Commit 22c03264 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: simplify wfx_suspend_resume_mc()

Indeed, it is not necessary to pass whole hif_ind_suspend_resume_tx to
wfx_suspend_resume_mc().

In add, the structure hif_ind_suspend_resume_tx come from hardware API.
It is not intended to be manipulated in upper layers of the driver.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-57-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b5d4d98e
...@@ -600,13 +600,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) ...@@ -600,13 +600,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg)
tx_info->flags |= IEEE80211_TX_STAT_ACK; tx_info->flags |= IEEE80211_TX_STAT_ACK;
} else if (arg->status == HIF_REQUEUE) { } else if (arg->status == HIF_REQUEUE) {
/* "REQUEUE" means "implicit suspend" */ /* "REQUEUE" means "implicit suspend" */
struct hif_ind_suspend_resume_tx suspend = {
.suspend_resume_flags.resume = 0,
.suspend_resume_flags.bc_mc_only = 1,
};
WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags");
wfx_suspend_resume(wvif, &suspend); wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP);
tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
} else { } else {
if (wvif->bss_loss_state && if (wvif->bss_loss_state &&
......
...@@ -230,7 +230,11 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, ...@@ -230,7 +230,11 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev,
const struct hif_ind_suspend_resume_tx *body = buf; const struct hif_ind_suspend_resume_tx *body = buf;
WARN_ON(!wvif); WARN_ON(!wvif);
wfx_suspend_resume(wvif, body); WARN(!body->suspend_resume_flags.bc_mc_only, "unsupported suspend/resume notification");
if (body->suspend_resume_flags.resume)
wfx_suspend_resume_mc(wvif, STA_NOTIFY_AWAKE);
else
wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP);
return 0; return 0;
} }
......
...@@ -985,18 +985,12 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, ...@@ -985,18 +985,12 @@ int wfx_ampdu_action(struct ieee80211_hw *hw,
return -ENOTSUPP; return -ENOTSUPP;
} }
void wfx_suspend_resume(struct wfx_vif *wvif, void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd)
const struct hif_ind_suspend_resume_tx *arg)
{ {
bool cancel_tmo = false; bool cancel_tmo = false;
if (!arg->suspend_resume_flags.bc_mc_only) {
dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n");
return;
}
spin_lock_bh(&wvif->ps_state_lock); spin_lock_bh(&wvif->ps_state_lock);
if (!arg->suspend_resume_flags.resume) if (notify_cmd == STA_NOTIFY_SLEEP)
wvif->mcast_tx = false; wvif->mcast_tx = false;
else else
wvif->mcast_tx = wvif->aid0_bit_set && wvif->mcast_tx = wvif->aid0_bit_set &&
......
...@@ -82,8 +82,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -82,8 +82,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw,
struct ieee80211_chanctx_conf *conf); struct ieee80211_chanctx_conf *conf);
// WSM Callbacks // WSM Callbacks
void wfx_suspend_resume(struct wfx_vif *wvif, void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
const struct hif_ind_suspend_resume_tx *arg);
// Other Helpers // Other Helpers
void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment