|
AM243x MCU+ SDK
09.01.00
|
|
Go to the documentation of this file.
57 #ifndef CB_LLD_ETHERNET_H
58 #define CB_LLD_ETHERNET_H
60 #include <sys/types.h>
84 #define ECONNREFUSED 100
86 #define MAX_NUMBER_ENET_DEVS LLDENET_MAX_PORTS
88 #define CB_SOCKET_VALID(x) ((x)!=NULL)
89 #define CB_SOCKET_INVALID_VALUE NULL
90 #define CB_SOCKET_T lld_socket_t*
91 #define CB_ETHHDR_T struct ethhdr
92 #define CB_SOCKADDR_LL_T struct sockaddr
93 #define CB_SOCK_SENDTO cb_lld_sendto
94 #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 IFNAMSIZ
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);
290 uint32_t enet_type, uint32_t instance_id);
362 void (*default_rxdata_cb)(
void *
data,
int size,
int port,
void *arg),
void *arg);
411 #endif //CB_LLD_ETHERNET_H
uint8_t h_dest[ETH_ALEN]
Definition: cb_lld_ethernet.h:129
unsigned char sll_addr[6]
Definition: cb_lld_ethernet.h:147
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:137
Structure representing the lld_ethdev instance.
Definition: cb_lld_ethernet.h:167
TI Ethernet Low Level Driver abstract APIs.
int dmaRxShared
Definition: cb_lld_ethernet.h:241
int dmaTxChId
Definition: cb_lld_ethernet.h:220
struct lld_socket lld_socket_t
Structure representing the lld_socket instance.
Definition: cb_lld_ethernet.h:162
Ethernet header structure.
Definition: cb_lld_ethernet.h:125
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
Structure representing the lld_sockaddr instance.
Definition: cb_lld_ethernet.h:143
char * netdev
Definition: cb_lld_ethernet.h:171
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:195
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:133
#define CB_SOCKADDR_LL_T
Definition: cb_lld_ethernet.h:92
int dmaRxOwner
Definition: cb_lld_ethernet.h:247
#define MAX_NUM_RX_DMA_CH_PER_INSTANCE
Definition: lldenet.h:66
int cb_lld_recv(CB_SOCKET_T sfd, void *buf, int size, int *port)
Receive a RX ethernet L2 packet. This should be called after a rxnotify_cb is invoked.
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:270
uint32_t pktSize
Definition: cb_lld_ethernet.h:215
uint32_t nTxPkts
Definition: cb_lld_ethernet.h:205
struct sockaddr __attribute__
uint8_t macport
Definition: cb_lld_ethernet.h:175
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:185
int unusedDmaTx
Definition: cb_lld_ethernet.h:235
#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.
int macport
Definition: cb_lld_ethernet.h:151
uint16_t vlanid
Definition: cb_lld_ethernet.h:199
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:190
uint32_t numRxChannels
Definition: cb_lld_ethernet.h:261
bool cb_lld_is_rxts_inbuff(CB_SOCKET_T sfd)
Checks the receive packet timestamping mode.
#define CB_SOCKET_T
Definition: cb_lld_ethernet.h:90
int tcid
Definition: cb_lld_ethernet.h:156
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:230