linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <Jerome.Pouiller@silabs.com>
To: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Jérôme Pouiller" <Jerome.Pouiller@silabs.com>
Subject: [PATCH v2 53/65] staging: wfx: pspoll_mask make no sense
Date: Wed, 15 Jan 2020 13:55:19 +0000	[thread overview]
Message-ID: <20200115135338.14374-54-Jerome.Pouiller@silabs.com> (raw)
In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com>

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

pspoll_mask is here to send data buffered in driver. But since station
is marked buffered, TIM for this station is 1 and mac80211 will call
sta_notify when a ps-poll is received. So pspoll_mask is useless and
sta_alseep_mask is sufficient.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/data_rx.c | 39 -----------------------------------
 drivers/staging/wfx/data_tx.c |  4 +---
 drivers/staging/wfx/queue.c   |  8 ++-----
 drivers/staging/wfx/sta.c     |  2 --
 drivers/staging/wfx/wfx.h     |  1 -
 5 files changed, 3 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index 699e2d60fa89..5d198457c6ce 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -13,41 +13,6 @@
 #include "bh.h"
 #include "sta.h"
 
-static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb)
-{
-	struct ieee80211_sta *sta;
-	struct ieee80211_pspoll *pspoll = (struct ieee80211_pspoll *)skb->data;
-	int link_id = 0;
-	u32 pspoll_mask = 0;
-	int i;
-
-	if (wvif->state != WFX_STATE_AP)
-		return 1;
-	if (!ether_addr_equal(wvif->vif->addr, pspoll->bssid))
-		return 1;
-
-	rcu_read_lock();
-	sta = ieee80211_find_sta(wvif->vif, pspoll->ta);
-	if (sta)
-		link_id = ((struct wfx_sta_priv *)&sta->drv_priv)->link_id;
-	rcu_read_unlock();
-	if (link_id)
-		pspoll_mask = BIT(link_id);
-	else
-		return 1;
-
-	wvif->pspoll_mask |= pspoll_mask;
-	/* Do not report pspols if data for given link id is queued already. */
-	for (i = 0; i < IEEE80211_NUM_ACS; ++i) {
-		if (wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i],
-						pspoll_mask)) {
-			wfx_bh_request_tx(wvif->wdev);
-			return 1;
-		}
-	}
-	return 0;
-}
-
 static int wfx_drop_encrypt_data(struct wfx_dev *wdev,
 				 const struct hif_ind_rx *arg,
 				 struct sk_buff *skb)
@@ -125,10 +90,6 @@ void wfx_rx_cb(struct wfx_vif *wvif,
 		goto drop;
 	}
 
-	if (ieee80211_is_pspoll(frame->frame_control))
-		if (wfx_handle_pspoll(wvif, skb))
-			goto drop;
-
 	hdr->band = NL80211_BAND_2GHZ;
 	hdr->freq = ieee80211_channel_to_frequency(arg->channel_number,
 						   hdr->band);
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 7da1afd6e9b5..7914c06578aa 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -286,10 +286,8 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr,
 	int tid = ieee80211_get_tid(hdr);
 
 	spin_lock_bh(&wvif->ps_state_lock);
-	if (ieee80211_is_auth(hdr->frame_control)) {
+	if (ieee80211_is_auth(hdr->frame_control))
 		wvif->sta_asleep_mask &= mask;
-		wvif->pspoll_mask &= mask;
-	}
 
 	if (tx_priv->link_id == WFX_LINK_ID_AFTER_DTIM &&
 	    !wvif->mcast_buffered) {
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 3d40388739e3..42d64534c92c 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -493,12 +493,10 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif,
 	/* Search for unicast traffic */
 	tx_allowed_mask = ~wvif->sta_asleep_mask;
 	tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD);
-	if (wvif->sta_asleep_mask) {
-		tx_allowed_mask |= wvif->pspoll_mask;
+	if (wvif->sta_asleep_mask)
 		tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM);
-	} else {
+	else
 		tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM);
-	}
 	idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total);
 	if (idx < 0)
 		return -ENOENT;
@@ -585,8 +583,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
 		if (hif_handle_tx_data(wvif, skb, queue))
 			continue;  /* Handled by WSM */
 
-		wvif->pspoll_mask &= ~BIT(tx_priv->raw_link_id);
-
 		/* allow bursting if txop is set */
 		if (wvif->edca_params[queue_num].txop)
 			burst = (int)wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index aa1a68b61ac5..c249a2953bb0 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -867,7 +867,6 @@ static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd,
 	case STA_NOTIFY_AWAKE:
 		if (prev) {
 			wvif->sta_asleep_mask &= ~bit;
-			wvif->pspoll_mask &= ~bit;
 			if (link_id && !wvif->sta_asleep_mask)
 				schedule_work(&wvif->mcast_stop_work);
 			wfx_bh_request_tx(wvif->wdev);
@@ -1178,7 +1177,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw,
 		wvif->mcast_tx = false;
 		wvif->aid0_bit_set = false;
 		wvif->mcast_buffered = false;
-		wvif->pspoll_mask = 0;
 		/* reset.link_id = 0; */
 		hif_reset(wvif, false);
 		break;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 365aacc073fb..8491f050478d 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -91,7 +91,6 @@ struct wfx_vif {
 	struct work_struct	tx_policy_upload_work;
 
 	u32			sta_asleep_mask;
-	u32			pspoll_mask;
 	spinlock_t		ps_state_lock;
 	struct work_struct	update_tim_work;
 
-- 
2.25.0


  parent reply	other threads:[~2020-01-15 13:55 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 13:54 [PATCH v2 00/65] Simplify and improve the wfx driver Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 01/65] staging: wfx: revert unexpected change in debugfs output Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 02/65] staging: wfx: make hif_scan() usage clearer Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 03/65] staging: wfx: add missing PROBE_RESP_OFFLOAD feature Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 04/65] staging: wfx: send rate policies one by one Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 05/65] staging: wfx: simplify hif_set_tx_rate_retry_policy() usage Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 06/65] staging: wfx: simplify hif_set_output_power() usage Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 08/65] staging: wfx: simplify hif_set_arp_ipv4_filter() usage Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 09/65] staging: wfx: simplify hif_start() usage Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 10/65] staging: wfx: use specialized structs for HIF arguments Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 11/65] staging: wfx: retrieve ampdu_density from sta->ht_cap Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 12/65] staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 13/65] staging: wfx: drop struct wfx_ht_info Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 14/65] staging: wfx: drop wdev->output_power Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 15/65] staging: wfx: simplify wfx_config() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 16/65] staging: wfx: rename wfx_upload_beacon() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 17/65] staging: wfx: simplify wfx_upload_ap_templates() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 18/65] staging: wfx: simplify wfx_update_beaconing() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 19/65] staging: wfx: fix __wfx_flush() when drop == false Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 20/65] staging: wfx: simplify wfx_flush() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 21/65] staging: wfx: simplify update of DTIM period Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 22/65] staging: wfx: drop wvif->dtim_period Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 23/65] staging: wfx: drop wvif->enable_beacon Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 24/65] staging: wfx: drop wvif->cqm_rssi_thold Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 25/65] staging: wfx: drop wvif->setbssparams_done Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 26/65] staging: wfx: drop wfx_set_cts_work() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 27/65] staging: wfx: SSID should be provided to hif_start() even if hidden Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 28/65] staging: wfx: simplify hif_update_ie() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 29/65] staging: wfx: simplify hif_join() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 30/65] staging: wfx: simplify hif_set_association_mode() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 32/65] staging: wfx: simplify hif_mib_uc_mc_bc_data_frame_condition Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 33/65] staging: wfx: simplify hif_mib_set_data_filtering Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 34/65] staging: wfx: simplify hif_set_data_filtering() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 35/65] staging: wfx: simplify hif_set_mac_addr_condition() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 36/65] staging: wfx: simplify hif_set_config_data_filter() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 37/65] staging: wfx: simplify wfx_set_mcast_filter() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 38/65] staging: wfx: simplify wfx_update_filtering() Jérôme Pouiller
2020-01-15 13:54 ` [PATCH v2 39/65] staging: wfx: simplify wfx_scan_complete() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 40/65] staging: wfx: update power-save per interface Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 41/65] staging: wfx: with multiple vifs, force PS only if channels differs Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 42/65] staging: wfx: do not update uapsd if not necessary Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 43/65] staging: wfx: fix case where RTS threshold is 0 Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 44/65] staging: wfx: fix possible overflow on jiffies comparaison Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 45/65] staging: wfx: remove handling of "early_data" Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 46/65] staging: wfx: relocate "buffered" information to sta_priv Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 47/65] staging: wfx: fix bss_loss Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 48/65] staging: wfx: fix RCU usage Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 49/65] staging: wfx: simplify wfx_set_tim_impl() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 50/65] staging: wfx: simplify the link-id allocation Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 51/65] staging: wfx: check that no tx is pending before release sta Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 52/65] staging: wfx: replace wfx_tx_get_tid() with ieee80211_get_tid() Jérôme Pouiller
2020-01-15 13:55 ` Jérôme Pouiller [this message]
2020-01-15 13:55 ` [PATCH v2 54/65] staging: wfx: sta and dtim Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 55/65] staging: wfx: firmware never return PS status for stations Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 57/65] staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 58/65] staging: wfx: simplify wfx_ps_notify_sta() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 59/65] staging: wfx: ensure that packet_id is unique Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 60/65] staging: wfx: remove unused do_probe Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 61/65] staging: wfx: remove check for interface state Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 62/65] staging: wfx: simplify hif_handle_tx_data() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 63/65] staging: wfx: simplify wfx_tx_queue_get_num_queued() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 64/65] staging: wfx: simplify hif_multi_tx_confirm() Jérôme Pouiller
2020-01-15 13:55 ` [PATCH v2 65/65] staging: wfx: update TODO Jérôme Pouiller

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=20200115135338.14374-54-Jerome.Pouiller@silabs.com \
    --to=jerome.pouiller@silabs.com \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).