@@ -1283,20 +1283,6 @@ static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1283
1283
return err ;
1284
1284
}
1285
1285
1286
- static void * brcmf_read_prof (struct brcmf_cfg80211_info * cfg , s32 item )
1287
- {
1288
- switch (item ) {
1289
- case WL_PROF_SEC :
1290
- return & cfg -> profile -> sec ;
1291
- case WL_PROF_BSSID :
1292
- return & cfg -> profile -> bssid ;
1293
- case WL_PROF_SSID :
1294
- return & cfg -> profile -> ssid ;
1295
- }
1296
- WL_ERR ("invalid item (%d)\n" , item );
1297
- return NULL ;
1298
- }
1299
-
1300
1286
static s32
1301
1287
brcmf_update_prof (struct brcmf_cfg80211_info * cfg ,
1302
1288
const struct brcmf_event_msg * e , void * data , s32 item )
@@ -1555,6 +1541,7 @@ static s32 brcmf_set_wpa_version(struct net_device *ndev,
1555
1541
struct cfg80211_connect_params * sme )
1556
1542
{
1557
1543
struct brcmf_cfg80211_info * cfg = ndev_to_cfg (ndev );
1544
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
1558
1545
struct brcmf_cfg80211_security * sec ;
1559
1546
s32 val = 0 ;
1560
1547
s32 err = 0 ;
@@ -1571,7 +1558,7 @@ static s32 brcmf_set_wpa_version(struct net_device *ndev,
1571
1558
WL_ERR ("set wpa_auth failed (%d)\n" , err );
1572
1559
return err ;
1573
1560
}
1574
- sec = brcmf_read_prof ( cfg , WL_PROF_SEC ) ;
1561
+ sec = & profile -> sec ;
1575
1562
sec -> wpa_versions = sme -> crypto .wpa_versions ;
1576
1563
return err ;
1577
1564
}
@@ -1580,6 +1567,7 @@ static s32 brcmf_set_auth_type(struct net_device *ndev,
1580
1567
struct cfg80211_connect_params * sme )
1581
1568
{
1582
1569
struct brcmf_cfg80211_info * cfg = ndev_to_cfg (ndev );
1570
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
1583
1571
struct brcmf_cfg80211_security * sec ;
1584
1572
s32 val = 0 ;
1585
1573
s32 err = 0 ;
@@ -1610,7 +1598,7 @@ static s32 brcmf_set_auth_type(struct net_device *ndev,
1610
1598
WL_ERR ("set auth failed (%d)\n" , err );
1611
1599
return err ;
1612
1600
}
1613
- sec = brcmf_read_prof ( cfg , WL_PROF_SEC ) ;
1601
+ sec = & profile -> sec ;
1614
1602
sec -> auth_type = sme -> auth_type ;
1615
1603
return err ;
1616
1604
}
@@ -1620,6 +1608,7 @@ brcmf_set_set_cipher(struct net_device *ndev,
1620
1608
struct cfg80211_connect_params * sme )
1621
1609
{
1622
1610
struct brcmf_cfg80211_info * cfg = ndev_to_cfg (ndev );
1611
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
1623
1612
struct brcmf_cfg80211_security * sec ;
1624
1613
s32 pval = 0 ;
1625
1614
s32 gval = 0 ;
@@ -1675,7 +1664,7 @@ brcmf_set_set_cipher(struct net_device *ndev,
1675
1664
return err ;
1676
1665
}
1677
1666
1678
- sec = brcmf_read_prof ( cfg , WL_PROF_SEC ) ;
1667
+ sec = & profile -> sec ;
1679
1668
sec -> cipher_pairwise = sme -> crypto .ciphers_pairwise [0 ];
1680
1669
sec -> cipher_group = sme -> crypto .cipher_group ;
1681
1670
@@ -1686,6 +1675,7 @@ static s32
1686
1675
brcmf_set_key_mgmt (struct net_device * ndev , struct cfg80211_connect_params * sme )
1687
1676
{
1688
1677
struct brcmf_cfg80211_info * cfg = ndev_to_cfg (ndev );
1678
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
1689
1679
struct brcmf_cfg80211_security * sec ;
1690
1680
s32 val = 0 ;
1691
1681
s32 err = 0 ;
@@ -1731,7 +1721,7 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
1731
1721
return err ;
1732
1722
}
1733
1723
}
1734
- sec = brcmf_read_prof ( cfg , WL_PROF_SEC ) ;
1724
+ sec = & profile -> sec ;
1735
1725
sec -> wpa_auth = sme -> crypto .akm_suites [0 ];
1736
1726
1737
1727
return err ;
@@ -1742,6 +1732,7 @@ brcmf_set_sharedkey(struct net_device *ndev,
1742
1732
struct cfg80211_connect_params * sme )
1743
1733
{
1744
1734
struct brcmf_cfg80211_info * cfg = ndev_to_cfg (ndev );
1735
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
1745
1736
struct brcmf_cfg80211_security * sec ;
1746
1737
struct brcmf_wsec_key key ;
1747
1738
s32 val ;
@@ -1753,7 +1744,7 @@ brcmf_set_sharedkey(struct net_device *ndev,
1753
1744
if (sme -> key_len == 0 )
1754
1745
return 0 ;
1755
1746
1756
- sec = brcmf_read_prof ( cfg , WL_PROF_SEC ) ;
1747
+ sec = & profile -> sec ;
1757
1748
WL_CONN ("wpa_versions 0x%x cipher_pairwise 0x%x\n" ,
1758
1749
sec -> wpa_versions , sec -> cipher_pairwise );
1759
1750
@@ -1901,6 +1892,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
1901
1892
u16 reason_code )
1902
1893
{
1903
1894
struct brcmf_cfg80211_info * cfg = wiphy_to_cfg (wiphy );
1895
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
1904
1896
struct brcmf_scb_val_le scbval ;
1905
1897
s32 err = 0 ;
1906
1898
@@ -1910,7 +1902,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
1910
1902
1911
1903
clear_bit (WL_STATUS_CONNECTED , & cfg -> status );
1912
1904
1913
- memcpy (& scbval .ea , brcmf_read_prof ( cfg , WL_PROF_BSSID ) , ETH_ALEN );
1905
+ memcpy (& scbval .ea , & profile -> bssid , ETH_ALEN );
1914
1906
scbval .val = cpu_to_le32 (reason_code );
1915
1907
err = brcmf_exec_dcmd (ndev , BRCMF_C_DISASSOC , & scbval ,
1916
1908
sizeof (struct brcmf_scb_val_le ));
@@ -2262,6 +2254,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
2262
2254
{
2263
2255
struct key_params params ;
2264
2256
struct brcmf_cfg80211_info * cfg = wiphy_to_cfg (wiphy );
2257
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
2265
2258
struct brcmf_cfg80211_security * sec ;
2266
2259
s32 wsec ;
2267
2260
s32 err = 0 ;
@@ -2284,7 +2277,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
2284
2277
}
2285
2278
switch (wsec & ~SES_OW_ENABLED ) {
2286
2279
case WEP_ENABLED :
2287
- sec = brcmf_read_prof ( cfg , WL_PROF_SEC ) ;
2280
+ sec = & profile -> sec ;
2288
2281
if (sec -> cipher_pairwise & WLAN_CIPHER_SUITE_WEP40 ) {
2289
2282
params .cipher = WLAN_CIPHER_SUITE_WEP40 ;
2290
2283
WL_CONN ("WLAN_CIPHER_SUITE_WEP40\n" );
@@ -2327,11 +2320,12 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
2327
2320
u8 * mac , struct station_info * sinfo )
2328
2321
{
2329
2322
struct brcmf_cfg80211_info * cfg = wiphy_to_cfg (wiphy );
2323
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
2330
2324
struct brcmf_scb_val_le scb_val ;
2331
2325
int rssi ;
2332
2326
s32 rate ;
2333
2327
s32 err = 0 ;
2334
- u8 * bssid = brcmf_read_prof ( cfg , WL_PROF_BSSID ) ;
2328
+ u8 * bssid = profile -> bssid ;
2335
2329
struct brcmf_sta_info_le * sta_info_le ;
2336
2330
2337
2331
WL_TRACE ("Enter, MAC %pM\n" , mac );
@@ -2735,6 +2729,7 @@ brcmf_find_wpaie(u8 *parse, u32 len)
2735
2729
2736
2730
static s32 brcmf_update_bss_info (struct brcmf_cfg80211_info * cfg )
2737
2731
{
2732
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
2738
2733
struct brcmf_bss_info_le * bi ;
2739
2734
struct brcmf_ssid * ssid ;
2740
2735
struct brcmf_tlv * tim ;
@@ -2748,7 +2743,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg)
2748
2743
if (brcmf_is_ibssmode (cfg ))
2749
2744
return err ;
2750
2745
2751
- ssid = ( struct brcmf_ssid * ) brcmf_read_prof ( cfg , WL_PROF_SSID ) ;
2746
+ ssid = & profile -> ssid ;
2752
2747
2753
2748
* (__le32 * )cfg -> extra_buf = cpu_to_le32 (WL_EXTRA_BUF_MAX );
2754
2749
err = brcmf_exec_dcmd (cfg_to_ndev (cfg ), BRCMF_C_GET_BSS_INFO ,
@@ -4648,6 +4643,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg,
4648
4643
struct net_device * ndev ,
4649
4644
const struct brcmf_event_msg * e )
4650
4645
{
4646
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
4651
4647
struct brcmf_cfg80211_connect_info * conn_info = cfg_to_conn (cfg );
4652
4648
struct wiphy * wiphy = cfg_to_wiphy (cfg );
4653
4649
struct brcmf_channel_info_le channel_le ;
@@ -4677,8 +4673,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg,
4677
4673
freq = ieee80211_channel_to_frequency (target_channel , band -> band );
4678
4674
notify_channel = ieee80211_get_channel (wiphy , freq );
4679
4675
4680
- cfg80211_roamed (ndev , notify_channel ,
4681
- (u8 * )brcmf_read_prof (cfg , WL_PROF_BSSID ),
4676
+ cfg80211_roamed (ndev , notify_channel , (u8 * )profile -> bssid ,
4682
4677
conn_info -> req_ie , conn_info -> req_ie_len ,
4683
4678
conn_info -> resp_ie , conn_info -> resp_ie_len , GFP_KERNEL );
4684
4679
WL_CONN ("Report roaming result\n" );
@@ -4693,6 +4688,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg,
4693
4688
struct net_device * ndev , const struct brcmf_event_msg * e ,
4694
4689
bool completed )
4695
4690
{
4691
+ struct brcmf_cfg80211_profile * profile = cfg -> profile ;
4696
4692
struct brcmf_cfg80211_connect_info * conn_info = cfg_to_conn (cfg );
4697
4693
s32 err = 0 ;
4698
4694
@@ -4706,8 +4702,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg,
4706
4702
brcmf_update_bss_info (cfg );
4707
4703
}
4708
4704
cfg80211_connect_result (ndev ,
4709
- (u8 * )brcmf_read_prof (cfg ,
4710
- WL_PROF_BSSID ),
4705
+ (u8 * )profile -> bssid ,
4711
4706
conn_info -> req_ie ,
4712
4707
conn_info -> req_ie_len ,
4713
4708
conn_info -> resp_ie ,
0 commit comments