| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // WARNING: This file is machine generated by fidlc. |
| |
| #pragma once |
| |
| #include <ddk/protocol/ethernet.h> |
| #include <fbl/type_support.h> |
| |
| namespace ddk { |
| namespace internal { |
| |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_ifc_status, EthmacIfcStatus, |
| void (C::*)(uint32_t status)); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_ifc_recv, EthmacIfcRecv, |
| void (C::*)(const void* data_buffer, size_t data_size, |
| uint32_t flags)); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_ifc_complete_tx, EthmacIfcCompleteTx, |
| void (C::*)(ethmac_netbuf_t* netbuf, zx_status_t status)); |
| |
| template <typename D> |
| constexpr void CheckEthmacIfcSubclass() { |
| static_assert(internal::has_ethmac_ifc_status<D>::value, |
| "EthmacIfc subclasses must implement " |
| "void EthmacIfcStatus(uint32_t status"); |
| static_assert(internal::has_ethmac_ifc_recv<D>::value, |
| "EthmacIfc subclasses must implement " |
| "void EthmacIfcRecv(const void* data_buffer, size_t data_size, uint32_t flags"); |
| static_assert(internal::has_ethmac_ifc_complete_tx<D>::value, |
| "EthmacIfc subclasses must implement " |
| "void EthmacIfcCompleteTx(ethmac_netbuf_t* netbuf, zx_status_t status"); |
| } |
| |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_protocol_query, EthmacQuery, |
| zx_status_t (C::*)(uint32_t options, ethmac_info_t* out_info)); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_protocol_stop, EthmacStop, void (C::*)()); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_protocol_start, EthmacStart, |
| zx_status_t (C::*)(const ethmac_ifc_t* ifc)); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_protocol_queue_tx, EthmacQueueTx, |
| zx_status_t (C::*)(uint32_t options, ethmac_netbuf_t* netbuf)); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_protocol_set_param, EthmacSetParam, |
| zx_status_t (C::*)(uint32_t param, zx_status_t value, |
| const void* data_buffer, size_t data_size)); |
| DECLARE_HAS_MEMBER_FN_WITH_SIGNATURE(has_ethmac_protocol_get_bti, EthmacGetBti, |
| zx_handle_t (C::*)()); |
| |
| template <typename D> |
| constexpr void CheckEthmacProtocolSubclass() { |
| static_assert(internal::has_ethmac_protocol_query<D>::value, |
| "EthmacProtocol subclasses must implement " |
| "zx_status_t EthmacQuery(uint32_t options, ethmac_info_t* out_info"); |
| static_assert(internal::has_ethmac_protocol_stop<D>::value, |
| "EthmacProtocol subclasses must implement " |
| "void EthmacStop("); |
| static_assert(internal::has_ethmac_protocol_start<D>::value, |
| "EthmacProtocol subclasses must implement " |
| "zx_status_t EthmacStart(const ethmac_ifc_t* ifc"); |
| static_assert(internal::has_ethmac_protocol_queue_tx<D>::value, |
| "EthmacProtocol subclasses must implement " |
| "zx_status_t EthmacQueueTx(uint32_t options, ethmac_netbuf_t* netbuf"); |
| static_assert(internal::has_ethmac_protocol_set_param<D>::value, |
| "EthmacProtocol subclasses must implement " |
| "zx_status_t EthmacSetParam(uint32_t param, zx_status_t value, const void* " |
| "data_buffer, size_t data_size"); |
| static_assert(internal::has_ethmac_protocol_get_bti<D>::value, |
| "EthmacProtocol subclasses must implement " |
| "zx_handle_t EthmacGetBti("); |
| } |
| |
| } // namespace internal |
| } // namespace ddk |