Commit 2e57865e authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: pspoll_mask make no sense



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: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-54-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent df3519a3
Loading
Loading
Loading
Loading
+0 −39
Original line number Diff line number Diff line
@@ -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);
+1 −3
Original line number Diff line number Diff line
@@ -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) {
+2 −6
Original line number Diff line number Diff line
@@ -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;
+0 −2
Original line number Diff line number Diff line
@@ -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;
+0 −1
Original line number Diff line number Diff line
@@ -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;