blob: 2594f090fa5111597dabcbfd704ad6c3692ec775 [file] [log] [blame]
Patrick Venture1cde5f92018-11-07 08:26:47 -08001#pragma once
2
3#include "data_handler.hpp"
4
5#include <cstdint>
6#include <vector>
7
8namespace blobs
9{
10
Patrick Venture8c535332018-11-08 15:58:00 -080011/** P2A configuration response. */
12struct PciConfigResponse
13{
14 std::uint32_t address;
15} __attribute__((packed));
16
17/**
18 * Data handler for reading and writing data via the P2A bridge.
19 */
Patrick Venture1cde5f92018-11-07 08:26:47 -080020class PciDataHandler : public DataInterface
21{
Patrick Venture1cde5f92018-11-07 08:26:47 -080022 public:
23 PciDataHandler() = default;
24
25 std::vector<std::uint8_t> copyFrom(std::uint32_t length) override;
Patrick Venture8c535332018-11-08 15:58:00 -080026 bool write(const std::vector<std::uint8_t>& configuration) override;
27 std::vector<std::uint8_t> read() override;
Patrick Venture1cde5f92018-11-07 08:26:47 -080028};
29
30} // namespace blobs