diff options
author | James Morris <james.l.morris@oracle.com> | 2014-06-24 18:46:07 +1000 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2014-06-24 18:46:07 +1000 |
commit | f01387d2693813eb5271a3448e6a082322c7d75d (patch) | |
tree | b591ca73c85276bae53d7db57ff1565be45a29da /drivers/staging/rtl8821ae | |
parent | Merge branch 'next' of git://git.infradead.org/users/pcmoore/selinux into next (diff) | |
parent | Linux 3.15 (diff) | |
download | linux-dev-f01387d2693813eb5271a3448e6a082322c7d75d.tar.xz linux-dev-f01387d2693813eb5271a3448e6a082322c7d75d.zip |
Merge commit 'v3.15' into next
Diffstat (limited to 'drivers/staging/rtl8821ae')
33 files changed, 597 insertions, 604 deletions
diff --git a/drivers/staging/rtl8821ae/base.c b/drivers/staging/rtl8821ae/base.c index 18c936fbdf1e..a4c9cc437bc6 100644 --- a/drivers/staging/rtl8821ae/base.c +++ b/drivers/staging/rtl8821ae/base.c @@ -39,10 +39,10 @@ #include "pci.h" /* - *NOTICE!!!: This file will be very big, we hsould - *keep it clear under follwing roles: + *NOTICE!!!: This file will be very big, we should + *keep it clear under following roles: * - *This file include follwing part, so, if you add new + *This file include following part, so, if you add new *functions into this file, please check which part it *should includes. or check if you should add new part *for this file: @@ -64,73 +64,73 @@ * *********************************************************/ static struct ieee80211_channel rtl_channeltable_2g[] = { - {.center_freq = 2412,.hw_value = 1,}, - {.center_freq = 2417,.hw_value = 2,}, - {.center_freq = 2422,.hw_value = 3,}, - {.center_freq = 2427,.hw_value = 4,}, - {.center_freq = 2432,.hw_value = 5,}, - {.center_freq = 2437,.hw_value = 6,}, - {.center_freq = 2442,.hw_value = 7,}, - {.center_freq = 2447,.hw_value = 8,}, - {.center_freq = 2452,.hw_value = 9,}, - {.center_freq = 2457,.hw_value = 10,}, - {.center_freq = 2462,.hw_value = 11,}, - {.center_freq = 2467,.hw_value = 12,}, - {.center_freq = 2472,.hw_value = 13,}, - {.center_freq = 2484,.hw_value = 14,}, + {.center_freq = 2412, .hw_value = 1,}, + {.center_freq = 2417, .hw_value = 2,}, + {.center_freq = 2422, .hw_value = 3,}, + {.center_freq = 2427, .hw_value = 4,}, + {.center_freq = 2432, .hw_value = 5,}, + {.center_freq = 2437, .hw_value = 6,}, + {.center_freq = 2442, .hw_value = 7,}, + {.center_freq = 2447, .hw_value = 8,}, + {.center_freq = 2452, .hw_value = 9,}, + {.center_freq = 2457, .hw_value = 10,}, + {.center_freq = 2462, .hw_value = 11,}, + {.center_freq = 2467, .hw_value = 12,}, + {.center_freq = 2472, .hw_value = 13,}, + {.center_freq = 2484, .hw_value = 14,}, }; static struct ieee80211_channel rtl_channeltable_5g[] = { - {.center_freq = 5180,.hw_value = 36,}, - {.center_freq = 5200,.hw_value = 40,}, - {.center_freq = 5220,.hw_value = 44,}, - {.center_freq = 5240,.hw_value = 48,}, - {.center_freq = 5260,.hw_value = 52,}, - {.center_freq = 5280,.hw_value = 56,}, - {.center_freq = 5300,.hw_value = 60,}, - {.center_freq = 5320,.hw_value = 64,}, - {.center_freq = 5500,.hw_value = 100,}, - {.center_freq = 5520,.hw_value = 104,}, - {.center_freq = 5540,.hw_value = 108,}, - {.center_freq = 5560,.hw_value = 112,}, - {.center_freq = 5580,.hw_value = 116,}, - {.center_freq = 5600,.hw_value = 120,}, - {.center_freq = 5620,.hw_value = 124,}, - {.center_freq = 5640,.hw_value = 128,}, - {.center_freq = 5660,.hw_value = 132,}, - {.center_freq = 5680,.hw_value = 136,}, - {.center_freq = 5700,.hw_value = 140,}, - {.center_freq = 5745,.hw_value = 149,}, - {.center_freq = 5765,.hw_value = 153,}, - {.center_freq = 5785,.hw_value = 157,}, - {.center_freq = 5805,.hw_value = 161,}, - {.center_freq = 5825,.hw_value = 165,}, + {.center_freq = 5180, .hw_value = 36,}, + {.center_freq = 5200, .hw_value = 40,}, + {.center_freq = 5220, .hw_value = 44,}, + {.center_freq = 5240, .hw_value = 48,}, + {.center_freq = 5260, .hw_value = 52,}, + {.center_freq = 5280, .hw_value = 56,}, + {.center_freq = 5300, .hw_value = 60,}, + {.center_freq = 5320, .hw_value = 64,}, + {.center_freq = 5500, .hw_value = 100,}, + {.center_freq = 5520, .hw_value = 104,}, + {.center_freq = 5540, .hw_value = 108,}, + {.center_freq = 5560, .hw_value = 112,}, + {.center_freq = 5580, .hw_value = 116,}, + {.center_freq = 5600, .hw_value = 120,}, + {.center_freq = 5620, .hw_value = 124,}, + {.center_freq = 5640, .hw_value = 128,}, + {.center_freq = 5660, .hw_value = 132,}, + {.center_freq = 5680, .hw_value = 136,}, + {.center_freq = 5700, .hw_value = 140,}, + {.center_freq = 5745, .hw_value = 149,}, + {.center_freq = 5765, .hw_value = 153,}, + {.center_freq = 5785, .hw_value = 157,}, + {.center_freq = 5805, .hw_value = 161,}, + {.center_freq = 5825, .hw_value = 165,}, }; static struct ieee80211_rate rtl_ratetable_2g[] = { - {.bitrate = 10,.hw_value = 0x00,}, - {.bitrate = 20,.hw_value = 0x01,}, - {.bitrate = 55,.hw_value = 0x02,}, - {.bitrate = 110,.hw_value = 0x03,}, - {.bitrate = 60,.hw_value = 0x04,}, - {.bitrate = 90,.hw_value = 0x05,}, - {.bitrate = 120,.hw_value = 0x06,}, - {.bitrate = 180,.hw_value = 0x07,}, - {.bitrate = 240,.hw_value = 0x08,}, - {.bitrate = 360,.hw_value = 0x09,}, - {.bitrate = 480,.hw_value = 0x0a,}, - {.bitrate = 540,.hw_value = 0x0b,}, + {.bitrate = 10, .hw_value = 0x00,}, + {.bitrate = 20, .hw_value = 0x01,}, + {.bitrate = 55, .hw_value = 0x02,}, + {.bitrate = 110, .hw_value = 0x03,}, + {.bitrate = 60, .hw_value = 0x04,}, + {.bitrate = 90, .hw_value = 0x05,}, + {.bitrate = 120, .hw_value = 0x06,}, + {.bitrate = 180, .hw_value = 0x07,}, + {.bitrate = 240, .hw_value = 0x08,}, + {.bitrate = 360, .hw_value = 0x09,}, + {.bitrate = 480, .hw_value = 0x0a,}, + {.bitrate = 540, .hw_value = 0x0b,}, }; static struct ieee80211_rate rtl_ratetable_5g[] = { - {.bitrate = 60,.hw_value = 0x04,}, - {.bitrate = 90,.hw_value = 0x05,}, - {.bitrate = 120,.hw_value = 0x06,}, - {.bitrate = 180,.hw_value = 0x07,}, - {.bitrate = 240,.hw_value = 0x08,}, - {.bitrate = 360,.hw_value = 0x09,}, - {.bitrate = 480,.hw_value = 0x0a,}, - {.bitrate = 540,.hw_value = 0x0b,}, + {.bitrate = 60, .hw_value = 0x04,}, + {.bitrate = 90, .hw_value = 0x05,}, + {.bitrate = 120, .hw_value = 0x06,}, + {.bitrate = 180, .hw_value = 0x07,}, + {.bitrate = 240, .hw_value = 0x08,}, + {.bitrate = 360, .hw_value = 0x09,}, + {.bitrate = 480, .hw_value = 0x0a,}, + {.bitrate = 540, .hw_value = 0x0b,}, }; static const struct ieee80211_supported_band rtl_band_2ghz = { @@ -320,7 +320,7 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw) /* <5> set hw caps */ hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_RX_INCLUDES_FCS | -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)) IEEE80211_HW_BEACON_FILTER | #endif IEEE80211_HW_AMPDU_AGGREGATION | @@ -332,11 +332,11 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw) /* swlps or hwlps has been set in diff chip in init_sw_vars */ if (rtlpriv->psc.b_swctrl_lps) hw->flags |= IEEE80211_HW_SUPPORTS_PS | - IEEE80211_HW_PS_NULLFUNC_STACK | - /* IEEE80211_HW_SUPPORTS_DYNAMIC_PS | */ + IEEE80211_HW_PS_NULLFUNC_STACK | + /* IEEE80211_HW_SUPPORTS_DYNAMIC_PS | */ 0; /*<delete in kernel start>*/ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_STATION) | @@ -354,11 +354,11 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw) /*<delete in kernel start>*/ #endif /*<delete in kernel end>*/ -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,39)) +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)) hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)) hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; #endif @@ -388,7 +388,7 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw) } -static void _rtl_init_deferred_work(struct ieee80211_hw *hw) +static int _rtl_init_deferred_work(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); @@ -402,7 +402,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) /* <2> work queue */ rtlpriv->works.hw = hw; /*<delete in kernel start>*/ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) /*<delete in kernel end>*/ rtlpriv->works.rtl_wq = alloc_workqueue(rtlpriv->cfg->name, 0, 0); /*<delete in kernel start>*/ @@ -410,6 +410,9 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) rtlpriv->works.rtl_wq = create_workqueue(rtlpriv->cfg->name); #endif /*<delete in kernel end>*/ + if (!rtlpriv->works.rtl_wq) + return -ENOMEM; + INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq, (void *)rtl_watchdog_wq_callback); INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq, @@ -421,6 +424,8 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) INIT_DELAYED_WORK(&rtlpriv->works.fwevt_wq, (void *)rtl_fwevt_wq_callback); + return 0; + } void rtl_deinit_deferred_work(struct ieee80211_hw *hw) @@ -519,7 +524,8 @@ int rtl_init_core(struct ieee80211_hw *hw) INIT_LIST_HEAD(&rtlpriv->entry_list); /* <6> init deferred work */ - _rtl_init_deferred_work(hw); + if (_rtl_init_deferred_work(hw)) + return 1; /* <7> */ #ifdef VIF_TODO @@ -662,30 +668,27 @@ static void _rtl_txrate_selectmode(struct ieee80211_hw *hw, if (rtlpriv->dm.b_useramask) { tcb_desc->ratr_index = ratr_index; - /* TODO we will differentiate adhoc and station futrue */ + /* TODO we will differentiate adhoc and station future */ if (mac->opmode == NL80211_IFTYPE_STATION || mac->opmode == NL80211_IFTYPE_MESH_POINT) { tcb_desc->mac_id = 0; - - if (mac->mode == WIRELESS_MODE_N_24G) { + if (mac->mode == WIRELESS_MODE_N_24G) tcb_desc->ratr_index = RATR_INX_WIRELESS_NGB; - } else if (mac->mode == WIRELESS_MODE_N_5G) { + else if (mac->mode == WIRELESS_MODE_N_5G) tcb_desc->ratr_index = RATR_INX_WIRELESS_NG; - } else if (mac->mode & WIRELESS_MODE_G) { + else if (mac->mode & WIRELESS_MODE_G) tcb_desc->ratr_index = RATR_INX_WIRELESS_GB; - } else if (mac->mode & WIRELESS_MODE_B) { + else if (mac->mode & WIRELESS_MODE_B) tcb_desc->ratr_index = RATR_INX_WIRELESS_B; - } else if (mac->mode & WIRELESS_MODE_A) { + else if (mac->mode & WIRELESS_MODE_A) tcb_desc->ratr_index = RATR_INX_WIRELESS_G; - } } else if (mac->opmode == NL80211_IFTYPE_AP || mac->opmode == NL80211_IFTYPE_ADHOC) { if (NULL != sta) { - if (sta->aid > 0) { + if (sta->aid > 0) tcb_desc->mac_id = sta->aid + 1; - } else { + else tcb_desc->mac_id = 1; - } } else { tcb_desc->mac_id = 0; } @@ -711,7 +714,7 @@ static void _rtl_query_bandwidth_mode(struct ieee80211_hw *hw, return; } else if (mac->opmode == NL80211_IFTYPE_STATION) { if (!mac->bw_40 || !(sta->ht_cap.ht_supported)) - return; + return; } if (tcb_desc->b_multicast || tcb_desc->b_broadcast) return; @@ -730,7 +733,7 @@ static u8 _rtl_get_highest_n_rate(struct ieee80211_hw *hw, struct rtl_phy *rtlphy = &(rtlpriv->phy); u8 hw_rate; - if ((get_rf_type(rtlphy) == RF_2T2R) && (sta->ht_cap.mcs.rx_mask[1]!=0)) + if ((get_rf_type(rtlphy) == RF_2T2R) && (sta->ht_cap.mcs.rx_mask[1] != 0)) hw_rate = rtlpriv->cfg->maps[RTL_RC_HT_RATEMCS15]; else hw_rate = rtlpriv->cfg->maps[RTL_RC_HT_RATEMCS7]; @@ -772,16 +775,16 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, tcb_desc->disable_ratefallback = 1; } else { /* - *because hw will nerver use hw_rate + *because hw will never use hw_rate *when tcb_desc->use_driver_rate = false *so we never set highest N rate here, - *and N rate will all be controled by FW + *and N rate will all be controlled by FW *when tcb_desc->use_driver_rate = false */ if (sta && (sta->ht_cap.ht_supported)) { tcb_desc->hw_rate = _rtl_get_highest_n_rate(hw, sta); } else { - if(rtlmac->mode == WIRELESS_MODE_B) { + if (rtlmac->mode == WIRELESS_MODE_B) { tcb_desc->hw_rate = rtlpriv->cfg->maps[RTL_RC_CCK_RATE11M]; } else { @@ -809,7 +812,7 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, tcb_desc->b_packet_bw = false; } } -//EXPORT_SYMBOL(rtl_get_tcb_desc); +/* EXPORT_SYMBOL(rtl_get_tcb_desc); */ bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb) { @@ -862,8 +865,8 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) RT_TRACE((COMP_SEND | COMP_RECV), DBG_DMESG, ("%s ACT_ADDBAREQ From :%pM\n", is_tx ? "Tx" : "Rx", hdr->addr2)); - RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, ("req \n"), - skb->data, skb->len); + RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, ("req\n"), + skb->data, skb->len); if (!is_tx) { struct ieee80211_sta *sta = NULL; struct rtl_sta_info *sta_entry = NULL; @@ -897,7 +900,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) hdr->addr3, tid); if (skb_delba) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) rx_status.freq = hw->conf.chandef.chan->center_freq; rx_status.band = hw->conf.chandef.chan->band; #else @@ -1184,7 +1187,7 @@ void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb) if (ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) return; - rtlpriv->link_info.bcn_rx_inperiod ++; + rtlpriv->link_info.bcn_rx_inperiod++; } void rtl_watchdog_wq_callback(void *data) @@ -1363,7 +1366,7 @@ void rtl_easy_concurrent_retrytimer_callback(unsigned long data) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *buddy_priv = rtlpriv->buddy_priv; - if(buddy_priv == NULL) + if (buddy_priv == NULL) return; rtlpriv->cfg->ops->dualmac_easy_concurrent(hw); @@ -1478,13 +1481,13 @@ int rtl_send_smps_action(struct ieee80211_hw *hw, /* rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0); */ info->control.rates[0].idx = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) info->band = hw->conf.chandef.chan->band; #else info->band = hw->conf.channel->band; #endif /*<delete in kernel start>*/ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)) info->control.sta = sta; rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc); #else @@ -1499,7 +1502,7 @@ int rtl_send_smps_action(struct ieee80211_hw *hw, err_free: return 0; } -//EXPORT_SYMBOL(rtl_send_smps_action); +/* EXPORT_SYMBOL(rtl_send_smps_action); */ /* because mac80211 have issues when can receive del ba * so here we just make a fake del_ba if we receive a ba_req @@ -1528,8 +1531,8 @@ struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw, IEEE80211_STYPE_ACTION); action_frame->u.action.category = WLAN_CATEGORY_BACK; action_frame->u.action.u.delba.action_code = WLAN_ACTION_DELBA; - params = (u16)(1 << 11); /* bit 11 initiator */ - params |= (u16)(tid << 12); /* bit 15:12 TID number */ + params = (u16)(1 << 11); /* bit 11 initiator */ + params |= (u16)(tid << 12); /* bit 15:12 TID number */ action_frame->u.action.u.delba.params = cpu_to_le16(params); action_frame->u.action.u.delba.reason_code = @@ -1652,9 +1655,8 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len) if (ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) return; - if (rtl_find_221_ie(hw, data, len)) { + if (rtl_find_221_ie(hw, data, len)) vendor = mac->vendor; - } if ((memcmp(mac->bssid, ap5_1, 3) == 0) || (memcmp(mac->bssid, ap5_2, 3) == 0) || @@ -1671,7 +1673,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len) (memcmp(mac->bssid, ap4_2, 3) == 0) || (memcmp(mac->bssid, ap4_3, 3) == 0) || vendor == PEER_RAL) { - RT_TRACE(COMP_MAC80211, DBG_LOUD, ("=>ral findn\n")); + RT_TRACE(COMP_MAC80211, DBG_LOUD, ("=>ral find\n")); vendor = PEER_RAL; } else if (memcmp(mac->bssid, ap6_1, 3) == 0 || vendor == PEER_CISCO) { @@ -1715,7 +1717,7 @@ static ssize_t rtl_store_debug_level(struct device *d, unsigned long val; int ret; - ret = strict_strtoul(buf, 0, &val); + ret = kstrtoul(buf, 0, &val); if (ret) { printk(KERN_DEBUG "%s is not in hex or decimal form.\n", buf); } else { @@ -1845,8 +1847,7 @@ struct rtl_global_var global_var = {}; int rtl_core_module_init(void) { if (rtl_rate_control_register()) - printk(KERN_DEBUG "rtl: Unable to register rtl_rc," - "use default RC !!\n"); + printk(KERN_DEBUG "rtl: Unable to register rtl_rc, use default RC !!\n"); /* add proc for debug */ rtl_proc_add_topdir(); @@ -1861,7 +1862,7 @@ int rtl_core_module_init(void) void rtl_core_module_exit(void) { /*RC*/ - rtl_rate_control_unregister(); + rtl_rate_control_unregister(); /* add proc for debug */ rtl_proc_remove_topdir(); diff --git a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c index b30f17ae0215..5a54bb10698c 100644 --- a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c @@ -1653,7 +1653,7 @@ halbtc8812a1ant_TdmaDurationAdjustForAcl( } else { - //accquire the BT TRx retry count from BT_Info byte2 + //acquire the BT TRx retry count from BT_Info byte2 retry_count = coex_sta->bt_retry_cnt; bt_info_ext = coex_sta->bt_info_ext; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retry_count = %d\n", retry_count)); diff --git a/drivers/staging/rtl8821ae/btcoexist/habtc8723a1ant.c b/drivers/staging/rtl8821ae/btcoexist/habtc8723a1ant.c index e619923ef0ab..8e4293a35872 100644 --- a/drivers/staging/rtl8821ae/btcoexist/habtc8723a1ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/habtc8723a1ant.c @@ -629,7 +629,7 @@ halbtc8723a1ant_TdmaDurationAdjust( } else { - //accquire the BT TRx retry count from BT_Info byte2 + //acquire the BT TRx retry count from BT_Info byte2 retryCount = pCoexSta->btRetryCnt; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], retryCount = %d\n", retryCount)); result = 0; diff --git a/drivers/staging/rtl8821ae/btcoexist/halbtc8192e1ant.c b/drivers/staging/rtl8821ae/btcoexist/halbtc8192e1ant.c index 973d0ea82cb8..1b04530d46bc 100644 --- a/drivers/staging/rtl8821ae/btcoexist/halbtc8192e1ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/halbtc8192e1ant.c @@ -1721,7 +1721,7 @@ halbtc8192e1ant_TdmaDurationAdjustForAcl( } else { - //accquire the BT TRx retry count from BT_Info byte2 + //acquire the BT TRx retry count from BT_Info byte2 retryCount = pCoexSta->btRetryCnt; btInfoExt = pCoexSta->btInfoExt; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); diff --git a/drivers/staging/rtl8821ae/btcoexist/halbtc8192e2ant.c b/drivers/staging/rtl8821ae/btcoexist/halbtc8192e2ant.c index 44ec78562e2d..115908928ae4 100644 --- a/drivers/staging/rtl8821ae/btcoexist/halbtc8192e2ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/halbtc8192e2ant.c @@ -1803,7 +1803,7 @@ void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist, result = 0; wait_cnt = 0; } else { - /* accquire the BT TRx retry count from BT_Info byte2 */ + /* acquire the BT TRx retry count from BT_Info byte2 */ retry_cnt = coex_sta->bt_retry_cnt; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, "[BTCoex], retry_cnt = %d\n", retry_cnt); diff --git a/drivers/staging/rtl8821ae/btcoexist/halbtc8723a2ant.c b/drivers/staging/rtl8821ae/btcoexist/halbtc8723a2ant.c index 180d6f12e7b5..3f5c4fd2e73f 100644 --- a/drivers/staging/rtl8821ae/btcoexist/halbtc8723a2ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/halbtc8723a2ant.c @@ -1687,7 +1687,7 @@ halbtc8723a2ant_TdmaDurationAdjust( } else { - //accquire the BT TRx retry count from BT_Info byte2 + //acquire the BT TRx retry count from BT_Info byte2 retryCount = pCoexSta->btRetryCnt; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up=%d, dn=%d, m=%d, n=%d, WaitCount=%d\n", diff --git a/drivers/staging/rtl8821ae/btcoexist/halbtc8723b1ant.c b/drivers/staging/rtl8821ae/btcoexist/halbtc8723b1ant.c index 3414ba78cc43..9677943fc20d 100644 --- a/drivers/staging/rtl8821ae/btcoexist/halbtc8723b1ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/halbtc8723b1ant.c @@ -1950,7 +1950,7 @@ void halbtc8723b1ant_tdma_duration_adjust_for_acl(struct btc_coexist *btcoexist, result = 0; wait_count = 0; } else { - /*accquire the BT TRx retry count from BT_Info byte2 */ + /*acquire the BT TRx retry count from BT_Info byte2 */ retry_count = coex_sta->bt_retry_cnt; bt_info_ext = coex_sta->bt_info_ext; result = 0; diff --git a/drivers/staging/rtl8821ae/btcoexist/halbtc8723b2ant.c b/drivers/staging/rtl8821ae/btcoexist/halbtc8723b2ant.c index 83b1b4218333..d337bd0b3c1b 100644 --- a/drivers/staging/rtl8821ae/btcoexist/halbtc8723b2ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/halbtc8723b2ant.c @@ -1830,7 +1830,7 @@ void halbtc8723b2ant_tdma_duration_adjust(struct btc_coexist *btcoexist, result = 0; wait_count = 0; } else { - /*accquire the BT TRx retry count from BT_Info byte2*/ + /*acquire the BT TRx retry count from BT_Info byte2*/ retryCount = coex_sta->bt_retry_cnt; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, "[BTCoex], retryCount = %d\n", retryCount); diff --git a/drivers/staging/rtl8821ae/btcoexist/halbtcoutsrc.c b/drivers/staging/rtl8821ae/btcoexist/halbtcoutsrc.c index 9d9fa4d7575d..c4e83773ec98 100644 --- a/drivers/staging/rtl8821ae/btcoexist/halbtcoutsrc.c +++ b/drivers/staging/rtl8821ae/btcoexist/halbtcoutsrc.c @@ -732,17 +732,7 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter) else btcoexist->binded = true; -#if ( defined(CONFIG_PCI_HCI)) - btcoexist->chip_interface = BTC_INTF_PCI; -#elif ( defined(CONFIG_USB_HCI)) - btcoexist->chip_interface = BTC_INTF_USB; -#elif ( defined(CONFIG_SDIO_HCI)) - btcoexist->chip_interface = BTC_INTF_SDIO; -#elif ( defined(CONFIG_GSPI_HCI)) - btcoexist->chip_interface = BTC_INTF_GSPI; -#else btcoexist->chip_interface = BTC_INTF_UNKNOWN; -#endif if (NULL == btcoexist->adapter) btcoexist->adapter = adapter; @@ -1087,7 +1077,7 @@ void exhalbtc_dbg_control(struct btc_coexist *btcoexist, btcoexist->statistics.cnt_dbg_ctrl++; } -void exhalbtc_stack_update_profile_info() +void exhalbtc_stack_update_profile_info(void) { } diff --git a/drivers/staging/rtl8821ae/core.c b/drivers/staging/rtl8821ae/core.c index 40de6089039e..ff3139b6da65 100644 --- a/drivers/staging/rtl8821ae/core.c +++ b/drivers/staging/rtl8821ae/core.c @@ -373,7 +373,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed) /* sleep here is must, or we may recv the beacon and * cause mac80211 into wrong ps state, this will cause * power save nullfunc send fail, and further cause - * pkt loss, So sleep must quickly but not immediatly + * pkt loss, So sleep must quickly but not immediately * because that will cause nullfunc send by mac80211 * fail, and cause pkt loss, we have tested that 5mA * is worked very well */ @@ -1200,8 +1200,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, key_type = AESCMAC_ENCRYPTION; RT_TRACE(COMP_SEC, DBG_DMESG, ("alg:CMAC\n")); RT_TRACE(COMP_SEC, DBG_DMESG, - ("HW don't support CMAC encrypiton, " - "use software CMAC encrypiton\n")); + ("HW don't support CMAC encryption, " + "use software CMAC encryption\n")); err = -EOPNOTSUPP; goto out_unlock; default: @@ -1235,8 +1235,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, key_type = AESCMAC_ENCRYPTION; RT_TRACE(COMP_SEC, DBG_DMESG, ("alg:CMAC\n")); RT_TRACE(COMP_SEC, DBG_DMESG, - ("HW don't support CMAC encrypiton, " - "use software CMAC encrypiton\n")); + ("HW don't support CMAC encryption, " + "use software CMAC encryption\n")); err = -EOPNOTSUPP; goto out_unlock; default: @@ -1411,7 +1411,7 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw) } /* this function is called by mac80211 to flush tx buffer - * before switch channle or power save, or tx buffer packet + * before switch channel or power save, or tx buffer packet * maybe send after offchannel or rf sleep, this may cause * dis-association by AP */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) diff --git a/drivers/staging/rtl8821ae/core.h b/drivers/staging/rtl8821ae/core.h index 4b247db2861d..f0c74e9239fd 100644 --- a/drivers/staging/rtl8821ae/core.h +++ b/drivers/staging/rtl8821ae/core.h @@ -2,20 +2,20 @@ * * Copyright(c) 2009-2010 Realtek Corporation. * - * Tmis program is free software; you can redistribute it and/or modify it + * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * - * Tmis program is distributed in the hope that it will be useful, but WITHOUT + * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with - * tmis program; if not, write to the Free Software Foundation, Inc., + * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * Tme full GNU General Public License is included in this distribution in the + * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: diff --git a/drivers/staging/rtl8821ae/debug.c b/drivers/staging/rtl8821ae/debug.c index cb051223c684..8a6c794bda41 100644 --- a/drivers/staging/rtl8821ae/debug.c +++ b/drivers/staging/rtl8821ae/debug.c @@ -2,20 +2,20 @@ * * Copyright(c) 2009-2010 Realtek Corporation. * - * Tmis program is free software; you can redistribute it and/or modify it + * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * - * Tmis program is distributed in the hope that it will be useful, but WITHOUT + * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with - * tmis program; if not, write to the Free Software Foundation, Inc., + * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * Tme full GNU General Public License is included in this distribution in the + * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: @@ -985,4 +985,4 @@ void rtl_proc_remove_topdir(void) { if (proc_topdir) remove_proc_entry("rtlwifi", init_net.proc_net); -}
\ No newline at end of file +} diff --git a/drivers/staging/rtl8821ae/debug.h b/drivers/staging/rtl8821ae/debug.h index 5eb6251b89da..6c0a553e98b7 100644 --- a/drivers/staging/rtl8821ae/debug.h +++ b/drivers/staging/rtl8821ae/debug.h @@ -2,20 +2,20 @@ * * Copyright(c) 2009-2010 Realtek Corporation. * - * Tmis program is free software; you can redistribute it and/or modify it + * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * - * Tmis program is distributed in the hope that it will be useful, but WITHOUT + * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with - * tmis program; if not, write to the Free Software Foundation, Inc., + * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * Tme full GNU General Public License is included in this distribution in the + * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: @@ -44,7 +44,7 @@ #define DBG_EMERG 0 /* - *Abnormal, rare, or unexpeted cases. + *Abnormal, rare, or unexpected cases. *For example, Packet/IO Ctl canceled, *device suprisely unremoved and so on. */ @@ -54,7 +54,7 @@ *Normal case driver developer should *open, we can see link status like *assoc/AddBA/DHCP/adapter start and - *so on basic and useful infromations. + *so on basic and useful informations. */ #define DBG_DMESG 3 diff --git a/drivers/staging/rtl8821ae/efuse.c b/drivers/staging/rtl8821ae/efuse.c index 74c19ecc95a9..250aae1ce631 100644 --- a/drivers/staging/rtl8821ae/efuse.c +++ b/drivers/staging/rtl8821ae/efuse.c @@ -2,20 +2,20 @@ * * Copyright(c) 2009-2010 Realtek Corporation. * - * Tmis program is free software; you can redistribute it and/or modify it + * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * - * Tmis program is distributed in the hope that it will be useful, but WITHOUT + * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with - * tmis program; if not, write to the Free Software Foundation, Inc., + * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * Tme full GNU General Public License is included in this distribution in the + * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: @@ -149,7 +149,7 @@ u8 efuse_read_1byte(struct ieee80211_hw *hw, u16 address) return 0xFF; } -//EXPORT_SYMBOL(efuse_read_1byte); +/* EXPORT_SYMBOL(efuse_read_1byte); */ void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value) { @@ -517,7 +517,7 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw) rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); } -//EXPORT_SYMBOL(rtl_efuse_shadow_map_update); +/* EXPORT_SYMBOL(rtl_efuse_shadow_map_update); */ void efuse_force_write_vendor_Id(struct ieee80211_hw *hw) { @@ -628,7 +628,7 @@ int efuse_one_byte_read(struct ieee80211_hw *hw, u16 addr, u8 *data) } return bresult; } -//EXPORT_SYMBOL(efuse_one_byte_read); +/* EXPORT_SYMBOL(efuse_one_byte_read); */ static int efuse_one_byte_write(struct ieee80211_hw *hw, u16 addr, u8 data) { @@ -1120,16 +1120,16 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 bwrite, u8 pwrstate) { rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_ACCESS], 0x69); - // 1.2V Power: From VDDON with Power Cut(0x0000h[15]), defualt valid + /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), default valid */ tmpV16 = rtl_read_word(rtlpriv, rtlpriv->cfg->maps[SYS_ISO_CTRL]); printk("SYS_ISO_CTRL=%04x.\n",tmpV16); if( ! (tmpV16 & PWC_EV12V ) ){ tmpV16 |= PWC_EV12V ; - //PlatformEFIOWrite2Byte(pAdapter,REG_SYS_ISO_CTRL,tmpV16); + /* PlatformEFIOWrite2Byte(pAdapter,REG_SYS_ISO_CTRL,tmpV16); */ } - // Reset: 0x0000h[28], default valid + /* Reset: 0x0000h[28], default valid */ tmpV16 = rtl_read_word(rtlpriv, rtlpriv->cfg->maps[SYS_FUNC_EN]); printk("SYS_FUNC_EN=%04x.\n",tmpV16); if( !(tmpV16 & FEN_ELDR) ){ @@ -1137,7 +1137,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 bwrite, u8 pwrstate) rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[SYS_FUNC_EN], tmpV16); } - // Clock: Gated(0x0008h[5]) 8M(0x0008h[1]) clock from ANA, default valid + /* Clock: Gated(0x0008h[5]) 8M(0x0008h[1]) clock from ANA, default valid */ tmpV16 = rtl_read_word(rtlpriv, rtlpriv->cfg->maps[SYS_CLK] ); printk("SYS_CLK=%04x.\n",tmpV16); if( (!(tmpV16 & LOADER_CLK_EN) ) ||(!(tmpV16 & ANA8M) ) ) @@ -1148,7 +1148,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 bwrite, u8 pwrstate) if(bwrite == true) { - // Enable LDO 2.5V before read/write action + /* Enable LDO 2.5V before read/write action */ tempval = rtl_read_word(rtlpriv, rtlpriv->cfg->maps[EFUSE_TEST] + 3); printk("EFUSE_TEST=%04x.\n",tmpV16); tempval &= ~(BIT(3) | BIT(4) |BIT(5) | BIT(6)); @@ -1161,7 +1161,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 bwrite, u8 pwrstate) { rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_ACCESS], 0x00); if(bwrite == true){ - // Disable LDO 2.5V after read/write action + /* Disable LDO 2.5V after read/write action */ tempval = rtl_read_word(rtlpriv, rtlpriv->cfg->maps[EFUSE_TEST] + 3); rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_TEST] + 3, (tempval & 0x7F)); } diff --git a/drivers/staging/rtl8821ae/pci.c b/drivers/staging/rtl8821ae/pci.c index cfa651edd238..a562aa60d595 100644 --- a/drivers/staging/rtl8821ae/pci.c +++ b/drivers/staging/rtl8821ae/pci.c @@ -388,13 +388,13 @@ static u8 _rtl_pci_get_pciehdr_offset(struct ieee80211_hw *hw) * capability that we are looking for, follow the link to * the next capability and continue looping. */ - rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS , - pcicfg_addr_port + + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS , + pcicfg_addr_port + (num4bytes << 2)); rtl_pci_raw_read_port_ushort(PCI_CONF_DATA, (u16*)&capability_hdr); /* Found the PCI express capability. */ - if (capability_hdr.capability_id == + if (capability_hdr.capability_id == PCI_CAPABILITY_ID_PCI_EXPRESS) break; else @@ -418,7 +418,7 @@ bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw, list_for_each_entry(temp_priv, &rtlpriv->glb_var->glb_priv_list, list) { if (temp_priv) { - temp_pcipriv = + temp_pcipriv = (struct rtl_pci_priv *)temp_priv->priv; RT_TRACE(COMP_INIT, DBG_LOUD, (("pcipriv->ndis_adapter.funcnumber %x \n"), @@ -526,8 +526,8 @@ static void _rtl_pci_io_handler_init(struct device *dev, } static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, - struct sk_buff *skb, - struct rtl_tcb_desc *tcb_desc, + struct sk_buff *skb, + struct rtl_tcb_desc *tcb_desc, u8 tid) { struct rtl_priv *rtlpriv = rtl_priv(hw); @@ -535,7 +535,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); u8 additionlen = FCS_LEN; struct sk_buff *next_skb; - + /* here open is 4, wep/tkip is 8, aes is 12*/ if (info->control.hw_key) additionlen += info->control.hw_key->icv_len; @@ -544,7 +544,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, tcb_desc->empkt_num = 0; spin_lock_bh(&rtlpriv->locks.waitq_lock); skb_queue_walk(&rtlpriv->mac80211.skb_waitq[tid], next_skb) { - struct ieee80211_tx_info *next_info = + struct ieee80211_tx_info *next_info = IEEE80211_SKB_CB(next_skb); if (next_info->flags & IEEE80211_TX_CTL_AMPDU) { tcb_desc->empkt_len[tcb_desc->empkt_num] = @@ -554,7 +554,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, break; } - if (skb_queue_is_last(&rtlpriv->mac80211.skb_waitq[tid], + if (skb_queue_is_last(&rtlpriv->mac80211.skb_waitq[tid], next_skb)) break; @@ -575,26 +575,26 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) struct sk_buff *skb = NULL; struct ieee80211_tx_info *info = NULL; int tid; /* should be int */ - + if (!rtlpriv->rtlhal.b_earlymode_enable) - return; + return; if (rtlpriv->dm.supp_phymode_switch && (rtlpriv->easy_concurrent_ctl.bswitch_in_process || - (rtlpriv->buddy_priv && + (rtlpriv->buddy_priv && rtlpriv->buddy_priv->easy_concurrent_ctl.bswitch_in_process))) return; - /* we juse use em for BE/BK/VI/VO */ + /* we just use em for BE/BK/VI/VO */ for (tid = 7; tid >= 0; tid--) { u8 hw_queue = ac_to_hwq[rtl_tid_to_ac(hw, tid)]; struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue]; - while (!mac->act_scanning && + while (!mac->act_scanning && rtlpriv->psc.rfpwr_state == ERFON) { struct rtl_tcb_desc tcb_desc; - memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); + memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); spin_lock_bh(&rtlpriv->locks.waitq_lock); if (!skb_queue_empty(&mac->skb_waitq[tid]) && - (ring->entries - skb_queue_len(&ring->queue) > + (ring->entries - skb_queue_len(&ring->queue) > rtlhal->max_earlymode_num)) { skb = skb_dequeue(&mac->skb_waitq[tid]); } else { @@ -607,7 +607,7 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) * multicast/broadcast/no_qos data */ info = IEEE80211_SKB_CB(skb); if (info->flags & IEEE80211_TX_CTL_AMPDU) - _rtl_pci_update_earlymode_info(hw, skb, + _rtl_pci_update_earlymode_info(hw, skb, &tcb_desc, tid); /*<delete in kernel start>*/ @@ -635,7 +635,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) u8 tid; u8 *entry; - + if (rtlpriv->use_new_trx_flow) entry = (u8 *)(&ring->buffer_desc[ring->idx]); else @@ -643,11 +643,11 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) if (!rtlpriv->cfg->ops->is_tx_desc_closed(hw, prio, ring->idx)) return; - + ring->idx = (ring->idx + 1) % ring->entries; - + skb = __skb_dequeue(&ring->queue); - + pci_unmap_single(rtlpci->pdev, le32_to_cpu(rtlpriv->cfg->ops-> get_desc((u8 *) entry, true, @@ -672,7 +672,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) } /* for sw LPS, just after NULL skb send out, we can - * sure AP kown we are sleeped, our we should not let + * sure AP known we are slept, our we should not let * rf to sleep*/ fc = rtl_get_fc(skb); if (ieee80211_is_nullfunc(fc)) { @@ -740,7 +740,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, u8 tmp_one = 1; struct sk_buff *skb; - skb = dev_alloc_skb(rtlpci->rxbuffersize); + skb = dev_alloc_skb(rtlpci->rxbuffersize); if (!skb) return 0; rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; @@ -754,25 +754,25 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) return 0; if (rtlpriv->use_new_trx_flow) { - rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, + rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, HW_DESC_RX_PREPARE, (u8 *) & bufferaddress); - } else { - rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, + } else { + rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, HW_DESC_RXBUFF_ADDR, (u8 *) & bufferaddress); - rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, + rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, HW_DESC_RXPKT_LEN, (u8 *) & rtlpci->rxbuffersize); - rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, + rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, HW_DESC_RXOWN, (u8 *) & tmp_one); } - + return 1; } -/* inorder to receive 8K AMSDU we have set skb to +/* In order to receive 8K AMSDU we have set skb to * 9100bytes in init rx ring, but if this packet is * not a AMSDU, this so big packet will be sent to * TCP/IP directly, this cause big packet ping fail @@ -783,7 +783,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, /* but some platform will fail when alloc skb sometimes. * in this condition, we will send the old skb to * mac80211 directly, this will not cause any other - * issues, but only be losted by TCP/IP */ + * issues, but only be lost by TCP/IP */ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw, struct sk_buff *skb, struct ieee80211_rx_status rx_status) { @@ -792,7 +792,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw, } else { struct sk_buff *uskb = NULL; u8 *pdata; - + uskb = dev_alloc_skb(skb->len + 128); if (likely(uskb)) { memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status, @@ -804,7 +804,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw, ieee80211_rx_irqsafe(hw, uskb); } else { ieee80211_rx_irqsafe(hw, skb); - } + } } } @@ -814,11 +814,11 @@ static void _rtl_pci_hs_interrupt(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); - rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR], - rtl_read_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR]) | + rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR], + rtl_read_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR]) | rtlpci->sys_irq_mask); - + } static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) { @@ -839,7 +839,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) .noise = -98, .rate = 0, }; - + /*RX NORMAL PKT */ while (count--) { struct ieee80211_hdr *hdr; @@ -852,65 +852,65 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) /*rx pkt */ struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[ rtlpci->rx_ring[rxring_idx].idx]; - + if (rtlpriv->use_new_trx_flow) { - rx_remained_cnt = + rx_remained_cnt = rtlpriv->cfg->ops->rx_desc_buff_remained_cnt(hw, hw_queue); - if (rx_remained_cnt < 1) + if (rx_remained_cnt < 1) return; - + } else { /* rx descriptor */ pdesc = &rtlpci->rx_ring[rxring_idx].desc[ rtlpci->rx_ring[rxring_idx].idx]; - + own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, - false, + false, HW_DESC_OWN); if (own) /* wait data to be filled by hardware */ return; } - + /* Get here means: data is filled already*/ /* AAAAAAttention !!! * We can NOT access 'skb' before 'pci_unmap_single' */ pci_unmap_single(rtlpci->pdev, *((dma_addr_t *) skb->cb), rtlpci->rxbuffersize, PCI_DMA_FROMDEVICE); - + if (rtlpriv->use_new_trx_flow) { buffer_desc = &rtlpci->rx_ring[rxring_idx].buffer_desc[ rtlpci->rx_ring[rxring_idx].idx]; /*means rx wifi info*/ pdesc = (struct rtl_rx_desc *)skb->data; } - + rtlpriv->cfg->ops->query_rx_desc(hw, &status, &rx_status, (u8 *) pdesc, skb); - + if (rtlpriv->use_new_trx_flow) - rtlpriv->cfg->ops->rx_check_dma_ok(hw, - (u8 *)buffer_desc, + rtlpriv->cfg->ops->rx_check_dma_ok(hw, + (u8 *)buffer_desc, hw_queue); - - len = rtlpriv->cfg->ops->get_desc((u8 *)pdesc, false, + + len = rtlpriv->cfg->ops->get_desc((u8 *)pdesc, false, HW_DESC_RXPKT_LEN); - + if (skb->end - skb->tail > len) { skb_put(skb, len); - if (rtlpriv->use_new_trx_flow) - skb_reserve(skb, status.rx_drvinfo_size + + if (rtlpriv->use_new_trx_flow) + skb_reserve(skb, status.rx_drvinfo_size + status.rx_bufshift + 24); else - skb_reserve(skb, status.rx_drvinfo_size + + skb_reserve(skb, status.rx_drvinfo_size + status.rx_bufshift); } else { - printk("skb->end - skb->tail = %d, len is %d\n", + printk("skb->end - skb->tail = %d, len is %d\n", skb->end - skb->tail, len); break; } - + rtlpriv->cfg->ops->rx_command_packet_handler(hw, status, skb); /* @@ -922,9 +922,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) hdr = rtl_get_hdr(skb); fc = rtl_get_fc(skb); - + if (!status.b_crc && !status.b_hwerror) { - memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, + memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); if (is_broadcast_ether_addr(hdr->addr1)) { @@ -947,13 +947,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) /* static bcn for roaming */ rtl_beacon_statistic(hw, skb); - rtl_p2p_info(hw, (void*)skb->data, skb->len); + rtl_p2p_info(hw, (void*)skb->data, skb->len); /* for sw lps */ rtl_swlps_beacon(hw, (void*)skb->data, skb->len); rtl_recognize_peer(hw, (void*)skb->data, skb->len); if ((rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP) && (rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G)&& - (ieee80211_is_beacon(fc) || + (ieee80211_is_beacon(fc) || ieee80211_is_probe_resp(fc))) { dev_kfree_skb_any(skb); } else { @@ -964,13 +964,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) } if (rtlpriv->use_new_trx_flow) { rtlpci->rx_ring[hw_queue].next_rx_rp += 1; - rtlpci->rx_ring[hw_queue].next_rx_rp %= + rtlpci->rx_ring[hw_queue].next_rx_rp %= RTL_PCI_MAX_RX_COUNT; rx_remained_cnt--; if (1/*rx_remained_cnt == 0*/) { - rtl_write_word(rtlpriv, 0x3B4, + rtl_write_word(rtlpriv, 0x3B4, rtlpci->rx_ring[hw_queue].next_rx_rp); } } @@ -981,22 +981,22 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) } if (rtlpriv->use_new_trx_flow) { - _rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc, + _rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc, rxring_idx, - rtlpci->rx_ring[rxring_idx].idx); + rtlpci->rx_ring[rxring_idx].idx); } else { _rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc, rxring_idx, - rtlpci->rx_ring[rxring_idx].idx); + rtlpci->rx_ring[rxring_idx].idx); - if (rtlpci->rx_ring[rxring_idx].idx == + if (rtlpci->rx_ring[rxring_idx].idx == rtlpci->rxringcount - 1) - rtlpriv->cfg->ops->set_desc(hw, (u8 *) pdesc, - false, + rtlpriv->cfg->ops->set_desc(hw, (u8 *) pdesc, + false, HW_DESC_RXERO, (u8 *) & tmp_one); } - rtlpci->rx_ring[rxring_idx].idx = - (rtlpci->rx_ring[rxring_idx].idx + 1) % + rtlpci->rx_ring[rxring_idx].idx = + (rtlpci->rx_ring[rxring_idx].idx + 1) % rtlpci->rxringcount; } } @@ -1011,7 +1011,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) u32 inta = 0; u32 intb = 0; - + if (rtlpci->irq_enabled == 0) return IRQ_HANDLED; @@ -1020,7 +1020,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMR], 0x0); - + rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMRE], 0x0); @@ -1029,7 +1029,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) rtlpriv->cfg->ops->interrupt_recognized(hw, &inta, &intb); - /*Shared IRQ or HW disappared */ + /*Shared IRQ or HW disappeared */ if (!inta || inta == 0xffff) goto done; /*<1> beacon related */ @@ -1127,7 +1127,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) /*<4> fw related*/ if (rtlhal->hw_type == HARDWARE_TYPE_RTL8723AE) { if (inta & rtlpriv->cfg->maps[RTL_IMR_C2HCMD]) { - RT_TRACE(COMP_INTR, DBG_TRACE, + RT_TRACE(COMP_INTR, DBG_TRACE, ("firmware interrupt!\n")); queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.fwevt_wq, 0); @@ -1142,12 +1142,12 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) if (rtlhal->hw_type == HARDWARE_TYPE_RTL8188EE || rtlhal->hw_type == HARDWARE_TYPE_RTL8723BE) { if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_HSISR_IND])) { - RT_TRACE(COMP_INTR, DBG_TRACE, + RT_TRACE(COMP_INTR, DBG_TRACE, ("hsisr interrupt!\n")); _rtl_pci_hs_interrupt(hw); } } - + if(rtlpriv->rtlhal.b_earlymode_enable) tasklet_schedule(&rtlpriv->works.irq_tasklet); @@ -1157,7 +1157,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMRE], rtlpci->irq_mask[1]); spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); - + return IRQ_HANDLED; done: @@ -1200,16 +1200,16 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) pdesc = &ring->desc[0]; if (rtlpriv->use_new_trx_flow) pbuffer_desc = &ring->buffer_desc[0]; - + /*<delete in kernel start>*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) - rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, - (u8 *)pbuffer_desc, info, pskb, + rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, + (u8 *)pbuffer_desc, info, pskb, BEACON_QUEUE, &tcb_desc); #else /*<delete in kernel end>*/ rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, - (u8 *)pbuffer_desc, info, NULL, pskb, + (u8 *)pbuffer_desc, info, NULL, pskb, BEACON_QUEUE, &tcb_desc); /*<delete in kernel start>*/ #endif @@ -1235,7 +1235,7 @@ static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) desc_num = TX_DESC_NUM_92E; else desc_num = RT_TXDESC_NUM; - + for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) { rtlpci->txringcount[i] = desc_num; } @@ -1309,12 +1309,12 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, /* alloc tx buffer desc for new trx flow*/ if (rtlpriv->use_new_trx_flow) { buffer_desc = pci_alloc_consistent(rtlpci->pdev, - sizeof(*buffer_desc) * entries, + sizeof(*buffer_desc) * entries, &buffer_desc_dma); if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) { RT_TRACE(COMP_ERR, DBG_EMERG, - ("Cannot allocate TX ring (prio = %d)\n", + ("Cannot allocate TX ring (prio = %d)\n", prio)); return -ENOMEM; } @@ -1322,13 +1322,13 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, memset(buffer_desc, 0, sizeof(*buffer_desc) * entries); rtlpci->tx_ring[prio].buffer_desc = buffer_desc; rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma; - + rtlpci->tx_ring[prio].cur_tx_rp = 0; rtlpci->tx_ring[prio].cur_tx_wp = 0; rtlpci->tx_ring[prio].avl_desc = entries; } - + /* alloc dma for this ring */ desc = pci_alloc_consistent(rtlpci->pdev, sizeof(*desc) * entries, &desc_dma); @@ -1342,7 +1342,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, memset(desc, 0, sizeof(*desc) * entries); rtlpci->tx_ring[prio].desc = desc; rtlpci->tx_ring[prio].dma = desc_dma; - + rtlpci->tx_ring[prio].idx = 0; rtlpci->tx_ring[prio].entries = entries; skb_queue_head_init(&rtlpci->tx_ring[prio].queue); @@ -1357,7 +1357,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, sizeof(*desc)); rtlpriv->cfg->ops->set_desc(hw, (u8 *) & (desc[i]), - true, + true, HW_DESC_TX_NEXTDESC_ADDR, (u8 *) & nextdescaddress); } @@ -1371,15 +1371,15 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) struct rtl_priv *rtlpriv = rtl_priv(hw); int i; - + if (rtlpriv->use_new_trx_flow) { struct rtl_rx_buffer_desc *entry = NULL; /* alloc dma for this ring */ - rtlpci->rx_ring[rxring_idx].buffer_desc = + rtlpci->rx_ring[rxring_idx].buffer_desc = pci_alloc_consistent(rtlpci->pdev, sizeof(*rtlpci->rx_ring[rxring_idx]. - buffer_desc) * - rtlpci->rxringcount, + buffer_desc) * + rtlpci->rxringcount, &rtlpci->rx_ring[rxring_idx].dma); if (!rtlpci->rx_ring[rxring_idx].buffer_desc || (unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) { @@ -1393,9 +1393,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) /* init every desc in this ring */ rtlpci->rx_ring[rxring_idx].idx = 0; - for (i = 0; i < rtlpci->rxringcount; i++) { + for (i = 0; i < rtlpci->rxringcount; i++) { entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i]; - if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, + if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, rxring_idx, i)) return -ENOMEM; } @@ -1403,14 +1403,14 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) struct rtl_rx_desc *entry = NULL; u8 tmp_one = 1; /* alloc dma for this ring */ - rtlpci->rx_ring[rxring_idx].desc = + rtlpci->rx_ring[rxring_idx].desc = pci_alloc_consistent(rtlpci->pdev, sizeof(*rtlpci->rx_ring[rxring_idx]. - desc) * rtlpci->rxringcount, + desc) * rtlpci->rxringcount, &rtlpci->rx_ring[rxring_idx].dma); if (!rtlpci->rx_ring[rxring_idx].desc || (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) { - RT_TRACE(COMP_ERR, DBG_EMERG, + RT_TRACE(COMP_ERR, DBG_EMERG, ("Cannot allocate RX ring\n")); return -ENOMEM; } @@ -1421,9 +1421,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) /* init every desc in this ring */ rtlpci->rx_ring[rxring_idx].idx = 0; - for (i = 0; i < rtlpci->rxringcount; i++) { + for (i = 0; i < rtlpci->rxringcount; i++) { entry = &rtlpci->rx_ring[rxring_idx].desc[i]; - if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, + if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, rxring_idx, i)) return -ENOMEM; } @@ -1467,7 +1467,7 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw, sizeof(*ring->buffer_desc) * ring->entries, ring->buffer_desc, ring->buffer_desc_dma); ring->buffer_desc = NULL; - } + } } static void _rtl_pci_free_rx_ring(struct ieee80211_hw *hw, int rxring_idx) @@ -1532,7 +1532,7 @@ err_free_rings: _rtl_pci_free_rx_ring(hw, rxring_idx); for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) - if (rtlpci->tx_ring[i].desc || + if (rtlpci->tx_ring[i].desc || rtlpci->tx_ring[i].buffer_desc) _rtl_pci_free_tx_ring(hw, i); @@ -1567,16 +1567,16 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) /* force the rx_ring[RX_MPDU_QUEUE/ * RX_CMD_QUEUE].idx to the first one */ /*new trx flow, do nothing*/ - if ((rtlpriv->use_new_trx_flow == false) && + if ((rtlpriv->use_new_trx_flow == false) && rtlpci->rx_ring[rxring_idx].desc) { struct rtl_rx_desc *entry = NULL; for (i = 0; i < rtlpci->rxringcount; i++) { - entry = &rtlpci->rx_ring[rxring_idx].desc[i]; - rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, + entry = &rtlpci->rx_ring[rxring_idx].desc[i]; + rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, - HW_DESC_RXOWN, - (u8 *) & tmp_one); + HW_DESC_RXOWN, + (u8 *) & tmp_one); } } rtlpci->rx_ring[rxring_idx].idx = 0; } @@ -1585,13 +1585,13 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) * and force the tx idx to the first one */ spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) { - if (rtlpci->tx_ring[i].desc || + if (rtlpci->tx_ring[i].desc || rtlpci->tx_ring[i].buffer_desc) { struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i]; while (skb_queue_len(&ring->queue)) { u8 *entry; - struct sk_buff *skb = + struct sk_buff *skb = __skb_dequeue(&ring->queue); if (rtlpriv->use_new_trx_flow) entry = (u8 *)(&ring->buffer_desc @@ -1618,7 +1618,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) /*<delete in kernel start>*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) -static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw, +static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw, struct sk_buff *skb) #else /*<delete in kernel end>*/ @@ -1741,10 +1741,10 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, } pdesc = &ring->desc[idx]; - + if (rtlpriv->use_new_trx_flow) { ptx_bd_desc = &ring->buffer_desc[idx]; - } else { + } else { own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, true, HW_DESC_OWN); @@ -1755,17 +1755,17 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, hw_queue, ring->idx, idx, skb_queue_len(&ring->queue))); - spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, + spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); return skb->len; } } - + if (ieee80211_is_data_qos(fc)) { tid = rtl_get_tid(skb); if (sta) { sta_entry = (struct rtl_sta_info *)sta->drv_priv; - seq_number = (le16_to_cpu(hdr->seq_ctrl) & + seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; seq_number += 1; @@ -1779,13 +1779,13 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, /*<delete in kernel start>*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) - rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, - (u8 *)ptx_bd_desc, info, skb, + rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, + (u8 *)ptx_bd_desc, info, skb, hw_queue, ptcb_desc); #else /*<delete in kernel end>*/ - rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, - (u8 *)ptx_bd_desc, info, sta, skb, + rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, + (u8 *)ptx_bd_desc, info, sta, skb, hw_queue, ptcb_desc); /*<delete in kernel start>*/ #endif @@ -1832,10 +1832,10 @@ static void rtl_pci_flush(struct ieee80211_hw *hw, bool drop) u16 i = 0; int queue_id; struct rtl8192_tx_ring *ring; - + if (mac->skip_scan) return; - + for (queue_id = RTL_PCI_MAX_TX_QUEUE_COUNT - 1; queue_id >= 0;) { u32 queue_len; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) @@ -1936,7 +1936,7 @@ void rtl_pci_stop(struct ieee80211_hw *hw) u8 RFInProgressTimeOut = 0; /* - *should before disable interrrupt&adapter + *should before disable interrupt&adapter *and will do it immediately. */ set_hal_stop(rtlhal); @@ -2081,13 +2081,13 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, rtlhal->interfaceindex = 0; } } - + /* 92ee use new trx flow */ if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192EE) rtlpriv->use_new_trx_flow = true; else rtlpriv->use_new_trx_flow = false; - + /*find bus info */ pcipriv->ndis_adapter.busnumber = pdev->bus->number; pcipriv->ndis_adapter.devnumber = PCI_SLOT(pdev->devfn); @@ -2095,7 +2095,7 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, /*find bridge info */ pcipriv->ndis_adapter.pcibridge_vendor = PCI_BRIDGE_VENDOR_UNKNOWN; - /* some ARM have no bridge_pdev and will crash here + /* some ARM have no bridge_pdev and will crash here * so we should check if bridge_pdev is NULL */ if (bridge_pdev) { pcipriv->ndis_adapter.pcibridge_vendorid = bridge_pdev->vendor; @@ -2187,7 +2187,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw) } rtlpci->using_msi = true; - + RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG, ("MSI Interrupt Mode!\n")); return 0; } @@ -2198,7 +2198,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw) struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); int ret; - + ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt, IRQF_SHARED, KBUILD_MODNAME, hw); if (ret < 0) { @@ -2206,7 +2206,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw) } rtlpci->using_msi = false; - RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG, + RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG, ("Pin-based Interrupt Mode!\n")); return 0; } @@ -2293,7 +2293,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, /* *init dbgp flags before all *other functions, because we will - *use it in other funtions like + *use it in other functions like *RT_TRACE/RT_PRINT/RTL_PRINT_DATA *you can not use these macro *before this @@ -2377,7 +2377,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, } else { rtlpriv->mac80211.mac80211_registered = 1; } - /* the wiphy must have been registed to + /* the wiphy must have been registed to * cfg80211 prior to regulatory_hint */ if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) { RT_TRACE(COMP_ERR, DBG_WARNING, ("regulatory_hint fail\n")); @@ -2428,13 +2428,13 @@ fail1: return -ENODEV; } -//EXPORT_SYMBOL(rtl_pci_probe); +/* EXPORT_SYMBOL(rtl_pci_probe); */ struct ieee80211_hw *rtl_pci_get_hw_pointer(void) { return hw_export; } -//EXPORT_SYMBOL(rtl_pci_get_hw_pointer); +/* EXPORT_SYMBOL(rtl_pci_get_hw_pointer); */ void rtl_pci_disconnect(struct pci_dev *pdev) { @@ -2450,7 +2450,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) /* add for prov */ rtl_proc_remove_one(hw); - + /*ieee80211_unregister_hw will call ops_stop */ if (rtlmac->mac80211_registered == 1) { @@ -2491,7 +2491,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) ieee80211_free_hw(hw); } -//EXPORT_SYMBOL(rtl_pci_disconnect); +/* EXPORT_SYMBOL(rtl_pci_disconnect); */ /*************************************** kernel pci power state define: @@ -2519,7 +2519,7 @@ int rtl_pci_suspend(struct device *dev) return 0; } -//EXPORT_SYMBOL(rtl_pci_suspend); +/* EXPORT_SYMBOL(rtl_pci_suspend); */ int rtl_pci_resume(struct device *dev) { @@ -2529,10 +2529,10 @@ int rtl_pci_resume(struct device *dev) rtlpriv->cfg->ops->hw_resume(hw); rtl_init_rfkill(hw); - + return 0; } -//EXPORT_SYMBOL(rtl_pci_resume); +/* EXPORT_SYMBOL(rtl_pci_resume); */ struct rtl_intf_ops rtl_pci_ops = { .read_efuse_byte = read_efuse_byte, diff --git a/drivers/staging/rtl8821ae/pci.h b/drivers/staging/rtl8821ae/pci.h index 9f206550a657..06eaa521e0eb 100644 --- a/drivers/staging/rtl8821ae/pci.h +++ b/drivers/staging/rtl8821ae/pci.h @@ -148,11 +148,11 @@ struct rtl_pci_capabilities_header { * RX wifi info == RX descriptor in old flow */ struct rtl_tx_buffer_desc { #if (RTL8192EE_SEG_NUM == 2) - u32 dword[2*(DMA_IS_64BIT + 1)*8]; //seg = 8 + u32 dword[2*(DMA_IS_64BIT + 1)*8]; /* seg = 8 */ #elif (RTL8192EE_SEG_NUM == 1) - u32 dword[2*(DMA_IS_64BIT + 1)*4]; //seg = 4 + u32 dword[2*(DMA_IS_64BIT + 1)*4]; /* seg = 4 */ #elif (RTL8192EE_SEG_NUM == 0) - u32 dword[2*(DMA_IS_64BIT + 1)*2]; //seg = 2 + u32 dword[2*(DMA_IS_64BIT + 1)*2]; /* seg = 2 */ #endif } __packed; @@ -187,7 +187,7 @@ struct rtl8192_tx_ring { }; struct rtl8192_rx_ring { - struct rtl_rx_desc *desc;/*for old trx flow, not uesd in new trx*/ + struct rtl_rx_desc *desc;/*for old trx flow, not used in new trx*/ /*dma matches either 'desc' or 'buffer_desc'*/ dma_addr_t dma; unsigned int idx; diff --git a/drivers/staging/rtl8821ae/ps.c b/drivers/staging/rtl8821ae/ps.c index f12ffa83c58d..7876442417f4 100644 --- a/drivers/staging/rtl8821ae/ps.c +++ b/drivers/staging/rtl8821ae/ps.c @@ -257,7 +257,7 @@ void rtl_ips_nic_off_wq_callback(void *data) *Do not enter IPS in the following conditions: *(1) RF is already OFF or Sleep *(2) b_swrf_processing (indicates the IPS is still under going) - *(3) Connectted (only disconnected can trigger IPS) + *(3) Connected (only disconnected can trigger IPS) *(4) IBSS (send Beacon) *(5) AP mode (send Beacon) *(6) monitor mode (rcv packet) diff --git a/drivers/staging/rtl8821ae/rc.c b/drivers/staging/rtl8821ae/rc.c index d387f13ea7dc..0cc32c60ddee 100644 --- a/drivers/staging/rtl8821ae/rc.c +++ b/drivers/staging/rtl8821ae/rc.c @@ -286,7 +286,6 @@ static void rtl_rate_free_sta(void *rtlpriv, } static struct rate_control_ops rtl_rate_ops = { - .module = NULL, .name = "rtl_rc", .alloc = rtl_rate_alloc, .free = rtl_rate_free, diff --git a/drivers/staging/rtl8821ae/regd.c b/drivers/staging/rtl8821ae/regd.c index d89f15cb8089..0a4b3984b7ef 100644 --- a/drivers/staging/rtl8821ae/regd.c +++ b/drivers/staging/rtl8821ae/regd.c @@ -243,7 +243,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy, } /* - *If a country IE has been recieved check its rule for this + *If a country IE has been received check its rule for this *channel first before enabling active scan. The passive scan *would have been enforced by the initial processing of our *custom regulatory domain. @@ -455,7 +455,7 @@ int rtl_regd_init(struct ieee80211_hw *hw, if (rtlpriv->regd.country_code >= COUNTRY_CODE_MAX) { RT_TRACE(COMP_REGD, DBG_DMESG, - (KERN_DEBUG "rtl: EEPROM indicates invalid contry code" + (KERN_DEBUG "rtl: EEPROM indicates invalid country code" "world wide 13 should be used\n")); rtlpriv->regd.country_code = COUNTRY_CODE_WORLD_WIDE_13; diff --git a/drivers/staging/rtl8821ae/regd.h b/drivers/staging/rtl8821ae/regd.h index abc60ab8165c..dceb3f18200b 100644 --- a/drivers/staging/rtl8821ae/regd.h +++ b/drivers/staging/rtl8821ae/regd.h @@ -30,8 +30,8 @@ #ifndef __RTL_REGD_H__ #define __RTL_REGD_H__ -#define IEEE80211_CHAN_NO_IBSS 1<<2 -#define IEEE80211_CHAN_PASSIVE_SCAN 1<<1 +#define IEEE80211_CHAN_NO_IBSS (1 << 2) +#define IEEE80211_CHAN_PASSIVE_SCAN (1 << 1) #define WIPHY_FLAG_CUSTOM_REGULATORY BIT(0) #define WIPHY_FLAG_STRICT_REGULATORY BIT(1) #define WIPHY_FLAG_DISABLE_BEACON_HINTS BIT(2) diff --git a/drivers/staging/rtl8821ae/rtl8821ae/dm.c b/drivers/staging/rtl8821ae/rtl8821ae/dm.c index 8634206b8929..e0efcd281dfe 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/dm.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/dm.c @@ -731,7 +731,7 @@ void rtl8821ae_dm_find_minimum_rssi(struct ieee80211_hw *hw) rtl_dm_dig->min_undecorated_pwdb_for_dm = rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; RT_TRACE(COMP_BB_POWERSAVING, DBG_LOUD, - ("AP Ext Port or disconnet PWDB = 0x%x \n", + ("AP Ext Port or disconnect PWDB = 0x%x \n", rtl_dm_dig->min_undecorated_pwdb_for_dm)); } RT_TRACE(COMP_DIG, DBG_LOUD, ("MinUndecoratedPWDBForDM =%d\n", @@ -925,7 +925,7 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw) if (rtlpriv->falsealm_cnt.cnt_all > 10000) { RT_TRACE(COMP_DIG, DBG_LOUD, - ("rtl8821ae_dm_dig(): Abnornally false alarm case. \n")); + ("rtl8821ae_dm_dig(): Abnormally false alarm case. \n")); if (dm_digtable.large_fa_hit != 3) dm_digtable.large_fa_hit++; @@ -1087,7 +1087,7 @@ static void rtl8821ae_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw) else falsealm_cnt->cnt_all = falsealm_cnt->cnt_ofdm_fail; - /*reset OFDM FA coutner*/ + /*reset OFDM FA counter*/ rtl_set_bbreg(hw, ODM_REG_OFDM_FA_RST_11AC, BIT(17), 1); rtl_set_bbreg(hw, ODM_REG_OFDM_FA_RST_11AC, BIT(17), 0); /* reset CCK FA counter*/ @@ -1316,7 +1316,7 @@ u8 rtl8812ae_hw_rate_to_mrate( /*----------------------------------------------------------------------------- * Function: odm_TxPwrTrackSetPwr88E() * - * Overview: 88E change all channel tx power accordign to flag. + * Overview: 88E change all channel tx power according to flag. * OFDM & CCK are all different. * * Input: NONE @@ -1537,7 +1537,7 @@ void rtl8812ae_dm_txpwr_track_set_pwr(struct ieee80211_hw *hw, rtldm->modify_txagc_flag_path_b = false; RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, - ("******Path_B pDM_Odm->Modify_TxAGC_Flag = FALSE \n")); + ("******Path_B dm_Odm->Modify_TxAGC_Flag = FALSE \n")); } } } @@ -1654,7 +1654,7 @@ void rtl8812ae_dm_txpower_tracking_callback_thermalmeter if (delta > 0 && rtldm->txpower_track_control) { - /*"delta" here is used to record the absolute value of differrence.*/ + /*"delta" here is used to record the absolute value of difference.*/ delta = thermal_value > rtlefuse->eeprom_thermalmeter ? \ (thermal_value - rtlefuse->eeprom_thermalmeter) : \ (rtlefuse->eeprom_thermalmeter - thermal_value); @@ -1976,7 +1976,7 @@ void rtl8821ae_phy_lccalibrate( /*----------------------------------------------------------------------------- * Function: odm_TxPwrTrackSetPwr88E() * - * Overview: 88E change all channel tx power accordign to flag. + * Overview: 88E change all channel tx power according to flag. * OFDM & CCK are all different. * * Input: NONE @@ -2159,7 +2159,7 @@ void rtl8821ae_dm_txpower_tracking_callback_thermalmeter u8 *delta_swing_table_idx_tup_b; u8 *delta_swing_table_idx_tdown_b; - /*2. Initilization ( 7 steps in total )*/ + /*2. Initialization ( 7 steps in total )*/ rtl8821ae_get_delta_swing_table(hw, (u8**)&delta_swing_table_idx_tup_a, (u8**)&delta_swing_table_idx_tdown_a, (u8**)&delta_swing_table_idx_tup_b, @@ -2244,7 +2244,7 @@ void rtl8821ae_dm_txpower_tracking_callback_thermalmeter if (delta > 0 && rtldm->txpower_track_control) { - /*"delta" here is used to record the absolute value of differrence.*/ + /*"delta" here is used to record the absolute value of difference.*/ delta = thermal_value > rtlefuse->eeprom_thermalmeter ? \ (thermal_value - rtlefuse->eeprom_thermalmeter) : \ (rtlefuse->eeprom_thermalmeter - thermal_value); @@ -2613,11 +2613,11 @@ static void rtl8821ae_dm_check_edca_turbo(struct ieee80211_hw *hw) RT_TRACE(COMP_TURBO, DBG_LOUD, ("rtl8821ae_dm_check_edca_turbo=====>")); RT_TRACE(COMP_TURBO, DBG_LOUD, - ("Orginial BE PARAM: 0x%x\n", + ("Original BE PARAM: 0x%x\n", rtl_read_dword(rtlpriv, DM_REG_EDCA_BE_11N))); /*=============================== - list paramter for different platform + list parameter for different platform ===============================*/ b_last_is_cur_rdl_state = rtlpriv->dm.bis_cur_rdlstate; pb_is_cur_rdl_state = &( rtlpriv->dm.bis_cur_rdlstate); @@ -2963,7 +2963,7 @@ void rtl8821ae_dm_dynamic_atc_switch(struct ieee80211_hw *hw) "Crystal cap = 0x%x, Crystal cap offset = %d\n", rtldm->crystal_cap, adjust_xtal)); - /*3.Adjudt Crystal Cap.*/ + /*3.Adjust Crystal Cap.*/ if (adjust_xtal != 0){ rtldm->is_freeze = 0; rtldm->crystal_cap += adjust_xtal; diff --git a/drivers/staging/rtl8821ae/rtl8821ae/fw.c b/drivers/staging/rtl8821ae/rtl8821ae/fw.c index 4083cab926a3..46eb4125d18f 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/fw.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/fw.c @@ -164,7 +164,7 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw) if (counter >= FW_8821AE_POLLING_TIMEOUT_COUNT) { RT_TRACE(COMP_ERR, DBG_LOUD, - ("chksum report faill ! REG_MCUFWDL:0x%08x .\n", + ("chksum report fail ! REG_MCUFWDL:0x%08x .\n", value32)); goto exit; } @@ -368,7 +368,7 @@ static void _rtl8821ae_fill_h2c_command(struct ieee80211_hw *hw, wait_h2c_limmit--; if (wait_h2c_limmit == 0) { RT_TRACE(COMP_CMD, DBG_LOUD, - ("Wating too long for FW read " + ("Waiting too long for FW read " "clear HMEBox(%d)!\n", boxnum)); break; } @@ -378,7 +378,7 @@ static void _rtl8821ae_fill_h2c_command(struct ieee80211_hw *hw, isfw_read = _rtl8821ae_check_fw_read_last_h2c(hw, boxnum); u1b_tmp = rtl_read_byte(rtlpriv, 0x130); RT_TRACE(COMP_CMD, DBG_LOUD, - ("Wating for FW read clear HMEBox(%d)!!! " + ("Waiting for FW read clear HMEBox(%d)!!! " "0x130 = %2x\n", boxnum, u1b_tmp)); } } @@ -1179,7 +1179,7 @@ void rtl8821ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished) ("Set RSVD page location to Fw FAIL!!!!!!.\n")); } -/*Shoud check FW support p2p or not.*/ +/*Should check FW support p2p or not.*/ void rtl8821ae_set_p2p_ctw_period_cmd(struct ieee80211_hw *hw, u8 ctwindow) { u8 u1_ctwindow_period[1] ={ ctwindow}; diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.h b/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.h index 799cc6f95cc1..b365f82f481c 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.h +++ b/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.h @@ -142,7 +142,7 @@ void rtl8821ae_dm_bt_hw_coex_all_off(struct ieee80211_hw *hw); long rtl8821ae_dm_bt_get_rx_ss(struct ieee80211_hw *hw); void rtl8821ae_dm_bt_balance(struct ieee80211_hw *hw, bool b_balance_on, u8 ms0, u8 ms1); -void rtl8821ae_dm_bt_agc_table(struct ieee80211_hw *hw, u8 tyep); +void rtl8821ae_dm_bt_agc_table(struct ieee80211_hw *hw, u8 type); void rtl8821ae_dm_bt_bb_back_off_level(struct ieee80211_hw *hw, u8 type); u8 rtl8821ae_dm_bt_check_coex_rssi_state(struct ieee80211_hw *hw, u8 level_num, u8 rssi_thresh, u8 rssi_thresh1); diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c index 79386ee142f9..7b1d113505fb 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c @@ -157,7 +157,7 @@ bool rtl8821ae_dm_bt_is_same_coexist_state(struct ieee80211_hw *hw) &&(rtlpcipriv->btcoexist.previous_state_h == rtlpcipriv->btcoexist.current_state_h)) { RT_TRACE(COMP_BT_COEXIST, DBG_DMESG, - ("[DM][BT], Coexist state do not chang!!\n")); + ("[DM][BT], Coexist state do not change!!\n")); return true; } else { RT_TRACE(COMP_BT_COEXIST, DBG_DMESG, @@ -902,7 +902,7 @@ void rtl8821ae_dm_bt_set_bt_dm(struct ieee80211_hw *hw, struct btdm_8821ae *p_bt /* * Note: - * We should add delay for making sure sw DacSwing can be set sucessfully. + * We should add delay for making sure sw DacSwing can be set successfully. * because of that rtl8821ae_dm_bt_set_fw_2_ant_hid() and rtl8821ae_dm_bt_set_fw_tdma_ctrl() * will overwrite the reg 0x880. */ @@ -2025,7 +2025,7 @@ void rtl_8821ae_c2h_command_handle(struct ieee80211_hw *hw) rtl_write_byte(rtlpriv, 0x1AF, 0x00); return; } - ptmp_buf = (u8 *) kmalloc(c2h_event.cmd_len, GFP_KERNEL); + ptmp_buf = kmalloc(c2h_event.cmd_len, GFP_KERNEL); if(ptmp_buf == NULL) { RT_TRACE(COMP_FW, DBG_TRACE, ("malloc cmd buf failed\n")); return; diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hw.c b/drivers/staging/rtl8821ae/rtl8821ae/hw.c index 5ed7a114c56b..1b8583b689d4 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/hw.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/hw.c @@ -147,6 +147,7 @@ static void _rtl8821ae_set_fw_clock_on(struct ieee80211_hw *hw, } else { rtlhal->bfw_clk_change_in_progress = false; spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); + break; } } @@ -1016,7 +1017,7 @@ static void _rtl8821ae_hw_configure(struct ieee80211_hw *hw) /* ARFB table 12 for 11ac 24G 1SS */ rtl_write_dword(rtlpriv, REG_ARFR3, 0x00000015); rtl_write_dword(rtlpriv, REG_ARFR3 + 4, 0xffcff000); - /* 0x420[7] = 0 , enable retry AMPDU in new AMPD not singal MPDU. */ + /* 0x420[7] = 0 , enable retry AMPDU in new AMPD not signal MPDU. */ rtl_write_word(rtlpriv, REG_FWHW_TXQ_CTRL, 0x1F00); rtl_write_byte(rtlpriv, REG_AMPDU_MAX_TIME, 0x70); @@ -1406,7 +1407,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw) rtl8821ae_phy_mac_config(hw); /* because last function modify RCR, so we update * rcr var here, or TP will unstable for receive_config - * is wrong, RX RCR_ACRC32 will cause TP unstabel & Rx + * is wrong, RX RCR_ACRC32 will cause TP unstable & Rx * RCR_APP_ICV will cause mac80211 unassoc for cisco 1252 rtlpci->receive_config = rtl_read_dword(rtlpriv, REG_RCR); rtlpci->receive_config &= ~(RCR_ACRC32 | RCR_AICV); @@ -1562,7 +1563,7 @@ static enum version_8821ae _rtl8821ae_read_chip_version(struct ieee80211_hw *hw) break; default: RT_TRACE(COMP_INIT, DBG_LOUD, - ("Chip Version ID: Unknow (0x%X).\n", version)); + ("Chip Version ID: Unknown (0x%X).\n", version)); break; } @@ -1622,7 +1623,7 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw, rtl_write_byte(rtlpriv, (MSR), bt_msr); rtlpriv->cfg->ops->led_control(hw, ledaction); - if ((bt_msr & 0xfc) == MSR_AP) + if ((bt_msr & ~0xfc) == MSR_AP) rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x00); else rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x66); @@ -2371,7 +2372,7 @@ static void _rtl8812ae_read_adapter_info(struct ieee80211_hw *hw, bool b_pseudo_ if (rtlefuse->eeprom_channelplan == 0xff) rtlefuse->eeprom_channelplan = 0x7F; - /* set channel paln to world wide 13 */ + /* set channel plan to world wide 13 */ //rtlefuse->channel_plan = (u8) rtlefuse->eeprom_channelplan; /*parse xtal*/ @@ -2534,7 +2535,7 @@ static void _rtl8821ae_read_adapter_info(struct ieee80211_hw *hw, bool b_pseudo_ if (rtlefuse->eeprom_channelplan == 0xff) rtlefuse->eeprom_channelplan = 0x7F; - /* set channel paln to world wide 13 */ + /* set channel plan to world wide 13 */ //rtlefuse->channel_plan = (u8) rtlefuse->eeprom_channelplan; /*parse xtal*/ diff --git a/drivers/staging/rtl8821ae/rtl8821ae/phy.c b/drivers/staging/rtl8821ae/rtl8821ae/phy.c index d02fca38a2b2..1dd33016b4b9 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/phy.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/phy.c @@ -86,7 +86,7 @@ void rtl8812ae_fixspur( /* 0x8AC[11:10] = 2'b10*/ - /* <20120914, Kordan> A workarould to resolve + /* <20120914, Kordan> A workaround to resolve 2480Mhz spur by setting ADC clock as 160M. (Asked by Binson)*/ if (band_width == HT_CHANNEL_WIDTH_20 && (channel == 13 || channel == 14)) { @@ -107,7 +107,7 @@ void rtl8812ae_fixspur( } else if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { - /* <20120914, Kordan> A workarould to resolve + /* <20120914, Kordan> A workaround to resolve 2480Mhz spur by setting ADC clock as 160M. (Asked by Binson)*/ if (band_width == HT_CHANNEL_WIDTH_20 && (channel == 13 || channel == 14)) @@ -441,8 +441,8 @@ u32 phy_get_tx_bb_swing_8812A( struct rtl_dm *rtldm = rtl_dm(rtlpriv); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); - char bb_swing_2g = (char) (-1 * 0xFF); - char bb_swing_5g = (char) (-1 * 0xFF); + char bb_swing_2g = (char) ((-1 * 0xFF) & 0xFF); + char bb_swing_5g = (char) ((-1 * 0xFF) & 0xFF); u32 out = 0x200; const char auto_temp = -1; diff --git a/drivers/staging/rtl8821ae/rtl8821ae/phy.h b/drivers/staging/rtl8821ae/rtl8821ae/phy.h index a932d8c9d45d..a80bf739940a 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/phy.h +++ b/drivers/staging/rtl8821ae/rtl8821ae/phy.h @@ -30,7 +30,7 @@ #ifndef __RTL8821AE_PHY_H__ #define __RTL8821AE_PHY_H__ -/*It must always set to 4, otherwise read efuse table secquence will be wrong.*/ +/*It must always set to 4, otherwise read efuse table sequence will be wrong.*/ #define MAX_TX_COUNT 4 #define TX_1S 0 #define TX_2S 1 diff --git a/drivers/staging/rtl8821ae/rtl8821ae/pwrseq.h b/drivers/staging/rtl8821ae/rtl8821ae/pwrseq.h index 8b39c042fa93..480a6bb6d76b 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/pwrseq.h +++ b/drivers/staging/rtl8821ae/rtl8821ae/pwrseq.h @@ -81,7 +81,7 @@ {0x0047, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/* 0x47[7:0] = 00 gpio mode */ \ {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/* suspend option all off */ \ {0x0014, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x80, BIT7},/*0x14[7] = 1 turn on ZCD */ \ - {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, BIT0},/* 0x15[0] =1 trun on ZCD */ \ + {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, BIT0},/* 0x15[0] =1 turn on ZCD */ \ {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x10, BIT4},/*0x23[4] = 1 hpon LDO sleep mode */ \ {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x02, 0},/*0x8[1] = 0 ANA clk =500k */ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3, BIT3}, /*0x04[11] = 2b'11 enable WL suspend for PCIe*/ @@ -91,7 +91,7 @@ /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3, 0}, /*0x04[11] = 2b'01enable WL suspend*/ \ {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x10, 0},/*0x23[4] = 0 hpon LDO sleep mode leave */ \ - {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, 0},/* 0x15[0] =0 trun off ZCD */ \ + {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, 0},/* 0x15[0] =0 turn off ZCD */ \ {0x0014, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x80, 0},/*0x14[7] = 0 turn off ZCD */ \ {0x0046, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x00},/* gpio0~7 input mode */ \ {0x0043, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x00},/* gpio11 input mode, gpio10~8 input mode */ @@ -110,7 +110,7 @@ {0x0046, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xff},/* gpio0~7 output mode */ \ {0x0047, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/* 0x47[7:0] = 00 gpio mode */ \ {0x0014, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x80, BIT7},/*0x14[7] = 1 turn on ZCD */ \ - {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, BIT0},/* 0x15[0] =1 trun on ZCD */ \ + {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, BIT0},/* 0x15[0] =1 turn on ZCD */ \ {0x0012, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, 0},/*0x12[0] = 0 force PFM mode */ \ {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x10, BIT4},/*0x23[4] = 1 hpon LDO sleep mode */ \ {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x02, 0},/*0x8[1] = 0 ANA clk =500k */ \ @@ -124,7 +124,7 @@ /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \ {0x0012, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0},/*0x12[0] = 1 force PWM mode */ \ {0x0014, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x80, 0},/*0x14[7] = 0 turn off ZCD */ \ - {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, 0},/* 0x15[0] =0 trun off ZCD */ \ + {0x0015, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x01, 0},/* 0x15[0] =0 turn off ZCD */ \ {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x10, 0},/*0x23[4] = 0 hpon LDO leave sleep mode */ \ {0x0046, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x00},/* gpio0~7 input mode */ \ {0x0043, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x00},/* gpio11 input mode, gpio10~8 input mode */ \ @@ -204,7 +204,7 @@ extern struct wlan_pwr_cfg rtl8812_leave_lps_flow[RTL8812_TRANS_LPS_TO_ACT_STEP 4: LPS--Low Power State 5: SUS--Suspend - The transision from different states are defined below + The transition from different states are defined below TRANS_CARDEMU_TO_ACT TRANS_ACT_TO_CARDEMU TRANS_CARDEMU_TO_SUS diff --git a/drivers/staging/rtl8821ae/rtl8821ae/pwrseqcmd.c b/drivers/staging/rtl8821ae/rtl8821ae/pwrseqcmd.c index 710bc015251c..ff1887187770 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/pwrseqcmd.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/pwrseqcmd.c @@ -82,7 +82,7 @@ bool rtl_hal_pwrseqcmdparsing (struct rtl_priv* rtlpriv, u8 cut_version, value = value | (GET_PWR_CFG_VALUE(pwr_cfg_cmd) & GET_PWR_CFG_MASK(pwr_cfg_cmd)); - /*Write the value back to sytem register*/ + /*Write the value back to system register*/ rtl_write_byte(rtlpriv, offset, value); } break; diff --git a/drivers/staging/rtl8821ae/rtl8821ae/reg.h b/drivers/staging/rtl8821ae/rtl8821ae/reg.h index 09c5f00d2603..beffb4243b1e 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/reg.h +++ b/drivers/staging/rtl8821ae/rtl8821ae/reg.h @@ -596,13 +596,13 @@ #define IMR_BCNDMAINT3 BIT(23) /* Beacon DMA Interrupt 3 */ #define IMR_BCNDMAINT2 BIT(22) /* Beacon DMA Interrupt 2 */ #define IMR_BCNDMAINT1 BIT(21) /* Beacon DMA Interrupt 1 */ -#define IMR_BCNDOK7 BIT(20) /* Beacon Queue DMA OK Interrup 7 */ -#define IMR_BCNDOK6 BIT(19) /* Beacon Queue DMA OK Interrup 6 */ -#define IMR_BCNDOK5 BIT(18) /* Beacon Queue DMA OK Interrup 5 */ -#define IMR_BCNDOK4 BIT(17) /* Beacon Queue DMA OK Interrup 4 */ -#define IMR_BCNDOK3 BIT(16) /* Beacon Queue DMA OK Interrup 3 */ -#define IMR_BCNDOK2 BIT(15) /* Beacon Queue DMA OK Interrup 2 */ -#define IMR_BCNDOK1 BIT(14) /* Beacon Queue DMA OK Interrup 1 */ +#define IMR_BCNDOK7 BIT(20) /* Beacon Queue DMA OK Interrupt 7 */ +#define IMR_BCNDOK6 BIT(19) /* Beacon Queue DMA OK Interrupt 6 */ +#define IMR_BCNDOK5 BIT(18) /* Beacon Queue DMA OK Interrupt 5 */ +#define IMR_BCNDOK4 BIT(17) /* Beacon Queue DMA OK Interrupt 4 */ +#define IMR_BCNDOK3 BIT(16) /* Beacon Queue DMA OK Interrupt 3 */ +#define IMR_BCNDOK2 BIT(15) /* Beacon Queue DMA OK Interrupt 2 */ +#define IMR_BCNDOK1 BIT(14) /* Beacon Queue DMA OK Interrupt 1 */ #define IMR_ATIMEND_E BIT(13) /* ATIM Window End Extension for Win7 */ #define IMR_TXERR BIT(11) /* Tx Error Flag Interrupt Status, write 1 clear. */ #define IMR_RXERR BIT(10) /* Rx Error Flag INT Status, Write 1 clear */ @@ -613,7 +613,7 @@ #define HWSET_MAX_SIZE 512 #define EFUSE_MAX_SECTION 64 #define EFUSE_REAL_CONTENT_LEN 256 -#define EFUSE_OOB_PROTECT_BYTES 18 /* PG data exclude header, dummy 7 bytes frome CP test and reserved 1byte.*/ +#define EFUSE_OOB_PROTECT_BYTES 18 /* PG data exclude header, dummy 7 bytes from CP test and reserved 1byte.*/ #define EEPROM_DEFAULT_TSSI 0x0 @@ -1511,7 +1511,7 @@ #define ROFDM0_TXCOEFF5 0xcb4 #define ROFDM0_TXCOEFF6 0xcb8 -/*Path_A RFE cotrol */ +/*Path_A RFE control */ #define RA_RFE_CTRL_8812 0xcb8 /*Path_B RFE control*/ #define RB_RFE_CTRL_8812 0xeb8 @@ -2336,19 +2336,19 @@ #define WOL_REASON_DEAUTH BIT(3) #define WOL_REASON_FW_DISCONNECT BIT(4) -#define RA_RFE_PINMUX 0xcb0 /* Path_A RFE cotrol pinmux*/ +#define RA_RFE_PINMUX 0xcb0 /* Path_A RFE control pinmux*/ #define RB_RFE_PINMUX 0xeb0 /* Path_B RFE control pinmux*/ #define RA_RFE_INV 0xcb4 #define RB_RFE_INV 0xeb4 /* RXIQC */ -#define RA_RXIQC_AB 0xc10 /*RxIQ imblance matrix coeff. A & B*/ -#define RA_RXIQC_CD 0xc14 /*RxIQ imblance matrix coeff. C & D*/ +#define RA_RXIQC_AB 0xc10 /*RxIQ imbalance matrix coeff. A & B*/ +#define RA_RXIQC_CD 0xc14 /*RxIQ imbalance matrix coeff. C & D*/ #define RA_TXSCALE 0xc1c /* Pah_A TX scaling factor*/ #define RB_TXSCALE 0xe1c /* Path_B TX scaling factor*/ -#define RB_RXIQC_AB 0xe10 /*RxIQ imblance matrix coeff. A & B*/ -#define RB_RXIQC_CD 0xe14 /*RxIQ imblance matrix coeff. C & D*/ +#define RB_RXIQC_AB 0xe10 /*RxIQ imbalance matrix coeff. A & B*/ +#define RB_RXIQC_CD 0xe14 /*RxIQ imbalance matrix coeff. C & D*/ #define RXIQC_AC 0x02ff /*bit mask for IQC matrix element A & C*/ #define RXIQC_BD 0x02ff0000 /*bit mask for IQC matrix element A & C*/ diff --git a/drivers/staging/rtl8821ae/rtl8821ae/sw.c b/drivers/staging/rtl8821ae/rtl8821ae/sw.c index 85a3474fc099..a8d175569770 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/sw.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/sw.c @@ -57,9 +57,9 @@ void rtl8821ae_init_aspm_vars(struct ieee80211_hw *hw) * 0 - Disable ASPM, * 1 - Enable ASPM without Clock Req, * 2 - Enable ASPM with Clock Req, - * 3 - Alwyas Enable ASPM with Clock Req, + * 3 - Always Enable ASPM with Clock Req, * 4 - Always Enable ASPM without Clock Req. - * set defult to RTL8192CE:3 RTL8192E:2 + * set default to RTL8192CE:3 RTL8192E:2 * */ rtlpci->const_pci_aspm = 3; diff --git a/drivers/staging/rtl8821ae/rtl8821ae/trx.c b/drivers/staging/rtl8821ae/rtl8821ae/trx.c index 75ae4387fe19..f40a93c0d2bb 100644 --- a/drivers/staging/rtl8821ae/rtl8821ae/trx.c +++ b/drivers/staging/rtl8821ae/rtl8821ae/trx.c @@ -37,8 +37,8 @@ #include "trx.h" #include "led.h" #include "dm.h" -#include "phy.h" -u8 _rtl8821ae_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue) + +static u8 _rtl8821ae_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue) { u16 fc = rtl_get_fc(skb); @@ -244,7 +244,7 @@ static void _rtl8821ae_query_rxphystatus(struct ieee80211_hw *hw, cck_agc_rpt = cck_buf->cck_agc_rpt; /* (1)Hardware does not provide RSSI for CCK */ - /* (2)PWDB, Average PWDB cacluated by + /* (2)PWDB, Average PWDB calculated by * hardware (for rate adaptive) */ if (ppsc->rfpwr_state == ERFON) cck_highpwr = (u8) rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, @@ -363,7 +363,7 @@ static void _rtl8821ae_query_rxphystatus(struct ieee80211_hw *hw, pstatus->rx_mimo_signalstrength[i] = (u8) rssi; } - /* (2)PWDB, Average PWDB cacluated by + /* (2)PWDB, Average PWDB calculated by * hardware (for rate adaptive) */ rx_pwr_all = ((p_drvinfo->pwdb_all >> 1) & 0x7f) - 110; @@ -603,7 +603,7 @@ bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw, /* hw will set status->decrypted true, if it finds the * frame is open data frame or mgmt frame. */ - /* So hw will not decryption robust managment frame + /* So hw will not decryption robust management frame * for IEEE80211w but still set status->decrypted * true, so here we should set it back to undecrypted * for IEEE80211w frame, and mac80211 sw will help @@ -616,7 +616,7 @@ bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw, return false; } - if ((ieee80211_is_robust_mgmt_frame(hdr)) && + if ((_ieee80211_is_robust_mgmt_frame(hdr)) && (ieee80211_has_protected(hdr->frame_control))) rx_status->flag &= ~RX_FLAG_DECRYPTED; else diff --git a/drivers/staging/rtl8821ae/wifi.h b/drivers/staging/rtl8821ae/wifi.h index 76bef93ad70a..17a9d9f8781d 100644 --- a/drivers/staging/rtl8821ae/wifi.h +++ b/drivers/staging/rtl8821ae/wifi.h @@ -40,10 +40,10 @@ #define RF_CHANGE_BY_INIT 0 -#define RF_CHANGE_BY_IPS BIT(28) -#define RF_CHANGE_BY_PS BIT(29) -#define RF_CHANGE_BY_HW BIT(30) -#define RF_CHANGE_BY_SW BIT(31) +#define RF_CHANGE_BY_IPS BIT(28) +#define RF_CHANGE_BY_PS BIT(29) +#define RF_CHANGE_BY_HW BIT(30) +#define RF_CHANGE_BY_SW BIT(31) #define IQK_ADDA_REG_NUM 16 #define IQK_MAC_REG_NUM 4 @@ -69,35 +69,35 @@ #define QBSS_LOAD_SIZE 5 #define MAX_WMMELE_LENGTH 64 -#define TOTAL_CAM_ENTRY 32 +#define TOTAL_CAM_ENTRY 32 /*slot time for 11g. */ #define RTL_SLOT_TIME_9 9 #define RTL_SLOT_TIME_20 20 /*related with tcp/ip. */ -/*if_ehther.h*/ -#define ETH_P_PAE 0x888E /*Port Access Entity +/*if_ether.h*/ +#define ETH_P_PAE 0x888E /*Port Access Entity *(IEEE 802.1X) */ -#define ETH_P_IP 0x0800 /*Internet Protocol packet */ -#define ETH_P_ARP 0x0806 /*Address Resolution packet */ -#define SNAP_SIZE 6 +#define ETH_P_IP 0x0800 /*Internet Protocol packet */ +#define ETH_P_ARP 0x0806 /*Address Resolution packet */ +#define SNAP_SIZE 6 #define PROTOC_TYPE_SIZE 2 /*related with 802.11 frame*/ -#define MAC80211_3ADDR_LEN 24 -#define MAC80211_4ADDR_LEN 30 +#define MAC80211_3ADDR_LEN 24 +#define MAC80211_4ADDR_LEN 30 #define CHANNEL_MAX_NUMBER (14 + 24 + 21) /* 14 is the max * channel number */ #define CHANNEL_MAX_NUMBER_2G 14 -#define CHANNEL_MAX_NUMBER_5G 54 /* Please refer to +#define CHANNEL_MAX_NUMBER_5G 54 /* Please refer to *"phy_GetChnlGroup8812A" and * "Hal_ReadTxPowerInfo8812A"*/ #define CHANNEL_MAX_NUMBER_5G_80M 7 #define CHANNEL_GROUP_MAX (3 + 9) /* ch1~3, ch4~9, ch10~14 * total three groups */ -#define MAX_PG_GROUP 13 +#define MAX_PG_GROUP 13 #define CHANNEL_GROUP_MAX_2G 3 #define CHANNEL_GROUP_IDX_5GL 3 #define CHANNEL_GROUP_IDX_5GM 6 @@ -112,14 +112,14 @@ #define MAX_NUM_RATES 264 /*for 88E use*/ -/*It must always set to 4, otherwise read efuse table secquence will be wrong.*/ +/*It must always set to 4, otherwise read efuse table sequence will be wrong.*/ #define MAX_TX_COUNT 4 #define MAX_RF_PATH 4 #define MAX_CHNL_GROUP_24G 6 #define MAX_CHNL_GROUP_5G 14 /* BK, BE, VI, VO, HCCA, MANAGEMENT, COMMAND, HIGH, BEACON. */ -#define MAX_TX_QUEUE 9 +#define MAX_TX_QUEUE 9 #define TX_PWR_BY_RATE_NUM_BAND 2 #define TX_PWR_BY_RATE_NUM_RF 4 @@ -127,11 +127,11 @@ #define MAX_BASE_NUM_IN_PHY_REG_PG_24G 6 #define MAX_BASE_NUM_IN_PHY_REG_PG_5G 5 -#define DELTA_SWINGIDX_SIZE 30 -#define BAND_NUM 3 +#define DELTA_SWINGIDX_SIZE 30 +#define BAND_NUM 3 /*Now, it's just for 8192ee *not OK yet, keep it 0*/ -#define DMA_IS_64BIT 0 +#define DMA_IS_64BIT 0 #define RTL8192EE_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg */ struct txpower_info_2g { @@ -219,7 +219,7 @@ enum hardware_type { }; enum scan_operation_backup_opt { - SCAN_OPT_BACKUP_BAND0=0, + SCAN_OPT_BACKUP_BAND0 = 0, SCAN_OPT_BACKUP_BAND1, SCAN_OPT_RESTORE, SCAN_OPT_MAX @@ -435,7 +435,7 @@ enum ht_channel_width { HT_CHANNEL_WIDTH_80 = 2, }; -/* Ref: 802.11i sepc D10.0 7.3.2.25.1 +/* Ref: 802.11i spec D10.0 7.3.2.25.1 Cipher Suites Encryption Algorithms */ enum rt_enc_alg { NO_ENCRYPTION = 0, @@ -499,14 +499,14 @@ enum rtl_var_map { RTL_IMR_BCNDMAINT3, /*Beacon DMA Interrupt 3 */ RTL_IMR_BCNDMAINT2, /*Beacon DMA Interrupt 2 */ RTL_IMR_BCNDMAINT1, /*Beacon DMA Interrupt 1 */ - RTL_IMR_BCNDOK8, /*Beacon Queue DMA OK Interrup 8 */ - RTL_IMR_BCNDOK7, /*Beacon Queue DMA OK Interrup 7 */ - RTL_IMR_BCNDOK6, /*Beacon Queue DMA OK Interrup 6 */ - RTL_IMR_BCNDOK5, /*Beacon Queue DMA OK Interrup 5 */ - RTL_IMR_BCNDOK4, /*Beacon Queue DMA OK Interrup 4 */ - RTL_IMR_BCNDOK3, /*Beacon Queue DMA OK Interrup 3 */ - RTL_IMR_BCNDOK2, /*Beacon Queue DMA OK Interrup 2 */ - RTL_IMR_BCNDOK1, /*Beacon Queue DMA OK Interrup 1 */ + RTL_IMR_BCNDOK8, /*Beacon Queue DMA OK Interrupt 8 */ + RTL_IMR_BCNDOK7, /*Beacon Queue DMA OK Interrupt 7 */ + RTL_IMR_BCNDOK6, /*Beacon Queue DMA OK Interrupt 6 */ + RTL_IMR_BCNDOK5, /*Beacon Queue DMA OK Interrupt 5 */ + RTL_IMR_BCNDOK4, /*Beacon Queue DMA OK Interrupt 4 */ + RTL_IMR_BCNDOK3, /*Beacon Queue DMA OK Interrupt 3 */ + RTL_IMR_BCNDOK2, /*Beacon Queue DMA OK Interrupt 2 */ + RTL_IMR_BCNDOK1, /*Beacon Queue DMA OK Interrupt 1 */ RTL_IMR_TIMEOUT2, /*Timeout interrupt 2 */ RTL_IMR_TIMEOUT1, /*Timeout interrupt 1 */ RTL_IMR_TXFOVW, /*Transmit FIFO Overflow */ @@ -515,10 +515,10 @@ enum rtl_var_map { RTL_IMR_RXFOVW, /*Receive FIFO Overflow */ RTL_IMR_RDU, /*Receive Descriptor Unavailable */ RTL_IMR_ATIMEND, /*For 92C,ATIM Window End Interrupt */ - RTL_IMR_BDOK, /*Beacon Queue DMA OK Interrup */ + RTL_IMR_BDOK, /*Beacon Queue DMA OK Interrupt */ RTL_IMR_HIGHDOK, /*High Queue DMA OK Interrupt */ RTL_IMR_COMDOK, /*Command Queue DMA OK Interrupt*/ - RTL_IMR_TBDOK, /*Transmit Beacon OK interrup */ + RTL_IMR_TBDOK, /*Transmit Beacon OK interrupt */ RTL_IMR_MGNTDOK, /*Management Queue DMA OK Interrupt */ RTL_IMR_TBDER, /*For 92C,Transmit Beacon Error Interrupt */ RTL_IMR_BKDOK, /*AC_BK DMA OK Interrupt */ @@ -645,9 +645,9 @@ enum wireless_mode { }; enum ratr_table_mode { - RATR_INX_WIRELESS_NGB = 0, // BGN 40 Mhz 2SS 1SS - RATR_INX_WIRELESS_NG = 1, // GN or N - RATR_INX_WIRELESS_NB = 2, // BGN 20 Mhz 2SS 1SS or BN + RATR_INX_WIRELESS_NGB = 0, /* BGN 40 Mhz 2SS 1SS */ + RATR_INX_WIRELESS_NG = 1, /* GN or N */ + RATR_INX_WIRELESS_NB = 2, /* BGN 20 Mhz 2SS 1SS or BN */ RATR_INX_WIRELESS_N = 3, RATR_INX_WIRELESS_GB = 4, RATR_INX_WIRELESS_G = 5, @@ -759,7 +759,7 @@ struct rtl_tid_data { struct rtl_ht_agg agg; }; -struct rssi_sta{ +struct rssi_sta { long undecorated_smoothed_pwdb; }; @@ -899,7 +899,7 @@ struct regd_pair_mapping { u16 reg_2ghz_ctl; }; -struct dynamic_primary_cca{ +struct dynamic_primary_cca { u8 pricca_flag; u8 intf_flag; u8 intf_type; @@ -939,14 +939,14 @@ enum p2p_ps_state { P2P_PS_ENABLE = 1, P2P_PS_SCAN = 2, P2P_PS_SCAN_DONE = 3, - P2P_PS_ALLSTASLEEP = 4, // for P2P GO + P2P_PS_ALLSTASLEEP = 4, /* for P2P GO */ }; enum p2p_ps_mode { P2P_PS_NONE = 0, P2P_PS_CTWINDOW = 1, P2P_PS_NOA = 2, - P2P_PS_MIX = 3, // CTWindow and NoA + P2P_PS_MIX = 3, /* CTWindow and NoA */ }; struct rtl_p2p_ps_info { @@ -969,7 +969,7 @@ struct rtl_p2p_ps_info { u32 noa_start_time[P2P_MAX_NOA_NUM]; }; - struct p2p_ps_offload_t { +struct p2p_ps_offload_t { u8 Offload_En:1; u8 role:1; /* 1: Owner, 0: Client */ u8 CTWindow_En:1; @@ -981,7 +981,7 @@ struct rtl_p2p_ps_info { }; #define IQK_MATRIX_REG_NUM 8 -#define IQK_MATRIX_SETTINGS_NUM (14+24+21) // Channels_2_4G_NUM + Channels_5G_20M_NUM + Channels_5G +#define IQK_MATRIX_SETTINGS_NUM (14+24+21) /* Channels_2_4G_NUM + Channels_5G_20M_NUM + Channels_5G */ struct iqk_matrix_regs { bool b_iqk_done; long value[1][IQK_MATRIX_REG_NUM]; @@ -1074,12 +1074,12 @@ struct rtl_phy { enum rt_polarity_ctl polarity_ctl; }; -#define RTL_AGG_STOP 0 +#define RTL_AGG_STOP 0 #define RTL_AGG_PROGRESS 1 -#define RTL_AGG_START 2 +#define RTL_AGG_START 2 #define RTL_AGG_OPERATIONAL 3 -#define RTL_RX_AGG_START 1 -#define RTL_RX_AGG_STOP 0 +#define RTL_RX_AGG_START 1 +#define RTL_RX_AGG_STOP 0 struct rtl_priv; struct rtl_io { @@ -1092,13 +1092,13 @@ struct rtl_io { /*PCI IO map */ unsigned long pci_base_addr; /*device I/O address */ - void (*write8_async) (struct rtl_priv * rtlpriv, u32 addr, u8 val); - void (*write16_async) (struct rtl_priv * rtlpriv, u32 addr, u16 val); - void (*write32_async) (struct rtl_priv * rtlpriv, u32 addr, u32 val); + void (*write8_async)(struct rtl_priv *rtlpriv, u32 addr, u8 val); + void (*write16_async)(struct rtl_priv *rtlpriv, u32 addr, u16 val); + void (*write32_async)(struct rtl_priv *rtlpriv, u32 addr, u32 val); - u8(*read8_sync) (struct rtl_priv * rtlpriv, u32 addr); - u16(*read16_sync) (struct rtl_priv * rtlpriv, u32 addr); - u32(*read32_sync) (struct rtl_priv * rtlpriv, u32 addr); + u8 (*read8_sync)(struct rtl_priv *rtlpriv, u32 addr); + u16 (*read16_sync)(struct rtl_priv *rtlpriv, u32 addr); + u32 (*read32_sync)(struct rtl_priv *rtlpriv, u32 addr); }; @@ -1256,7 +1256,7 @@ struct rtl_security { bool use_defaultkey; /*Encryption Algorithm for Unicast Packet */ enum rt_enc_alg pairwise_enc_algorithm; - /*Encryption Algorithm for Brocast/Multicast */ + /*Encryption Algorithm for Broadcast/Multicast */ enum rt_enc_alg group_enc_algorithm; /*Cam Entry Bitmap */ u32 hwsec_cam_bitmap; @@ -1317,9 +1317,9 @@ struct rtl_pstbl { }; -#define ASSOCIATE_ENTRY_NUM 32+1 +#define ASSOCIATE_ENTRY_NUM (32+1) -struct fast_ant_trainning{ +struct fast_ant_trainning { u8 bssid[6]; u8 antsel_rx_keep_0; u8 antsel_rx_keep_1; @@ -1427,19 +1427,19 @@ struct rtl_dm { char bb_swing_diff_5g; u8 delta_swing_table_idx_24gccka_p[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24gccka_n[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24gcckb_p[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24gccka_n[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24gcckb_p[DELTA_SWINGIDX_SIZE]; u8 delta_swing_table_idx_24gcckb_n[DELTA_SWINGIDX_SIZE]; u8 delta_swing_table_idx_24ga_p[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24ga_n[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24gb_p[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24gb_n[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_5ga_p[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_5ga_n[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_5gb_p[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_5gb_n[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24ga_p_8188e[DELTA_SWINGIDX_SIZE]; - u8 delta_swing_table_idx_24ga_n_8188e[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24ga_n[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24gb_p[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24gb_n[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_5ga_p[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_5ga_n[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_5gb_p[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_5gb_n[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24ga_p_8188e[DELTA_SWINGIDX_SIZE]; + u8 delta_swing_table_idx_24ga_n_8188e[DELTA_SWINGIDX_SIZE]; /* DMSP */ @@ -1451,7 +1451,7 @@ struct rtl_dm { struct fast_ant_trainning fat_table; u8 resp_tx_path; - u8 path_sel; + u8 path_sel; u32 patha_sum; u32 pathb_sum; u32 patha_cnt; @@ -1671,7 +1671,6 @@ struct rtl_stats { u8 rx_mimo_evm_dbm[4]; u16 cfo_short[4]; /* per-path's Cfo_short */ u16 cfo_tail[4]; - u8 rx_pwr[4]; /* per-path's pwdb */ u8 rx_snr[4]; /* per-path's SNR */ u8 bandwidth; @@ -1692,7 +1691,7 @@ struct rtl_stats { }; struct rt_link_detect { - /* count for raoming */ + /* count for roaming */ u32 bcn_rx_inperiod; u32 roam_times; @@ -1756,48 +1755,48 @@ struct proxim { void *proximity_priv; int (*proxim_rx)(struct ieee80211_hw *hw, struct rtl_stats *status, struct sk_buff *skb); - u8 (*proxim_get_var)(struct ieee80211_hw *hw, u8 type); + u8 (*proxim_get_var)(struct ieee80211_hw *hw, u8 type); }; struct rtl_hal_ops { - int (*init_sw_vars) (struct ieee80211_hw * hw); - void (*deinit_sw_vars) (struct ieee80211_hw * hw); - void (*read_eeprom_info) (struct ieee80211_hw * hw); - void (*interrupt_recognized) (struct ieee80211_hw * hw, - u32 * p_inta, u32 * p_intb); - int (*hw_init) (struct ieee80211_hw * hw); - void (*hw_disable) (struct ieee80211_hw * hw); - void (*hw_suspend) (struct ieee80211_hw * hw); - void (*hw_resume) (struct ieee80211_hw * hw); - void (*enable_interrupt) (struct ieee80211_hw * hw); - void (*disable_interrupt) (struct ieee80211_hw * hw); - int (*set_network_type) (struct ieee80211_hw * hw, - enum nl80211_iftype type); + int (*init_sw_vars)(struct ieee80211_hw *hw); + void (*deinit_sw_vars)(struct ieee80211_hw *hw); + void (*read_eeprom_info)(struct ieee80211_hw *hw); + void (*interrupt_recognized)(struct ieee80211_hw *hw, + u32 *p_inta, u32 *p_intb); + int (*hw_init)(struct ieee80211_hw *hw); + void (*hw_disable)(struct ieee80211_hw *hw); + void (*hw_suspend)(struct ieee80211_hw *hw); + void (*hw_resume)(struct ieee80211_hw *hw); + void (*enable_interrupt)(struct ieee80211_hw *hw); + void (*disable_interrupt)(struct ieee80211_hw *hw); + int (*set_network_type)(struct ieee80211_hw *hw, + enum nl80211_iftype type); void (*set_chk_bssid)(struct ieee80211_hw *hw, bool check_bssid); - void (*set_bw_mode) (struct ieee80211_hw * hw, - enum nl80211_channel_type ch_type); - u8(*switch_channel) (struct ieee80211_hw * hw); - void (*set_qos) (struct ieee80211_hw * hw, int aci); - void (*set_bcn_reg) (struct ieee80211_hw * hw); - void (*set_bcn_intv) (struct ieee80211_hw * hw); - void (*update_interrupt_mask) (struct ieee80211_hw * hw, - u32 add_msr, u32 rm_msr); - void (*get_hw_reg) (struct ieee80211_hw * hw, u8 variable, u8 * val); - void (*set_hw_reg) (struct ieee80211_hw * hw, u8 variable, u8 * val); - void (*update_rate_tbl) (struct ieee80211_hw * hw, - struct ieee80211_sta *sta, u8 rssi_level); - void (*pre_fill_tx_bd_desc) (struct ieee80211_hw *hw, u8 *tx_bd_desc, - u8 *desc, u8 queue_index, - struct sk_buff *skb, dma_addr_t addr); - u16 (*rx_desc_buff_remained_cnt) (struct ieee80211_hw *hw, - u8 queue_index); - void (*rx_check_dma_ok) (struct ieee80211_hw *hw, u8 *header_desc, - u8 queue_index); - void (*fill_tx_desc) (struct ieee80211_hw * hw, - struct ieee80211_hdr * hdr, - u8 * pdesc_tx, u8 * pbd_desc, - struct ieee80211_tx_info * info, + void (*set_bw_mode)(struct ieee80211_hw *hw, + enum nl80211_channel_type ch_type); + u8 (*switch_channel)(struct ieee80211_hw *hw); + void (*set_qos)(struct ieee80211_hw *hw, int aci); + void (*set_bcn_reg)(struct ieee80211_hw *hw); + void (*set_bcn_intv)(struct ieee80211_hw *hw); + void (*update_interrupt_mask)(struct ieee80211_hw *hw, + u32 add_msr, u32 rm_msr); + void (*get_hw_reg)(struct ieee80211_hw *hw, u8 variable, u8 *val); + void (*set_hw_reg)(struct ieee80211_hw *hw, u8 variable, u8 *val); + void (*update_rate_tbl)(struct ieee80211_hw *hw, + struct ieee80211_sta *sta, u8 rssi_level); + void (*pre_fill_tx_bd_desc)(struct ieee80211_hw *hw, u8 *tx_bd_desc, + u8 *desc, u8 queue_index, + struct sk_buff *skb, dma_addr_t addr); + u16 (*rx_desc_buff_remained_cnt)(struct ieee80211_hw *hw, + u8 queue_index); + void (*rx_check_dma_ok)(struct ieee80211_hw *hw, u8 *header_desc, + u8 queue_index); + void (*fill_tx_desc)(struct ieee80211_hw *hw, + struct ieee80211_hdr *hdr, + u8 *pdesc_tx, u8 *pbd_desc, + struct ieee80211_tx_info *info, /*<delete in kernel start>*/ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) /*<delete in kernel end>*/ @@ -1805,74 +1804,77 @@ struct rtl_hal_ops { /*<delete in kernel start>*/ #endif /*<delete in kernel end>*/ - struct sk_buff * skb, u8 hw_queue, + struct sk_buff *skb, u8 hw_queue, struct rtl_tcb_desc *ptcb_desc); - void (*fill_tx_cmddesc) (struct ieee80211_hw * hw, u8 * pdesc, - bool b_firstseg, bool b_lastseg, - struct sk_buff * skb); - bool(*query_rx_desc) (struct ieee80211_hw * hw, - struct rtl_stats * status, - struct ieee80211_rx_status * rx_status, - u8 * pdesc, struct sk_buff * skb); - void (*set_channel_access) (struct ieee80211_hw * hw); - bool(*radio_onoff_checking) (struct ieee80211_hw * hw, u8 * valid); - void (*dm_watchdog) (struct ieee80211_hw * hw); - void (*scan_operation_backup) (struct ieee80211_hw * hw, u8 operation); - bool(*set_rf_power_state) (struct ieee80211_hw * hw, - enum rf_pwrstate rfpwr_state); - void (*led_control) (struct ieee80211_hw * hw, - enum led_ctl_mode ledaction); - void (*set_desc) (struct ieee80211_hw *hw, u8 * pdesc, bool istx, - u8 desc_name, u8 * val); - u32(*get_desc) (u8 * pdesc, bool istx, u8 desc_name); - bool (*is_tx_desc_closed) (struct ieee80211_hw *hw, - u8 hw_queue, u16 index); - void (*tx_polling) (struct ieee80211_hw * hw, u8 hw_queue); - void (*enable_hw_sec) (struct ieee80211_hw * hw); - void (*set_key) (struct ieee80211_hw * hw, u32 key_index, - u8 * p_macaddr, bool is_group, u8 enc_algo, - bool is_wepkey, bool clear_all); - void (*init_sw_leds) (struct ieee80211_hw * hw); - u32(*get_bbreg) (struct ieee80211_hw * hw, u32 regaddr, u32 bitmask); - void (*set_bbreg) (struct ieee80211_hw * hw, u32 regaddr, u32 bitmask, - u32 data); - u32(*get_rfreg) (struct ieee80211_hw * hw, enum radio_path rfpath, - u32 regaddr, u32 bitmask); - void (*set_rfreg) (struct ieee80211_hw * hw, enum radio_path rfpath, - u32 regaddr, u32 bitmask, u32 data); + void (*fill_tx_cmddesc)(struct ieee80211_hw *hw, u8 *pdesc, + bool b_firstseg, bool b_lastseg, + struct sk_buff *skb); + bool (*query_rx_desc)(struct ieee80211_hw *hw, + struct rtl_stats *status, + struct ieee80211_rx_status *rx_status, + u8 *pdesc, struct sk_buff *skb); + void (*set_channel_access)(struct ieee80211_hw *hw); + bool (*radio_onoff_checking)(struct ieee80211_hw *hw, u8 *valid); + void (*dm_watchdog)(struct ieee80211_hw *hw); + void (*scan_operation_backup)(struct ieee80211_hw *hw, u8 operation); + bool (*set_rf_power_state)(struct ieee80211_hw *hw, + enum rf_pwrstate rfpwr_state); + void (*led_control)(struct ieee80211_hw *hw, + enum led_ctl_mode ledaction); + void (*set_desc)(struct ieee80211_hw *hw, u8 *pdesc, bool istx, + u8 desc_name, u8 *val); + u32 (*get_desc)(u8 *pdesc, bool istx, u8 desc_name); + bool (*is_tx_desc_closed)(struct ieee80211_hw *hw, + u8 hw_queue, u16 index); + void (*tx_polling)(struct ieee80211_hw *hw, u8 hw_queue); + void (*enable_hw_sec)(struct ieee80211_hw *hw); + void (*set_key)(struct ieee80211_hw *hw, u32 key_index, + u8 *p_macaddr, bool is_group, u8 enc_algo, + bool is_wepkey, bool clear_all); + void (*init_sw_leds)(struct ieee80211_hw *hw); + u32 (*get_bbreg)(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask); + void (*set_bbreg)(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask, + u32 data); + u32 (*get_rfreg)(struct ieee80211_hw *hw, enum radio_path rfpath, + u32 regaddr, u32 bitmask); + void (*set_rfreg)(struct ieee80211_hw *hw, enum radio_path rfpath, + u32 regaddr, u32 bitmask, u32 data); void (*allow_all_destaddr)(struct ieee80211_hw *hw, - bool allow_all_da, bool write_into_reg); - void (*linked_set_reg) (struct ieee80211_hw * hw); - void (*check_switch_to_dmdp) (struct ieee80211_hw * hw); - void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw); - void (*dualmac_switch_to_dmdp) (struct ieee80211_hw *hw); - void (*c2h_command_handle) (struct ieee80211_hw *hw); - void (*bt_wifi_media_status_notify) (struct ieee80211_hw *hw, bool mstate); - void (*bt_turn_off_bt_coexist_before_enter_lps) (struct ieee80211_hw *hw); - void (*fill_h2c_cmd) (struct ieee80211_hw *hw, u8 element_id, - u32 cmd_len, u8 *p_cmdbuffer); - bool (*get_btc_status) (void); - u32 (*rx_command_packet_handler)(struct ieee80211_hw *hw, struct rtl_stats status, struct sk_buff *skb); + bool allow_all_da, bool write_into_reg); + void (*linked_set_reg)(struct ieee80211_hw *hw); + void (*check_switch_to_dmdp)(struct ieee80211_hw *hw); + void (*dualmac_easy_concurrent)(struct ieee80211_hw *hw); + void (*dualmac_switch_to_dmdp)(struct ieee80211_hw *hw); + void (*c2h_command_handle)(struct ieee80211_hw *hw); + void (*bt_wifi_media_status_notify)(struct ieee80211_hw *hw, + bool mstate); + void (*bt_turn_off_bt_coexist_before_enter_lps)(struct ieee80211_hw *hw); + void (*fill_h2c_cmd)(struct ieee80211_hw *hw, u8 element_id, + u32 cmd_len, u8 *p_cmdbuffer); + bool (*get_btc_status)(void); + u32 (*rx_command_packet_handler)(struct ieee80211_hw *hw, + struct rtl_stats status, + struct sk_buff *skb); }; struct rtl_intf_ops { /*com */ void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); - int (*adapter_start) (struct ieee80211_hw * hw); - void (*adapter_stop) (struct ieee80211_hw * hw); + int (*adapter_start)(struct ieee80211_hw *hw); + void (*adapter_stop)(struct ieee80211_hw *hw); bool (*check_buddy_priv)(struct ieee80211_hw *hw, - struct rtl_priv **buddy_priv); + struct rtl_priv **buddy_priv); /*<delete in kernel start>*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) - int (*adapter_tx) (struct ieee80211_hw * hw, struct sk_buff * skb, - struct rtl_tcb_desc *ptcb_desc); + int (*adapter_tx)(struct ieee80211_hw *hw, struct sk_buff *skb, + struct rtl_tcb_desc *ptcb_desc); #else /*<delete in kernel end>*/ - int (*adapter_tx) (struct ieee80211_hw *hw, - struct ieee80211_sta *sta, - struct sk_buff *skb, - struct rtl_tcb_desc *ptcb_desc); + int (*adapter_tx)(struct ieee80211_hw *hw, + struct ieee80211_sta *sta, + struct sk_buff *skb, + struct rtl_tcb_desc *ptcb_desc); /*<delete in kernel start>*/ #endif /*<delete in kernel end>*/ @@ -1881,22 +1883,22 @@ struct rtl_intf_ops { #else void (*flush)(struct ieee80211_hw *hw, bool drop); #endif - int (*reset_trx_ring) (struct ieee80211_hw * hw); + int (*reset_trx_ring)(struct ieee80211_hw *hw); /*<delete in kernel start>*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) - bool (*waitq_insert) (struct ieee80211_hw *hw, struct sk_buff *skb); + bool (*waitq_insert)(struct ieee80211_hw *hw, struct sk_buff *skb); #else /*<delete in kernel end>*/ - bool (*waitq_insert) (struct ieee80211_hw *hw, - struct ieee80211_sta *sta, - struct sk_buff *skb); + bool (*waitq_insert)(struct ieee80211_hw *hw, + struct ieee80211_sta *sta, + struct sk_buff *skb); /*<delete in kernel start>*/ #endif /*<delete in kernel end>*/ /*pci */ - void (*disable_aspm) (struct ieee80211_hw * hw); - void (*enable_aspm) (struct ieee80211_hw * hw); + void (*disable_aspm)(struct ieee80211_hw *hw); + void (*enable_aspm)(struct ieee80211_hw *hw); /*usb */ }; @@ -2027,21 +2029,21 @@ struct rtl_btc_info { }; struct rtl_btc_ops { - void (*btc_init_variables) (struct rtl_priv *rtlpriv); - void (*btc_init_hal_vars) (struct rtl_priv *rtlpriv); - void (*btc_init_hw_config) (struct rtl_priv *rtlpriv); - void (*btc_ips_notify) (struct rtl_priv *rtlpriv, u8 type); - void (*btc_scan_notify) (struct rtl_priv *rtlpriv, u8 scantype); - void (*btc_connect_notify) (struct rtl_priv *rtlpriv, u8 action); - void (*btc_mediastatus_notify) (struct rtl_priv *rtlpriv, - enum rt_media_status mstatus); - void (*btc_periodical) (struct rtl_priv *rtlpriv); - void (*btc_halt_notify) (void); - void (*btc_btinfo_notify) (struct rtl_priv *rtlpriv, - u8 * tmp_buf, u8 length); - bool (*btc_is_limited_dig) (struct rtl_priv *rtlpriv); - bool (*btc_is_disable_edca_turbo) (struct rtl_priv *rtlpriv); - bool (*btc_is_bt_disabled) (struct rtl_priv *rtlpriv); + void (*btc_init_variables)(struct rtl_priv *rtlpriv); + void (*btc_init_hal_vars)(struct rtl_priv *rtlpriv); + void (*btc_init_hw_config)(struct rtl_priv *rtlpriv); + void (*btc_ips_notify)(struct rtl_priv *rtlpriv, u8 type); + void (*btc_scan_notify)(struct rtl_priv *rtlpriv, u8 scantype); + void (*btc_connect_notify)(struct rtl_priv *rtlpriv, u8 action); + void (*btc_mediastatus_notify)(struct rtl_priv *rtlpriv, + enum rt_media_status mstatus); + void (*btc_periodical)(struct rtl_priv *rtlpriv); + void (*btc_halt_notify)(void); + void (*btc_btinfo_notify)(struct rtl_priv *rtlpriv, + u8 *tmp_buf, u8 length); + bool (*btc_is_limited_dig)(struct rtl_priv *rtlpriv); + bool (*btc_is_disable_edca_turbo)(struct rtl_priv *rtlpriv); + bool (*btc_is_bt_disabled)(struct rtl_priv *rtlpriv); }; struct rtl_bt_coexist { @@ -2087,7 +2089,7 @@ struct rtl_priv { /* *hal_cfg : for diff cards - *intf_ops : for diff interrface usb/pcie + *intf_ops : for diff interface usb/pcie */ struct rtl_hal_cfg *cfg; struct rtl_intf_ops *intf_ops; @@ -2105,7 +2107,7 @@ struct rtl_priv { /*for bt coexist use*/ struct rtl_bt_coexist btcoexist; - /* seperate 92ee from other ICs, + /* separate 92ee from other ICs, * 92ee use new trx flow. */ bool use_new_trx_flow; /*This must be the last item so @@ -2120,57 +2122,57 @@ struct rtl_priv { #define rtl_hal(rtlpriv) (&((rtlpriv)->rtlhal)) #define rtl_efuse(rtlpriv) (&((rtlpriv)->efuse)) #define rtl_psc(rtlpriv) (&((rtlpriv)->psc)) -#define rtl_sec(rtlpriv) (&((rtlpriv)->sec)) -#define rtl_dm(rtlpriv) (&((rtlpriv)->dm)) +#define rtl_sec(rtlpriv) (&((rtlpriv)->sec)) +#define rtl_dm(rtlpriv) (&((rtlpriv)->dm)) /*************************************** Bluetooth Co-existance Related ****************************************/ enum bt_ant_num { - ANT_X2 = 0, - ANT_X1 = 1, + ANT_X2 = 0, + ANT_X1 = 1, }; enum bt_co_type { - BT_2WIRE = 0, - BT_ISSC_3WIRE = 1, - BT_ACCEL = 2, - BT_CSR_BC4 = 3, - BT_CSR_BC8 = 4, - BT_RTL8756 = 5, - BT_RTL8723A = 6, - BT_RTL8821A = 7, - BT_RTL8723B = 8, - BT_RTL8192E = 9, - BT_RTL8812A = 11, -}; - -enum bt_total_ant_num{ + BT_2WIRE = 0, + BT_ISSC_3WIRE = 1, + BT_ACCEL = 2, + BT_CSR_BC4 = 3, + BT_CSR_BC8 = 4, + BT_RTL8756 = 5, + BT_RTL8723A = 6, + BT_RTL8821A = 7, + BT_RTL8723B = 8, + BT_RTL8192E = 9, + BT_RTL8812A = 11, +}; + +enum bt_total_ant_num { ANT_TOTAL_X2 = 0, ANT_TOTAL_X1 = 1 }; enum bt_cur_state { - BT_OFF = 0, - BT_ON = 1, + BT_OFF = 0, + BT_ON = 1, }; enum bt_service_type { - BT_SCO = 0, - BT_A2DP = 1, - BT_HID = 2, - BT_HID_IDLE = 3, - BT_SCAN = 4, - BT_IDLE = 5, - BT_OTHER_ACTION = 6, - BT_BUSY = 7, - BT_OTHERBUSY = 8, - BT_PAN = 9, + BT_SCO = 0, + BT_A2DP = 1, + BT_HID = 2, + BT_HID_IDLE = 3, + BT_SCAN = 4, + BT_IDLE = 5, + BT_OTHER_ACTION = 6, + BT_BUSY = 7, + BT_OTHERBUSY = 8, + BT_PAN = 9, }; enum bt_radio_shared { - BT_RADIO_SHARED = 0, - BT_RADIO_INDIVIDUAL = 1, + BT_RADIO_SHARED = 0, + BT_RADIO_INDIVIDUAL = 1, }; struct bt_coexist_info { @@ -2255,11 +2257,11 @@ struct bt_coexist_info { /* Write data to memory */ #define WRITEEF1BYTE(_ptr, _val) \ - (*((u8 *)(_ptr)))=EF1BYTE(_val) + ((*((u8 *)(_ptr))) = EF1BYTE(_val)) #define WRITEEF2BYTE(_ptr, _val) \ - (*((u16 *)(_ptr)))=EF2BYTE(_val) + ((*((u16 *)(_ptr))) = EF2BYTE(_val)) #define WRITEEF4BYTE(_ptr, _val) \ - (*((u32 *)(_ptr)))=EF4BYTE(_val) + ((*((u32 *)(_ptr))) = EF4BYTE(_val)) /*Example: BIT_LEN_MASK_32(0) => 0x00000000 @@ -2298,17 +2300,17 @@ Translate subfield (continuous bits in little-endian) of 4-byte value to host byte ordering.*/ #define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ ( \ - ( LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset) ) & \ + (LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \ BIT_LEN_MASK_32(__bitlen) \ ) #define LE_BITS_TO_2BYTE(__pstart, __bitoffset, __bitlen) \ ( \ - ( LE_P2BYTE_TO_HOST_2BYTE(__pstart) >> (__bitoffset) ) & \ + (LE_P2BYTE_TO_HOST_2BYTE(__pstart) >> (__bitoffset)) & \ BIT_LEN_MASK_16(__bitlen) \ ) #define LE_BITS_TO_1BYTE(__pstart, __bitoffset, __bitlen) \ ( \ - ( LE_P1BYTE_TO_HOST_1BYTE(__pstart) >> (__bitoffset) ) & \ + (LE_P1BYTE_TO_HOST_1BYTE(__pstart) >> (__bitoffset)) & \ BIT_LEN_MASK_8(__bitlen) \ ) @@ -2318,17 +2320,17 @@ and return the result in 4-byte value in host byte ordering.*/ #define LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ ( \ LE_P4BYTE_TO_HOST_4BYTE(__pstart) & \ - ( ~BIT_OFFSET_LEN_MASK_32(__bitoffset, __bitlen) ) \ + (~BIT_OFFSET_LEN_MASK_32(__bitoffset, __bitlen)) \ ) #define LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) \ ( \ LE_P2BYTE_TO_HOST_2BYTE(__pstart) & \ - ( ~BIT_OFFSET_LEN_MASK_16(__bitoffset, __bitlen) ) \ + (~BIT_OFFSET_LEN_MASK_16(__bitoffset, __bitlen)) \ ) #define LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) \ ( \ LE_P1BYTE_TO_HOST_1BYTE(__pstart) & \ - ( ~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) ) \ + (~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen)) \ ) /*Description: @@ -2337,19 +2339,19 @@ Set subfield of little-endian 4-byte value to specified value. */ *((u32 *)(__pstart)) = EF4BYTE \ ( \ LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ - ( (((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset) )\ + ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset))\ ); #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ *((u16 *)(__pstart)) = EF2BYTE \ ( \ LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ - ( (((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset) )\ + ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset))\ ); #define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \ *((u8 *)(__pstart)) = EF1BYTE \ ( \ LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) | \ - ( (((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset) ) \ + ((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \ ); #define N_BYTE_ALIGMENT(__value, __aligment) ((__aligment == 1) ? \ @@ -2359,18 +2361,18 @@ Set subfield of little-endian 4-byte value to specified value. */ mem access macro define end ****************************************/ -#define byte(x,n) ((x >> (8 * n)) & 0xff) +#define byte(x, n) ((x >> (8 * n)) & 0xff) #define packet_get_type(_packet) (EF1BYTE((_packet).octet[0]) & 0xFC) -#define RTL_WATCH_DOG_TIME 2000 +#define RTL_WATCH_DOG_TIME 2000 #define MSECS(t) msecs_to_jiffies(t) -#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS) -#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) -#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) -#define WLAN_FC_MORE_DATA(fc) ((fc) & IEEE80211_FCTL_MOREDATA) -#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) -#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) -#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) +#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS) +#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) +#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) +#define WLAN_FC_MORE_DATA(fc) ((fc) & IEEE80211_FCTL_MOREDATA) +#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) +#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) +#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) #define RT_RF_OFF_LEVL_ASPM BIT(0) /*PCI ASPM */ #define RT_RF_OFF_LEVL_CLK_REQ BIT(1) /*PCI clock request */ @@ -2383,7 +2385,7 @@ Set subfield of little-endian 4-byte value to specified value. */ #define RT_RF_PS_LEVEL_ALWAYS_ASPM BIT(6) /* no matter RFOFF or SLEEP we set PS_ASPM_LEVL*/ #define RT_PS_LEVEL_ASPM BIT(7) -/*When LPS is on, disable 2R if no packet is received or transmittd.*/ +/*When LPS is on, disable 2R if no packet is received or transmitted.*/ #define RT_RF_LPS_DISALBE_2R BIT(30) #define RT_RF_LPS_LEVEL_ASPM BIT(31) /*LPS with ASPM */ #define RT_IN_PS_LEVEL(ppsc, _ps_flg) \ @@ -2397,13 +2399,13 @@ Set subfield of little-endian 4-byte value to specified value. */ container_of(container_of(x, struct delayed_work, work), y, z) #define FILL_OCTET_STRING(_os,_octet,_len) \ - (_os).octet=(u8*)(_octet); \ - (_os).length=(_len); + (_os).octet = (u8 *)(_octet); \ + (_os).length = (_len); #define CP_MACADDR(des,src) \ - ((des)[0]=(src)[0],(des)[1]=(src)[1],\ - (des)[2]=(src)[2],(des)[3]=(src)[3],\ - (des)[4]=(src)[4],(des)[5]=(src)[5]) + ((des)[0] = (src)[0],(des)[1] = (src)[1],\ + (des)[2] = (src)[2],(des)[3] = (src)[3],\ + (des)[4] = (src)[4],(des)[5] = (src)[5]) static inline u8 rtl_read_byte(struct rtl_priv *rtlpriv, u32 addr) { |