aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-06-30 09:10:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-02 15:48:33 -0400
commitf4ea83dd743d3e1bec8fdf954ac911c6b12ae87a (patch)
tree2db594d668648779e1932981410e37258df76b2c /net/mac80211/main.c
parent49461622edf74cd1e1a1056cee3ca8dd90cd9556 (diff)
mac80211: rework debug settings and make debugging safer
This patch reworks the mac80211 debug settings making them more focused and adding help text for those that didn't have one. It also removes a number of printks that can be triggered remotely and add no value, e.g. "too short deauthentication frame received - ignoring". If somebody really needs to debug that they should just add a monitor interface and look at the frames in wireshark. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index b661ee5bb82..f18cfd72787 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -151,9 +151,7 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
151 /* FIX: what would be proper limits for MTU? 151 /* FIX: what would be proper limits for MTU?
152 * This interface uses 802.3 frames. */ 152 * This interface uses 802.3 frames. */
153 if (new_mtu < 256 || 153 if (new_mtu < 256 ||
154 new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) { 154 new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) {
155 printk(KERN_WARNING "%s: invalid MTU %d\n",
156 dev->name, new_mtu);
157 return -EINVAL; 155 return -EINVAL;
158 } 156 }
159 157
@@ -589,7 +587,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
589 587
590 sta = sta_info_get(local, ra); 588 sta = sta_info_get(local, ra);
591 if (!sta) { 589 if (!sta) {
590#ifdef CONFIG_MAC80211_HT_DEBUG
592 printk(KERN_DEBUG "Could not find the station\n"); 591 printk(KERN_DEBUG "Could not find the station\n");
592#endif
593 ret = -ENOENT; 593 ret = -ENOENT;
594 goto exit; 594 goto exit;
595 } 595 }
@@ -617,9 +617,11 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
617 sta->ampdu_mlme.tid_tx[tid] = 617 sta->ampdu_mlme.tid_tx[tid] =
618 kmalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC); 618 kmalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC);
619 if (!sta->ampdu_mlme.tid_tx[tid]) { 619 if (!sta->ampdu_mlme.tid_tx[tid]) {
620#ifdef CONFIG_MAC80211_HT_DEBUG
620 if (net_ratelimit()) 621 if (net_ratelimit())
621 printk(KERN_ERR "allocate tx mlme to tid %d failed\n", 622 printk(KERN_ERR "allocate tx mlme to tid %d failed\n",
622 tid); 623 tid);
624#endif
623 ret = -ENOMEM; 625 ret = -ENOMEM;
624 goto err_unlock_sta; 626 goto err_unlock_sta;
625 } 627 }
@@ -689,7 +691,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
689 sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer.expires = 691 sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer.expires =
690 jiffies + ADDBA_RESP_INTERVAL; 692 jiffies + ADDBA_RESP_INTERVAL;
691 add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); 693 add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
694#ifdef CONFIG_MAC80211_HT_DEBUG
692 printk(KERN_DEBUG "activated addBA response timer on tid %d\n", tid); 695 printk(KERN_DEBUG "activated addBA response timer on tid %d\n", tid);
696#endif
693 goto exit; 697 goto exit;
694 698
695err_unlock_queue: 699err_unlock_queue:
@@ -771,8 +775,10 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
771 DECLARE_MAC_BUF(mac); 775 DECLARE_MAC_BUF(mac);
772 776
773 if (tid >= STA_TID_NUM) { 777 if (tid >= STA_TID_NUM) {
778#ifdef CONFIG_MAC80211_HT_DEBUG
774 printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", 779 printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n",
775 tid, STA_TID_NUM); 780 tid, STA_TID_NUM);
781#endif
776 return; 782 return;
777 } 783 }
778 784
@@ -780,8 +786,10 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
780 sta = sta_info_get(local, ra); 786 sta = sta_info_get(local, ra);
781 if (!sta) { 787 if (!sta) {
782 rcu_read_unlock(); 788 rcu_read_unlock();
789#ifdef CONFIG_MAC80211_HT_DEBUG
783 printk(KERN_DEBUG "Could not find station: %s\n", 790 printk(KERN_DEBUG "Could not find station: %s\n",
784 print_mac(mac, ra)); 791 print_mac(mac, ra));
792#endif
785 return; 793 return;
786 } 794 }
787 795
@@ -789,8 +797,10 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
789 spin_lock_bh(&sta->lock); 797 spin_lock_bh(&sta->lock);
790 798
791 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 799 if (!(*state & HT_ADDBA_REQUESTED_MSK)) {
800#ifdef CONFIG_MAC80211_HT_DEBUG
792 printk(KERN_DEBUG "addBA was not requested yet, state is %d\n", 801 printk(KERN_DEBUG "addBA was not requested yet, state is %d\n",
793 *state); 802 *state);
803#endif
794 spin_unlock_bh(&sta->lock); 804 spin_unlock_bh(&sta->lock);
795 rcu_read_unlock(); 805 rcu_read_unlock();
796 return; 806 return;
@@ -801,7 +811,9 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
801 *state |= HT_ADDBA_DRV_READY_MSK; 811 *state |= HT_ADDBA_DRV_READY_MSK;
802 812
803 if (*state == HT_AGG_STATE_OPERATIONAL) { 813 if (*state == HT_AGG_STATE_OPERATIONAL) {
814#ifdef CONFIG_MAC80211_HT_DEBUG
804 printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid); 815 printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid);
816#endif
805 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); 817 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]);
806 } 818 }
807 spin_unlock_bh(&sta->lock); 819 spin_unlock_bh(&sta->lock);
@@ -818,8 +830,10 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
818 DECLARE_MAC_BUF(mac); 830 DECLARE_MAC_BUF(mac);
819 831
820 if (tid >= STA_TID_NUM) { 832 if (tid >= STA_TID_NUM) {
833#ifdef CONFIG_MAC80211_HT_DEBUG
821 printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", 834 printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n",
822 tid, STA_TID_NUM); 835 tid, STA_TID_NUM);
836#endif
823 return; 837 return;
824 } 838 }
825 839
@@ -831,8 +845,10 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
831 rcu_read_lock(); 845 rcu_read_lock();
832 sta = sta_info_get(local, ra); 846 sta = sta_info_get(local, ra);
833 if (!sta) { 847 if (!sta) {
848#ifdef CONFIG_MAC80211_HT_DEBUG
834 printk(KERN_DEBUG "Could not find station: %s\n", 849 printk(KERN_DEBUG "Could not find station: %s\n",
835 print_mac(mac, ra)); 850 print_mac(mac, ra));
851#endif
836 rcu_read_unlock(); 852 rcu_read_unlock();
837 return; 853 return;
838 } 854 }
@@ -842,7 +858,9 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
842 * ieee80211_stop_tx_ba_session will let only 858 * ieee80211_stop_tx_ba_session will let only
843 * one stop call to pass through per sta/tid */ 859 * one stop call to pass through per sta/tid */
844 if ((*state & HT_AGG_STATE_REQ_STOP_BA_MSK) == 0) { 860 if ((*state & HT_AGG_STATE_REQ_STOP_BA_MSK) == 0) {
861#ifdef CONFIG_MAC80211_HT_DEBUG
845 printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n"); 862 printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n");
863#endif
846 rcu_read_unlock(); 864 rcu_read_unlock();
847 return; 865 return;
848 } 866 }
@@ -884,9 +902,11 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw,
884 struct sk_buff *skb = dev_alloc_skb(0); 902 struct sk_buff *skb = dev_alloc_skb(0);
885 903
886 if (unlikely(!skb)) { 904 if (unlikely(!skb)) {
905#ifdef CONFIG_MAC80211_HT_DEBUG
887 if (net_ratelimit()) 906 if (net_ratelimit())
888 printk(KERN_WARNING "%s: Not enough memory, " 907 printk(KERN_WARNING "%s: Not enough memory, "
889 "dropping start BA session", skb->dev->name); 908 "dropping start BA session", skb->dev->name);
909#endif
890 return; 910 return;
891 } 911 }
892 ra_tid = (struct ieee80211_ra_tid *) &skb->cb; 912 ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
@@ -907,9 +927,11 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw,
907 struct sk_buff *skb = dev_alloc_skb(0); 927 struct sk_buff *skb = dev_alloc_skb(0);
908 928
909 if (unlikely(!skb)) { 929 if (unlikely(!skb)) {
930#ifdef CONFIG_MAC80211_HT_DEBUG
910 if (net_ratelimit()) 931 if (net_ratelimit())
911 printk(KERN_WARNING "%s: Not enough memory, " 932 printk(KERN_WARNING "%s: Not enough memory, "
912 "dropping stop BA session", skb->dev->name); 933 "dropping stop BA session", skb->dev->name);
934#endif
913 return; 935 return;
914 } 936 }
915 ra_tid = (struct ieee80211_ra_tid *) &skb->cb; 937 ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
@@ -1236,9 +1258,8 @@ static void ieee80211_tasklet_handler(unsigned long data)
1236 ra_tid->ra, ra_tid->tid); 1258 ra_tid->ra, ra_tid->tid);
1237 dev_kfree_skb(skb); 1259 dev_kfree_skb(skb);
1238 break ; 1260 break ;
1239 default: /* should never get here! */ 1261 default:
1240 printk(KERN_ERR "%s: Unknown message type (%d)\n", 1262 WARN_ON(1);
1241 wiphy_name(local->hw.wiphy), skb->pkt_type);
1242 dev_kfree_skb(skb); 1263 dev_kfree_skb(skb);
1243 break; 1264 break;
1244 } 1265 }
@@ -1365,12 +1386,14 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
1365 return; 1386 return;
1366 } 1387 }
1367 1388
1389#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1368 if (net_ratelimit()) 1390 if (net_ratelimit())
1369 printk(KERN_DEBUG "%s: dropped TX filtered frame, " 1391 printk(KERN_DEBUG "%s: dropped TX filtered frame, "
1370 "queue_len=%d PS=%d @%lu\n", 1392 "queue_len=%d PS=%d @%lu\n",
1371 wiphy_name(local->hw.wiphy), 1393 wiphy_name(local->hw.wiphy),
1372 skb_queue_len(&sta->tx_filtered), 1394 skb_queue_len(&sta->tx_filtered),
1373 !!test_sta_flags(sta, WLAN_STA_PS), jiffies); 1395 !!test_sta_flags(sta, WLAN_STA_PS), jiffies);
1396#endif
1374 dev_kfree_skb(skb); 1397 dev_kfree_skb(skb);
1375} 1398}
1376 1399