1 Each hw supports a different iface combinations.
2 Define the supported combinations in each driver,
3 and save it in wl->iface_combinations.
5 Since each driver defines its own combinations now,
6 it can also define its max supported channels, so
7 we no longer need to save and set it explicitly
10 Update wl18xx interface combinations to allow
13 Signed-off-by: Eliad Peller <eliad@wizery.com>
16 drivers/net/wireless/ti/wl12xx/main.c | 26 +++++++++++++++++++++-
17 drivers/net/wireless/ti/wl18xx/main.c | 39 ++++++++++++++++++++++++++++++++-
18 drivers/net/wireless/ti/wlcore/main.c | 28 ++---------------------
19 drivers/net/wireless/ti/wlcore/wlcore.h | 5 +++--
20 4 files changed, 68 insertions(+), 30 deletions(-)
22 --- a/drivers/net/wireless/ti/wl12xx/main.c
23 +++ b/drivers/net/wireless/ti/wl12xx/main.c
24 @@ -1743,6 +1743,29 @@ static struct ieee80211_sta_ht_cap wl12x
28 +static const struct ieee80211_iface_limit wl12xx_iface_limits[] = {
31 + .types = BIT(NL80211_IFTYPE_STATION),
35 + .types = BIT(NL80211_IFTYPE_AP) |
36 + BIT(NL80211_IFTYPE_P2P_GO) |
37 + BIT(NL80211_IFTYPE_P2P_CLIENT),
41 +static const struct ieee80211_iface_combination
42 +wl12xx_iface_combinations[] = {
44 + .max_interfaces = 3,
45 + .limits = wl12xx_iface_limits,
46 + .n_limits = ARRAY_SIZE(wl12xx_iface_limits),
47 + .num_different_channels = 1,
51 static int wl12xx_setup(struct wl1271 *wl)
53 struct wl12xx_priv *priv = wl->priv;
54 @@ -1757,7 +1780,8 @@ static int wl12xx_setup(struct wl1271 *w
55 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS;
56 wl->num_links = WL12XX_MAX_LINKS;
57 wl->max_ap_stations = WL12XX_MAX_AP_STATIONS;
58 - wl->num_channels = 1;
59 + wl->iface_combinations = wl12xx_iface_combinations;
60 + wl->n_iface_combinations = ARRAY_SIZE(wl12xx_iface_combinations);
61 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES;
62 wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
63 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
64 --- a/drivers/net/wireless/ti/wl18xx/main.c
65 +++ b/drivers/net/wireless/ti/wl18xx/main.c
66 @@ -1747,6 +1747,42 @@ static struct ieee80211_sta_ht_cap wl18x
70 +static const struct ieee80211_iface_limit wl18xx_iface_limits[] = {
73 + .types = BIT(NL80211_IFTYPE_STATION),
77 + .types = BIT(NL80211_IFTYPE_AP) |
78 + BIT(NL80211_IFTYPE_P2P_GO) |
79 + BIT(NL80211_IFTYPE_P2P_CLIENT),
83 +static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
86 + .types = BIT(NL80211_IFTYPE_AP),
90 +static const struct ieee80211_iface_combination
91 +wl18xx_iface_combinations[] = {
93 + .max_interfaces = 3,
94 + .limits = wl18xx_iface_limits,
95 + .n_limits = ARRAY_SIZE(wl18xx_iface_limits),
96 + .num_different_channels = 2,
99 + .max_interfaces = 2,
100 + .limits = wl18xx_iface_ap_limits,
101 + .n_limits = ARRAY_SIZE(wl18xx_iface_ap_limits),
102 + .num_different_channels = 1,
106 static int wl18xx_setup(struct wl1271 *wl)
108 struct wl18xx_priv *priv = wl->priv;
109 @@ -1760,7 +1796,8 @@ static int wl18xx_setup(struct wl1271 *w
110 wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS;
111 wl->num_links = WL18XX_MAX_LINKS;
112 wl->max_ap_stations = WL18XX_MAX_AP_STATIONS;
113 - wl->num_channels = 2;
114 + wl->iface_combinations = wl18xx_iface_combinations;
115 + wl->n_iface_combinations = ARRAY_SIZE(wl18xx_iface_combinations);
116 wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES;
117 wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
118 wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX;
119 --- a/drivers/net/wireless/ti/wlcore/main.c
120 +++ b/drivers/net/wireless/ti/wlcore/main.c
121 @@ -5723,28 +5723,6 @@ static void wl1271_unregister_hw(struct
125 -static const struct ieee80211_iface_limit wlcore_iface_limits[] = {
128 - .types = BIT(NL80211_IFTYPE_STATION),
132 - .types = BIT(NL80211_IFTYPE_AP) |
133 - BIT(NL80211_IFTYPE_P2P_GO) |
134 - BIT(NL80211_IFTYPE_P2P_CLIENT),
138 -static struct ieee80211_iface_combination
139 -wlcore_iface_combinations[] = {
141 - .max_interfaces = 3,
142 - .limits = wlcore_iface_limits,
143 - .n_limits = ARRAY_SIZE(wlcore_iface_limits),
147 static int wl1271_init_ieee80211(struct wl1271 *wl)
150 @@ -5865,10 +5843,8 @@ static int wl1271_init_ieee80211(struct
151 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P;
153 /* allowed interface combinations */
154 - wlcore_iface_combinations[0].num_different_channels = wl->num_channels;
155 - wl->hw->wiphy->iface_combinations = wlcore_iface_combinations;
156 - wl->hw->wiphy->n_iface_combinations =
157 - ARRAY_SIZE(wlcore_iface_combinations);
158 + wl->hw->wiphy->iface_combinations = wl->iface_combinations;
159 + wl->hw->wiphy->n_iface_combinations = wl->n_iface_combinations;
161 SET_IEEE80211_DEV(wl->hw, wl->dev);
163 --- a/drivers/net/wireless/ti/wlcore/wlcore.h
164 +++ b/drivers/net/wireless/ti/wlcore/wlcore.h
165 @@ -485,8 +485,9 @@ struct wl1271 {
167 struct completion nvs_loading_complete;
169 - /* number of concurrent channels the HW supports */
171 + /* interface combinations supported by the hw */
172 + const struct ieee80211_iface_combination *iface_combinations;
173 + u8 n_iface_combinations;
176 int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);