Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  ibmtr: Drain rich supply of modpost warnings.
  3c59x: Fix several modpost warnings
  z85230: Fix FIFO handling
  r8169: fix a race between PCI probe and dev_open
  r8169: revert bogus BMCR reset
  sky2: turn off Rx checksum on bad hardware
  mv643xx: Clear pending interrupts before calling request_irq
  myri10ge: add a wc_enabled flag to myri10ge_priv
  myri10ge: prevent 4k rdma on SGI TIOCE chipset
  myri10ge: use pci_map_page to prepare the dmatest buffer
  myri10ge: fix error checking and return value in myri10ge_allocate_rings
  netxen: fix warnings
  via-rhine: set avoid_D3 for broken BIOSes
  [PATCH] bcm43xx: Fix assertion failures in interrupt handler
  [PATCH] bcm43xx: Fix bug in frequency to channel conversion
  [PATCH] bcm43xx: Fix errors in specs to code translation in B6PHY init
  • Loading branch information
Linus Torvalds committed Mar 9, 2007
2 parents 2f8d16a + 0a38f54 commit 8466c83
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 63 deletions.
28 changes: 13 additions & 15 deletions drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,19 +858,7 @@ static struct eisa_device_id vortex_eisa_ids[] = {
};
MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);

static int vortex_eisa_probe(struct device *device);
static int vortex_eisa_remove(struct device *device);

static struct eisa_driver vortex_eisa_driver = {
.id_table = vortex_eisa_ids,
.driver = {
.name = "3c59x",
.probe = vortex_eisa_probe,
.remove = vortex_eisa_remove
}
};

static int vortex_eisa_probe(struct device *device)
static int __init vortex_eisa_probe(struct device *device)
{
void __iomem *ioaddr;
struct eisa_device *edev;
Expand All @@ -893,7 +881,7 @@ static int vortex_eisa_probe(struct device *device)
return 0;
}

static int vortex_eisa_remove(struct device *device)
static int __devexit vortex_eisa_remove(struct device *device)
{
struct eisa_device *edev;
struct net_device *dev;
Expand All @@ -918,7 +906,17 @@ static int vortex_eisa_remove(struct device *device)
free_netdev(dev);
return 0;
}
#endif

static struct eisa_driver vortex_eisa_driver = {
.id_table = vortex_eisa_ids,
.driver = {
.name = "3c59x",
.probe = vortex_eisa_probe,
.remove = __devexit_p(vortex_eisa_remove)
}
};

#endif /* CONFIG_EISA */

/* returns count found (>= 0), or negative on error */
static int __init vortex_eisa_init(void)
Expand Down
10 changes: 6 additions & 4 deletions drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,12 @@ static int mv643xx_eth_open(struct net_device *dev)
unsigned int size;
int err;

/* Clear any pending ethernet port interrupts */
mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
/* wait for previous write to complete */
mv_read (MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num));

err = request_irq(dev->irq, mv643xx_eth_int_handler,
IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev);
if (err) {
Expand Down Expand Up @@ -875,10 +881,6 @@ static int mv643xx_eth_open(struct net_device *dev)

mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */

/* Clear any pending ethernet port interrupts */
mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);

eth_port_start(dev);

/* Interrupt Coalescing */
Expand Down
42 changes: 33 additions & 9 deletions drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ struct myri10ge_priv {
int intr_coal_delay;
__be32 __iomem *intr_coal_delay_ptr;
int mtrr;
int wc_enabled;
int wake_queue;
int stop_queue;
int down_cnt;
Expand Down Expand Up @@ -717,6 +718,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
int status;
size_t bytes;
u32 len;
struct page *dmatest_page;
dma_addr_t dmatest_bus;

/* try to send a reset command to the card to see if it
* is alive */
Expand All @@ -726,6 +729,11 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
dev_err(&mgp->pdev->dev, "failed reset\n");
return -ENXIO;
}
dmatest_page = alloc_page(GFP_KERNEL);
if (!dmatest_page)
return -ENOMEM;
dmatest_bus = pci_map_page(mgp->pdev, dmatest_page, 0, PAGE_SIZE,
DMA_BIDIRECTIONAL);

/* Now exchange information about interrupts */

Expand Down Expand Up @@ -764,8 +772,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)

len = mgp->tx.boundary;

cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus);
cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus);
cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus);
cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus);
cmd.data2 = len * 0x10000;
status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0);
if (status == 0)
Expand All @@ -774,8 +782,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
else
dev_warn(&mgp->pdev->dev, "DMA read benchmark failed: %d\n",
status);
cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus);
cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus);
cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus);
cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus);
cmd.data2 = len * 0x1;
status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0);
if (status == 0)
Expand All @@ -785,8 +793,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
dev_warn(&mgp->pdev->dev, "DMA write benchmark failed: %d\n",
status);

cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus);
cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus);
cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus);
cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus);
cmd.data2 = len * 0x10001;
status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0);
if (status == 0)
Expand All @@ -796,6 +804,9 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
dev_warn(&mgp->pdev->dev,
"DMA read/write benchmark failed: %d\n", status);

pci_unmap_page(mgp->pdev, dmatest_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
put_page(dmatest_page);

memset(mgp->rx_done.entry, 0, bytes);

/* reset mcp/driver shared state back to 0 */
Expand Down Expand Up @@ -1375,7 +1386,7 @@ myri10ge_get_ethtool_stats(struct net_device *netdev,
data[i] = ((unsigned long *)&mgp->stats)[i];

data[i++] = (unsigned int)mgp->tx.boundary;
data[i++] = (unsigned int)(mgp->mtrr >= 0);
data[i++] = (unsigned int)mgp->wc_enabled;
data[i++] = (unsigned int)mgp->pdev->irq;
data[i++] = (unsigned int)mgp->msi_enabled;
data[i++] = (unsigned int)mgp->read_dma;
Expand Down Expand Up @@ -1456,13 +1467,17 @@ static int myri10ge_allocate_rings(struct net_device *dev)
status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0);
tx_ring_size = cmd.data0;
status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0);
if (status != 0)
return status;
rx_ring_size = cmd.data0;

tx_ring_entries = tx_ring_size / sizeof(struct mcp_kreq_ether_send);
rx_ring_entries = rx_ring_size / sizeof(struct mcp_dma_addr);
mgp->tx.mask = tx_ring_entries - 1;
mgp->rx_small.mask = mgp->rx_big.mask = rx_ring_entries - 1;

status = -ENOMEM;

/* allocate the host shadow rings */

bytes = 8 + (MYRI10GE_MAX_SEND_DESC_TSO + 4)
Expand Down Expand Up @@ -1735,7 +1750,7 @@ static int myri10ge_open(struct net_device *dev)
goto abort_with_irq;
}

if (myri10ge_wcfifo && mgp->mtrr >= 0) {
if (myri10ge_wcfifo && mgp->wc_enabled) {
mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4;
mgp->rx_small.wc_fifo =
(u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL;
Expand Down Expand Up @@ -2510,6 +2525,12 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
bridge->vendor, bridge->device);
mgp->tx.boundary = 4096;
mgp->fw_name = myri10ge_fw_aligned;
} else if (bridge &&
bridge->vendor == PCI_VENDOR_ID_SGI &&
bridge->device == 0x4002 /* TIOCE pcie-port */ ) {
/* this pcie bridge does not support 4K rdma request */
mgp->tx.boundary = 2048;
mgp->fw_name = myri10ge_fw_aligned;
}
} else {
if (myri10ge_force_firmware == 1) {
Expand Down Expand Up @@ -2830,9 +2851,12 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
mgp->board_span = pci_resource_len(pdev, 0);
mgp->iomem_base = pci_resource_start(pdev, 0);
mgp->mtrr = -1;
mgp->wc_enabled = 0;
#ifdef CONFIG_MTRR
mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span,
MTRR_TYPE_WRCOMB, 1);
if (mgp->mtrr >= 0)
mgp->wc_enabled = 1;
#endif
/* Hack. need to get rid of these magic numbers */
mgp->sram_size =
Expand Down Expand Up @@ -2927,7 +2951,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n",
(mgp->msi_enabled ? "MSI" : "xPIC"),
netdev->irq, mgp->tx.boundary, mgp->fw_name,
(mgp->mtrr >= 0 ? "Enabled" : "Disabled"));
(mgp->wc_enabled ? "Enabled" : "Disabled"));

return 0;

Expand Down
5 changes: 3 additions & 2 deletions drivers/net/netxen/netxen_nic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
&adapter->ctx_desc_pdev);

printk("ctx_desc_phys_addr: 0x%llx\n",
(u64) adapter->ctx_desc_phys_addr);
(unsigned long long) adapter->ctx_desc_phys_addr);
if (addr == NULL) {
DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
err = -ENOMEM;
Expand All @@ -247,7 +247,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
adapter->max_tx_desc_count,
(dma_addr_t *) & hw->cmd_desc_phys_addr,
&adapter->ahw.cmd_desc_pdev);
printk("cmd_desc_phys_addr: 0x%llx\n", (u64) hw->cmd_desc_phys_addr);
printk("cmd_desc_phys_addr: 0x%llx\n",
(unsigned long long) hw->cmd_desc_phys_addr);

if (addr == NULL) {
DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
Expand Down
14 changes: 7 additions & 7 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr)
{
unsigned int val;

mdio_write(ioaddr, MII_BMCR, BMCR_RESET);
val = mdio_read(ioaddr, MII_BMCR);
val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET;
mdio_write(ioaddr, MII_BMCR, val & 0xffff);
}

static void rtl8169_check_link_status(struct net_device *dev,
Expand Down Expand Up @@ -1368,11 +1368,7 @@ static inline void rtl8169_request_timer(struct net_device *dev)
(tp->phy_version >= RTL_GIGA_PHY_VER_H))
return;

init_timer(timer);
timer->expires = jiffies + RTL8169_PHY_TIMEOUT;
timer->data = (unsigned long)(dev);
timer->function = rtl8169_phy_timer;
add_timer(timer);
mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT);
}

#ifdef CONFIG_NET_POLL_CONTROLLER
Expand Down Expand Up @@ -1685,6 +1681,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->mmio_addr = ioaddr;
tp->align = rtl_cfg_info[ent->driver_data].align;

init_timer(&tp->timer);
tp->timer.data = (unsigned long) dev;
tp->timer.function = rtl8169_phy_timer;

spin_lock_init(&tp->lock);

rc = register_netdev(dev);
Expand Down
24 changes: 21 additions & 3 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2165,9 +2165,27 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
/* fall through */
#endif
case OP_RXCHKS:
skb = sky2->rx_ring[sky2->rx_next].skb;
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = status & 0xffff;
if (!sky2->rx_csum)
break;

/* Both checksum counters are programmed to start at
* the same offset, so unless there is a problem they
* should match. This failure is an early indication that
* hardware receive checksumming won't work.
*/
if (likely(status >> 16 == (status & 0xffff))) {
skb = sky2->rx_ring[sky2->rx_next].skb;
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = status & 0xffff;
} else {
printk(KERN_NOTICE PFX "%s: hardware receive "
"checksum problem (status = %#x)\n",
dev->name, status);
sky2->rx_csum = 0;
sky2_write32(sky2->hw,
Q_ADDR(rxqaddr[le->link], Q_CSR),
BMU_DIS_RX_CHKSUM);
}
break;

case OP_TXINDEXLE:
Expand Down
25 changes: 12 additions & 13 deletions drivers/net/tokenring/ibmtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ static char __devinit *adapter_def(char type)
#define TRC_INITV 0x02 /* verbose init trace points */
static unsigned char ibmtr_debug_trace = 0;

static int ibmtr_probe(struct net_device *dev);
static int ibmtr_probe1(struct net_device *dev, int ioaddr);
static unsigned char get_sram_size(struct tok_info *adapt_info);
static int trdev_init(struct net_device *dev);
Expand Down Expand Up @@ -335,17 +334,6 @@ static void ibmtr_cleanup_card(struct net_device *dev)
#endif
}

int ibmtr_probe_card(struct net_device *dev)
{
int err = ibmtr_probe(dev);
if (!err) {
err = register_netdev(dev);
if (err)
ibmtr_cleanup_card(dev);
}
return err;
}

/****************************************************************************
* ibmtr_probe(): Routine specified in the network device structure
* to probe for an IBM Token Ring Adapter. Routine outline:
Expand All @@ -358,7 +346,7 @@ int ibmtr_probe_card(struct net_device *dev)
* which references it.
****************************************************************************/

static int ibmtr_probe(struct net_device *dev)
static int __init ibmtr_probe(struct net_device *dev)
{
int i;
int base_addr = dev->base_addr;
Expand All @@ -378,6 +366,17 @@ static int ibmtr_probe(struct net_device *dev)
return -ENODEV;
}

int __init ibmtr_probe_card(struct net_device *dev)
{
int err = ibmtr_probe(dev);
if (!err) {
err = register_netdev(dev);
if (err)
ibmtr_cleanup_card(dev);
}
return err;
}

/*****************************************************************************/

static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
Expand Down
Loading

0 comments on commit 8466c83

Please sign in to comment.