#ifdef CYGINT_IO_ETH_INT_SUPPORT_REQUIRED
// Initialize environment, setup interrupt handler
cyg_drv_interrupt_create(cpd->interrupt,
- 0, // Priority - what goes here?
+ cpd->priority,
(cyg_addrword_t)cpd, // Data item passed to interrupt handler
(cyg_ISR_t *)cs8900a_isr,
(cyg_DSR_t *)cs8900a_dsr,
cyg_uint16 saved_data = 0, *sdata;
cyg_uint16 stat;
bool odd_byte = false;
- int timeout = 50000;
// Mark xmitter busy
cpd->txbusy = true;
HAL_WRITE_UINT16(cpd->base+CS8900A_TxLEN, total_len);
// Wait for controller ready signal
- do {
- stat = get_reg(base, PP_BusStat);
- if (timeout-- < 0) {
+ {
+ // add timeout per cs8900a bugzilla report 1000281 */
+ int timeout = 1000;
+
+ do {
+ stat = get_reg(base, PP_BusStat);
+#if DEBUG & 1
+ if( stat & PP_BusStat_TxBid )
+ diag_printf( "cs8900a_send: Bid error!\n" );
+#endif
+ } while (!(stat & PP_BusStat_TxRDY) && --timeout);
+
+ if( !timeout ) {
+ // we might as well just return, since if we write the data it will
+ // just get thrown away
+ diag_printf("if_cs8900a.c: PP_BusStat_TXRDY is not set. Cannot transmit packet\n");
return;
}
- } while (!(stat & PP_BusStat_TxRDY));
-
- if (timeout < 0) {
- diag_printf("if_cs8900a.c: PP_BusStat_TXRDY is not set. Cannot transmit packet\n");
- return;
}
+
// Put data into buffer
for (i = 0; i < sg_len; i++) {
data = (cyg_uint8 *)sg_list[i].buf;