summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/silabs/wfx/queue.c
diff options
context:
space:
mode:
authorJaehee Park <jhpark1013@gmail.com>2022-05-06 13:00:46 -0400
committerKalle Valo <kvalo@kernel.org>2022-05-11 08:32:57 +0300
commit2c33360bce6af0948fa162cdbd373d49be5a7491 (patch)
treebf88a65643d2cf6966d65f6e0e0279918e329778 /drivers/net/wireless/silabs/wfx/queue.c
parentdadb20864d89d43dd5386089bd82e5c66f0060c0 (diff)
downloadlinux-2c33360bce6af0948fa162cdbd373d49be5a7491.tar.bz2
wfx: use container_of() to get vif
Currently, upon virtual interface creation, wfx_add_interface() stores a reference to the corresponding struct ieee80211_vif in private data, for later usage. This is not needed when using the container_of construct. This construct already has all the info it needs to retrieve the reference to the corresponding struct from the offset that is already available, inherent in container_of(), between its type and member inputs (struct ieee80211_vif and drv_priv, respectively). Remove vif (which was previously storing the reference to the struct ieee80211_vif) from the struct wfx_vif, define a function wvif_to_vif(wvif) for container_of(), and replace all wvif->vif with the newly defined container_of construct. Signed-off-by: Jaehee Park <jhpark1013@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220506170046.GA1297231@jaehee-ThinkPad-X1-Extreme
Diffstat (limited to 'drivers/net/wireless/silabs/wfx/queue.c')
-rw-r--r--drivers/net/wireless/silabs/wfx/queue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/silabs/wfx/queue.c b/drivers/net/wireless/silabs/wfx/queue.c
index 729825230db2..37f492e5d3be 100644
--- a/drivers/net/wireless/silabs/wfx/queue.c
+++ b/drivers/net/wireless/silabs/wfx/queue.c
@@ -205,9 +205,10 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *
bool wfx_tx_queues_has_cab(struct wfx_vif *wvif)
{
+ struct ieee80211_vif *vif = wvif_to_vif(wvif);
int i;
- if (wvif->vif->type != NL80211_IFTYPE_AP)
+ if (vif->type != NL80211_IFTYPE_AP)
return false;
for (i = 0; i < IEEE80211_NUM_ACS; ++i)
/* Note: since only AP can have mcast frames in queue and only one vif can be AP,