diff options
Diffstat (limited to 'os/hal/templates/mac_lld.h')
-rw-r--r-- | os/hal/templates/mac_lld.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/os/hal/templates/mac_lld.h b/os/hal/templates/mac_lld.h index 786cc7772..cb6a6cd8b 100644 --- a/os/hal/templates/mac_lld.h +++ b/os/hal/templates/mac_lld.h @@ -35,6 +35,11 @@ /* Driver constants. */
/*===========================================================================*/
+/**
+ * @brief This implementation supports the zero-copy mode API.
+ */
+#define MAC_SUPPORTS_ZERO_COPY TRUE
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -94,11 +99,11 @@ typedef struct { /**
* @brief Current write offset.
*/
- size_t offset;
+ size_t offset;
/**
* @brief Available space size.
*/
- size_t size;
+ size_t size;
/* End of the mandatory fields.*/
} MACTransmitDescriptor;
@@ -126,7 +131,7 @@ typedef struct { /*===========================================================================*/
#if !defined(__DOXYGEN__)
-extern MACDriver ETH1;
+extern MACDriver ETHD1;
#endif
#ifdef __cplusplus
@@ -137,17 +142,24 @@ extern "C" { void mac_lld_stop(MACDriver *macp);
msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp);
- size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
- uint8_t *buf,
- size_t size);
void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp);
msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp);
+ void mac_lld_release_receive_descriptor(MACReceiveDescriptor *rdp);
+ bool_t mac_lld_poll_link_status(MACDriver *macp);
+ size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
+ uint8_t *buf,
+ size_t size);
size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
uint8_t *buf,
size_t size);
- void mac_lld_release_receive_descriptor(MACReceiveDescriptor *rdp);
- bool_t mac_lld_poll_link_status(MACDriver *macp);
+#if MAC_USE_ZERO_COPY
+ uint8_t *mac_lld_get_next_transmit_buffer(MACTransmitDescriptor *tdp,
+ size_t size,
+ size_t *sizep);
+ const uint8_t *mac_lld_get_next_receive_buffer(MACReceiveDescriptor *rdp,
+ size_t *sizep);
+#endif /* MAC_USE_ZERO_COPY */
#ifdef __cplusplus
}
#endif
|