Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-57-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jérôme Pouiller and committed by
Greg Kroah-Hartman
22c03264 b5d4d98e

+9 -17
+1 -6
drivers/staging/wfx/data_tx.c
··· 600 600 tx_info->flags |= IEEE80211_TX_STAT_ACK; 601 601 } else if (arg->status == HIF_REQUEUE) { 602 602 /* "REQUEUE" means "implicit suspend" */ 603 - struct hif_ind_suspend_resume_tx suspend = { 604 - .suspend_resume_flags.resume = 0, 605 - .suspend_resume_flags.bc_mc_only = 1, 606 - }; 607 - 608 603 WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); 609 - wfx_suspend_resume(wvif, &suspend); 604 + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); 610 605 tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; 611 606 } else { 612 607 if (wvif->bss_loss_state &&
+5 -1
drivers/staging/wfx/hif_rx.c
··· 230 230 const struct hif_ind_suspend_resume_tx *body = buf; 231 231 232 232 WARN_ON(!wvif); 233 - wfx_suspend_resume(wvif, body); 233 + WARN(!body->suspend_resume_flags.bc_mc_only, "unsupported suspend/resume notification"); 234 + if (body->suspend_resume_flags.resume) 235 + wfx_suspend_resume_mc(wvif, STA_NOTIFY_AWAKE); 236 + else 237 + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); 234 238 235 239 return 0; 236 240 }
+2 -8
drivers/staging/wfx/sta.c
··· 985 985 return -ENOTSUPP; 986 986 } 987 987 988 - void wfx_suspend_resume(struct wfx_vif *wvif, 989 - const struct hif_ind_suspend_resume_tx *arg) 988 + void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) 990 989 { 991 990 bool cancel_tmo = false; 992 991 993 - if (!arg->suspend_resume_flags.bc_mc_only) { 994 - dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); 995 - return; 996 - } 997 - 998 992 spin_lock_bh(&wvif->ps_state_lock); 999 - if (!arg->suspend_resume_flags.resume) 993 + if (notify_cmd == STA_NOTIFY_SLEEP) 1000 994 wvif->mcast_tx = false; 1001 995 else 1002 996 wvif->mcast_tx = wvif->aid0_bit_set &&
+1 -2
drivers/staging/wfx/sta.h
··· 82 82 struct ieee80211_chanctx_conf *conf); 83 83 84 84 // WSM Callbacks 85 - void wfx_suspend_resume(struct wfx_vif *wvif, 86 - const struct hif_ind_suspend_resume_tx *arg); 85 + void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd); 87 86 88 87 // Other Helpers 89 88 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);