mirror of https://gitee.com/openkylin/linux.git
iwlwifi: mvm: cleanup iwl_mvm_tx_skb_non_sta
Make the coupling of station id and queue id clear. Group code together. Remove outdated comment. Never use an undefined hw queue as given from mac80211. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
a124caf8f3
commit
4120e4a119
|
@ -708,22 +708,12 @@ static void iwl_mvm_probe_resp_set_noa(struct iwl_mvm *mvm,
|
||||||
int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
|
int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);
|
|
||||||
struct ieee80211_tx_info info;
|
struct ieee80211_tx_info info;
|
||||||
struct iwl_device_cmd *dev_cmd;
|
struct iwl_device_cmd *dev_cmd;
|
||||||
u8 sta_id;
|
u8 sta_id;
|
||||||
int hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
int hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
||||||
__le16 fc = hdr->frame_control;
|
__le16 fc = hdr->frame_control;
|
||||||
int queue;
|
int queue = -1;
|
||||||
|
|
||||||
/* IWL_MVM_OFFCHANNEL_QUEUE is used for ROC packets that can be used
|
|
||||||
* in 2 different types of vifs, P2P & STATION. P2P uses the offchannel
|
|
||||||
* queue. STATION (HS2.0) uses the auxiliary context of the FW,
|
|
||||||
* and hence needs to be sent on the aux queue
|
|
||||||
*/
|
|
||||||
if (skb_info->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE &&
|
|
||||||
skb_info->control.vif->type == NL80211_IFTYPE_STATION)
|
|
||||||
skb_info->hw_queue = mvm->aux_queue;
|
|
||||||
|
|
||||||
memcpy(&info, skb->cb, sizeof(info));
|
memcpy(&info, skb->cb, sizeof(info));
|
||||||
|
|
||||||
|
@ -735,18 +725,6 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
|
||||||
info.hw_queue != info.control.vif->cab_queue)))
|
info.hw_queue != info.control.vif->cab_queue)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
queue = info.hw_queue;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the interface on which the frame is sent is the P2P_DEVICE
|
|
||||||
* or an AP/GO interface use the broadcast station associated
|
|
||||||
* with it; otherwise if the interface is a managed interface
|
|
||||||
* use the AP station associated with it for multicast traffic
|
|
||||||
* (this is not possible for unicast packets as a TLDS discovery
|
|
||||||
* response are sent without a station entry); otherwise use the
|
|
||||||
* AUX station.
|
|
||||||
*/
|
|
||||||
sta_id = mvm->aux_sta.sta_id;
|
|
||||||
if (info.control.vif) {
|
if (info.control.vif) {
|
||||||
struct iwl_mvm_vif *mvmvif =
|
struct iwl_mvm_vif *mvmvif =
|
||||||
iwl_mvm_vif_from_mac80211(info.control.vif);
|
iwl_mvm_vif_from_mac80211(info.control.vif);
|
||||||
|
@ -761,14 +739,28 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
|
||||||
|
|
||||||
queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info,
|
queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info,
|
||||||
hdr->frame_control);
|
hdr->frame_control);
|
||||||
if (queue < 0)
|
|
||||||
return -1;
|
|
||||||
} else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) {
|
} else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) {
|
||||||
queue = mvm->snif_queue;
|
queue = mvm->snif_queue;
|
||||||
sta_id = mvm->snif_sta.sta_id;
|
sta_id = mvm->snif_sta.sta_id;
|
||||||
|
} else if (info.control.vif->type == NL80211_IFTYPE_STATION &&
|
||||||
|
info.hw_queue == IWL_MVM_OFFCHANNEL_QUEUE) {
|
||||||
|
/*
|
||||||
|
* IWL_MVM_OFFCHANNEL_QUEUE is used for ROC packets
|
||||||
|
* that can be used in 2 different types of vifs, P2P &
|
||||||
|
* STATION.
|
||||||
|
* P2P uses the offchannel queue.
|
||||||
|
* STATION (HS2.0) uses the auxiliary context of the FW,
|
||||||
|
* and hence needs to be sent on the aux queue.
|
||||||
|
*/
|
||||||
|
sta_id = mvm->aux_sta.sta_id;
|
||||||
|
queue = mvm->aux_queue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (queue < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (unlikely(ieee80211_is_probe_resp(fc)))
|
if (unlikely(ieee80211_is_probe_resp(fc)))
|
||||||
iwl_mvm_probe_resp_set_noa(mvm, skb);
|
iwl_mvm_probe_resp_set_noa(mvm, skb);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue