// SPDX-License-Identifier: MIT /** Copyright (c) 2021 - 2022 Beckhoff Automation GmbH & Co. KG */ #pragma once #include "AdsDevice.h" #include namespace Beckhoff { namespace Ads { struct RouterAccess { RouterAccess(const std::string& gw, AmsNetId netid, uint16_t port); bool PciScan(uint64_t pci_id, std::ostream& os) const; private: AdsDevice device; }; struct SearchPciBusReq { SearchPciBusReq(const uint64_t quad) : leVendorID(Beckhoff::htole(static_cast(quad >> 48))) , leDeviceID(Beckhoff::htole(static_cast(quad >> 32))) , leSubVendorID(Beckhoff::htole(static_cast(quad >> 16))) , leSubSystemID(Beckhoff::htole(static_cast(quad))) {} private: const uint16_t leVendorID; const uint16_t leDeviceID; const uint16_t leSubVendorID; const uint16_t leSubSystemID; }; struct SearchPciSlotResNew { static constexpr size_t MAXBASEADDRESSES = 6; std::array leBaseAddresses; uint32_t leSize[MAXBASEADDRESSES]; uint32_t leBusNumber; uint32_t leSlotNumber; uint16_t leBoardIrq; uint16_t lePciRegViaPorts; }; struct SearchPciBusResNew { static constexpr size_t MAXSLOTRESPONSE = 64; uint32_t leFound; std::array slot; uint32_t nFound() const { return Beckhoff::letoh(leFound); } }; } }