 |
AM261x MCU+ SDK
10.02.00
|
|
Go to the documentation of this file.
58 #ifndef CB_LLD_ETHERNET_H
59 #define CB_LLD_ETHERNET_H
61 #include <sys/types.h>
70 #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
84 #define MAX_NUMBER_ENET_DEVS LLDENET_MAX_PORTS
86 #define CB_SOCKET_VALID(x) ((x)!=NULL)
87 #define CB_SOCKET_INVALID_VALUE NULL
88 #define CB_SOCKET_T lld_socket_t*
89 #define CB_ETHHDR_T struct lld_ethhdr
90 #define CB_SOCKADDR_LL_T struct lld_sockaddr
91 #define CB_SOCKADDR_T struct lld_sockaddr
92 #define CB_SOCK_SENDTO cb_lld_sendto
93 #define CB_SOCK_CLOSE cb_rawsock_close
96 #define CB_CLOSE close
97 #define CB_WRITE write
100 #define CB_IN_ADDR_T void*
108 #define ETH_DATA_LEN 1500
110 #define ETH_P_8021Q 0x8100
111 #define ETH_P_1588 0x88F7
112 #define ETH_P_LLDP 0x88CC
113 #define ETH_P_TSN 0x22F0
114 #define ETH_P_NETLINK 0x22F1
116 #define CB_MAX_NETDEVNAME 16
118 #define MKPIPE(x) (-1)
120 #define CB_LLD_MAX_ETH_FRAME_SIZE (1522U)
252 void (*rxDefaultDataCb)(
void *data,
int size,
int port,
void *cbArg);
265 #define CB_TILLD_STATS_BLOCK_ELEM_NUM (128U)
266 typedef struct cb_tilld_port_stats {
297 uint32_t enet_type, uint32_t instance_id,
392 void (*default_rxdata_cb)(
void *data,
int size,
int port,
void *arg),
void *arg);
466 #endif //CB_LLD_ETHERNET_H
int cb_lld_get_port_stats(CB_SOCKET_T sfd, int port, cb_tilld_port_stats_t *stats)
Get stats info from host or mac port.
int cb_lld_sendto(CB_SOCKET_T sfd, void *sdata, int psize, int flags, const CB_SOCKADDR_LL_T *addr, int addrsize)
Send a TX ethernet L2 packet.
int cb_lld_recv_zerocopy(CB_SOCKET_T sfd, LLDEnetRecvCb_t cblld_recv_cb, void *cbarg)
Receive a RX ethernet L2 packet n the zero-copy way. This should be called after a rxnotify_cb is inv...
Structure representing the lld_ethdev instance.
Definition: cb_lld_ethernet.h:171
TI Ethernet Low Level Driver abstract APIs.
int dmaRxShared
Definition: cb_lld_ethernet.h:241
int dmaTxChId
Definition: cb_lld_ethernet.h:224
int cb_lld_init_devs_table(lld_ethdev_t *ethdevs, uint32_t ndevs, uint32_t enet_type, uint32_t instance_id, const LLDTsyncTsSource tsSource)
Initialize a LLD device table.
uint16_t h_proto
Definition: cb_lld_ethernet.h:137
struct lld_socket lld_socket_t
Structure representing the lld_socket instance.
Definition: cb_lld_ethernet.h:166
uint8_t h_source[ETH_ALEN]
Definition: cb_lld_ethernet.h:133
void(* LLDEnetRecvCb_t)(LLDEnetFrame_t *frame, void *cbArg)
Receives callback an Ethernet frame using LLDEnet in the Zero-Copy way.
Definition: lldenet.h:337
unsigned char sll_addr[6]
Definition: cb_lld_ethernet.h:147
int macport
Definition: cb_lld_ethernet.h:151
int cb_lld_netdev_to_macport(const char *netdev)
Convert net device name to mac port.
int cb_lld_recv(CB_SOCKET_T sfd, void *buf, int size, CB_SOCKADDR_LL_T *addr, int addrsize)
Receive a RX ethernet L2 packet. This should be called after a rxnotify_cb is invoked.
int numRxChannels
Definition: cb_lld_ethernet.h:261
char * netdev
Definition: cb_lld_ethernet.h:175
void * rxDefaultCbArg
Definition: cb_lld_ethernet.h:257
int cb_socket_set_lldcfg_update_cb(cb_socket_lldcfg_update_cb_t lldcfg_update_cb)
This function sets the callback for updating LLD config parameters. It enables the user to update con...
uint16_t proto
Definition: cb_lld_ethernet.h:199
int tcid
Definition: cb_lld_ethernet.h:156
int cb_lld_get_type_instance(uint32_t *enet_type, uint32_t *instance_id)
Get enet type and instance that is set via cb_lld_init_devs_table()
struct lld_sockaddr __attribute__
This is the SecureBoot Stream type which holds the data for a specific bootloader to HSM call....
#define CB_SOCKADDR_LL_T
Definition: cb_lld_ethernet.h:90
int dmaRxOwner
Definition: cb_lld_ethernet.h:247
#define MAX_NUM_RX_DMA_CH_PER_INSTANCE
Definition: lldtype.h:114
uint8_t flags
Definition: hsmclient_msg.h:2
Structure representing an Ethernet frame.
Definition: lldenet.h:203
int(* cb_socket_lldcfg_update_cb_t)(cb_socket_lldcfg_update_t *update_cfg)
Callback function type for cb_socket_lldcfg_update.
Definition: cb_lld_ethernet.h:276
uint32_t pktSize
Definition: cb_lld_ethernet.h:219
Ethernet header structure.
Definition: cb_lld_ethernet.h:125
Definition: cb_lld_ethernet.h:266
int cb_lld_sendto_scatter(CB_SOCKET_T sfd, LLDEnetFrameScatter_t *frame, const CB_SOCKADDR_LL_T *addr)
Send a TX ethernet L2 packet in the scatter way.
uint32_t nTxPkts
Definition: cb_lld_ethernet.h:209
#define CB_TILLD_STATS_BLOCK_ELEM_NUM
Definition: cb_lld_ethernet.h:265
int cb_lld_process_status_frames(CB_SOCKET_T sfd)
process the Phy status frames.
uint8_t macport
Definition: cb_lld_ethernet.h:179
uint8_t h_dest[ETH_ALEN]
Definition: cb_lld_ethernet.h:129
int dmaTxShared
Definition: cb_lld_ethernet.h:235
int cb_lld_set_rxnotify_cb(CB_SOCKET_T sfd, void(*rxnotify_cb)(void *arg), void *arg)
Set the RX notify callback that is invoked when an RX packet is ready to be received.
int cb_lld_set_default_rxdata_cb(CB_SOCKET_T sfd, void(*default_rxdata_cb)(void *data, int size, int port, void *arg), void *arg)
Set the default RX data callback that is invoked when an RX packet does not match any filters.
int cb_lld_set_txnotify_cb(CB_SOCKET_T sfd, void(*txnotify_cb)(void *arg), void *arg)
Set the TX notify callback that is invoked when an TX packet is sent successfully.
Structure representing the cb_socket_lldcfg_update instance.
Definition: cb_lld_ethernet.h:189
#define ETH_ALEN
Definition: cb_lld_ethernet.h:106
int cb_lld_get_netdevs(char *netdevs[], int *len)
Get all virtual network interfaces which were defined for the TI platform.
uint16_t vlanid
Definition: cb_lld_ethernet.h:203
void cb_lld_reset_port_stats(CB_SOCKET_T sfd, int port)
reset stats info from host or mac port.
TI Timesync Low Level Driver abstract APIs.
LLDTsyncTsSource
Definition: lldtsync.h:76
uint64_t rxts
Definition: cb_lld_ethernet.h:160
int cb_lld_get_ts_source(LLDTsyncTsSource *tsSource)
Get Timestamp source that is set via cb_lld_init_devs_table()
Structure representing the lld_sockaddr instance.
Definition: cb_lld_ethernet.h:143
int cb_lld_get_link_state(CB_SOCKET_T cfd, const char *dev, uint32_t *linkstate)
get link state from device name like 'eth0'
const char * dev
Definition: cb_lld_ethernet.h:194
#define CB_SOCKET_T
Definition: cb_lld_ethernet.h:88
int cb_lld_get_link_info(CB_SOCKET_T cfd, const char *dev, uint32_t *speed, uint32_t *duplex)
get link info(speed and duplex) from device name like 'eth0'