aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaital Hahn <maitalm@ti.com>2016-06-28 06:41:35 -0400
committerKalle Valo <kvalo@codeaurora.org>2016-07-18 15:33:26 -0400
commitc0174ee28003b22dba0edc160ff6f16c27d3dff1 (patch)
tree3b41b70562caeedefd6299d2d8954296c885897a
parent8cfb86003dbfbe7341574fef02c96b97cbd63997 (diff)
wlcore/wl18xx: mesh: added initial mesh support for wl8
1. Added support for interface and role of mesh type. 2. Enabled enable/start of mesh-point role, and opening and closing a connection with a mesh peer. 3. Added multirole combination of mesh and ap under the same limits of dual ap mode. 4. Add support for 'sta_rc_update' opcode for mesh IF. The 'sta_rc_update' opcode is being used in mesh_plink.c. Add support in wlcore to handle this opcode correctly for mesh (as opposed to current implementation that handles STA only). 5. Bumped the firmware version to support new Mesh functionality Signed-off-by: Maital Hahn <maitalm@ti.com> Signed-off-by: Yaniv Machani <yanivma@ti.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c15
-rw-r--r--drivers/net/wireless/ti/wl18xx/wl18xx.h2
-rw-r--r--drivers/net/wireless/ti/wlcore/acx.h1
-rw-r--r--drivers/net/wireless/ti/wlcore/boot.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.c13
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c32
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore_i.h1
7 files changed, 52 insertions, 14 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index ae47c79cb9b6..4811b74bf939 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1821,9 +1821,12 @@ static const struct ieee80211_iface_limit wl18xx_iface_limits[] = {
1821 }, 1821 },
1822 { 1822 {
1823 .max = 1, 1823 .max = 1,
1824 .types = BIT(NL80211_IFTYPE_AP) | 1824 .types = BIT(NL80211_IFTYPE_AP)
1825 BIT(NL80211_IFTYPE_P2P_GO) | 1825 | BIT(NL80211_IFTYPE_P2P_GO)
1826 BIT(NL80211_IFTYPE_P2P_CLIENT), 1826 | BIT(NL80211_IFTYPE_P2P_CLIENT)
1827#ifdef CONFIG_MAC80211_MESH
1828 | BIT(NL80211_IFTYPE_MESH_POINT)
1829#endif
1827 }, 1830 },
1828 { 1831 {
1829 .max = 1, 1832 .max = 1,
@@ -1836,6 +1839,12 @@ static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
1836 .max = 2, 1839 .max = 2,
1837 .types = BIT(NL80211_IFTYPE_AP), 1840 .types = BIT(NL80211_IFTYPE_AP),
1838 }, 1841 },
1842#ifdef CONFIG_MAC80211_MESH
1843 {
1844 .max = 1,
1845 .types = BIT(NL80211_IFTYPE_MESH_POINT),
1846 },
1847#endif
1839 { 1848 {
1840 .max = 1, 1849 .max = 1,
1841 .types = BIT(NL80211_IFTYPE_P2P_DEVICE), 1850 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h b/drivers/net/wireless/ti/wl18xx/wl18xx.h
index 71e9e382ce80..d65cc6dd7dff 100644
--- a/drivers/net/wireless/ti/wl18xx/wl18xx.h
+++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h
@@ -29,7 +29,7 @@
29#define WL18XX_IFTYPE_VER 9 29#define WL18XX_IFTYPE_VER 9
30#define WL18XX_MAJOR_VER WLCORE_FW_VER_IGNORE 30#define WL18XX_MAJOR_VER WLCORE_FW_VER_IGNORE
31#define WL18XX_SUBTYPE_VER WLCORE_FW_VER_IGNORE 31#define WL18XX_SUBTYPE_VER WLCORE_FW_VER_IGNORE
32#define WL18XX_MINOR_VER 11 32#define WL18XX_MINOR_VER 58
33 33
34#define WL18XX_CMD_MAX_SIZE 740 34#define WL18XX_CMD_MAX_SIZE 740
35 35
diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h
index 0d61fae88dcb..6321ed472891 100644
--- a/drivers/net/wireless/ti/wlcore/acx.h
+++ b/drivers/net/wireless/ti/wlcore/acx.h
@@ -105,6 +105,7 @@ enum wl12xx_role {
105 WL1271_ROLE_DEVICE, 105 WL1271_ROLE_DEVICE,
106 WL1271_ROLE_P2P_CL, 106 WL1271_ROLE_P2P_CL,
107 WL1271_ROLE_P2P_GO, 107 WL1271_ROLE_P2P_GO,
108 WL1271_ROLE_MESH_POINT,
108 109
109 WL12XX_INVALID_ROLE_TYPE = 0xff 110 WL12XX_INVALID_ROLE_TYPE = 0xff
110}; 111};
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 19b7ec7b69c2..f75d30444117 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -130,7 +130,7 @@ fail:
130 wl1271_error("Your WiFi FW version (%u.%u.%u.%u.%u) is invalid.\n" 130 wl1271_error("Your WiFi FW version (%u.%u.%u.%u.%u) is invalid.\n"
131 "Please use at least FW %s\n" 131 "Please use at least FW %s\n"
132 "You can get the latest firmwares at:\n" 132 "You can get the latest firmwares at:\n"
133 "git://github.com/TI-OpenLink/firmwares.git", 133 "git://git.ti.com/wilink8-wlan/wl18xx_fw.git",
134 fw_ver[FW_VER_CHIP], fw_ver[FW_VER_IF_TYPE], 134 fw_ver[FW_VER_CHIP], fw_ver[FW_VER_IF_TYPE],
135 fw_ver[FW_VER_MAJOR], fw_ver[FW_VER_SUBTYPE], 135 fw_ver[FW_VER_MAJOR], fw_ver[FW_VER_SUBTYPE],
136 fw_ver[FW_VER_MINOR], min_fw_str); 136 fw_ver[FW_VER_MINOR], min_fw_str);
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 5f360cecbb0b..7f4da727bb7b 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -629,11 +629,14 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
629 629
630 wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wlvif->role_id); 630 wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wlvif->role_id);
631 631
632 /* trying to use hidden SSID with an old hostapd version */ 632 /* If MESH --> ssid_len is always 0 */
633 if (wlvif->ssid_len == 0 && !bss_conf->hidden_ssid) { 633 if (!ieee80211_vif_is_mesh(vif)) {
634 wl1271_error("got a null SSID from beacon/bss"); 634 /* trying to use hidden SSID with an old hostapd version */
635 ret = -EINVAL; 635 if (wlvif->ssid_len == 0 && !bss_conf->hidden_ssid) {
636 goto out; 636 wl1271_error("got a null SSID from beacon/bss");
637 ret = -EINVAL;
638 goto out;
639 }
637 } 640 }
638 641
639 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); 642 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 9abc15293307..4652636e9ecf 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -221,6 +221,7 @@ static void wlcore_rc_update_work(struct work_struct *work)
221 struct wl12xx_vif *wlvif = container_of(work, struct wl12xx_vif, 221 struct wl12xx_vif *wlvif = container_of(work, struct wl12xx_vif,
222 rc_update_work); 222 rc_update_work);
223 struct wl1271 *wl = wlvif->wl; 223 struct wl1271 *wl = wlvif->wl;
224 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
224 225
225 mutex_lock(&wl->mutex); 226 mutex_lock(&wl->mutex);
226 227
@@ -231,8 +232,16 @@ static void wlcore_rc_update_work(struct work_struct *work)
231 if (ret < 0) 232 if (ret < 0)
232 goto out; 233 goto out;
233 234
234 wlcore_hw_sta_rc_update(wl, wlvif); 235 if (ieee80211_vif_is_mesh(vif)) {
236 ret = wl1271_acx_set_ht_capabilities(wl, &wlvif->rc_ht_cap,
237 true, wlvif->sta.hlid);
238 if (ret < 0)
239 goto out_sleep;
240 } else {
241 wlcore_hw_sta_rc_update(wl, wlvif);
242 }
235 243
244out_sleep:
236 wl1271_ps_elp_sleep(wl); 245 wl1271_ps_elp_sleep(wl);
237out: 246out:
238 mutex_unlock(&wl->mutex); 247 mutex_unlock(&wl->mutex);
@@ -2153,10 +2162,14 @@ static void wlcore_free_klv_template(struct wl1271 *wl, u8 *idx)
2153 2162
2154static u8 wl12xx_get_role_type(struct wl1271 *wl, struct wl12xx_vif *wlvif) 2163static u8 wl12xx_get_role_type(struct wl1271 *wl, struct wl12xx_vif *wlvif)
2155{ 2164{
2165 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
2166
2156 switch (wlvif->bss_type) { 2167 switch (wlvif->bss_type) {
2157 case BSS_TYPE_AP_BSS: 2168 case BSS_TYPE_AP_BSS:
2158 if (wlvif->p2p) 2169 if (wlvif->p2p)
2159 return WL1271_ROLE_P2P_GO; 2170 return WL1271_ROLE_P2P_GO;
2171 else if (ieee80211_vif_is_mesh(vif))
2172 return WL1271_ROLE_MESH_POINT;
2160 else 2173 else
2161 return WL1271_ROLE_AP; 2174 return WL1271_ROLE_AP;
2162 2175
@@ -2198,6 +2211,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
2198 wlvif->p2p = 1; 2211 wlvif->p2p = 1;
2199 /* fall-through */ 2212 /* fall-through */
2200 case NL80211_IFTYPE_AP: 2213 case NL80211_IFTYPE_AP:
2214 case NL80211_IFTYPE_MESH_POINT:
2201 wlvif->bss_type = BSS_TYPE_AP_BSS; 2215 wlvif->bss_type = BSS_TYPE_AP_BSS;
2202 break; 2216 break;
2203 default: 2217 default:
@@ -4131,9 +4145,14 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
4131 if (ret < 0) 4145 if (ret < 0)
4132 goto out; 4146 goto out;
4133 4147
4134 ret = wl1271_ap_set_probe_resp_tmpl(wl, wlvif->basic_rate, vif); 4148 /* No need to set probe resp template for mesh */
4135 if (ret < 0) 4149 if (!ieee80211_vif_is_mesh(vif)) {
4136 goto out; 4150 ret = wl1271_ap_set_probe_resp_tmpl(wl,
4151 wlvif->basic_rate,
4152 vif);
4153 if (ret < 0)
4154 goto out;
4155 }
4137 4156
4138 ret = wlcore_set_beacon_template(wl, vif, true); 4157 ret = wlcore_set_beacon_template(wl, vif, true);
4139 if (ret < 0) 4158 if (ret < 0)
@@ -5641,6 +5660,7 @@ static void wlcore_op_sta_rc_update(struct ieee80211_hw *hw,
5641 5660
5642 /* this callback is atomic, so schedule a new work */ 5661 /* this callback is atomic, so schedule a new work */
5643 wlvif->rc_update_bw = sta->bandwidth; 5662 wlvif->rc_update_bw = sta->bandwidth;
5663 memcpy(&wlvif->rc_ht_cap, &sta->ht_cap, sizeof(sta->ht_cap));
5644 ieee80211_queue_work(hw, &wlvif->rc_update_work); 5664 ieee80211_queue_work(hw, &wlvif->rc_update_work);
5645} 5665}
5646 5666
@@ -6062,7 +6082,11 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
6062 BIT(NL80211_IFTYPE_AP) | 6082 BIT(NL80211_IFTYPE_AP) |
6063 BIT(NL80211_IFTYPE_P2P_DEVICE) | 6083 BIT(NL80211_IFTYPE_P2P_DEVICE) |
6064 BIT(NL80211_IFTYPE_P2P_CLIENT) | 6084 BIT(NL80211_IFTYPE_P2P_CLIENT) |
6085#ifdef CONFIG_MAC80211_MESH
6086 BIT(NL80211_IFTYPE_MESH_POINT) |
6087#endif
6065 BIT(NL80211_IFTYPE_P2P_GO); 6088 BIT(NL80211_IFTYPE_P2P_GO);
6089
6066 wl->hw->wiphy->max_scan_ssids = 1; 6090 wl->hw->wiphy->max_scan_ssids = 1;
6067 wl->hw->wiphy->max_sched_scan_ssids = 16; 6091 wl->hw->wiphy->max_sched_scan_ssids = 16;
6068 wl->hw->wiphy->max_match_sets = 16; 6092 wl->hw->wiphy->max_match_sets = 16;
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 5c4199f3a19a..f5f910b59d86 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -472,6 +472,7 @@ struct wl12xx_vif {
472 472
473 /* update rate conrol */ 473 /* update rate conrol */
474 enum ieee80211_sta_rx_bandwidth rc_update_bw; 474 enum ieee80211_sta_rx_bandwidth rc_update_bw;
475 struct ieee80211_sta_ht_cap rc_ht_cap;
475 struct work_struct rc_update_work; 476 struct work_struct rc_update_work;
476 477
477 /* 478 /*