diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-02-13 05:23:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-22 14:51:15 -0500 |
commit | 9ce7b73c76ca872cb5b42e835f8e683a4051fbd9 (patch) | |
tree | 93e7cfd03deab376154537cd26db502a6cd9f37a /drivers/net/wireless/iwlegacy | |
parent | 288f9954132cd64f60fbb8051e31d62d8c35875f (diff) |
iwlegacy: improve mac operation debuggability a bit
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r-- | drivers/net/wireless/iwlegacy/3945-mac.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 89 |
2 files changed, 53 insertions, 52 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c index 1743accc1271..99d7c729d8ce 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c | |||
@@ -2781,10 +2781,9 @@ il3945_mac_start(struct ieee80211_hw *hw) | |||
2781 | struct il_priv *il = hw->priv; | 2781 | struct il_priv *il = hw->priv; |
2782 | int ret; | 2782 | int ret; |
2783 | 2783 | ||
2784 | D_MAC80211("enter\n"); | ||
2785 | |||
2786 | /* we should be verifying the device is ready to be opened */ | 2784 | /* we should be verifying the device is ready to be opened */ |
2787 | mutex_lock(&il->mutex); | 2785 | mutex_lock(&il->mutex); |
2786 | D_MAC80211("enter\n"); | ||
2788 | 2787 | ||
2789 | /* fetch ucode file from disk, alloc and copy to bus-master buffers ... | 2788 | /* fetch ucode file from disk, alloc and copy to bus-master buffers ... |
2790 | * ucode filename and max sizes are card-specific. */ | 2789 | * ucode filename and max sizes are card-specific. */ |
@@ -2940,15 +2939,19 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
2940 | * hardware will then not attempt to decrypt the frames. | 2939 | * hardware will then not attempt to decrypt the frames. |
2941 | */ | 2940 | */ |
2942 | if (vif->type == NL80211_IFTYPE_ADHOC && | 2941 | if (vif->type == NL80211_IFTYPE_ADHOC && |
2943 | !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) | 2942 | !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { |
2943 | D_MAC80211("leave - IBSS RSN\n"); | ||
2944 | return -EOPNOTSUPP; | 2944 | return -EOPNOTSUPP; |
2945 | } | ||
2945 | 2946 | ||
2946 | static_key = !il_is_associated(il); | 2947 | static_key = !il_is_associated(il); |
2947 | 2948 | ||
2948 | if (!static_key) { | 2949 | if (!static_key) { |
2949 | sta_id = il_sta_id_or_broadcast(il, sta); | 2950 | sta_id = il_sta_id_or_broadcast(il, sta); |
2950 | if (sta_id == IL_INVALID_STATION) | 2951 | if (sta_id == IL_INVALID_STATION) { |
2952 | D_MAC80211("leave - station not found\n"); | ||
2951 | return -EINVAL; | 2953 | return -EINVAL; |
2954 | } | ||
2952 | } | 2955 | } |
2953 | 2956 | ||
2954 | mutex_lock(&il->mutex); | 2957 | mutex_lock(&il->mutex); |
@@ -2973,8 +2976,8 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
2973 | ret = -EINVAL; | 2976 | ret = -EINVAL; |
2974 | } | 2977 | } |
2975 | 2978 | ||
2979 | D_MAC80211("leave ret %d\n", ret); | ||
2976 | mutex_unlock(&il->mutex); | 2980 | mutex_unlock(&il->mutex); |
2977 | D_MAC80211("leave\n"); | ||
2978 | 2981 | ||
2979 | return ret; | 2982 | return ret; |
2980 | } | 2983 | } |
@@ -2989,9 +2992,8 @@ il3945_mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
2989 | bool is_ap = vif->type == NL80211_IFTYPE_STATION; | 2992 | bool is_ap = vif->type == NL80211_IFTYPE_STATION; |
2990 | u8 sta_id; | 2993 | u8 sta_id; |
2991 | 2994 | ||
2992 | D_INFO("received request to add station %pM\n", sta->addr); | ||
2993 | mutex_lock(&il->mutex); | 2995 | mutex_lock(&il->mutex); |
2994 | D_INFO("proceeding to add station %pM\n", sta->addr); | 2996 | D_INFO("station %pM\n", sta->addr); |
2995 | sta_priv->common.sta_id = IL_INVALID_STATION; | 2997 | sta_priv->common.sta_id = IL_INVALID_STATION; |
2996 | 2998 | ||
2997 | ret = il_add_station_common(il, sta->addr, is_ap, sta, &sta_id); | 2999 | ret = il_add_station_common(il, sta->addr, is_ap, sta, &sta_id); |
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index 21b355a9171f..0d1a643d8b91 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -1523,12 +1523,13 @@ il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1523 | struct il_priv *il = hw->priv; | 1523 | struct il_priv *il = hw->priv; |
1524 | int ret; | 1524 | int ret; |
1525 | 1525 | ||
1526 | D_MAC80211("enter\n"); | 1526 | if (req->n_channels == 0) { |
1527 | 1527 | IL_ERR("Can not scan on no channels.\n"); | |
1528 | if (req->n_channels == 0) | ||
1529 | return -EINVAL; | 1528 | return -EINVAL; |
1529 | } | ||
1530 | 1530 | ||
1531 | mutex_lock(&il->mutex); | 1531 | mutex_lock(&il->mutex); |
1532 | D_MAC80211("enter\n"); | ||
1532 | 1533 | ||
1533 | if (test_bit(S_SCANNING, &il->status)) { | 1534 | if (test_bit(S_SCANNING, &il->status)) { |
1534 | D_SCAN("Scan already in progress.\n"); | 1535 | D_SCAN("Scan already in progress.\n"); |
@@ -1543,9 +1544,8 @@ il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1543 | 1544 | ||
1544 | ret = il_scan_initiate(il, vif); | 1545 | ret = il_scan_initiate(il, vif); |
1545 | 1546 | ||
1546 | D_MAC80211("leave\n"); | ||
1547 | |||
1548 | out_unlock: | 1547 | out_unlock: |
1548 | D_MAC80211("leave ret %d\n", ret); | ||
1549 | mutex_unlock(&il->mutex); | 1549 | mutex_unlock(&il->mutex); |
1550 | 1550 | ||
1551 | return ret; | 1551 | return ret; |
@@ -2413,13 +2413,16 @@ il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
2413 | struct il_station_priv_common *sta_common = (void *)sta->drv_priv; | 2413 | struct il_station_priv_common *sta_common = (void *)sta->drv_priv; |
2414 | int ret; | 2414 | int ret; |
2415 | 2415 | ||
2416 | D_INFO("received request to remove station %pM\n", sta->addr); | ||
2417 | mutex_lock(&il->mutex); | 2416 | mutex_lock(&il->mutex); |
2418 | D_INFO("proceeding to remove station %pM\n", sta->addr); | 2417 | D_MAC80211("enter station %pM\n", sta->addr); |
2418 | |||
2419 | ret = il_remove_station(il, sta_common->sta_id, sta->addr); | 2419 | ret = il_remove_station(il, sta_common->sta_id, sta->addr); |
2420 | if (ret) | 2420 | if (ret) |
2421 | IL_ERR("Error removing station %pM\n", sta->addr); | 2421 | IL_ERR("Error removing station %pM\n", sta->addr); |
2422 | |||
2423 | D_MAC80211("leave ret %d\n", ret); | ||
2422 | mutex_unlock(&il->mutex); | 2424 | mutex_unlock(&il->mutex); |
2425 | |||
2423 | return ret; | 2426 | return ret; |
2424 | } | 2427 | } |
2425 | EXPORT_SYMBOL(il_mac_sta_remove); | 2428 | EXPORT_SYMBOL(il_mac_sta_remove); |
@@ -4459,8 +4462,14 @@ int | |||
4459 | il_mac_tx_last_beacon(struct ieee80211_hw *hw) | 4462 | il_mac_tx_last_beacon(struct ieee80211_hw *hw) |
4460 | { | 4463 | { |
4461 | struct il_priv *il = hw->priv; | 4464 | struct il_priv *il = hw->priv; |
4465 | int ret; | ||
4462 | 4466 | ||
4463 | return il->ibss_manager == IL_IBSS_MANAGER; | 4467 | D_MAC80211("enter\n"); |
4468 | |||
4469 | ret = (il->ibss_manager == IL_IBSS_MANAGER); | ||
4470 | |||
4471 | D_MAC80211("leave ret %d\n", ret); | ||
4472 | return ret; | ||
4464 | } | 4473 | } |
4465 | EXPORT_SYMBOL_GPL(il_mac_tx_last_beacon); | 4474 | EXPORT_SYMBOL_GPL(il_mac_tx_last_beacon); |
4466 | 4475 | ||
@@ -4481,9 +4490,8 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4481 | struct il_priv *il = hw->priv; | 4490 | struct il_priv *il = hw->priv; |
4482 | int err; | 4491 | int err; |
4483 | 4492 | ||
4484 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); | ||
4485 | |||
4486 | mutex_lock(&il->mutex); | 4493 | mutex_lock(&il->mutex); |
4494 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); | ||
4487 | 4495 | ||
4488 | if (!il_is_ready_rf(il)) { | 4496 | if (!il_is_ready_rf(il)) { |
4489 | IL_WARN("Try to add interface when device not ready\n"); | 4497 | IL_WARN("Try to add interface when device not ready\n"); |
@@ -4506,9 +4514,9 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4506 | } | 4514 | } |
4507 | 4515 | ||
4508 | out: | 4516 | out: |
4517 | D_MAC80211("leave err %d\n", err); | ||
4509 | mutex_unlock(&il->mutex); | 4518 | mutex_unlock(&il->mutex); |
4510 | 4519 | ||
4511 | D_MAC80211("leave\n"); | ||
4512 | return err; | 4520 | return err; |
4513 | } | 4521 | } |
4514 | EXPORT_SYMBOL(il_mac_add_interface); | 4522 | EXPORT_SYMBOL(il_mac_add_interface); |
@@ -4534,20 +4542,17 @@ il_mac_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4534 | { | 4542 | { |
4535 | struct il_priv *il = hw->priv; | 4543 | struct il_priv *il = hw->priv; |
4536 | 4544 | ||
4537 | D_MAC80211("enter\n"); | ||
4538 | |||
4539 | mutex_lock(&il->mutex); | 4545 | mutex_lock(&il->mutex); |
4546 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); | ||
4540 | 4547 | ||
4541 | WARN_ON(il->vif != vif); | 4548 | WARN_ON(il->vif != vif); |
4542 | il->vif = NULL; | 4549 | il->vif = NULL; |
4543 | 4550 | ||
4544 | il_teardown_interface(il, vif, false); | 4551 | il_teardown_interface(il, vif, false); |
4545 | |||
4546 | memset(il->bssid, 0, ETH_ALEN); | 4552 | memset(il->bssid, 0, ETH_ALEN); |
4547 | mutex_unlock(&il->mutex); | ||
4548 | 4553 | ||
4549 | D_MAC80211("leave\n"); | 4554 | D_MAC80211("leave\n"); |
4550 | 4555 | mutex_unlock(&il->mutex); | |
4551 | } | 4556 | } |
4552 | EXPORT_SYMBOL(il_mac_remove_interface); | 4557 | EXPORT_SYMBOL(il_mac_remove_interface); |
4553 | 4558 | ||
@@ -4633,10 +4638,14 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
4633 | struct il_priv *il = hw->priv; | 4638 | struct il_priv *il = hw->priv; |
4634 | int err; | 4639 | int err; |
4635 | 4640 | ||
4636 | if (newp2p) | ||
4637 | return -EOPNOTSUPP; | ||
4638 | |||
4639 | mutex_lock(&il->mutex); | 4641 | mutex_lock(&il->mutex); |
4642 | D_MAC80211("enter: type %d, addr %pM newtype %d newp2p %d\n", | ||
4643 | vif->type, vif->addr, newtype, newp2p); | ||
4644 | |||
4645 | if (newp2p) { | ||
4646 | err = -EOPNOTSUPP; | ||
4647 | goto out; | ||
4648 | } | ||
4640 | 4649 | ||
4641 | if (!il->vif || !il_is_ready_rf(il)) { | 4650 | if (!il->vif || !il_is_ready_rf(il)) { |
4642 | /* | 4651 | /* |
@@ -4663,7 +4672,9 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
4663 | err = 0; | 4672 | err = 0; |
4664 | 4673 | ||
4665 | out: | 4674 | out: |
4675 | D_MAC80211("leave err %d\n", err); | ||
4666 | mutex_unlock(&il->mutex); | 4676 | mutex_unlock(&il->mutex); |
4677 | |||
4667 | return err; | 4678 | return err; |
4668 | } | 4679 | } |
4669 | EXPORT_SYMBOL(il_mac_change_interface); | 4680 | EXPORT_SYMBOL(il_mac_change_interface); |
@@ -4922,8 +4933,7 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
4922 | bool ht_changed = false; | 4933 | bool ht_changed = false; |
4923 | 4934 | ||
4924 | mutex_lock(&il->mutex); | 4935 | mutex_lock(&il->mutex); |
4925 | 4936 | D_MAC80211("enter: channel %d changed 0x%X\n", channel->hw_value, | |
4926 | D_MAC80211("enter to channel %d changed 0x%X\n", channel->hw_value, | ||
4927 | changed); | 4937 | changed); |
4928 | 4938 | ||
4929 | if (unlikely(test_bit(S_SCANNING, &il->status))) { | 4939 | if (unlikely(test_bit(S_SCANNING, &il->status))) { |
@@ -5052,8 +5062,9 @@ set_ch_out: | |||
5052 | il_update_qos(il); | 5062 | il_update_qos(il); |
5053 | 5063 | ||
5054 | out: | 5064 | out: |
5055 | D_MAC80211("leave\n"); | 5065 | D_MAC80211("leave ret %d\n", ret); |
5056 | mutex_unlock(&il->mutex); | 5066 | mutex_unlock(&il->mutex); |
5067 | |||
5057 | return ret; | 5068 | return ret; |
5058 | } | 5069 | } |
5059 | EXPORT_SYMBOL(il_mac_config); | 5070 | EXPORT_SYMBOL(il_mac_config); |
@@ -5065,20 +5076,16 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
5065 | unsigned long flags; | 5076 | unsigned long flags; |
5066 | 5077 | ||
5067 | mutex_lock(&il->mutex); | 5078 | mutex_lock(&il->mutex); |
5068 | D_MAC80211("enter\n"); | 5079 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); |
5069 | 5080 | ||
5070 | spin_lock_irqsave(&il->lock, flags); | 5081 | spin_lock_irqsave(&il->lock, flags); |
5071 | memset(&il->current_ht_config, 0, sizeof(struct il_ht_config)); | ||
5072 | spin_unlock_irqrestore(&il->lock, flags); | ||
5073 | 5082 | ||
5074 | spin_lock_irqsave(&il->lock, flags); | 5083 | memset(&il->current_ht_config, 0, sizeof(struct il_ht_config)); |
5075 | 5084 | ||
5076 | /* new association get rid of ibss beacon skb */ | 5085 | /* new association get rid of ibss beacon skb */ |
5077 | if (il->beacon_skb) | 5086 | if (il->beacon_skb) |
5078 | dev_kfree_skb(il->beacon_skb); | 5087 | dev_kfree_skb(il->beacon_skb); |
5079 | |||
5080 | il->beacon_skb = NULL; | 5088 | il->beacon_skb = NULL; |
5081 | |||
5082 | il->timestamp = 0; | 5089 | il->timestamp = 0; |
5083 | 5090 | ||
5084 | spin_unlock_irqrestore(&il->lock, flags); | 5091 | spin_unlock_irqrestore(&il->lock, flags); |
@@ -5090,17 +5097,14 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
5090 | return; | 5097 | return; |
5091 | } | 5098 | } |
5092 | 5099 | ||
5093 | /* we are restarting association process | 5100 | /* we are restarting association process */ |
5094 | * clear RXON_FILTER_ASSOC_MSK bit | ||
5095 | */ | ||
5096 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 5101 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
5097 | il_commit_rxon(il); | 5102 | il_commit_rxon(il); |
5098 | 5103 | ||
5099 | il_set_rate(il); | 5104 | il_set_rate(il); |
5100 | 5105 | ||
5101 | mutex_unlock(&il->mutex); | ||
5102 | |||
5103 | D_MAC80211("leave\n"); | 5106 | D_MAC80211("leave\n"); |
5107 | mutex_unlock(&il->mutex); | ||
5104 | } | 5108 | } |
5105 | EXPORT_SYMBOL(il_mac_reset_tsf); | 5109 | EXPORT_SYMBOL(il_mac_reset_tsf); |
5106 | 5110 | ||
@@ -5226,11 +5230,11 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5226 | struct il_priv *il = hw->priv; | 5230 | struct il_priv *il = hw->priv; |
5227 | int ret; | 5231 | int ret; |
5228 | 5232 | ||
5229 | D_MAC80211("changes = 0x%X\n", changes); | ||
5230 | |||
5231 | mutex_lock(&il->mutex); | 5233 | mutex_lock(&il->mutex); |
5234 | D_MAC80211("enter: changes 0x%x\n", changes); | ||
5232 | 5235 | ||
5233 | if (!il_is_alive(il)) { | 5236 | if (!il_is_alive(il)) { |
5237 | D_MAC80211("leave - not alive\n"); | ||
5234 | mutex_unlock(&il->mutex); | 5238 | mutex_unlock(&il->mutex); |
5235 | return; | 5239 | return; |
5236 | } | 5240 | } |
@@ -5261,8 +5265,7 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5261 | * below/in post_associate will fail. | 5265 | * below/in post_associate will fail. |
5262 | */ | 5266 | */ |
5263 | if (il_scan_cancel_timeout(il, 100)) { | 5267 | if (il_scan_cancel_timeout(il, 100)) { |
5264 | IL_WARN("Aborted scan still in progress after 100ms\n"); | 5268 | D_MAC80211("leave - scan abort failed\n"); |
5265 | D_MAC80211("leaving - scan abort failed.\n"); | ||
5266 | mutex_unlock(&il->mutex); | 5269 | mutex_unlock(&il->mutex); |
5267 | return; | 5270 | return; |
5268 | } | 5271 | } |
@@ -5274,10 +5277,8 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5274 | 5277 | ||
5275 | /* currently needed in a few places */ | 5278 | /* currently needed in a few places */ |
5276 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); | 5279 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); |
5277 | } else { | 5280 | } else |
5278 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 5281 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
5279 | } | ||
5280 | |||
5281 | } | 5282 | } |
5282 | 5283 | ||
5283 | /* | 5284 | /* |
@@ -5364,18 +5365,16 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5364 | } | 5365 | } |
5365 | 5366 | ||
5366 | if (changes & BSS_CHANGED_IBSS) { | 5367 | if (changes & BSS_CHANGED_IBSS) { |
5367 | ret = | 5368 | ret = il->ops->manage_ibss_station(il, vif, |
5368 | il->ops->manage_ibss_station(il, vif, | 5369 | bss_conf->ibss_joined); |
5369 | bss_conf->ibss_joined); | ||
5370 | if (ret) | 5370 | if (ret) |
5371 | IL_ERR("failed to %s IBSS station %pM\n", | 5371 | IL_ERR("failed to %s IBSS station %pM\n", |
5372 | bss_conf->ibss_joined ? "add" : "remove", | 5372 | bss_conf->ibss_joined ? "add" : "remove", |
5373 | bss_conf->bssid); | 5373 | bss_conf->bssid); |
5374 | } | 5374 | } |
5375 | 5375 | ||
5376 | mutex_unlock(&il->mutex); | ||
5377 | |||
5378 | D_MAC80211("leave\n"); | 5376 | D_MAC80211("leave\n"); |
5377 | mutex_unlock(&il->mutex); | ||
5379 | } | 5378 | } |
5380 | EXPORT_SYMBOL(il_mac_bss_info_changed); | 5379 | EXPORT_SYMBOL(il_mac_bss_info_changed); |
5381 | 5380 | ||