#define IEEE_802_3_MAC_INTERFACE "ieee_802_3_mac" SIM_INTERFACE(ieee_802_3_mac) { int (*receive_frame)(conf_object_t *obj, int phy, dbuffer_t *buf, int crc_ok); void (*tx_bandwidth_available)(conf_object_t *obj, int phy); void (*link_status_changed)(conf_object_t *obj, int phy, ieee_802_3_link_status_t status); };
typedef enum { IEEE_link_unconnected, IEEE_link_down, IEEE_link_up } ieee_802_3_link_status_t;
Deprecated; use ieee_802_3_mac_v3
instead.
Interface that should be implemented by 802.3 media access control layers.
The receive_frame function is called when a frame has
been received by the phy. The frame is passed as a
dbuffer_t
that may not be modified without
cloning it first. The return value have no meaning, callers should
ignore it, and new implementations should return 0.
The tx_bandwidth_available is called by the PHY when a
previous call to send_frame or check_tx_bandwidth
in the ieee_802_3_phy
interface have returned no bandwidth
available.
link_status_changed is called when the phy detects a change of the link status.
The phy parameter is a number that identifies this particular PHY, in configurations with several PHYs connected to the same MAC.