diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/base.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/atmel.c | 51 |
3 files changed, 49 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index b20a45aa8680..0676c6d84383 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -251,7 +251,7 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc, | |||
251 | return; | 251 | return; |
252 | pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, | 252 | pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, |
253 | PCI_DMA_TODEVICE); | 253 | PCI_DMA_TODEVICE); |
254 | dev_kfree_skb(bf->skb); | 254 | dev_kfree_skb_any(bf->skb); |
255 | bf->skb = NULL; | 255 | bf->skb = NULL; |
256 | } | 256 | } |
257 | 257 | ||
@@ -466,6 +466,7 @@ ath5k_pci_probe(struct pci_dev *pdev, | |||
466 | mutex_init(&sc->lock); | 466 | mutex_init(&sc->lock); |
467 | spin_lock_init(&sc->rxbuflock); | 467 | spin_lock_init(&sc->rxbuflock); |
468 | spin_lock_init(&sc->txbuflock); | 468 | spin_lock_init(&sc->txbuflock); |
469 | spin_lock_init(&sc->block); | ||
469 | 470 | ||
470 | /* Set private data */ | 471 | /* Set private data */ |
471 | pci_set_drvdata(pdev, hw); | 472 | pci_set_drvdata(pdev, hw); |
@@ -2179,8 +2180,11 @@ ath5k_beacon_config(struct ath5k_softc *sc) | |||
2179 | 2180 | ||
2180 | sc->imask |= AR5K_INT_SWBA; | 2181 | sc->imask |= AR5K_INT_SWBA; |
2181 | 2182 | ||
2182 | if (ath5k_hw_hasveol(ah)) | 2183 | if (ath5k_hw_hasveol(ah)) { |
2184 | spin_lock(&sc->block); | ||
2183 | ath5k_beacon_send(sc); | 2185 | ath5k_beacon_send(sc); |
2186 | spin_unlock(&sc->block); | ||
2187 | } | ||
2184 | } | 2188 | } |
2185 | /* TODO else AP */ | 2189 | /* TODO else AP */ |
2186 | 2190 | ||
@@ -2403,7 +2407,9 @@ ath5k_intr(int irq, void *dev_id) | |||
2403 | TSF_TO_TU(tsf), | 2407 | TSF_TO_TU(tsf), |
2404 | (unsigned long long) tsf); | 2408 | (unsigned long long) tsf); |
2405 | } else { | 2409 | } else { |
2410 | spin_lock(&sc->block); | ||
2406 | ath5k_beacon_send(sc); | 2411 | ath5k_beacon_send(sc); |
2412 | spin_unlock(&sc->block); | ||
2407 | } | 2413 | } |
2408 | } | 2414 | } |
2409 | if (status & AR5K_INT_RXEOL) { | 2415 | if (status & AR5K_INT_RXEOL) { |
@@ -2745,6 +2751,11 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
2745 | ret = -EOPNOTSUPP; | 2751 | ret = -EOPNOTSUPP; |
2746 | goto end; | 2752 | goto end; |
2747 | } | 2753 | } |
2754 | |||
2755 | /* Set to a reasonable value. Note that this will | ||
2756 | * be set to mac80211's value at ath5k_config(). */ | ||
2757 | sc->bintval = 1000; | ||
2758 | |||
2748 | ret = 0; | 2759 | ret = 0; |
2749 | end: | 2760 | end: |
2750 | mutex_unlock(&sc->lock); | 2761 | mutex_unlock(&sc->lock); |
@@ -2789,9 +2800,6 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
2789 | struct ath5k_hw *ah = sc->ah; | 2800 | struct ath5k_hw *ah = sc->ah; |
2790 | int ret; | 2801 | int ret; |
2791 | 2802 | ||
2792 | /* Set to a reasonable value. Note that this will | ||
2793 | * be set to mac80211's value at ath5k_config(). */ | ||
2794 | sc->bintval = 1000; | ||
2795 | mutex_lock(&sc->lock); | 2803 | mutex_lock(&sc->lock); |
2796 | if (sc->vif != vif) { | 2804 | if (sc->vif != vif) { |
2797 | ret = -EIO; | 2805 | ret = -EIO; |
@@ -3050,6 +3058,7 @@ static int | |||
3050 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | 3058 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
3051 | { | 3059 | { |
3052 | struct ath5k_softc *sc = hw->priv; | 3060 | struct ath5k_softc *sc = hw->priv; |
3061 | unsigned long flags; | ||
3053 | int ret; | 3062 | int ret; |
3054 | 3063 | ||
3055 | ath5k_debug_dump_skb(sc, skb, "BC ", 1); | 3064 | ath5k_debug_dump_skb(sc, skb, "BC ", 1); |
@@ -3059,12 +3068,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
3059 | goto end; | 3068 | goto end; |
3060 | } | 3069 | } |
3061 | 3070 | ||
3071 | spin_lock_irqsave(&sc->block, flags); | ||
3062 | ath5k_txbuf_free(sc, sc->bbuf); | 3072 | ath5k_txbuf_free(sc, sc->bbuf); |
3063 | sc->bbuf->skb = skb; | 3073 | sc->bbuf->skb = skb; |
3064 | ret = ath5k_beacon_setup(sc, sc->bbuf); | 3074 | ret = ath5k_beacon_setup(sc, sc->bbuf); |
3065 | if (ret) | 3075 | if (ret) |
3066 | sc->bbuf->skb = NULL; | 3076 | sc->bbuf->skb = NULL; |
3067 | else { | 3077 | spin_unlock_irqrestore(&sc->block, flags); |
3078 | if (!ret) { | ||
3068 | ath5k_beacon_config(sc); | 3079 | ath5k_beacon_config(sc); |
3069 | mmiowb(); | 3080 | mmiowb(); |
3070 | } | 3081 | } |
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h index d7e03e6b8271..7ec2f377d5c7 100644 --- a/drivers/net/wireless/ath5k/base.h +++ b/drivers/net/wireless/ath5k/base.h | |||
@@ -172,6 +172,7 @@ struct ath5k_softc { | |||
172 | struct tasklet_struct txtq; /* tx intr tasklet */ | 172 | struct tasklet_struct txtq; /* tx intr tasklet */ |
173 | struct ath5k_led tx_led; /* tx led */ | 173 | struct ath5k_led tx_led; /* tx led */ |
174 | 174 | ||
175 | spinlock_t block; /* protects beacon */ | ||
175 | struct ath5k_buf *bbuf; /* beacon buffer */ | 176 | struct ath5k_buf *bbuf; /* beacon buffer */ |
176 | unsigned int bhalq, /* SW q for outgoing beacons */ | 177 | unsigned int bhalq, /* SW q for outgoing beacons */ |
177 | bmisscount, /* missed beacon transmits */ | 178 | bmisscount, /* missed beacon transmits */ |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index bd35bb0a1480..bd65c485098c 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -1304,7 +1304,7 @@ EXPORT_SYMBOL(atmel_open); | |||
1304 | int atmel_open(struct net_device *dev) | 1304 | int atmel_open(struct net_device *dev) |
1305 | { | 1305 | { |
1306 | struct atmel_private *priv = netdev_priv(dev); | 1306 | struct atmel_private *priv = netdev_priv(dev); |
1307 | int i, channel; | 1307 | int i, channel, err; |
1308 | 1308 | ||
1309 | /* any scheduled timer is no longer needed and might screw things up.. */ | 1309 | /* any scheduled timer is no longer needed and might screw things up.. */ |
1310 | del_timer_sync(&priv->management_timer); | 1310 | del_timer_sync(&priv->management_timer); |
@@ -1328,8 +1328,9 @@ int atmel_open(struct net_device *dev) | |||
1328 | priv->site_survey_state = SITE_SURVEY_IDLE; | 1328 | priv->site_survey_state = SITE_SURVEY_IDLE; |
1329 | priv->station_is_associated = 0; | 1329 | priv->station_is_associated = 0; |
1330 | 1330 | ||
1331 | if (!reset_atmel_card(dev)) | 1331 | err = reset_atmel_card(dev); |
1332 | return -EAGAIN; | 1332 | if (err) |
1333 | return err; | ||
1333 | 1334 | ||
1334 | if (priv->config_reg_domain) { | 1335 | if (priv->config_reg_domain) { |
1335 | priv->reg_domain = priv->config_reg_domain; | 1336 | priv->reg_domain = priv->config_reg_domain; |
@@ -3061,12 +3062,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) | |||
3061 | } | 3062 | } |
3062 | 3063 | ||
3063 | if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { | 3064 | if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { |
3064 | /* Do opensystem first, then try sharedkey */ | 3065 | /* Flip back and forth between WEP auth modes until the max |
3066 | * authentication tries has been exceeded. | ||
3067 | */ | ||
3065 | if (system == WLAN_AUTH_OPEN) { | 3068 | if (system == WLAN_AUTH_OPEN) { |
3066 | priv->CurrentAuthentTransactionSeqNum = 0x001; | 3069 | priv->CurrentAuthentTransactionSeqNum = 0x001; |
3067 | priv->exclude_unencrypted = 1; | 3070 | priv->exclude_unencrypted = 1; |
3068 | send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0); | 3071 | send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0); |
3069 | return; | 3072 | return; |
3073 | } else if ( system == WLAN_AUTH_SHARED_KEY | ||
3074 | && priv->wep_is_on) { | ||
3075 | priv->CurrentAuthentTransactionSeqNum = 0x001; | ||
3076 | priv->exclude_unencrypted = 0; | ||
3077 | send_authentication_request(priv, WLAN_AUTH_OPEN, NULL, 0); | ||
3078 | return; | ||
3070 | } else if (priv->connect_to_any_BSS) { | 3079 | } else if (priv->connect_to_any_BSS) { |
3071 | int bss_index; | 3080 | int bss_index; |
3072 | 3081 | ||
@@ -3580,12 +3589,12 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) | |||
3580 | 3589 | ||
3581 | if (i == 0) { | 3590 | if (i == 0) { |
3582 | printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); | 3591 | printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); |
3583 | return 0; | 3592 | return -EIO; |
3584 | } | 3593 | } |
3585 | 3594 | ||
3586 | if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { | 3595 | if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { |
3587 | printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); | 3596 | printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); |
3588 | return 0; | 3597 | return -ENODEV; |
3589 | } | 3598 | } |
3590 | 3599 | ||
3591 | /* now check for completion of MAC initialization through | 3600 | /* now check for completion of MAC initialization through |
@@ -3609,19 +3618,19 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) | |||
3609 | if (i == 0) { | 3618 | if (i == 0) { |
3610 | printk(KERN_ALERT "%s: MAC failed to initialise.\n", | 3619 | printk(KERN_ALERT "%s: MAC failed to initialise.\n", |
3611 | priv->dev->name); | 3620 | priv->dev->name); |
3612 | return 0; | 3621 | return -EIO; |
3613 | } | 3622 | } |
3614 | 3623 | ||
3615 | /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ | 3624 | /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ |
3616 | if ((mr3 & MAC_INIT_COMPLETE) && | 3625 | if ((mr3 & MAC_INIT_COMPLETE) && |
3617 | !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { | 3626 | !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { |
3618 | printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name); | 3627 | printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name); |
3619 | return 0; | 3628 | return -EIO; |
3620 | } | 3629 | } |
3621 | if ((mr1 & MAC_INIT_COMPLETE) && | 3630 | if ((mr1 & MAC_INIT_COMPLETE) && |
3622 | !(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) { | 3631 | !(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) { |
3623 | printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name); | 3632 | printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name); |
3624 | return 0; | 3633 | return -EIO; |
3625 | } | 3634 | } |
3626 | 3635 | ||
3627 | atmel_copy_to_host(priv->dev, (unsigned char *)iface, | 3636 | atmel_copy_to_host(priv->dev, (unsigned char *)iface, |
@@ -3642,7 +3651,7 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) | |||
3642 | iface->func_ctrl = le16_to_cpu(iface->func_ctrl); | 3651 | iface->func_ctrl = le16_to_cpu(iface->func_ctrl); |
3643 | iface->mac_status = le16_to_cpu(iface->mac_status); | 3652 | iface->mac_status = le16_to_cpu(iface->mac_status); |
3644 | 3653 | ||
3645 | return 1; | 3654 | return 0; |
3646 | } | 3655 | } |
3647 | 3656 | ||
3648 | /* determine type of memory and MAC address */ | 3657 | /* determine type of memory and MAC address */ |
@@ -3693,7 +3702,7 @@ static int probe_atmel_card(struct net_device *dev) | |||
3693 | /* Standard firmware in flash, boot it up and ask | 3702 | /* Standard firmware in flash, boot it up and ask |
3694 | for the Mac Address */ | 3703 | for the Mac Address */ |
3695 | priv->card_type = CARD_TYPE_SPI_FLASH; | 3704 | priv->card_type = CARD_TYPE_SPI_FLASH; |
3696 | if (atmel_wakeup_firmware(priv)) { | 3705 | if (atmel_wakeup_firmware(priv) == 0) { |
3697 | atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); | 3706 | atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); |
3698 | 3707 | ||
3699 | /* got address, now squash it again until the network | 3708 | /* got address, now squash it again until the network |
@@ -3835,6 +3844,7 @@ static int reset_atmel_card(struct net_device *dev) | |||
3835 | struct atmel_private *priv = netdev_priv(dev); | 3844 | struct atmel_private *priv = netdev_priv(dev); |
3836 | u8 configuration; | 3845 | u8 configuration; |
3837 | int old_state = priv->station_state; | 3846 | int old_state = priv->station_state; |
3847 | int err = 0; | ||
3838 | 3848 | ||
3839 | /* data to add to the firmware names, in priority order | 3849 | /* data to add to the firmware names, in priority order |
3840 | this implemenents firmware versioning */ | 3850 | this implemenents firmware versioning */ |
@@ -3868,11 +3878,12 @@ static int reset_atmel_card(struct net_device *dev) | |||
3868 | dev->name); | 3878 | dev->name); |
3869 | strcpy(priv->firmware_id, "atmel_at76c502.bin"); | 3879 | strcpy(priv->firmware_id, "atmel_at76c502.bin"); |
3870 | } | 3880 | } |
3871 | if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) { | 3881 | err = request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev); |
3882 | if (err != 0) { | ||
3872 | printk(KERN_ALERT | 3883 | printk(KERN_ALERT |
3873 | "%s: firmware %s is missing, cannot continue.\n", | 3884 | "%s: firmware %s is missing, cannot continue.\n", |
3874 | dev->name, priv->firmware_id); | 3885 | dev->name, priv->firmware_id); |
3875 | return 0; | 3886 | return err; |
3876 | } | 3887 | } |
3877 | } else { | 3888 | } else { |
3878 | int fw_index = 0; | 3889 | int fw_index = 0; |
@@ -3901,7 +3912,7 @@ static int reset_atmel_card(struct net_device *dev) | |||
3901 | "%s: firmware %s is missing, cannot start.\n", | 3912 | "%s: firmware %s is missing, cannot start.\n", |
3902 | dev->name, priv->firmware_id); | 3913 | dev->name, priv->firmware_id); |
3903 | priv->firmware_id[0] = '\0'; | 3914 | priv->firmware_id[0] = '\0'; |
3904 | return 0; | 3915 | return -ENOENT; |
3905 | } | 3916 | } |
3906 | } | 3917 | } |
3907 | 3918 | ||
@@ -3926,8 +3937,9 @@ static int reset_atmel_card(struct net_device *dev) | |||
3926 | release_firmware(fw_entry); | 3937 | release_firmware(fw_entry); |
3927 | } | 3938 | } |
3928 | 3939 | ||
3929 | if (!atmel_wakeup_firmware(priv)) | 3940 | err = atmel_wakeup_firmware(priv); |
3930 | return 0; | 3941 | if (err != 0) |
3942 | return err; | ||
3931 | 3943 | ||
3932 | /* Check the version and set the correct flag for wpa stuff, | 3944 | /* Check the version and set the correct flag for wpa stuff, |
3933 | old and new firmware is incompatible. | 3945 | old and new firmware is incompatible. |
@@ -3968,10 +3980,9 @@ static int reset_atmel_card(struct net_device *dev) | |||
3968 | if (!priv->radio_on_broken) { | 3980 | if (!priv->radio_on_broken) { |
3969 | if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == | 3981 | if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == |
3970 | CMD_STATUS_REJECTED_RADIO_OFF) { | 3982 | CMD_STATUS_REJECTED_RADIO_OFF) { |
3971 | printk(KERN_INFO | 3983 | printk(KERN_INFO "%s: cannot turn the radio on.\n", |
3972 | "%s: cannot turn the radio on. (Hey radio, you're beautiful!)\n", | ||
3973 | dev->name); | 3984 | dev->name); |
3974 | return 0; | 3985 | return -EIO; |
3975 | } | 3986 | } |
3976 | } | 3987 | } |
3977 | 3988 | ||
@@ -4006,7 +4017,7 @@ static int reset_atmel_card(struct net_device *dev) | |||
4006 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); | 4017 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); |
4007 | } | 4018 | } |
4008 | 4019 | ||
4009 | return 1; | 4020 | return 0; |
4010 | } | 4021 | } |
4011 | 4022 | ||
4012 | static void atmel_send_command(struct atmel_private *priv, int command, | 4023 | static void atmel_send_command(struct atmel_private *priv, int command, |