|
AM64x MCU+ SDK
09.02.01
|
|
Go to the documentation of this file.
57 #ifndef CB_LLD_ETHERNET_H
58 #define CB_LLD_ETHERNET_H
60 #include <sys/types.h>
82 #define MAX_NUMBER_ENET_DEVS LLDENET_MAX_PORTS
84 #define CB_SOCKET_VALID(x) ((x)!=NULL)
85 #define CB_SOCKET_INVALID_VALUE NULL
86 #define CB_SOCKET_T lld_socket_t*
87 #define CB_ETHHDR_T struct ethhdr
88 #define CB_SOCKADDR_LL_T struct sockaddr
89 #define CB_SOCKADDR_T struct sockaddr
90 #define CB_SOCK_SENDTO cb_lld_sendto
91 #define CB_SOCK_CLOSE cb_rawsock_close
94 #define CB_CLOSE close
95 #define CB_WRITE write
98 #define CB_IN_ADDR_T void*
106 #define ETH_DATA_LEN 1500
108 #define ETH_P_8021Q 0x8100
109 #define ETH_P_1588 0x88F7
110 #define ETH_P_LLDP 0x88CC
111 #define ETH_P_TSN 0x22F0
112 #define ETH_P_NETLINK 0x22F1
114 #define CB_MAX_NETDEVNAME IFNAMSIZ
116 #define MKPIPE(x) (-1)
118 #define CB_LLD_MAX_ETH_FRAME_SIZE (1522U)
254 void (*rxDefaultDataCb)(
void *
data,
int size,
int port,
void *cbArg);
267 #define CB_TILLD_STATS_BLOCK_ELEM_NUM (128U)
268 typedef struct cb_tilld_port_stats {
298 uint32_t enet_type, uint32_t instance_id);
385 void (*default_rxdata_cb)(
void *
data,
int size,
int port,
void *arg),
void *arg);
445 #endif //CB_LLD_ETHERNET_H
uint8_t h_dest[ETH_ALEN]
Definition: cb_lld_ethernet.h:127
unsigned char sll_addr[6]
Definition: cb_lld_ethernet.h:145
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.
uint16_t size
Definition: tisci_boardcfg.h:1
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.
uint16_t h_proto
Definition: cb_lld_ethernet.h:135
Structure representing the lld_ethdev instance.
Definition: cb_lld_ethernet.h:169
TI Ethernet Low Level Driver abstract APIs.
int dmaRxShared
Definition: cb_lld_ethernet.h:243
int dmaTxChId
Definition: cb_lld_ethernet.h:222
int cb_lld_recv_zerocopy(CB_SOCKET_T sfd, cb_lld_zerocopy_recv_cb_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...
struct lld_socket lld_socket_t
Structure representing the lld_socket instance.
Definition: cb_lld_ethernet.h:164
uint64_t rxts
Definition: cb_lld_ethernet.h:158
Ethernet header structure.
Definition: cb_lld_ethernet.h:123
uint32_t data
Definition: tisci_rm_psil.h:1
int cb_lld_netdev_to_macport(const char *netdev)
Convert net device name to mac port.
uint64_t addr
Definition: csl_udmap_tr.h:3
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.
Structure representing the lld_sockaddr instance.
Definition: cb_lld_ethernet.h:141
char * netdev
Definition: cb_lld_ethernet.h:173
void * rxDefaultCbArg
Definition: cb_lld_ethernet.h:259
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:197
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()
uint8_t h_source[ETH_ALEN]
Definition: cb_lld_ethernet.h:131
#define CB_SOCKADDR_LL_T
Definition: cb_lld_ethernet.h:88
int dmaRxOwner
Definition: cb_lld_ethernet.h:249
#define MAX_NUM_RX_DMA_CH_PER_INSTANCE
Definition: lldtype.h:114
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:278
uint32_t pktSize
Definition: cb_lld_ethernet.h:217
Definition: cb_lld_ethernet.h:268
uint32_t nTxPkts
Definition: cb_lld_ethernet.h:207
struct sockaddr __attribute__
#define CB_TILLD_STATS_BLOCK_ELEM_NUM
Definition: cb_lld_ethernet.h:267
uint8_t macport
Definition: cb_lld_ethernet.h:177
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_init_devs_table(lld_ethdev_t *ethdevs, uint32_t ndevs, uint32_t enet_type, uint32_t instance_id)
Initialize a LLD device table.
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:187
int unusedDmaTx
Definition: cb_lld_ethernet.h:237
#define ETH_ALEN
Definition: cb_lld_ethernet.h:104
int cb_lld_get_netdevs(char *netdevs[], int *len)
Get all virtual network interfaces which were defined for the TI platform.
int macport
Definition: cb_lld_ethernet.h:149
void(* cb_lld_zerocopy_recv_cb_t)(void *buf, int size, CB_SOCKADDR_LL_T *addr, void *cbarg)
Definition: cb_lld_ethernet.h:343
uint16_t vlanid
Definition: cb_lld_ethernet.h:201
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.
uint32_t flags
Definition: csl_udmap_tr.h:0
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:192
uint32_t numRxChannels
Definition: cb_lld_ethernet.h:263
#define CB_SOCKET_T
Definition: cb_lld_ethernet.h:86
int tcid
Definition: cb_lld_ethernet.h:154
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'
int unusedDmaRx
Definition: cb_lld_ethernet.h:232