aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c6
8 files changed, 41 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 9b60a0c5de5f..21c841847d88 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -638,12 +638,16 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
638 s8 scale_action = 0; 638 s8 scale_action = 0;
639 unsigned long flags; 639 unsigned long flags;
640 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 640 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
641 u16 fc, rate_mask; 641 u16 fc;
642 u16 rate_mask = 0;
642 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; 643 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r;
643 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 644 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
644 645
645 IWL_DEBUG_RATE("enter\n"); 646 IWL_DEBUG_RATE("enter\n");
646 647
648 if (sta)
649 rate_mask = sta->supp_rates[sband->band];
650
647 /* Send management frames and broadcast/multicast data using lowest 651 /* Send management frames and broadcast/multicast data using lowest
648 * rate. */ 652 * rate. */
649 fc = le16_to_cpu(hdr->frame_control); 653 fc = le16_to_cpu(hdr->frame_control);
@@ -651,11 +655,15 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
651 is_multicast_ether_addr(hdr->addr1) || 655 is_multicast_ether_addr(hdr->addr1) ||
652 !sta || !priv_sta) { 656 !sta || !priv_sta) {
653 IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); 657 IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
654 info->control.rates[0].idx = rate_lowest_index(sband, sta); 658 if (!rate_mask)
659 info->control.rates[0].idx =
660 rate_lowest_index(sband, NULL);
661 else
662 info->control.rates[0].idx =
663 rate_lowest_index(sband, sta);
655 return; 664 return;
656 } 665 }
657 666
658 rate_mask = sta->supp_rates[sband->band];
659 index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); 667 index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1);
660 668
661 if (sband->band == IEEE80211_BAND_5GHZ) 669 if (sband->band == IEEE80211_BAND_5GHZ)
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 8fdb34222c0a..45cfa1cf194a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2219,7 +2219,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv)
2219 /* set tx power value for all OFDM rates */ 2219 /* set tx power value for all OFDM rates */
2220 for (rate_index = 0; rate_index < IWL_OFDM_RATES; 2220 for (rate_index = 0; rate_index < IWL_OFDM_RATES;
2221 rate_index++) { 2221 rate_index++) {
2222 s32 power_idx; 2222 s32 uninitialized_var(power_idx);
2223 int rc; 2223 int rc;
2224 2224
2225 /* use channel group's clip-power table, 2225 /* use channel group's clip-power table,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index f3f17929ca0b..27f50471aed8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -944,7 +944,8 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
944 } 944 }
945 945
946 /* See if there's a better rate or modulation mode to try. */ 946 /* See if there's a better rate or modulation mode to try. */
947 rs_rate_scale_perform(priv, hdr, sta, lq_sta); 947 if (sta && sta->supp_rates[sband->band])
948 rs_rate_scale_perform(priv, hdr, sta, lq_sta);
948out: 949out:
949 return; 950 return;
950} 951}
@@ -2101,14 +2102,23 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
2101 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 2102 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
2102 struct iwl_lq_sta *lq_sta = priv_sta; 2103 struct iwl_lq_sta *lq_sta = priv_sta;
2103 int rate_idx; 2104 int rate_idx;
2105 u64 mask_bit = 0;
2104 2106
2105 IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); 2107 IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
2106 2108
2109 if (sta)
2110 mask_bit = sta->supp_rates[sband->band];
2111
2107 /* Send management frames and broadcast/multicast data using lowest 2112 /* Send management frames and broadcast/multicast data using lowest
2108 * rate. */ 2113 * rate. */
2109 if (!ieee80211_is_data(hdr->frame_control) || 2114 if (!ieee80211_is_data(hdr->frame_control) ||
2110 is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) { 2115 is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) {
2111 info->control.rates[0].idx = rate_lowest_index(sband, sta); 2116 if (!mask_bit)
2117 info->control.rates[0].idx =
2118 rate_lowest_index(sband, NULL);
2119 else
2120 info->control.rates[0].idx =
2121 rate_lowest_index(sband, sta);
2112 return; 2122 return;
2113 } 2123 }
2114 2124
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 5da6b35cd26d..c01ea48da5fe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1719,6 +1719,10 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1719 priv->ucode_data_backup.len = data_size; 1719 priv->ucode_data_backup.len = data_size;
1720 iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup); 1720 iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
1721 1721
1722 if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr ||
1723 !priv->ucode_data_backup.v_addr)
1724 goto err_pci_alloc;
1725
1722 /* Initialization instructions and data */ 1726 /* Initialization instructions and data */
1723 if (init_size && init_data_size) { 1727 if (init_size && init_data_size) {
1724 priv->ucode_init.len = init_size; 1728 priv->ucode_init.len = init_size;
@@ -2482,7 +2486,7 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2482 dev_kfree_skb_any(skb); 2486 dev_kfree_skb_any(skb);
2483 2487
2484 IWL_DEBUG_MACDUMP("leave\n"); 2488 IWL_DEBUG_MACDUMP("leave\n");
2485 return 0; 2489 return NETDEV_TX_OK;
2486} 2490}
2487 2491
2488static int iwl_mac_add_interface(struct ieee80211_hw *hw, 2492static int iwl_mac_add_interface(struct ieee80211_hw *hw,
@@ -4038,6 +4042,7 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
4038 priv->is_open = 1; 4042 priv->is_open = 1;
4039 } 4043 }
4040 4044
4045 pci_save_state(pdev);
4041 pci_set_power_state(pdev, PCI_D3hot); 4046 pci_set_power_state(pdev, PCI_D3hot);
4042 4047
4043 return 0; 4048 return 0;
@@ -4048,6 +4053,7 @@ static int iwl_pci_resume(struct pci_dev *pdev)
4048 struct iwl_priv *priv = pci_get_drvdata(pdev); 4053 struct iwl_priv *priv = pci_get_drvdata(pdev);
4049 4054
4050 pci_set_power_state(pdev, PCI_D0); 4055 pci_set_power_state(pdev, PCI_D0);
4056 pci_restore_state(pdev);
4051 4057
4052 if (priv->is_open) 4058 if (priv->is_open)
4053 iwl_mac_start(priv->hw); 4059 iwl_mac_start(priv->hw);
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 52966ffbef6e..ba997204c8d4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -255,7 +255,7 @@ struct iwl_cmd_header {
255 * 0x3) 54 Mbps 255 * 0x3) 54 Mbps
256 * 256 *
257 * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"): 257 * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"):
258 * 3-0: 10) 1 Mbps 258 * 6-0: 10) 1 Mbps
259 * 20) 2 Mbps 259 * 20) 2 Mbps
260 * 55) 5.5 Mbps 260 * 55) 5.5 Mbps
261 * 110) 11 Mbps 261 * 110) 11 Mbps
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index 01a2169cecec..4b35b30e493e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -51,6 +51,7 @@ const char *get_cmd_string(u8 cmd)
51 IWL_CMD(REPLY_REMOVE_STA); 51 IWL_CMD(REPLY_REMOVE_STA);
52 IWL_CMD(REPLY_REMOVE_ALL_STA); 52 IWL_CMD(REPLY_REMOVE_ALL_STA);
53 IWL_CMD(REPLY_WEPKEY); 53 IWL_CMD(REPLY_WEPKEY);
54 IWL_CMD(REPLY_3945_RX);
54 IWL_CMD(REPLY_TX); 55 IWL_CMD(REPLY_TX);
55 IWL_CMD(REPLY_RATE_SCALE); 56 IWL_CMD(REPLY_RATE_SCALE);
56 IWL_CMD(REPLY_LEDS_CMD); 57 IWL_CMD(REPLY_LEDS_CMD);
@@ -223,7 +224,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
223 IWL_ERROR("Error: Response NULL in '%s'\n", 224 IWL_ERROR("Error: Response NULL in '%s'\n",
224 get_cmd_string(cmd->id)); 225 get_cmd_string(cmd->id));
225 ret = -EIO; 226 ret = -EIO;
226 goto out; 227 goto cancel;
227 } 228 }
228 229
229 ret = 0; 230 ret = 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 412f66bac1af..70a8b21ca39b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -480,6 +480,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv)
480 priv->num_stations = 0; 480 priv->num_stations = 0;
481 memset(priv->stations, 0, sizeof(priv->stations)); 481 memset(priv->stations, 0, sizeof(priv->stations));
482 482
483 /* clean ucode key table bit map */
484 priv->ucode_key_table = 0;
485
483 spin_unlock_irqrestore(&priv->sta_lock, flags); 486 spin_unlock_irqrestore(&priv->sta_lock, flags);
484} 487}
485EXPORT_SYMBOL(iwl_clear_stations_table); 488EXPORT_SYMBOL(iwl_clear_stations_table);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index d64580805d6e..5b44d322b99f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -745,7 +745,7 @@ static int iwl3945_send_cmd_sync(struct iwl3945_priv *priv, struct iwl3945_host_
745 IWL_ERROR("Error: Response NULL in '%s'\n", 745 IWL_ERROR("Error: Response NULL in '%s'\n",
746 get_cmd_string(cmd->id)); 746 get_cmd_string(cmd->id));
747 ret = -EIO; 747 ret = -EIO;
748 goto out; 748 goto cancel;
749 } 749 }
750 750
751 ret = 0; 751 ret = 0;
@@ -6538,7 +6538,7 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
6538 dev_kfree_skb_any(skb); 6538 dev_kfree_skb_any(skb);
6539 6539
6540 IWL_DEBUG_MAC80211("leave\n"); 6540 IWL_DEBUG_MAC80211("leave\n");
6541 return 0; 6541 return NETDEV_TX_OK;
6542} 6542}
6543 6543
6544static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, 6544static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
@@ -8143,6 +8143,7 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state)
8143 priv->is_open = 1; 8143 priv->is_open = 1;
8144 } 8144 }
8145 8145
8146 pci_save_state(pdev);
8146 pci_set_power_state(pdev, PCI_D3hot); 8147 pci_set_power_state(pdev, PCI_D3hot);
8147 8148
8148 return 0; 8149 return 0;
@@ -8153,6 +8154,7 @@ static int iwl3945_pci_resume(struct pci_dev *pdev)
8153 struct iwl3945_priv *priv = pci_get_drvdata(pdev); 8154 struct iwl3945_priv *priv = pci_get_drvdata(pdev);
8154 8155
8155 pci_set_power_state(pdev, PCI_D0); 8156 pci_set_power_state(pdev, PCI_D0);
8157 pci_restore_state(pdev);
8156 8158
8157 if (priv->is_open) 8159 if (priv->is_open)
8158 iwl3945_mac_start(priv->hw); 8160 iwl3945_mac_start(priv->hw);