Lines Matching defs:UsbFfsConnection
143 struct UsbFfsConnection : public Connection { struct
144 UsbFfsConnection(unique_fd control, unique_fd read, unique_fd write, in UsbFfsConnection() function
166 ~UsbFfsConnection() { in ~UsbFfsConnection() argument
181 virtual bool Write(std::unique_ptr<apacket> packet) override final { in Write()
226 PLOG(FATAL) << "failed to notify worker eventfd to stop UsbFfsConnection"; in Stop() argument
252 // eventually result in the transport being destroyed, which will result in UsbFfsConnection in StartMonitor() argument
400 void StartWorker() { in StartWorker()
431 void StopWorker() { in StopWorker()
459 void PrepareReadBlock(IoReadBlock* block, uint64_t id) { in PrepareReadBlock()
471 IoReadBlock CreateReadBlock(uint64_t id) { in CreateReadBlock()
484 void ReadEvents() { in ReadEvents()
531 bool HandleRead(TransferId id, int64_t size) { in HandleRead()
559 bool ProcessRead(IoReadBlock* block) { in ProcessRead()
605 bool SubmitRead(IoReadBlock* block) { in SubmitRead()
616 void HandleWrite(TransferId id) { in HandleWrite()
629 IoWriteBlock CreateWriteBlock(std::shared_ptr<Block> payload, size_t offset, size_t len, in CreateWriteBlock()
646 IoWriteBlock CreateWriteBlock(Block&& payload, uint64_t id) { in CreateWriteBlock()
651 void SubmitWrites() REQUIRES(write_mutex_) { in SubmitWrites()
683 void CancelWrites() { in CancelWrites()
694 void HandleError(const std::string& error) { in HandleError()
706 std::thread monitor_thread_;
708 bool worker_started_;
709 std::thread worker_thread_;
711 std::atomic<bool> stopped_;
712 std::promise<void> destruction_notifier_;
713 std::once_flag error_flag_;
715 unique_fd worker_event_fd_;
716 unique_fd monitor_event_fd_;
718 ScopedAioContext aio_context_;
719 unique_fd control_fd_;
720 unique_fd read_fd_;
721 unique_fd write_fd_;
723 bool connection_started_ = false;
724 std::optional<amessage> incoming_header_;
725 IOVector incoming_payload_;
727 std::array<IoReadBlock, kUsbReadQueueDepth> read_requests_;
728 IOVector read_data_;
731 size_t next_read_id_ = 0;
734 size_t needed_read_id_ = 0;
736 std::mutex write_mutex_;
741 static constexpr int kInterruptionSignal = SIGUSR1;