[tg3] Fix driver for BCM5719, BCM5720, BCM5764M, BCM57762

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Kevin Tran
2012-08-20 18:48:50 +01:00
committed by Michael Brown
parent 8f7cd88af5
commit a05871d89a
4 changed files with 29 additions and 19 deletions

View File

@@ -247,11 +247,12 @@ static int tg3_open(struct net_device *dev)
return err;
tpr->rx_std_iob_cnt = 0;
tg3_refill_prod_ring(tp);
err = tg3_init_hw(tp, 1);
if (err != 0)
DBGC(tp->dev, "tg3_init_hw failed: %s\n", strerror(err));
else
tg3_refill_prod_ring(tp);
return err;
}
@@ -301,7 +302,6 @@ static int tg3_transmit(struct net_device *dev, struct io_buffer *iob)
struct tg3 *tp = netdev_priv(dev);
u32 len, entry;
dma_addr_t mapping;
u32 bmsr;
if (tg3_tx_avail(tp) < 1) {
DBGC(dev, "Transmit ring full\n");
@@ -323,14 +323,10 @@ static int tg3_transmit(struct net_device *dev, struct io_buffer *iob)
/* Packets are ready, update Tx producer idx local and on card. */
tw32_tx_mbox(tp->prodmbox, entry);
writel(entry, tp->regs + MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW);
tp->tx_prod = entry;
mb();
tg3_readphy(tp, MII_BMSR, &bmsr);
return 0;
}
@@ -422,8 +418,10 @@ static void tg3_refill_prod_ring(struct tg3 *tp)
tpr->rx_std_iob_cnt++;
}
tpr->rx_std_prod_idx = idx;
tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx);
if ((u32)idx != tpr->rx_std_prod_idx) {
tpr->rx_std_prod_idx = idx;
tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx);
}
}
static void tg3_rx_complete(struct net_device *dev)
@@ -469,7 +467,10 @@ static void tg3_rx_complete(struct net_device *dev)
tpr->rx_std_iob_cnt--;
}
tp->rx_rcb_ptr = sw_idx;
if (tp->rx_rcb_ptr != sw_idx) {
tw32_rx_mbox(tp->consmbox, sw_idx);
tp->rx_rcb_ptr = sw_idx;
}
tg3_refill_prod_ring(tp);
}
@@ -480,7 +481,9 @@ static void tg3_poll(struct net_device *dev)
struct tg3 *tp = netdev_priv(dev);
/* ACK interrupts */
tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00);
/*
*tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00);
*/
tp->hw_status->status &= ~SD_STATUS_UPDATED;
tg3_poll_link(tp);
@@ -905,6 +908,7 @@ static struct pci_device_id tg3_nics[] = {
PCI_ROM(0x14e4, 0x1684, "14e4-1684", "14e4-1684", 0),
PCI_ROM(0x14e4, 0x165b, "14e4-165b", "14e4-165b", 0),
PCI_ROM(0x14e4, 0x1681, "14e4-1681", "14e4-1681", 0),
PCI_ROM(0x14e4, 0x1682, "14e4-1682", "14e4-1682", 0),
PCI_ROM(0x14e4, 0x1680, "14e4-1680", "14e4-1680", 0),
PCI_ROM(0x14e4, 0x1688, "14e4-1688", "14e4-1688", 0),
PCI_ROM(0x14e4, 0x1689, "14e4-1689", "14e4-1689", 0),