blob: 6953dd78465399e15c54da2045aa0af9b8080758 [file] [log] [blame]
Andrew Jefferye3e3c972021-05-26 14:37:07 +09301#pragma once
2
3#include "NVMeContext.hpp"
4
5#include <boost/asio/io_service.hpp>
6#include <boost/asio/posix/stream_descriptor.hpp>
7
8class NVMeBasicContext : public NVMeContext
9{
10 public:
11 NVMeBasicContext(boost::asio::io_service& io, int rootBus);
Ed Tanous74cffa82022-01-25 13:00:28 -080012 ~NVMeBasicContext() override = default;
13 void pollNVMeDevices() override;
Andrew Jeffery8c7074e2022-03-21 14:58:13 +103014 void readAndProcessNVMeSensor(
15 std::list<std::shared_ptr<NVMeSensor>>::iterator iter) override;
16 void processResponse(std::shared_ptr<NVMeSensor>& sensor, void* msg,
17 size_t len) override;
Andrew Jefferye3e3c972021-05-26 14:37:07 +093018
19 private:
20 NVMeBasicContext(boost::asio::io_service& io, int rootBus, int cmdOut,
21 int streamIn, int streamOut, int cmdIn);
22 boost::asio::io_service& io;
23 boost::asio::posix::stream_descriptor reqStream;
24 boost::asio::posix::stream_descriptor respStream;
Andrew Jeffery7aeb1a52022-03-15 22:49:04 +103025
26 enum
27 {
28 NVME_MI_BASIC_SFLGS_DRIVE_NOT_READY = 0x40,
29 NVME_MI_BASIC_SFLGS_DRIVE_FUNCTIONAL = 0x20,
30 };
Andrew Jefferye3e3c972021-05-26 14:37:07 +093031};