Merge branch 'no-iwlwifi' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

+80 -81
+17 -6
drivers/net/wireless/ath5k/base.c
··· 251 251 return; 252 252 pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, 253 253 PCI_DMA_TODEVICE); 254 - dev_kfree_skb(bf->skb); 254 + dev_kfree_skb_any(bf->skb); 255 255 bf->skb = NULL; 256 256 } 257 257 ··· 466 466 mutex_init(&sc->lock); 467 467 spin_lock_init(&sc->rxbuflock); 468 468 spin_lock_init(&sc->txbuflock); 469 + spin_lock_init(&sc->block); 469 470 470 471 /* Set private data */ 471 472 pci_set_drvdata(pdev, hw); ··· 2180 2179 2181 2180 sc->imask |= AR5K_INT_SWBA; 2182 2181 2183 - if (ath5k_hw_hasveol(ah)) 2182 + if (ath5k_hw_hasveol(ah)) { 2183 + spin_lock(&sc->block); 2184 2184 ath5k_beacon_send(sc); 2185 + spin_unlock(&sc->block); 2186 + } 2185 2187 } 2186 2188 /* TODO else AP */ 2187 2189 ··· 2407 2403 TSF_TO_TU(tsf), 2408 2404 (unsigned long long) tsf); 2409 2405 } else { 2406 + spin_lock(&sc->block); 2410 2407 ath5k_beacon_send(sc); 2408 + spin_unlock(&sc->block); 2411 2409 } 2412 2410 } 2413 2411 if (status & AR5K_INT_RXEOL) { ··· 2751 2745 ret = -EOPNOTSUPP; 2752 2746 goto end; 2753 2747 } 2748 + 2749 + /* Set to a reasonable value. Note that this will 2750 + * be set to mac80211's value at ath5k_config(). */ 2751 + sc->bintval = 1000; 2752 + 2754 2753 ret = 0; 2755 2754 end: 2756 2755 mutex_unlock(&sc->lock); ··· 2800 2789 struct ath5k_hw *ah = sc->ah; 2801 2790 int ret; 2802 2791 2803 - /* Set to a reasonable value. Note that this will 2804 - * be set to mac80211's value at ath5k_config(). */ 2805 - sc->bintval = 1000; 2806 2792 mutex_lock(&sc->lock); 2807 2793 if (sc->vif != vif) { 2808 2794 ret = -EIO; ··· 3058 3050 ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) 3059 3051 { 3060 3052 struct ath5k_softc *sc = hw->priv; 3053 + unsigned long flags; 3061 3054 int ret; 3062 3055 3063 3056 ath5k_debug_dump_skb(sc, skb, "BC ", 1); ··· 3068 3059 goto end; 3069 3060 } 3070 3061 3062 + spin_lock_irqsave(&sc->block, flags); 3071 3063 ath5k_txbuf_free(sc, sc->bbuf); 3072 3064 sc->bbuf->skb = skb; 3073 3065 ret = ath5k_beacon_setup(sc, sc->bbuf); 3074 3066 if (ret) 3075 3067 sc->bbuf->skb = NULL; 3076 - else { 3068 + spin_unlock_irqrestore(&sc->block, flags); 3069 + if (!ret) { 3077 3070 ath5k_beacon_config(sc); 3078 3071 mmiowb(); 3079 3072 }
+1
drivers/net/wireless/ath5k/base.h
··· 172 172 struct tasklet_struct txtq; /* tx intr tasklet */ 173 173 struct ath5k_led tx_led; /* tx led */ 174 174 175 + spinlock_t block; /* protects beacon */ 175 176 struct ath5k_buf *bbuf; /* beacon buffer */ 176 177 unsigned int bhalq, /* SW q for outgoing beacons */ 177 178 bmisscount, /* missed beacon transmits */
+31 -20
drivers/net/wireless/atmel.c
··· 1304 1304 int atmel_open(struct net_device *dev) 1305 1305 { 1306 1306 struct atmel_private *priv = netdev_priv(dev); 1307 - int i, channel; 1307 + int i, channel, err; 1308 1308 1309 1309 /* any scheduled timer is no longer needed and might screw things up.. */ 1310 1310 del_timer_sync(&priv->management_timer); ··· 1328 1328 priv->site_survey_state = SITE_SURVEY_IDLE; 1329 1329 priv->station_is_associated = 0; 1330 1330 1331 - if (!reset_atmel_card(dev)) 1332 - return -EAGAIN; 1331 + err = reset_atmel_card(dev); 1332 + if (err) 1333 + return err; 1333 1334 1334 1335 if (priv->config_reg_domain) { 1335 1336 priv->reg_domain = priv->config_reg_domain; ··· 3062 3061 } 3063 3062 3064 3063 if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { 3065 - /* Do opensystem first, then try sharedkey */ 3064 + /* Flip back and forth between WEP auth modes until the max 3065 + * authentication tries has been exceeded. 3066 + */ 3066 3067 if (system == WLAN_AUTH_OPEN) { 3067 3068 priv->CurrentAuthentTransactionSeqNum = 0x001; 3068 3069 priv->exclude_unencrypted = 1; 3069 3070 send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0); 3071 + return; 3072 + } else if ( system == WLAN_AUTH_SHARED_KEY 3073 + && priv->wep_is_on) { 3074 + priv->CurrentAuthentTransactionSeqNum = 0x001; 3075 + priv->exclude_unencrypted = 0; 3076 + send_authentication_request(priv, WLAN_AUTH_OPEN, NULL, 0); 3070 3077 return; 3071 3078 } else if (priv->connect_to_any_BSS) { 3072 3079 int bss_index; ··· 3589 3580 3590 3581 if (i == 0) { 3591 3582 printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); 3592 - return 0; 3583 + return -EIO; 3593 3584 } 3594 3585 3595 3586 if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { 3596 3587 printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); 3597 - return 0; 3588 + return -ENODEV; 3598 3589 } 3599 3590 3600 3591 /* now check for completion of MAC initialization through ··· 3618 3609 if (i == 0) { 3619 3610 printk(KERN_ALERT "%s: MAC failed to initialise.\n", 3620 3611 priv->dev->name); 3621 - return 0; 3612 + return -EIO; 3622 3613 } 3623 3614 3624 3615 /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ 3625 3616 if ((mr3 & MAC_INIT_COMPLETE) && 3626 3617 !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { 3627 3618 printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name); 3628 - return 0; 3619 + return -EIO; 3629 3620 } 3630 3621 if ((mr1 & MAC_INIT_COMPLETE) && 3631 3622 !(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) { 3632 3623 printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name); 3633 - return 0; 3624 + return -EIO; 3634 3625 } 3635 3626 3636 3627 atmel_copy_to_host(priv->dev, (unsigned char *)iface, ··· 3651 3642 iface->func_ctrl = le16_to_cpu(iface->func_ctrl); 3652 3643 iface->mac_status = le16_to_cpu(iface->mac_status); 3653 3644 3654 - return 1; 3645 + return 0; 3655 3646 } 3656 3647 3657 3648 /* determine type of memory and MAC address */ ··· 3702 3693 /* Standard firmware in flash, boot it up and ask 3703 3694 for the Mac Address */ 3704 3695 priv->card_type = CARD_TYPE_SPI_FLASH; 3705 - if (atmel_wakeup_firmware(priv)) { 3696 + if (atmel_wakeup_firmware(priv) == 0) { 3706 3697 atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); 3707 3698 3708 3699 /* got address, now squash it again until the network ··· 3844 3835 struct atmel_private *priv = netdev_priv(dev); 3845 3836 u8 configuration; 3846 3837 int old_state = priv->station_state; 3838 + int err = 0; 3847 3839 3848 3840 /* data to add to the firmware names, in priority order 3849 3841 this implemenents firmware versioning */ ··· 3878 3868 dev->name); 3879 3869 strcpy(priv->firmware_id, "atmel_at76c502.bin"); 3880 3870 } 3881 - if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) { 3871 + err = request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev); 3872 + if (err != 0) { 3882 3873 printk(KERN_ALERT 3883 3874 "%s: firmware %s is missing, cannot continue.\n", 3884 3875 dev->name, priv->firmware_id); 3885 - return 0; 3876 + return err; 3886 3877 } 3887 3878 } else { 3888 3879 int fw_index = 0; ··· 3912 3901 "%s: firmware %s is missing, cannot start.\n", 3913 3902 dev->name, priv->firmware_id); 3914 3903 priv->firmware_id[0] = '\0'; 3915 - return 0; 3904 + return -ENOENT; 3916 3905 } 3917 3906 } 3918 3907 ··· 3937 3926 release_firmware(fw_entry); 3938 3927 } 3939 3928 3940 - if (!atmel_wakeup_firmware(priv)) 3941 - return 0; 3929 + err = atmel_wakeup_firmware(priv); 3930 + if (err != 0) 3931 + return err; 3942 3932 3943 3933 /* Check the version and set the correct flag for wpa stuff, 3944 3934 old and new firmware is incompatible. ··· 3980 3968 if (!priv->radio_on_broken) { 3981 3969 if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == 3982 3970 CMD_STATUS_REJECTED_RADIO_OFF) { 3983 - printk(KERN_INFO 3984 - "%s: cannot turn the radio on. (Hey radio, you're beautiful!)\n", 3971 + printk(KERN_INFO "%s: cannot turn the radio on.\n", 3985 3972 dev->name); 3986 - return 0; 3973 + return -EIO; 3987 3974 } 3988 3975 } 3989 3976 ··· 4017 4006 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); 4018 4007 } 4019 4008 4020 - return 1; 4009 + return 0; 4021 4010 } 4022 4011 4023 4012 static void atmel_send_command(struct atmel_private *priv, int command,
+12 -12
net/mac80211/debugfs_netdev.c
··· 248 248 static void add_sta_files(struct ieee80211_sub_if_data *sdata) 249 249 { 250 250 DEBUGFS_ADD(drop_unencrypted, sta); 251 - DEBUGFS_ADD(force_unicast_rateidx, ap); 252 - DEBUGFS_ADD(max_ratectrl_rateidx, ap); 251 + DEBUGFS_ADD(force_unicast_rateidx, sta); 252 + DEBUGFS_ADD(max_ratectrl_rateidx, sta); 253 253 254 254 DEBUGFS_ADD(state, sta); 255 255 DEBUGFS_ADD(bssid, sta); ··· 283 283 static void add_wds_files(struct ieee80211_sub_if_data *sdata) 284 284 { 285 285 DEBUGFS_ADD(drop_unencrypted, wds); 286 - DEBUGFS_ADD(force_unicast_rateidx, ap); 287 - DEBUGFS_ADD(max_ratectrl_rateidx, ap); 286 + DEBUGFS_ADD(force_unicast_rateidx, wds); 287 + DEBUGFS_ADD(max_ratectrl_rateidx, wds); 288 288 289 289 DEBUGFS_ADD(peer, wds); 290 290 } ··· 292 292 static void add_vlan_files(struct ieee80211_sub_if_data *sdata) 293 293 { 294 294 DEBUGFS_ADD(drop_unencrypted, vlan); 295 - DEBUGFS_ADD(force_unicast_rateidx, ap); 296 - DEBUGFS_ADD(max_ratectrl_rateidx, ap); 295 + DEBUGFS_ADD(force_unicast_rateidx, vlan); 296 + DEBUGFS_ADD(max_ratectrl_rateidx, vlan); 297 297 } 298 298 299 299 static void add_monitor_files(struct ieee80211_sub_if_data *sdata) ··· 381 381 static void del_sta_files(struct ieee80211_sub_if_data *sdata) 382 382 { 383 383 DEBUGFS_DEL(drop_unencrypted, sta); 384 - DEBUGFS_DEL(force_unicast_rateidx, ap); 385 - DEBUGFS_DEL(max_ratectrl_rateidx, ap); 384 + DEBUGFS_DEL(force_unicast_rateidx, sta); 385 + DEBUGFS_DEL(max_ratectrl_rateidx, sta); 386 386 387 387 DEBUGFS_DEL(state, sta); 388 388 DEBUGFS_DEL(bssid, sta); ··· 416 416 static void del_wds_files(struct ieee80211_sub_if_data *sdata) 417 417 { 418 418 DEBUGFS_DEL(drop_unencrypted, wds); 419 - DEBUGFS_DEL(force_unicast_rateidx, ap); 420 - DEBUGFS_DEL(max_ratectrl_rateidx, ap); 419 + DEBUGFS_DEL(force_unicast_rateidx, wds); 420 + DEBUGFS_DEL(max_ratectrl_rateidx, wds); 421 421 422 422 DEBUGFS_DEL(peer, wds); 423 423 } ··· 425 425 static void del_vlan_files(struct ieee80211_sub_if_data *sdata) 426 426 { 427 427 DEBUGFS_DEL(drop_unencrypted, vlan); 428 - DEBUGFS_DEL(force_unicast_rateidx, ap); 429 - DEBUGFS_DEL(max_ratectrl_rateidx, ap); 428 + DEBUGFS_DEL(force_unicast_rateidx, vlan); 429 + DEBUGFS_DEL(max_ratectrl_rateidx, vlan); 430 430 } 431 431 432 432 static void del_monitor_files(struct ieee80211_sub_if_data *sdata)
+6
net/mac80211/ieee80211_i.h
··· 470 470 struct dentry *auth_transaction; 471 471 struct dentry *flags; 472 472 struct dentry *num_beacons_sta; 473 + struct dentry *force_unicast_rateidx; 474 + struct dentry *max_ratectrl_rateidx; 473 475 } sta; 474 476 struct { 475 477 struct dentry *drop_unencrypted; ··· 485 483 struct { 486 484 struct dentry *drop_unencrypted; 487 485 struct dentry *peer; 486 + struct dentry *force_unicast_rateidx; 487 + struct dentry *max_ratectrl_rateidx; 488 488 } wds; 489 489 struct { 490 490 struct dentry *drop_unencrypted; 491 + struct dentry *force_unicast_rateidx; 492 + struct dentry *max_ratectrl_rateidx; 491 493 } vlan; 492 494 struct { 493 495 struct dentry *mode;
+1 -1
net/mac80211/mesh.c
··· 383 383 hlist_for_each_safe(p, q, &newtbl->hash_buckets[i]) 384 384 tbl->free_node(p, 0); 385 385 } 386 - __mesh_table_free(tbl); 386 + __mesh_table_free(newtbl); 387 387 endgrow: 388 388 return NULL; 389 389 }
+11 -41
net/mac80211/mlme.c
··· 478 478 static void ieee80211_sta_send_associnfo(struct net_device *dev, 479 479 struct ieee80211_if_sta *ifsta) 480 480 { 481 - char *buf; 482 - size_t len; 483 - int i; 484 481 union iwreq_data wrqu; 485 482 486 - if (!ifsta->assocreq_ies && !ifsta->assocresp_ies) 487 - return; 488 - 489 - buf = kmalloc(50 + 2 * (ifsta->assocreq_ies_len + 490 - ifsta->assocresp_ies_len), GFP_KERNEL); 491 - if (!buf) 492 - return; 493 - 494 - len = sprintf(buf, "ASSOCINFO("); 495 483 if (ifsta->assocreq_ies) { 496 - len += sprintf(buf + len, "ReqIEs="); 497 - for (i = 0; i < ifsta->assocreq_ies_len; i++) { 498 - len += sprintf(buf + len, "%02x", 499 - ifsta->assocreq_ies[i]); 500 - } 484 + memset(&wrqu, 0, sizeof(wrqu)); 485 + wrqu.data.length = ifsta->assocreq_ies_len; 486 + wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, 487 + ifsta->assocreq_ies); 501 488 } 489 + 502 490 if (ifsta->assocresp_ies) { 503 - if (ifsta->assocreq_ies) 504 - len += sprintf(buf + len, " "); 505 - len += sprintf(buf + len, "RespIEs="); 506 - for (i = 0; i < ifsta->assocresp_ies_len; i++) { 507 - len += sprintf(buf + len, "%02x", 508 - ifsta->assocresp_ies[i]); 509 - } 491 + memset(&wrqu, 0, sizeof(wrqu)); 492 + wrqu.data.length = ifsta->assocresp_ies_len; 493 + wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, 494 + ifsta->assocresp_ies); 510 495 } 511 - len += sprintf(buf + len, ")"); 512 - 513 - if (len > IW_CUSTOM_MAX) { 514 - len = sprintf(buf, "ASSOCRESPIE="); 515 - for (i = 0; i < ifsta->assocresp_ies_len; i++) { 516 - len += sprintf(buf + len, "%02x", 517 - ifsta->assocresp_ies[i]); 518 - } 519 - } 520 - 521 - memset(&wrqu, 0, sizeof(wrqu)); 522 - wrqu.data.length = len; 523 - wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); 524 - 525 - kfree(buf); 526 496 } 527 497 528 498 ··· 783 813 } 784 814 } 785 815 786 - if (count == 8) { 816 + if (rates_len > count) { 787 817 pos = skb_put(skb, rates_len - count + 2); 788 818 *pos++ = WLAN_EID_EXT_SUPP_RATES; 789 819 *pos++ = rates_len - count; ··· 2838 2868 jiffies); 2839 2869 #endif /* CONFIG_MAC80211_IBSS_DEBUG */ 2840 2870 if (beacon_timestamp > rx_timestamp) { 2841 - #ifndef CONFIG_MAC80211_IBSS_DEBUG 2871 + #ifdef CONFIG_MAC80211_IBSS_DEBUG 2842 2872 printk(KERN_DEBUG "%s: beacon TSF higher than " 2843 2873 "local TSF - IBSS merge with BSSID %s\n", 2844 2874 dev->name, print_mac(mac, mgmt->bssid));
+1 -1
net/rfkill/rfkill.c
··· 377 377 { 378 378 struct rfkill *rfkill = to_rfkill(dev); 379 379 380 - return sprintf(buf, "%d", rfkill->user_claim); 380 + return sprintf(buf, "%d\n", rfkill->user_claim); 381 381 } 382 382 383 383 static ssize_t rfkill_claim_store(struct device *dev,