PebbleOS v4.47.0-1312-gf1984a001
Loading...
Searching...
No Matches
pbl_eth_ops Struct Reference

Ethernet driver operations, called with the device lock held. More...

#include <ethernet.h>

Data Fields

uint32_t caps
 PBL_ETH_CAP_* offloads the controller does.
 
int(* init )(const struct pbl_eth *eth, const uint8_t addr[PBL_ETH_ADDR_LEN])
 Set the controller up, stopped, with the MAC address addr.
 
int(* start )(const struct pbl_eth *eth)
 Start receiving and sending.
 
int(* stop )(const struct pbl_eth *eth)
 Stop receiving and sending, dropping the frames in flight.
 
int(* adjust_link )(const struct pbl_eth *eth, const struct pbl_net_phy_link *link)
 Match the speed and duplex of a link that came up.
 
int(* send )(const struct pbl_eth *eth, const struct pbl_eth_buf *bufs, size_t num_bufs, size_t len, uint32_t flags)
 Queue the frame gathered from bufs, len bytes in all, between PBL_ETH_HDR_LEN and PBL_ETH_FRAME_MAX, with PBL_ETH_TX_* flags the controller has the capabilities of.
 
int(* recv )(const struct pbl_eth *eth, void *buf, size_t len)
 Copy the next good received frame into buf.
 
int(* set_filter )(const struct pbl_eth *eth, uint32_t flags, const uint8_t(*mcast)[PBL_ETH_ADDR_LEN], size_t num_mcast)
 Receive frames to the MAC address, broadcast and the num_mcast multicast addresses, or more as PBL_ETH_FILTER_* flags say; a controller may let other multicast frames through.
 

Detailed Description

Ethernet driver operations, called with the device lock held.

Field Documentation

◆ adjust_link

int(* pbl_eth_ops::adjust_link) (const struct pbl_eth *eth, const struct pbl_net_phy_link *link)

Match the speed and duplex of a link that came up.

Returns 0 or a negative errno.

◆ caps

uint32_t pbl_eth_ops::caps

PBL_ETH_CAP_* offloads the controller does.

◆ init

int(* pbl_eth_ops::init) (const struct pbl_eth *eth, const uint8_t addr[PBL_ETH_ADDR_LEN])

Set the controller up, stopped, with the MAC address addr.

Returns 0 or a negative errno.

◆ recv

int(* pbl_eth_ops::recv) (const struct pbl_eth *eth, void *buf, size_t len)

Copy the next good received frame into buf.

Returns its length, -EAGAIN without one, or -EMSGSIZE if it does not fit, dropping it.

◆ send

int(* pbl_eth_ops::send) (const struct pbl_eth *eth, const struct pbl_eth_buf *bufs, size_t num_bufs, size_t len, uint32_t flags)

Queue the frame gathered from bufs, len bytes in all, between PBL_ETH_HDR_LEN and PBL_ETH_FRAME_MAX, with PBL_ETH_TX_* flags the controller has the capabilities of.

Returns 0 or -ENOBUFS while there is no room.

◆ set_filter

int(* pbl_eth_ops::set_filter) (const struct pbl_eth *eth, uint32_t flags, const uint8_t(*mcast)[PBL_ETH_ADDR_LEN], size_t num_mcast)

Receive frames to the MAC address, broadcast and the num_mcast multicast addresses, or more as PBL_ETH_FILTER_* flags say; a controller may let other multicast frames through.

Returns 0 or a negative errno.

◆ start

int(* pbl_eth_ops::start) (const struct pbl_eth *eth)

Start receiving and sending.

Returns 0 or a negative errno.

◆ stop

int(* pbl_eth_ops::stop) (const struct pbl_eth *eth)

Stop receiving and sending, dropping the frames in flight.

Returns 0 or a negative errno.


The documentation for this struct was generated from the following file: