aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/airo_cs.c72
-rw-r--r--drivers/net/wireless/atmel_cs.c70
-rw-r--r--drivers/net/wireless/b43/pcmcia.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c38
-rw-r--r--drivers/net/wireless/libertas/if_cs.c21
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c27
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c27
-rw-r--r--drivers/net/wireless/ray_cs.c15
-rw-r--r--drivers/net/wireless/ray_cs.h1
-rw-r--r--drivers/net/wireless/wl3501.h1
-rw-r--r--drivers/net/wireless/wl3501_cs.c23
11 files changed, 41 insertions, 259 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index f6036fb42319..33bdc6a84e81 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -75,42 +75,7 @@ static void airo_release(struct pcmcia_device *link);
75 75
76static void airo_detach(struct pcmcia_device *p_dev); 76static void airo_detach(struct pcmcia_device *p_dev);
77 77
78/*
79 You'll also need to prototype all the functions that will actually
80 be used to talk to your device. See 'pcmem_cs' for a good example
81 of a fully self-sufficient driver; the other drivers rely more or
82 less on other parts of the kernel.
83*/
84
85/*
86 A linked list of "instances" of the aironet device. Each actual
87 PCMCIA card corresponds to one device instance, and is described
88 by one struct pcmcia_device structure (defined in ds.h).
89
90 You may not want to use a linked list for this -- for example, the
91 memory card driver uses an array of struct pcmcia_device pointers,
92 where minor device numbers are used to derive the corresponding
93 array index.
94*/
95
96/*
97 A driver needs to provide a dev_node_t structure for each device
98 on a card. In some cases, there is only one device per card (for
99 example, ethernet cards, modems). In other cases, there may be
100 many actual or logical devices (SCSI adapters, memory cards with
101 multiple partitions). The dev_node_t structures need to be kept
102 in a linked list starting at the 'dev' field of a struct pcmcia_device
103 structure. We allocate them in the card's private data structure,
104 because they generally shouldn't be allocated dynamically.
105
106 In this case, we also provide a flag to indicate if a device is
107 "stopped" due to a power management event, or card ejection. The
108 device IO routines can use a flag like this to throttle IO to a
109 card that is not ready to accept it.
110*/
111
112typedef struct local_info_t { 78typedef struct local_info_t {
113 dev_node_t node;
114 struct net_device *eth_dev; 79 struct net_device *eth_dev;
115} local_info_t; 80} local_info_t;
116 81
@@ -132,10 +97,6 @@ static int airo_probe(struct pcmcia_device *p_dev)
132 97
133 dev_dbg(&p_dev->dev, "airo_attach()\n"); 98 dev_dbg(&p_dev->dev, "airo_attach()\n");
134 99
135 /* Interrupt setup */
136 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
137 p_dev->irq.Handler = NULL;
138
139 /* 100 /*
140 General socket configuration defaults can go here. In this 101 General socket configuration defaults can go here. In this
141 client, we assume very little, and rely on the CIS for almost 102 client, we assume very little, and rely on the CIS for almost
@@ -212,9 +173,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
212 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 173 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
213 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 174 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
214 175
215 /* Do we need to allocate an interrupt? */ 176 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
216 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
217 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
218 177
219 /* IO window settings */ 178 /* IO window settings */
220 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 179 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -300,16 +259,8 @@ static int airo_config(struct pcmcia_device *link)
300 if (ret) 259 if (ret)
301 goto failed; 260 goto failed;
302 261
303 /* 262 if (!link->irq)
304 Allocate an interrupt line. Note that this does not assign a 263 goto failed;
305 handler to the interrupt, unless the 'Handler' member of the
306 irq structure is initialized.
307 */
308 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
309 ret = pcmcia_request_irq(link, &link->irq);
310 if (ret)
311 goto failed;
312 }
313 264
314 /* 265 /*
315 This actually configures the PCMCIA socket -- setting up 266 This actually configures the PCMCIA socket -- setting up
@@ -320,26 +271,17 @@ static int airo_config(struct pcmcia_device *link)
320 if (ret) 271 if (ret)
321 goto failed; 272 goto failed;
322 ((local_info_t *)link->priv)->eth_dev = 273 ((local_info_t *)link->priv)->eth_dev =
323 init_airo_card(link->irq.AssignedIRQ, 274 init_airo_card(link->irq,
324 link->io.BasePort1, 1, &link->dev); 275 link->io.BasePort1, 1, &link->dev);
325 if (!((local_info_t *)link->priv)->eth_dev) 276 if (!((local_info_t *)link->priv)->eth_dev)
326 goto failed; 277 goto failed;
327 278
328 /*
329 At this point, the dev_node_t structure(s) need to be
330 initialized and arranged in a linked list at link->dev_node.
331 */
332 strcpy(dev->node.dev_name, ((local_info_t *)link->priv)->eth_dev->name);
333 dev->node.major = dev->node.minor = 0;
334 link->dev_node = &dev->node;
335
336 /* Finally, report what we've done */ 279 /* Finally, report what we've done */
337 printk(KERN_INFO "%s: index 0x%02x: ", 280 dev_info(&link->dev, "index 0x%02x: ",
338 dev->node.dev_name, link->conf.ConfigIndex); 281 link->conf.ConfigIndex);
339 if (link->conf.Vpp) 282 if (link->conf.Vpp)
340 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); 283 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
341 if (link->conf.Attributes & CONF_ENABLE_IRQ) 284 printk(", irq %d", link->irq);
342 printk(", irq %d", link->irq.AssignedIRQ);
343 if (link->io.NumPorts1) 285 if (link->io.NumPorts1)
344 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 286 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
345 link->io.BasePort1+link->io.NumPorts1-1); 287 link->io.BasePort1+link->io.NumPorts1-1);
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 32407911842f..c2746fc7f2be 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -85,41 +85,7 @@ static void atmel_release(struct pcmcia_device *link);
85 85
86static void atmel_detach(struct pcmcia_device *p_dev); 86static void atmel_detach(struct pcmcia_device *p_dev);
87 87
88/*
89 You'll also need to prototype all the functions that will actually
90 be used to talk to your device. See 'pcmem_cs' for a good example
91 of a fully self-sufficient driver; the other drivers rely more or
92 less on other parts of the kernel.
93*/
94
95/*
96 A linked list of "instances" of the atmelnet device. Each actual
97 PCMCIA card corresponds to one device instance, and is described
98 by one struct pcmcia_device structure (defined in ds.h).
99
100 You may not want to use a linked list for this -- for example, the
101 memory card driver uses an array of struct pcmcia_device pointers, where minor
102 device numbers are used to derive the corresponding array index.
103*/
104
105/*
106 A driver needs to provide a dev_node_t structure for each device
107 on a card. In some cases, there is only one device per card (for
108 example, ethernet cards, modems). In other cases, there may be
109 many actual or logical devices (SCSI adapters, memory cards with
110 multiple partitions). The dev_node_t structures need to be kept
111 in a linked list starting at the 'dev' field of a struct pcmcia_device
112 structure. We allocate them in the card's private data structure,
113 because they generally shouldn't be allocated dynamically.
114
115 In this case, we also provide a flag to indicate if a device is
116 "stopped" due to a power management event, or card ejection. The
117 device IO routines can use a flag like this to throttle IO to a
118 card that is not ready to accept it.
119*/
120
121typedef struct local_info_t { 88typedef struct local_info_t {
122 dev_node_t node;
123 struct net_device *eth_dev; 89 struct net_device *eth_dev;
124} local_info_t; 90} local_info_t;
125 91
@@ -141,10 +107,6 @@ static int atmel_probe(struct pcmcia_device *p_dev)
141 107
142 dev_dbg(&p_dev->dev, "atmel_attach()\n"); 108 dev_dbg(&p_dev->dev, "atmel_attach()\n");
143 109
144 /* Interrupt setup */
145 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
146 p_dev->irq.Handler = NULL;
147
148 /* 110 /*
149 General socket configuration defaults can go here. In this 111 General socket configuration defaults can go here. In this
150 client, we assume very little, and rely on the CIS for almost 112 client, we assume very little, and rely on the CIS for almost
@@ -226,9 +188,7 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
226 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 188 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
227 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 189 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
228 190
229 /* Do we need to allocate an interrupt? */ 191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
230 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
231 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
232 192
233 /* IO window settings */ 193 /* IO window settings */
234 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 194 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -278,15 +238,9 @@ static int atmel_config(struct pcmcia_device *link)
278 if (pcmcia_loop_config(link, atmel_config_check, NULL)) 238 if (pcmcia_loop_config(link, atmel_config_check, NULL))
279 goto failed; 239 goto failed;
280 240
281 /* 241 if (!link->irq) {
282 Allocate an interrupt line. Note that this does not assign a 242 dev_err(&link->dev, "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
283 handler to the interrupt, unless the 'Handler' member of the 243 goto failed;
284 irq structure is initialized.
285 */
286 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
287 ret = pcmcia_request_irq(link, &link->irq);
288 if (ret)
289 goto failed;
290 } 244 }
291 245
292 /* 246 /*
@@ -298,14 +252,8 @@ static int atmel_config(struct pcmcia_device *link)
298 if (ret) 252 if (ret)
299 goto failed; 253 goto failed;
300 254
301 if (link->irq.AssignedIRQ == 0) {
302 printk(KERN_ALERT
303 "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
304 goto failed;
305 }
306
307 ((local_info_t*)link->priv)->eth_dev = 255 ((local_info_t*)link->priv)->eth_dev =
308 init_atmel_card(link->irq.AssignedIRQ, 256 init_atmel_card(link->irq,
309 link->io.BasePort1, 257 link->io.BasePort1,
310 did ? did->driver_info : ATMEL_FW_TYPE_NONE, 258 did ? did->driver_info : ATMEL_FW_TYPE_NONE,
311 &link->dev, 259 &link->dev,
@@ -315,14 +263,6 @@ static int atmel_config(struct pcmcia_device *link)
315 goto failed; 263 goto failed;
316 264
317 265
318 /*
319 At this point, the dev_node_t structure(s) need to be
320 initialized and arranged in a linked list at link->dev_node.
321 */
322 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name );
323 dev->node.major = dev->node.minor = 0;
324 link->dev_node = &dev->node;
325
326 return 0; 266 return 0;
327 267
328 failed: 268 failed:
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 609e7051e018..0e99b634267c 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -98,10 +98,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
98 if (res != 0) 98 if (res != 0)
99 goto err_disable; 99 goto err_disable;
100 100
101 dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 101 if (!dev->irq)
102 dev->irq.Handler = NULL; /* The handler is registered later. */
103 res = pcmcia_request_irq(dev, &dev->irq);
104 if (res != 0)
105 goto err_disable; 102 goto err_disable;
106 103
107 res = pcmcia_request_configuration(dev, &dev->conf); 104 res = pcmcia_request_configuration(dev, &dev->conf);
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index a36501dbbe02..db72461c486b 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -39,7 +39,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Ignore broken CIS VCC entry");
39 39
40/* struct local_info::hw_priv */ 40/* struct local_info::hw_priv */
41struct hostap_cs_priv { 41struct hostap_cs_priv {
42 dev_node_t node;
43 struct pcmcia_device *link; 42 struct pcmcia_device *link;
44 int sandisk_connectplus; 43 int sandisk_connectplus;
45}; 44};
@@ -556,15 +555,7 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
556 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 555 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
557 556
558 /* Do we need to allocate an interrupt? */ 557 /* Do we need to allocate an interrupt? */
559 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1) 558 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
560 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
561 else if (!(p_dev->conf.Attributes & CONF_ENABLE_IRQ)) {
562 /* At least Compaq WL200 does not have IRQInfo1 set,
563 * but it does not work without interrupts.. */
564 printk(KERN_WARNING "Config has no IRQ info, but trying to "
565 "enable IRQ anyway..\n");
566 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
567 }
568 559
569 /* IO window settings */ 560 /* IO window settings */
570 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " 561 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
@@ -633,21 +624,10 @@ static int prism2_config(struct pcmcia_device *link)
633 local = iface->local; 624 local = iface->local;
634 local->hw_priv = hw_priv; 625 local->hw_priv = hw_priv;
635 hw_priv->link = link; 626 hw_priv->link = link;
636 strcpy(hw_priv->node.dev_name, dev->name);
637 link->dev_node = &hw_priv->node;
638 627
639 /* 628 ret = pcmcia_request_irq(link, prism2_interrupt);
640 * Allocate an interrupt line. Note that this does not assign a 629 if (ret)
641 * handler to the interrupt, unless the 'Handler' member of the 630 goto failed;
642 * irq structure is initialized.
643 */
644 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
645 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
646 link->irq.Handler = prism2_interrupt;
647 ret = pcmcia_request_irq(link, &link->irq);
648 if (ret)
649 goto failed;
650 }
651 631
652 /* 632 /*
653 * This actually configures the PCMCIA socket -- setting up 633 * This actually configures the PCMCIA socket -- setting up
@@ -658,7 +638,7 @@ static int prism2_config(struct pcmcia_device *link)
658 if (ret) 638 if (ret)
659 goto failed; 639 goto failed;
660 640
661 dev->irq = link->irq.AssignedIRQ; 641 dev->irq = link->irq;
662 dev->base_addr = link->io.BasePort1; 642 dev->base_addr = link->io.BasePort1;
663 643
664 /* Finally, report what we've done */ 644 /* Finally, report what we've done */
@@ -668,7 +648,7 @@ static int prism2_config(struct pcmcia_device *link)
668 printk(", Vpp %d.%d", link->conf.Vpp / 10, 648 printk(", Vpp %d.%d", link->conf.Vpp / 10,
669 link->conf.Vpp % 10); 649 link->conf.Vpp % 10);
670 if (link->conf.Attributes & CONF_ENABLE_IRQ) 650 if (link->conf.Attributes & CONF_ENABLE_IRQ)
671 printk(", irq %d", link->irq.AssignedIRQ); 651 printk(", irq %d", link->irq);
672 if (link->io.NumPorts1) 652 if (link->io.NumPorts1)
673 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 653 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
674 link->io.BasePort1+link->io.NumPorts1-1); 654 link->io.BasePort1+link->io.NumPorts1-1);
@@ -682,11 +662,9 @@ static int prism2_config(struct pcmcia_device *link)
682 sandisk_enable_wireless(dev); 662 sandisk_enable_wireless(dev);
683 663
684 ret = prism2_hw_config(dev, 1); 664 ret = prism2_hw_config(dev, 1);
685 if (!ret) { 665 if (!ret)
686 ret = hostap_hw_ready(dev); 666 ret = hostap_hw_ready(dev);
687 if (ret == 0 && local->ddev) 667
688 strcpy(hw_priv->node.dev_name, local->ddev->name);
689 }
690 return ret; 668 return ret;
691 669
692 failed: 670 failed:
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 6d55439a7b97..08e4e3908003 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -777,7 +777,7 @@ static void if_cs_release(struct pcmcia_device *p_dev)
777 777
778 lbs_deb_enter(LBS_DEB_CS); 778 lbs_deb_enter(LBS_DEB_CS);
779 779
780 free_irq(p_dev->irq.AssignedIRQ, card); 780 free_irq(p_dev->irq, card);
781 pcmcia_disable_device(p_dev); 781 pcmcia_disable_device(p_dev);
782 if (card->iobase) 782 if (card->iobase)
783 ioport_unmap(card->iobase); 783 ioport_unmap(card->iobase);
@@ -807,8 +807,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
807 p_dev->io.NumPorts1 = cfg->io.win[0].len; 807 p_dev->io.NumPorts1 = cfg->io.win[0].len;
808 808
809 /* Do we need to allocate an interrupt? */ 809 /* Do we need to allocate an interrupt? */
810 if (cfg->irq.IRQInfo1) 810 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
811 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
812 811
813 /* IO window settings */ 812 /* IO window settings */
814 if (cfg->io.nwin != 1) { 813 if (cfg->io.nwin != 1) {
@@ -837,9 +836,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
837 card->p_dev = p_dev; 836 card->p_dev = p_dev;
838 p_dev->priv = card; 837 p_dev->priv = card;
839 838
840 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
841 p_dev->irq.Handler = NULL;
842
843 p_dev->conf.Attributes = 0; 839 p_dev->conf.Attributes = 0;
844 p_dev->conf.IntType = INT_MEMORY_AND_IO; 840 p_dev->conf.IntType = INT_MEMORY_AND_IO;
845 841
@@ -854,13 +850,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
854 * a handler to the interrupt, unless the 'Handler' member of 850 * a handler to the interrupt, unless the 'Handler' member of
855 * the irq structure is initialized. 851 * the irq structure is initialized.
856 */ 852 */
857 if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) { 853 if (!p_dev->irq)
858 ret = pcmcia_request_irq(p_dev, &p_dev->irq); 854 goto out1;
859 if (ret) {
860 lbs_pr_err("error in pcmcia_request_irq\n");
861 goto out1;
862 }
863 }
864 855
865 /* Initialize io access */ 856 /* Initialize io access */
866 card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1); 857 card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1);
@@ -883,7 +874,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
883 874
884 /* Finally, report what we've done */ 875 /* Finally, report what we've done */
885 lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", 876 lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n",
886 p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, 877 p_dev->irq, p_dev->io.BasePort1,
887 p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); 878 p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
888 879
889 /* 880 /*
@@ -940,7 +931,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
940 priv->fw_ready = 1; 931 priv->fw_ready = 1;
941 932
942 /* Now actually get the IRQ */ 933 /* Now actually get the IRQ */
943 ret = request_irq(p_dev->irq.AssignedIRQ, if_cs_interrupt, 934 ret = request_irq(p_dev->irq, if_cs_interrupt,
944 IRQF_SHARED, DRV_NAME, card); 935 IRQF_SHARED, DRV_NAME, card);
945 if (ret) { 936 if (ret) {
946 lbs_pr_err("error in request_irq\n"); 937 lbs_pr_err("error in request_irq\n");
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 1d4ada188eda..03056ab73032 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -50,7 +50,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
50 * struct orinoco_private */ 50 * struct orinoco_private */
51struct orinoco_pccard { 51struct orinoco_pccard {
52 struct pcmcia_device *p_dev; 52 struct pcmcia_device *p_dev;
53 dev_node_t node;
54 53
55 /* Used to handle hard reset */ 54 /* Used to handle hard reset */
56 /* yuck, we need this hack to work around the insanity of the 55 /* yuck, we need this hack to work around the insanity of the
@@ -119,10 +118,6 @@ orinoco_cs_probe(struct pcmcia_device *link)
119 card->p_dev = link; 118 card->p_dev = link;
120 link->priv = priv; 119 link->priv = priv;
121 120
122 /* Interrupt setup */
123 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
124 link->irq.Handler = orinoco_interrupt;
125
126 /* General socket configuration defaults can go here. In this 121 /* General socket configuration defaults can go here. In this
127 * client, we assume very little, and rely on the CIS for 122 * client, we assume very little, and rely on the CIS for
128 * almost everything. In most clients, many details (i.e., 123 * almost everything. In most clients, many details (i.e.,
@@ -144,8 +139,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
144{ 139{
145 struct orinoco_private *priv = link->priv; 140 struct orinoco_private *priv = link->priv;
146 141
147 if (link->dev_node) 142 orinoco_if_del(priv);
148 orinoco_if_del(priv);
149 143
150 orinoco_cs_release(link); 144 orinoco_cs_release(link);
151 145
@@ -230,7 +224,6 @@ static int
230orinoco_cs_config(struct pcmcia_device *link) 224orinoco_cs_config(struct pcmcia_device *link)
231{ 225{
232 struct orinoco_private *priv = link->priv; 226 struct orinoco_private *priv = link->priv;
233 struct orinoco_pccard *card = priv->card;
234 hermes_t *hw = &priv->hw; 227 hermes_t *hw = &priv->hw;
235 int ret; 228 int ret;
236 void __iomem *mem; 229 void __iomem *mem;
@@ -258,12 +251,7 @@ orinoco_cs_config(struct pcmcia_device *link)
258 goto failed; 251 goto failed;
259 } 252 }
260 253
261 /* 254 ret = pcmcia_request_irq(link, orinoco_interrupt);
262 * Allocate an interrupt line. Note that this does not assign
263 * a handler to the interrupt, unless the 'Handler' member of
264 * the irq structure is initialized.
265 */
266 ret = pcmcia_request_irq(link, &link->irq);
267 if (ret) 255 if (ret)
268 goto failed; 256 goto failed;
269 257
@@ -285,9 +273,6 @@ orinoco_cs_config(struct pcmcia_device *link)
285 if (ret) 273 if (ret)
286 goto failed; 274 goto failed;
287 275
288 /* Ok, we have the configuration, prepare to register the netdev */
289 card->node.major = card->node.minor = 0;
290
291 /* Initialise the main driver */ 276 /* Initialise the main driver */
292 if (orinoco_init(priv) != 0) { 277 if (orinoco_init(priv) != 0) {
293 printk(KERN_ERR PFX "orinoco_init() failed\n"); 278 printk(KERN_ERR PFX "orinoco_init() failed\n");
@@ -296,17 +281,11 @@ orinoco_cs_config(struct pcmcia_device *link)
296 281
297 /* Register an interface with the stack */ 282 /* Register an interface with the stack */
298 if (orinoco_if_add(priv, link->io.BasePort1, 283 if (orinoco_if_add(priv, link->io.BasePort1,
299 link->irq.AssignedIRQ) != 0) { 284 link->irq) != 0) {
300 printk(KERN_ERR PFX "orinoco_if_add() failed\n"); 285 printk(KERN_ERR PFX "orinoco_if_add() failed\n");
301 goto failed; 286 goto failed;
302 } 287 }
303 288
304 /* At this point, the dev_node_t structure(s) needs to be
305 * initialized and arranged in a linked list at link->dev_node. */
306 strcpy(card->node.dev_name, priv->ndev->name);
307 link->dev_node = &card->node; /* link->dev_node being non-NULL is also
308 * used to indicate that the
309 * net_device has been registered */
310 return 0; 289 return 0;
311 290
312 failed: 291 failed:
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 59bda240fdc2..41b9ce425855 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -57,7 +57,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
57 * struct orinoco_private */ 57 * struct orinoco_private */
58struct orinoco_pccard { 58struct orinoco_pccard {
59 struct pcmcia_device *p_dev; 59 struct pcmcia_device *p_dev;
60 dev_node_t node;
61}; 60};
62 61
63/********************************************************************/ 62/********************************************************************/
@@ -193,10 +192,6 @@ spectrum_cs_probe(struct pcmcia_device *link)
193 card->p_dev = link; 192 card->p_dev = link;
194 link->priv = priv; 193 link->priv = priv;
195 194
196 /* Interrupt setup */
197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
198 link->irq.Handler = orinoco_interrupt;
199
200 /* General socket configuration defaults can go here. In this 195 /* General socket configuration defaults can go here. In this
201 * client, we assume very little, and rely on the CIS for 196 * client, we assume very little, and rely on the CIS for
202 * almost everything. In most clients, many details (i.e., 197 * almost everything. In most clients, many details (i.e.,
@@ -218,8 +213,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link)
218{ 213{
219 struct orinoco_private *priv = link->priv; 214 struct orinoco_private *priv = link->priv;
220 215
221 if (link->dev_node) 216 orinoco_if_del(priv);
222 orinoco_if_del(priv);
223 217
224 spectrum_cs_release(link); 218 spectrum_cs_release(link);
225 219
@@ -304,7 +298,6 @@ static int
304spectrum_cs_config(struct pcmcia_device *link) 298spectrum_cs_config(struct pcmcia_device *link)
305{ 299{
306 struct orinoco_private *priv = link->priv; 300 struct orinoco_private *priv = link->priv;
307 struct orinoco_pccard *card = priv->card;
308 hermes_t *hw = &priv->hw; 301 hermes_t *hw = &priv->hw;
309 int ret; 302 int ret;
310 void __iomem *mem; 303 void __iomem *mem;
@@ -332,12 +325,7 @@ spectrum_cs_config(struct pcmcia_device *link)
332 goto failed; 325 goto failed;
333 } 326 }
334 327
335 /* 328 ret = pcmcia_request_irq(link, orinoco_interrupt);
336 * Allocate an interrupt line. Note that this does not assign
337 * a handler to the interrupt, unless the 'Handler' member of
338 * the irq structure is initialized.
339 */
340 ret = pcmcia_request_irq(link, &link->irq);
341 if (ret) 329 if (ret)
342 goto failed; 330 goto failed;
343 331
@@ -359,9 +347,6 @@ spectrum_cs_config(struct pcmcia_device *link)
359 if (ret) 347 if (ret)
360 goto failed; 348 goto failed;
361 349
362 /* Ok, we have the configuration, prepare to register the netdev */
363 card->node.major = card->node.minor = 0;
364
365 /* Reset card */ 350 /* Reset card */
366 if (spectrum_cs_hard_reset(priv) != 0) 351 if (spectrum_cs_hard_reset(priv) != 0)
367 goto failed; 352 goto failed;
@@ -374,17 +359,11 @@ spectrum_cs_config(struct pcmcia_device *link)
374 359
375 /* Register an interface with the stack */ 360 /* Register an interface with the stack */
376 if (orinoco_if_add(priv, link->io.BasePort1, 361 if (orinoco_if_add(priv, link->io.BasePort1,
377 link->irq.AssignedIRQ) != 0) { 362 link->irq) != 0) {
378 printk(KERN_ERR PFX "orinoco_if_add() failed\n"); 363 printk(KERN_ERR PFX "orinoco_if_add() failed\n");
379 goto failed; 364 goto failed;
380 } 365 }
381 366
382 /* At this point, the dev_node_t structure(s) needs to be
383 * initialized and arranged in a linked list at link->dev_node. */
384 strcpy(card->node.dev_name, priv->ndev->name);
385 link->dev_node = &card->node; /* link->dev_node being non-NULL is also
386 * used to indicate that the
387 * net_device has been registered */
388 return 0; 367 return 0;
389 368
390 failed: 369 failed:
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 11865ea21875..f7d2a34ca531 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -51,7 +51,6 @@
51#include <pcmcia/cistpl.h> 51#include <pcmcia/cistpl.h>
52#include <pcmcia/cisreg.h> 52#include <pcmcia/cisreg.h>
53#include <pcmcia/ds.h> 53#include <pcmcia/ds.h>
54#include <pcmcia/mem_op.h>
55 54
56#include <linux/wireless.h> 55#include <linux/wireless.h>
57#include <net/iw_handler.h> 56#include <net/iw_handler.h>
@@ -321,10 +320,6 @@ static int ray_probe(struct pcmcia_device *p_dev)
321 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 320 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
322 p_dev->io.IOAddrLines = 5; 321 p_dev->io.IOAddrLines = 5;
323 322
324 /* Interrupt setup. For PCMCIA, driver takes what's given */
325 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
326 p_dev->irq.Handler = &ray_interrupt;
327
328 /* General socket configuration */ 323 /* General socket configuration */
329 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 324 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
330 p_dev->conf.IntType = INT_MEMORY_AND_IO; 325 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -383,8 +378,7 @@ static void ray_detach(struct pcmcia_device *link)
383 del_timer(&local->timer); 378 del_timer(&local->timer);
384 379
385 if (link->priv) { 380 if (link->priv) {
386 if (link->dev_node) 381 unregister_netdev(dev);
387 unregister_netdev(dev);
388 free_netdev(dev); 382 free_netdev(dev);
389 } 383 }
390 dev_dbg(&link->dev, "ray_cs ray_detach ending\n"); 384 dev_dbg(&link->dev, "ray_cs ray_detach ending\n");
@@ -417,10 +411,10 @@ static int ray_config(struct pcmcia_device *link)
417 /* Now allocate an interrupt line. Note that this does not 411 /* Now allocate an interrupt line. Note that this does not
418 actually assign a handler to the interrupt. 412 actually assign a handler to the interrupt.
419 */ 413 */
420 ret = pcmcia_request_irq(link, &link->irq); 414 ret = pcmcia_request_irq(link, ray_interrupt);
421 if (ret) 415 if (ret)
422 goto failed; 416 goto failed;
423 dev->irq = link->irq.AssignedIRQ; 417 dev->irq = link->irq;
424 418
425 /* This actually configures the PCMCIA socket -- setting up 419 /* This actually configures the PCMCIA socket -- setting up
426 the I/O windows and the interrupt mapping. 420 the I/O windows and the interrupt mapping.
@@ -493,9 +487,6 @@ static int ray_config(struct pcmcia_device *link)
493 return i; 487 return i;
494 } 488 }
495 489
496 strcpy(local->node.dev_name, dev->name);
497 link->dev_node = &local->node;
498
499 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n", 490 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n",
500 dev->name, dev->irq, dev->dev_addr); 491 dev->name, dev->irq, dev->dev_addr);
501 492
diff --git a/drivers/net/wireless/ray_cs.h b/drivers/net/wireless/ray_cs.h
index 1e23b7f4cca7..9f01ddb19748 100644
--- a/drivers/net/wireless/ray_cs.h
+++ b/drivers/net/wireless/ray_cs.h
@@ -25,7 +25,6 @@ struct beacon_rx {
25typedef struct ray_dev_t { 25typedef struct ray_dev_t {
26 int card_status; 26 int card_status;
27 int authentication_state; 27 int authentication_state;
28 dev_node_t node;
29 window_handle_t amem_handle; /* handle to window for attribute memory */ 28 window_handle_t amem_handle; /* handle to window for attribute memory */
30 window_handle_t rmem_handle; /* handle to window for rx buffer on card */ 29 window_handle_t rmem_handle; /* handle to window for rx buffer on card */
31 void __iomem *sram; /* pointer to beginning of shared RAM */ 30 void __iomem *sram; /* pointer to beginning of shared RAM */
diff --git a/drivers/net/wireless/wl3501.h b/drivers/net/wireless/wl3501.h
index 8bce1a550a22..8816e371fd0e 100644
--- a/drivers/net/wireless/wl3501.h
+++ b/drivers/net/wireless/wl3501.h
@@ -610,7 +610,6 @@ struct wl3501_card {
610 struct iw_statistics wstats; 610 struct iw_statistics wstats;
611 struct iw_spy_data spy_data; 611 struct iw_spy_data spy_data;
612 struct iw_public_data wireless_data; 612 struct iw_public_data wireless_data;
613 struct dev_node_t node;
614 struct pcmcia_device *p_dev; 613 struct pcmcia_device *p_dev;
615}; 614};
616#endif 615#endif
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 7b9621de239f..5e5d24c1ce2b 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1451,6 +1451,8 @@ static void wl3501_detach(struct pcmcia_device *link)
1451 netif_device_detach(dev); 1451 netif_device_detach(dev);
1452 wl3501_release(link); 1452 wl3501_release(link);
1453 1453
1454 unregister_netdev(dev);
1455
1454 if (link->priv) 1456 if (link->priv)
1455 free_netdev(link->priv); 1457 free_netdev(link->priv);
1456 1458
@@ -1897,10 +1899,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1897 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1899 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
1898 p_dev->io.IOAddrLines = 5; 1900 p_dev->io.IOAddrLines = 5;
1899 1901
1900 /* Interrupt setup */
1901 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
1902 p_dev->irq.Handler = wl3501_interrupt;
1903
1904 /* General socket configuration */ 1902 /* General socket configuration */
1905 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1903 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
1906 p_dev->conf.IntType = INT_MEMORY_AND_IO; 1904 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -1961,7 +1959,7 @@ static int wl3501_config(struct pcmcia_device *link)
1961 /* Now allocate an interrupt line. Note that this does not actually 1959 /* Now allocate an interrupt line. Note that this does not actually
1962 * assign a handler to the interrupt. */ 1960 * assign a handler to the interrupt. */
1963 1961
1964 ret = pcmcia_request_irq(link, &link->irq); 1962 ret = pcmcia_request_irq(link, wl3501_interrupt);
1965 if (ret) 1963 if (ret)
1966 goto failed; 1964 goto failed;
1967 1965
@@ -1972,7 +1970,7 @@ static int wl3501_config(struct pcmcia_device *link)
1972 if (ret) 1970 if (ret)
1973 goto failed; 1971 goto failed;
1974 1972
1975 dev->irq = link->irq.AssignedIRQ; 1973 dev->irq = link->irq;
1976 dev->base_addr = link->io.BasePort1; 1974 dev->base_addr = link->io.BasePort1;
1977 SET_NETDEV_DEV(dev, &link->dev); 1975 SET_NETDEV_DEV(dev, &link->dev);
1978 if (register_netdev(dev)) { 1976 if (register_netdev(dev)) {
@@ -1981,20 +1979,15 @@ static int wl3501_config(struct pcmcia_device *link)
1981 } 1979 }
1982 1980
1983 this = netdev_priv(dev); 1981 this = netdev_priv(dev);
1984 /*
1985 * At this point, the dev_node_t structure(s) should be initialized and
1986 * arranged in a linked list at link->dev_node.
1987 */
1988 link->dev_node = &this->node;
1989 1982
1990 this->base_addr = dev->base_addr; 1983 this->base_addr = dev->base_addr;
1991 1984
1992 if (!wl3501_get_flash_mac_addr(this)) { 1985 if (!wl3501_get_flash_mac_addr(this)) {
1993 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", 1986 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n",
1994 dev->name); 1987 dev->name);
1988 unregister_netdev(dev);
1995 goto failed; 1989 goto failed;
1996 } 1990 }
1997 strcpy(this->node.dev_name, dev->name);
1998 1991
1999 for (i = 0; i < 6; i++) 1992 for (i = 0; i < 6; i++)
2000 dev->dev_addr[i] = ((char *)&this->mac_addr)[i]; 1993 dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
@@ -2038,12 +2031,6 @@ failed:
2038 */ 2031 */
2039static void wl3501_release(struct pcmcia_device *link) 2032static void wl3501_release(struct pcmcia_device *link)
2040{ 2033{
2041 struct net_device *dev = link->priv;
2042
2043 /* Unlink the device chain */
2044 if (link->dev_node)
2045 unregister_netdev(dev);
2046
2047 pcmcia_disable_device(link); 2034 pcmcia_disable_device(link);
2048} 2035}
2049 2036