diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/wireless/orinoco | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r-- | drivers/net/wireless/orinoco/cfg.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/main.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_cs.c | 153 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/scan.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/scan.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/spectrum_cs.c | 150 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/wext.c | 23 |
9 files changed, 90 insertions, 285 deletions
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c index 09fae2f0ea08..736bbb9bd1d0 100644 --- a/drivers/net/wireless/orinoco/cfg.c +++ b/drivers/net/wireless/orinoco/cfg.c | |||
@@ -153,6 +153,9 @@ static int orinoco_scan(struct wiphy *wiphy, struct net_device *dev, | |||
153 | priv->scan_request = request; | 153 | priv->scan_request = request; |
154 | 154 | ||
155 | err = orinoco_hw_trigger_scan(priv, request->ssids); | 155 | err = orinoco_hw_trigger_scan(priv, request->ssids); |
156 | /* On error the we aren't processing the request */ | ||
157 | if (err) | ||
158 | priv->scan_request = NULL; | ||
156 | 159 | ||
157 | return err; | 160 | return err; |
158 | } | 161 | } |
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 077baa86756b..3c7877a7c31c 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -762,14 +762,17 @@ int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate) | |||
762 | case FIRMWARE_TYPE_INTERSIL: /* Intersil style rate */ | 762 | case FIRMWARE_TYPE_INTERSIL: /* Intersil style rate */ |
763 | case FIRMWARE_TYPE_SYMBOL: /* Symbol style rate */ | 763 | case FIRMWARE_TYPE_SYMBOL: /* Symbol style rate */ |
764 | for (i = 0; i < BITRATE_TABLE_SIZE; i++) | 764 | for (i = 0; i < BITRATE_TABLE_SIZE; i++) |
765 | if (bitrate_table[i].intersil_txratectrl == val) | 765 | if (bitrate_table[i].intersil_txratectrl == val) { |
766 | *bitrate = bitrate_table[i].bitrate * 100000; | ||
766 | break; | 767 | break; |
768 | } | ||
767 | 769 | ||
768 | if (i >= BITRATE_TABLE_SIZE) | 770 | if (i >= BITRATE_TABLE_SIZE) { |
769 | printk(KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n", | 771 | printk(KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n", |
770 | priv->ndev->name, val); | 772 | priv->ndev->name, val); |
773 | err = -EIO; | ||
774 | } | ||
771 | 775 | ||
772 | *bitrate = bitrate_table[i].bitrate * 100000; | ||
773 | break; | 776 | break; |
774 | default: | 777 | default: |
775 | BUG(); | 778 | BUG(); |
@@ -1028,7 +1031,7 @@ int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, | |||
1028 | else | 1031 | else |
1029 | buf.tsc[4] = 0x10; | 1032 | buf.tsc[4] = 0x10; |
1030 | 1033 | ||
1031 | /* Wait upto 100ms for tx queue to empty */ | 1034 | /* Wait up to 100ms for tx queue to empty */ |
1032 | for (k = 100; k > 0; k--) { | 1035 | for (k = 100; k > 0; k--) { |
1033 | udelay(1000); | 1036 | udelay(1000); |
1034 | ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY, | 1037 | ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY, |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index e8e2d0f4763d..62c6b2b37dbe 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -1376,13 +1376,13 @@ static void orinoco_process_scan_results(struct work_struct *work) | |||
1376 | 1376 | ||
1377 | spin_lock_irqsave(&priv->scan_lock, flags); | 1377 | spin_lock_irqsave(&priv->scan_lock, flags); |
1378 | list_for_each_entry_safe(sd, temp, &priv->scan_list, list) { | 1378 | list_for_each_entry_safe(sd, temp, &priv->scan_list, list) { |
1379 | spin_unlock_irqrestore(&priv->scan_lock, flags); | ||
1380 | 1379 | ||
1381 | buf = sd->buf; | 1380 | buf = sd->buf; |
1382 | len = sd->len; | 1381 | len = sd->len; |
1383 | type = sd->type; | 1382 | type = sd->type; |
1384 | 1383 | ||
1385 | list_del(&sd->list); | 1384 | list_del(&sd->list); |
1385 | spin_unlock_irqrestore(&priv->scan_lock, flags); | ||
1386 | kfree(sd); | 1386 | kfree(sd); |
1387 | 1387 | ||
1388 | if (len > 0) { | 1388 | if (len > 0) { |
@@ -1392,10 +1392,9 @@ static void orinoco_process_scan_results(struct work_struct *work) | |||
1392 | orinoco_add_hostscan_results(priv, buf, len); | 1392 | orinoco_add_hostscan_results(priv, buf, len); |
1393 | 1393 | ||
1394 | kfree(buf); | 1394 | kfree(buf); |
1395 | } else if (priv->scan_request) { | 1395 | } else { |
1396 | /* Either abort or complete the scan */ | 1396 | /* Either abort or complete the scan */ |
1397 | cfg80211_scan_done(priv->scan_request, (len < 0)); | 1397 | orinoco_scan_done(priv, (len < 0)); |
1398 | priv->scan_request = NULL; | ||
1399 | } | 1398 | } |
1400 | 1399 | ||
1401 | spin_lock_irqsave(&priv->scan_lock, flags); | 1400 | spin_lock_irqsave(&priv->scan_lock, flags); |
@@ -1684,6 +1683,8 @@ static int __orinoco_down(struct orinoco_private *priv) | |||
1684 | hermes_write_regn(hw, EVACK, 0xffff); | 1683 | hermes_write_regn(hw, EVACK, 0xffff); |
1685 | } | 1684 | } |
1686 | 1685 | ||
1686 | orinoco_scan_done(priv, true); | ||
1687 | |||
1687 | /* firmware will have to reassociate */ | 1688 | /* firmware will have to reassociate */ |
1688 | netif_carrier_off(dev); | 1689 | netif_carrier_off(dev); |
1689 | priv->last_linkstatus = 0xffff; | 1690 | priv->last_linkstatus = 0xffff; |
@@ -1762,10 +1763,7 @@ void orinoco_reset(struct work_struct *work) | |||
1762 | orinoco_unlock(priv, &flags); | 1763 | orinoco_unlock(priv, &flags); |
1763 | 1764 | ||
1764 | /* Scanning support: Notify scan cancellation */ | 1765 | /* Scanning support: Notify scan cancellation */ |
1765 | if (priv->scan_request) { | 1766 | orinoco_scan_done(priv, true); |
1766 | cfg80211_scan_done(priv->scan_request, 1); | ||
1767 | priv->scan_request = NULL; | ||
1768 | } | ||
1769 | 1767 | ||
1770 | if (priv->hard_reset) { | 1768 | if (priv->hard_reset) { |
1771 | err = (*priv->hard_reset)(priv); | 1769 | err = (*priv->hard_reset)(priv); |
@@ -1813,6 +1811,12 @@ static int __orinoco_commit(struct orinoco_private *priv) | |||
1813 | struct net_device *dev = priv->ndev; | 1811 | struct net_device *dev = priv->ndev; |
1814 | int err = 0; | 1812 | int err = 0; |
1815 | 1813 | ||
1814 | /* If we've called commit, we are reconfiguring or bringing the | ||
1815 | * interface up. Maintaining countermeasures across this would | ||
1816 | * be confusing, so note that we've disabled them. The port will | ||
1817 | * be enabled later in orinoco_commit or __orinoco_up. */ | ||
1818 | priv->tkip_cm_active = 0; | ||
1819 | |||
1816 | err = orinoco_hw_program_rids(priv); | 1820 | err = orinoco_hw_program_rids(priv); |
1817 | 1821 | ||
1818 | /* FIXME: what about netif_tx_lock */ | 1822 | /* FIXME: what about netif_tx_lock */ |
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index ef46a2d88539..88e3c0ebcaad 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <pcmcia/cs.h> | ||
21 | #include <pcmcia/cistpl.h> | 20 | #include <pcmcia/cistpl.h> |
22 | #include <pcmcia/cisreg.h> | 21 | #include <pcmcia/cisreg.h> |
23 | #include <pcmcia/ds.h> | 22 | #include <pcmcia/ds.h> |
@@ -93,14 +92,6 @@ orinoco_cs_hard_reset(struct orinoco_private *priv) | |||
93 | /* PCMCIA stuff */ | 92 | /* PCMCIA stuff */ |
94 | /********************************************************************/ | 93 | /********************************************************************/ |
95 | 94 | ||
96 | /* | ||
97 | * This creates an "instance" of the driver, allocating local data | ||
98 | * structures for one device. The device is registered with Card | ||
99 | * Services. | ||
100 | * | ||
101 | * The dev_link structure is initialized, but we don't actually | ||
102 | * configure the card at this point -- we wait until we receive a card | ||
103 | * insertion event. */ | ||
104 | static int | 95 | static int |
105 | orinoco_cs_probe(struct pcmcia_device *link) | 96 | orinoco_cs_probe(struct pcmcia_device *link) |
106 | { | 97 | { |
@@ -117,23 +108,9 @@ orinoco_cs_probe(struct pcmcia_device *link) | |||
117 | card->p_dev = link; | 108 | card->p_dev = link; |
118 | link->priv = priv; | 109 | link->priv = priv; |
119 | 110 | ||
120 | /* General socket configuration defaults can go here. In this | ||
121 | * client, we assume very little, and rely on the CIS for | ||
122 | * almost everything. In most clients, many details (i.e., | ||
123 | * number, sizes, and attributes of IO windows) are fixed by | ||
124 | * the nature of the device, and can be hard-wired here. */ | ||
125 | link->conf.Attributes = 0; | ||
126 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
127 | |||
128 | return orinoco_cs_config(link); | 111 | return orinoco_cs_config(link); |
129 | } /* orinoco_cs_attach */ | 112 | } /* orinoco_cs_attach */ |
130 | 113 | ||
131 | /* | ||
132 | * This deletes a driver "instance". The device is de-registered with | ||
133 | * Card Services. If it has been released, all local data structures | ||
134 | * are freed. Otherwise, the structures will be freed when the device | ||
135 | * is released. | ||
136 | */ | ||
137 | static void orinoco_cs_detach(struct pcmcia_device *link) | 114 | static void orinoco_cs_detach(struct pcmcia_device *link) |
138 | { | 115 | { |
139 | struct orinoco_private *priv = link->priv; | 116 | struct orinoco_private *priv = link->priv; |
@@ -145,76 +122,12 @@ static void orinoco_cs_detach(struct pcmcia_device *link) | |||
145 | free_orinocodev(priv); | 122 | free_orinocodev(priv); |
146 | } /* orinoco_cs_detach */ | 123 | } /* orinoco_cs_detach */ |
147 | 124 | ||
148 | /* | 125 | static int orinoco_cs_config_check(struct pcmcia_device *p_dev, void *priv_data) |
149 | * orinoco_cs_config() is scheduled to run after a CARD_INSERTION | ||
150 | * event is received, to configure the PCMCIA socket, and to make the | ||
151 | * device available to the system. | ||
152 | */ | ||
153 | |||
154 | static int orinoco_cs_config_check(struct pcmcia_device *p_dev, | ||
155 | cistpl_cftable_entry_t *cfg, | ||
156 | cistpl_cftable_entry_t *dflt, | ||
157 | unsigned int vcc, | ||
158 | void *priv_data) | ||
159 | { | 126 | { |
160 | if (cfg->index == 0) | 127 | if (p_dev->config_index == 0) |
161 | goto next_entry; | 128 | return -EINVAL; |
162 | |||
163 | /* Use power settings for Vcc and Vpp if present */ | ||
164 | /* Note that the CIS values need to be rescaled */ | ||
165 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { | ||
166 | if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { | ||
167 | DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", | ||
168 | __func__, vcc, | ||
169 | cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); | ||
170 | if (!ignore_cis_vcc) | ||
171 | goto next_entry; | ||
172 | } | ||
173 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { | ||
174 | if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { | ||
175 | DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", | ||
176 | __func__, vcc, | ||
177 | dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); | ||
178 | if (!ignore_cis_vcc) | ||
179 | goto next_entry; | ||
180 | } | ||
181 | } | ||
182 | |||
183 | if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) | ||
184 | p_dev->conf.Vpp = | ||
185 | cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; | ||
186 | else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) | ||
187 | p_dev->conf.Vpp = | ||
188 | dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; | ||
189 | |||
190 | /* Do we need to allocate an interrupt? */ | ||
191 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | ||
192 | |||
193 | /* IO window settings */ | ||
194 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; | ||
195 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | ||
196 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | ||
197 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; | ||
198 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; | ||
199 | p_dev->resource[0]->flags |= | ||
200 | pcmcia_io_cfg_data_width(io->flags); | ||
201 | p_dev->resource[0]->start = io->win[0].base; | ||
202 | p_dev->resource[0]->end = io->win[0].len; | ||
203 | if (io->nwin > 1) { | ||
204 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; | ||
205 | p_dev->resource[1]->start = io->win[1].base; | ||
206 | p_dev->resource[1]->end = io->win[1].len; | ||
207 | } | ||
208 | |||
209 | /* This reserves IO space but doesn't actually enable it */ | ||
210 | if (pcmcia_request_io(p_dev) != 0) | ||
211 | goto next_entry; | ||
212 | } | ||
213 | return 0; | ||
214 | 129 | ||
215 | next_entry: | 130 | return pcmcia_request_io(p_dev); |
216 | pcmcia_disable_device(p_dev); | ||
217 | return -ENODEV; | ||
218 | }; | 131 | }; |
219 | 132 | ||
220 | static int | 133 | static int |
@@ -225,20 +138,10 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
225 | int ret; | 138 | int ret; |
226 | void __iomem *mem; | 139 | void __iomem *mem; |
227 | 140 | ||
228 | /* | 141 | link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | |
229 | * In this loop, we scan the CIS for configuration table | 142 | CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; |
230 | * entries, each of which describes a valid card | 143 | if (ignore_cis_vcc) |
231 | * configuration, including voltage, IO window, memory window, | 144 | link->config_flags &= ~CONF_AUTO_CHECK_VCC; |
232 | * and interrupt settings. | ||
233 | * | ||
234 | * We make no assumptions about the card to be configured: we | ||
235 | * use just the information available in the CIS. In an ideal | ||
236 | * world, this would work for any PCMCIA card, but it requires | ||
237 | * a complete and accurate CIS. In practice, a driver usually | ||
238 | * "knows" most of these things without consulting the CIS, | ||
239 | * and most client drivers will only use the CIS to fill in | ||
240 | * implementation-defined details. | ||
241 | */ | ||
242 | ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); | 145 | ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); |
243 | if (ret) { | 146 | if (ret) { |
244 | if (!ignore_cis_vcc) | 147 | if (!ignore_cis_vcc) |
@@ -248,26 +151,21 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
248 | goto failed; | 151 | goto failed; |
249 | } | 152 | } |
250 | 153 | ||
251 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
252 | if (ret) | ||
253 | goto failed; | ||
254 | |||
255 | /* We initialize the hermes structure before completing PCMCIA | ||
256 | * configuration just in case the interrupt handler gets | ||
257 | * called. */ | ||
258 | mem = ioport_map(link->resource[0]->start, | 154 | mem = ioport_map(link->resource[0]->start, |
259 | resource_size(link->resource[0])); | 155 | resource_size(link->resource[0])); |
260 | if (!mem) | 156 | if (!mem) |
261 | goto failed; | 157 | goto failed; |
262 | 158 | ||
159 | /* We initialize the hermes structure before completing PCMCIA | ||
160 | * configuration just in case the interrupt handler gets | ||
161 | * called. */ | ||
263 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); | 162 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); |
264 | 163 | ||
265 | /* | 164 | ret = pcmcia_request_irq(link, orinoco_interrupt); |
266 | * This actually configures the PCMCIA socket -- setting up | 165 | if (ret) |
267 | * the I/O windows and the interrupt mapping, and putting the | 166 | goto failed; |
268 | * card and host interface into "Memory and IO" mode. | 167 | |
269 | */ | 168 | ret = pcmcia_enable_device(link); |
270 | ret = pcmcia_request_configuration(link, &link->conf); | ||
271 | if (ret) | 169 | if (ret) |
272 | goto failed; | 170 | goto failed; |
273 | 171 | ||
@@ -291,11 +189,6 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
291 | return -ENODEV; | 189 | return -ENODEV; |
292 | } /* orinoco_cs_config */ | 190 | } /* orinoco_cs_config */ |
293 | 191 | ||
294 | /* | ||
295 | * After a card is removed, orinoco_cs_release() will unregister the | ||
296 | * device, and release the PCMCIA configuration. If the device is | ||
297 | * still open, this will be postponed until it is closed. | ||
298 | */ | ||
299 | static void | 192 | static void |
300 | orinoco_cs_release(struct pcmcia_device *link) | 193 | orinoco_cs_release(struct pcmcia_device *link) |
301 | { | 194 | { |
@@ -344,13 +237,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link) | |||
344 | /* Module initialization */ | 237 | /* Module initialization */ |
345 | /********************************************************************/ | 238 | /********************************************************************/ |
346 | 239 | ||
347 | /* Can't be declared "const" or the whole __initdata section will | 240 | static const struct pcmcia_device_id orinoco_cs_ids[] = { |
348 | * become const */ | ||
349 | static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION | ||
350 | " (David Gibson <hermes@gibson.dropbear.id.au>, " | ||
351 | "Pavel Roskin <proski@gnu.org>, et al)"; | ||
352 | |||
353 | static struct pcmcia_device_id orinoco_cs_ids[] = { | ||
354 | PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), /* 3Com AirConnect PCI 777A */ | 241 | PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), /* 3Com AirConnect PCI 777A */ |
355 | PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), /* Lucent Orinoco and old Intersil */ | 242 | PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), /* Lucent Orinoco and old Intersil */ |
356 | PCMCIA_DEVICE_MANF_CARD(0x016b, 0x0001), /* Ericsson WLAN Card C11 */ | 243 | PCMCIA_DEVICE_MANF_CARD(0x016b, 0x0001), /* Ericsson WLAN Card C11 */ |
@@ -441,9 +328,7 @@ MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_ids); | |||
441 | 328 | ||
442 | static struct pcmcia_driver orinoco_driver = { | 329 | static struct pcmcia_driver orinoco_driver = { |
443 | .owner = THIS_MODULE, | 330 | .owner = THIS_MODULE, |
444 | .drv = { | 331 | .name = DRIVER_NAME, |
445 | .name = DRIVER_NAME, | ||
446 | }, | ||
447 | .probe = orinoco_cs_probe, | 332 | .probe = orinoco_cs_probe, |
448 | .remove = orinoco_cs_detach, | 333 | .remove = orinoco_cs_detach, |
449 | .id_table = orinoco_cs_ids, | 334 | .id_table = orinoco_cs_ids, |
@@ -454,8 +339,6 @@ static struct pcmcia_driver orinoco_driver = { | |||
454 | static int __init | 339 | static int __init |
455 | init_orinoco_cs(void) | 340 | init_orinoco_cs(void) |
456 | { | 341 | { |
457 | printk(KERN_DEBUG "%s\n", version); | ||
458 | |||
459 | return pcmcia_register_driver(&orinoco_driver); | 342 | return pcmcia_register_driver(&orinoco_driver); |
460 | } | 343 | } |
461 | 344 | ||
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index a38a7bd25f19..b9aedf18a046 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c | |||
@@ -57,7 +57,6 @@ | |||
57 | #include <linux/fcntl.h> | 57 | #include <linux/fcntl.h> |
58 | #include <linux/spinlock.h> | 58 | #include <linux/spinlock.h> |
59 | #include <linux/list.h> | 59 | #include <linux/list.h> |
60 | #include <linux/smp_lock.h> | ||
61 | #include <linux/usb.h> | 60 | #include <linux/usb.h> |
62 | #include <linux/timer.h> | 61 | #include <linux/timer.h> |
63 | 62 | ||
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c index 4300d9db7d8c..e99ca1c1e0d8 100644 --- a/drivers/net/wireless/orinoco/scan.c +++ b/drivers/net/wireless/orinoco/scan.c | |||
@@ -111,6 +111,11 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv, | |||
111 | 111 | ||
112 | freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel)); | 112 | freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel)); |
113 | channel = ieee80211_get_channel(wiphy, freq); | 113 | channel = ieee80211_get_channel(wiphy, freq); |
114 | if (!channel) { | ||
115 | printk(KERN_DEBUG "Invalid channel designation %04X(%04X)", | ||
116 | bss->a.channel, freq); | ||
117 | return; /* Then ignore it for now */ | ||
118 | } | ||
114 | timestamp = 0; | 119 | timestamp = 0; |
115 | capability = le16_to_cpu(bss->a.capabilities); | 120 | capability = le16_to_cpu(bss->a.capabilities); |
116 | beacon_interval = le16_to_cpu(bss->a.beacon_interv); | 121 | beacon_interval = le16_to_cpu(bss->a.beacon_interv); |
@@ -229,3 +234,11 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv, | |||
229 | priv->scan_request = NULL; | 234 | priv->scan_request = NULL; |
230 | } | 235 | } |
231 | } | 236 | } |
237 | |||
238 | void orinoco_scan_done(struct orinoco_private *priv, bool abort) | ||
239 | { | ||
240 | if (priv->scan_request) { | ||
241 | cfg80211_scan_done(priv->scan_request, abort); | ||
242 | priv->scan_request = NULL; | ||
243 | } | ||
244 | } | ||
diff --git a/drivers/net/wireless/orinoco/scan.h b/drivers/net/wireless/orinoco/scan.h index 2dc4e046dbdb..27281fb0a6dc 100644 --- a/drivers/net/wireless/orinoco/scan.h +++ b/drivers/net/wireless/orinoco/scan.h | |||
@@ -16,5 +16,6 @@ void orinoco_add_extscan_result(struct orinoco_private *priv, | |||
16 | void orinoco_add_hostscan_results(struct orinoco_private *dev, | 16 | void orinoco_add_hostscan_results(struct orinoco_private *dev, |
17 | unsigned char *buf, | 17 | unsigned char *buf, |
18 | size_t len); | 18 | size_t len); |
19 | void orinoco_scan_done(struct orinoco_private *priv, bool abort); | ||
19 | 20 | ||
20 | #endif /* _ORINOCO_SCAN_H_ */ | 21 | #endif /* _ORINOCO_SCAN_H_ */ |
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index 873877e17e1b..81f3673d31d4 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <pcmcia/cs.h> | ||
29 | #include <pcmcia/cistpl.h> | 28 | #include <pcmcia/cistpl.h> |
30 | #include <pcmcia/cisreg.h> | 29 | #include <pcmcia/cisreg.h> |
31 | #include <pcmcia/ds.h> | 30 | #include <pcmcia/ds.h> |
@@ -154,14 +153,6 @@ spectrum_cs_stop_firmware(struct orinoco_private *priv, int idle) | |||
154 | /* PCMCIA stuff */ | 153 | /* PCMCIA stuff */ |
155 | /********************************************************************/ | 154 | /********************************************************************/ |
156 | 155 | ||
157 | /* | ||
158 | * This creates an "instance" of the driver, allocating local data | ||
159 | * structures for one device. The device is registered with Card | ||
160 | * Services. | ||
161 | * | ||
162 | * The dev_link structure is initialized, but we don't actually | ||
163 | * configure the card at this point -- we wait until we receive a card | ||
164 | * insertion event. */ | ||
165 | static int | 156 | static int |
166 | spectrum_cs_probe(struct pcmcia_device *link) | 157 | spectrum_cs_probe(struct pcmcia_device *link) |
167 | { | 158 | { |
@@ -179,23 +170,9 @@ spectrum_cs_probe(struct pcmcia_device *link) | |||
179 | card->p_dev = link; | 170 | card->p_dev = link; |
180 | link->priv = priv; | 171 | link->priv = priv; |
181 | 172 | ||
182 | /* General socket configuration defaults can go here. In this | ||
183 | * client, we assume very little, and rely on the CIS for | ||
184 | * almost everything. In most clients, many details (i.e., | ||
185 | * number, sizes, and attributes of IO windows) are fixed by | ||
186 | * the nature of the device, and can be hard-wired here. */ | ||
187 | link->conf.Attributes = 0; | ||
188 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
189 | |||
190 | return spectrum_cs_config(link); | 173 | return spectrum_cs_config(link); |
191 | } /* spectrum_cs_attach */ | 174 | } /* spectrum_cs_attach */ |
192 | 175 | ||
193 | /* | ||
194 | * This deletes a driver "instance". The device is de-registered with | ||
195 | * Card Services. If it has been released, all local data structures | ||
196 | * are freed. Otherwise, the structures will be freed when the device | ||
197 | * is released. | ||
198 | */ | ||
199 | static void spectrum_cs_detach(struct pcmcia_device *link) | 176 | static void spectrum_cs_detach(struct pcmcia_device *link) |
200 | { | 177 | { |
201 | struct orinoco_private *priv = link->priv; | 178 | struct orinoco_private *priv = link->priv; |
@@ -207,76 +184,13 @@ static void spectrum_cs_detach(struct pcmcia_device *link) | |||
207 | free_orinocodev(priv); | 184 | free_orinocodev(priv); |
208 | } /* spectrum_cs_detach */ | 185 | } /* spectrum_cs_detach */ |
209 | 186 | ||
210 | /* | ||
211 | * spectrum_cs_config() is scheduled to run after a CARD_INSERTION | ||
212 | * event is received, to configure the PCMCIA socket, and to make the | ||
213 | * device available to the system. | ||
214 | */ | ||
215 | |||
216 | static int spectrum_cs_config_check(struct pcmcia_device *p_dev, | 187 | static int spectrum_cs_config_check(struct pcmcia_device *p_dev, |
217 | cistpl_cftable_entry_t *cfg, | ||
218 | cistpl_cftable_entry_t *dflt, | ||
219 | unsigned int vcc, | ||
220 | void *priv_data) | 188 | void *priv_data) |
221 | { | 189 | { |
222 | if (cfg->index == 0) | 190 | if (p_dev->config_index == 0) |
223 | goto next_entry; | 191 | return -EINVAL; |
224 | |||
225 | /* Use power settings for Vcc and Vpp if present */ | ||
226 | /* Note that the CIS values need to be rescaled */ | ||
227 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { | ||
228 | if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { | ||
229 | DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", | ||
230 | __func__, vcc, | ||
231 | cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); | ||
232 | if (!ignore_cis_vcc) | ||
233 | goto next_entry; | ||
234 | } | ||
235 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { | ||
236 | if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { | ||
237 | DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", | ||
238 | __func__, vcc, | ||
239 | dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); | ||
240 | if (!ignore_cis_vcc) | ||
241 | goto next_entry; | ||
242 | } | ||
243 | } | ||
244 | 192 | ||
245 | if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) | 193 | return pcmcia_request_io(p_dev); |
246 | p_dev->conf.Vpp = | ||
247 | cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; | ||
248 | else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) | ||
249 | p_dev->conf.Vpp = | ||
250 | dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; | ||
251 | |||
252 | /* Do we need to allocate an interrupt? */ | ||
253 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | ||
254 | |||
255 | /* IO window settings */ | ||
256 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; | ||
257 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | ||
258 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | ||
259 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; | ||
260 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; | ||
261 | p_dev->resource[0]->flags |= | ||
262 | pcmcia_io_cfg_data_width(io->flags); | ||
263 | p_dev->resource[0]->start = io->win[0].base; | ||
264 | p_dev->resource[0]->end = io->win[0].len; | ||
265 | if (io->nwin > 1) { | ||
266 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; | ||
267 | p_dev->resource[1]->start = io->win[1].base; | ||
268 | p_dev->resource[1]->end = io->win[1].len; | ||
269 | } | ||
270 | |||
271 | /* This reserves IO space but doesn't actually enable it */ | ||
272 | if (pcmcia_request_io(p_dev) != 0) | ||
273 | goto next_entry; | ||
274 | } | ||
275 | return 0; | ||
276 | |||
277 | next_entry: | ||
278 | pcmcia_disable_device(p_dev); | ||
279 | return -ENODEV; | ||
280 | }; | 194 | }; |
281 | 195 | ||
282 | static int | 196 | static int |
@@ -287,20 +201,10 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
287 | int ret; | 201 | int ret; |
288 | void __iomem *mem; | 202 | void __iomem *mem; |
289 | 203 | ||
290 | /* | 204 | link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | |
291 | * In this loop, we scan the CIS for configuration table | 205 | CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; |
292 | * entries, each of which describes a valid card | 206 | if (ignore_cis_vcc) |
293 | * configuration, including voltage, IO window, memory window, | 207 | link->config_flags &= ~CONF_AUTO_CHECK_VCC; |
294 | * and interrupt settings. | ||
295 | * | ||
296 | * We make no assumptions about the card to be configured: we | ||
297 | * use just the information available in the CIS. In an ideal | ||
298 | * world, this would work for any PCMCIA card, but it requires | ||
299 | * a complete and accurate CIS. In practice, a driver usually | ||
300 | * "knows" most of these things without consulting the CIS, | ||
301 | * and most client drivers will only use the CIS to fill in | ||
302 | * implementation-defined details. | ||
303 | */ | ||
304 | ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); | 208 | ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); |
305 | if (ret) { | 209 | if (ret) { |
306 | if (!ignore_cis_vcc) | 210 | if (!ignore_cis_vcc) |
@@ -310,27 +214,22 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
310 | goto failed; | 214 | goto failed; |
311 | } | 215 | } |
312 | 216 | ||
313 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
314 | if (ret) | ||
315 | goto failed; | ||
316 | |||
317 | /* We initialize the hermes structure before completing PCMCIA | ||
318 | * configuration just in case the interrupt handler gets | ||
319 | * called. */ | ||
320 | mem = ioport_map(link->resource[0]->start, | 217 | mem = ioport_map(link->resource[0]->start, |
321 | resource_size(link->resource[0])); | 218 | resource_size(link->resource[0])); |
322 | if (!mem) | 219 | if (!mem) |
323 | goto failed; | 220 | goto failed; |
324 | 221 | ||
222 | /* We initialize the hermes structure before completing PCMCIA | ||
223 | * configuration just in case the interrupt handler gets | ||
224 | * called. */ | ||
325 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); | 225 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); |
326 | hw->eeprom_pda = true; | 226 | hw->eeprom_pda = true; |
327 | 227 | ||
328 | /* | 228 | ret = pcmcia_request_irq(link, orinoco_interrupt); |
329 | * This actually configures the PCMCIA socket -- setting up | 229 | if (ret) |
330 | * the I/O windows and the interrupt mapping, and putting the | 230 | goto failed; |
331 | * card and host interface into "Memory and IO" mode. | 231 | |
332 | */ | 232 | ret = pcmcia_enable_device(link); |
333 | ret = pcmcia_request_configuration(link, &link->conf); | ||
334 | if (ret) | 233 | if (ret) |
335 | goto failed; | 234 | goto failed; |
336 | 235 | ||
@@ -358,11 +257,6 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
358 | return -ENODEV; | 257 | return -ENODEV; |
359 | } /* spectrum_cs_config */ | 258 | } /* spectrum_cs_config */ |
360 | 259 | ||
361 | /* | ||
362 | * After a card is removed, spectrum_cs_release() will unregister the | ||
363 | * device, and release the PCMCIA configuration. If the device is | ||
364 | * still open, this will be postponed until it is closed. | ||
365 | */ | ||
366 | static void | 260 | static void |
367 | spectrum_cs_release(struct pcmcia_device *link) | 261 | spectrum_cs_release(struct pcmcia_device *link) |
368 | { | 262 | { |
@@ -407,13 +301,7 @@ spectrum_cs_resume(struct pcmcia_device *link) | |||
407 | /* Module initialization */ | 301 | /* Module initialization */ |
408 | /********************************************************************/ | 302 | /********************************************************************/ |
409 | 303 | ||
410 | /* Can't be declared "const" or the whole __initdata section will | 304 | static const struct pcmcia_device_id spectrum_cs_ids[] = { |
411 | * become const */ | ||
412 | static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION | ||
413 | " (Pavel Roskin <proski@gnu.org>," | ||
414 | " David Gibson <hermes@gibson.dropbear.id.au>, et al)"; | ||
415 | |||
416 | static struct pcmcia_device_id spectrum_cs_ids[] = { | ||
417 | PCMCIA_DEVICE_MANF_CARD(0x026c, 0x0001), /* Symbol Spectrum24 LA4137 */ | 305 | PCMCIA_DEVICE_MANF_CARD(0x026c, 0x0001), /* Symbol Spectrum24 LA4137 */ |
418 | PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0001), /* Socket Communications CF */ | 306 | PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0001), /* Socket Communications CF */ |
419 | PCMCIA_DEVICE_PROD_ID12("Intel", "PRO/Wireless LAN PC Card", 0x816cc815, 0x6fbf459a), /* 2011B, not 2011 */ | 307 | PCMCIA_DEVICE_PROD_ID12("Intel", "PRO/Wireless LAN PC Card", 0x816cc815, 0x6fbf459a), /* 2011B, not 2011 */ |
@@ -423,9 +311,7 @@ MODULE_DEVICE_TABLE(pcmcia, spectrum_cs_ids); | |||
423 | 311 | ||
424 | static struct pcmcia_driver orinoco_driver = { | 312 | static struct pcmcia_driver orinoco_driver = { |
425 | .owner = THIS_MODULE, | 313 | .owner = THIS_MODULE, |
426 | .drv = { | 314 | .name = DRIVER_NAME, |
427 | .name = DRIVER_NAME, | ||
428 | }, | ||
429 | .probe = spectrum_cs_probe, | 315 | .probe = spectrum_cs_probe, |
430 | .remove = spectrum_cs_detach, | 316 | .remove = spectrum_cs_detach, |
431 | .suspend = spectrum_cs_suspend, | 317 | .suspend = spectrum_cs_suspend, |
@@ -436,8 +322,6 @@ static struct pcmcia_driver orinoco_driver = { | |||
436 | static int __init | 322 | static int __init |
437 | init_spectrum_cs(void) | 323 | init_spectrum_cs(void) |
438 | { | 324 | { |
439 | printk(KERN_DEBUG "%s\n", version); | ||
440 | |||
441 | return pcmcia_register_driver(&orinoco_driver); | 325 | return pcmcia_register_driver(&orinoco_driver); |
442 | } | 326 | } |
443 | 327 | ||
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index cf7be1eb6124..e793679e2e19 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -589,8 +589,15 @@ static int orinoco_ioctl_getrate(struct net_device *dev, | |||
589 | 589 | ||
590 | /* If the interface is running we try to find more about the | 590 | /* If the interface is running we try to find more about the |
591 | current mode */ | 591 | current mode */ |
592 | if (netif_running(dev)) | 592 | if (netif_running(dev)) { |
593 | err = orinoco_hw_get_act_bitrate(priv, &bitrate); | 593 | int act_bitrate; |
594 | int lerr; | ||
595 | |||
596 | /* Ignore errors if we can't get the actual bitrate */ | ||
597 | lerr = orinoco_hw_get_act_bitrate(priv, &act_bitrate); | ||
598 | if (!lerr) | ||
599 | bitrate = act_bitrate; | ||
600 | } | ||
594 | 601 | ||
595 | orinoco_unlock(priv, &flags); | 602 | orinoco_unlock(priv, &flags); |
596 | 603 | ||
@@ -886,6 +893,14 @@ static int orinoco_ioctl_set_auth(struct net_device *dev, | |||
886 | */ | 893 | */ |
887 | break; | 894 | break; |
888 | 895 | ||
896 | case IW_AUTH_MFP: | ||
897 | /* Management Frame Protection not supported. | ||
898 | * Only fail if set to required. | ||
899 | */ | ||
900 | if (param->value == IW_AUTH_MFP_REQUIRED) | ||
901 | ret = -EINVAL; | ||
902 | break; | ||
903 | |||
889 | case IW_AUTH_KEY_MGMT: | 904 | case IW_AUTH_KEY_MGMT: |
890 | /* wl_lkm implies value 2 == PSK for Hermes I | 905 | /* wl_lkm implies value 2 == PSK for Hermes I |
891 | * which ties in with WEXT | 906 | * which ties in with WEXT |
@@ -904,10 +919,10 @@ static int orinoco_ioctl_set_auth(struct net_device *dev, | |||
904 | */ | 919 | */ |
905 | if (param->value) { | 920 | if (param->value) { |
906 | priv->tkip_cm_active = 1; | 921 | priv->tkip_cm_active = 1; |
907 | ret = hermes_enable_port(hw, 0); | 922 | ret = hermes_disable_port(hw, 0); |
908 | } else { | 923 | } else { |
909 | priv->tkip_cm_active = 0; | 924 | priv->tkip_cm_active = 0; |
910 | ret = hermes_disable_port(hw, 0); | 925 | ret = hermes_enable_port(hw, 0); |
911 | } | 926 | } |
912 | break; | 927 | break; |
913 | 928 | ||