aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/tokenring
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r--drivers/net/tokenring/3c359.c11
-rw-r--r--drivers/net/tokenring/abyss.c2
-rw-r--r--drivers/net/tokenring/ibmtr.c8
-rw-r--r--drivers/net/tokenring/lanstreamer.c17
-rw-r--r--drivers/net/tokenring/madgemc.c1
-rw-r--r--drivers/net/tokenring/olympic.c11
-rw-r--r--drivers/net/tokenring/smctr.c89
-rw-r--r--drivers/net/tokenring/tms380tr.c39
-rw-r--r--drivers/net/tokenring/tmspci.c2
9 files changed, 86 insertions, 94 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 724158966ec1..7d7f3eef1ab3 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -63,6 +63,7 @@
63#include <linux/spinlock.h> 63#include <linux/spinlock.h>
64#include <linux/bitops.h> 64#include <linux/bitops.h>
65#include <linux/firmware.h> 65#include <linux/firmware.h>
66#include <linux/slab.h>
66 67
67#include <net/checksum.h> 68#include <net/checksum.h>
68 69
@@ -117,7 +118,7 @@ MODULE_PARM_DESC(message_level, "3c359: Level of reported messages") ;
117 * will be stuck with 1555 lines of hex #'s in the code. 118 * will be stuck with 1555 lines of hex #'s in the code.
118 */ 119 */
119 120
120static struct pci_device_id xl_pci_tbl[] = 121static DEFINE_PCI_DEVICE_TABLE(xl_pci_tbl) =
121{ 122{
122 {PCI_VENDOR_ID_3COM,PCI_DEVICE_ID_3COM_3C359, PCI_ANY_ID, PCI_ANY_ID, }, 123 {PCI_VENDOR_ID_3COM,PCI_DEVICE_ID_3COM_3C359, PCI_ANY_ID, PCI_ANY_ID, },
123 { } /* terminate list */ 124 { } /* terminate list */
@@ -610,9 +611,8 @@ static int xl_open(struct net_device *dev)
610 611
611 u16 switchsettings, switchsettings_eeprom ; 612 u16 switchsettings, switchsettings_eeprom ;
612 613
613 if(request_irq(dev->irq, &xl_interrupt, IRQF_SHARED , "3c359", dev)) { 614 if (request_irq(dev->irq, xl_interrupt, IRQF_SHARED , "3c359", dev))
614 return -EAGAIN; 615 return -EAGAIN;
615 }
616 616
617 /* 617 /*
618 * Read the information from the EEPROM that we need. 618 * Read the information from the EEPROM that we need.
@@ -1391,10 +1391,9 @@ static int xl_close(struct net_device *dev)
1391static void xl_set_rx_mode(struct net_device *dev) 1391static void xl_set_rx_mode(struct net_device *dev)
1392{ 1392{
1393 struct xl_private *xl_priv = netdev_priv(dev); 1393 struct xl_private *xl_priv = netdev_priv(dev);
1394 struct dev_mc_list *dmi ; 1394 struct dev_mc_list *dmi;
1395 unsigned char dev_mc_address[4] ; 1395 unsigned char dev_mc_address[4] ;
1396 u16 options ; 1396 u16 options ;
1397 int i ;
1398 1397
1399 if (dev->flags & IFF_PROMISC) 1398 if (dev->flags & IFF_PROMISC)
1400 options = 0x0004 ; 1399 options = 0x0004 ;
@@ -1409,7 +1408,7 @@ static void xl_set_rx_mode(struct net_device *dev)
1409 1408
1410 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 1409 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
1411 1410
1412 for (i=0,dmi=dev->mc_list;i < dev->mc_count; i++,dmi = dmi->next) { 1411 netdev_for_each_mc_addr(dmi, dev) {
1413 dev_mc_address[0] |= dmi->dmi_addr[2] ; 1412 dev_mc_address[0] |= dmi->dmi_addr[2] ;
1414 dev_mc_address[1] |= dmi->dmi_addr[3] ; 1413 dev_mc_address[1] |= dmi->dmi_addr[3] ;
1415 dev_mc_address[2] |= dmi->dmi_addr[4] ; 1414 dev_mc_address[2] |= dmi->dmi_addr[4] ;
diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c
index b9db1b5a58a3..515f122777ab 100644
--- a/drivers/net/tokenring/abyss.c
+++ b/drivers/net/tokenring/abyss.c
@@ -45,7 +45,7 @@ static char version[] __devinitdata =
45 45
46#define ABYSS_IO_EXTENT 64 46#define ABYSS_IO_EXTENT 64
47 47
48static struct pci_device_id abyss_pci_tbl[] = { 48static DEFINE_PCI_DEVICE_TABLE(abyss_pci_tbl) = {
49 { PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_MK2, 49 { PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_MK2,
50 PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_TOKEN_RING << 8, 0x00ffffff, }, 50 PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_TOKEN_RING << 8, 0x00ffffff, },
51 { } /* Terminating entry */ 51 { } /* Terminating entry */
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 75fa32e34fd0..1a0967246e2f 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -96,7 +96,7 @@
96 * 96 *
97 * Change by Mike Sullivan et al.: 97 * Change by Mike Sullivan et al.:
98 * + added turbo card support. No need to use lanaid to configure 98 * + added turbo card support. No need to use lanaid to configure
99 * the adapter into isa compatiblity mode. 99 * the adapter into isa compatibility mode.
100 * 100 *
101 * Changes by Burt Silverman to allow the computer to behave nicely when 101 * Changes by Burt Silverman to allow the computer to behave nicely when
102 * a cable is pulled or not in place, or a PCMCIA card is removed hot. 102 * a cable is pulled or not in place, or a PCMCIA card is removed hot.
@@ -680,7 +680,7 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
680 680
681 /* The PCMCIA has already got the interrupt line and the io port, 681 /* The PCMCIA has already got the interrupt line and the io port,
682 so no chance of anybody else getting it - MLP */ 682 so no chance of anybody else getting it - MLP */
683 if (request_irq(dev->irq = irq, &tok_interrupt, 0, "ibmtr", dev) != 0) { 683 if (request_irq(dev->irq = irq, tok_interrupt, 0, "ibmtr", dev) != 0) {
684 DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", 684 DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n",
685 irq); 685 irq);
686 iounmap(t_mmio); 686 iounmap(t_mmio);
@@ -995,13 +995,11 @@ static void tok_set_multicast_list(struct net_device *dev)
995 /*BMS ifconfig tr down or hot unplug a PCMCIA card ??hownowbrowncow*/ 995 /*BMS ifconfig tr down or hot unplug a PCMCIA card ??hownowbrowncow*/
996 if (/*BMSHELPdev->start == 0 ||*/ ti->open_status != OPEN) return; 996 if (/*BMSHELPdev->start == 0 ||*/ ti->open_status != OPEN) return;
997 address[0] = address[1] = address[2] = address[3] = 0; 997 address[0] = address[1] = address[2] = address[3] = 0;
998 mclist = dev->mc_list; 998 netdev_for_each_mc_addr(mclist, dev) {
999 for (i = 0; i < dev->mc_count; i++) {
1000 address[0] |= mclist->dmi_addr[2]; 999 address[0] |= mclist->dmi_addr[2];
1001 address[1] |= mclist->dmi_addr[3]; 1000 address[1] |= mclist->dmi_addr[3];
1002 address[2] |= mclist->dmi_addr[4]; 1001 address[2] |= mclist->dmi_addr[4];
1003 address[3] |= mclist->dmi_addr[5]; 1002 address[3] |= mclist->dmi_addr[5];
1004 mclist = mclist->next;
1005 } 1003 }
1006 SET_PAGE(ti->srb_page); 1004 SET_PAGE(ti->srb_page);
1007 for (i = 0; i < sizeof(struct srb_set_funct_addr); i++) 1005 for (i = 0; i < sizeof(struct srb_set_funct_addr); i++)
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 26dca2b2bdbd..7a5fbf5a9d71 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -121,6 +121,7 @@
121#include <linux/spinlock.h> 121#include <linux/spinlock.h>
122#include <linux/bitops.h> 122#include <linux/bitops.h>
123#include <linux/jiffies.h> 123#include <linux/jiffies.h>
124#include <linux/slab.h>
124 125
125#include <net/net_namespace.h> 126#include <net/net_namespace.h>
126#include <net/checksum.h> 127#include <net/checksum.h>
@@ -146,7 +147,7 @@
146static char version[] = "LanStreamer.c v0.4.0 03/08/01 - Mike Sullivan\n" 147static char version[] = "LanStreamer.c v0.4.0 03/08/01 - Mike Sullivan\n"
147 " v0.5.3 11/13/02 - Kent Yoder"; 148 " v0.5.3 11/13/02 - Kent Yoder";
148 149
149static struct pci_device_id streamer_pci_tbl[] = { 150static DEFINE_PCI_DEVICE_TABLE(streamer_pci_tbl) = {
150 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, PCI_ANY_ID, PCI_ANY_ID,}, 151 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, PCI_ANY_ID, PCI_ANY_ID,},
151 {} /* terminating entry */ 152 {} /* terminating entry */
152}; 153};
@@ -596,7 +597,7 @@ static int streamer_open(struct net_device *dev)
596 rc=streamer_reset(dev); 597 rc=streamer_reset(dev);
597 } 598 }
598 599
599 if (request_irq(dev->irq, &streamer_interrupt, IRQF_SHARED, "lanstreamer", dev)) { 600 if (request_irq(dev->irq, streamer_interrupt, IRQF_SHARED, "lanstreamer", dev)) {
600 return -EAGAIN; 601 return -EAGAIN;
601 } 602 }
602#if STREAMER_DEBUG 603#if STREAMER_DEBUG
@@ -712,8 +713,8 @@ static int streamer_open(struct net_device *dev)
712 strcat(open_error, " - "); 713 strcat(open_error, " - ");
713 strcat(open_error, open_min_error[(error_code & 0x0f)]); 714 strcat(open_error, open_min_error[(error_code & 0x0f)]);
714 715
715 if (!streamer_priv->streamer_ring_speed 716 if (!streamer_priv->streamer_ring_speed &&
716 && ((error_code & 0x0f) == 0x0d)) 717 ((error_code & 0x0f) == 0x0d))
717 { 718 {
718 printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n", dev->name); 719 printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n", dev->name);
719 printk(KERN_WARNING "%s: Please try again with a specified ring speed \n", dev->name); 720 printk(KERN_WARNING "%s: Please try again with a specified ring speed \n", dev->name);
@@ -1032,8 +1033,8 @@ static irqreturn_t streamer_interrupt(int irq, void *dev_id)
1032 sisr = readw(streamer_mmio + SISR); 1033 sisr = readw(streamer_mmio + SISR);
1033 1034
1034 while((sisr & (SISR_MI | SISR_SRB_REPLY | SISR_ADAPTER_CHECK | SISR_ASB_FREE | 1035 while((sisr & (SISR_MI | SISR_SRB_REPLY | SISR_ADAPTER_CHECK | SISR_ASB_FREE |
1035 SISR_ARB_CMD | SISR_TRB_REPLY | SISR_PAR_ERR | SISR_SERR_ERR)) 1036 SISR_ARB_CMD | SISR_TRB_REPLY | SISR_PAR_ERR | SISR_SERR_ERR)) &&
1036 && (max_intr > 0)) { 1037 (max_intr > 0)) {
1037 1038
1038 if(sisr & SISR_PAR_ERR) { 1039 if(sisr & SISR_PAR_ERR) {
1039 writew(~SISR_PAR_ERR, streamer_mmio + SISR_RUM); 1040 writew(~SISR_PAR_ERR, streamer_mmio + SISR_RUM);
@@ -1268,7 +1269,6 @@ static void streamer_set_rx_mode(struct net_device *dev)
1268 __u8 options = 0; 1269 __u8 options = 0;
1269 struct dev_mc_list *dmi; 1270 struct dev_mc_list *dmi;
1270 unsigned char dev_mc_address[5]; 1271 unsigned char dev_mc_address[5];
1271 int i;
1272 1272
1273 writel(streamer_priv->srb, streamer_mmio + LAPA); 1273 writel(streamer_priv->srb, streamer_mmio + LAPA);
1274 options = streamer_priv->streamer_copy_all_options; 1274 options = streamer_priv->streamer_copy_all_options;
@@ -1303,8 +1303,7 @@ static void streamer_set_rx_mode(struct net_device *dev)
1303 writel(streamer_priv->srb,streamer_mmio+LAPA); 1303 writel(streamer_priv->srb,streamer_mmio+LAPA);
1304 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 1304 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
1305 1305
1306 for (i=0,dmi=dev->mc_list;i < dev->mc_count; i++,dmi = dmi->next) 1306 netdev_for_each_mc_addr(dmi, dev) {
1307 {
1308 dev_mc_address[0] |= dmi->dmi_addr[2] ; 1307 dev_mc_address[0] |= dmi->dmi_addr[2] ;
1309 dev_mc_address[1] |= dmi->dmi_addr[3] ; 1308 dev_mc_address[1] |= dmi->dmi_addr[3] ;
1310 dev_mc_address[2] |= dmi->dmi_addr[4] ; 1309 dev_mc_address[2] |= dmi->dmi_addr[4] ;
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 456f8bff40be..53f631ebb162 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -21,6 +21,7 @@ static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n";
21 21
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/mca.h> 23#include <linux/mca.h>
24#include <linux/slab.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
25#include <linux/errno.h> 26#include <linux/errno.h>
26#include <linux/init.h> 27#include <linux/init.h>
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index d9ec7f0bbd0a..3a25e0434ae2 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -172,7 +172,7 @@ module_param_array(message_level, int, NULL, 0) ;
172static int network_monitor[OLYMPIC_MAX_ADAPTERS] = {0,}; 172static int network_monitor[OLYMPIC_MAX_ADAPTERS] = {0,};
173module_param_array(network_monitor, int, NULL, 0); 173module_param_array(network_monitor, int, NULL, 0);
174 174
175static struct pci_device_id olympic_pci_tbl[] = { 175static DEFINE_PCI_DEVICE_TABLE(olympic_pci_tbl) = {
176 {PCI_VENDOR_ID_IBM,PCI_DEVICE_ID_IBM_TR_WAKE,PCI_ANY_ID,PCI_ANY_ID,}, 176 {PCI_VENDOR_ID_IBM,PCI_DEVICE_ID_IBM_TR_WAKE,PCI_ANY_ID,PCI_ANY_ID,},
177 { } /* Terminating Entry */ 177 { } /* Terminating Entry */
178}; 178};
@@ -445,9 +445,9 @@ static int olympic_open(struct net_device *dev)
445 445
446 olympic_init(dev); 446 olympic_init(dev);
447 447
448 if(request_irq(dev->irq, &olympic_interrupt, IRQF_SHARED , "olympic", dev)) { 448 if (request_irq(dev->irq, olympic_interrupt, IRQF_SHARED , "olympic",
449 dev))
449 return -EAGAIN; 450 return -EAGAIN;
450 }
451 451
452#if OLYMPIC_DEBUG 452#if OLYMPIC_DEBUG
453 printk("BMCTL: %x\n",readl(olympic_mmio+BMCTL_SUM)); 453 printk("BMCTL: %x\n",readl(olympic_mmio+BMCTL_SUM));
@@ -1139,9 +1139,8 @@ static void olympic_set_rx_mode(struct net_device *dev)
1139 u8 __iomem *olympic_mmio = olympic_priv->olympic_mmio ; 1139 u8 __iomem *olympic_mmio = olympic_priv->olympic_mmio ;
1140 u8 options = 0; 1140 u8 options = 0;
1141 u8 __iomem *srb; 1141 u8 __iomem *srb;
1142 struct dev_mc_list *dmi ; 1142 struct dev_mc_list *dmi;
1143 unsigned char dev_mc_address[4] ; 1143 unsigned char dev_mc_address[4] ;
1144 int i ;
1145 1144
1146 writel(olympic_priv->srb,olympic_mmio+LAPA); 1145 writel(olympic_priv->srb,olympic_mmio+LAPA);
1147 srb=olympic_priv->olympic_lap + (olympic_priv->srb & (~0xf800)); 1146 srb=olympic_priv->olympic_lap + (olympic_priv->srb & (~0xf800));
@@ -1178,7 +1177,7 @@ static void olympic_set_rx_mode(struct net_device *dev)
1178 1177
1179 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 1178 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
1180 1179
1181 for (i=0,dmi=dev->mc_list;i < dev->mc_count; i++,dmi = dmi->next) { 1180 netdev_for_each_mc_addr(dmi, dev) {
1182 dev_mc_address[0] |= dmi->dmi_addr[2] ; 1181 dev_mc_address[0] |= dmi->dmi_addr[2] ;
1183 dev_mc_address[1] |= dmi->dmi_addr[3] ; 1182 dev_mc_address[1] |= dmi->dmi_addr[3] ;
1184 dev_mc_address[2] |= dmi->dmi_addr[4] ; 1183 dev_mc_address[2] |= dmi->dmi_addr[4] ;
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index ebda61bc4c2f..e40560137c46 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -36,7 +36,6 @@
36#include <linux/ptrace.h> 36#include <linux/ptrace.h>
37#include <linux/ioport.h> 37#include <linux/ioport.h>
38#include <linux/in.h> 38#include <linux/in.h>
39#include <linux/slab.h>
40#include <linux/string.h> 39#include <linux/string.h>
41#include <linux/time.h> 40#include <linux/time.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
@@ -426,7 +425,7 @@ static int smctr_alloc_shared_memory(struct net_device *dev)
426 smctr_malloc(dev, 1L); 425 smctr_malloc(dev, 1L);
427 426
428 /* Allocate Non-MAC receive data buffers. 427 /* Allocate Non-MAC receive data buffers.
429 * To guarantee a minimum of 256 contigous memory to 428 * To guarantee a minimum of 256 contiguous memory to
430 * UM_Receive_Packet's lookahead pointer, before a page 429 * UM_Receive_Packet's lookahead pointer, before a page
431 * change or ring end is encountered, place each rx buffer on 430 * change or ring end is encountered, place each rx buffer on
432 * a 256 byte boundary. 431 * a 256 byte boundary.
@@ -2309,9 +2308,9 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
2309 else 2308 else
2310 { 2309 {
2311 if((tp->acb_head->cmd 2310 if((tp->acb_head->cmd
2312 == ACB_CMD_READ_TRC_STATUS) 2311 == ACB_CMD_READ_TRC_STATUS) &&
2313 && (tp->acb_head->subcmd 2312 (tp->acb_head->subcmd
2314 == RW_TRC_STATUS_BLOCK)) 2313 == RW_TRC_STATUS_BLOCK))
2315 { 2314 {
2316 if(tp->ptr_bcn_type) 2315 if(tp->ptr_bcn_type)
2317 { 2316 {
@@ -2331,8 +2330,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
2331 smctr_disable_16bit(dev); 2330 smctr_disable_16bit(dev);
2332 err = smctr_ring_status_chg(dev); 2331 err = smctr_ring_status_chg(dev);
2333 smctr_enable_16bit(dev); 2332 smctr_enable_16bit(dev);
2334 if((tp->ring_status & REMOVE_RECEIVED) 2333 if((tp->ring_status & REMOVE_RECEIVED) &&
2335 && (tp->config_word0 & NO_AUTOREMOVE)) 2334 (tp->config_word0 & NO_AUTOREMOVE))
2336 { 2335 {
2337 smctr_issue_remove_cmd(dev); 2336 smctr_issue_remove_cmd(dev);
2338 } 2337 }
@@ -2511,9 +2510,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev)
2511 tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE; 2510 tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE;
2512 tp->config_word1 = 0; 2511 tp->config_word1 = 0;
2513 2512
2514 if((tp->media_type == MEDIA_STP_16) 2513 if((tp->media_type == MEDIA_STP_16) ||
2515 || (tp->media_type == MEDIA_UTP_16) 2514 (tp->media_type == MEDIA_UTP_16) ||
2516 || (tp->media_type == MEDIA_STP_16_UTP_16)) 2515 (tp->media_type == MEDIA_STP_16_UTP_16))
2517 { 2516 {
2518 tp->config_word0 |= FREQ_16MB_BIT; 2517 tp->config_word0 |= FREQ_16MB_BIT;
2519 } 2518 }
@@ -2556,9 +2555,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev)
2556 tp->config_word1 &= ~SOURCE_ROUTING_SPANNING_BITS; 2555 tp->config_word1 &= ~SOURCE_ROUTING_SPANNING_BITS;
2557 } 2556 }
2558 2557
2559 if((tp->media_type == MEDIA_STP_16) 2558 if((tp->media_type == MEDIA_STP_16) ||
2560 || (tp->media_type == MEDIA_UTP_16) 2559 (tp->media_type == MEDIA_UTP_16) ||
2561 || (tp->media_type == MEDIA_STP_16_UTP_16)) 2560 (tp->media_type == MEDIA_STP_16_UTP_16))
2562 { 2561 {
2563 tp->config_word1 |= INTERFRAME_SPACING_16; 2562 tp->config_word1 |= INTERFRAME_SPACING_16;
2564 } 2563 }
@@ -2568,9 +2567,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev)
2568 *pTimer_Struc++ = tp->config_word0; 2567 *pTimer_Struc++ = tp->config_word0;
2569 *pTimer_Struc++ = tp->config_word1; 2568 *pTimer_Struc++ = tp->config_word1;
2570 2569
2571 if((tp->media_type == MEDIA_STP_4) 2570 if((tp->media_type == MEDIA_STP_4) ||
2572 || (tp->media_type == MEDIA_UTP_4) 2571 (tp->media_type == MEDIA_UTP_4) ||
2573 || (tp->media_type == MEDIA_STP_4_UTP_4)) 2572 (tp->media_type == MEDIA_STP_4_UTP_4))
2574 { 2573 {
2575 *pTimer_Struc++ = 0x00FA; /* prescale */ 2574 *pTimer_Struc++ = 0x00FA; /* prescale */
2576 *pTimer_Struc++ = 0x2710; /* TPT_limit */ 2575 *pTimer_Struc++ = 0x2710; /* TPT_limit */
@@ -2990,8 +2989,8 @@ static int smctr_load_firmware(struct net_device *dev)
2990 } 2989 }
2991 2990
2992 /* Verify the firmware exists and is there in the right amount. */ 2991 /* Verify the firmware exists and is there in the right amount. */
2993 if (!fw->data 2992 if (!fw->data ||
2994 || (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION)) 2993 (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION))
2995 { 2994 {
2996 err = (UCODE_NOT_PRESENT); 2995 err = (UCODE_NOT_PRESENT);
2997 goto out; 2996 goto out;
@@ -3010,9 +3009,8 @@ static int smctr_load_firmware(struct net_device *dev)
3010 smctr_enable_16bit(dev); 3009 smctr_enable_16bit(dev);
3011 smctr_set_page(dev, (__u8 *)tp->ram_access); 3010 smctr_set_page(dev, (__u8 *)tp->ram_access);
3012 3011
3013 if((smctr_checksum_firmware(dev)) 3012 if((smctr_checksum_firmware(dev)) ||
3014 || (*(fw->data + UCODE_VERSION_OFFSET) 3013 (*(fw->data + UCODE_VERSION_OFFSET) > tp->microcode_version))
3015 > tp->microcode_version))
3016 { 3014 {
3017 smctr_enable_adapter_ctrl_store(dev); 3015 smctr_enable_adapter_ctrl_store(dev);
3018 3016
@@ -3117,9 +3115,9 @@ static int smctr_lobe_media_test(struct net_device *dev)
3117 } 3115 }
3118 3116
3119 /* Check if any frames received during test. */ 3117 /* Check if any frames received during test. */
3120 if((tp->rx_fcb_curr[MAC_QUEUE]->frame_status) 3118 if((tp->rx_fcb_curr[MAC_QUEUE]->frame_status) ||
3121 || (tp->rx_fcb_curr[NON_MAC_QUEUE]->frame_status)) 3119 (tp->rx_fcb_curr[NON_MAC_QUEUE]->frame_status))
3122 goto err; 3120 goto err;
3123 3121
3124 /* Set receive mask to "Promisc" mode. */ 3122 /* Set receive mask to "Promisc" mode. */
3125 tp->receive_mask = saved_rcv_mask; 3123 tp->receive_mask = saved_rcv_mask;
@@ -3303,8 +3301,8 @@ static int smctr_make_group_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv)
3303 /* Set Group Address Sub-vector to all zeros if only the 3301 /* Set Group Address Sub-vector to all zeros if only the
3304 * Group Address/Functional Address Indicator is set. 3302 * Group Address/Functional Address Indicator is set.
3305 */ 3303 */
3306 if(tsv->svv[0] == 0x80 && tsv->svv[1] == 0x00 3304 if(tsv->svv[0] == 0x80 && tsv->svv[1] == 0x00 &&
3307 && tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00) 3305 tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00)
3308 tsv->svv[0] = 0x00; 3306 tsv->svv[0] = 0x00;
3309 3307
3310 return (0); 3308 return (0);
@@ -3876,10 +3874,10 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size,
3876 /* NOTE: UNKNOWN MAC frames will NOT be passed up unless 3874 /* NOTE: UNKNOWN MAC frames will NOT be passed up unless
3877 * ACCEPT_ATT_MAC_FRAMES is set. 3875 * ACCEPT_ATT_MAC_FRAMES is set.
3878 */ 3876 */
3879 if(((tp->receive_mask & ACCEPT_ATT_MAC_FRAMES) 3877 if(((tp->receive_mask & ACCEPT_ATT_MAC_FRAMES) &&
3880 && (xframe == (__u8)0)) 3878 (xframe == (__u8)0)) ||
3881 || ((tp->receive_mask & ACCEPT_EXT_MAC_FRAMES) 3879 ((tp->receive_mask & ACCEPT_EXT_MAC_FRAMES) &&
3882 && (xframe == (__u8)1))) 3880 (xframe == (__u8)1)))
3883 { 3881 {
3884 rmf->vl = SWAP_BYTES(rmf->vl); 3882 rmf->vl = SWAP_BYTES(rmf->vl);
3885 3883
@@ -3934,8 +3932,8 @@ static int smctr_ram_memory_test(struct net_device *dev)
3934 3932
3935 word_pattern = start_pattern; 3933 word_pattern = start_pattern;
3936 3934
3937 for(j = 1; j < (__u32)(tp->ram_usable * 1024) - 1 3935 for(j = 1; j < (__u32)(tp->ram_usable * 1024) - 1 && (~err);
3938 && (~err); j += 2, word_pattern++) 3936 j += 2, word_pattern++)
3939 { 3937 {
3940 word_read = *(__u16 *)(pword + j); 3938 word_read = *(__u16 *)(pword + j);
3941 if(word_read != word_pattern) 3939 if(word_read != word_pattern)
@@ -3959,8 +3957,7 @@ static int smctr_ram_memory_test(struct net_device *dev)
3959 for(j = 0; j < (__u32)tp->ram_usable * 1024; j +=2) 3957 for(j = 0; j < (__u32)tp->ram_usable * 1024; j +=2)
3960 *(__u16 *)(pword + j) = word_pattern; 3958 *(__u16 *)(pword + j) = word_pattern;
3961 3959
3962 for(j =0; j < (__u32)tp->ram_usable * 1024 3960 for(j =0; j < (__u32)tp->ram_usable * 1024 && (~err); j += 2)
3963 && (~err); j += 2)
3964 { 3961 {
3965 word_read = *(__u16 *)(pword + j); 3962 word_read = *(__u16 *)(pword + j);
3966 if(word_read != word_pattern) 3963 if(word_read != word_pattern)
@@ -4325,8 +4322,8 @@ static int smctr_restart_tx_chain(struct net_device *dev, short queue)
4325 if(smctr_debug > 10) 4322 if(smctr_debug > 10)
4326 printk(KERN_DEBUG "%s: smctr_restart_tx_chain\n", dev->name); 4323 printk(KERN_DEBUG "%s: smctr_restart_tx_chain\n", dev->name);
4327 4324
4328 if(tp->num_tx_fcbs_used[queue] != 0 4325 if(tp->num_tx_fcbs_used[queue] != 0 &&
4329 && tp->tx_queue_status[queue] == NOT_TRANSMITING) 4326 tp->tx_queue_status[queue] == NOT_TRANSMITING)
4330 { 4327 {
4331 tp->tx_queue_status[queue] = TRANSMITING; 4328 tp->tx_queue_status[queue] = TRANSMITING;
4332 err = smctr_issue_resume_tx_fcb_cmd(dev, queue); 4329 err = smctr_issue_resume_tx_fcb_cmd(dev, queue);
@@ -4349,8 +4346,8 @@ static int smctr_ring_status_chg(struct net_device *dev)
4349 */ 4346 */
4350 if(tp->ring_status_flags == MONITOR_STATE_CHANGED) 4347 if(tp->ring_status_flags == MONITOR_STATE_CHANGED)
4351 { 4348 {
4352 if((tp->monitor_state == MS_ACTIVE_MONITOR_STATE) 4349 if((tp->monitor_state == MS_ACTIVE_MONITOR_STATE) ||
4353 || (tp->monitor_state == MS_STANDBY_MONITOR_STATE)) 4350 (tp->monitor_state == MS_STANDBY_MONITOR_STATE))
4354 { 4351 {
4355 tp->monitor_state_ready = 1; 4352 tp->monitor_state_ready = 1;
4356 } 4353 }
@@ -4363,8 +4360,8 @@ static int smctr_ring_status_chg(struct net_device *dev)
4363 tp->monitor_state_ready = 0; 4360 tp->monitor_state_ready = 0;
4364 4361
4365 /* Ring speed problem, switching to auto mode. */ 4362 /* Ring speed problem, switching to auto mode. */
4366 if(tp->monitor_state == MS_MONITOR_FSM_INACTIVE 4363 if(tp->monitor_state == MS_MONITOR_FSM_INACTIVE &&
4367 && !tp->cleanup) 4364 !tp->cleanup)
4368 { 4365 {
4369 printk(KERN_INFO "%s: Incorrect ring speed switching.\n", 4366 printk(KERN_INFO "%s: Incorrect ring speed switching.\n",
4370 dev->name); 4367 dev->name);
@@ -4442,8 +4439,8 @@ static int smctr_rx_frame(struct net_device *dev)
4442 { 4439 {
4443 err = HARDWARE_FAILED; 4440 err = HARDWARE_FAILED;
4444 4441
4445 if(((status & 0x007f) == 0) 4442 if(((status & 0x007f) == 0) ||
4446 || ((tp->receive_mask & ACCEPT_ERR_PACKETS) != 0)) 4443 ((tp->receive_mask & ACCEPT_ERR_PACKETS) != 0))
4447 { 4444 {
4448 /* frame length less the CRC (4 bytes) + FS (1 byte) */ 4445 /* frame length less the CRC (4 bytes) + FS (1 byte) */
4449 rx_size = tp->rx_fcb_curr[queue]->frame_length - 5; 4446 rx_size = tp->rx_fcb_curr[queue]->frame_length - 5;
@@ -4538,8 +4535,8 @@ static int smctr_send_dat(struct net_device *dev)
4538 } 4535 }
4539 4536
4540 /* Check if GOOD frame Tx'ed. */ 4537 /* Check if GOOD frame Tx'ed. */
4541 if(!(fcb->frame_status & FCB_COMMAND_DONE) 4538 if(!(fcb->frame_status & FCB_COMMAND_DONE) ||
4542 || fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) 4539 fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS))
4543 { 4540 {
4544 return (INITIALIZE_FAILED); 4541 return (INITIALIZE_FAILED);
4545 } 4542 }
@@ -4653,8 +4650,8 @@ static int smctr_send_lobe_media_test(struct net_device *dev)
4653 } 4650 }
4654 4651
4655 /* Check if GOOD frame Tx'ed */ 4652 /* Check if GOOD frame Tx'ed */
4656 if(!(fcb->frame_status & FCB_COMMAND_DONE) 4653 if(!(fcb->frame_status & FCB_COMMAND_DONE) ||
4657 || fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) 4654 fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS))
4658 { 4655 {
4659 return (LOBE_MEDIA_TEST_FAILED); 4656 return (LOBE_MEDIA_TEST_FAILED);
4660 } 4657 }
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index a7b6888829b5..8b508c922410 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -85,7 +85,6 @@ static const char version[] = "tms380tr.c: v1.10 30/12/2002 by Christoph Goos, A
85#include <linux/ptrace.h> 85#include <linux/ptrace.h>
86#include <linux/ioport.h> 86#include <linux/ioport.h>
87#include <linux/in.h> 87#include <linux/in.h>
88#include <linux/slab.h>
89#include <linux/string.h> 88#include <linux/string.h>
90#include <linux/time.h> 89#include <linux/time.h>
91#include <linux/errno.h> 90#include <linux/errno.h>
@@ -693,7 +692,7 @@ static netdev_tx_t tms380tr_hardware_send_packet(struct sk_buff *skb,
693 * NOTE: This function should be used whenever the status of any TPL must be 692 * NOTE: This function should be used whenever the status of any TPL must be
694 * modified by the driver, because the compiler may otherwise change the 693 * modified by the driver, because the compiler may otherwise change the
695 * order of instructions such that writing the TPL status may be executed at 694 * order of instructions such that writing the TPL status may be executed at
696 * an undesireable time. When this function is used, the status is always 695 * an undesirable time. When this function is used, the status is always
697 * written when the function is called. 696 * written when the function is called.
698 */ 697 */
699static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status) 698static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status)
@@ -729,8 +728,8 @@ static void tms380tr_timer_chk(unsigned long data)
729 return; 728 return;
730 729
731 tms380tr_chk_outstanding_cmds(dev); 730 tms380tr_chk_outstanding_cmds(dev);
732 if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) 731 if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) &&
733 && (tp->TplFree != tp->TplBusy)) 732 (tp->TplFree != tp->TplBusy))
734 { 733 {
735 /* Anything to send, but stalled too long */ 734 /* Anything to send, but stalled too long */
736 tp->LastSendTime = jiffies; 735 tp->LastSendTime = jiffies;
@@ -830,8 +829,8 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
830 } 829 }
831 830
832 /* Reset system interrupt if not already done. */ 831 /* Reset system interrupt if not already done. */
833 if(irq_type != STS_IRQ_TRANSMIT_STATUS 832 if(irq_type != STS_IRQ_TRANSMIT_STATUS &&
834 && irq_type != STS_IRQ_RECEIVE_STATUS) { 833 irq_type != STS_IRQ_RECEIVE_STATUS) {
835 tms380tr_reset_interrupt(dev); 834 tms380tr_reset_interrupt(dev);
836 } 835 }
837 836
@@ -895,10 +894,10 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy
895 894
896 /* Check if this interrupt does use the SSB. */ 895 /* Check if this interrupt does use the SSB. */
897 896
898 if(IrqType != STS_IRQ_TRANSMIT_STATUS 897 if(IrqType != STS_IRQ_TRANSMIT_STATUS &&
899 && IrqType != STS_IRQ_RECEIVE_STATUS 898 IrqType != STS_IRQ_RECEIVE_STATUS &&
900 && IrqType != STS_IRQ_COMMAND_STATUS 899 IrqType != STS_IRQ_COMMAND_STATUS &&
901 && IrqType != STS_IRQ_RING_STATUS) 900 IrqType != STS_IRQ_RING_STATUS)
902 { 901 {
903 return (1); /* SSB not involved. */ 902 return (1); /* SSB not involved. */
904 } 903 }
@@ -1212,10 +1211,9 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
1212 } 1211 }
1213 else 1212 else
1214 { 1213 {
1215 int i; 1214 struct dev_mc_list *mclist;
1216 struct dev_mc_list *mclist = dev->mc_list; 1215
1217 for (i=0; i< dev->mc_count; i++) 1216 netdev_for_each_mc_addr(mclist, dev) {
1218 {
1219 ((char *)(&tp->ocpl.FunctAddr))[0] |= 1217 ((char *)(&tp->ocpl.FunctAddr))[0] |=
1220 mclist->dmi_addr[2]; 1218 mclist->dmi_addr[2];
1221 ((char *)(&tp->ocpl.FunctAddr))[1] |= 1219 ((char *)(&tp->ocpl.FunctAddr))[1] |=
@@ -1224,7 +1222,6 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
1224 mclist->dmi_addr[4]; 1222 mclist->dmi_addr[4];
1225 ((char *)(&tp->ocpl.FunctAddr))[3] |= 1223 ((char *)(&tp->ocpl.FunctAddr))[3] |=
1226 mclist->dmi_addr[5]; 1224 mclist->dmi_addr[5];
1227 mclist = mclist->next;
1228 } 1225 }
1229 } 1226 }
1230 tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR); 1227 tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR);
@@ -1364,6 +1361,8 @@ static int tms380tr_reset_adapter(struct net_device *dev)
1364 return (-1); 1361 return (-1);
1365} 1362}
1366 1363
1364MODULE_FIRMWARE("tms380tr.bin");
1365
1367/* 1366/*
1368 * Starts bring up diagnostics of token ring adapter and evaluates 1367 * Starts bring up diagnostics of token ring adapter and evaluates
1369 * diagnostic results. 1368 * diagnostic results.
@@ -1483,8 +1482,8 @@ static int tms380tr_init_adapter(struct net_device *dev)
1483 /* Mask interesting status bits */ 1482 /* Mask interesting status bits */
1484 Status = SIFREADW(SIFSTS); 1483 Status = SIFREADW(SIFSTS);
1485 Status &= STS_MASK; 1484 Status &= STS_MASK;
1486 } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) 1485 } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) &&
1487 && ((Status & STS_ERROR) == 0) && (loop_cnt != 0)); 1486 ((Status & STS_ERROR) == 0) && (loop_cnt != 0));
1488 1487
1489 if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0) 1488 if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0)
1490 { 1489 {
@@ -2181,8 +2180,8 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2181 } 2180 }
2182 } 2181 }
2183 2182
2184 if(skb && (rpl->SkbStat == SKB_DATA_COPY 2183 if(skb && (rpl->SkbStat == SKB_DATA_COPY ||
2185 || rpl->SkbStat == SKB_DMA_DIRECT)) 2184 rpl->SkbStat == SKB_DMA_DIRECT))
2186 { 2185 {
2187 if(rpl->SkbStat == SKB_DATA_COPY) 2186 if(rpl->SkbStat == SKB_DATA_COPY)
2188 skb_copy_to_linear_data(skb, ReceiveDataPtr, 2187 skb_copy_to_linear_data(skb, ReceiveDataPtr,
@@ -2264,7 +2263,7 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2264 * This function should be used whenever the status of any RPL must be 2263 * This function should be used whenever the status of any RPL must be
2265 * modified by the driver, because the compiler may otherwise change the 2264 * modified by the driver, because the compiler may otherwise change the
2266 * order of instructions such that writing the RPL status may be executed 2265 * order of instructions such that writing the RPL status may be executed
2267 * at an undesireable time. When this function is used, the status is 2266 * at an undesirable time. When this function is used, the status is
2268 * always written when the function is called. 2267 * always written when the function is called.
2269 */ 2268 */
2270static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status) 2269static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status)
diff --git a/drivers/net/tokenring/tmspci.c b/drivers/net/tokenring/tmspci.c
index f92fe86fdcae..d4c7c0c0a3d6 100644
--- a/drivers/net/tokenring/tmspci.c
+++ b/drivers/net/tokenring/tmspci.c
@@ -57,7 +57,7 @@ static struct card_info card_info_table[] = {
57 { {0x03, 0x01}, "3Com Token Link Velocity"}, 57 { {0x03, 0x01}, "3Com Token Link Velocity"},
58}; 58};
59 59
60static struct pci_device_id tmspci_pci_tbl[] = { 60static DEFINE_PCI_DEVICE_TABLE(tmspci_pci_tbl) = {
61 { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TOKENRING, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 61 { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TOKENRING, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
62 { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_TR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, 62 { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_TR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
63 { PCI_VENDOR_ID_TCONRAD, PCI_DEVICE_ID_TCONRAD_TOKENRING, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 }, 63 { PCI_VENDOR_ID_TCONRAD, PCI_DEVICE_ID_TCONRAD_TOKENRING, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },