aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/airo_cs.c')
-rw-r--r--drivers/net/wireless/airo_cs.c72
1 files changed, 7 insertions, 65 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);