Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "NVMeContext.hpp" |
| 4 | |
| 5 | #include <boost/asio/io_service.hpp> |
| 6 | #include <boost/asio/posix/stream_descriptor.hpp> |
| 7 | |
| 8 | class NVMeBasicContext : public NVMeContext |
| 9 | { |
| 10 | public: |
| 11 | NVMeBasicContext(boost::asio::io_service& io, int rootBus); |
Ed Tanous | 74cffa8 | 2022-01-25 13:00:28 -0800 | [diff] [blame] | 12 | ~NVMeBasicContext() override = default; |
| 13 | void pollNVMeDevices() override; |
Andrew Jeffery | b5d7a7f | 2022-05-02 11:57:03 +0930 | [diff] [blame^] | 14 | void readAndProcessNVMeSensor() override; |
Andrew Jeffery | 8c7074e | 2022-03-21 14:58:13 +1030 | [diff] [blame] | 15 | void processResponse(std::shared_ptr<NVMeSensor>& sensor, void* msg, |
| 16 | size_t len) override; |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 17 | |
| 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 Jeffery | 7aeb1a5 | 2022-03-15 22:49:04 +1030 | [diff] [blame] | 24 | |
| 25 | enum |
| 26 | { |
| 27 | NVME_MI_BASIC_SFLGS_DRIVE_NOT_READY = 0x40, |
| 28 | NVME_MI_BASIC_SFLGS_DRIVE_FUNCTIONAL = 0x20, |
| 29 | }; |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 30 | }; |