Commit 62dd7535 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://gkernel.bkbits.net/net-drivers-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents ca28fe37 f9b451bd
...@@ -430,7 +430,8 @@ CONFIG_EQUALIZER=m ...@@ -430,7 +430,8 @@ CONFIG_EQUALIZER=m
# #
# Ethernet (10 or 100Mbit) # Ethernet (10 or 100Mbit)
# #
# CONFIG_NET_ETHERNET is not set CONFIG_NET_ETHERNET=y
CONFIG_MII=m
CONFIG_ATARILANCE=m CONFIG_ATARILANCE=m
# #
......
...@@ -65,7 +65,7 @@ CONFIG_KMOD=y ...@@ -65,7 +65,7 @@ CONFIG_KMOD=y
# CONFIG_APOLLO is not set # CONFIG_APOLLO is not set
# CONFIG_VME is not set # CONFIG_VME is not set
CONFIG_HP300=y CONFIG_HP300=y
# CONFIG_DIO is not set CONFIG_DIO=y
# CONFIG_SUN3X is not set # CONFIG_SUN3X is not set
# CONFIG_Q40 is not set # CONFIG_Q40 is not set
...@@ -404,7 +404,7 @@ CONFIG_EQUALIZER=m ...@@ -404,7 +404,7 @@ CONFIG_EQUALIZER=m
# #
CONFIG_NET_ETHERNET=y CONFIG_NET_ETHERNET=y
CONFIG_MII=m CONFIG_MII=m
# CONFIG_HPLANCE is not set CONFIG_HPLANCE=y
# #
# Ethernet (1000 Mbit) # Ethernet (1000 Mbit)
......
...@@ -2204,23 +2204,25 @@ static int __devinit e100_probe(struct pci_dev *pdev, ...@@ -2204,23 +2204,25 @@ static int __devinit e100_probe(struct pci_dev *pdev,
goto err_out_disable_pdev; goto err_out_disable_pdev;
} }
nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
if(!nic->csr) {
DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
e100_hw_reset(nic);
pci_set_master(pdev); pci_set_master(pdev);
if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) { if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
goto err_out_free_res; goto err_out_iounmap;
} }
SET_MODULE_OWNER(netdev); SET_MODULE_OWNER(netdev);
SET_NETDEV_DEV(netdev, &pdev->dev); SET_NETDEV_DEV(netdev, &pdev->dev);
nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
if(!nic->csr) {
DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
if(ent->driver_data) if(ent->driver_data)
nic->flags |= ich; nic->flags |= ich;
else else
......
...@@ -76,25 +76,31 @@ static int __devinit hplance_init_one(struct dio_dev *d, ...@@ -76,25 +76,31 @@ static int __devinit hplance_init_one(struct dio_dev *d,
const struct dio_device_id *ent) const struct dio_device_id *ent)
{ {
struct net_device *dev; struct net_device *dev;
int err; int err = -ENOMEM;
dev = alloc_etherdev(sizeof(struct hplance_private)); dev = alloc_etherdev(sizeof(struct hplance_private));
if (!dev) if (!dev)
return -ENOMEM; goto out;
if (!request_mem_region(d->resource.start, d->resource.end-d->resource.start, d->name)) err = -EBUSY;
return -EBUSY; if (!request_mem_region(dio_resource_start(d),
dio_resource_len(d), d->name))
goto out_free_netdev;
SET_MODULE_OWNER(dev);
hplance_init(dev, d); hplance_init(dev, d);
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err)
free_netdev(dev); goto out_release_mem_region;
return err;
}
dio_set_drvdata(d, dev); dio_set_drvdata(d, dev);
return 0; return 0;
out_release_mem_region:
release_mem_region(dio_resource_start(d), dio_resource_len(d));
out_free_netdev:
free_netdev(dev);
out:
return err;
} }
static void __devexit hplance_remove_one(struct dio_dev *d) static void __devexit hplance_remove_one(struct dio_dev *d)
...@@ -102,6 +108,7 @@ static void __devexit hplance_remove_one(struct dio_dev *d) ...@@ -102,6 +108,7 @@ static void __devexit hplance_remove_one(struct dio_dev *d)
struct net_device *dev = dio_get_drvdata(d); struct net_device *dev = dio_get_drvdata(d);
unregister_netdev(dev); unregister_netdev(dev);
release_mem_region(dio_resource_start(d), dio_resource_len(d));
free_netdev(dev); free_netdev(dev);
} }
......
...@@ -598,7 +598,7 @@ static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo * ...@@ -598,7 +598,7 @@ static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *
} }
static u32 netdev_get_link(struct net_device *dev) { static u32 netdev_get_link(struct net_device *dev) {
return 0; return 1;
} }
static struct ethtool_ops netdev_ethtool_ops = { static struct ethtool_ops netdev_ethtool_ops = {
......
...@@ -1010,7 +1010,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1010,7 +1010,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
return -EBUSY; return -EBUSY;
} }
return pcnet32_probe1(ioaddr, 1, pdev); err = pcnet32_probe1(ioaddr, 1, pdev);
if (err < 0) {
pci_disable_device(pdev);
}
return err;
} }
...@@ -2249,6 +2253,7 @@ static void __devexit pcnet32_remove_one(struct pci_dev *pdev) ...@@ -2249,6 +2253,7 @@ static void __devexit pcnet32_remove_one(struct pci_dev *pdev)
release_region(dev->base_addr, PCNET32_TOTAL_SIZE); release_region(dev->base_addr, PCNET32_TOTAL_SIZE);
pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr); pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
free_netdev(dev); free_netdev(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
} }
} }
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
*/ */
#include "tulip.h"
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "tulip.h"
static u16 t21142_csr13[] = { 0x0001, 0x0009, 0x0009, 0x0000, 0x0001, }; static u16 t21142_csr13[] = { 0x0001, 0x0009, 0x0009, 0x0000, 0x0001, };
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include <linux/pci.h>
#include "tulip.h" #include "tulip.h"
#include <linux/init.h> #include <linux/init.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
*/ */
#include <linux/pci.h>
#include "tulip.h" #include "tulip.h"
#include <linux/config.h> #include <linux/config.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/pci.h>
int tulip_rx_copybreak; int tulip_rx_copybreak;
unsigned int tulip_max_interrupt_work; unsigned int tulip_max_interrupt_work;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pci.h>
#include "tulip.h" #include "tulip.h"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h>
#include "tulip.h" #include "tulip.h"
......
...@@ -76,8 +76,8 @@ ...@@ -76,8 +76,8 @@
#include "tulip.h"
#include <linux/pci.h> #include <linux/pci.h>
#include "tulip.h"
#include <linux/delay.h> #include <linux/delay.h>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include <linux/pci.h>
#include "tulip.h" #include "tulip.h"
......
...@@ -149,6 +149,9 @@ enum status_bits { ...@@ -149,6 +149,9 @@ enum status_bits {
TxIntr = 0x01, TxIntr = 0x01,
}; };
/* bit mask for CSR5 TX/RX process state */
#define CSR5_TS 0x00700000
#define CSR5_RS 0x000e0000
enum tulip_mode_bits { enum tulip_mode_bits {
TxThreshold = (1 << 22), TxThreshold = (1 << 22),
...@@ -460,9 +463,19 @@ static inline void tulip_stop_rxtx(struct tulip_private *tp) ...@@ -460,9 +463,19 @@ static inline void tulip_stop_rxtx(struct tulip_private *tp)
u32 csr6 = ioread32(ioaddr + CSR6); u32 csr6 = ioread32(ioaddr + CSR6);
if (csr6 & RxTx) { if (csr6 & RxTx) {
unsigned i=1300/10;
iowrite32(csr6 & ~RxTx, ioaddr + CSR6); iowrite32(csr6 & ~RxTx, ioaddr + CSR6);
barrier(); barrier();
(void) ioread32(ioaddr + CSR6); /* mmio sync */ /* wait until in-flight frame completes.
* Max time @ 10BT: 1500*8b/10Mbps == 1200us (+ 100us margin)
* Typically expect this loop to end in < 50 us on 100BT.
*/
while (--i && (ioread32(ioaddr + CSR5) & (CSR5_TS|CSR5_RS)))
udelay(10);
if (!i)
printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
tp->pdev->slot_name);
} }
} }
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include <linux/module.h> #include <linux/module.h>
#include "tulip.h"
#include <linux/pci.h> #include <linux/pci.h>
#include "tulip.h"
#include <linux/init.h> #include <linux/init.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/delay.h> #include <linux/delay.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment