diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
commit | d6434e1042f3b0a6dfe1b1f615af369486f9b1fa (patch) | |
tree | e2be02f33984c48ec019c654051d27964e42c441 /drivers/net/ne2k-pci.c | |
parent | 609d1e803baf519487233b765eb487f9ec227a18 (diff) |
Merge with 2.3.19.
Diffstat (limited to 'drivers/net/ne2k-pci.c')
-rw-r--r-- | drivers/net/ne2k-pci.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index cd809d562..72f9d8f7e 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c @@ -86,7 +86,7 @@ pci_clone_list[] __initdata = { {0x4a14, 0x5000, "NetVin NV5000SC", 0}, {0x1106, 0x0926, "Via 86C926", ONLY_16BIT_IO}, {0x10bd, 0x0e34, "SureCom NE34", 0}, - {0x1050, 0x5a5a, "Winbond", 0}, + {0x1050, 0x5a5a, "Winbond W89C940F", 0}, {0x12c3, 0x0058, "Holtek HT80232", ONLY_16BIT_IO | HOLTEK_FDX}, {0x12c3, 0x5598, "Holtek HT80229", ONLY_32BIT_IO | HOLTEK_FDX | STOP_PG_0x60 }, @@ -104,19 +104,19 @@ pci_clone_list[] __initdata = { #define NESM_START_PG 0x40 /* First page of TX buffer */ #define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ -int ne2k_pci_probe(struct device *dev); -static struct device *ne2k_pci_probe1(struct device *dev, int ioaddr, int irq, +int ne2k_pci_probe(struct net_device *dev); +static struct net_device *ne2k_pci_probe1(struct net_device *dev, long ioaddr, int irq, int chip_idx); -static int ne2k_pci_open(struct device *dev); -static int ne2k_pci_close(struct device *dev); +static int ne2k_pci_open(struct net_device *dev); +static int ne2k_pci_close(struct net_device *dev); -static void ne2k_pci_reset_8390(struct device *dev); -static void ne2k_pci_get_8390_hdr(struct device *dev, struct e8390_pkt_hdr *hdr, +static void ne2k_pci_reset_8390(struct net_device *dev); +static void ne2k_pci_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page); -static void ne2k_pci_block_input(struct device *dev, int count, +static void ne2k_pci_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset); -static void ne2k_pci_block_output(struct device *dev, const int count, +static void ne2k_pci_block_output(struct net_device *dev, const int count, const unsigned char *buf, const int start_page); @@ -124,7 +124,7 @@ static void ne2k_pci_block_output(struct device *dev, const int count, /* No room in the standard 8390 structure for extra info we need. */ struct ne2k_pci_card { struct ne2k_pci_card *next; - struct device *dev; + struct net_device *dev; struct pci_dev *pci_dev; }; /* A list of all installed devices, for removing the driver module. */ @@ -150,7 +150,7 @@ init_module(void) void cleanup_module(void) { - struct device *dev; + struct net_device *dev; struct ne2k_pci_card *this_card; /* No need to check MOD_IN_USE, as sys_delete_module() checks. */ @@ -186,7 +186,7 @@ struct netdev_entry netcard_drv = {"ne2k_pci", ne2k_pci_probe1, NE_IO_EXTENT, 0}; #endif -int __init ne2k_pci_probe(struct device *dev) +int __init ne2k_pci_probe(struct net_device *dev) { struct pci_dev *pdev = NULL; int cards_found = 0; @@ -196,9 +196,9 @@ int __init ne2k_pci_probe(struct device *dev) return -ENODEV; while ((pdev = pci_find_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev)) != NULL) { - u8 pci_irq_line; + int pci_irq_line; u16 pci_command, new_command; - u32 pci_ioaddr; + unsigned long pci_ioaddr; /* Note: some vendor IDs (RealTek) have non-NE2k cards as well. */ for (i = 0; pci_clone_list[i].vendor != 0; i++) @@ -208,7 +208,7 @@ int __init ne2k_pci_probe(struct device *dev) if (pci_clone_list[i].vendor == 0) continue; - pci_ioaddr = pdev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; + pci_ioaddr = pdev->resource[0].start; pci_irq_line = pdev->irq; pci_read_config_word(pdev, PCI_COMMAND, &pci_command); @@ -232,19 +232,19 @@ int __init ne2k_pci_probe(struct device *dev) pci_command, new_command); pci_write_config_word(pdev, PCI_COMMAND, new_command); } - +#ifndef __sparc__ if (pci_irq_line <= 0 || pci_irq_line >= NR_IRQS) printk(KERN_WARNING " WARNING: The PCI BIOS assigned this PCI NE2k" " card to IRQ %d, which is unlikely to work!.\n" KERN_WARNING " You should use the PCI BIOS setup to assign" " a valid IRQ line.\n", pci_irq_line); - - printk("ne2k-pci.c: PCI NE2000 clone '%s' at I/O %#x, IRQ %d.\n", +#endif + printk("ne2k-pci.c: PCI NE2000 clone '%s' at I/O %#lx, IRQ %d.\n", pci_clone_list[i].name, pci_ioaddr, pci_irq_line); dev = ne2k_pci_probe1(dev, pci_ioaddr, pci_irq_line, i); if (dev == 0) { /* Should not happen. */ - printk(KERN_ERR "ne2k-pci: Probe of PCI card at %#x failed.\n", + printk(KERN_ERR "ne2k-pci: Probe of PCI card at %#lx failed.\n", pci_ioaddr); continue; } else { @@ -263,7 +263,7 @@ int __init ne2k_pci_probe(struct device *dev) return cards_found ? 0 : -ENODEV; } -static struct device __init *ne2k_pci_probe1(struct device *dev, int ioaddr, int irq, int chip_idx) +static struct net_device __init *ne2k_pci_probe1(struct net_device *dev, long ioaddr, int irq, int chip_idx) { int i; unsigned char SA_prom[32]; @@ -340,7 +340,6 @@ static struct device __init *ne2k_pci_probe1(struct device *dev, int ioaddr, int /* Note: all PCI cards have at least 16 bit access, so we don't have to check for 8 bit cards. Most cards permit 32 bit access. */ - if (pci_clone_list[chip_idx].flags & ONLY_32BIT_IO) { for (i = 0; i < 4 ; i++) ((u32 *)SA_prom)[i] = le32_to_cpu(inl(ioaddr + NE_DATAPORT)); @@ -367,7 +366,7 @@ static struct device __init *ne2k_pci_probe1(struct device *dev, int ioaddr, int request_region(ioaddr, NE_IO_EXTENT, dev->name); - printk("%s: %s found at %#x, IRQ %d, ", + printk("%s: %s found at %#lx, IRQ %d, ", dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq); for(i = 0; i < 6; i++) { printk("%2.2X%s", SA_prom[i], i == 5 ? ".\n": ":"); @@ -397,7 +396,7 @@ static struct device __init *ne2k_pci_probe1(struct device *dev, int ioaddr, int } static int -ne2k_pci_open(struct device *dev) +ne2k_pci_open(struct net_device *dev) { if (request_irq(dev->irq, ei_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; @@ -407,7 +406,7 @@ ne2k_pci_open(struct device *dev) } static int -ne2k_pci_close(struct device *dev) +ne2k_pci_close(struct net_device *dev) { ei_close(dev); free_irq(dev->irq, dev); @@ -418,7 +417,7 @@ ne2k_pci_close(struct device *dev) /* Hard reset the card. This used to pause for the same period that a 8390 reset command required, but that shouldn't be necessary. */ static void -ne2k_pci_reset_8390(struct device *dev) +ne2k_pci_reset_8390(struct net_device *dev) { unsigned long reset_start_time = jiffies; @@ -444,10 +443,10 @@ ne2k_pci_reset_8390(struct device *dev) the start of a page, so we optimize accordingly. */ static void -ne2k_pci_get_8390_hdr(struct device *dev, struct e8390_pkt_hdr *hdr, int ring_page) +ne2k_pci_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { - int nic_base = dev->base_addr; + long nic_base = dev->base_addr; /* This *shouldn't* happen. If it does, it's the last thing you'll see */ if (ei_status.dmaing) { @@ -483,9 +482,9 @@ ne2k_pci_get_8390_hdr(struct device *dev, struct e8390_pkt_hdr *hdr, int ring_pa the packet out through the "remote DMA" dataport using outb. */ static void -ne2k_pci_block_input(struct device *dev, int count, struct sk_buff *skb, int ring_offset) +ne2k_pci_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - int nic_base = dev->base_addr; + long nic_base = dev->base_addr; char *buf = skb->data; /* This *shouldn't* happen. If it does, it's the last thing you'll see */ @@ -527,10 +526,10 @@ ne2k_pci_block_input(struct device *dev, int count, struct sk_buff *skb, int rin } static void -ne2k_pci_block_output(struct device *dev, int count, +ne2k_pci_block_output(struct net_device *dev, int count, const unsigned char *buf, const int start_page) { - int nic_base = NE_BASE; + long nic_base = NE_BASE; unsigned long dma_start; /* On little-endian it's always safe to round the count up for |