diff options
author | Lior David <liord@codeaurora.org> | 2018-02-26 19:12:11 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-02-27 17:50:04 +0100 |
commit | 9f38f28624555af82a2909c9716688367d7297b1 (patch) | |
tree | 4e7bff528883ea923fbb28dcf821abc283eefc54 /drivers/net/wireless/ath/wil6210/wil6210.h | |
parent | wcn36xx: Fix warning due to duplicate scan_completed notification (diff) | |
download | linux-9f38f28624555af82a2909c9716688367d7297b1.tar.xz linux-9f38f28624555af82a2909c9716688367d7297b1.zip |
wil6210: add wil6210_vif structure for per-VIF data
For supporting multiple virtual interfaces in the future,
introduce a wil6210_vif structure which will hold per-VIF
data. Change the module initialization so wil6210_vif will
be part of net_device structure, and wireless_dev will be
embedded inside the wil6210_vif structure. This will allow
us to find the appropriate wil6210_vif structure when we
only have access to wireless_dev or net_device.
Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 0df2aada6659..b33aa7ddf24e 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h @@ -669,10 +669,18 @@ extern struct blink_on_off_time led_blink_time[WIL_LED_TIME_LAST]; extern u8 led_id; extern u8 led_polarity; +struct wil6210_vif { + struct wireless_dev wdev; + struct wil6210_priv *wil; + u8 mid; +}; + struct wil6210_priv { struct pci_dev *pdev; u32 bar_size; + struct wiphy *wiphy; struct wireless_dev *wdev; + struct net_device *ndev; void __iomem *csr; DECLARE_BITMAP(status, wil_status_last); u8 fw_version[ETHTOOL_FWVERS_LEN]; @@ -798,13 +806,15 @@ struct wil6210_priv { u32 iccm_base; }; -#define wil_to_wiphy(i) (i->wdev->wiphy) +#define wil_to_wiphy(i) (i->wiphy) #define wil_to_dev(i) (wiphy_dev(wil_to_wiphy(i))) #define wiphy_to_wil(w) (struct wil6210_priv *)(wiphy_priv(w)) #define wil_to_wdev(i) (i->wdev) #define wdev_to_wil(w) (struct wil6210_priv *)(wdev_priv(w)) -#define wil_to_ndev(i) (wil_to_wdev(i)->netdev) +#define wil_to_ndev(i) (i->ndev) #define ndev_to_wil(n) (wdev_to_wil(n->ieee80211_ptr)) +#define ndev_to_vif(n) (struct wil6210_vif *)(netdev_priv(n)) +#define wdev_to_vif(w) (container_of(w, struct wil6210_vif, wdev)) __printf(2, 3) void wil_dbg_trace(struct wil6210_priv *wil, const char *fmt, ...); @@ -900,6 +910,10 @@ void wil_memcpy_fromio_32(void *dst, const volatile void __iomem *src, void wil_memcpy_toio_32(volatile void __iomem *dst, const void *src, size_t count); +struct wil6210_vif * +wil_vif_alloc(struct wil6210_priv *wil, const char *name, + unsigned char name_assign_type, enum nl80211_iftype iftype, + u8 mid); void *wil_if_alloc(struct device *dev); void wil_if_free(struct wil6210_priv *wil); int wil_if_add(struct wil6210_priv *wil); @@ -1010,8 +1024,8 @@ static inline void wil6210_debugfs_remove(struct wil6210_priv *wil) {} int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, struct station_info *sinfo); -struct wireless_dev *wil_cfg80211_init(struct device *dev); -void wil_wdev_free(struct wil6210_priv *wil); +struct wil6210_priv *wil_cfg80211_init(struct device *dev); +void wil_cfg80211_deinit(struct wil6210_priv *wil); void wil_p2p_wdev_free(struct wil6210_priv *wil); int wmi_set_mac_address(struct wil6210_priv *wil, void *addr); |