diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 12:39:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 12:39:05 -0500 |
commit | cf10b2853f86e714eac7117484c0d368ce710fa4 (patch) | |
tree | 6f1574a9de786c8c345ac852eff12d65b2d75bfe /drivers | |
parent | 14591de147f7c9656fa2b9c05680d2b46e286c40 (diff) | |
parent | 166c3436d683cfe5316c7723ed746a93db053f12 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/3c503.c | 16 | ||||
-rw-r--r-- | drivers/net/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/ac3200.c | 16 | ||||
-rw-r--r-- | drivers/net/bonding/bonding.h | 8 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_param.c | 10 | ||||
-rw-r--r-- | drivers/net/e2100.c | 14 | ||||
-rw-r--r-- | drivers/net/es3210.c | 14 | ||||
-rw-r--r-- | drivers/net/forcedeth.c | 164 | ||||
-rw-r--r-- | drivers/net/gianfar.h | 4 | ||||
-rw-r--r-- | drivers/net/hp-plus.c | 12 | ||||
-rw-r--r-- | drivers/net/hp.c | 12 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac.h | 3 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_core.c | 2 | ||||
-rw-r--r-- | drivers/net/lance.c | 22 | ||||
-rw-r--r-- | drivers/net/lne390.c | 14 | ||||
-rw-r--r-- | drivers/net/mv643xx_eth.c | 2 | ||||
-rw-r--r-- | drivers/net/ne.c | 18 | ||||
-rw-r--r-- | drivers/net/ne2.c | 16 | ||||
-rw-r--r-- | drivers/net/sk98lin/skge.c | 129 | ||||
-rw-r--r-- | drivers/net/smc-ultra.c | 24 | ||||
-rw-r--r-- | drivers/net/tulip/tulip_core.c | 2 | ||||
-rw-r--r-- | drivers/net/wd.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 5 |
23 files changed, 296 insertions, 229 deletions
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index 5c5eebdb6914..dcc98afa65d7 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c | |||
@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev) | |||
148 | return -ENODEV; | 148 | return -ENODEV; |
149 | } | 149 | } |
150 | 150 | ||
151 | static void cleanup_card(struct net_device *dev) | ||
152 | { | ||
153 | /* NB: el2_close() handles free_irq */ | ||
154 | release_region(dev->base_addr, EL2_IO_EXTENT); | ||
155 | if (ei_status.mem) | ||
156 | iounmap(ei_status.mem); | ||
157 | } | ||
158 | |||
159 | #ifndef MODULE | 151 | #ifndef MODULE |
160 | struct net_device * __init el2_probe(int unit) | 152 | struct net_device * __init el2_probe(int unit) |
161 | { | 153 | { |
@@ -726,6 +718,14 @@ init_module(void) | |||
726 | return -ENXIO; | 718 | return -ENXIO; |
727 | } | 719 | } |
728 | 720 | ||
721 | static void cleanup_card(struct net_device *dev) | ||
722 | { | ||
723 | /* NB: el2_close() handles free_irq */ | ||
724 | release_region(dev->base_addr, EL2_IO_EXTENT); | ||
725 | if (ei_status.mem) | ||
726 | iounmap(ei_status.mem); | ||
727 | } | ||
728 | |||
729 | void | 729 | void |
730 | cleanup_module(void) | 730 | cleanup_module(void) |
731 | { | 731 | { |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 1960961bf28e..733bc25b2bf9 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -129,7 +129,7 @@ config NET_SB1000 | |||
129 | 129 | ||
130 | If you don't have this card, of course say N. | 130 | If you don't have this card, of course say N. |
131 | 131 | ||
132 | source "drivers/net/arcnet/Kconfig" | 132 | source "drivers/net/arcnet/Kconfig" |
133 | 133 | ||
134 | source "drivers/net/phy/Kconfig" | 134 | source "drivers/net/phy/Kconfig" |
135 | 135 | ||
@@ -844,7 +844,7 @@ config SMC9194 | |||
844 | 844 | ||
845 | config DM9000 | 845 | config DM9000 |
846 | tristate "DM9000 support" | 846 | tristate "DM9000 support" |
847 | depends on ARM && NET_ETHERNET | 847 | depends on (ARM || MIPS) && NET_ETHERNET |
848 | select CRC32 | 848 | select CRC32 |
849 | select MII | 849 | select MII |
850 | ---help--- | 850 | ---help--- |
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c index 8a0af5453e21..7952dc6d77e3 100644 --- a/drivers/net/ac3200.c +++ b/drivers/net/ac3200.c | |||
@@ -123,14 +123,6 @@ static int __init do_ac3200_probe(struct net_device *dev) | |||
123 | return -ENODEV; | 123 | return -ENODEV; |
124 | } | 124 | } |
125 | 125 | ||
126 | static void cleanup_card(struct net_device *dev) | ||
127 | { | ||
128 | /* Someday free_irq may be in ac_close_card() */ | ||
129 | free_irq(dev->irq, dev); | ||
130 | release_region(dev->base_addr, AC_IO_EXTENT); | ||
131 | iounmap(ei_status.mem); | ||
132 | } | ||
133 | |||
134 | #ifndef MODULE | 126 | #ifndef MODULE |
135 | struct net_device * __init ac3200_probe(int unit) | 127 | struct net_device * __init ac3200_probe(int unit) |
136 | { | 128 | { |
@@ -406,6 +398,14 @@ init_module(void) | |||
406 | return -ENXIO; | 398 | return -ENXIO; |
407 | } | 399 | } |
408 | 400 | ||
401 | static void cleanup_card(struct net_device *dev) | ||
402 | { | ||
403 | /* Someday free_irq may be in ac_close_card() */ | ||
404 | free_irq(dev->irq, dev); | ||
405 | release_region(dev->base_addr, AC_IO_EXTENT); | ||
406 | iounmap(ei_status.mem); | ||
407 | } | ||
408 | |||
409 | void | 409 | void |
410 | cleanup_module(void) | 410 | cleanup_module(void) |
411 | { | 411 | { |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 015c7f1d1bc0..f20bb85c1ea5 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -205,7 +205,7 @@ struct bonding { | |||
205 | * | 205 | * |
206 | * Caller must hold bond lock for read | 206 | * Caller must hold bond lock for read |
207 | */ | 207 | */ |
208 | extern inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev) | 208 | static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev) |
209 | { | 209 | { |
210 | struct slave *slave = NULL; | 210 | struct slave *slave = NULL; |
211 | int i; | 211 | int i; |
@@ -219,7 +219,7 @@ extern inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n | |||
219 | return slave; | 219 | return slave; |
220 | } | 220 | } |
221 | 221 | ||
222 | extern inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | 222 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) |
223 | { | 223 | { |
224 | if (!slave || !slave->dev->master) { | 224 | if (!slave || !slave->dev->master) { |
225 | return NULL; | 225 | return NULL; |
@@ -228,13 +228,13 @@ extern inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | |||
228 | return (struct bonding *)slave->dev->master->priv; | 228 | return (struct bonding *)slave->dev->master->priv; |
229 | } | 229 | } |
230 | 230 | ||
231 | extern inline void bond_set_slave_inactive_flags(struct slave *slave) | 231 | static inline void bond_set_slave_inactive_flags(struct slave *slave) |
232 | { | 232 | { |
233 | slave->state = BOND_STATE_BACKUP; | 233 | slave->state = BOND_STATE_BACKUP; |
234 | slave->dev->flags |= IFF_NOARP; | 234 | slave->dev->flags |= IFF_NOARP; |
235 | } | 235 | } |
236 | 236 | ||
237 | extern inline void bond_set_slave_active_flags(struct slave *slave) | 237 | static inline void bond_set_slave_active_flags(struct slave *slave) |
238 | { | 238 | { |
239 | slave->state = BOND_STATE_ACTIVE; | 239 | slave->state = BOND_STATE_ACTIVE; |
240 | slave->dev->flags &= ~IFF_NOARP; | 240 | slave->dev->flags &= ~IFF_NOARP; |
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c index 38695d5b4637..ccbbe5ad8e0f 100644 --- a/drivers/net/e1000/e1000_param.c +++ b/drivers/net/e1000/e1000_param.c | |||
@@ -545,7 +545,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter) | |||
545 | static void __devinit | 545 | static void __devinit |
546 | e1000_check_copper_options(struct e1000_adapter *adapter) | 546 | e1000_check_copper_options(struct e1000_adapter *adapter) |
547 | { | 547 | { |
548 | int speed, dplx; | 548 | int speed, dplx, an; |
549 | int bd = adapter->bd_number; | 549 | int bd = adapter->bd_number; |
550 | 550 | ||
551 | { /* Speed */ | 551 | { /* Speed */ |
@@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter) | |||
641 | .p = an_list }} | 641 | .p = an_list }} |
642 | }; | 642 | }; |
643 | 643 | ||
644 | int an = AutoNeg[bd]; | 644 | if (num_AutoNeg > bd) { |
645 | e1000_validate_option(&an, &opt, adapter); | 645 | an = AutoNeg[bd]; |
646 | e1000_validate_option(&an, &opt, adapter); | ||
647 | } else { | ||
648 | an = opt.def; | ||
649 | } | ||
646 | adapter->hw.autoneg_advertised = an; | 650 | adapter->hw.autoneg_advertised = an; |
647 | } | 651 | } |
648 | 652 | ||
diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index f5a4dd7d8564..e5c5cd2a2712 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c | |||
@@ -140,13 +140,6 @@ static int __init do_e2100_probe(struct net_device *dev) | |||
140 | return -ENODEV; | 140 | return -ENODEV; |
141 | } | 141 | } |
142 | 142 | ||
143 | static void cleanup_card(struct net_device *dev) | ||
144 | { | ||
145 | /* NB: e21_close() handles free_irq */ | ||
146 | iounmap(ei_status.mem); | ||
147 | release_region(dev->base_addr, E21_IO_EXTENT); | ||
148 | } | ||
149 | |||
150 | #ifndef MODULE | 143 | #ifndef MODULE |
151 | struct net_device * __init e2100_probe(int unit) | 144 | struct net_device * __init e2100_probe(int unit) |
152 | { | 145 | { |
@@ -463,6 +456,13 @@ init_module(void) | |||
463 | return -ENXIO; | 456 | return -ENXIO; |
464 | } | 457 | } |
465 | 458 | ||
459 | static void cleanup_card(struct net_device *dev) | ||
460 | { | ||
461 | /* NB: e21_close() handles free_irq */ | ||
462 | iounmap(ei_status.mem); | ||
463 | release_region(dev->base_addr, E21_IO_EXTENT); | ||
464 | } | ||
465 | |||
466 | void | 466 | void |
467 | cleanup_module(void) | 467 | cleanup_module(void) |
468 | { | 468 | { |
diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c index 50f8e23bb9e5..6b0ab1eac3fb 100644 --- a/drivers/net/es3210.c +++ b/drivers/net/es3210.c | |||
@@ -155,13 +155,6 @@ static int __init do_es_probe(struct net_device *dev) | |||
155 | return -ENODEV; | 155 | return -ENODEV; |
156 | } | 156 | } |
157 | 157 | ||
158 | static void cleanup_card(struct net_device *dev) | ||
159 | { | ||
160 | free_irq(dev->irq, dev); | ||
161 | release_region(dev->base_addr, ES_IO_EXTENT); | ||
162 | iounmap(ei_status.mem); | ||
163 | } | ||
164 | |||
165 | #ifndef MODULE | 158 | #ifndef MODULE |
166 | struct net_device * __init es_probe(int unit) | 159 | struct net_device * __init es_probe(int unit) |
167 | { | 160 | { |
@@ -456,6 +449,13 @@ init_module(void) | |||
456 | return -ENXIO; | 449 | return -ENXIO; |
457 | } | 450 | } |
458 | 451 | ||
452 | static void cleanup_card(struct net_device *dev) | ||
453 | { | ||
454 | free_irq(dev->irq, dev); | ||
455 | release_region(dev->base_addr, ES_IO_EXTENT); | ||
456 | iounmap(ei_status.mem); | ||
457 | } | ||
458 | |||
459 | void | 459 | void |
460 | cleanup_module(void) | 460 | cleanup_module(void) |
461 | { | 461 | { |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index c39344adecce..3682ec61e8a8 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -101,6 +101,7 @@ | |||
101 | * 0.46: 20 Oct 2005: Add irq optimization modes. | 101 | * 0.46: 20 Oct 2005: Add irq optimization modes. |
102 | * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan. | 102 | * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan. |
103 | * 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single | 103 | * 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single |
104 | * 0.49: 10 Dec 2005: Fix tso for large buffers. | ||
104 | * | 105 | * |
105 | * Known bugs: | 106 | * Known bugs: |
106 | * We suspect that on some hardware no TX done interrupts are generated. | 107 | * We suspect that on some hardware no TX done interrupts are generated. |
@@ -112,7 +113,7 @@ | |||
112 | * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few | 113 | * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few |
113 | * superfluous timer interrupts from the nic. | 114 | * superfluous timer interrupts from the nic. |
114 | */ | 115 | */ |
115 | #define FORCEDETH_VERSION "0.48" | 116 | #define FORCEDETH_VERSION "0.49" |
116 | #define DRV_NAME "forcedeth" | 117 | #define DRV_NAME "forcedeth" |
117 | 118 | ||
118 | #include <linux/module.h> | 119 | #include <linux/module.h> |
@@ -349,6 +350,8 @@ typedef union _ring_type { | |||
349 | #define NV_TX2_VALID (1<<31) | 350 | #define NV_TX2_VALID (1<<31) |
350 | #define NV_TX2_TSO (1<<28) | 351 | #define NV_TX2_TSO (1<<28) |
351 | #define NV_TX2_TSO_SHIFT 14 | 352 | #define NV_TX2_TSO_SHIFT 14 |
353 | #define NV_TX2_TSO_MAX_SHIFT 14 | ||
354 | #define NV_TX2_TSO_MAX_SIZE (1<<NV_TX2_TSO_MAX_SHIFT) | ||
352 | #define NV_TX2_CHECKSUM_L3 (1<<27) | 355 | #define NV_TX2_CHECKSUM_L3 (1<<27) |
353 | #define NV_TX2_CHECKSUM_L4 (1<<26) | 356 | #define NV_TX2_CHECKSUM_L4 (1<<26) |
354 | 357 | ||
@@ -408,15 +411,15 @@ typedef union _ring_type { | |||
408 | #define NV_WATCHDOG_TIMEO (5*HZ) | 411 | #define NV_WATCHDOG_TIMEO (5*HZ) |
409 | 412 | ||
410 | #define RX_RING 128 | 413 | #define RX_RING 128 |
411 | #define TX_RING 64 | 414 | #define TX_RING 256 |
412 | /* | 415 | /* |
413 | * If your nic mysteriously hangs then try to reduce the limits | 416 | * If your nic mysteriously hangs then try to reduce the limits |
414 | * to 1/0: It might be required to set NV_TX_LASTPACKET in the | 417 | * to 1/0: It might be required to set NV_TX_LASTPACKET in the |
415 | * last valid ring entry. But this would be impossible to | 418 | * last valid ring entry. But this would be impossible to |
416 | * implement - probably a disassembly error. | 419 | * implement - probably a disassembly error. |
417 | */ | 420 | */ |
418 | #define TX_LIMIT_STOP 63 | 421 | #define TX_LIMIT_STOP 255 |
419 | #define TX_LIMIT_START 62 | 422 | #define TX_LIMIT_START 254 |
420 | 423 | ||
421 | /* rx/tx mac addr + type + vlan + align + slack*/ | 424 | /* rx/tx mac addr + type + vlan + align + slack*/ |
422 | #define NV_RX_HEADERS (64) | 425 | #define NV_RX_HEADERS (64) |
@@ -535,6 +538,7 @@ struct fe_priv { | |||
535 | unsigned int next_tx, nic_tx; | 538 | unsigned int next_tx, nic_tx; |
536 | struct sk_buff *tx_skbuff[TX_RING]; | 539 | struct sk_buff *tx_skbuff[TX_RING]; |
537 | dma_addr_t tx_dma[TX_RING]; | 540 | dma_addr_t tx_dma[TX_RING]; |
541 | unsigned int tx_dma_len[TX_RING]; | ||
538 | u32 tx_flags; | 542 | u32 tx_flags; |
539 | }; | 543 | }; |
540 | 544 | ||
@@ -935,6 +939,7 @@ static void nv_init_tx(struct net_device *dev) | |||
935 | else | 939 | else |
936 | np->tx_ring.ex[i].FlagLen = 0; | 940 | np->tx_ring.ex[i].FlagLen = 0; |
937 | np->tx_skbuff[i] = NULL; | 941 | np->tx_skbuff[i] = NULL; |
942 | np->tx_dma[i] = 0; | ||
938 | } | 943 | } |
939 | } | 944 | } |
940 | 945 | ||
@@ -945,30 +950,27 @@ static int nv_init_ring(struct net_device *dev) | |||
945 | return nv_alloc_rx(dev); | 950 | return nv_alloc_rx(dev); |
946 | } | 951 | } |
947 | 952 | ||
948 | static void nv_release_txskb(struct net_device *dev, unsigned int skbnr) | 953 | static int nv_release_txskb(struct net_device *dev, unsigned int skbnr) |
949 | { | 954 | { |
950 | struct fe_priv *np = netdev_priv(dev); | 955 | struct fe_priv *np = netdev_priv(dev); |
951 | struct sk_buff *skb = np->tx_skbuff[skbnr]; | 956 | |
952 | unsigned int j, entry, fragments; | 957 | dprintk(KERN_INFO "%s: nv_release_txskb for skbnr %d\n", |
953 | 958 | dev->name, skbnr); | |
954 | dprintk(KERN_INFO "%s: nv_release_txskb for skbnr %d, skb %p\n", | 959 | |
955 | dev->name, skbnr, np->tx_skbuff[skbnr]); | 960 | if (np->tx_dma[skbnr]) { |
956 | 961 | pci_unmap_page(np->pci_dev, np->tx_dma[skbnr], | |
957 | entry = skbnr; | 962 | np->tx_dma_len[skbnr], |
958 | if ((fragments = skb_shinfo(skb)->nr_frags) != 0) { | 963 | PCI_DMA_TODEVICE); |
959 | for (j = fragments; j >= 1; j--) { | 964 | np->tx_dma[skbnr] = 0; |
960 | skb_frag_t *frag = &skb_shinfo(skb)->frags[j-1]; | 965 | } |
961 | pci_unmap_page(np->pci_dev, np->tx_dma[entry], | 966 | |
962 | frag->size, | 967 | if (np->tx_skbuff[skbnr]) { |
963 | PCI_DMA_TODEVICE); | 968 | dev_kfree_skb_irq(np->tx_skbuff[skbnr]); |
964 | entry = (entry - 1) % TX_RING; | 969 | np->tx_skbuff[skbnr] = NULL; |
965 | } | 970 | return 1; |
971 | } else { | ||
972 | return 0; | ||
966 | } | 973 | } |
967 | pci_unmap_single(np->pci_dev, np->tx_dma[entry], | ||
968 | skb->len - skb->data_len, | ||
969 | PCI_DMA_TODEVICE); | ||
970 | dev_kfree_skb_irq(skb); | ||
971 | np->tx_skbuff[skbnr] = NULL; | ||
972 | } | 974 | } |
973 | 975 | ||
974 | static void nv_drain_tx(struct net_device *dev) | 976 | static void nv_drain_tx(struct net_device *dev) |
@@ -981,10 +983,8 @@ static void nv_drain_tx(struct net_device *dev) | |||
981 | np->tx_ring.orig[i].FlagLen = 0; | 983 | np->tx_ring.orig[i].FlagLen = 0; |
982 | else | 984 | else |
983 | np->tx_ring.ex[i].FlagLen = 0; | 985 | np->tx_ring.ex[i].FlagLen = 0; |
984 | if (np->tx_skbuff[i]) { | 986 | if (nv_release_txskb(dev, i)) |
985 | nv_release_txskb(dev, i); | ||
986 | np->stats.tx_dropped++; | 987 | np->stats.tx_dropped++; |
987 | } | ||
988 | } | 988 | } |
989 | } | 989 | } |
990 | 990 | ||
@@ -1021,68 +1021,105 @@ static void drain_ring(struct net_device *dev) | |||
1021 | static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1021 | static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) |
1022 | { | 1022 | { |
1023 | struct fe_priv *np = netdev_priv(dev); | 1023 | struct fe_priv *np = netdev_priv(dev); |
1024 | u32 tx_flags = 0; | ||
1024 | u32 tx_flags_extra = (np->desc_ver == DESC_VER_1 ? NV_TX_LASTPACKET : NV_TX2_LASTPACKET); | 1025 | u32 tx_flags_extra = (np->desc_ver == DESC_VER_1 ? NV_TX_LASTPACKET : NV_TX2_LASTPACKET); |
1025 | unsigned int fragments = skb_shinfo(skb)->nr_frags; | 1026 | unsigned int fragments = skb_shinfo(skb)->nr_frags; |
1026 | unsigned int nr = (np->next_tx + fragments) % TX_RING; | 1027 | unsigned int nr = (np->next_tx - 1) % TX_RING; |
1028 | unsigned int start_nr = np->next_tx % TX_RING; | ||
1027 | unsigned int i; | 1029 | unsigned int i; |
1030 | u32 offset = 0; | ||
1031 | u32 bcnt; | ||
1032 | u32 size = skb->len-skb->data_len; | ||
1033 | u32 entries = (size >> NV_TX2_TSO_MAX_SHIFT) + ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); | ||
1034 | |||
1035 | /* add fragments to entries count */ | ||
1036 | for (i = 0; i < fragments; i++) { | ||
1037 | entries += (skb_shinfo(skb)->frags[i].size >> NV_TX2_TSO_MAX_SHIFT) + | ||
1038 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); | ||
1039 | } | ||
1028 | 1040 | ||
1029 | spin_lock_irq(&np->lock); | 1041 | spin_lock_irq(&np->lock); |
1030 | 1042 | ||
1031 | if ((np->next_tx - np->nic_tx + fragments) > TX_LIMIT_STOP) { | 1043 | if ((np->next_tx - np->nic_tx + entries - 1) > TX_LIMIT_STOP) { |
1032 | spin_unlock_irq(&np->lock); | 1044 | spin_unlock_irq(&np->lock); |
1033 | netif_stop_queue(dev); | 1045 | netif_stop_queue(dev); |
1034 | return NETDEV_TX_BUSY; | 1046 | return NETDEV_TX_BUSY; |
1035 | } | 1047 | } |
1036 | 1048 | ||
1037 | np->tx_skbuff[nr] = skb; | 1049 | /* setup the header buffer */ |
1038 | 1050 | do { | |
1039 | if (fragments) { | 1051 | bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size; |
1040 | dprintk(KERN_DEBUG "%s: nv_start_xmit: buffer contains %d fragments\n", dev->name, fragments); | 1052 | nr = (nr + 1) % TX_RING; |
1041 | /* setup descriptors in reverse order */ | 1053 | |
1042 | for (i = fragments; i >= 1; i--) { | 1054 | np->tx_dma[nr] = pci_map_single(np->pci_dev, skb->data + offset, bcnt, |
1043 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i-1]; | 1055 | PCI_DMA_TODEVICE); |
1044 | np->tx_dma[nr] = pci_map_page(np->pci_dev, frag->page, frag->page_offset, frag->size, | 1056 | np->tx_dma_len[nr] = bcnt; |
1045 | PCI_DMA_TODEVICE); | 1057 | |
1058 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { | ||
1059 | np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]); | ||
1060 | np->tx_ring.orig[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags); | ||
1061 | } else { | ||
1062 | np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32; | ||
1063 | np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF; | ||
1064 | np->tx_ring.ex[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags); | ||
1065 | } | ||
1066 | tx_flags = np->tx_flags; | ||
1067 | offset += bcnt; | ||
1068 | size -= bcnt; | ||
1069 | } while(size); | ||
1070 | |||
1071 | /* setup the fragments */ | ||
1072 | for (i = 0; i < fragments; i++) { | ||
1073 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | ||
1074 | u32 size = frag->size; | ||
1075 | offset = 0; | ||
1076 | |||
1077 | do { | ||
1078 | bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size; | ||
1079 | nr = (nr + 1) % TX_RING; | ||
1080 | |||
1081 | np->tx_dma[nr] = pci_map_page(np->pci_dev, frag->page, frag->page_offset+offset, bcnt, | ||
1082 | PCI_DMA_TODEVICE); | ||
1083 | np->tx_dma_len[nr] = bcnt; | ||
1046 | 1084 | ||
1047 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { | 1085 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { |
1048 | np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]); | 1086 | np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]); |
1049 | np->tx_ring.orig[nr].FlagLen = cpu_to_le32( (frag->size-1) | np->tx_flags | tx_flags_extra); | 1087 | np->tx_ring.orig[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags); |
1050 | } else { | 1088 | } else { |
1051 | np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32; | 1089 | np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32; |
1052 | np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF; | 1090 | np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF; |
1053 | np->tx_ring.ex[nr].FlagLen = cpu_to_le32( (frag->size-1) | np->tx_flags | tx_flags_extra); | 1091 | np->tx_ring.ex[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags); |
1054 | } | 1092 | } |
1055 | 1093 | offset += bcnt; | |
1056 | nr = (nr - 1) % TX_RING; | 1094 | size -= bcnt; |
1095 | } while (size); | ||
1096 | } | ||
1057 | 1097 | ||
1058 | if (np->desc_ver == DESC_VER_1) | 1098 | /* set last fragment flag */ |
1059 | tx_flags_extra &= ~NV_TX_LASTPACKET; | 1099 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { |
1060 | else | 1100 | np->tx_ring.orig[nr].FlagLen |= cpu_to_le32(tx_flags_extra); |
1061 | tx_flags_extra &= ~NV_TX2_LASTPACKET; | 1101 | } else { |
1062 | } | 1102 | np->tx_ring.ex[nr].FlagLen |= cpu_to_le32(tx_flags_extra); |
1063 | } | 1103 | } |
1064 | 1104 | ||
1105 | np->tx_skbuff[nr] = skb; | ||
1106 | |||
1065 | #ifdef NETIF_F_TSO | 1107 | #ifdef NETIF_F_TSO |
1066 | if (skb_shinfo(skb)->tso_size) | 1108 | if (skb_shinfo(skb)->tso_size) |
1067 | tx_flags_extra |= NV_TX2_TSO | (skb_shinfo(skb)->tso_size << NV_TX2_TSO_SHIFT); | 1109 | tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->tso_size << NV_TX2_TSO_SHIFT); |
1068 | else | 1110 | else |
1069 | #endif | 1111 | #endif |
1070 | tx_flags_extra |= (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0); | 1112 | tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0); |
1071 | 1113 | ||
1072 | np->tx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len-skb->data_len, | 1114 | /* set tx flags */ |
1073 | PCI_DMA_TODEVICE); | ||
1074 | |||
1075 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { | 1115 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { |
1076 | np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]); | 1116 | np->tx_ring.orig[start_nr].FlagLen |= cpu_to_le32(tx_flags | tx_flags_extra); |
1077 | np->tx_ring.orig[nr].FlagLen = cpu_to_le32( (skb->len-skb->data_len-1) | np->tx_flags | tx_flags_extra); | ||
1078 | } else { | 1117 | } else { |
1079 | np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32; | 1118 | np->tx_ring.ex[start_nr].FlagLen |= cpu_to_le32(tx_flags | tx_flags_extra); |
1080 | np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF; | ||
1081 | np->tx_ring.ex[nr].FlagLen = cpu_to_le32( (skb->len-skb->data_len-1) | np->tx_flags | tx_flags_extra); | ||
1082 | } | 1119 | } |
1083 | 1120 | ||
1084 | dprintk(KERN_DEBUG "%s: nv_start_xmit: packet packet %d queued for transmission. tx_flags_extra: %x\n", | 1121 | dprintk(KERN_DEBUG "%s: nv_start_xmit: packet %d (entries %d) queued for transmission. tx_flags_extra: %x\n", |
1085 | dev->name, np->next_tx, tx_flags_extra); | 1122 | dev->name, np->next_tx, entries, tx_flags_extra); |
1086 | { | 1123 | { |
1087 | int j; | 1124 | int j; |
1088 | for (j=0; j<64; j++) { | 1125 | for (j=0; j<64; j++) { |
@@ -1093,7 +1130,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1093 | dprintk("\n"); | 1130 | dprintk("\n"); |
1094 | } | 1131 | } |
1095 | 1132 | ||
1096 | np->next_tx += 1 + fragments; | 1133 | np->next_tx += entries; |
1097 | 1134 | ||
1098 | dev->trans_start = jiffies; | 1135 | dev->trans_start = jiffies; |
1099 | spin_unlock_irq(&np->lock); | 1136 | spin_unlock_irq(&np->lock); |
@@ -1140,7 +1177,6 @@ static void nv_tx_done(struct net_device *dev) | |||
1140 | np->stats.tx_packets++; | 1177 | np->stats.tx_packets++; |
1141 | np->stats.tx_bytes += skb->len; | 1178 | np->stats.tx_bytes += skb->len; |
1142 | } | 1179 | } |
1143 | nv_release_txskb(dev, i); | ||
1144 | } | 1180 | } |
1145 | } else { | 1181 | } else { |
1146 | if (Flags & NV_TX2_LASTPACKET) { | 1182 | if (Flags & NV_TX2_LASTPACKET) { |
@@ -1156,9 +1192,9 @@ static void nv_tx_done(struct net_device *dev) | |||
1156 | np->stats.tx_packets++; | 1192 | np->stats.tx_packets++; |
1157 | np->stats.tx_bytes += skb->len; | 1193 | np->stats.tx_bytes += skb->len; |
1158 | } | 1194 | } |
1159 | nv_release_txskb(dev, i); | ||
1160 | } | 1195 | } |
1161 | } | 1196 | } |
1197 | nv_release_txskb(dev, i); | ||
1162 | np->nic_tx++; | 1198 | np->nic_tx++; |
1163 | } | 1199 | } |
1164 | if (np->next_tx - np->nic_tx < TX_LIMIT_START) | 1200 | if (np->next_tx - np->nic_tx < TX_LIMIT_START) |
@@ -2456,7 +2492,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
2456 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; | 2492 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; |
2457 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; | 2493 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; |
2458 | #ifdef NETIF_F_TSO | 2494 | #ifdef NETIF_F_TSO |
2459 | /* disabled dev->features |= NETIF_F_TSO; */ | 2495 | dev->features |= NETIF_F_TSO; |
2460 | #endif | 2496 | #endif |
2461 | } | 2497 | } |
2462 | 2498 | ||
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index 94a91da84fbb..cb9d66ac3ab9 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -718,14 +718,14 @@ struct gfar_private { | |||
718 | uint32_t msg_enable; | 718 | uint32_t msg_enable; |
719 | }; | 719 | }; |
720 | 720 | ||
721 | extern inline u32 gfar_read(volatile unsigned *addr) | 721 | static inline u32 gfar_read(volatile unsigned *addr) |
722 | { | 722 | { |
723 | u32 val; | 723 | u32 val; |
724 | val = in_be32(addr); | 724 | val = in_be32(addr); |
725 | return val; | 725 | return val; |
726 | } | 726 | } |
727 | 727 | ||
728 | extern inline void gfar_write(volatile unsigned *addr, u32 val) | 728 | static inline void gfar_write(volatile unsigned *addr, u32 val) |
729 | { | 729 | { |
730 | out_be32(addr, val); | 730 | out_be32(addr, val); |
731 | } | 731 | } |
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index 0abf5dd08b4c..74e167e7dea7 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c | |||
@@ -138,12 +138,6 @@ static int __init do_hpp_probe(struct net_device *dev) | |||
138 | return -ENODEV; | 138 | return -ENODEV; |
139 | } | 139 | } |
140 | 140 | ||
141 | static void cleanup_card(struct net_device *dev) | ||
142 | { | ||
143 | /* NB: hpp_close() handles free_irq */ | ||
144 | release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); | ||
145 | } | ||
146 | |||
147 | #ifndef MODULE | 141 | #ifndef MODULE |
148 | struct net_device * __init hp_plus_probe(int unit) | 142 | struct net_device * __init hp_plus_probe(int unit) |
149 | { | 143 | { |
@@ -473,6 +467,12 @@ init_module(void) | |||
473 | return -ENXIO; | 467 | return -ENXIO; |
474 | } | 468 | } |
475 | 469 | ||
470 | static void cleanup_card(struct net_device *dev) | ||
471 | { | ||
472 | /* NB: hpp_close() handles free_irq */ | ||
473 | release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); | ||
474 | } | ||
475 | |||
476 | void | 476 | void |
477 | cleanup_module(void) | 477 | cleanup_module(void) |
478 | { | 478 | { |
diff --git a/drivers/net/hp.c b/drivers/net/hp.c index 59cf841b14ab..cf9fb3698a6b 100644 --- a/drivers/net/hp.c +++ b/drivers/net/hp.c | |||
@@ -102,12 +102,6 @@ static int __init do_hp_probe(struct net_device *dev) | |||
102 | return -ENODEV; | 102 | return -ENODEV; |
103 | } | 103 | } |
104 | 104 | ||
105 | static void cleanup_card(struct net_device *dev) | ||
106 | { | ||
107 | free_irq(dev->irq, dev); | ||
108 | release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); | ||
109 | } | ||
110 | |||
111 | #ifndef MODULE | 105 | #ifndef MODULE |
112 | struct net_device * __init hp_probe(int unit) | 106 | struct net_device * __init hp_probe(int unit) |
113 | { | 107 | { |
@@ -444,6 +438,12 @@ init_module(void) | |||
444 | return -ENXIO; | 438 | return -ENXIO; |
445 | } | 439 | } |
446 | 440 | ||
441 | static void cleanup_card(struct net_device *dev) | ||
442 | { | ||
443 | free_irq(dev->irq, dev); | ||
444 | release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); | ||
445 | } | ||
446 | |||
447 | void | 447 | void |
448 | cleanup_module(void) | 448 | cleanup_module(void) |
449 | { | 449 | { |
diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h index 644edbff4f94..c2dae6092c4c 100644 --- a/drivers/net/ibm_emac/ibm_emac.h +++ b/drivers/net/ibm_emac/ibm_emac.h | |||
@@ -110,6 +110,7 @@ struct emac_regs { | |||
110 | #define EMAC_MR1_TFS_2K 0x00080000 | 110 | #define EMAC_MR1_TFS_2K 0x00080000 |
111 | #define EMAC_MR1_TR0_MULT 0x00008000 | 111 | #define EMAC_MR1_TR0_MULT 0x00008000 |
112 | #define EMAC_MR1_JPSM 0x00000000 | 112 | #define EMAC_MR1_JPSM 0x00000000 |
113 | #define EMAC_MR1_MWSW_001 0x00000000 | ||
113 | #define EMAC_MR1_BASE(opb) (EMAC_MR1_TFS_2K | EMAC_MR1_TR0_MULT) | 114 | #define EMAC_MR1_BASE(opb) (EMAC_MR1_TFS_2K | EMAC_MR1_TR0_MULT) |
114 | #else | 115 | #else |
115 | #define EMAC_MR1_RFS_4K 0x00180000 | 116 | #define EMAC_MR1_RFS_4K 0x00180000 |
@@ -130,7 +131,7 @@ struct emac_regs { | |||
130 | (freq) <= 83 ? EMAC_MR1_OBCI_83 : \ | 131 | (freq) <= 83 ? EMAC_MR1_OBCI_83 : \ |
131 | (freq) <= 100 ? EMAC_MR1_OBCI_100 : EMAC_MR1_OBCI_100P) | 132 | (freq) <= 100 ? EMAC_MR1_OBCI_100 : EMAC_MR1_OBCI_100P) |
132 | #define EMAC_MR1_BASE(opb) (EMAC_MR1_TFS_2K | EMAC_MR1_TR | \ | 133 | #define EMAC_MR1_BASE(opb) (EMAC_MR1_TFS_2K | EMAC_MR1_TR | \ |
133 | EMAC_MR1_MWSW_001 | EMAC_MR1_OBCI(opb)) | 134 | EMAC_MR1_OBCI(opb)) |
134 | #endif | 135 | #endif |
135 | 136 | ||
136 | /* EMACx_TMR0 */ | 137 | /* EMACx_TMR0 */ |
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c index 1da8a66f91e1..591c5864ffb1 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c | |||
@@ -408,7 +408,7 @@ static int emac_configure(struct ocp_enet_private *dev) | |||
408 | /* Mode register */ | 408 | /* Mode register */ |
409 | r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST; | 409 | r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST; |
410 | if (dev->phy.duplex == DUPLEX_FULL) | 410 | if (dev->phy.duplex == DUPLEX_FULL) |
411 | r |= EMAC_MR1_FDE; | 411 | r |= EMAC_MR1_FDE | EMAC_MR1_MWSW_001; |
412 | dev->stop_timeout = STOP_TIMEOUT_10; | 412 | dev->stop_timeout = STOP_TIMEOUT_10; |
413 | switch (dev->phy.speed) { | 413 | switch (dev->phy.speed) { |
414 | case SPEED_1000: | 414 | case SPEED_1000: |
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 1d75ca0bb939..d1d714faa6ce 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -309,17 +309,6 @@ static void lance_tx_timeout (struct net_device *dev); | |||
309 | 309 | ||
310 | 310 | ||
311 | 311 | ||
312 | static void cleanup_card(struct net_device *dev) | ||
313 | { | ||
314 | struct lance_private *lp = dev->priv; | ||
315 | if (dev->dma != 4) | ||
316 | free_dma(dev->dma); | ||
317 | release_region(dev->base_addr, LANCE_TOTAL_SIZE); | ||
318 | kfree(lp->tx_bounce_buffs); | ||
319 | kfree((void*)lp->rx_buffs); | ||
320 | kfree(lp); | ||
321 | } | ||
322 | |||
323 | #ifdef MODULE | 312 | #ifdef MODULE |
324 | #define MAX_CARDS 8 /* Max number of interfaces (cards) per module */ | 313 | #define MAX_CARDS 8 /* Max number of interfaces (cards) per module */ |
325 | 314 | ||
@@ -367,6 +356,17 @@ int init_module(void) | |||
367 | return -ENXIO; | 356 | return -ENXIO; |
368 | } | 357 | } |
369 | 358 | ||
359 | static void cleanup_card(struct net_device *dev) | ||
360 | { | ||
361 | struct lance_private *lp = dev->priv; | ||
362 | if (dev->dma != 4) | ||
363 | free_dma(dev->dma); | ||
364 | release_region(dev->base_addr, LANCE_TOTAL_SIZE); | ||
365 | kfree(lp->tx_bounce_buffs); | ||
366 | kfree((void*)lp->rx_buffs); | ||
367 | kfree(lp); | ||
368 | } | ||
369 | |||
370 | void cleanup_module(void) | 370 | void cleanup_module(void) |
371 | { | 371 | { |
372 | int this_dev; | 372 | int this_dev; |
diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c index 309d254842cf..646e89fc3562 100644 --- a/drivers/net/lne390.c +++ b/drivers/net/lne390.c | |||
@@ -145,13 +145,6 @@ static int __init do_lne390_probe(struct net_device *dev) | |||
145 | return -ENODEV; | 145 | return -ENODEV; |
146 | } | 146 | } |
147 | 147 | ||
148 | static void cleanup_card(struct net_device *dev) | ||
149 | { | ||
150 | free_irq(dev->irq, dev); | ||
151 | release_region(dev->base_addr, LNE390_IO_EXTENT); | ||
152 | iounmap(ei_status.mem); | ||
153 | } | ||
154 | |||
155 | #ifndef MODULE | 148 | #ifndef MODULE |
156 | struct net_device * __init lne390_probe(int unit) | 149 | struct net_device * __init lne390_probe(int unit) |
157 | { | 150 | { |
@@ -440,6 +433,13 @@ int init_module(void) | |||
440 | return -ENXIO; | 433 | return -ENXIO; |
441 | } | 434 | } |
442 | 435 | ||
436 | static void cleanup_card(struct net_device *dev) | ||
437 | { | ||
438 | free_irq(dev->irq, dev); | ||
439 | release_region(dev->base_addr, LNE390_IO_EXTENT); | ||
440 | iounmap(ei_status.mem); | ||
441 | } | ||
442 | |||
443 | void cleanup_module(void) | 443 | void cleanup_module(void) |
444 | { | 444 | { |
445 | int this_dev; | 445 | int this_dev; |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 3cb9b3fe0cf1..22c3a37bba5a 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (C) 2002 rabeeh@galileo.co.il | 6 | * Copyright (C) 2002 rabeeh@galileo.co.il |
7 | * | 7 | * |
8 | * Copyright (C) 2003 PMC-Sierra, Inc., | 8 | * Copyright (C) 2003 PMC-Sierra, Inc., |
9 | * written by Manish Lachwani (lachwani@pmc-sierra.com) | 9 | * written by Manish Lachwani |
10 | * | 10 | * |
11 | * Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org> | 11 | * Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org> |
12 | * | 12 | * |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 0de8fdd2aa86..94f782d51f0f 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -212,15 +212,6 @@ static int __init do_ne_probe(struct net_device *dev) | |||
212 | return -ENODEV; | 212 | return -ENODEV; |
213 | } | 213 | } |
214 | 214 | ||
215 | static void cleanup_card(struct net_device *dev) | ||
216 | { | ||
217 | struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; | ||
218 | if (idev) | ||
219 | pnp_device_detach(idev); | ||
220 | free_irq(dev->irq, dev); | ||
221 | release_region(dev->base_addr, NE_IO_EXTENT); | ||
222 | } | ||
223 | |||
224 | #ifndef MODULE | 215 | #ifndef MODULE |
225 | struct net_device * __init ne_probe(int unit) | 216 | struct net_device * __init ne_probe(int unit) |
226 | { | 217 | { |
@@ -859,6 +850,15 @@ int init_module(void) | |||
859 | return -ENODEV; | 850 | return -ENODEV; |
860 | } | 851 | } |
861 | 852 | ||
853 | static void cleanup_card(struct net_device *dev) | ||
854 | { | ||
855 | struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; | ||
856 | if (idev) | ||
857 | pnp_device_detach(idev); | ||
858 | free_irq(dev->irq, dev); | ||
859 | release_region(dev->base_addr, NE_IO_EXTENT); | ||
860 | } | ||
861 | |||
862 | void cleanup_module(void) | 862 | void cleanup_module(void) |
863 | { | 863 | { |
864 | int this_dev; | 864 | int this_dev; |
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c index 6d62ada85de6..e6df375a1d4b 100644 --- a/drivers/net/ne2.c +++ b/drivers/net/ne2.c | |||
@@ -278,14 +278,6 @@ static int __init do_ne2_probe(struct net_device *dev) | |||
278 | return -ENODEV; | 278 | return -ENODEV; |
279 | } | 279 | } |
280 | 280 | ||
281 | static void cleanup_card(struct net_device *dev) | ||
282 | { | ||
283 | mca_mark_as_unused(ei_status.priv); | ||
284 | mca_set_adapter_procfn( ei_status.priv, NULL, NULL); | ||
285 | free_irq(dev->irq, dev); | ||
286 | release_region(dev->base_addr, NE_IO_EXTENT); | ||
287 | } | ||
288 | |||
289 | #ifndef MODULE | 281 | #ifndef MODULE |
290 | struct net_device * __init ne2_probe(int unit) | 282 | struct net_device * __init ne2_probe(int unit) |
291 | { | 283 | { |
@@ -812,6 +804,14 @@ int init_module(void) | |||
812 | return -ENXIO; | 804 | return -ENXIO; |
813 | } | 805 | } |
814 | 806 | ||
807 | static void cleanup_card(struct net_device *dev) | ||
808 | { | ||
809 | mca_mark_as_unused(ei_status.priv); | ||
810 | mca_set_adapter_procfn( ei_status.priv, NULL, NULL); | ||
811 | free_irq(dev->irq, dev); | ||
812 | release_region(dev->base_addr, NE_IO_EXTENT); | ||
813 | } | ||
814 | |||
815 | void cleanup_module(void) | 815 | void cleanup_module(void) |
816 | { | 816 | { |
817 | int this_dev; | 817 | int this_dev; |
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 9a76ac180b11..197edd74fbb5 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -282,26 +282,22 @@ SK_U32 Val) /* pointer to store the read value */ | |||
282 | * Description: | 282 | * Description: |
283 | * This function initialize the PCI resources and IO | 283 | * This function initialize the PCI resources and IO |
284 | * | 284 | * |
285 | * Returns: N/A | 285 | * Returns: |
286 | * | 286 | * 0 - indicate everything worked ok. |
287 | * != 0 - error indication | ||
287 | */ | 288 | */ |
288 | int SkGeInitPCI(SK_AC *pAC) | 289 | static __devinit int SkGeInitPCI(SK_AC *pAC) |
289 | { | 290 | { |
290 | struct SK_NET_DEVICE *dev = pAC->dev[0]; | 291 | struct SK_NET_DEVICE *dev = pAC->dev[0]; |
291 | struct pci_dev *pdev = pAC->PciDev; | 292 | struct pci_dev *pdev = pAC->PciDev; |
292 | int retval; | 293 | int retval; |
293 | 294 | ||
294 | if (pci_enable_device(pdev) != 0) { | ||
295 | return 1; | ||
296 | } | ||
297 | |||
298 | dev->mem_start = pci_resource_start (pdev, 0); | 295 | dev->mem_start = pci_resource_start (pdev, 0); |
299 | pci_set_master(pdev); | 296 | pci_set_master(pdev); |
300 | 297 | ||
301 | if (pci_request_regions(pdev, "sk98lin") != 0) { | 298 | retval = pci_request_regions(pdev, "sk98lin"); |
302 | retval = 2; | 299 | if (retval) |
303 | goto out_disable; | 300 | goto out; |
304 | } | ||
305 | 301 | ||
306 | #ifdef SK_BIG_ENDIAN | 302 | #ifdef SK_BIG_ENDIAN |
307 | /* | 303 | /* |
@@ -320,9 +316,8 @@ int SkGeInitPCI(SK_AC *pAC) | |||
320 | * Remap the regs into kernel space. | 316 | * Remap the regs into kernel space. |
321 | */ | 317 | */ |
322 | pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000); | 318 | pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000); |
323 | 319 | if (!pAC->IoBase) { | |
324 | if (!pAC->IoBase){ | 320 | retval = -EIO; |
325 | retval = 3; | ||
326 | goto out_release; | 321 | goto out_release; |
327 | } | 322 | } |
328 | 323 | ||
@@ -330,8 +325,7 @@ int SkGeInitPCI(SK_AC *pAC) | |||
330 | 325 | ||
331 | out_release: | 326 | out_release: |
332 | pci_release_regions(pdev); | 327 | pci_release_regions(pdev); |
333 | out_disable: | 328 | out: |
334 | pci_disable_device(pdev); | ||
335 | return retval; | 329 | return retval; |
336 | } | 330 | } |
337 | 331 | ||
@@ -492,7 +486,7 @@ module_param_array(AutoSizing, charp, NULL, 0); | |||
492 | * 0, if everything is ok | 486 | * 0, if everything is ok |
493 | * !=0, on error | 487 | * !=0, on error |
494 | */ | 488 | */ |
495 | static int __init SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC) | 489 | static int __devinit SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC) |
496 | { | 490 | { |
497 | short i; | 491 | short i; |
498 | unsigned long Flags; | 492 | unsigned long Flags; |
@@ -529,7 +523,7 @@ SK_BOOL DualNet; | |||
529 | if (SkGeInit(pAC, pAC->IoBase, SK_INIT_DATA) != 0) { | 523 | if (SkGeInit(pAC, pAC->IoBase, SK_INIT_DATA) != 0) { |
530 | printk("HWInit (0) failed.\n"); | 524 | printk("HWInit (0) failed.\n"); |
531 | spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); | 525 | spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); |
532 | return(-EAGAIN); | 526 | return -EIO; |
533 | } | 527 | } |
534 | SkI2cInit( pAC, pAC->IoBase, SK_INIT_DATA); | 528 | SkI2cInit( pAC, pAC->IoBase, SK_INIT_DATA); |
535 | SkEventInit(pAC, pAC->IoBase, SK_INIT_DATA); | 529 | SkEventInit(pAC, pAC->IoBase, SK_INIT_DATA); |
@@ -551,7 +545,7 @@ SK_BOOL DualNet; | |||
551 | if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) { | 545 | if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) { |
552 | printk("sk98lin: HWInit (1) failed.\n"); | 546 | printk("sk98lin: HWInit (1) failed.\n"); |
553 | spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); | 547 | spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); |
554 | return(-EAGAIN); | 548 | return -EIO; |
555 | } | 549 | } |
556 | SkI2cInit( pAC, pAC->IoBase, SK_INIT_IO); | 550 | SkI2cInit( pAC, pAC->IoBase, SK_INIT_IO); |
557 | SkEventInit(pAC, pAC->IoBase, SK_INIT_IO); | 551 | SkEventInit(pAC, pAC->IoBase, SK_INIT_IO); |
@@ -583,20 +577,20 @@ SK_BOOL DualNet; | |||
583 | } else { | 577 | } else { |
584 | printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n", | 578 | printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n", |
585 | pAC->GIni.GIMacsFound); | 579 | pAC->GIni.GIMacsFound); |
586 | return -EAGAIN; | 580 | return -EIO; |
587 | } | 581 | } |
588 | 582 | ||
589 | if (Ret) { | 583 | if (Ret) { |
590 | printk(KERN_WARNING "sk98lin: Requested IRQ %d is busy.\n", | 584 | printk(KERN_WARNING "sk98lin: Requested IRQ %d is busy.\n", |
591 | dev->irq); | 585 | dev->irq); |
592 | return -EAGAIN; | 586 | return Ret; |
593 | } | 587 | } |
594 | pAC->AllocFlag |= SK_ALLOC_IRQ; | 588 | pAC->AllocFlag |= SK_ALLOC_IRQ; |
595 | 589 | ||
596 | /* Alloc memory for this board (Mem for RxD/TxD) : */ | 590 | /* Alloc memory for this board (Mem for RxD/TxD) : */ |
597 | if(!BoardAllocMem(pAC)) { | 591 | if(!BoardAllocMem(pAC)) { |
598 | printk("No memory for descriptor rings.\n"); | 592 | printk("No memory for descriptor rings.\n"); |
599 | return(-EAGAIN); | 593 | return -ENOMEM; |
600 | } | 594 | } |
601 | 595 | ||
602 | BoardInitMem(pAC); | 596 | BoardInitMem(pAC); |
@@ -612,7 +606,7 @@ SK_BOOL DualNet; | |||
612 | DualNet)) { | 606 | DualNet)) { |
613 | BoardFreeMem(pAC); | 607 | BoardFreeMem(pAC); |
614 | printk("sk98lin: SkGeInitAssignRamToQueues failed.\n"); | 608 | printk("sk98lin: SkGeInitAssignRamToQueues failed.\n"); |
615 | return(-EAGAIN); | 609 | return -EIO; |
616 | } | 610 | } |
617 | 611 | ||
618 | return (0); | 612 | return (0); |
@@ -633,8 +627,7 @@ SK_BOOL DualNet; | |||
633 | * SK_TRUE, if all memory could be allocated | 627 | * SK_TRUE, if all memory could be allocated |
634 | * SK_FALSE, if not | 628 | * SK_FALSE, if not |
635 | */ | 629 | */ |
636 | static SK_BOOL BoardAllocMem( | 630 | static __devinit SK_BOOL BoardAllocMem(SK_AC *pAC) |
637 | SK_AC *pAC) | ||
638 | { | 631 | { |
639 | caddr_t pDescrMem; /* pointer to descriptor memory area */ | 632 | caddr_t pDescrMem; /* pointer to descriptor memory area */ |
640 | size_t AllocLength; /* length of complete descriptor area */ | 633 | size_t AllocLength; /* length of complete descriptor area */ |
@@ -727,8 +720,7 @@ size_t AllocLength; /* length of complete descriptor area */ | |||
727 | * | 720 | * |
728 | * Returns: N/A | 721 | * Returns: N/A |
729 | */ | 722 | */ |
730 | static void BoardInitMem( | 723 | static __devinit void BoardInitMem(SK_AC *pAC) |
731 | SK_AC *pAC) /* pointer to adapter context */ | ||
732 | { | 724 | { |
733 | int i; /* loop counter */ | 725 | int i; /* loop counter */ |
734 | int RxDescrSize; /* the size of a rx descriptor rounded up to alignment*/ | 726 | int RxDescrSize; /* the size of a rx descriptor rounded up to alignment*/ |
@@ -4776,32 +4768,47 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4776 | struct net_device *dev = NULL; | 4768 | struct net_device *dev = NULL; |
4777 | static int boards_found = 0; | 4769 | static int boards_found = 0; |
4778 | int error = -ENODEV; | 4770 | int error = -ENODEV; |
4771 | int using_dac = 0; | ||
4779 | char DeviceStr[80]; | 4772 | char DeviceStr[80]; |
4780 | 4773 | ||
4781 | if (pci_enable_device(pdev)) | 4774 | if (pci_enable_device(pdev)) |
4782 | goto out; | 4775 | goto out; |
4783 | 4776 | ||
4784 | /* Configure DMA attributes. */ | 4777 | /* Configure DMA attributes. */ |
4785 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) && | 4778 | if (sizeof(dma_addr_t) > sizeof(u32) && |
4786 | pci_set_dma_mask(pdev, DMA_32BIT_MASK)) | 4779 | !(error = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { |
4787 | goto out_disable_device; | 4780 | using_dac = 1; |
4788 | 4781 | error = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); | |
4782 | if (error < 0) { | ||
4783 | printk(KERN_ERR "sk98lin %s unable to obtain 64 bit DMA " | ||
4784 | "for consistent allocations\n", pci_name(pdev)); | ||
4785 | goto out_disable_device; | ||
4786 | } | ||
4787 | } else { | ||
4788 | error = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | ||
4789 | if (error) { | ||
4790 | printk(KERN_ERR "sk98lin %s no usable DMA configuration\n", | ||
4791 | pci_name(pdev)); | ||
4792 | goto out_disable_device; | ||
4793 | } | ||
4794 | } | ||
4789 | 4795 | ||
4790 | if ((dev = alloc_etherdev(sizeof(DEV_NET))) == NULL) { | 4796 | error = -ENOMEM; |
4791 | printk(KERN_ERR "Unable to allocate etherdev " | 4797 | dev = alloc_etherdev(sizeof(DEV_NET)); |
4798 | if (!dev) { | ||
4799 | printk(KERN_ERR "sk98lin: unable to allocate etherdev " | ||
4792 | "structure!\n"); | 4800 | "structure!\n"); |
4793 | goto out_disable_device; | 4801 | goto out_disable_device; |
4794 | } | 4802 | } |
4795 | 4803 | ||
4796 | pNet = netdev_priv(dev); | 4804 | pNet = netdev_priv(dev); |
4797 | pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL); | 4805 | pNet->pAC = kzalloc(sizeof(SK_AC), GFP_KERNEL); |
4798 | if (!pNet->pAC) { | 4806 | if (!pNet->pAC) { |
4799 | printk(KERN_ERR "Unable to allocate adapter " | 4807 | printk(KERN_ERR "sk98lin: unable to allocate adapter " |
4800 | "structure!\n"); | 4808 | "structure!\n"); |
4801 | goto out_free_netdev; | 4809 | goto out_free_netdev; |
4802 | } | 4810 | } |
4803 | 4811 | ||
4804 | memset(pNet->pAC, 0, sizeof(SK_AC)); | ||
4805 | pAC = pNet->pAC; | 4812 | pAC = pNet->pAC; |
4806 | pAC->PciDev = pdev; | 4813 | pAC->PciDev = pdev; |
4807 | 4814 | ||
@@ -4810,6 +4817,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4810 | pAC->CheckQueue = SK_FALSE; | 4817 | pAC->CheckQueue = SK_FALSE; |
4811 | 4818 | ||
4812 | dev->irq = pdev->irq; | 4819 | dev->irq = pdev->irq; |
4820 | |||
4813 | error = SkGeInitPCI(pAC); | 4821 | error = SkGeInitPCI(pAC); |
4814 | if (error) { | 4822 | if (error) { |
4815 | printk(KERN_ERR "sk98lin: PCI setup failed: %i\n", error); | 4823 | printk(KERN_ERR "sk98lin: PCI setup failed: %i\n", error); |
@@ -4844,19 +4852,25 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4844 | #endif | 4852 | #endif |
4845 | } | 4853 | } |
4846 | 4854 | ||
4855 | if (using_dac) | ||
4856 | dev->features |= NETIF_F_HIGHDMA; | ||
4857 | |||
4847 | pAC->Index = boards_found++; | 4858 | pAC->Index = boards_found++; |
4848 | 4859 | ||
4849 | if (SkGeBoardInit(dev, pAC)) | 4860 | error = SkGeBoardInit(dev, pAC); |
4861 | if (error) | ||
4850 | goto out_free_netdev; | 4862 | goto out_free_netdev; |
4851 | 4863 | ||
4852 | /* Read Adapter name from VPD */ | 4864 | /* Read Adapter name from VPD */ |
4853 | if (ProductStr(pAC, DeviceStr, sizeof(DeviceStr)) != 0) { | 4865 | if (ProductStr(pAC, DeviceStr, sizeof(DeviceStr)) != 0) { |
4866 | error = -EIO; | ||
4854 | printk(KERN_ERR "sk98lin: Could not read VPD data.\n"); | 4867 | printk(KERN_ERR "sk98lin: Could not read VPD data.\n"); |
4855 | goto out_free_resources; | 4868 | goto out_free_resources; |
4856 | } | 4869 | } |
4857 | 4870 | ||
4858 | /* Register net device */ | 4871 | /* Register net device */ |
4859 | if (register_netdev(dev)) { | 4872 | error = register_netdev(dev); |
4873 | if (error) { | ||
4860 | printk(KERN_ERR "sk98lin: Could not register device.\n"); | 4874 | printk(KERN_ERR "sk98lin: Could not register device.\n"); |
4861 | goto out_free_resources; | 4875 | goto out_free_resources; |
4862 | } | 4876 | } |
@@ -4883,15 +4897,17 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4883 | 4897 | ||
4884 | boards_found++; | 4898 | boards_found++; |
4885 | 4899 | ||
4900 | pci_set_drvdata(pdev, dev); | ||
4901 | |||
4886 | /* More then one port found */ | 4902 | /* More then one port found */ |
4887 | if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) { | 4903 | if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) { |
4888 | if ((dev = alloc_etherdev(sizeof(DEV_NET))) == 0) { | 4904 | dev = alloc_etherdev(sizeof(DEV_NET)); |
4889 | printk(KERN_ERR "Unable to allocate etherdev " | 4905 | if (!dev) { |
4906 | printk(KERN_ERR "sk98lin: unable to allocate etherdev " | ||
4890 | "structure!\n"); | 4907 | "structure!\n"); |
4891 | goto out; | 4908 | goto single_port; |
4892 | } | 4909 | } |
4893 | 4910 | ||
4894 | pAC->dev[1] = dev; | ||
4895 | pNet = netdev_priv(dev); | 4911 | pNet = netdev_priv(dev); |
4896 | pNet->PortNr = 1; | 4912 | pNet->PortNr = 1; |
4897 | pNet->NetNr = 1; | 4913 | pNet->NetNr = 1; |
@@ -4920,20 +4936,28 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4920 | #endif | 4936 | #endif |
4921 | } | 4937 | } |
4922 | 4938 | ||
4923 | if (register_netdev(dev)) { | 4939 | if (using_dac) |
4924 | printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n"); | 4940 | dev->features |= NETIF_F_HIGHDMA; |
4941 | |||
4942 | error = register_netdev(dev); | ||
4943 | if (error) { | ||
4944 | printk(KERN_ERR "sk98lin: Could not register device" | ||
4945 | " for second port. (%d)\n", error); | ||
4925 | free_netdev(dev); | 4946 | free_netdev(dev); |
4926 | pAC->dev[1] = pAC->dev[0]; | 4947 | goto single_port; |
4927 | } else { | ||
4928 | memcpy(&dev->dev_addr, | ||
4929 | &pAC->Addr.Net[1].CurrentMacAddress, 6); | ||
4930 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | ||
4931 | |||
4932 | printk("%s: %s\n", dev->name, DeviceStr); | ||
4933 | printk(" PrefPort:B RlmtMode:Dual Check Link State\n"); | ||
4934 | } | 4948 | } |
4949 | |||
4950 | pAC->dev[1] = dev; | ||
4951 | memcpy(&dev->dev_addr, | ||
4952 | &pAC->Addr.Net[1].CurrentMacAddress, 6); | ||
4953 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | ||
4954 | |||
4955 | printk("%s: %s\n", dev->name, DeviceStr); | ||
4956 | printk(" PrefPort:B RlmtMode:Dual Check Link State\n"); | ||
4935 | } | 4957 | } |
4936 | 4958 | ||
4959 | single_port: | ||
4960 | |||
4937 | /* Save the hardware revision */ | 4961 | /* Save the hardware revision */ |
4938 | pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) + | 4962 | pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) + |
4939 | (pAC->GIni.GIPciHwRev & 0x0F); | 4963 | (pAC->GIni.GIPciHwRev & 0x0F); |
@@ -4945,7 +4969,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4945 | memset(&pAC->PnmiBackup, 0, sizeof(SK_PNMI_STRUCT_DATA)); | 4969 | memset(&pAC->PnmiBackup, 0, sizeof(SK_PNMI_STRUCT_DATA)); |
4946 | memcpy(&pAC->PnmiBackup, &pAC->PnmiStruct, sizeof(SK_PNMI_STRUCT_DATA)); | 4970 | memcpy(&pAC->PnmiBackup, &pAC->PnmiStruct, sizeof(SK_PNMI_STRUCT_DATA)); |
4947 | 4971 | ||
4948 | pci_set_drvdata(pdev, dev); | ||
4949 | return 0; | 4972 | return 0; |
4950 | 4973 | ||
4951 | out_free_resources: | 4974 | out_free_resources: |
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index ba8593ac3f8a..3db30cd0625e 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c | |||
@@ -168,18 +168,6 @@ static int __init do_ultra_probe(struct net_device *dev) | |||
168 | return -ENODEV; | 168 | return -ENODEV; |
169 | } | 169 | } |
170 | 170 | ||
171 | static void cleanup_card(struct net_device *dev) | ||
172 | { | ||
173 | /* NB: ultra_close_card() does free_irq */ | ||
174 | #ifdef __ISAPNP__ | ||
175 | struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; | ||
176 | if (idev) | ||
177 | pnp_device_detach(idev); | ||
178 | #endif | ||
179 | release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT); | ||
180 | iounmap(ei_status.mem); | ||
181 | } | ||
182 | |||
183 | #ifndef MODULE | 171 | #ifndef MODULE |
184 | struct net_device * __init ultra_probe(int unit) | 172 | struct net_device * __init ultra_probe(int unit) |
185 | { | 173 | { |
@@ -594,6 +582,18 @@ init_module(void) | |||
594 | return -ENXIO; | 582 | return -ENXIO; |
595 | } | 583 | } |
596 | 584 | ||
585 | static void cleanup_card(struct net_device *dev) | ||
586 | { | ||
587 | /* NB: ultra_close_card() does free_irq */ | ||
588 | #ifdef __ISAPNP__ | ||
589 | struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; | ||
590 | if (idev) | ||
591 | pnp_device_detach(idev); | ||
592 | #endif | ||
593 | release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT); | ||
594 | iounmap(ei_status.mem); | ||
595 | } | ||
596 | |||
597 | void | 597 | void |
598 | cleanup_module(void) | 598 | cleanup_module(void) |
599 | { | 599 | { |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 125ed00e95a5..c67c91251d04 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1564,7 +1564,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1564 | dev->dev_addr, 6); | 1564 | dev->dev_addr, 6); |
1565 | } | 1565 | } |
1566 | #endif | 1566 | #endif |
1567 | #if defined(__i386__) /* Patch up x86 BIOS bug. */ | 1567 | #if defined(__i386__) || defined(__x86_64__) /* Patch up x86 BIOS bug. */ |
1568 | if (last_irq) | 1568 | if (last_irq) |
1569 | irq = last_irq; | 1569 | irq = last_irq; |
1570 | #endif | 1570 | #endif |
diff --git a/drivers/net/wd.c b/drivers/net/wd.c index b03feae459fc..7caa8dc88a58 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c | |||
@@ -127,13 +127,6 @@ static int __init do_wd_probe(struct net_device *dev) | |||
127 | return -ENODEV; | 127 | return -ENODEV; |
128 | } | 128 | } |
129 | 129 | ||
130 | static void cleanup_card(struct net_device *dev) | ||
131 | { | ||
132 | free_irq(dev->irq, dev); | ||
133 | release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT); | ||
134 | iounmap(ei_status.mem); | ||
135 | } | ||
136 | |||
137 | #ifndef MODULE | 130 | #ifndef MODULE |
138 | struct net_device * __init wd_probe(int unit) | 131 | struct net_device * __init wd_probe(int unit) |
139 | { | 132 | { |
@@ -538,6 +531,13 @@ init_module(void) | |||
538 | return -ENXIO; | 531 | return -ENXIO; |
539 | } | 532 | } |
540 | 533 | ||
534 | static void cleanup_card(struct net_device *dev) | ||
535 | { | ||
536 | free_irq(dev->irq, dev); | ||
537 | release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT); | ||
538 | iounmap(ei_status.mem); | ||
539 | } | ||
540 | |||
541 | void | 541 | void |
542 | cleanup_module(void) | 542 | cleanup_module(void) |
543 | { | 543 | { |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 44cd3fcd1572..cf05661fb1bd 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -7153,7 +7153,7 @@ static int ipw2100_wx_get_range(struct net_device *dev, | |||
7153 | 7153 | ||
7154 | /* Set the Wireless Extension versions */ | 7154 | /* Set the Wireless Extension versions */ |
7155 | range->we_version_compiled = WIRELESS_EXT; | 7155 | range->we_version_compiled = WIRELESS_EXT; |
7156 | range->we_version_source = 16; | 7156 | range->we_version_source = 18; |
7157 | 7157 | ||
7158 | // range->retry_capa; /* What retry options are supported */ | 7158 | // range->retry_capa; /* What retry options are supported */ |
7159 | // range->retry_flags; /* How to decode max/min retry limit */ | 7159 | // range->retry_flags; /* How to decode max/min retry limit */ |
@@ -7184,6 +7184,9 @@ static int ipw2100_wx_get_range(struct net_device *dev, | |||
7184 | IW_EVENT_CAPA_MASK(SIOCGIWAP)); | 7184 | IW_EVENT_CAPA_MASK(SIOCGIWAP)); |
7185 | range->event_capa[1] = IW_EVENT_CAPA_K_1; | 7185 | range->event_capa[1] = IW_EVENT_CAPA_K_1; |
7186 | 7186 | ||
7187 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | | ||
7188 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; | ||
7189 | |||
7187 | IPW_DEBUG_WX("GET Range\n"); | 7190 | IPW_DEBUG_WX("GET Range\n"); |
7188 | 7191 | ||
7189 | return 0; | 7192 | return 0; |