aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-05-24 00:29:57 -0400
committerJeff Garzik <jeff@garzik.org>2006-05-24 00:29:57 -0400
commitdb21e578e551421d76641d72cb3f8296ed3f9e61 (patch)
tree73968aeda7ed0051b5cff6950ad513011a3c7a5f
parent6ed14254cb6e269030ff09bed8673473b7be0283 (diff)
parentdf8ccb9bf1ca360581a94c2245efb9fa613fbb29 (diff)
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream
-rw-r--r--drivers/net/wireless/airo.c2
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c8
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c11
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c6
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c2
-rw-r--r--drivers/net/wireless/orinoco_cs.c33
-rw-r--r--drivers/net/wireless/orinoco_nortel.c5
-rw-r--r--drivers/net/wireless/orinoco_pci.c5
-rw-r--r--drivers/net/wireless/orinoco_pci.h31
-rw-r--r--drivers/net/wireless/orinoco_plx.c5
-rw-r--r--drivers/net/wireless/orinoco_tmd.c5
-rw-r--r--drivers/net/wireless/spectrum_cs.c33
-rw-r--r--include/net/ieee80211softmac.h38
-rw-r--r--net/ieee80211/ieee80211_wx.c2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c72
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_auth.c3
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_module.c117
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_priv.h6
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c6
20 files changed, 228 insertions, 163 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 7f2dacf634ee..4069b79d8259 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2768,7 +2768,7 @@ static int airo_test_wpa_capable(struct airo_info *ai)
2768 2768
2769 /* Only firmware versions 5.30.17 or better can do WPA */ 2769 /* Only firmware versions 5.30.17 or better can do WPA */
2770 if ((cap_rid.softVer > 0x530) 2770 if ((cap_rid.softVer > 0x530)
2771 || ((cap_rid.softVer == 0x530) && (cap_rid.softSubVer >= 0x17))) { 2771 || ((cap_rid.softVer == 0x530) && (cap_rid.softSubVer >= 17))) {
2772 airo_print_info(name, "WPA is supported."); 2772 airo_print_info(name, "WPA is supported.");
2773 return 1; 2773 return 1;
2774 } 2774 }
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index 2adf02ac400e..c0502905a956 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -128,13 +128,15 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for .fw files. Useful for debugging.");
128 static struct pci_device_id bcm43xx_pci_tbl[] = { 128 static struct pci_device_id bcm43xx_pci_tbl[] = {
129 /* Broadcom 4303 802.11b */ 129 /* Broadcom 4303 802.11b */
130 { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 130 { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
131 /* Broadcom 4307 802.11b */ 131 /* Broadcom 4307 802.11b */
132 { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 132 { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
133 /* Broadcom 4318 802.11b/g */ 133 /* Broadcom 4318 802.11b/g */
134 { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 134 { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
135 /* Broadcom 4319 802.11a/b/g */
136 { PCI_VENDOR_ID_BROADCOM, 0x4319, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
135 /* Broadcom 4306 802.11b/g */ 137 /* Broadcom 4306 802.11b/g */
136 { PCI_VENDOR_ID_BROADCOM, 0x4320, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 138 { PCI_VENDOR_ID_BROADCOM, 0x4320, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
137 /* Broadcom 4306 802.11a */ 139 /* Broadcom 4306 802.11a */
138// { PCI_VENDOR_ID_BROADCOM, 0x4321, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 140// { PCI_VENDOR_ID_BROADCOM, 0x4321, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
139 /* Broadcom 4309 802.11a/b/g */ 141 /* Broadcom 4309 802.11a/b/g */
140 { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 142 { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 06a5214145e3..4a5be70c0419 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -534,5 +534,4 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
534} 534}
535 535
536 536
537EXPORT_SYMBOL(hostap_dump_tx_80211);
538EXPORT_SYMBOL(hostap_master_start_xmit); 537EXPORT_SYMBOL(hostap_master_start_xmit);
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 06c3fa32b310..ba13125024cb 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -3276,17 +3276,6 @@ EXPORT_SYMBOL(hostap_init_data);
3276EXPORT_SYMBOL(hostap_init_ap_proc); 3276EXPORT_SYMBOL(hostap_init_ap_proc);
3277EXPORT_SYMBOL(hostap_free_data); 3277EXPORT_SYMBOL(hostap_free_data);
3278EXPORT_SYMBOL(hostap_check_sta_fw_version); 3278EXPORT_SYMBOL(hostap_check_sta_fw_version);
3279EXPORT_SYMBOL(hostap_handle_sta_tx);
3280EXPORT_SYMBOL(hostap_handle_sta_release);
3281EXPORT_SYMBOL(hostap_handle_sta_tx_exc); 3279EXPORT_SYMBOL(hostap_handle_sta_tx_exc);
3282EXPORT_SYMBOL(hostap_update_sta_ps);
3283EXPORT_SYMBOL(hostap_handle_sta_rx);
3284EXPORT_SYMBOL(hostap_is_sta_assoc);
3285EXPORT_SYMBOL(hostap_is_sta_authorized);
3286EXPORT_SYMBOL(hostap_add_sta);
3287EXPORT_SYMBOL(hostap_update_rates);
3288EXPORT_SYMBOL(hostap_add_wds_links);
3289EXPORT_SYMBOL(hostap_wds_link_oper);
3290#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 3280#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
3291EXPORT_SYMBOL(hostap_deauth_all_stas);
3292#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3281#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 55bed923fbe9..db03dc2646df 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -881,6 +881,12 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
881 PCMCIA_DEVICE_PROD_ID12( 881 PCMCIA_DEVICE_PROD_ID12(
882 "ZoomAir 11Mbps High", "Rate wireless Networking", 882 "ZoomAir 11Mbps High", "Rate wireless Networking",
883 0x273fe3db, 0x32a1eaee), 883 0x273fe3db, 0x32a1eaee),
884 PCMCIA_DEVICE_PROD_ID123(
885 "Pretec", "CompactWLAN Card 802.11b", "2.5",
886 0x1cadd3e5, 0xe697636c, 0x7a5bfcf1),
887 PCMCIA_DEVICE_PROD_ID123(
888 "U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02",
889 0xc7b8df9d, 0x1700d087, 0x4b74baa0),
884 PCMCIA_DEVICE_NULL 890 PCMCIA_DEVICE_NULL
885}; 891};
886MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids); 892MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 8dd4c4446a64..93786f4218f0 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -1125,11 +1125,9 @@ EXPORT_SYMBOL(hostap_set_auth_algs);
1125EXPORT_SYMBOL(hostap_dump_rx_header); 1125EXPORT_SYMBOL(hostap_dump_rx_header);
1126EXPORT_SYMBOL(hostap_dump_tx_header); 1126EXPORT_SYMBOL(hostap_dump_tx_header);
1127EXPORT_SYMBOL(hostap_80211_header_parse); 1127EXPORT_SYMBOL(hostap_80211_header_parse);
1128EXPORT_SYMBOL(hostap_80211_prism_header_parse);
1129EXPORT_SYMBOL(hostap_80211_get_hdrlen); 1128EXPORT_SYMBOL(hostap_80211_get_hdrlen);
1130EXPORT_SYMBOL(hostap_get_stats); 1129EXPORT_SYMBOL(hostap_get_stats);
1131EXPORT_SYMBOL(hostap_setup_dev); 1130EXPORT_SYMBOL(hostap_setup_dev);
1132EXPORT_SYMBOL(hostap_proc);
1133EXPORT_SYMBOL(hostap_set_multicast_list_queue); 1131EXPORT_SYMBOL(hostap_set_multicast_list_queue);
1134EXPORT_SYMBOL(hostap_set_hostapd); 1132EXPORT_SYMBOL(hostap_set_hostapd);
1135EXPORT_SYMBOL(hostap_set_hostapd_sta); 1133EXPORT_SYMBOL(hostap_set_hostapd_sta);
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index d2c48ac60f46..b2aec4d9fbb1 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -147,14 +147,11 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
147{ 147{
148 struct net_device *dev = link->priv; 148 struct net_device *dev = link->priv;
149 149
150 if (link->dev_node)
151 unregister_netdev(dev);
152
150 orinoco_cs_release(link); 153 orinoco_cs_release(link);
151 154
152 DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
153 if (link->dev_node) {
154 DEBUG(0, PFX "About to unregister net device %p\n",
155 dev);
156 unregister_netdev(dev);
157 }
158 free_orinocodev(dev); 155 free_orinocodev(dev);
159} /* orinoco_cs_detach */ 156} /* orinoco_cs_detach */
160 157
@@ -346,19 +343,10 @@ orinoco_cs_config(struct pcmcia_device *link)
346 net_device has been registered */ 343 net_device has been registered */
347 344
348 /* Finally, report what we've done */ 345 /* Finally, report what we've done */
349 printk(KERN_DEBUG "%s: index 0x%02x: ", 346 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
350 dev->name, link->conf.ConfigIndex); 347 "0x%04x-0x%04x\n", dev->name, dev->class_dev.dev->bus_id,
351 if (link->conf.Vpp) 348 link->irq.AssignedIRQ, link->io.BasePort1,
352 printk(", Vpp %d.%d", link->conf.Vpp / 10, 349 link->io.BasePort1 + link->io.NumPorts1 - 1);
353 link->conf.Vpp % 10);
354 printk(", irq %d", link->irq.AssignedIRQ);
355 if (link->io.NumPorts1)
356 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
357 link->io.BasePort1 + link->io.NumPorts1 - 1);
358 if (link->io.NumPorts2)
359 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
360 link->io.BasePort2 + link->io.NumPorts2 - 1);
361 printk("\n");
362 350
363 return 0; 351 return 0;
364 352
@@ -427,7 +415,6 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
427 struct orinoco_private *priv = netdev_priv(dev); 415 struct orinoco_private *priv = netdev_priv(dev);
428 struct orinoco_pccard *card = priv->card; 416 struct orinoco_pccard *card = priv->card;
429 int err = 0; 417 int err = 0;
430 unsigned long flags;
431 418
432 if (! test_bit(0, &card->hard_reset_in_progress)) { 419 if (! test_bit(0, &card->hard_reset_in_progress)) {
433 err = orinoco_reinit_firmware(dev); 420 err = orinoco_reinit_firmware(dev);
@@ -437,7 +424,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
437 return -EIO; 424 return -EIO;
438 } 425 }
439 426
440 spin_lock_irqsave(&priv->lock, flags); 427 spin_lock(&priv->lock);
441 428
442 netif_device_attach(dev); 429 netif_device_attach(dev);
443 priv->hw_unavailable--; 430 priv->hw_unavailable--;
@@ -449,10 +436,10 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
449 dev->name, err); 436 dev->name, err);
450 } 437 }
451 438
452 spin_unlock_irqrestore(&priv->lock, flags); 439 spin_unlock(&priv->lock);
453 } 440 }
454 441
455 return 0; 442 return err;
456} 443}
457 444
458 445
diff --git a/drivers/net/wireless/orinoco_nortel.c b/drivers/net/wireless/orinoco_nortel.c
index 1596182f7412..74b9d5b2ba9e 100644
--- a/drivers/net/wireless/orinoco_nortel.c
+++ b/drivers/net/wireless/orinoco_nortel.c
@@ -206,7 +206,6 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
206 err = -EBUSY; 206 err = -EBUSY;
207 goto fail_irq; 207 goto fail_irq;
208 } 208 }
209 orinoco_pci_setup_netdev(dev, pdev, 2);
210 209
211 err = orinoco_nortel_hw_init(card); 210 err = orinoco_nortel_hw_init(card);
212 if (err) { 211 if (err) {
@@ -227,6 +226,8 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
227 } 226 }
228 227
229 pci_set_drvdata(pdev, dev); 228 pci_set_drvdata(pdev, dev);
229 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
230 pci_name(pdev));
230 231
231 return 0; 232 return 0;
232 233
@@ -265,7 +266,7 @@ static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev)
265 iowrite16(0, card->bridge_io + 10); 266 iowrite16(0, card->bridge_io + 10);
266 267
267 unregister_netdev(dev); 268 unregister_netdev(dev);
268 free_irq(dev->irq, dev); 269 free_irq(pdev->irq, dev);
269 pci_set_drvdata(pdev, NULL); 270 pci_set_drvdata(pdev, NULL);
270 free_orinocodev(dev); 271 free_orinocodev(dev);
271 pci_iounmap(pdev, priv->hw.iobase); 272 pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
index df37b95607ff..1c105f40f8d5 100644
--- a/drivers/net/wireless/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco_pci.c
@@ -161,7 +161,6 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
161 err = -EBUSY; 161 err = -EBUSY;
162 goto fail_irq; 162 goto fail_irq;
163 } 163 }
164 orinoco_pci_setup_netdev(dev, pdev, 0);
165 164
166 err = orinoco_pci_cor_reset(priv); 165 err = orinoco_pci_cor_reset(priv);
167 if (err) { 166 if (err) {
@@ -176,6 +175,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
176 } 175 }
177 176
178 pci_set_drvdata(pdev, dev); 177 pci_set_drvdata(pdev, dev);
178 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
179 pci_name(pdev));
179 180
180 return 0; 181 return 0;
181 182
@@ -204,7 +205,7 @@ static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
204 struct orinoco_private *priv = netdev_priv(dev); 205 struct orinoco_private *priv = netdev_priv(dev);
205 206
206 unregister_netdev(dev); 207 unregister_netdev(dev);
207 free_irq(dev->irq, dev); 208 free_irq(pdev->irq, dev);
208 pci_set_drvdata(pdev, NULL); 209 pci_set_drvdata(pdev, NULL);
209 free_orinocodev(dev); 210 free_orinocodev(dev);
210 pci_iounmap(pdev, priv->hw.iobase); 211 pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/orinoco_pci.h b/drivers/net/wireless/orinoco_pci.h
index b05a9a5b1f5f..7eb1e08113e0 100644
--- a/drivers/net/wireless/orinoco_pci.h
+++ b/drivers/net/wireless/orinoco_pci.h
@@ -18,32 +18,7 @@ struct orinoco_pci_card {
18 void __iomem *attr_io; 18 void __iomem *attr_io;
19}; 19};
20 20
21/* Set base address or memory range of the network device based on 21#ifdef CONFIG_PM
22 * the PCI device it's using. Specify BAR of the "main" resource.
23 * To be used after request_irq(). */
24static inline void orinoco_pci_setup_netdev(struct net_device *dev,
25 struct pci_dev *pdev, int bar)
26{
27 char *range_type;
28 unsigned long start = pci_resource_start(pdev, bar);
29 unsigned long len = pci_resource_len(pdev, bar);
30 unsigned long flags = pci_resource_flags(pdev, bar);
31 unsigned long end = start + len - 1;
32
33 dev->irq = pdev->irq;
34 if (flags & IORESOURCE_IO) {
35 dev->base_addr = start;
36 range_type = "ports";
37 } else {
38 dev->mem_start = start;
39 dev->mem_end = end;
40 range_type = "memory";
41 }
42
43 printk(KERN_DEBUG PFX "%s: irq %d, %s 0x%lx-0x%lx\n",
44 pci_name(pdev), pdev->irq, range_type, start, end);
45}
46
47static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) 22static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)
48{ 23{
49 struct net_device *dev = pci_get_drvdata(pdev); 24 struct net_device *dev = pci_get_drvdata(pdev);
@@ -121,5 +96,9 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
121 96
122 return 0; 97 return 0;
123} 98}
99#else
100#define orinoco_pci_suspend NULL
101#define orinoco_pci_resume NULL
102#endif
124 103
125#endif /* _ORINOCO_PCI_H */ 104#endif /* _ORINOCO_PCI_H */
diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c
index 7b9405096389..84f696c77551 100644
--- a/drivers/net/wireless/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco_plx.c
@@ -245,7 +245,6 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
245 err = -EBUSY; 245 err = -EBUSY;
246 goto fail_irq; 246 goto fail_irq;
247 } 247 }
248 orinoco_pci_setup_netdev(dev, pdev, 2);
249 248
250 err = orinoco_plx_hw_init(card); 249 err = orinoco_plx_hw_init(card);
251 if (err) { 250 if (err) {
@@ -266,6 +265,8 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
266 } 265 }
267 266
268 pci_set_drvdata(pdev, dev); 267 pci_set_drvdata(pdev, dev);
268 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
269 pci_name(pdev));
269 270
270 return 0; 271 return 0;
271 272
@@ -301,7 +302,7 @@ static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
301 struct orinoco_pci_card *card = priv->card; 302 struct orinoco_pci_card *card = priv->card;
302 303
303 unregister_netdev(dev); 304 unregister_netdev(dev);
304 free_irq(dev->irq, dev); 305 free_irq(pdev->irq, dev);
305 pci_set_drvdata(pdev, NULL); 306 pci_set_drvdata(pdev, NULL);
306 free_orinocodev(dev); 307 free_orinocodev(dev);
307 pci_iounmap(pdev, priv->hw.iobase); 308 pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c
index 0496663e837c..d2b4decb7a7d 100644
--- a/drivers/net/wireless/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco_tmd.c
@@ -147,7 +147,6 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
147 err = -EBUSY; 147 err = -EBUSY;
148 goto fail_irq; 148 goto fail_irq;
149 } 149 }
150 orinoco_pci_setup_netdev(dev, pdev, 2);
151 150
152 err = orinoco_tmd_cor_reset(priv); 151 err = orinoco_tmd_cor_reset(priv);
153 if (err) { 152 if (err) {
@@ -162,6 +161,8 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
162 } 161 }
163 162
164 pci_set_drvdata(pdev, dev); 163 pci_set_drvdata(pdev, dev);
164 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
165 pci_name(pdev));
165 166
166 return 0; 167 return 0;
167 168
@@ -194,7 +195,7 @@ static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
194 struct orinoco_pci_card *card = priv->card; 195 struct orinoco_pci_card *card = priv->card;
195 196
196 unregister_netdev(dev); 197 unregister_netdev(dev);
197 free_irq(dev->irq, dev); 198 free_irq(pdev->irq, dev);
198 pci_set_drvdata(pdev, NULL); 199 pci_set_drvdata(pdev, NULL);
199 free_orinocodev(dev); 200 free_orinocodev(dev);
200 pci_iounmap(pdev, priv->hw.iobase); 201 pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index aeb38d938832..7f9aa139c347 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -625,14 +625,11 @@ static void spectrum_cs_detach(struct pcmcia_device *link)
625{ 625{
626 struct net_device *dev = link->priv; 626 struct net_device *dev = link->priv;
627 627
628 if (link->dev_node)
629 unregister_netdev(dev);
630
628 spectrum_cs_release(link); 631 spectrum_cs_release(link);
629 632
630 DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
631 if (link->dev_node) {
632 DEBUG(0, PFX "About to unregister net device %p\n",
633 dev);
634 unregister_netdev(dev);
635 }
636 free_orinocodev(dev); 633 free_orinocodev(dev);
637} /* spectrum_cs_detach */ 634} /* spectrum_cs_detach */
638 635
@@ -825,19 +822,10 @@ spectrum_cs_config(struct pcmcia_device *link)
825 net_device has been registered */ 822 net_device has been registered */
826 823
827 /* Finally, report what we've done */ 824 /* Finally, report what we've done */
828 printk(KERN_DEBUG "%s: index 0x%02x: ", 825 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
829 dev->name, link->conf.ConfigIndex); 826 "0x%04x-0x%04x\n", dev->name, dev->class_dev.dev->bus_id,
830 if (link->conf.Vpp) 827 link->irq.AssignedIRQ, link->io.BasePort1,
831 printk(", Vpp %d.%d", link->conf.Vpp / 10, 828 link->io.BasePort1 + link->io.NumPorts1 - 1);
832 link->conf.Vpp % 10);
833 printk(", irq %d", link->irq.AssignedIRQ);
834 if (link->io.NumPorts1)
835 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
836 link->io.BasePort1 + link->io.NumPorts1 - 1);
837 if (link->io.NumPorts2)
838 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
839 link->io.BasePort2 + link->io.NumPorts2 - 1);
840 printk("\n");
841 829
842 return 0; 830 return 0;
843 831
@@ -878,11 +866,10 @@ spectrum_cs_suspend(struct pcmcia_device *link)
878{ 866{
879 struct net_device *dev = link->priv; 867 struct net_device *dev = link->priv;
880 struct orinoco_private *priv = netdev_priv(dev); 868 struct orinoco_private *priv = netdev_priv(dev);
881 unsigned long flags;
882 int err = 0; 869 int err = 0;
883 870
884 /* Mark the device as stopped, to block IO until later */ 871 /* Mark the device as stopped, to block IO until later */
885 spin_lock_irqsave(&priv->lock, flags); 872 spin_lock(&priv->lock);
886 873
887 err = __orinoco_down(dev); 874 err = __orinoco_down(dev);
888 if (err) 875 if (err)
@@ -892,9 +879,9 @@ spectrum_cs_suspend(struct pcmcia_device *link)
892 netif_device_detach(dev); 879 netif_device_detach(dev);
893 priv->hw_unavailable++; 880 priv->hw_unavailable++;
894 881
895 spin_unlock_irqrestore(&priv->lock, flags); 882 spin_unlock(&priv->lock);
896 883
897 return 0; 884 return err;
898} 885}
899 886
900static int 887static int
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 052ed596a4e4..703463a8828b 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -86,6 +86,9 @@ struct ieee80211softmac_assoc_info {
86 86
87 /* BSSID we're trying to associate to */ 87 /* BSSID we're trying to associate to */
88 char bssid[ETH_ALEN]; 88 char bssid[ETH_ALEN];
89
90 /* Rates supported by the network */
91 struct ieee80211softmac_ratesinfo supported_rates;
89 92
90 /* some flags. 93 /* some flags.
91 * static_essid is valid if the essid is constant, 94 * static_essid is valid if the essid is constant,
@@ -132,23 +135,26 @@ enum {
132struct ieee80211softmac_txrates { 135struct ieee80211softmac_txrates {
133 /* The Bit-Rate to be used for multicast frames. */ 136 /* The Bit-Rate to be used for multicast frames. */
134 u8 mcast_rate; 137 u8 mcast_rate;
135 /* The Bit-Rate to be used for multicast fallback 138
136 * (If the device supports fallback and hardware-retry) 139 /* The Bit-Rate to be used for multicast management frames. */
137 */ 140 u8 mgt_mcast_rate;
138 u8 mcast_fallback; 141
139 /* The Bit-Rate to be used for any other (normal) data packet. */ 142 /* The Bit-Rate to be used for any other (normal) data packet. */
140 u8 default_rate; 143 u8 default_rate;
141 /* The Bit-Rate to be used for default fallback 144 /* The Bit-Rate to be used for default fallback
142 * (If the device supports fallback and hardware-retry) 145 * (If the device supports fallback and hardware-retry)
143 */ 146 */
144 u8 default_fallback; 147 u8 default_fallback;
148
149 /* This is the rate that the user asked for */
150 u8 user_rate;
145}; 151};
146 152
147/* Bits for txrates_change callback. */ 153/* Bits for txrates_change callback. */
148#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */ 154#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */
149#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */ 155#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */
150#define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ 156#define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */
151#define IEEE80211SOFTMAC_TXRATECHG_MCAST_FBACK (1 << 3) /* mcast_fallback */ 157#define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */
152 158
153struct ieee80211softmac_device { 159struct ieee80211softmac_device {
154 /* 802.11 structure for data stuff */ 160 /* 802.11 structure for data stuff */
@@ -250,6 +256,28 @@ extern void ieee80211softmac_fragment_lost(struct net_device *dev,
250 * Note that the rates need to be sorted. */ 256 * Note that the rates need to be sorted. */
251extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); 257extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates);
252 258
259/* Helper function which advises you the rate at which a frame should be
260 * transmitted at. */
261static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac,
262 int is_multicast,
263 int is_mgt)
264{
265 struct ieee80211softmac_txrates *txrates = &mac->txrates;
266
267 if (!mac->associated)
268 return txrates->mgt_mcast_rate;
269
270 /* We are associated, sending unicast frame */
271 if (!is_multicast)
272 return txrates->default_rate;
273
274 /* We are associated, sending multicast frame */
275 if (is_mgt)
276 return txrates->mgt_mcast_rate;
277 else
278 return txrates->mcast_rate;
279}
280
253/* Start the SoftMAC. Call this after you initialized the device 281/* Start the SoftMAC. Call this after you initialized the device
254 * and it is ready to run. 282 * and it is ready to run.
255 */ 283 */
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 0ea55cb5f172..a78c4f845f66 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -503,7 +503,7 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
503 len = sec->key_sizes[key]; 503 len = sec->key_sizes[key];
504 memcpy(keybuf, sec->keys[key], len); 504 memcpy(keybuf, sec->keys[key], len);
505 505
506 erq->length = (len >= 0 ? len : 0); 506 erq->length = len;
507 erq->flags |= IW_ENCODE_ENABLED; 507 erq->flags |= IW_ENCODE_ENABLED;
508 508
509 if (ieee->open_wep) 509 if (ieee->open_wep)
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index d4c79ce16871..5d90b9a6ee50 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -82,51 +82,52 @@ ieee80211softmac_assoc_timeout(void *d)
82 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, NULL); 82 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, NULL);
83} 83}
84 84
85/* Sends out a disassociation request to the desired AP */
86void 85void
87ieee80211softmac_disassoc(struct ieee80211softmac_device *mac, u16 reason) 86ieee80211softmac_disassoc(struct ieee80211softmac_device *mac)
88{ 87{
89 unsigned long flags; 88 unsigned long flags;
89
90 spin_lock_irqsave(&mac->lock, flags);
91 if (mac->associnfo.associating)
92 cancel_delayed_work(&mac->associnfo.timeout);
93
94 netif_carrier_off(mac->dev);
95
96 mac->associated = 0;
97 mac->associnfo.bssvalid = 0;
98 mac->associnfo.associating = 0;
99 ieee80211softmac_init_txrates(mac);
100 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
101 spin_unlock_irqrestore(&mac->lock, flags);
102}
103
104/* Sends out a disassociation request to the desired AP */
105void
106ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reason)
107{
90 struct ieee80211softmac_network *found; 108 struct ieee80211softmac_network *found;
91 109
92 if (mac->associnfo.bssvalid && mac->associated) { 110 if (mac->associnfo.bssvalid && mac->associated) {
93 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 111 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
94 if (found) 112 if (found)
95 ieee80211softmac_send_mgt_frame(mac, found, IEEE80211_STYPE_DISASSOC, reason); 113 ieee80211softmac_send_mgt_frame(mac, found, IEEE80211_STYPE_DISASSOC, reason);
96 } else if (mac->associnfo.associating) {
97 cancel_delayed_work(&mac->associnfo.timeout);
98 } 114 }
99 115
100 /* Change our state */ 116 ieee80211softmac_disassoc(mac);
101 spin_lock_irqsave(&mac->lock, flags);
102 /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */
103 mac->associated = 0;
104 mac->associnfo.associating = 0;
105 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
106 spin_unlock_irqrestore(&mac->lock, flags);
107} 117}
108 118
109static inline int 119static inline int
110we_support_all_basic_rates(struct ieee80211softmac_device *mac, u8 *from, u8 from_len) 120we_support_all_basic_rates(struct ieee80211softmac_device *mac, u8 *from, u8 from_len)
111{ 121{
112 int idx, search, found; 122 int idx;
113 u8 rate, search_rate; 123 u8 rate;
114 124
115 for (idx = 0; idx < (from_len); idx++) { 125 for (idx = 0; idx < (from_len); idx++) {
116 rate = (from)[idx]; 126 rate = (from)[idx];
117 if (!(rate & IEEE80211_BASIC_RATE_MASK)) 127 if (!(rate & IEEE80211_BASIC_RATE_MASK))
118 continue; 128 continue;
119 found = 0;
120 rate &= ~IEEE80211_BASIC_RATE_MASK; 129 rate &= ~IEEE80211_BASIC_RATE_MASK;
121 for (search = 0; search < mac->ratesinfo.count; search++) { 130 if (!ieee80211softmac_ratesinfo_rate_supported(&mac->ratesinfo, rate))
122 search_rate = mac->ratesinfo.rates[search];
123 search_rate &= ~IEEE80211_BASIC_RATE_MASK;
124 if (rate == search_rate) {
125 found = 1;
126 break;
127 }
128 }
129 if (!found)
130 return 0; 131 return 0;
131 } 132 }
132 return 1; 133 return 1;
@@ -176,14 +177,18 @@ ieee80211softmac_assoc_work(void *d)
176 struct ieee80211softmac_device *mac = (struct ieee80211softmac_device *)d; 177 struct ieee80211softmac_device *mac = (struct ieee80211softmac_device *)d;
177 struct ieee80211softmac_network *found = NULL; 178 struct ieee80211softmac_network *found = NULL;
178 struct ieee80211_network *net = NULL, *best = NULL; 179 struct ieee80211_network *net = NULL, *best = NULL;
180 int bssvalid;
179 unsigned long flags; 181 unsigned long flags;
180 182
183 /* ieee80211_disassoc might clear this */
184 bssvalid = mac->associnfo.bssvalid;
185
181 /* meh */ 186 /* meh */
182 if (mac->associated) 187 if (mac->associated)
183 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT); 188 ieee80211softmac_send_disassoc_req(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);
184 189
185 /* try to find the requested network in our list, if we found one already */ 190 /* try to find the requested network in our list, if we found one already */
186 if (mac->associnfo.bssvalid || mac->associnfo.bssfixed) 191 if (bssvalid || mac->associnfo.bssfixed)
187 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 192 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
188 193
189 /* Search the ieee80211 networks for this network if we didn't find it by bssid, 194 /* Search the ieee80211 networks for this network if we didn't find it by bssid,
@@ -297,6 +302,9 @@ ieee80211softmac_associated(struct ieee80211softmac_device *mac,
297 struct ieee80211softmac_network *net) 302 struct ieee80211softmac_network *net)
298{ 303{
299 mac->associnfo.associating = 0; 304 mac->associnfo.associating = 0;
305 mac->associnfo.supported_rates = net->supported_rates;
306 ieee80211softmac_recalc_txrates(mac);
307
300 mac->associated = 1; 308 mac->associated = 1;
301 if (mac->set_bssid_filter) 309 if (mac->set_bssid_filter)
302 mac->set_bssid_filter(mac->dev, net->bssid); 310 mac->set_bssid_filter(mac->dev, net->bssid);
@@ -380,7 +388,6 @@ ieee80211softmac_handle_disassoc(struct net_device * dev,
380 struct ieee80211_disassoc *disassoc) 388 struct ieee80211_disassoc *disassoc)
381{ 389{
382 struct ieee80211softmac_device *mac = ieee80211_priv(dev); 390 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
383 unsigned long flags;
384 391
385 if (unlikely(!mac->running)) 392 if (unlikely(!mac->running))
386 return -ENODEV; 393 return -ENODEV;
@@ -392,14 +399,11 @@ ieee80211softmac_handle_disassoc(struct net_device * dev,
392 return 0; 399 return 0;
393 400
394 dprintk(KERN_INFO PFX "got disassoc frame\n"); 401 dprintk(KERN_INFO PFX "got disassoc frame\n");
395 netif_carrier_off(dev); 402 ieee80211softmac_disassoc(mac);
396 spin_lock_irqsave(&mac->lock, flags); 403
397 mac->associnfo.bssvalid = 0; 404 /* try to reassociate */
398 mac->associated = 0;
399 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
400 schedule_work(&mac->associnfo.work); 405 schedule_work(&mac->associnfo.work);
401 spin_unlock_irqrestore(&mac->lock, flags); 406
402
403 return 0; 407 return 0;
404} 408}
405 409
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 06e332624665..084b6211f293 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -279,6 +279,9 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
279 struct list_head *list_ptr; 279 struct list_head *list_ptr;
280 unsigned long flags; 280 unsigned long flags;
281 281
282 /* deauthentication implies disassociation */
283 ieee80211softmac_disassoc(mac);
284
282 /* Lock and reset status flags */ 285 /* Lock and reset status flags */
283 spin_lock_irqsave(&mac->lock, flags); 286 spin_lock_irqsave(&mac->lock, flags);
284 net->authenticating = 0; 287 net->authenticating = 0;
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c
index 6252be2c0db9..4b2e57d12418 100644
--- a/net/ieee80211/softmac/ieee80211softmac_module.c
+++ b/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -26,6 +26,7 @@
26 26
27#include "ieee80211softmac_priv.h" 27#include "ieee80211softmac_priv.h"
28#include <linux/sort.h> 28#include <linux/sort.h>
29#include <linux/etherdevice.h>
29 30
30struct net_device *alloc_ieee80211softmac(int sizeof_priv) 31struct net_device *alloc_ieee80211softmac(int sizeof_priv)
31{ 32{
@@ -61,14 +62,6 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
61 softmac->wait_for_scan = ieee80211softmac_wait_for_scan_implementation; 62 softmac->wait_for_scan = ieee80211softmac_wait_for_scan_implementation;
62 softmac->stop_scan = ieee80211softmac_stop_scan_implementation; 63 softmac->stop_scan = ieee80211softmac_stop_scan_implementation;
63 64
64 //TODO: The mcast rate has to be assigned dynamically somewhere (in scanning, association. Not sure...)
65 // It has to be set to the highest rate all stations in the current network can handle.
66 softmac->txrates.mcast_rate = IEEE80211_CCK_RATE_1MB;
67 softmac->txrates.mcast_fallback = IEEE80211_CCK_RATE_1MB;
68 /* This is reassigned in ieee80211softmac_start to sane values. */
69 softmac->txrates.default_rate = IEEE80211_CCK_RATE_1MB;
70 softmac->txrates.default_fallback = IEEE80211_CCK_RATE_1MB;
71
72 /* to start with, we can't send anything ... */ 65 /* to start with, we can't send anything ... */
73 netif_carrier_off(dev); 66 netif_carrier_off(dev);
74 67
@@ -170,15 +163,82 @@ static void ieee80211softmac_start_check_rates(struct ieee80211softmac_device *m
170 } 163 }
171} 164}
172 165
173void ieee80211softmac_start(struct net_device *dev) 166int ieee80211softmac_ratesinfo_rate_supported(struct ieee80211softmac_ratesinfo *ri, u8 rate)
167{
168 int search;
169 u8 search_rate;
170
171 for (search = 0; search < ri->count; search++) {
172 search_rate = ri->rates[search];
173 search_rate &= ~IEEE80211_BASIC_RATE_MASK;
174 if (rate == search_rate)
175 return 1;
176 }
177
178 return 0;
179}
180
181/* Finds the highest rate which is:
182 * 1. Present in ri (optionally a basic rate)
183 * 2. Supported by the device
184 * 3. Less than or equal to the user-defined rate
185 */
186static u8 highest_supported_rate(struct ieee80211softmac_device *mac,
187 struct ieee80211softmac_ratesinfo *ri, int basic_only)
188{
189 u8 user_rate = mac->txrates.user_rate;
190 int i;
191
192 if (ri->count == 0) {
193 dprintk(KERN_ERR PFX "empty ratesinfo?\n");
194 return IEEE80211_CCK_RATE_1MB;
195 }
196
197 for (i = ri->count - 1; i >= 0; i--) {
198 u8 rate = ri->rates[i];
199 if (basic_only && !(rate & IEEE80211_BASIC_RATE_MASK))
200 continue;
201 rate &= ~IEEE80211_BASIC_RATE_MASK;
202 if (rate > user_rate)
203 continue;
204 if (ieee80211softmac_ratesinfo_rate_supported(&mac->ratesinfo, rate))
205 return rate;
206 }
207
208 /* If we haven't found a suitable rate by now, just trust the user */
209 return user_rate;
210}
211
212void ieee80211softmac_recalc_txrates(struct ieee80211softmac_device *mac)
213{
214 struct ieee80211softmac_txrates *txrates = &mac->txrates;
215 struct ieee80211softmac_txrates oldrates;
216 u32 change = 0;
217
218 if (mac->txrates_change)
219 oldrates = mac->txrates;
220
221 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT;
222 txrates->default_rate = highest_supported_rate(mac, &mac->associnfo.supported_rates, 0);
223
224 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK;
225 txrates->default_fallback = lower_rate(mac, txrates->default_rate);
226
227 change |= IEEE80211SOFTMAC_TXRATECHG_MCAST;
228 txrates->mcast_rate = highest_supported_rate(mac, &mac->associnfo.supported_rates, 1);
229
230 if (mac->txrates_change)
231 mac->txrates_change(mac->dev, change, &oldrates);
232
233}
234
235void ieee80211softmac_init_txrates(struct ieee80211softmac_device *mac)
174{ 236{
175 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
176 struct ieee80211_device *ieee = mac->ieee; 237 struct ieee80211_device *ieee = mac->ieee;
177 u32 change = 0; 238 u32 change = 0;
239 struct ieee80211softmac_txrates *txrates = &mac->txrates;
178 struct ieee80211softmac_txrates oldrates; 240 struct ieee80211softmac_txrates oldrates;
179 241
180 ieee80211softmac_start_check_rates(mac);
181
182 /* TODO: We need some kind of state machine to lower the default rates 242 /* TODO: We need some kind of state machine to lower the default rates
183 * if we loose too many packets. 243 * if we loose too many packets.
184 */ 244 */
@@ -193,22 +253,37 @@ void ieee80211softmac_start(struct net_device *dev)
193 more reliable. Note similar logic in 253 more reliable. Note similar logic in
194 ieee80211softmac_wx_set_rate() */ 254 ieee80211softmac_wx_set_rate() */
195 if (ieee->modulation & IEEE80211_CCK_MODULATION) { 255 if (ieee->modulation & IEEE80211_CCK_MODULATION) {
196 mac->txrates.default_rate = IEEE80211_CCK_RATE_11MB; 256 txrates->user_rate = IEEE80211_CCK_RATE_11MB;
197 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT;
198 mac->txrates.default_fallback = IEEE80211_CCK_RATE_5MB;
199 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK;
200 } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) { 257 } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) {
201 mac->txrates.default_rate = IEEE80211_OFDM_RATE_54MB; 258 txrates->user_rate = IEEE80211_OFDM_RATE_54MB;
202 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT;
203 mac->txrates.default_fallback = IEEE80211_OFDM_RATE_24MB;
204 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK;
205 } else 259 } else
206 assert(0); 260 assert(0);
261
262 txrates->default_rate = IEEE80211_CCK_RATE_1MB;
263 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT;
264
265 txrates->default_fallback = IEEE80211_CCK_RATE_1MB;
266 change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK;
267
268 txrates->mcast_rate = IEEE80211_CCK_RATE_1MB;
269 change |= IEEE80211SOFTMAC_TXRATECHG_MCAST;
270
271 txrates->mgt_mcast_rate = IEEE80211_CCK_RATE_1MB;
272 change |= IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST;
273
207 if (mac->txrates_change) 274 if (mac->txrates_change)
208 mac->txrates_change(dev, change, &oldrates); 275 mac->txrates_change(mac->dev, change, &oldrates);
209 276
210 mac->running = 1; 277 mac->running = 1;
211} 278}
279
280void ieee80211softmac_start(struct net_device *dev)
281{
282 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
283
284 ieee80211softmac_start_check_rates(mac);
285 ieee80211softmac_init_txrates(mac);
286}
212EXPORT_SYMBOL_GPL(ieee80211softmac_start); 287EXPORT_SYMBOL_GPL(ieee80211softmac_start);
213 288
214void ieee80211softmac_stop(struct net_device *dev) 289void ieee80211softmac_stop(struct net_device *dev)
diff --git a/net/ieee80211/softmac/ieee80211softmac_priv.h b/net/ieee80211/softmac/ieee80211softmac_priv.h
index 8c95b3abe0cc..fa1f8e3acfc0 100644
--- a/net/ieee80211/softmac/ieee80211softmac_priv.h
+++ b/net/ieee80211/softmac/ieee80211softmac_priv.h
@@ -116,7 +116,10 @@ ieee80211softmac_get_network_by_essid(struct ieee80211softmac_device *mac,
116 struct ieee80211softmac_essid *essid); 116 struct ieee80211softmac_essid *essid);
117 117
118/* Rates related */ 118/* Rates related */
119int ieee80211softmac_ratesinfo_rate_supported(struct ieee80211softmac_ratesinfo *ri, u8 rate);
119u8 ieee80211softmac_lower_rate_delta(struct ieee80211softmac_device *mac, u8 rate, int delta); 120u8 ieee80211softmac_lower_rate_delta(struct ieee80211softmac_device *mac, u8 rate, int delta);
121void ieee80211softmac_init_txrates(struct ieee80211softmac_device *mac);
122void ieee80211softmac_recalc_txrates(struct ieee80211softmac_device *mac);
120static inline u8 lower_rate(struct ieee80211softmac_device *mac, u8 rate) { 123static inline u8 lower_rate(struct ieee80211softmac_device *mac, u8 rate) {
121 return ieee80211softmac_lower_rate_delta(mac, rate, 1); 124 return ieee80211softmac_lower_rate_delta(mac, rate, 1);
122} 125}
@@ -150,7 +153,8 @@ int ieee80211softmac_handle_disassoc(struct net_device * dev,
150int ieee80211softmac_handle_reassoc_req(struct net_device * dev, 153int ieee80211softmac_handle_reassoc_req(struct net_device * dev,
151 struct ieee80211_reassoc_request * reassoc); 154 struct ieee80211_reassoc_request * reassoc);
152void ieee80211softmac_assoc_timeout(void *d); 155void ieee80211softmac_assoc_timeout(void *d);
153void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac, u16 reason); 156void ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reason);
157void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac);
154 158
155/* some helper functions */ 159/* some helper functions */
156static inline int ieee80211softmac_scan_handlers_check_self(struct ieee80211softmac_device *sm) 160static inline int ieee80211softmac_scan_handlers_check_self(struct ieee80211softmac_device *sm)
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index 8d0c22641ca8..22aa6199185b 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -211,8 +211,8 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev,
211 if (is_ofdm && !(ieee->modulation & IEEE80211_OFDM_MODULATION)) 211 if (is_ofdm && !(ieee->modulation & IEEE80211_OFDM_MODULATION))
212 goto out_unlock; 212 goto out_unlock;
213 213
214 mac->txrates.default_rate = rate; 214 mac->txrates.user_rate = rate;
215 mac->txrates.default_fallback = lower_rate(mac, rate); 215 ieee80211softmac_recalc_txrates(mac);
216 err = 0; 216 err = 0;
217 217
218out_unlock: 218out_unlock:
@@ -456,7 +456,7 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev,
456 } 456 }
457 return ieee80211softmac_deauth_req(mac, net, reason); 457 return ieee80211softmac_deauth_req(mac, net, reason);
458 case IW_MLME_DISASSOC: 458 case IW_MLME_DISASSOC:
459 ieee80211softmac_disassoc(mac, reason); 459 ieee80211softmac_send_disassoc_req(mac, reason);
460 return 0; 460 return 0;
461 default: 461 default:
462 return -EOPNOTSUPP; 462 return -EOPNOTSUPP;