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>
Link: https://lore.kernel.org/r/20200115135338.14374-54-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 #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)
                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);
 
        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) {
 
        /* 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;
                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;
 
        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);
                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;
 
        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;