All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Sara Sharon <sara.sharon@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 04/18] iwlwifi: mvm: cleanup iwl_mvm_tx_skb_non_sta
Date: Fri, 14 Dec 2018 22:29:31 +0200	[thread overview]
Message-ID: <20181214202945.32375-5-luca@coelho.fi> (raw)
In-Reply-To: <20181214202945.32375-1-luca@coelho.fi>

From: Sara Sharon <sara.sharon@intel.com>

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>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 42 +++++++++------------
 1 file changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index 2738cd307765..4ebfd41dadc9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -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)
 {
 	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 iwl_device_cmd *dev_cmd;
 	u8 sta_id;
 	int hdrlen = ieee80211_hdrlen(hdr->frame_control);
 	__le16 fc = hdr->frame_control;
-	int 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
-	 */
-	if (skb_info->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE &&
-	    skb_info->control.vif->type == NL80211_IFTYPE_STATION)
-		skb_info->hw_queue = mvm->aux_queue;
+	int queue = -1;
 
 	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)))
 		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) {
 		struct iwl_mvm_vif *mvmvif =
 			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,
 							   hdr->frame_control);
-			if (queue < 0)
-				return -1;
+
 		} else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) {
 			queue = mvm->snif_queue;
 			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)))
 		iwl_mvm_probe_resp_set_noa(mvm, skb);
 
-- 
2.19.2


  parent reply	other threads:[~2018-12-14 20:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 20:29 [PATCH 00/18] iwlwifi: updates intended for v4.21 2018-12-14 Luca Coelho
2018-12-14 20:29 ` [PATCH 01/18] iwlwifi: pcie: use iwl_tx_cmd_gen2 and not iwl_tx_cmd Luca Coelho
2018-12-14 20:29 ` [PATCH 02/18] iwlwifi: mvm: remove dead code Luca Coelho
2018-12-14 20:29 ` [PATCH 03/18] iwlwifi: mvm: remove pointless NULL assignment Luca Coelho
2018-12-14 20:29 ` Luca Coelho [this message]
2018-12-14 20:29 ` [PATCH 05/18] iwlwifi: mvm: fix setting HE ppe FW config Luca Coelho
2018-12-14 20:29 ` [PATCH 06/18] [BUGFIXiwlwifi: make MVM and DVM depend on MAC80211 Luca Coelho
2018-12-18 16:17   ` Kalle Valo
2018-12-19 10:24     ` Luca Coelho
2018-12-14 20:29 ` [PATCH 07/18] iwlwifi: split HE capabilities between AP and STA Luca Coelho
2018-12-14 20:29 ` [PATCH 08/18] iwlwifi: mvm: handle RX no data notification Luca Coelho
2018-12-14 20:29 ` [PATCH 09/18] iwlwifi: mvm: take station lock later in the code Luca Coelho
2018-12-14 20:29 ` [PATCH 10/18] iwlwifi: pcie: lock txq a bit later in reclaim code Luca Coelho
2018-12-14 20:29 ` [PATCH 11/18] iwlwifi: mvm: clean up SSN incrementation Luca Coelho
2018-12-14 20:29 ` [PATCH 12/18] iwlwifi: wrt: add rt status and num of rx/tx fifos to dump Luca Coelho
2018-12-14 20:29 ` [PATCH 13/18] iwlwifi: remove unused and wrong PHY_CFG_* macros Luca Coelho
2018-12-14 20:29 ` [PATCH 14/18] iwlwifi: mvm: set TWT responder capability bit in 11AX SoftAP mode Luca Coelho
2018-12-14 20:29 ` [PATCH 15/18] iwlwifi: mvm: fix spelling mistake "Recieved" -> "Received" Luca Coelho
2018-12-14 20:29 ` [PATCH 16/18] iwlwifi: mvm: d3: use struct_size() in kzalloc() Luca Coelho
2018-12-14 20:29 ` [PATCH 17/18] iwlwifi: dbg: add debug data to warning Luca Coelho
2018-12-14 20:29 ` [PATCH 18/18] iwlwifi: bump the API version to 43 for 9000 and 22000 Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181214202945.32375-5-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=sara.sharon@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.