diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2019-09-19 14:25:45 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-04 10:47:35 +0200 |
commit | 9bca45f3d6924f19f29c0d019e961af3f41bdc9e (patch) | |
tree | ad4801c513155558e7e636c734d15d2cce6214fd /drivers/staging/wfx/wfx.h | |
parent | staging: wfx: add debug files and trace debug events (diff) | |
download | linux-dev-9bca45f3d6924f19f29c0d019e961af3f41bdc9e.tar.xz linux-dev-9bca45f3d6924f19f29c0d019e961af3f41bdc9e.zip |
staging: wfx: allow to send 802.11 frames
Three things make this task more complex than it should:
- Chip necessitate to associate a link-id to each station. It is same
thing than association ID but, using 8 bits only.
- Rate policy is sent separately from Tx frames
- Driver try to handle itself power saving of stations and multicast
data
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/wfx.h')
-rw-r--r-- | drivers/staging/wfx/wfx.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 49b776a07515..11775b1e06ef 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -14,8 +14,11 @@ #include <net/mac80211.h> #include "bh.h" +#include "data_tx.h" #include "main.h" +#include "queue.h" #include "secure_link.h" +#include "sta.h" #include "hif_tx.h" #include "hif_api_general.h" @@ -38,6 +41,10 @@ struct wfx_dev { int chip_frozen; struct wfx_hif_cmd hif_cmd; + struct wfx_queue tx_queue[4]; + struct wfx_queue_stats tx_queue_stats; + int tx_burst_idx; + atomic_t tx_lock; struct hif_rx_stats rx_stats; struct mutex rx_stats_lock; @@ -47,6 +54,28 @@ struct wfx_vif { struct wfx_dev *wdev; struct ieee80211_vif *vif; int id; + + + u32 link_id_map; + struct wfx_link_entry link_id_db[WFX_MAX_STA_IN_AP_MODE]; + struct delayed_work link_id_gc_work; + struct work_struct link_id_work; + + bool aid0_bit_set; + bool mcast_tx; + bool mcast_buffered; + struct timer_list mcast_timeout; + struct work_struct mcast_start_work; + struct work_struct mcast_stop_work; + + + struct tx_policy_cache tx_policy_cache; + struct work_struct tx_policy_upload_work; + u32 sta_asleep_mask; + u32 pspoll_mask; + spinlock_t ps_state_lock; + + struct wfx_edca_params edca; }; static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id) @@ -62,4 +91,33 @@ static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id) return (struct wfx_vif *) wdev->vif[vif_id]->drv_priv; } +static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev, struct wfx_vif *cur) +{ + int i; + int mark = 0; + struct wfx_vif *tmp; + + if (!cur) + mark = 1; + for (i = 0; i < ARRAY_SIZE(wdev->vif); i++) { + tmp = wdev_to_wvif(wdev, i); + if (mark && tmp) + return tmp; + if (tmp == cur) + mark = 1; + } + return NULL; +} + +static inline int memzcmp(void *src, unsigned int size) +{ + uint8_t *buf = src; + + if (!size) + return 0; + if (*buf) + return 1; + return memcmp(buf, buf + 1, size - 1); +} + #endif /* WFX_H */ |