80 #define MAX(a,b) (((a) > (b)) ? (a) : (b)) 81 #define MIN(a,b) (((a) < (b)) ? (a) : (b)) 104 #define RX_PRIM priMAC[1] 106 #define RX_SEC secMAC[1] 283 stack = &(port->
stack);
319 datagramP->index = idx;
346 stack = &(port->
stack);
356 return (bytesrx > 0);
387 stack = &(port->
stack);
394 rxbuf = &(*stack->
rxbuf)[idx];
398 l = (*rxbuf)[0] + ((
uint16)((*rxbuf)[1] & 0x0f) << 8);
400 rval = ((*rxbuf)[l] + ((
uint16)(*rxbuf)[l + 1] << 8));
416 l =
etohs(ecp->elength) & 0x0fff;
424 rval = ((*rxbuf)[l] + ((
uint16)((*rxbuf)[l + 1]) << 8));
435 rxbuf = &(*stack->
rxbuf)[idxf];
503 primrx = port->
rxsa[idx];
521 if ( ((primrx == 0) && (secrx ==
RX_SEC)) ||
618 int ec_setupnic(
const char *ifname,
int secondary)
623 int ec_closenic(
void)
628 int ec_getindex(
void)
633 void ec_setbufstat(
int idx,
int bufstat)
638 int ec_outframe(
int idx,
int stacknumber)
643 int ec_outframe_red(
int idx)
648 int ec_inframe(
int idx,
int stacknumber)
653 int ec_waitinframe(
int idx,
int timeout)
658 int ec_srconfirm(
int idx,
int timeout)
int txbuflength[EC_MAXBUF]
int ecx_outframe_red(ecx_portt *port, int idx)
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
int bfin_EMAC_recv(uint8_t *packet, size_t size)
int(* txbuflength)[EC_MAXBUF]
uint16 oshw_ntohs(uint16 networkshort)
PACKED_BEGIN struct PACKED ec_etherheadert
void ec_setupheader(void *p)
static int ecx_recvpkt(ecx_portt *port, int stacknumber)
int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
boolean osal_timer_is_expired(osal_timert *self)
int bfin_EMAC_init(uint8_t *enetaddr)
int bfin_EMAC_send(void *packet, int length)
ec_bufT(* rxbuf)[EC_MAXBUF]
int ecx_closenic(ecx_portt *port)
ec_bufT(* txbuf)[EC_MAXBUF]
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
PACKED_BEGIN struct PACKED ec_comt
int ecx_getindex(ecx_portt *port)
void osal_timer_start(osal_timert *self, uint32 timeout_us)
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
pthread_mutex_t getindex_mutex
uint8 ec_bufT[EC_BUFSIZE]
static int ecx_waitinframe_red(ecx_portt *port, int idx, const osal_timert timer)
int(* rxbufstat)[EC_MAXBUF]
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
uint16 oshw_htons(uint16 hostshort)