aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/airo.c94
-rw-r--r--drivers/net/wireless/ath5k/base.c8
-rw-r--r--drivers/net/wireless/b43/leds.c5
-rw-r--r--drivers/net/wireless/b43/main.c10
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c32
-rw-r--r--drivers/net/wireless/libertas/scan.c2
-rw-r--r--drivers/net/wireless/strip.c66
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c4
9 files changed, 87 insertions, 136 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 932d6b1c9d0b..45f47c1c0a35 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3657,7 +3657,7 @@ void mpi_receive_802_11 (struct airo_info *ai)
3657 ptr += hdrlen; 3657 ptr += hdrlen;
3658 if (hdrlen == 24) 3658 if (hdrlen == 24)
3659 ptr += 6; 3659 ptr += 6;
3660 gap = le16_to_cpu(get_unaligned((__le16 *)ptr)); 3660 gap = get_unaligned_le16(ptr);
3661 ptr += sizeof(__le16); 3661 ptr += sizeof(__le16);
3662 if (gap) { 3662 if (gap) {
3663 if (gap <= 8) 3663 if (gap <= 8)
@@ -4347,24 +4347,28 @@ static int proc_config_open( struct inode *inode, struct file *file );
4347static int proc_wepkey_open( struct inode *inode, struct file *file ); 4347static int proc_wepkey_open( struct inode *inode, struct file *file );
4348 4348
4349static const struct file_operations proc_statsdelta_ops = { 4349static const struct file_operations proc_statsdelta_ops = {
4350 .owner = THIS_MODULE,
4350 .read = proc_read, 4351 .read = proc_read,
4351 .open = proc_statsdelta_open, 4352 .open = proc_statsdelta_open,
4352 .release = proc_close 4353 .release = proc_close
4353}; 4354};
4354 4355
4355static const struct file_operations proc_stats_ops = { 4356static const struct file_operations proc_stats_ops = {
4357 .owner = THIS_MODULE,
4356 .read = proc_read, 4358 .read = proc_read,
4357 .open = proc_stats_open, 4359 .open = proc_stats_open,
4358 .release = proc_close 4360 .release = proc_close
4359}; 4361};
4360 4362
4361static const struct file_operations proc_status_ops = { 4363static const struct file_operations proc_status_ops = {
4364 .owner = THIS_MODULE,
4362 .read = proc_read, 4365 .read = proc_read,
4363 .open = proc_status_open, 4366 .open = proc_status_open,
4364 .release = proc_close 4367 .release = proc_close
4365}; 4368};
4366 4369
4367static const struct file_operations proc_SSID_ops = { 4370static const struct file_operations proc_SSID_ops = {
4371 .owner = THIS_MODULE,
4368 .read = proc_read, 4372 .read = proc_read,
4369 .write = proc_write, 4373 .write = proc_write,
4370 .open = proc_SSID_open, 4374 .open = proc_SSID_open,
@@ -4372,6 +4376,7 @@ static const struct file_operations proc_SSID_ops = {
4372}; 4376};
4373 4377
4374static const struct file_operations proc_BSSList_ops = { 4378static const struct file_operations proc_BSSList_ops = {
4379 .owner = THIS_MODULE,
4375 .read = proc_read, 4380 .read = proc_read,
4376 .write = proc_write, 4381 .write = proc_write,
4377 .open = proc_BSSList_open, 4382 .open = proc_BSSList_open,
@@ -4379,6 +4384,7 @@ static const struct file_operations proc_BSSList_ops = {
4379}; 4384};
4380 4385
4381static const struct file_operations proc_APList_ops = { 4386static const struct file_operations proc_APList_ops = {
4387 .owner = THIS_MODULE,
4382 .read = proc_read, 4388 .read = proc_read,
4383 .write = proc_write, 4389 .write = proc_write,
4384 .open = proc_APList_open, 4390 .open = proc_APList_open,
@@ -4386,6 +4392,7 @@ static const struct file_operations proc_APList_ops = {
4386}; 4392};
4387 4393
4388static const struct file_operations proc_config_ops = { 4394static const struct file_operations proc_config_ops = {
4395 .owner = THIS_MODULE,
4389 .read = proc_read, 4396 .read = proc_read,
4390 .write = proc_write, 4397 .write = proc_write,
4391 .open = proc_config_open, 4398 .open = proc_config_open,
@@ -4393,6 +4400,7 @@ static const struct file_operations proc_config_ops = {
4393}; 4400};
4394 4401
4395static const struct file_operations proc_wepkey_ops = { 4402static const struct file_operations proc_wepkey_ops = {
4403 .owner = THIS_MODULE,
4396 .read = proc_read, 4404 .read = proc_read,
4397 .write = proc_write, 4405 .write = proc_write,
4398 .open = proc_wepkey_open, 4406 .open = proc_wepkey_open,
@@ -4411,10 +4419,6 @@ struct proc_data {
4411 void (*on_close) (struct inode *, struct file *); 4419 void (*on_close) (struct inode *, struct file *);
4412}; 4420};
4413 4421
4414#ifndef SETPROC_OPS
4415#define SETPROC_OPS(entry, ops) (entry)->proc_fops = &(ops)
4416#endif
4417
4418static int setup_proc_entry( struct net_device *dev, 4422static int setup_proc_entry( struct net_device *dev,
4419 struct airo_info *apriv ) { 4423 struct airo_info *apriv ) {
4420 struct proc_dir_entry *entry; 4424 struct proc_dir_entry *entry;
@@ -4430,100 +4434,76 @@ static int setup_proc_entry( struct net_device *dev,
4430 apriv->proc_entry->owner = THIS_MODULE; 4434 apriv->proc_entry->owner = THIS_MODULE;
4431 4435
4432 /* Setup the StatsDelta */ 4436 /* Setup the StatsDelta */
4433 entry = create_proc_entry("StatsDelta", 4437 entry = proc_create_data("StatsDelta",
4434 S_IFREG | (S_IRUGO&proc_perm), 4438 S_IFREG | (S_IRUGO&proc_perm),
4435 apriv->proc_entry); 4439 apriv->proc_entry, &proc_statsdelta_ops, dev);
4436 if (!entry) 4440 if (!entry)
4437 goto fail_stats_delta; 4441 goto fail_stats_delta;
4438 entry->uid = proc_uid; 4442 entry->uid = proc_uid;
4439 entry->gid = proc_gid; 4443 entry->gid = proc_gid;
4440 entry->data = dev;
4441 entry->owner = THIS_MODULE;
4442 SETPROC_OPS(entry, proc_statsdelta_ops);
4443 4444
4444 /* Setup the Stats */ 4445 /* Setup the Stats */
4445 entry = create_proc_entry("Stats", 4446 entry = proc_create_data("Stats",
4446 S_IFREG | (S_IRUGO&proc_perm), 4447 S_IFREG | (S_IRUGO&proc_perm),
4447 apriv->proc_entry); 4448 apriv->proc_entry, &proc_stats_ops, dev);
4448 if (!entry) 4449 if (!entry)
4449 goto fail_stats; 4450 goto fail_stats;
4450 entry->uid = proc_uid; 4451 entry->uid = proc_uid;
4451 entry->gid = proc_gid; 4452 entry->gid = proc_gid;
4452 entry->data = dev;
4453 entry->owner = THIS_MODULE;
4454 SETPROC_OPS(entry, proc_stats_ops);
4455 4453
4456 /* Setup the Status */ 4454 /* Setup the Status */
4457 entry = create_proc_entry("Status", 4455 entry = proc_create_data("Status",
4458 S_IFREG | (S_IRUGO&proc_perm), 4456 S_IFREG | (S_IRUGO&proc_perm),
4459 apriv->proc_entry); 4457 apriv->proc_entry, &proc_status_ops, dev);
4460 if (!entry) 4458 if (!entry)
4461 goto fail_status; 4459 goto fail_status;
4462 entry->uid = proc_uid; 4460 entry->uid = proc_uid;
4463 entry->gid = proc_gid; 4461 entry->gid = proc_gid;
4464 entry->data = dev;
4465 entry->owner = THIS_MODULE;
4466 SETPROC_OPS(entry, proc_status_ops);
4467 4462
4468 /* Setup the Config */ 4463 /* Setup the Config */
4469 entry = create_proc_entry("Config", 4464 entry = proc_create_data("Config",
4470 S_IFREG | proc_perm, 4465 S_IFREG | proc_perm,
4471 apriv->proc_entry); 4466 apriv->proc_entry, &proc_config_ops, dev);
4472 if (!entry) 4467 if (!entry)
4473 goto fail_config; 4468 goto fail_config;
4474 entry->uid = proc_uid; 4469 entry->uid = proc_uid;
4475 entry->gid = proc_gid; 4470 entry->gid = proc_gid;
4476 entry->data = dev;
4477 entry->owner = THIS_MODULE;
4478 SETPROC_OPS(entry, proc_config_ops);
4479 4471
4480 /* Setup the SSID */ 4472 /* Setup the SSID */
4481 entry = create_proc_entry("SSID", 4473 entry = proc_create_data("SSID",
4482 S_IFREG | proc_perm, 4474 S_IFREG | proc_perm,
4483 apriv->proc_entry); 4475 apriv->proc_entry, &proc_SSID_ops, dev);
4484 if (!entry) 4476 if (!entry)
4485 goto fail_ssid; 4477 goto fail_ssid;
4486 entry->uid = proc_uid; 4478 entry->uid = proc_uid;
4487 entry->gid = proc_gid; 4479 entry->gid = proc_gid;
4488 entry->data = dev;
4489 entry->owner = THIS_MODULE;
4490 SETPROC_OPS(entry, proc_SSID_ops);
4491 4480
4492 /* Setup the APList */ 4481 /* Setup the APList */
4493 entry = create_proc_entry("APList", 4482 entry = proc_create_data("APList",
4494 S_IFREG | proc_perm, 4483 S_IFREG | proc_perm,
4495 apriv->proc_entry); 4484 apriv->proc_entry, &proc_APList_ops, dev);
4496 if (!entry) 4485 if (!entry)
4497 goto fail_aplist; 4486 goto fail_aplist;
4498 entry->uid = proc_uid; 4487 entry->uid = proc_uid;
4499 entry->gid = proc_gid; 4488 entry->gid = proc_gid;
4500 entry->data = dev;
4501 entry->owner = THIS_MODULE;
4502 SETPROC_OPS(entry, proc_APList_ops);
4503 4489
4504 /* Setup the BSSList */ 4490 /* Setup the BSSList */
4505 entry = create_proc_entry("BSSList", 4491 entry = proc_create_data("BSSList",
4506 S_IFREG | proc_perm, 4492 S_IFREG | proc_perm,
4507 apriv->proc_entry); 4493 apriv->proc_entry, &proc_BSSList_ops, dev);
4508 if (!entry) 4494 if (!entry)
4509 goto fail_bsslist; 4495 goto fail_bsslist;
4510 entry->uid = proc_uid; 4496 entry->uid = proc_uid;
4511 entry->gid = proc_gid; 4497 entry->gid = proc_gid;
4512 entry->data = dev;
4513 entry->owner = THIS_MODULE;
4514 SETPROC_OPS(entry, proc_BSSList_ops);
4515 4498
4516 /* Setup the WepKey */ 4499 /* Setup the WepKey */
4517 entry = create_proc_entry("WepKey", 4500 entry = proc_create_data("WepKey",
4518 S_IFREG | proc_perm, 4501 S_IFREG | proc_perm,
4519 apriv->proc_entry); 4502 apriv->proc_entry, &proc_wepkey_ops, dev);
4520 if (!entry) 4503 if (!entry)
4521 goto fail_wepkey; 4504 goto fail_wepkey;
4522 entry->uid = proc_uid; 4505 entry->uid = proc_uid;
4523 entry->gid = proc_gid; 4506 entry->gid = proc_gid;
4524 entry->data = dev;
4525 entry->owner = THIS_MODULE;
4526 SETPROC_OPS(entry, proc_wepkey_ops);
4527 4507
4528 return 0; 4508 return 0;
4529 4509
@@ -5625,9 +5605,9 @@ static int __init airo_init_module( void )
5625 int have_isa_dev = 0; 5605 int have_isa_dev = 0;
5626#endif 5606#endif
5627 5607
5628 airo_entry = create_proc_entry("aironet", 5608 airo_entry = create_proc_entry("driver/aironet",
5629 S_IFDIR | airo_perm, 5609 S_IFDIR | airo_perm,
5630 proc_root_driver); 5610 NULL);
5631 5611
5632 if (airo_entry) { 5612 if (airo_entry) {
5633 airo_entry->uid = proc_uid; 5613 airo_entry->uid = proc_uid;
@@ -5651,7 +5631,7 @@ static int __init airo_init_module( void )
5651 airo_print_info("", "Finished probing for PCI adapters"); 5631 airo_print_info("", "Finished probing for PCI adapters");
5652 5632
5653 if (i) { 5633 if (i) {
5654 remove_proc_entry("aironet", proc_root_driver); 5634 remove_proc_entry("driver/aironet", NULL);
5655 return i; 5635 return i;
5656 } 5636 }
5657#endif 5637#endif
@@ -5673,7 +5653,7 @@ static void __exit airo_cleanup_module( void )
5673#ifdef CONFIG_PCI 5653#ifdef CONFIG_PCI
5674 pci_unregister_driver(&airo_driver); 5654 pci_unregister_driver(&airo_driver);
5675#endif 5655#endif
5676 remove_proc_entry("aironet", proc_root_driver); 5656 remove_proc_entry("driver/aironet", NULL);
5677} 5657}
5678 5658
5679/* 5659/*
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index e18305b781c9..4e5c8fc35200 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -58,10 +58,6 @@
58#include "reg.h" 58#include "reg.h"
59#include "debug.h" 59#include "debug.h"
60 60
61/* unaligned little endian access */
62#define LE_READ_2(_p) (le16_to_cpu(get_unaligned((__le16 *)(_p))))
63#define LE_READ_4(_p) (le32_to_cpu(get_unaligned((__le32 *)(_p))))
64
65enum { 61enum {
66 ATH_LED_TX, 62 ATH_LED_TX,
67 ATH_LED_RX, 63 ATH_LED_RX,
@@ -2909,9 +2905,9 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
2909 if (!mclist) 2905 if (!mclist)
2910 break; 2906 break;
2911 /* calculate XOR of eight 6-bit values */ 2907 /* calculate XOR of eight 6-bit values */
2912 val = LE_READ_4(mclist->dmi_addr + 0); 2908 val = get_unaligned_le32(mclist->dmi_addr + 0);
2913 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; 2909 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
2914 val = LE_READ_4(mclist->dmi_addr + 3); 2910 val = get_unaligned_le32(mclist->dmi_addr + 3);
2915 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; 2911 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
2916 pos &= 0x3f; 2912 pos &= 0x3f;
2917 mfilt[pos / 32] |= (1 << (pos % 32)); 2913 mfilt[pos / 32] |= (1 << (pos % 32));
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c
index 0aac1ff511df..36a9c42df835 100644
--- a/drivers/net/wireless/b43/leds.c
+++ b/drivers/net/wireless/b43/leds.c
@@ -116,10 +116,7 @@ static void b43_unregister_led(struct b43_led *led)
116{ 116{
117 if (!led->dev) 117 if (!led->dev)
118 return; 118 return;
119 if (led->dev->suspend_in_progress) 119 led_classdev_unregister(&led->led_dev);
120 led_classdev_unregister_suspended(&led->led_dev);
121 else
122 led_classdev_unregister(&led->led_dev);
123 b43_led_turn_off(led->dev, led->index, led->activelow); 120 b43_led_turn_off(led->dev, led->index, led->activelow);
124 led->dev = NULL; 121 led->dev = NULL;
125} 122}
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 1e95c4f5256b..6c7db9a1a466 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2171,7 +2171,7 @@ static int b43_write_initvals(struct b43_wldev *dev,
2171 goto err_format; 2171 goto err_format;
2172 array_size -= sizeof(iv->data.d32); 2172 array_size -= sizeof(iv->data.d32);
2173 2173
2174 value = be32_to_cpu(get_unaligned(&iv->data.d32)); 2174 value = get_unaligned_be32(&iv->data.d32);
2175 b43_write32(dev, offset, value); 2175 b43_write32(dev, offset, value);
2176 2176
2177 iv = (const struct b43_iv *)((const uint8_t *)iv + 2177 iv = (const struct b43_iv *)((const uint8_t *)iv +
@@ -2808,10 +2808,10 @@ static int b43_rng_read(struct hwrng *rng, u32 * data)
2808 return (sizeof(u16)); 2808 return (sizeof(u16));
2809} 2809}
2810 2810
2811static void b43_rng_exit(struct b43_wl *wl, bool suspended) 2811static void b43_rng_exit(struct b43_wl *wl)
2812{ 2812{
2813 if (wl->rng_initialized) 2813 if (wl->rng_initialized)
2814 __hwrng_unregister(&wl->rng, suspended); 2814 hwrng_unregister(&wl->rng);
2815} 2815}
2816 2816
2817static int b43_rng_init(struct b43_wl *wl) 2817static int b43_rng_init(struct b43_wl *wl)
@@ -3832,7 +3832,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
3832 3832
3833 if (!dev->suspend_in_progress) { 3833 if (!dev->suspend_in_progress) {
3834 b43_leds_exit(dev); 3834 b43_leds_exit(dev);
3835 b43_rng_exit(dev->wl, false); 3835 b43_rng_exit(dev->wl);
3836 } 3836 }
3837 b43_dma_free(dev); 3837 b43_dma_free(dev);
3838 b43_pio_free(dev); 3838 b43_pio_free(dev);
@@ -4621,7 +4621,7 @@ static int b43_resume(struct ssb_device *dev)
4621 err = b43_wireless_core_start(wldev); 4621 err = b43_wireless_core_start(wldev);
4622 if (err) { 4622 if (err) {
4623 b43_leds_exit(wldev); 4623 b43_leds_exit(wldev);
4624 b43_rng_exit(wldev->wl, true); 4624 b43_rng_exit(wldev->wl);
4625 b43_wireless_core_exit(wldev); 4625 b43_wireless_core_exit(wldev);
4626 b43err(wl, "Resume failed at core start\n"); 4626 b43err(wl, "Resume failed at core start\n");
4627 goto out; 4627 goto out;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index ef829ee8ffd4..14a5eea2573e 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -1720,7 +1720,7 @@ static int b43legacy_write_initvals(struct b43legacy_wldev *dev,
1720 goto err_format; 1720 goto err_format;
1721 array_size -= sizeof(iv->data.d32); 1721 array_size -= sizeof(iv->data.d32);
1722 1722
1723 value = be32_to_cpu(get_unaligned(&iv->data.d32)); 1723 value = get_unaligned_be32(&iv->data.d32);
1724 b43legacy_write32(dev, offset, value); 1724 b43legacy_write32(dev, offset, value);
1725 1725
1726 iv = (const struct b43legacy_iv *)((const uint8_t *)iv + 1726 iv = (const struct b43legacy_iv *)((const uint8_t *)iv +
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 598e4eef4f40..d3406830c8e3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -554,40 +554,36 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
554 iwl3945_rt->rt_hdr.it_pad = 0; 554 iwl3945_rt->rt_hdr.it_pad = 0;
555 555
556 /* total header + data */ 556 /* total header + data */
557 put_unaligned(cpu_to_le16(sizeof(*iwl3945_rt)), 557 put_unaligned_le16(sizeof(*iwl3945_rt), &iwl3945_rt->rt_hdr.it_len);
558 &iwl3945_rt->rt_hdr.it_len);
559 558
560 /* Indicate all the fields we add to the radiotap header */ 559 /* Indicate all the fields we add to the radiotap header */
561 put_unaligned(cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) | 560 put_unaligned_le32((1 << IEEE80211_RADIOTAP_TSFT) |
562 (1 << IEEE80211_RADIOTAP_FLAGS) | 561 (1 << IEEE80211_RADIOTAP_FLAGS) |
563 (1 << IEEE80211_RADIOTAP_RATE) | 562 (1 << IEEE80211_RADIOTAP_RATE) |
564 (1 << IEEE80211_RADIOTAP_CHANNEL) | 563 (1 << IEEE80211_RADIOTAP_CHANNEL) |
565 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | 564 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
566 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | 565 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
567 (1 << IEEE80211_RADIOTAP_ANTENNA)), 566 (1 << IEEE80211_RADIOTAP_ANTENNA),
568 &iwl3945_rt->rt_hdr.it_present); 567 &iwl3945_rt->rt_hdr.it_present);
569 568
570 /* Zero the flags, we'll add to them as we go */ 569 /* Zero the flags, we'll add to them as we go */
571 iwl3945_rt->rt_flags = 0; 570 iwl3945_rt->rt_flags = 0;
572 571
573 put_unaligned(cpu_to_le64(tsf), &iwl3945_rt->rt_tsf); 572 put_unaligned_le64(tsf, &iwl3945_rt->rt_tsf);
574 573
575 iwl3945_rt->rt_dbmsignal = signal; 574 iwl3945_rt->rt_dbmsignal = signal;
576 iwl3945_rt->rt_dbmnoise = noise; 575 iwl3945_rt->rt_dbmnoise = noise;
577 576
578 /* Convert the channel frequency and set the flags */ 577 /* Convert the channel frequency and set the flags */
579 put_unaligned(cpu_to_le16(stats->freq), &iwl3945_rt->rt_channelMHz); 578 put_unaligned_le16(stats->freq, &iwl3945_rt->rt_channelMHz);
580 if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK)) 579 if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK))
581 put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM | 580 put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ,
582 IEEE80211_CHAN_5GHZ),
583 &iwl3945_rt->rt_chbitmask); 581 &iwl3945_rt->rt_chbitmask);
584 else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK) 582 else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK)
585 put_unaligned(cpu_to_le16(IEEE80211_CHAN_CCK | 583 put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
586 IEEE80211_CHAN_2GHZ),
587 &iwl3945_rt->rt_chbitmask); 584 &iwl3945_rt->rt_chbitmask);
588 else /* 802.11g */ 585 else /* 802.11g */
589 put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM | 586 put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
590 IEEE80211_CHAN_2GHZ),
591 &iwl3945_rt->rt_chbitmask); 587 &iwl3945_rt->rt_chbitmask);
592 588
593 if (rate == -1) 589 if (rate == -1)
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 7234669d05c0..d448c9702a0f 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -523,7 +523,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
523 523
524 if (*bytesleft >= sizeof(beaconsize)) { 524 if (*bytesleft >= sizeof(beaconsize)) {
525 /* Extract & convert beacon size from the command buffer */ 525 /* Extract & convert beacon size from the command buffer */
526 beaconsize = le16_to_cpu(get_unaligned((__le16 *)*pbeaconinfo)); 526 beaconsize = get_unaligned_le16(*pbeaconinfo);
527 *bytesleft -= sizeof(beaconsize); 527 *bytesleft -= sizeof(beaconsize);
528 *pbeaconinfo += sizeof(beaconsize); 528 *pbeaconinfo += sizeof(beaconsize);
529 } 529 }
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index bced3fe1cf8a..5dd23c93497d 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -768,41 +768,17 @@ static __u8 *UnStuffData(__u8 * src, __u8 * end, __u8 * dst,
768/* General routines for STRIP */ 768/* General routines for STRIP */
769 769
770/* 770/*
771 * get_baud returns the current baud rate, as one of the constants defined in
772 * termbits.h
773 * If the user has issued a baud rate override using the 'setserial' command
774 * and the logical current rate is set to 38.4, then the true baud rate
775 * currently in effect (57.6 or 115.2) is returned.
776 */
777static unsigned int get_baud(struct tty_struct *tty)
778{
779 if (!tty || !tty->termios)
780 return (0);
781 if ((tty->termios->c_cflag & CBAUD) == B38400 && tty->driver_data) {
782 struct async_struct *info =
783 (struct async_struct *) tty->driver_data;
784 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
785 return (B57600);
786 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
787 return (B115200);
788 }
789 return (tty->termios->c_cflag & CBAUD);
790}
791
792/*
793 * set_baud sets the baud rate to the rate defined by baudcode 771 * set_baud sets the baud rate to the rate defined by baudcode
794 * Note: The rate B38400 should be avoided, because the user may have
795 * issued a 'setserial' speed override to map that to a different speed.
796 * We could achieve a true rate of 38400 if we needed to by cancelling
797 * any user speed override that is in place, but that might annoy the
798 * user, so it is simplest to just avoid using 38400.
799 */ 772 */
800static void set_baud(struct tty_struct *tty, unsigned int baudcode) 773static void set_baud(struct tty_struct *tty, speed_t baudrate)
801{ 774{
802 struct ktermios old_termios = *(tty->termios); 775 struct ktermios old_termios;
803 tty->termios->c_cflag &= ~CBAUD; /* Clear the old baud setting */ 776
804 tty->termios->c_cflag |= baudcode; /* Set the new baud setting */ 777 mutex_lock(&tty->termios_mutex);
805 tty->driver->set_termios(tty, &old_termios); 778 old_termios =*(tty->termios);
779 tty_encode_baud_rate(tty, baudrate, baudrate);
780 tty->ops->set_termios(tty, &old_termios);
781 mutex_unlock(&tty->termios_mutex);
806} 782}
807 783
808/* 784/*
@@ -1217,7 +1193,7 @@ static void ResetRadio(struct strip *strip_info)
1217 strip_info->watchdog_doreset = jiffies + 1 * HZ; 1193 strip_info->watchdog_doreset = jiffies + 1 * HZ;
1218 1194
1219 /* If the user has selected a baud rate above 38.4 see what magic we have to do */ 1195 /* If the user has selected a baud rate above 38.4 see what magic we have to do */
1220 if (strip_info->user_baud > B38400) { 1196 if (strip_info->user_baud > 38400) {
1221 /* 1197 /*
1222 * Subtle stuff: Pay attention :-) 1198 * Subtle stuff: Pay attention :-)
1223 * If the serial port is currently at the user's selected (>38.4) rate, 1199 * If the serial port is currently at the user's selected (>38.4) rate,
@@ -1227,17 +1203,17 @@ static void ResetRadio(struct strip *strip_info)
1227 * issued the ATS304 command last time through, so this time we restore 1203 * issued the ATS304 command last time through, so this time we restore
1228 * the user's selected rate and issue the normal starmode reset string. 1204 * the user's selected rate and issue the normal starmode reset string.
1229 */ 1205 */
1230 if (strip_info->user_baud == get_baud(tty)) { 1206 if (strip_info->user_baud == tty_get_baud_rate(tty)) {
1231 static const char b0[] = "ate0q1s304=57600\r"; 1207 static const char b0[] = "ate0q1s304=57600\r";
1232 static const char b1[] = "ate0q1s304=115200\r"; 1208 static const char b1[] = "ate0q1s304=115200\r";
1233 static const StringDescriptor baudstring[2] = 1209 static const StringDescriptor baudstring[2] =
1234 { {b0, sizeof(b0) - 1} 1210 { {b0, sizeof(b0) - 1}
1235 , {b1, sizeof(b1) - 1} 1211 , {b1, sizeof(b1) - 1}
1236 }; 1212 };
1237 set_baud(tty, B19200); 1213 set_baud(tty, 19200);
1238 if (strip_info->user_baud == B57600) 1214 if (strip_info->user_baud == 57600)
1239 s = baudstring[0]; 1215 s = baudstring[0];
1240 else if (strip_info->user_baud == B115200) 1216 else if (strip_info->user_baud == 115200)
1241 s = baudstring[1]; 1217 s = baudstring[1];
1242 else 1218 else
1243 s = baudstring[1]; /* For now */ 1219 s = baudstring[1]; /* For now */
@@ -1245,7 +1221,7 @@ static void ResetRadio(struct strip *strip_info)
1245 set_baud(tty, strip_info->user_baud); 1221 set_baud(tty, strip_info->user_baud);
1246 } 1222 }
1247 1223
1248 tty->driver->write(tty, s.string, s.length); 1224 tty->ops->write(tty, s.string, s.length);
1249#ifdef EXT_COUNTERS 1225#ifdef EXT_COUNTERS
1250 strip_info->tx_ebytes += s.length; 1226 strip_info->tx_ebytes += s.length;
1251#endif 1227#endif
@@ -1267,7 +1243,7 @@ static void strip_write_some_more(struct tty_struct *tty)
1267 1243
1268 if (strip_info->tx_left > 0) { 1244 if (strip_info->tx_left > 0) {
1269 int num_written = 1245 int num_written =
1270 tty->driver->write(tty, strip_info->tx_head, 1246 tty->ops->write(tty, strip_info->tx_head,
1271 strip_info->tx_left); 1247 strip_info->tx_left);
1272 strip_info->tx_left -= num_written; 1248 strip_info->tx_left -= num_written;
1273 strip_info->tx_head += num_written; 1249 strip_info->tx_head += num_written;
@@ -2457,7 +2433,7 @@ static int strip_open_low(struct net_device *dev)
2457 strip_info->working = FALSE; 2433 strip_info->working = FALSE;
2458 strip_info->firmware_level = NoStructure; 2434 strip_info->firmware_level = NoStructure;
2459 strip_info->next_command = CompatibilityCommand; 2435 strip_info->next_command = CompatibilityCommand;
2460 strip_info->user_baud = get_baud(strip_info->tty); 2436 strip_info->user_baud = tty_get_baud_rate(strip_info->tty);
2461 2437
2462 printk(KERN_INFO "%s: Initializing Radio.\n", 2438 printk(KERN_INFO "%s: Initializing Radio.\n",
2463 strip_info->dev->name); 2439 strip_info->dev->name);
@@ -2632,6 +2608,13 @@ static int strip_open(struct tty_struct *tty)
2632 return -EEXIST; 2608 return -EEXIST;
2633 2609
2634 /* 2610 /*
2611 * We need a write method.
2612 */
2613
2614 if (tty->ops->write == NULL)
2615 return -EOPNOTSUPP;
2616
2617 /*
2635 * OK. Find a free STRIP channel to use. 2618 * OK. Find a free STRIP channel to use.
2636 */ 2619 */
2637 if ((strip_info = strip_alloc()) == NULL) 2620 if ((strip_info = strip_alloc()) == NULL)
@@ -2652,8 +2635,7 @@ static int strip_open(struct tty_struct *tty)
2652 tty->disc_data = strip_info; 2635 tty->disc_data = strip_info;
2653 tty->receive_room = 65536; 2636 tty->receive_room = 65536;
2654 2637
2655 if (tty->driver->flush_buffer) 2638 tty_driver_flush_buffer(tty);
2656 tty->driver->flush_buffer(tty);
2657 2639
2658 /* 2640 /*
2659 * Restore default settings 2641 * Restore default settings
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index e34675c2f8fc..5316074f39f0 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -545,11 +545,11 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
545 * be padded. Unaligned access might also happen if the length_info 545 * be padded. Unaligned access might also happen if the length_info
546 * structure is not present. 546 * structure is not present.
547 */ 547 */
548 if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG)) 548 if (get_unaligned_le16(&length_info->tag) == RX_LENGTH_INFO_TAG)
549 { 549 {
550 unsigned int l, k, n; 550 unsigned int l, k, n;
551 for (i = 0, l = 0;; i++) { 551 for (i = 0, l = 0;; i++) {
552 k = le16_to_cpu(get_unaligned(&length_info->length[i])); 552 k = get_unaligned_le16(&length_info->length[i]);
553 if (k == 0) 553 if (k == 0)
554 return; 554 return;
555 n = l+k; 555 n = l+k;