staging: rtlwifi: refactor rtl_get_tcb_desc

Refactored rtl_get_tcb_desc slightly to stay within the 80 character
line limit.

Signed-off-by: Luke Triantafyllidis <ltriant@cpan.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Luke Triantafyllidis 2018-08-03 14:37:13 +10:00 коммит произвёл Greg Kroah-Hartman
Родитель e083926b3e
Коммит f7992a043f
1 изменённых файлов: 49 добавлений и 55 удалений

Просмотреть файл

@ -1236,67 +1236,61 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
if (rtl_is_tx_report_skb(hw, skb))
tcb_desc->use_spe_rpt = 1;
if (ieee80211_is_data(fc)) {
/*
*we set data rate INX 0
*in rtl_rc.c if skb is special data or
*mgt which need low data rate.
*/
/*
*So tcb_desc->hw_rate is just used for
*special data and mgt frames
*/
if (info->control.rates[0].idx == 0 ||
ieee80211_is_nullfunc(fc)) {
tcb_desc->use_driver_rate = true;
tcb_desc->ratr_index =
SET_RATE_ID(RATR_INX_WIRELESS_MC);
tcb_desc->disable_ratefallback = 1;
} else {
/* 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 controlled by FW
* when tcb_desc->use_driver_rate = false
*/
if (sta && sta->vht_cap.vht_supported) {
tcb_desc->hw_rate =
_rtl_get_vht_highest_n_rate(hw, sta);
} else {
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) {
tcb_desc->hw_rate =
rtlpriv->cfg->maps[RTL_RC_CCK_RATE11M];
} else {
tcb_desc->hw_rate =
rtlpriv->cfg->maps[RTL_RC_OFDM_RATE54M];
}
}
}
}
if (is_multicast_ether_addr(hdr->addr1))
tcb_desc->multicast = 1;
else if (is_broadcast_ether_addr(hdr->addr1))
tcb_desc->broadcast = 1;
_rtl_txrate_selectmode(hw, sta, tcb_desc);
_rtl_query_bandwidth_mode(hw, sta, tcb_desc);
_rtl_qurey_shortpreamble_mode(hw, tcb_desc, info);
_rtl_query_shortgi(hw, sta, tcb_desc, info);
_rtl_query_protection_mode(hw, tcb_desc, info);
} else {
if (!ieee80211_is_data(fc)) {
tcb_desc->use_driver_rate = true;
tcb_desc->ratr_index = SET_RATE_ID(RATR_INX_WIRELESS_MC);
tcb_desc->disable_ratefallback = 1;
tcb_desc->mac_id = 0;
tcb_desc->packet_bw = false;
return;
}
/*
* We set data rate INX 0
* in rtl_rc.c if skb is special data or
* mgt which need low data rate.
*/
/*
* So tcb_desc->hw_rate is just used for
* special data and mgt frames
*/
if (info->control.rates[0].idx == 0 || ieee80211_is_nullfunc(fc)) {
tcb_desc->use_driver_rate = true;
tcb_desc->ratr_index = SET_RATE_ID(RATR_INX_WIRELESS_MC);
tcb_desc->disable_ratefallback = 1;
} else if (sta && sta->vht_cap.vht_supported) {
/*
* 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 controlled by FW
* when tcb_desc->use_driver_rate = false
*/
tcb_desc->hw_rate = _rtl_get_vht_highest_n_rate(hw, sta);
} else if (sta && sta->ht_cap.ht_supported) {
tcb_desc->hw_rate = _rtl_get_highest_n_rate(hw, sta);
} else {
enum rtl_var_map var = RTL_RC_OFDM_RATE54M;
if (rtlmac->mode == WIRELESS_MODE_B)
var = RTL_RC_CCK_RATE11M;
tcb_desc->hw_rate = rtlpriv->cfg->maps[var];
}
if (is_multicast_ether_addr(hdr->addr1))
tcb_desc->multicast = 1;
else if (is_broadcast_ether_addr(hdr->addr1))
tcb_desc->broadcast = 1;
_rtl_txrate_selectmode(hw, sta, tcb_desc);
_rtl_query_bandwidth_mode(hw, sta, tcb_desc);
_rtl_qurey_shortpreamble_mode(hw, tcb_desc, info);
_rtl_query_shortgi(hw, sta, tcb_desc, info);
_rtl_query_protection_mode(hw, tcb_desc, info);
#undef SET_RATE_ID
}