diff options
author | David S. Miller <davem@davemloft.net> | 2009-07-30 22:22:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-30 22:22:43 -0400 |
commit | df597efb5737063497f1a4f7c996cc9aec294230 (patch) | |
tree | 17bb60f68ee299d9717038197a932501625f1621 /drivers/net/wireless | |
parent | a33bc5c15154c835aae26f16e6a3a7d9ad4acb45 (diff) | |
parent | 0a924578bc4a2823a95c151f56975c71f5c156bb (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-3945.h
drivers/net/wireless/iwlwifi/iwl-tx.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/airo.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/netdev.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 3 |
6 files changed, 28 insertions, 30 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 49f3139a3fe7..c150c4858576 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -5918,20 +5918,19 @@ static int airo_set_essid(struct net_device *dev, | |||
5918 | readSsidRid(local, &SSID_rid); | 5918 | readSsidRid(local, &SSID_rid); |
5919 | 5919 | ||
5920 | /* Check if we asked for `any' */ | 5920 | /* Check if we asked for `any' */ |
5921 | if(dwrq->flags == 0) { | 5921 | if (dwrq->flags == 0) { |
5922 | /* Just send an empty SSID list */ | 5922 | /* Just send an empty SSID list */ |
5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); | 5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); |
5924 | } else { | 5924 | } else { |
5925 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | 5925 | unsigned index = (dwrq->flags & IW_ENCODE_INDEX) - 1; |
5926 | 5926 | ||
5927 | /* Check the size of the string */ | 5927 | /* Check the size of the string */ |
5928 | if(dwrq->length > IW_ESSID_MAX_SIZE) { | 5928 | if (dwrq->length > IW_ESSID_MAX_SIZE) |
5929 | return -E2BIG ; | 5929 | return -E2BIG ; |
5930 | } | 5930 | |
5931 | /* Check if index is valid */ | 5931 | /* Check if index is valid */ |
5932 | if((index < 0) || (index >= 4)) { | 5932 | if (index >= ARRAY_SIZE(SSID_rid.ssids)) |
5933 | return -EINVAL; | 5933 | return -EINVAL; |
5934 | } | ||
5935 | 5934 | ||
5936 | /* Set the SSID */ | 5935 | /* Set the SSID */ |
5937 | memset(SSID_rid.ssids[index].ssid, 0, | 5936 | memset(SSID_rid.ssids[index].ssid, 0, |
@@ -6819,7 +6818,7 @@ static int airo_set_txpow(struct net_device *dev, | |||
6819 | return -EINVAL; | 6818 | return -EINVAL; |
6820 | } | 6819 | } |
6821 | clear_bit (FLAG_RADIO_OFF, &local->flags); | 6820 | clear_bit (FLAG_RADIO_OFF, &local->flags); |
6822 | for (i = 0; cap_rid.txPowerLevels[i] && (i < 8); i++) | 6821 | for (i = 0; i < 8 && cap_rid.txPowerLevels[i]; i++) |
6823 | if (v == cap_rid.txPowerLevels[i]) { | 6822 | if (v == cap_rid.txPowerLevels[i]) { |
6824 | readConfigRid(local, 1); | 6823 | readConfigRid(local, 1); |
6825 | local->config.txPower = v; | 6824 | local->config.txPower = v; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index df41ed5fd7c4..93e8ce0598a4 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c | |||
@@ -460,7 +460,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) | |||
460 | integer = swab32(eep->modalHeader.antCtrlCommon); | 460 | integer = swab32(eep->modalHeader.antCtrlCommon); |
461 | eep->modalHeader.antCtrlCommon = integer; | 461 | eep->modalHeader.antCtrlCommon = integer; |
462 | 462 | ||
463 | for (i = 0; i < AR5416_MAX_CHAINS; i++) { | 463 | for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { |
464 | integer = swab32(eep->modalHeader.antCtrlChain[i]); | 464 | integer = swab32(eep->modalHeader.antCtrlChain[i]); |
465 | eep->modalHeader.antCtrlChain[i] = integer; | 465 | eep->modalHeader.antCtrlChain[i] = integer; |
466 | } | 466 | } |
@@ -914,7 +914,7 @@ static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah, | |||
914 | ctlMode, numCtlModes, isHt40CtlMode, | 914 | ctlMode, numCtlModes, isHt40CtlMode, |
915 | (pCtlMode[ctlMode] & EXT_ADDITIVE)); | 915 | (pCtlMode[ctlMode] & EXT_ADDITIVE)); |
916 | 916 | ||
917 | for (i = 0; (i < AR5416_NUM_CTLS) && | 917 | for (i = 0; (i < AR5416_EEP4K_NUM_CTLS) && |
918 | pEepData->ctlIndex[i]; i++) { | 918 | pEepData->ctlIndex[i]; i++) { |
919 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, | 919 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, |
920 | " LOOP-Ctlidx %d: cfgCtl 0x%2.2x " | 920 | " LOOP-Ctlidx %d: cfgCtl 0x%2.2x " |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 0912987af603..c7100b9dcede 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -724,8 +724,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
724 | goto drop_unlock; | 724 | goto drop_unlock; |
725 | } | 725 | } |
726 | 726 | ||
727 | spin_unlock_irqrestore(&priv->lock, flags); | ||
728 | |||
729 | hdr_len = ieee80211_hdrlen(fc); | 727 | hdr_len = ieee80211_hdrlen(fc); |
730 | 728 | ||
731 | /* Find (or create) index into station table for destination station */ | 729 | /* Find (or create) index into station table for destination station */ |
@@ -733,7 +731,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
733 | if (sta_id == IWL_INVALID_STATION) { | 731 | if (sta_id == IWL_INVALID_STATION) { |
734 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", | 732 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", |
735 | hdr->addr1); | 733 | hdr->addr1); |
736 | goto drop; | 734 | goto drop_unlock; |
737 | } | 735 | } |
738 | 736 | ||
739 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); | 737 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); |
@@ -751,14 +749,17 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
751 | /* aggregation is on for this <sta,tid> */ | 749 | /* aggregation is on for this <sta,tid> */ |
752 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | 750 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
753 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; | 751 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; |
754 | priv->stations[sta_id].tid[tid].tfds_in_queue++; | ||
755 | } | 752 | } |
756 | 753 | ||
757 | txq = &priv->txq[txq_id]; | 754 | txq = &priv->txq[txq_id]; |
758 | swq_id = txq->swq_id; | 755 | swq_id = txq->swq_id; |
759 | q = &txq->q; | 756 | q = &txq->q; |
760 | 757 | ||
761 | spin_lock_irqsave(&priv->lock, flags); | 758 | if (unlikely(iwl_queue_space(q) < q->high_mark)) |
759 | goto drop_unlock; | ||
760 | |||
761 | if (ieee80211_is_data_qos(fc)) | ||
762 | priv->stations[sta_id].tid[tid].tfds_in_queue++; | ||
762 | 763 | ||
763 | /* Set up driver data for this TFD */ | 764 | /* Set up driver data for this TFD */ |
764 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); | 765 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); |
@@ -903,7 +904,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
903 | 904 | ||
904 | drop_unlock: | 905 | drop_unlock: |
905 | spin_unlock_irqrestore(&priv->lock, flags); | 906 | spin_unlock_irqrestore(&priv->lock, flags); |
906 | drop: | ||
907 | return -1; | 907 | return -1; |
908 | } | 908 | } |
909 | EXPORT_SYMBOL(iwl_tx_skb); | 909 | EXPORT_SYMBOL(iwl_tx_skb); |
@@ -1172,6 +1172,8 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn) | |||
1172 | IWL_ERR(priv, "Start AGG on invalid station\n"); | 1172 | IWL_ERR(priv, "Start AGG on invalid station\n"); |
1173 | return -ENXIO; | 1173 | return -ENXIO; |
1174 | } | 1174 | } |
1175 | if (unlikely(tid >= MAX_TID_COUNT)) | ||
1176 | return -EINVAL; | ||
1175 | 1177 | ||
1176 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { | 1178 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { |
1177 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); | 1179 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); |
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c index 092d28ae56a0..93cc1b3e7f48 100644 --- a/drivers/net/wireless/iwmc3200wifi/netdev.c +++ b/drivers/net/wireless/iwmc3200wifi/netdev.c | |||
@@ -99,10 +99,8 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev, | |||
99 | int ret = 0; | 99 | int ret = 0; |
100 | 100 | ||
101 | wdev = iwm_wdev_alloc(sizeof_bus, dev); | 101 | wdev = iwm_wdev_alloc(sizeof_bus, dev); |
102 | if (!wdev) { | 102 | if (IS_ERR(wdev)) |
103 | dev_err(dev, "no memory for wireless device instance\n"); | 103 | return wdev; |
104 | return ERR_PTR(-ENOMEM); | ||
105 | } | ||
106 | 104 | ||
107 | iwm = wdev_to_iwm(wdev); | 105 | iwm = wdev_to_iwm(wdev); |
108 | iwm->bus_ops = if_ops; | 106 | iwm->bus_ops = if_ops; |
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 385b50f4b105..1902b6f0b78c 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright (C) 2006, Red Hat, Inc. */ | 1 | /* Copyright (C) 2006, Red Hat, Inc. */ |
2 | 2 | ||
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | #include <linux/kernel.h> | ||
4 | #include <linux/etherdevice.h> | 5 | #include <linux/etherdevice.h> |
5 | #include <linux/ieee80211.h> | 6 | #include <linux/ieee80211.h> |
6 | #include <linux/if_arp.h> | 7 | #include <linux/if_arp.h> |
@@ -43,21 +44,21 @@ static int get_common_rates(struct lbs_private *priv, | |||
43 | u16 *rates_size) | 44 | u16 *rates_size) |
44 | { | 45 | { |
45 | u8 *card_rates = lbs_bg_rates; | 46 | u8 *card_rates = lbs_bg_rates; |
46 | size_t num_card_rates = sizeof(lbs_bg_rates); | ||
47 | int ret = 0, i, j; | 47 | int ret = 0, i, j; |
48 | u8 tmp[30]; | 48 | u8 tmp[(ARRAY_SIZE(lbs_bg_rates) - 1) * (*rates_size - 1)]; |
49 | size_t tmp_size = 0; | 49 | size_t tmp_size = 0; |
50 | 50 | ||
51 | /* For each rate in card_rates that exists in rate1, copy to tmp */ | 51 | /* For each rate in card_rates that exists in rate1, copy to tmp */ |
52 | for (i = 0; card_rates[i] && (i < num_card_rates); i++) { | 52 | for (i = 0; i < ARRAY_SIZE(lbs_bg_rates) && card_rates[i]; i++) { |
53 | for (j = 0; rates[j] && (j < *rates_size); j++) { | 53 | for (j = 0; j < *rates_size && rates[j]; j++) { |
54 | if (rates[j] == card_rates[i]) | 54 | if (rates[j] == card_rates[i]) |
55 | tmp[tmp_size++] = card_rates[i]; | 55 | tmp[tmp_size++] = card_rates[i]; |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); | 59 | lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); |
60 | lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, num_card_rates); | 60 | lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, |
61 | ARRAY_SIZE(lbs_bg_rates)); | ||
61 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); | 62 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); |
62 | lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); | 63 | lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); |
63 | 64 | ||
@@ -69,10 +70,7 @@ static int get_common_rates(struct lbs_private *priv, | |||
69 | lbs_pr_alert("Previously set fixed data rate %#x isn't " | 70 | lbs_pr_alert("Previously set fixed data rate %#x isn't " |
70 | "compatible with the network.\n", priv->cur_rate); | 71 | "compatible with the network.\n", priv->cur_rate); |
71 | ret = -1; | 72 | ret = -1; |
72 | goto done; | ||
73 | } | 73 | } |
74 | ret = 0; | ||
75 | |||
76 | done: | 74 | done: |
77 | memset(rates, 0, *rates_size); | 75 | memset(rates, 0, *rates_size); |
78 | *rates_size = min_t(int, tmp_size, *rates_size); | 76 | *rates_size = min_t(int, tmp_size, *rates_size); |
@@ -320,7 +318,7 @@ static int lbs_associate(struct lbs_private *priv, | |||
320 | rates = (struct mrvl_ie_rates_param_set *) pos; | 318 | rates = (struct mrvl_ie_rates_param_set *) pos; |
321 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); | 319 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); |
322 | memcpy(&rates->rates, &bss->rates, MAX_RATES); | 320 | memcpy(&rates->rates, &bss->rates, MAX_RATES); |
323 | tmplen = MAX_RATES; | 321 | tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES); |
324 | if (get_common_rates(priv, rates->rates, &tmplen)) { | 322 | if (get_common_rates(priv, rates->rates, &tmplen)) { |
325 | ret = -1; | 323 | ret = -1; |
326 | goto done; | 324 | goto done; |
@@ -594,7 +592,7 @@ static int lbs_adhoc_join(struct lbs_private *priv, | |||
594 | 592 | ||
595 | /* Copy Data rates from the rates recorded in scan response */ | 593 | /* Copy Data rates from the rates recorded in scan response */ |
596 | memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates)); | 594 | memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates)); |
597 | ratesize = min_t(u16, sizeof(cmd.bss.rates), MAX_RATES); | 595 | ratesize = min_t(u16, ARRAY_SIZE(cmd.bss.rates), MAX_RATES); |
598 | memcpy(cmd.bss.rates, bss->rates, ratesize); | 596 | memcpy(cmd.bss.rates, bss->rates, ratesize); |
599 | if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { | 597 | if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { |
600 | lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); | 598 | lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 601b54249677..6c95af3023cc 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * for sending scan commands to the firmware. | 5 | * for sending scan commands to the firmware. |
6 | */ | 6 | */ |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/kernel.h> | ||
8 | #include <linux/etherdevice.h> | 9 | #include <linux/etherdevice.h> |
9 | #include <linux/if_arp.h> | 10 | #include <linux/if_arp.h> |
10 | #include <asm/unaligned.h> | 11 | #include <asm/unaligned.h> |
@@ -876,7 +877,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, | |||
876 | iwe.u.bitrate.disabled = 0; | 877 | iwe.u.bitrate.disabled = 0; |
877 | iwe.u.bitrate.value = 0; | 878 | iwe.u.bitrate.value = 0; |
878 | 879 | ||
879 | for (j = 0; bss->rates[j] && (j < sizeof(bss->rates)); j++) { | 880 | for (j = 0; j < ARRAY_SIZE(bss->rates) && bss->rates[j]; j++) { |
880 | /* Bit rate given in 500 kb/s units */ | 881 | /* Bit rate given in 500 kb/s units */ |
881 | iwe.u.bitrate.value = bss->rates[j] * 500000; | 882 | iwe.u.bitrate.value = bss->rates[j] * 500000; |
882 | current_val = iwe_stream_add_value(info, start, current_val, | 883 | current_val = iwe_stream_add_value(info, start, current_val, |