aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/cfg80211.c13
-rw-r--r--drivers/net/wireless/iwmc3200wifi/commands.c2
-rw-r--r--drivers/net/wireless/iwmc3200wifi/debugfs.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/hal.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/netdev.c2
-rw-r--r--drivers/net/wireless/iwmc3200wifi/rx.c21
-rw-r--r--drivers/net/wireless/iwmc3200wifi/sdio.c1
-rw-r--r--drivers/net/wireless/iwmc3200wifi/tx.c2
8 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
index 60619678f4ec..ed57e4402800 100644
--- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c
+++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
@@ -161,7 +161,7 @@ static int iwm_key_init(struct iwm_key *key, u8 key_index,
161} 161}
162 162
163static int iwm_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, 163static int iwm_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
164 u8 key_index, const u8 *mac_addr, 164 u8 key_index, bool pairwise, const u8 *mac_addr,
165 struct key_params *params) 165 struct key_params *params)
166{ 166{
167 struct iwm_priv *iwm = ndev_to_iwm(ndev); 167 struct iwm_priv *iwm = ndev_to_iwm(ndev);
@@ -181,7 +181,8 @@ static int iwm_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
181} 181}
182 182
183static int iwm_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, 183static int iwm_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
184 u8 key_index, const u8 *mac_addr, void *cookie, 184 u8 key_index, bool pairwise, const u8 *mac_addr,
185 void *cookie,
185 void (*callback)(void *cookie, 186 void (*callback)(void *cookie,
186 struct key_params*)) 187 struct key_params*))
187{ 188{
@@ -206,7 +207,7 @@ static int iwm_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
206 207
207 208
208static int iwm_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, 209static int iwm_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
209 u8 key_index, const u8 *mac_addr) 210 u8 key_index, bool pairwise, const u8 *mac_addr)
210{ 211{
211 struct iwm_priv *iwm = ndev_to_iwm(ndev); 212 struct iwm_priv *iwm = ndev_to_iwm(ndev);
212 struct iwm_key *key = &iwm->keys[key_index]; 213 struct iwm_key *key = &iwm->keys[key_index];
@@ -224,7 +225,8 @@ static int iwm_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
224 225
225static int iwm_cfg80211_set_default_key(struct wiphy *wiphy, 226static int iwm_cfg80211_set_default_key(struct wiphy *wiphy,
226 struct net_device *ndev, 227 struct net_device *ndev,
227 u8 key_index) 228 u8 key_index, bool unicast,
229 bool multicast)
228{ 230{
229 struct iwm_priv *iwm = ndev_to_iwm(ndev); 231 struct iwm_priv *iwm = ndev_to_iwm(ndev);
230 232
@@ -285,7 +287,8 @@ int iwm_cfg80211_inform_bss(struct iwm_priv *iwm)
285 return -EINVAL; 287 return -EINVAL;
286 } 288 }
287 289
288 freq = ieee80211_channel_to_frequency(umac_bss->channel); 290 freq = ieee80211_channel_to_frequency(umac_bss->channel,
291 band->band);
289 channel = ieee80211_get_channel(wiphy, freq); 292 channel = ieee80211_get_channel(wiphy, freq);
290 signal = umac_bss->rssi * 100; 293 signal = umac_bss->rssi * 100;
291 294
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c
index 330c7d9cf101..50dee6a0a5ca 100644
--- a/drivers/net/wireless/iwmc3200wifi/commands.c
+++ b/drivers/net/wireless/iwmc3200wifi/commands.c
@@ -908,7 +908,7 @@ int iwm_scan_ssids(struct iwm_priv *iwm, struct cfg80211_ssid *ssids,
908 return ret; 908 return ret;
909 } 909 }
910 910
911 iwm->scan_id = iwm->scan_id++ % IWM_SCAN_ID_MAX; 911 iwm->scan_id = (iwm->scan_id + 1) % IWM_SCAN_ID_MAX;
912 912
913 return 0; 913 return 0;
914} 914}
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
index 53b0b7711f02..0a0cc9667cd6 100644
--- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
+++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
@@ -402,24 +402,28 @@ static const struct file_operations iwm_debugfs_txq_fops = {
402 .owner = THIS_MODULE, 402 .owner = THIS_MODULE,
403 .open = iwm_generic_open, 403 .open = iwm_generic_open,
404 .read = iwm_debugfs_txq_read, 404 .read = iwm_debugfs_txq_read,
405 .llseek = default_llseek,
405}; 406};
406 407
407static const struct file_operations iwm_debugfs_tx_credit_fops = { 408static const struct file_operations iwm_debugfs_tx_credit_fops = {
408 .owner = THIS_MODULE, 409 .owner = THIS_MODULE,
409 .open = iwm_generic_open, 410 .open = iwm_generic_open,
410 .read = iwm_debugfs_tx_credit_read, 411 .read = iwm_debugfs_tx_credit_read,
412 .llseek = default_llseek,
411}; 413};
412 414
413static const struct file_operations iwm_debugfs_rx_ticket_fops = { 415static const struct file_operations iwm_debugfs_rx_ticket_fops = {
414 .owner = THIS_MODULE, 416 .owner = THIS_MODULE,
415 .open = iwm_generic_open, 417 .open = iwm_generic_open,
416 .read = iwm_debugfs_rx_ticket_read, 418 .read = iwm_debugfs_rx_ticket_read,
419 .llseek = default_llseek,
417}; 420};
418 421
419static const struct file_operations iwm_debugfs_fw_err_fops = { 422static const struct file_operations iwm_debugfs_fw_err_fops = {
420 .owner = THIS_MODULE, 423 .owner = THIS_MODULE,
421 .open = iwm_generic_open, 424 .open = iwm_generic_open,
422 .read = iwm_debugfs_fw_err_read, 425 .read = iwm_debugfs_fw_err_read,
426 .llseek = default_llseek,
423}; 427};
424 428
425void iwm_debugfs_init(struct iwm_priv *iwm) 429void iwm_debugfs_init(struct iwm_priv *iwm)
diff --git a/drivers/net/wireless/iwmc3200wifi/hal.c b/drivers/net/wireless/iwmc3200wifi/hal.c
index 907ac890997c..1cabcb39643f 100644
--- a/drivers/net/wireless/iwmc3200wifi/hal.c
+++ b/drivers/net/wireless/iwmc3200wifi/hal.c
@@ -57,7 +57,7 @@
57 * This is due to the fact the host talks exclusively 57 * This is due to the fact the host talks exclusively
58 * to the UMAC and so there needs to be a special UMAC 58 * to the UMAC and so there needs to be a special UMAC
59 * command for talking to the LMAC. 59 * command for talking to the LMAC.
60 * This is how a wifi command is layed out: 60 * This is how a wifi command is laid out:
61 * ------------------------ 61 * ------------------------
62 * | iwm_udma_out_wifi_hdr | 62 * | iwm_udma_out_wifi_hdr |
63 * ------------------------ 63 * ------------------------
@@ -72,7 +72,7 @@
72 * Those commands are handled by the device's bootrom, 72 * Those commands are handled by the device's bootrom,
73 * and are typically sent when the UMAC and the LMAC 73 * and are typically sent when the UMAC and the LMAC
74 * are not yet available. 74 * are not yet available.
75 * * This is how a non-wifi command is layed out: 75 * * This is how a non-wifi command is laid out:
76 * --------------------------- 76 * ---------------------------
77 * | iwm_udma_out_nonwifi_hdr | 77 * | iwm_udma_out_nonwifi_hdr |
78 * --------------------------- 78 * ---------------------------
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index 13a69ebf2a94..5091d77e02ce 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -126,6 +126,7 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
126 ndev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES); 126 ndev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES);
127 if (!ndev) { 127 if (!ndev) {
128 dev_err(dev, "no memory for network device instance\n"); 128 dev_err(dev, "no memory for network device instance\n");
129 ret = -ENOMEM;
129 goto out_priv; 130 goto out_priv;
130 } 131 }
131 132
@@ -138,6 +139,7 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
138 GFP_KERNEL); 139 GFP_KERNEL);
139 if (!iwm->umac_profile) { 140 if (!iwm->umac_profile) {
140 dev_err(dev, "Couldn't alloc memory for profile\n"); 141 dev_err(dev, "Couldn't alloc memory for profile\n");
142 ret = -ENOMEM;
141 goto out_profile; 143 goto out_profile;
142 } 144 }
143 145
diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
index c02fcedea9fa..a414768f40f1 100644
--- a/drivers/net/wireless/iwmc3200wifi/rx.c
+++ b/drivers/net/wireless/iwmc3200wifi/rx.c
@@ -543,7 +543,10 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf,
543 switch (le32_to_cpu(complete->status)) { 543 switch (le32_to_cpu(complete->status)) {
544 case UMAC_ASSOC_COMPLETE_SUCCESS: 544 case UMAC_ASSOC_COMPLETE_SUCCESS:
545 chan = ieee80211_get_channel(wiphy, 545 chan = ieee80211_get_channel(wiphy,
546 ieee80211_channel_to_frequency(complete->channel)); 546 ieee80211_channel_to_frequency(complete->channel,
547 complete->band == UMAC_BAND_2GHZ ?
548 IEEE80211_BAND_2GHZ :
549 IEEE80211_BAND_5GHZ));
547 if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) { 550 if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) {
548 /* Associated to a unallowed channel, disassociate. */ 551 /* Associated to a unallowed channel, disassociate. */
549 __iwm_invalidate_mlme_profile(iwm); 552 __iwm_invalidate_mlme_profile(iwm);
@@ -562,7 +565,7 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf,
562 if (!test_and_clear_bit(IWM_STATUS_SME_CONNECTING, &iwm->status) 565 if (!test_and_clear_bit(IWM_STATUS_SME_CONNECTING, &iwm->status)
563 && iwm->conf.mode == UMAC_MODE_BSS) { 566 && iwm->conf.mode == UMAC_MODE_BSS) {
564 cancel_delayed_work(&iwm->disconnect); 567 cancel_delayed_work(&iwm->disconnect);
565 cfg80211_roamed(iwm_to_ndev(iwm), 568 cfg80211_roamed(iwm_to_ndev(iwm), NULL,
566 complete->bssid, 569 complete->bssid,
567 iwm->req_ie, iwm->req_ie_len, 570 iwm->req_ie, iwm->req_ie_len,
568 iwm->resp_ie, iwm->resp_ie_len, 571 iwm->resp_ie, iwm->resp_ie_len,
@@ -583,7 +586,7 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf,
583 WLAN_STATUS_SUCCESS, 586 WLAN_STATUS_SUCCESS,
584 GFP_KERNEL); 587 GFP_KERNEL);
585 else 588 else
586 cfg80211_roamed(iwm_to_ndev(iwm), 589 cfg80211_roamed(iwm_to_ndev(iwm), NULL,
587 complete->bssid, 590 complete->bssid,
588 iwm->req_ie, iwm->req_ie_len, 591 iwm->req_ie, iwm->req_ie_len,
589 iwm->resp_ie, iwm->resp_ie_len, 592 iwm->resp_ie, iwm->resp_ie_len,
@@ -841,7 +844,7 @@ static int iwm_mlme_update_bss_table(struct iwm_priv *iwm, u8 *buf,
841 goto err; 844 goto err;
842 } 845 }
843 846
844 freq = ieee80211_channel_to_frequency(umac_bss->channel); 847 freq = ieee80211_channel_to_frequency(umac_bss->channel, band->band);
845 channel = ieee80211_get_channel(wiphy, freq); 848 channel = ieee80211_get_channel(wiphy, freq);
846 signal = umac_bss->rssi * 100; 849 signal = umac_bss->rssi * 100;
847 850
@@ -1195,11 +1198,8 @@ static int iwm_ntf_wifi_if_wrapper(struct iwm_priv *iwm, u8 *buf,
1195 IWM_DBG_NTF(iwm, DBG, "WIFI_IF_WRAPPER cmd is delivered to UMAC: " 1198 IWM_DBG_NTF(iwm, DBG, "WIFI_IF_WRAPPER cmd is delivered to UMAC: "
1196 "oid is 0x%x\n", hdr->oid); 1199 "oid is 0x%x\n", hdr->oid);
1197 1200
1198 if (hdr->oid <= WIFI_IF_NTFY_MAX) { 1201 set_bit(hdr->oid, &iwm->wifi_ntfy[0]);
1199 set_bit(hdr->oid, &iwm->wifi_ntfy[0]); 1202 wake_up_interruptible(&iwm->wifi_ntfy_queue);
1200 wake_up_interruptible(&iwm->wifi_ntfy_queue);
1201 } else
1202 return -EINVAL;
1203 1203
1204 switch (hdr->oid) { 1204 switch (hdr->oid) {
1205 case UMAC_WIFI_IF_CMD_SET_PROFILE: 1205 case UMAC_WIFI_IF_CMD_SET_PROFILE:
@@ -1576,7 +1576,8 @@ static void iwm_rx_process_amsdu(struct iwm_priv *iwm, struct sk_buff *skb)
1576 IWM_HEXDUMP(iwm, DBG, RX, "A-MSDU: ", skb->data, skb->len); 1576 IWM_HEXDUMP(iwm, DBG, RX, "A-MSDU: ", skb->data, skb->len);
1577 1577
1578 __skb_queue_head_init(&list); 1578 __skb_queue_head_init(&list);
1579 ieee80211_amsdu_to_8023s(skb, &list, ndev->dev_addr, wdev->iftype, 0); 1579 ieee80211_amsdu_to_8023s(skb, &list, ndev->dev_addr, wdev->iftype, 0,
1580 true);
1580 1581
1581 while ((frame = __skb_dequeue(&list))) { 1582 while ((frame = __skb_dequeue(&list))) {
1582 ndev->stats.rx_packets++; 1583 ndev->stats.rx_packets++;
diff --git a/drivers/net/wireless/iwmc3200wifi/sdio.c b/drivers/net/wireless/iwmc3200wifi/sdio.c
index edcb52330cf5..56383e7be835 100644
--- a/drivers/net/wireless/iwmc3200wifi/sdio.c
+++ b/drivers/net/wireless/iwmc3200wifi/sdio.c
@@ -364,6 +364,7 @@ static const struct file_operations iwm_debugfs_sdio_fops = {
364 .owner = THIS_MODULE, 364 .owner = THIS_MODULE,
365 .open = iwm_debugfs_sdio_open, 365 .open = iwm_debugfs_sdio_open,
366 .read = iwm_debugfs_sdio_read, 366 .read = iwm_debugfs_sdio_read,
367 .llseek = default_llseek,
367}; 368};
368 369
369static void if_sdio_debugfs_init(struct iwm_priv *iwm, struct dentry *parent_dir) 370static void if_sdio_debugfs_init(struct iwm_priv *iwm, struct dentry *parent_dir)
diff --git a/drivers/net/wireless/iwmc3200wifi/tx.c b/drivers/net/wireless/iwmc3200wifi/tx.c
index 3216621fc55a..be98074c0608 100644
--- a/drivers/net/wireless/iwmc3200wifi/tx.c
+++ b/drivers/net/wireless/iwmc3200wifi/tx.c
@@ -197,7 +197,7 @@ int iwm_tx_credit_alloc(struct iwm_priv *iwm, int id, int nb)
197 spin_lock(&iwm->tx_credit.lock); 197 spin_lock(&iwm->tx_credit.lock);
198 198
199 if (!iwm_tx_credit_ok(iwm, id, nb)) { 199 if (!iwm_tx_credit_ok(iwm, id, nb)) {
200 IWM_DBG_TX(iwm, DBG, "No credit avaliable for pool[%d]\n", id); 200 IWM_DBG_TX(iwm, DBG, "No credit available for pool[%d]\n", id);
201 ret = -ENOSPC; 201 ret = -ENOSPC;
202 goto out; 202 goto out;
203 } 203 }