aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/base.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:26:39 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:26:39 -0500
commit8926574c4d0055ca4c4a02d1f6b2c249d01a0621 (patch)
tree0c02c3cfff77e868d605246204add4664503b2af /drivers/net/wireless/rtlwifi/base.c
parentc056b734e54e12f38f34a2583a4824e6cecc16c1 (diff)
parentb0302aba812bcc39291cdab9ad7e37008f352a91 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: drivers/net/wireless/rtlwifi/rtl8192se/sw.c
Diffstat (limited to 'drivers/net/wireless/rtlwifi/base.c')
-rw-r--r--drivers/net/wireless/rtlwifi/base.c67
1 files changed, 32 insertions, 35 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 8d6eb0f56c03..df5655cc55c0 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -27,10 +27,6 @@
27 * 27 *
28 *****************************************************************************/ 28 *****************************************************************************/
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
32#include <linux/ip.h>
33#include <linux/module.h>
34#include "wifi.h" 30#include "wifi.h"
35#include "rc.h" 31#include "rc.h"
36#include "base.h" 32#include "base.h"
@@ -39,6 +35,9 @@
39#include "ps.h" 35#include "ps.h"
40#include "regd.h" 36#include "regd.h"
41 37
38#include <linux/ip.h>
39#include <linux/module.h>
40
42/* 41/*
43 *NOTICE!!!: This file will be very big, we hsould 42 *NOTICE!!!: This file will be very big, we hsould
44 *keep it clear under follwing roles: 43 *keep it clear under follwing roles:
@@ -211,7 +210,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
211 */ 210 */
212 if (get_rf_type(rtlphy) == RF_1T2R || get_rf_type(rtlphy) == RF_2T2R) { 211 if (get_rf_type(rtlphy) == RF_1T2R || get_rf_type(rtlphy) == RF_2T2R) {
213 212
214 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("1T2R or 2T2R\n")); 213 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "1T2R or 2T2R\n");
215 214
216 ht_cap->mcs.rx_mask[0] = 0xFF; 215 ht_cap->mcs.rx_mask[0] = 0xFF;
217 ht_cap->mcs.rx_mask[1] = 0xFF; 216 ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -220,7 +219,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
220 ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15); 219 ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15);
221 } else if (get_rf_type(rtlphy) == RF_1T1R) { 220 } else if (get_rf_type(rtlphy) == RF_1T1R) {
222 221
223 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("1T1R\n")); 222 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "1T1R\n");
224 223
225 ht_cap->mcs.rx_mask[0] = 0xFF; 224 ht_cap->mcs.rx_mask[0] = 0xFF;
226 ht_cap->mcs.rx_mask[1] = 0x00; 225 ht_cap->mcs.rx_mask[1] = 0x00;
@@ -302,15 +301,13 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
302 /* <4> set mac->sband to wiphy->sband */ 301 /* <4> set mac->sband to wiphy->sband */
303 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband; 302 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
304 } else { 303 } else {
305 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 304 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
306 ("Err BAND %d\n", 305 rtlhal->current_bandtype);
307 rtlhal->current_bandtype));
308 } 306 }
309 } 307 }
310 /* <5> set hw caps */ 308 /* <5> set hw caps */
311 hw->flags = IEEE80211_HW_SIGNAL_DBM | 309 hw->flags = IEEE80211_HW_SIGNAL_DBM |
312 IEEE80211_HW_RX_INCLUDES_FCS | 310 IEEE80211_HW_RX_INCLUDES_FCS |
313 IEEE80211_HW_BEACON_FILTER |
314 IEEE80211_HW_AMPDU_AGGREGATION | 311 IEEE80211_HW_AMPDU_AGGREGATION |
315 IEEE80211_HW_CONNECTION_MONITOR | 312 IEEE80211_HW_CONNECTION_MONITOR |
316 /* IEEE80211_HW_SUPPORTS_CQM_RSSI | */ 313 /* IEEE80211_HW_SUPPORTS_CQM_RSSI | */
@@ -413,6 +410,7 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
413 410
414 wiphy_rfkill_start_polling(hw->wiphy); 411 wiphy_rfkill_start_polling(hw->wiphy);
415} 412}
413EXPORT_SYMBOL(rtl_init_rfkill);
416 414
417void rtl_deinit_rfkill(struct ieee80211_hw *hw) 415void rtl_deinit_rfkill(struct ieee80211_hw *hw)
418{ 416{
@@ -436,13 +434,13 @@ int rtl_init_core(struct ieee80211_hw *hw)
436 * mac80211 hw in _rtl_init_mac80211. 434 * mac80211 hw in _rtl_init_mac80211.
437 */ 435 */
438 if (rtl_regd_init(hw, rtl_reg_notifier)) { 436 if (rtl_regd_init(hw, rtl_reg_notifier)) {
439 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("REGD init failed\n")); 437 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
440 return 1; 438 return 1;
441 } else { 439 } else {
442 /* CRDA regd hint must after init CRDA */ 440 /* CRDA regd hint must after init CRDA */
443 if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) { 441 if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) {
444 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 442 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
445 ("regulatory_hint fail\n")); 443 "regulatory_hint fail\n");
446 } 444 }
447 } 445 }
448 446
@@ -922,17 +920,17 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
922 return false; 920 return false;
923 921
924 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 922 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
925 ("%s ACT_ADDBAREQ From :%pM\n", 923 "%s ACT_ADDBAREQ From :%pM\n",
926 is_tx ? "Tx" : "Rx", hdr->addr2)); 924 is_tx ? "Tx" : "Rx", hdr->addr2);
927 break; 925 break;
928 case ACT_ADDBARSP: 926 case ACT_ADDBARSP:
929 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 927 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
930 ("%s ACT_ADDBARSP From :%pM\n", 928 "%s ACT_ADDBARSP From :%pM\n",
931 is_tx ? "Tx" : "Rx", hdr->addr2)); 929 is_tx ? "Tx" : "Rx", hdr->addr2);
932 break; 930 break;
933 case ACT_DELBA: 931 case ACT_DELBA:
934 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 932 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
935 ("ACT_ADDBADEL From :%pM\n", hdr->addr2)); 933 "ACT_ADDBADEL From :%pM\n", hdr->addr2);
936 break; 934 break;
937 } 935 }
938 break; 936 break;
@@ -975,8 +973,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
975 * 67 : UDP BOOTP server 973 * 67 : UDP BOOTP server
976 */ 974 */
977 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), 975 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV),
978 DBG_DMESG, ("dhcp %s !!\n", 976 DBG_DMESG, "dhcp %s !!\n",
979 (is_tx) ? "Tx" : "Rx")); 977 is_tx ? "Tx" : "Rx");
980 978
981 if (is_tx) { 979 if (is_tx) {
982 rtl_lps_leave(hw); 980 rtl_lps_leave(hw);
@@ -996,7 +994,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
996 return true; 994 return true;
997 } else if (ETH_P_PAE == ether_type) { 995 } else if (ETH_P_PAE == ether_type) {
998 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 996 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
999 ("802.1X %s EAPOL pkt!!\n", (is_tx) ? "Tx" : "Rx")); 997 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");
1000 998
1001 if (is_tx) { 999 if (is_tx) {
1002 rtl_lps_leave(hw); 1000 rtl_lps_leave(hw);
@@ -1036,9 +1034,8 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw,
1036 return -ENXIO; 1034 return -ENXIO;
1037 tid_data = &sta_entry->tids[tid]; 1035 tid_data = &sta_entry->tids[tid];
1038 1036
1039 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, 1037 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "on ra = %pM tid = %d seq:%d\n",
1040 ("on ra = %pM tid = %d seq:%d\n", sta->addr, tid, 1038 sta->addr, tid, tid_data->seq_number);
1041 tid_data->seq_number));
1042 1039
1043 *ssn = tid_data->seq_number; 1040 *ssn = tid_data->seq_number;
1044 tid_data->agg.agg_state = RTL_AGG_START; 1041 tid_data->agg.agg_state = RTL_AGG_START;
@@ -1059,12 +1056,12 @@ int rtl_tx_agg_stop(struct ieee80211_hw *hw,
1059 return -EINVAL; 1056 return -EINVAL;
1060 1057
1061 if (!sta->addr) { 1058 if (!sta->addr) {
1062 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("ra = NULL\n")); 1059 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "ra = NULL\n");
1063 return -EINVAL; 1060 return -EINVAL;
1064 } 1061 }
1065 1062
1066 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, 1063 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "on ra = %pM tid = %d\n",
1067 ("on ra = %pM tid = %d\n", sta->addr, tid)); 1064 sta->addr, tid);
1068 1065
1069 if (unlikely(tid >= MAX_TID_COUNT)) 1066 if (unlikely(tid >= MAX_TID_COUNT))
1070 return -EINVAL; 1067 return -EINVAL;
@@ -1087,12 +1084,12 @@ int rtl_tx_agg_oper(struct ieee80211_hw *hw,
1087 return -EINVAL; 1084 return -EINVAL;
1088 1085
1089 if (!sta->addr) { 1086 if (!sta->addr) {
1090 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("ra = NULL\n")); 1087 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "ra = NULL\n");
1091 return -EINVAL; 1088 return -EINVAL;
1092 } 1089 }
1093 1090
1094 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, 1091 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "on ra = %pM tid = %d\n",
1095 ("on ra = %pM tid = %d\n", sta->addr, tid)); 1092 sta->addr, tid);
1096 1093
1097 if (unlikely(tid >= MAX_TID_COUNT)) 1094 if (unlikely(tid >= MAX_TID_COUNT))
1098 return -EINVAL; 1095 return -EINVAL;
@@ -1474,29 +1471,29 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len)
1474 (memcmp(mac->bssid, ap5_6, 3) == 0) || 1471 (memcmp(mac->bssid, ap5_6, 3) == 0) ||
1475 vendor == PEER_ATH) { 1472 vendor == PEER_ATH) {
1476 vendor = PEER_ATH; 1473 vendor = PEER_ATH;
1477 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>ath find\n")); 1474 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>ath find\n");
1478 } else if ((memcmp(mac->bssid, ap4_4, 3) == 0) || 1475 } else if ((memcmp(mac->bssid, ap4_4, 3) == 0) ||
1479 (memcmp(mac->bssid, ap4_5, 3) == 0) || 1476 (memcmp(mac->bssid, ap4_5, 3) == 0) ||
1480 (memcmp(mac->bssid, ap4_1, 3) == 0) || 1477 (memcmp(mac->bssid, ap4_1, 3) == 0) ||
1481 (memcmp(mac->bssid, ap4_2, 3) == 0) || 1478 (memcmp(mac->bssid, ap4_2, 3) == 0) ||
1482 (memcmp(mac->bssid, ap4_3, 3) == 0) || 1479 (memcmp(mac->bssid, ap4_3, 3) == 0) ||
1483 vendor == PEER_RAL) { 1480 vendor == PEER_RAL) {
1484 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>ral findn\n")); 1481 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>ral find\n");
1485 vendor = PEER_RAL; 1482 vendor = PEER_RAL;
1486 } else if (memcmp(mac->bssid, ap6_1, 3) == 0 || 1483 } else if (memcmp(mac->bssid, ap6_1, 3) == 0 ||
1487 vendor == PEER_CISCO) { 1484 vendor == PEER_CISCO) {
1488 vendor = PEER_CISCO; 1485 vendor = PEER_CISCO;
1489 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>cisco find\n")); 1486 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>cisco find\n");
1490 } else if ((memcmp(mac->bssid, ap3_1, 3) == 0) || 1487 } else if ((memcmp(mac->bssid, ap3_1, 3) == 0) ||
1491 (memcmp(mac->bssid, ap3_2, 3) == 0) || 1488 (memcmp(mac->bssid, ap3_2, 3) == 0) ||
1492 (memcmp(mac->bssid, ap3_3, 3) == 0) || 1489 (memcmp(mac->bssid, ap3_3, 3) == 0) ||
1493 vendor == PEER_BROAD) { 1490 vendor == PEER_BROAD) {
1494 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>broad find\n")); 1491 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>broad find\n");
1495 vendor = PEER_BROAD; 1492 vendor = PEER_BROAD;
1496 } else if (memcmp(mac->bssid, ap7_1, 3) == 0 || 1493 } else if (memcmp(mac->bssid, ap7_1, 3) == 0 ||
1497 vendor == PEER_MARV) { 1494 vendor == PEER_MARV) {
1498 vendor = PEER_MARV; 1495 vendor = PEER_MARV;
1499 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>marv find\n")); 1496 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>marv find\n");
1500 } 1497 }
1501 1498
1502 mac->vendor = vendor; 1499 mac->vendor = vendor;