aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2012-10-22 16:55:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-29 15:28:45 -0400
commit6ac4f4ed132d13b7c2b4af8e73df49846b264c71 (patch)
tree46dfa0167f3de36914308439bf4e03f92f0ae4c5
parent3eacf866559c3d2062690bab8bf09f15f963fb16 (diff)
brcmfmac: store profile information per virtual interface
The profile information applies to an interface so each virtual interface needs it. So it is removed from brcmf_cfg80211_info and added to brcmf_cfg80211_vif structure. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c59
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h10
2 files changed, 34 insertions, 35 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 21d6ab358c8..d01396d903e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1189,7 +1189,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
1189 struct cfg80211_ibss_params *params) 1189 struct cfg80211_ibss_params *params)
1190{ 1190{
1191 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 1191 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1192 struct brcmf_cfg80211_profile *profile = cfg->profile; 1192 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1193 struct brcmf_join_params join_params; 1193 struct brcmf_join_params join_params;
1194 size_t join_params_size = 0; 1194 size_t join_params_size = 0;
1195 s32 err = 0; 1195 s32 err = 0;
@@ -1348,8 +1348,7 @@ brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
1348static s32 brcmf_set_wpa_version(struct net_device *ndev, 1348static s32 brcmf_set_wpa_version(struct net_device *ndev,
1349 struct cfg80211_connect_params *sme) 1349 struct cfg80211_connect_params *sme)
1350{ 1350{
1351 struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); 1351 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1352 struct brcmf_cfg80211_profile *profile = cfg->profile;
1353 struct brcmf_cfg80211_security *sec; 1352 struct brcmf_cfg80211_security *sec;
1354 s32 val = 0; 1353 s32 val = 0;
1355 s32 err = 0; 1354 s32 err = 0;
@@ -1374,8 +1373,7 @@ static s32 brcmf_set_wpa_version(struct net_device *ndev,
1374static s32 brcmf_set_auth_type(struct net_device *ndev, 1373static s32 brcmf_set_auth_type(struct net_device *ndev,
1375 struct cfg80211_connect_params *sme) 1374 struct cfg80211_connect_params *sme)
1376{ 1375{
1377 struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); 1376 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1378 struct brcmf_cfg80211_profile *profile = cfg->profile;
1379 struct brcmf_cfg80211_security *sec; 1377 struct brcmf_cfg80211_security *sec;
1380 s32 val = 0; 1378 s32 val = 0;
1381 s32 err = 0; 1379 s32 err = 0;
@@ -1415,8 +1413,7 @@ static s32
1415brcmf_set_set_cipher(struct net_device *ndev, 1413brcmf_set_set_cipher(struct net_device *ndev,
1416 struct cfg80211_connect_params *sme) 1414 struct cfg80211_connect_params *sme)
1417{ 1415{
1418 struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); 1416 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1419 struct brcmf_cfg80211_profile *profile = cfg->profile;
1420 struct brcmf_cfg80211_security *sec; 1417 struct brcmf_cfg80211_security *sec;
1421 s32 pval = 0; 1418 s32 pval = 0;
1422 s32 gval = 0; 1419 s32 gval = 0;
@@ -1482,8 +1479,7 @@ brcmf_set_set_cipher(struct net_device *ndev,
1482static s32 1479static s32
1483brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme) 1480brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
1484{ 1481{
1485 struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); 1482 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1486 struct brcmf_cfg80211_profile *profile = cfg->profile;
1487 struct brcmf_cfg80211_security *sec; 1483 struct brcmf_cfg80211_security *sec;
1488 s32 val = 0; 1484 s32 val = 0;
1489 s32 err = 0; 1485 s32 err = 0;
@@ -1541,8 +1537,7 @@ static s32
1541brcmf_set_sharedkey(struct net_device *ndev, 1537brcmf_set_sharedkey(struct net_device *ndev,
1542 struct cfg80211_connect_params *sme) 1538 struct cfg80211_connect_params *sme)
1543{ 1539{
1544 struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); 1540 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1545 struct brcmf_cfg80211_profile *profile = cfg->profile;
1546 struct brcmf_cfg80211_security *sec; 1541 struct brcmf_cfg80211_security *sec;
1547 struct brcmf_wsec_key key; 1542 struct brcmf_wsec_key key;
1548 s32 val; 1543 s32 val;
@@ -1608,7 +1603,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
1608 struct cfg80211_connect_params *sme) 1603 struct cfg80211_connect_params *sme)
1609{ 1604{
1610 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 1605 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1611 struct brcmf_cfg80211_profile *profile = cfg->profile; 1606 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1612 struct ieee80211_channel *chan = sme->channel; 1607 struct ieee80211_channel *chan = sme->channel;
1613 struct brcmf_join_params join_params; 1608 struct brcmf_join_params join_params;
1614 size_t join_params_size; 1609 size_t join_params_size;
@@ -1701,7 +1696,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
1701 u16 reason_code) 1696 u16 reason_code)
1702{ 1697{
1703 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 1698 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1704 struct brcmf_cfg80211_profile *profile = cfg->profile; 1699 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
1705 struct brcmf_scb_val_le scbval; 1700 struct brcmf_scb_val_le scbval;
1706 s32 err = 0; 1701 s32 err = 0;
1707 1702
@@ -2044,8 +2039,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
2044 void (*callback) (void *cookie, struct key_params * params)) 2039 void (*callback) (void *cookie, struct key_params * params))
2045{ 2040{
2046 struct key_params params; 2041 struct key_params params;
2047 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 2042 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
2048 struct brcmf_cfg80211_profile *profile = cfg->profile;
2049 struct brcmf_cfg80211_security *sec; 2043 struct brcmf_cfg80211_security *sec;
2050 s32 wsec; 2044 s32 wsec;
2051 s32 err = 0; 2045 s32 err = 0;
@@ -2109,7 +2103,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
2109 u8 *mac, struct station_info *sinfo) 2103 u8 *mac, struct station_info *sinfo)
2110{ 2104{
2111 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 2105 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
2112 struct brcmf_cfg80211_profile *profile = cfg->profile; 2106 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
2113 struct brcmf_scb_val_le scb_val; 2107 struct brcmf_scb_val_le scb_val;
2114 int rssi; 2108 int rssi;
2115 s32 rate; 2109 s32 rate;
@@ -2519,8 +2513,9 @@ brcmf_find_wpaie(u8 *parse, u32 len)
2519 2513
2520static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg) 2514static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg)
2521{ 2515{
2522 struct brcmf_cfg80211_profile *profile = cfg->profile; 2516 struct net_device *ndev = cfg_to_ndev(cfg);
2523 struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); 2517 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
2518 struct brcmf_if *ifp = netdev_priv(ndev);
2524 struct brcmf_bss_info_le *bi; 2519 struct brcmf_bss_info_le *bi;
2525 struct brcmf_ssid *ssid; 2520 struct brcmf_ssid *ssid;
2526 struct brcmf_tlv *tim; 2521 struct brcmf_tlv *tim;
@@ -3777,11 +3772,11 @@ brcmf_set_management_ie(struct brcmf_cfg80211_info *cfg,
3777 struct parsed_vndr_ies new_vndr_ies; 3772 struct parsed_vndr_ies new_vndr_ies;
3778 struct parsed_vndr_ie_info *vndrie_info; 3773 struct parsed_vndr_ie_info *vndrie_info;
3779 s32 i; 3774 s32 i;
3780 s32 bssidx = brcmf_ndev_bssidx(ndev);
3781 u8 *ptr; 3775 u8 *ptr;
3782 int remained_buf_len; 3776 int remained_buf_len;
3783 3777
3784 WL_TRACE("bssidx %d, pktflag : 0x%02X\n", bssidx, pktflag); 3778 WL_TRACE("bssidx %d, pktflag : 0x%02X\n",
3779 brcmf_ndev_bssidx(ndev), pktflag);
3785 iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); 3780 iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
3786 if (!iovar_ie_buf) 3781 if (!iovar_ie_buf)
3787 return -ENOMEM; 3782 return -ENOMEM;
@@ -4265,6 +4260,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
4265 vif->pm_block = pm_block; 4260 vif->pm_block = pm_block;
4266 vif->roam_off = -1; 4261 vif->roam_off = -1;
4267 4262
4263 brcmf_init_prof(&vif->profile);
4264
4268 list_add_tail(&vif->list, &cfg->vif_list); 4265 list_add_tail(&vif->list, &cfg->vif_list);
4269 cfg->vif_cnt++; 4266 cfg->vif_cnt++;
4270 return vif; 4267 return vif;
@@ -4412,7 +4409,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg,
4412 struct net_device *ndev, 4409 struct net_device *ndev,
4413 const struct brcmf_event_msg *e) 4410 const struct brcmf_event_msg *e)
4414{ 4411{
4415 struct brcmf_cfg80211_profile *profile = cfg->profile; 4412 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
4416 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); 4413 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
4417 struct wiphy *wiphy = cfg_to_wiphy(cfg); 4414 struct wiphy *wiphy = cfg_to_wiphy(cfg);
4418 struct ieee80211_channel *notify_channel = NULL; 4415 struct ieee80211_channel *notify_channel = NULL;
@@ -4472,7 +4469,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg,
4472 struct net_device *ndev, const struct brcmf_event_msg *e, 4469 struct net_device *ndev, const struct brcmf_event_msg *e,
4473 bool completed) 4470 bool completed)
4474{ 4471{
4475 struct brcmf_cfg80211_profile *profile = cfg->profile; 4472 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
4476 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); 4473 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
4477 s32 err = 0; 4474 s32 err = 0;
4478 4475
@@ -4546,7 +4543,7 @@ brcmf_notify_connect_status(struct brcmf_cfg80211_info *cfg,
4546 struct net_device *ndev, 4543 struct net_device *ndev,
4547 const struct brcmf_event_msg *e, void *data) 4544 const struct brcmf_event_msg *e, void *data)
4548{ 4545{
4549 struct brcmf_cfg80211_profile *profile = cfg->profile; 4546 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
4550 s32 err = 0; 4547 s32 err = 0;
4551 4548
4552 if (cfg->conf->mode == WL_MODE_AP) { 4549 if (cfg->conf->mode == WL_MODE_AP) {
@@ -4577,7 +4574,7 @@ brcmf_notify_connect_status(struct brcmf_cfg80211_info *cfg,
4577 brcmf_link_down(cfg); 4574 brcmf_link_down(cfg);
4578 } 4575 }
4579 } 4576 }
4580 brcmf_init_prof(cfg->profile); 4577 brcmf_init_prof(ndev_to_prof(ndev));
4581 } else if (brcmf_is_nonetwork(cfg, e)) { 4578 } else if (brcmf_is_nonetwork(cfg, e)) {
4582 if (brcmf_is_ibssmode(cfg)) 4579 if (brcmf_is_ibssmode(cfg))
4583 clear_bit(WL_STATUS_CONNECTING, &cfg->status); 4580 clear_bit(WL_STATUS_CONNECTING, &cfg->status);
@@ -4731,8 +4728,6 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_info *cfg)
4731 cfg->bss_info = NULL; 4728 cfg->bss_info = NULL;
4732 kfree(cfg->conf); 4729 kfree(cfg->conf);
4733 cfg->conf = NULL; 4730 cfg->conf = NULL;
4734 kfree(cfg->profile);
4735 cfg->profile = NULL;
4736 kfree(cfg->scan_req_int); 4731 kfree(cfg->scan_req_int);
4737 cfg->scan_req_int = NULL; 4732 cfg->scan_req_int = NULL;
4738 kfree(cfg->escan_ioctl_buf); 4733 kfree(cfg->escan_ioctl_buf);
@@ -4761,9 +4756,6 @@ static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_info *cfg)
4761 cfg->conf = kzalloc(sizeof(*cfg->conf), GFP_KERNEL); 4756 cfg->conf = kzalloc(sizeof(*cfg->conf), GFP_KERNEL);
4762 if (!cfg->conf) 4757 if (!cfg->conf)
4763 goto init_priv_mem_out; 4758 goto init_priv_mem_out;
4764 cfg->profile = kzalloc(sizeof(*cfg->profile), GFP_KERNEL);
4765 if (!cfg->profile)
4766 goto init_priv_mem_out;
4767 cfg->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); 4759 cfg->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
4768 if (!cfg->bss_info) 4760 if (!cfg->bss_info)
4769 goto init_priv_mem_out; 4761 goto init_priv_mem_out;
@@ -4940,7 +4932,6 @@ static s32 wl_init_priv(struct brcmf_cfg80211_info *cfg)
4940 return err; 4932 return err;
4941 brcmf_init_escan(cfg); 4933 brcmf_init_escan(cfg);
4942 brcmf_init_conf(cfg->conf); 4934 brcmf_init_conf(cfg->conf);
4943 brcmf_init_prof(cfg->profile);
4944 brcmf_link_down(cfg); 4935 brcmf_link_down(cfg);
4945 4936
4946 return err; 4937 return err;
@@ -5247,23 +5238,25 @@ default_conf_out:
5247 5238
5248static int brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_info *cfg) 5239static int brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_info *cfg)
5249{ 5240{
5241 struct net_device *ndev = cfg_to_ndev(cfg);
5242 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
5250 char buf[10+IFNAMSIZ]; 5243 char buf[10+IFNAMSIZ];
5251 struct dentry *fd; 5244 struct dentry *fd;
5252 s32 err = 0; 5245 s32 err = 0;
5253 5246
5254 sprintf(buf, "netdev:%s", cfg_to_ndev(cfg)->name); 5247 sprintf(buf, "netdev:%s", ndev->name);
5255 cfg->debugfsdir = debugfs_create_dir(buf, 5248 cfg->debugfsdir = debugfs_create_dir(buf,
5256 cfg_to_wiphy(cfg)->debugfsdir); 5249 cfg_to_wiphy(cfg)->debugfsdir);
5257 5250
5258 fd = debugfs_create_u16("beacon_int", S_IRUGO, cfg->debugfsdir, 5251 fd = debugfs_create_u16("beacon_int", S_IRUGO, cfg->debugfsdir,
5259 (u16 *)&cfg->profile->beacon_interval); 5252 (u16 *)&profile->beacon_interval);
5260 if (!fd) { 5253 if (!fd) {
5261 err = -ENOMEM; 5254 err = -ENOMEM;
5262 goto err_out; 5255 goto err_out;
5263 } 5256 }
5264 5257
5265 fd = debugfs_create_u8("dtim_period", S_IRUGO, cfg->debugfsdir, 5258 fd = debugfs_create_u8("dtim_period", S_IRUGO, cfg->debugfsdir,
5266 (u8 *)&cfg->profile->dtim_period); 5259 (u8 *)&profile->dtim_period);
5267 if (!fd) { 5260 if (!fd) {
5268 err = -ENOMEM; 5261 err = -ENOMEM;
5269 goto err_out; 5262 goto err_out;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
index 6644ea85f07..bf172d94484 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
@@ -240,6 +240,7 @@ struct brcmf_cfg80211_profile {
240 * 240 *
241 * @ifp: lower layer interface pointer 241 * @ifp: lower layer interface pointer
242 * @wdev: wireless device. 242 * @wdev: wireless device.
243 * @profile: profile information.
243 * @mode: operating mode. 244 * @mode: operating mode.
244 * @roam_off: roaming state. 245 * @roam_off: roaming state.
245 * @pm_block: power-management blocked. 246 * @pm_block: power-management blocked.
@@ -248,6 +249,7 @@ struct brcmf_cfg80211_profile {
248struct brcmf_cfg80211_vif { 249struct brcmf_cfg80211_vif {
249 struct brcmf_if *ifp; 250 struct brcmf_if *ifp;
250 struct wireless_dev wdev; 251 struct wireless_dev wdev;
252 struct brcmf_cfg80211_profile profile;
251 s32 mode; 253 s32 mode;
252 s32 roam_off; 254 s32 roam_off;
253 bool pm_block; 255 bool pm_block;
@@ -414,7 +416,6 @@ struct brcmf_pno_scanresults_le {
414 * @scan_req_int: internal scan request object. 416 * @scan_req_int: internal scan request object.
415 * @bss_info: bss information for cfg80211 layer. 417 * @bss_info: bss information for cfg80211 layer.
416 * @ie: information element object for internal purpose. 418 * @ie: information element object for internal purpose.
417 * @profile: holding dongle profile.
418 * @iscan: iscan controller information. 419 * @iscan: iscan controller information.
419 * @conn_info: association info. 420 * @conn_info: association info.
420 * @pmk_list: wpa2 pmk list. 421 * @pmk_list: wpa2 pmk list.
@@ -457,7 +458,6 @@ struct brcmf_cfg80211_info {
457 struct brcmf_cfg80211_scan_req *scan_req_int; 458 struct brcmf_cfg80211_scan_req *scan_req_int;
458 struct wl_cfg80211_bss_info *bss_info; 459 struct wl_cfg80211_bss_info *bss_info;
459 struct brcmf_cfg80211_ie ie; 460 struct brcmf_cfg80211_ie ie;
460 struct brcmf_cfg80211_profile *profile;
461 struct brcmf_cfg80211_iscan_ctrl *iscan; 461 struct brcmf_cfg80211_iscan_ctrl *iscan;
462 struct brcmf_cfg80211_connect_info conn_info; 462 struct brcmf_cfg80211_connect_info conn_info;
463 struct brcmf_cfg80211_pmk_list *pmk_list; 463 struct brcmf_cfg80211_pmk_list *pmk_list;
@@ -516,6 +516,12 @@ static inline struct brcmf_cfg80211_info *ndev_to_cfg(struct net_device *ndev)
516 return wdev_to_cfg(ndev->ieee80211_ptr); 516 return wdev_to_cfg(ndev->ieee80211_ptr);
517} 517}
518 518
519static inline struct brcmf_cfg80211_profile *ndev_to_prof(struct net_device *nd)
520{
521 struct brcmf_if *ifp = netdev_priv(nd);
522 return &ifp->vif->profile;
523}
524
519#define iscan_to_cfg(i) ((struct brcmf_cfg80211_info *)(i->data)) 525#define iscan_to_cfg(i) ((struct brcmf_cfg80211_info *)(i->data))
520#define cfg_to_iscan(w) (w->iscan) 526#define cfg_to_iscan(w) (w->iscan)
521 527