blob: ec7a0b10896e379d8ef795a7bb203be97a3fd65b [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 Jefferyb5d7a7f2022-05-02 11:57:03 +093014 void readAndProcessNVMeSensor() override;
Andrew Jeffery8c7074e2022-03-21 14:58:13 +103015 void processResponse(std::shared_ptr<NVMeSensor>& sensor, void* msg,
16 size_t len) override;
Andrew Jefferye3e3c972021-05-26 14:37:07 +093017
18 private:
19 NVMeBasicContext(boost::asio::io_service& io, int rootBus, int cmdOut,
20 int streamIn, int streamOut, int cmdIn);
21 boost::asio::io_service& io;
22 boost::asio::posix::stream_descriptor reqStream;
23 boost::asio::posix::stream_descriptor respStream;
Andrew Jeffery7aeb1a52022-03-15 22:49:04 +103024
25 enum
26 {
27 NVME_MI_BASIC_SFLGS_DRIVE_NOT_READY = 0x40,
28 NVME_MI_BASIC_SFLGS_DRIVE_FUNCTIONAL = 0x20,
29 };
Andrew Jefferye3e3c972021-05-26 14:37:07 +093030};