708 |
return NULL; |
return NULL; |
709 |
} |
} |
710 |
|
|
711 |
|
/* Trigger/clear Ethernet interrupt if one or both port have pending events */ |
712 |
|
static void gt_eth_set_int_status(struct gt_data *d) |
713 |
|
{ |
714 |
|
if ((d->eth_ports[0].icr & GT_ICR_INT_SUM) || |
715 |
|
(d->eth_ports[1].icr & GT_ICR_INT_SUM)) |
716 |
|
vm_set_irq(d->vm,d->eth_irq); |
717 |
|
else |
718 |
|
vm_clear_irq(d->vm,d->eth_irq); |
719 |
|
} |
720 |
|
|
721 |
/* Update the Ethernet port interrupt status */ |
/* Update the Ethernet port interrupt status */ |
722 |
static void gt_eth_update_int_status(struct gt_data *d,struct eth_port *port) |
static void gt_eth_update_int_status(struct gt_data *d,struct eth_port *port) |
723 |
{ |
{ |
724 |
if (port->icr & port->imr & GT_ICR_MASK) { |
if (port->icr & port->imr & GT_ICR_MASK) { |
725 |
port->icr |= GT_ICR_INT_SUM; |
port->icr |= GT_ICR_INT_SUM; |
|
vm_set_irq(d->vm,d->eth_irq); |
|
726 |
} else { |
} else { |
727 |
port->icr &= ~GT_ICR_INT_SUM; |
port->icr &= ~GT_ICR_INT_SUM; |
|
vm_clear_irq(d->vm,d->eth_irq); |
|
728 |
} |
} |
729 |
|
|
730 |
|
gt_eth_set_int_status(d); |
731 |
} |
} |
732 |
|
|
733 |
/* Read a MII register */ |
/* Read a MII register */ |
1299 |
tx_start = tx_current = port->tx_current[queue]; |
tx_start = tx_current = port->tx_current[queue]; |
1300 |
|
|
1301 |
if (!tx_start) |
if (!tx_start) |
1302 |
goto done; |
return(FALSE); |
1303 |
|
|
1304 |
ptxd = &txd0; |
ptxd = &txd0; |
1305 |
gt_eth_desc_read(d,tx_start,ptxd); |
gt_eth_desc_read(d,tx_start,ptxd); |
1306 |
|
|
1307 |
/* If we don't own the first descriptor, we cannot transmit */ |
/* If we don't own the first descriptor, we cannot transmit */ |
1308 |
if (!(txd0.cmd_stat & GT_TXDESC_OWN)) |
if (!(txd0.cmd_stat & GT_TXDESC_OWN)) |
1309 |
goto done; |
return(FALSE); |
1310 |
|
|
1311 |
/* Empty packet for now */ |
/* Empty packet for now */ |
1312 |
pkt_ptr = pkt; |
pkt_ptr = pkt; |
1379 |
else |
else |
1380 |
port->icr |= GT_ICR_TXBUFH; |
port->icr |= GT_ICR_TXBUFH; |
1381 |
|
|
|
done: |
|
1382 |
if (abort) { |
if (abort) { |
1383 |
/* TX underrun */ |
/* TX underrun */ |
1384 |
port->icr |= GT_ICR_TXUDR; |
port->icr |= GT_ICR_TXUDR; |