lantiq: remove unmaintained code
[openwrt.git] / package / kernel / mac80211 / patches / 908-wlcore-wl12xx-wl18xx-configure-iface_combinations-per-hw.patch
1 Each hw supports a different iface combinations.
2 Define the supported combinations in each driver,
3 and save it in wl->iface_combinations.
4
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
8 in wlcore.
9
10 Update wl18xx interface combinations to allow
11 multiple APs.
12
13 Signed-off-by: Eliad Peller <eliad@wizery.com>
14
15 ---
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(-)
21
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
25                 },
26  };
27  
28 +static const struct ieee80211_iface_limit wl12xx_iface_limits[] = {
29 +       {
30 +               .max = 3,
31 +               .types = BIT(NL80211_IFTYPE_STATION),
32 +       },
33 +       {
34 +               .max = 1,
35 +               .types = BIT(NL80211_IFTYPE_AP) |
36 +                        BIT(NL80211_IFTYPE_P2P_GO) |
37 +                        BIT(NL80211_IFTYPE_P2P_CLIENT),
38 +       },
39 +};
40 +
41 +static const struct ieee80211_iface_combination
42 +wl12xx_iface_combinations[] = {
43 +       {
44 +               .max_interfaces = 3,
45 +               .limits = wl12xx_iface_limits,
46 +               .n_limits = ARRAY_SIZE(wl12xx_iface_limits),
47 +               .num_different_channels = 1,
48 +       },
49 +};
50 +
51  static int wl12xx_setup(struct wl1271 *wl)
52  {
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
67                 },
68  };
69  
70 +static const struct ieee80211_iface_limit wl18xx_iface_limits[] = {
71 +       {
72 +               .max = 3,
73 +               .types = BIT(NL80211_IFTYPE_STATION),
74 +       },
75 +       {
76 +               .max = 1,
77 +               .types = BIT(NL80211_IFTYPE_AP) |
78 +                        BIT(NL80211_IFTYPE_P2P_GO) |
79 +                        BIT(NL80211_IFTYPE_P2P_CLIENT),
80 +       },
81 +};
82 +
83 +static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
84 +       {
85 +               .max = 2,
86 +               .types = BIT(NL80211_IFTYPE_AP),
87 +       },
88 +};
89 +
90 +static const struct ieee80211_iface_combination
91 +wl18xx_iface_combinations[] = {
92 +       {
93 +               .max_interfaces = 3,
94 +               .limits = wl18xx_iface_limits,
95 +               .n_limits = ARRAY_SIZE(wl18xx_iface_limits),
96 +               .num_different_channels = 2,
97 +       },
98 +       {
99 +               .max_interfaces = 2,
100 +               .limits = wl18xx_iface_ap_limits,
101 +               .n_limits = ARRAY_SIZE(wl18xx_iface_ap_limits),
102 +               .num_different_channels = 1,
103 +       }
104 +};
105 +
106  static int wl18xx_setup(struct wl1271 *wl)
107  {
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
122  
123  }
124  
125 -static const struct ieee80211_iface_limit wlcore_iface_limits[] = {
126 -       {
127 -               .max = 3,
128 -               .types = BIT(NL80211_IFTYPE_STATION),
129 -       },
130 -       {
131 -               .max = 1,
132 -               .types = BIT(NL80211_IFTYPE_AP) |
133 -                        BIT(NL80211_IFTYPE_P2P_GO) |
134 -                        BIT(NL80211_IFTYPE_P2P_CLIENT),
135 -       },
136 -};
137 -
138 -static struct ieee80211_iface_combination
139 -wlcore_iface_combinations[] = {
140 -       {
141 -         .max_interfaces = 3,
142 -         .limits = wlcore_iface_limits,
143 -         .n_limits = ARRAY_SIZE(wlcore_iface_limits),
144 -       },
145 -};
146 -
147  static int wl1271_init_ieee80211(struct wl1271 *wl)
148  {
149         int i;
150 @@ -5865,10 +5843,8 @@ static int wl1271_init_ieee80211(struct
151                 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P;
152  
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;
160  
161         SET_IEEE80211_DEV(wl->hw, wl->dev);
162  
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 {
166  
167         struct completion nvs_loading_complete;
168  
169 -       /* number of concurrent channels the HW supports */
170 -       u32 num_channels;
171 +       /* interface combinations supported by the hw */
172 +       const struct ieee80211_iface_combination *iface_combinations;
173 +       u8 n_iface_combinations;
174  };
175  
176  int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);