aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/cfg80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/cfg80211.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c82
1 files changed, 47 insertions, 35 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index d1922d8eb3bb..5370333883e4 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2269,25 +2269,11 @@ static int ath6kl_set_ap_probe_resp_ies(struct ath6kl_vif *vif,
2269 return ret; 2269 return ret;
2270} 2270}
2271 2271
2272static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev, 2272static int ath6kl_set_ies(struct ath6kl_vif *vif,
2273 struct beacon_parameters *info, bool add) 2273 struct cfg80211_beacon_data *info)
2274{ 2274{
2275 struct ath6kl *ar = ath6kl_priv(dev); 2275 struct ath6kl *ar = vif->ar;
2276 struct ath6kl_vif *vif = netdev_priv(dev);
2277 struct ieee80211_mgmt *mgmt;
2278 u8 *ies;
2279 int ies_len;
2280 struct wmi_connect_cmd p;
2281 int res; 2276 int res;
2282 int i, ret;
2283
2284 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: add=%d\n", __func__, add);
2285
2286 if (!ath6kl_cfg80211_ready(vif))
2287 return -EIO;
2288
2289 if (vif->next_mode != AP_NETWORK)
2290 return -EOPNOTSUPP;
2291 2277
2292 if (info->beacon_ies) { 2278 if (info->beacon_ies) {
2293 res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, 2279 res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx,
@@ -2297,12 +2283,14 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev,
2297 if (res) 2283 if (res)
2298 return res; 2284 return res;
2299 } 2285 }
2286
2300 if (info->proberesp_ies) { 2287 if (info->proberesp_ies) {
2301 res = ath6kl_set_ap_probe_resp_ies(vif, info->proberesp_ies, 2288 res = ath6kl_set_ap_probe_resp_ies(vif, info->proberesp_ies,
2302 info->proberesp_ies_len); 2289 info->proberesp_ies_len);
2303 if (res) 2290 if (res)
2304 return res; 2291 return res;
2305 } 2292 }
2293
2306 if (info->assocresp_ies) { 2294 if (info->assocresp_ies) {
2307 res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, 2295 res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx,
2308 WMI_FRAME_ASSOC_RESP, 2296 WMI_FRAME_ASSOC_RESP,
@@ -2312,8 +2300,30 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev,
2312 return res; 2300 return res;
2313 } 2301 }
2314 2302
2315 if (!add) 2303 return 0;
2316 return 0; 2304}
2305
2306static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
2307 struct cfg80211_ap_settings *info)
2308{
2309 struct ath6kl *ar = ath6kl_priv(dev);
2310 struct ath6kl_vif *vif = netdev_priv(dev);
2311 struct ieee80211_mgmt *mgmt;
2312 u8 *ies;
2313 int ies_len;
2314 struct wmi_connect_cmd p;
2315 int res;
2316 int i, ret;
2317
2318 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s:\n", __func__);
2319
2320 if (!ath6kl_cfg80211_ready(vif))
2321 return -EIO;
2322
2323 if (vif->next_mode != AP_NETWORK)
2324 return -EOPNOTSUPP;
2325
2326 res = ath6kl_set_ies(vif, &info->beacon);
2317 2327
2318 ar->ap_mode_bkey.valid = false; 2328 ar->ap_mode_bkey.valid = false;
2319 2329
@@ -2322,13 +2332,13 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev,
2322 * info->dtim_period 2332 * info->dtim_period
2323 */ 2333 */
2324 2334
2325 if (info->head == NULL) 2335 if (info->beacon.head == NULL)
2326 return -EINVAL; 2336 return -EINVAL;
2327 mgmt = (struct ieee80211_mgmt *) info->head; 2337 mgmt = (struct ieee80211_mgmt *) info->beacon.head;
2328 ies = mgmt->u.beacon.variable; 2338 ies = mgmt->u.beacon.variable;
2329 if (ies > info->head + info->head_len) 2339 if (ies > info->beacon.head + info->beacon.head_len)
2330 return -EINVAL; 2340 return -EINVAL;
2331 ies_len = info->head + info->head_len - ies; 2341 ies_len = info->beacon.head + info->beacon.head_len - ies;
2332 2342
2333 if (info->ssid == NULL) 2343 if (info->ssid == NULL)
2334 return -EINVAL; 2344 return -EINVAL;
@@ -2436,19 +2446,21 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev,
2436 return 0; 2446 return 0;
2437} 2447}
2438 2448
2439static int ath6kl_add_beacon(struct wiphy *wiphy, struct net_device *dev, 2449static int ath6kl_change_beacon(struct wiphy *wiphy, struct net_device *dev,
2440 struct beacon_parameters *info) 2450 struct cfg80211_beacon_data *beacon)
2441{ 2451{
2442 return ath6kl_ap_beacon(wiphy, dev, info, true); 2452 struct ath6kl_vif *vif = netdev_priv(dev);
2443}
2444 2453
2445static int ath6kl_set_beacon(struct wiphy *wiphy, struct net_device *dev, 2454 if (!ath6kl_cfg80211_ready(vif))
2446 struct beacon_parameters *info) 2455 return -EIO;
2447{ 2456
2448 return ath6kl_ap_beacon(wiphy, dev, info, false); 2457 if (vif->next_mode != AP_NETWORK)
2458 return -EOPNOTSUPP;
2459
2460 return ath6kl_set_ies(vif, beacon);
2449} 2461}
2450 2462
2451static int ath6kl_del_beacon(struct wiphy *wiphy, struct net_device *dev) 2463static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev)
2452{ 2464{
2453 struct ath6kl *ar = ath6kl_priv(dev); 2465 struct ath6kl *ar = ath6kl_priv(dev);
2454 struct ath6kl_vif *vif = netdev_priv(dev); 2466 struct ath6kl_vif *vif = netdev_priv(dev);
@@ -2783,9 +2795,9 @@ static struct cfg80211_ops ath6kl_cfg80211_ops = {
2783 .resume = __ath6kl_cfg80211_resume, 2795 .resume = __ath6kl_cfg80211_resume,
2784#endif 2796#endif
2785 .set_channel = ath6kl_set_channel, 2797 .set_channel = ath6kl_set_channel,
2786 .add_beacon = ath6kl_add_beacon, 2798 .start_ap = ath6kl_start_ap,
2787 .set_beacon = ath6kl_set_beacon, 2799 .change_beacon = ath6kl_change_beacon,
2788 .del_beacon = ath6kl_del_beacon, 2800 .stop_ap = ath6kl_stop_ap,
2789 .del_station = ath6kl_del_station, 2801 .del_station = ath6kl_del_station,
2790 .change_station = ath6kl_change_station, 2802 .change_station = ath6kl_change_station,
2791 .remain_on_channel = ath6kl_remain_on_channel, 2803 .remain_on_channel = ath6kl_remain_on_channel,