diff options
Diffstat (limited to 'drivers/net/yellowfin.c')
-rw-r--r-- | drivers/net/yellowfin.c | 73 |
1 files changed, 17 insertions, 56 deletions
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index fd0f43b7db5b..8459a18254a4 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -19,37 +19,13 @@ | |||
19 | 19 | ||
20 | Support and updates available at | 20 | Support and updates available at |
21 | http://www.scyld.com/network/yellowfin.html | 21 | http://www.scyld.com/network/yellowfin.html |
22 | [link no longer provides useful info -jgarzik] | ||
22 | 23 | ||
23 | |||
24 | Linux kernel changelog: | ||
25 | ----------------------- | ||
26 | |||
27 | LK1.1.1 (jgarzik): Port to 2.4 kernel | ||
28 | |||
29 | LK1.1.2 (jgarzik): | ||
30 | * Merge in becker version 1.05 | ||
31 | |||
32 | LK1.1.3 (jgarzik): | ||
33 | * Various cleanups | ||
34 | * Update yellowfin_timer to correctly calculate duplex. | ||
35 | (suggested by Manfred Spraul) | ||
36 | |||
37 | LK1.1.4 (val@nmt.edu): | ||
38 | * Fix three endian-ness bugs | ||
39 | * Support dual function SYM53C885E ethernet chip | ||
40 | |||
41 | LK1.1.5 (val@nmt.edu): | ||
42 | * Fix forced full-duplex bug I introduced | ||
43 | |||
44 | LK1.1.6 (val@nmt.edu): | ||
45 | * Only print warning on truly "oversized" packets | ||
46 | * Fix theoretical bug on gigabit cards - return to 1.1.3 behavior | ||
47 | |||
48 | */ | 24 | */ |
49 | 25 | ||
50 | #define DRV_NAME "yellowfin" | 26 | #define DRV_NAME "yellowfin" |
51 | #define DRV_VERSION "1.05+LK1.1.6" | 27 | #define DRV_VERSION "2.0" |
52 | #define DRV_RELDATE "Feb 11, 2002" | 28 | #define DRV_RELDATE "Jun 27, 2006" |
53 | 29 | ||
54 | #define PFX DRV_NAME ": " | 30 | #define PFX DRV_NAME ": " |
55 | 31 | ||
@@ -234,26 +210,16 @@ See Packet Engines confidential appendix (prototype chips only). | |||
234 | 210 | ||
235 | 211 | ||
236 | 212 | ||
237 | enum pci_id_flags_bits { | ||
238 | /* Set PCI command register bits before calling probe1(). */ | ||
239 | PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, | ||
240 | /* Read and map the single following PCI BAR. */ | ||
241 | PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4, | ||
242 | PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400, | ||
243 | PCI_UNUSED_IRQ=0x800, | ||
244 | }; | ||
245 | enum capability_flags { | 213 | enum capability_flags { |
246 | HasMII=1, FullTxStatus=2, IsGigabit=4, HasMulticastBug=8, FullRxStatus=16, | 214 | HasMII=1, FullTxStatus=2, IsGigabit=4, HasMulticastBug=8, FullRxStatus=16, |
247 | HasMACAddrBug=32, /* Only on early revs. */ | 215 | HasMACAddrBug=32, /* Only on early revs. */ |
248 | DontUseEeprom=64, /* Don't read the MAC from the EEPROm. */ | 216 | DontUseEeprom=64, /* Don't read the MAC from the EEPROm. */ |
249 | }; | 217 | }; |
218 | |||
250 | /* The PCI I/O space extent. */ | 219 | /* The PCI I/O space extent. */ |
251 | #define YELLOWFIN_SIZE 0x100 | 220 | enum { |
252 | #ifdef USE_IO_OPS | 221 | YELLOWFIN_SIZE = 0x100, |
253 | #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0) | 222 | }; |
254 | #else | ||
255 | #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1) | ||
256 | #endif | ||
257 | 223 | ||
258 | struct pci_id_info { | 224 | struct pci_id_info { |
259 | const char *name; | 225 | const char *name; |
@@ -261,24 +227,21 @@ struct pci_id_info { | |||
261 | int pci, pci_mask, subsystem, subsystem_mask; | 227 | int pci, pci_mask, subsystem, subsystem_mask; |
262 | int revision, revision_mask; /* Only 8 bits. */ | 228 | int revision, revision_mask; /* Only 8 bits. */ |
263 | } id; | 229 | } id; |
264 | enum pci_id_flags_bits pci_flags; | ||
265 | int io_size; /* Needed for I/O region check or ioremap(). */ | ||
266 | int drv_flags; /* Driver use, intended as capability flags. */ | 230 | int drv_flags; /* Driver use, intended as capability flags. */ |
267 | }; | 231 | }; |
268 | 232 | ||
269 | static const struct pci_id_info pci_id_tbl[] = { | 233 | static const struct pci_id_info pci_id_tbl[] = { |
270 | {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff}, | 234 | {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff}, |
271 | PCI_IOTYPE, YELLOWFIN_SIZE, | ||
272 | FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom}, | 235 | FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom}, |
273 | {"Symbios SYM83C885", { 0x07011000, 0xffffffff}, | 236 | {"Symbios SYM83C885", { 0x07011000, 0xffffffff}, |
274 | PCI_IOTYPE, YELLOWFIN_SIZE, HasMII | DontUseEeprom }, | 237 | HasMII | DontUseEeprom }, |
275 | {NULL,}, | 238 | { } |
276 | }; | 239 | }; |
277 | 240 | ||
278 | static struct pci_device_id yellowfin_pci_tbl[] = { | 241 | static const struct pci_device_id yellowfin_pci_tbl[] = { |
279 | { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 242 | { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
280 | { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, | 243 | { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, |
281 | { 0, } | 244 | { } |
282 | }; | 245 | }; |
283 | MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl); | 246 | MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl); |
284 | 247 | ||
@@ -616,7 +579,7 @@ static int yellowfin_open(struct net_device *dev) | |||
616 | /* Reset the chip. */ | 579 | /* Reset the chip. */ |
617 | iowrite32(0x80000000, ioaddr + DMACtrl); | 580 | iowrite32(0x80000000, ioaddr + DMACtrl); |
618 | 581 | ||
619 | i = request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev); | 582 | i = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev); |
620 | if (i) return i; | 583 | if (i) return i; |
621 | 584 | ||
622 | if (yellowfin_debug > 1) | 585 | if (yellowfin_debug > 1) |
@@ -862,13 +825,11 @@ static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
862 | /* Fix GX chipset errata. */ | 825 | /* Fix GX chipset errata. */ |
863 | if (cacheline_end > 24 || cacheline_end == 0) { | 826 | if (cacheline_end > 24 || cacheline_end == 0) { |
864 | len = skb->len + 32 - cacheline_end + 1; | 827 | len = skb->len + 32 - cacheline_end + 1; |
865 | if (len != skb->len) | 828 | if (skb_padto(skb, len)) { |
866 | skb = skb_padto(skb, len); | 829 | yp->tx_skbuff[entry] = NULL; |
867 | } | 830 | netif_wake_queue(dev); |
868 | if (skb == NULL) { | 831 | return 0; |
869 | yp->tx_skbuff[entry] = NULL; | 832 | } |
870 | netif_wake_queue(dev); | ||
871 | return 0; | ||
872 | } | 833 | } |
873 | } | 834 | } |
874 | yp->tx_skbuff[entry] = skb; | 835 | yp->tx_skbuff[entry] = skb; |