ieee_802_3_phy ieee_802_3_phy_v3
API Reference Manual  /  4 Model-to-Model Interfaces  / 

ieee_802_3_phy_v2

Description
#define IEEE_802_3_PHY_V2_INTERFACE "ieee_802_3_phy_v2"
SIM_INTERFACE(ieee_802_3_phy_v2) {
        int (*send_frame)(conf_object_t *obj, dbuffer_t *buf, int replace_crc);
        int (*check_tx_bandwidth)(conf_object_t *obj);
        void (*add_mac)(conf_object_t *obj, byte_string_t mac);
        void (*del_mac)(conf_object_t *obj, byte_string_t mac);
        void (*add_mac_mask)(conf_object_t *obj, byte_string_t mac,
                             byte_string_t mask);
        void (*del_mac_mask)(conf_object_t *obj, byte_string_t mac,
                             byte_string_t mask);
        void (*set_promiscous_mode)(conf_object_t *obj, int enable);
};

Deprecated; use ieee_802_3_phy_v3 instead.

Interface that should be implemented by 802.3 physical layers.

The send_frame function is used by a device to send an Ethernet frame. The frame should be a dbuffer_t containing a complete Ethernet frame. excluding the preamble and SFD, but including the CRC. The replace_crc flag indicates whether the CRC is not actually calculated yet. The passed buf should not be modified by the called function. If the function return 0, the frame was sent to the link; In case -1 is returned, there was not enough bandwidth available right now, and the frame could not be sent. The PHY should call the tx_bandwidth_available in the ieee_802_3_mac interface at the MAC, when the frame can be sent.

The check_tx_bandwidth can also be used to check that there is bandwidth available, without sending a frame. It returns 0 if there is no bandwidth available, and a positive value if the frame can be sent right away.

add_mac, del_mac and set_promiscous_mode have the same functionality as the equivalent functions in ethernet_link interface. They do nothing if the PHY is connected to the new-style links using the ethernet_common interface.

The word "promiscuous" is misspelled in the interface.

Execution Context
Cell Context for all methods.

ieee_802_3_phy ieee_802_3_phy_v3