diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-10-22 16:55:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-29 15:28:47 -0400 |
commit | 0abb5f21b77e33b0d2a05e0362b3a0965324b408 (patch) | |
tree | c45a14e7032814a2abb18a68bae230d01fc0b17b | |
parent | 6ac4f4ed132d13b7c2b4af8e73df49846b264c71 (diff) |
brcmfmac: use vif struct to check_sys_up() function
This checks the status that will soon be moved to virtual
interface data so preparing for that use the structure
brcmf_cfg80211_vif as parameter instead.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meulemen <meuleman@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.c | 103 |
1 files changed, 59 insertions, 44 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index d01396d903e1..d6a70f7c7689 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -98,9 +98,10 @@ static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255}; | |||
98 | 98 | ||
99 | static u32 brcmf_dbg_level = WL_DBG_ERR; | 99 | static u32 brcmf_dbg_level = WL_DBG_ERR; |
100 | 100 | ||
101 | static bool check_sys_up(struct wiphy *wiphy) | 101 | static bool check_sys_up(struct brcmf_cfg80211_vif *vif) |
102 | { | 102 | { |
103 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 103 | struct brcmf_cfg80211_info *cfg = wdev_priv(&vif->wdev); |
104 | |||
104 | if (!test_bit(WL_STATUS_READY, &cfg->status)) { | 105 | if (!test_bit(WL_STATUS_READY, &cfg->status)) { |
105 | WL_INFO("device is not ready : status (%d)\n", | 106 | WL_INFO("device is not ready : status (%d)\n", |
106 | (int)cfg->status); | 107 | (int)cfg->status); |
@@ -1028,8 +1029,7 @@ scan_out: | |||
1028 | } | 1029 | } |
1029 | 1030 | ||
1030 | static s32 | 1031 | static s32 |
1031 | brcmf_cfg80211_scan(struct wiphy *wiphy, | 1032 | brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) |
1032 | struct cfg80211_scan_request *request) | ||
1033 | { | 1033 | { |
1034 | struct net_device *ndev = request->wdev->netdev; | 1034 | struct net_device *ndev = request->wdev->netdev; |
1035 | struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); | 1035 | struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); |
@@ -1037,7 +1037,8 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, | |||
1037 | 1037 | ||
1038 | WL_TRACE("Enter\n"); | 1038 | WL_TRACE("Enter\n"); |
1039 | 1039 | ||
1040 | if (!check_sys_up(wiphy)) | 1040 | if (!check_sys_up(container_of(request->wdev, |
1041 | struct brcmf_cfg80211_vif, wdev))) | ||
1041 | return -EIO; | 1042 | return -EIO; |
1042 | 1043 | ||
1043 | if (cfg->iscan_on) | 1044 | if (cfg->iscan_on) |
@@ -1093,10 +1094,11 @@ static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) | |||
1093 | { | 1094 | { |
1094 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1095 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1095 | struct net_device *ndev = cfg_to_ndev(cfg); | 1096 | struct net_device *ndev = cfg_to_ndev(cfg); |
1097 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
1096 | s32 err = 0; | 1098 | s32 err = 0; |
1097 | 1099 | ||
1098 | WL_TRACE("Enter\n"); | 1100 | WL_TRACE("Enter\n"); |
1099 | if (!check_sys_up(wiphy)) | 1101 | if (!check_sys_up(ifp->vif)) |
1100 | return -EIO; | 1102 | return -EIO; |
1101 | 1103 | ||
1102 | if (changed & WIPHY_PARAM_RTS_THRESHOLD && | 1104 | if (changed & WIPHY_PARAM_RTS_THRESHOLD && |
@@ -1189,7 +1191,8 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev, | |||
1189 | struct cfg80211_ibss_params *params) | 1191 | struct cfg80211_ibss_params *params) |
1190 | { | 1192 | { |
1191 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1193 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1192 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); | 1194 | struct brcmf_if *ifp = netdev_priv(ndev); |
1195 | struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; | ||
1193 | struct brcmf_join_params join_params; | 1196 | struct brcmf_join_params join_params; |
1194 | size_t join_params_size = 0; | 1197 | size_t join_params_size = 0; |
1195 | s32 err = 0; | 1198 | s32 err = 0; |
@@ -1197,7 +1200,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev, | |||
1197 | s32 bcnprd; | 1200 | s32 bcnprd; |
1198 | 1201 | ||
1199 | WL_TRACE("Enter\n"); | 1202 | WL_TRACE("Enter\n"); |
1200 | if (!check_sys_up(wiphy)) | 1203 | if (!check_sys_up(ifp->vif)) |
1201 | return -EIO; | 1204 | return -EIO; |
1202 | 1205 | ||
1203 | if (params->ssid) | 1206 | if (params->ssid) |
@@ -1332,10 +1335,11 @@ static s32 | |||
1332 | brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev) | 1335 | brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev) |
1333 | { | 1336 | { |
1334 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1337 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1338 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
1335 | s32 err = 0; | 1339 | s32 err = 0; |
1336 | 1340 | ||
1337 | WL_TRACE("Enter\n"); | 1341 | WL_TRACE("Enter\n"); |
1338 | if (!check_sys_up(wiphy)) | 1342 | if (!check_sys_up(ifp->vif)) |
1339 | return -EIO; | 1343 | return -EIO; |
1340 | 1344 | ||
1341 | brcmf_link_down(cfg); | 1345 | brcmf_link_down(cfg); |
@@ -1603,7 +1607,8 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, | |||
1603 | struct cfg80211_connect_params *sme) | 1607 | struct cfg80211_connect_params *sme) |
1604 | { | 1608 | { |
1605 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1609 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1606 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); | 1610 | struct brcmf_if *ifp = netdev_priv(ndev); |
1611 | struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; | ||
1607 | struct ieee80211_channel *chan = sme->channel; | 1612 | struct ieee80211_channel *chan = sme->channel; |
1608 | struct brcmf_join_params join_params; | 1613 | struct brcmf_join_params join_params; |
1609 | size_t join_params_size; | 1614 | size_t join_params_size; |
@@ -1612,7 +1617,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, | |||
1612 | s32 err = 0; | 1617 | s32 err = 0; |
1613 | 1618 | ||
1614 | WL_TRACE("Enter\n"); | 1619 | WL_TRACE("Enter\n"); |
1615 | if (!check_sys_up(wiphy)) | 1620 | if (!check_sys_up(ifp->vif)) |
1616 | return -EIO; | 1621 | return -EIO; |
1617 | 1622 | ||
1618 | if (!sme->ssid) { | 1623 | if (!sme->ssid) { |
@@ -1696,12 +1701,13 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev, | |||
1696 | u16 reason_code) | 1701 | u16 reason_code) |
1697 | { | 1702 | { |
1698 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1703 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1699 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); | 1704 | struct brcmf_if *ifp = netdev_priv(ndev); |
1705 | struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; | ||
1700 | struct brcmf_scb_val_le scbval; | 1706 | struct brcmf_scb_val_le scbval; |
1701 | s32 err = 0; | 1707 | s32 err = 0; |
1702 | 1708 | ||
1703 | WL_TRACE("Enter. Reason code = %d\n", reason_code); | 1709 | WL_TRACE("Enter. Reason code = %d\n", reason_code); |
1704 | if (!check_sys_up(wiphy)) | 1710 | if (!check_sys_up(ifp->vif)) |
1705 | return -EIO; | 1711 | return -EIO; |
1706 | 1712 | ||
1707 | clear_bit(WL_STATUS_CONNECTED, &cfg->status); | 1713 | clear_bit(WL_STATUS_CONNECTED, &cfg->status); |
@@ -1725,14 +1731,15 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, | |||
1725 | { | 1731 | { |
1726 | 1732 | ||
1727 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1733 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1728 | struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); | 1734 | struct net_device *ndev = cfg_to_ndev(cfg); |
1735 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
1729 | u16 txpwrmw; | 1736 | u16 txpwrmw; |
1730 | s32 err = 0; | 1737 | s32 err = 0; |
1731 | s32 disable = 0; | 1738 | s32 disable = 0; |
1732 | s32 dbm = MBM_TO_DBM(mbm); | 1739 | s32 dbm = MBM_TO_DBM(mbm); |
1733 | 1740 | ||
1734 | WL_TRACE("Enter\n"); | 1741 | WL_TRACE("Enter\n"); |
1735 | if (!check_sys_up(wiphy)) | 1742 | if (!check_sys_up(ifp->vif)) |
1736 | return -EIO; | 1743 | return -EIO; |
1737 | 1744 | ||
1738 | switch (type) { | 1745 | switch (type) { |
@@ -1771,16 +1778,16 @@ done: | |||
1771 | static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm) | 1778 | static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm) |
1772 | { | 1779 | { |
1773 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1780 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1774 | struct net_device *ndev = cfg_to_ndev(cfg); | 1781 | struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); |
1775 | s32 txpwrdbm; | 1782 | s32 txpwrdbm; |
1776 | u8 result; | 1783 | u8 result; |
1777 | s32 err = 0; | 1784 | s32 err = 0; |
1778 | 1785 | ||
1779 | WL_TRACE("Enter\n"); | 1786 | WL_TRACE("Enter\n"); |
1780 | if (!check_sys_up(wiphy)) | 1787 | if (!check_sys_up(ifp->vif)) |
1781 | return -EIO; | 1788 | return -EIO; |
1782 | 1789 | ||
1783 | err = brcmf_fil_iovar_int_get(netdev_priv(ndev), "qtxpower", &txpwrdbm); | 1790 | err = brcmf_fil_iovar_int_get(ifp, "qtxpower", &txpwrdbm); |
1784 | if (err) { | 1791 | if (err) { |
1785 | WL_ERR("error (%d)\n", err); | 1792 | WL_ERR("error (%d)\n", err); |
1786 | goto done; | 1793 | goto done; |
@@ -1798,16 +1805,17 @@ static s32 | |||
1798 | brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, | 1805 | brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, |
1799 | u8 key_idx, bool unicast, bool multicast) | 1806 | u8 key_idx, bool unicast, bool multicast) |
1800 | { | 1807 | { |
1808 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
1801 | u32 index; | 1809 | u32 index; |
1802 | u32 wsec; | 1810 | u32 wsec; |
1803 | s32 err = 0; | 1811 | s32 err = 0; |
1804 | 1812 | ||
1805 | WL_TRACE("Enter\n"); | 1813 | WL_TRACE("Enter\n"); |
1806 | WL_CONN("key index (%d)\n", key_idx); | 1814 | WL_CONN("key index (%d)\n", key_idx); |
1807 | if (!check_sys_up(wiphy)) | 1815 | if (!check_sys_up(ifp->vif)) |
1808 | return -EIO; | 1816 | return -EIO; |
1809 | 1817 | ||
1810 | err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wsec", &wsec); | 1818 | err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); |
1811 | if (err) { | 1819 | if (err) { |
1812 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); | 1820 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); |
1813 | goto done; | 1821 | goto done; |
@@ -1816,7 +1824,7 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1816 | if (wsec & WEP_ENABLED) { | 1824 | if (wsec & WEP_ENABLED) { |
1817 | /* Just select a new current key */ | 1825 | /* Just select a new current key */ |
1818 | index = key_idx; | 1826 | index = key_idx; |
1819 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), | 1827 | err = brcmf_fil_cmd_int_set(ifp, |
1820 | BRCMF_C_SET_KEY_PRIMARY, index); | 1828 | BRCMF_C_SET_KEY_PRIMARY, index); |
1821 | if (err) | 1829 | if (err) |
1822 | WL_ERR("error (%d)\n", err); | 1830 | WL_ERR("error (%d)\n", err); |
@@ -1911,6 +1919,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1911 | struct key_params *params) | 1919 | struct key_params *params) |
1912 | { | 1920 | { |
1913 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1921 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1922 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
1914 | struct brcmf_wsec_key key; | 1923 | struct brcmf_wsec_key key; |
1915 | s32 val; | 1924 | s32 val; |
1916 | s32 wsec; | 1925 | s32 wsec; |
@@ -1919,7 +1928,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1919 | 1928 | ||
1920 | WL_TRACE("Enter\n"); | 1929 | WL_TRACE("Enter\n"); |
1921 | WL_CONN("key index (%d)\n", key_idx); | 1930 | WL_CONN("key index (%d)\n", key_idx); |
1922 | if (!check_sys_up(wiphy)) | 1931 | if (!check_sys_up(ifp->vif)) |
1923 | return -EIO; | 1932 | return -EIO; |
1924 | 1933 | ||
1925 | if (mac_addr) { | 1934 | if (mac_addr) { |
@@ -1981,13 +1990,13 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1981 | if (err) | 1990 | if (err) |
1982 | goto done; | 1991 | goto done; |
1983 | 1992 | ||
1984 | err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wsec", &wsec); | 1993 | err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); |
1985 | if (err) { | 1994 | if (err) { |
1986 | WL_ERR("get wsec error (%d)\n", err); | 1995 | WL_ERR("get wsec error (%d)\n", err); |
1987 | goto done; | 1996 | goto done; |
1988 | } | 1997 | } |
1989 | wsec |= val; | 1998 | wsec |= val; |
1990 | err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec); | 1999 | err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec); |
1991 | if (err) { | 2000 | if (err) { |
1992 | WL_ERR("set wsec error (%d)\n", err); | 2001 | WL_ERR("set wsec error (%d)\n", err); |
1993 | goto done; | 2002 | goto done; |
@@ -2002,11 +2011,12 @@ static s32 | |||
2002 | brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, | 2011 | brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, |
2003 | u8 key_idx, bool pairwise, const u8 *mac_addr) | 2012 | u8 key_idx, bool pairwise, const u8 *mac_addr) |
2004 | { | 2013 | { |
2014 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
2005 | struct brcmf_wsec_key key; | 2015 | struct brcmf_wsec_key key; |
2006 | s32 err = 0; | 2016 | s32 err = 0; |
2007 | 2017 | ||
2008 | WL_TRACE("Enter\n"); | 2018 | WL_TRACE("Enter\n"); |
2009 | if (!check_sys_up(wiphy)) | 2019 | if (!check_sys_up(ifp->vif)) |
2010 | return -EIO; | 2020 | return -EIO; |
2011 | 2021 | ||
2012 | memset(&key, 0, sizeof(key)); | 2022 | memset(&key, 0, sizeof(key)); |
@@ -2039,19 +2049,20 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, | |||
2039 | void (*callback) (void *cookie, struct key_params * params)) | 2049 | void (*callback) (void *cookie, struct key_params * params)) |
2040 | { | 2050 | { |
2041 | struct key_params params; | 2051 | struct key_params params; |
2042 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); | 2052 | struct brcmf_if *ifp = netdev_priv(ndev); |
2053 | struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; | ||
2043 | struct brcmf_cfg80211_security *sec; | 2054 | struct brcmf_cfg80211_security *sec; |
2044 | s32 wsec; | 2055 | s32 wsec; |
2045 | s32 err = 0; | 2056 | s32 err = 0; |
2046 | 2057 | ||
2047 | WL_TRACE("Enter\n"); | 2058 | WL_TRACE("Enter\n"); |
2048 | WL_CONN("key index (%d)\n", key_idx); | 2059 | WL_CONN("key index (%d)\n", key_idx); |
2049 | if (!check_sys_up(wiphy)) | 2060 | if (!check_sys_up(ifp->vif)) |
2050 | return -EIO; | 2061 | return -EIO; |
2051 | 2062 | ||
2052 | memset(¶ms, 0, sizeof(params)); | 2063 | memset(¶ms, 0, sizeof(params)); |
2053 | 2064 | ||
2054 | err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wsec", &wsec); | 2065 | err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); |
2055 | if (err) { | 2066 | if (err) { |
2056 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); | 2067 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); |
2057 | /* Ignore this error, may happen during DISASSOC */ | 2068 | /* Ignore this error, may happen during DISASSOC */ |
@@ -2103,7 +2114,8 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2103 | u8 *mac, struct station_info *sinfo) | 2114 | u8 *mac, struct station_info *sinfo) |
2104 | { | 2115 | { |
2105 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 2116 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
2106 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); | 2117 | struct brcmf_if *ifp = netdev_priv(ndev); |
2118 | struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; | ||
2107 | struct brcmf_scb_val_le scb_val; | 2119 | struct brcmf_scb_val_le scb_val; |
2108 | int rssi; | 2120 | int rssi; |
2109 | s32 rate; | 2121 | s32 rate; |
@@ -2112,12 +2124,12 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2112 | struct brcmf_sta_info_le sta_info_le; | 2124 | struct brcmf_sta_info_le sta_info_le; |
2113 | 2125 | ||
2114 | WL_TRACE("Enter, MAC %pM\n", mac); | 2126 | WL_TRACE("Enter, MAC %pM\n", mac); |
2115 | if (!check_sys_up(wiphy)) | 2127 | if (!check_sys_up(ifp->vif)) |
2116 | return -EIO; | 2128 | return -EIO; |
2117 | 2129 | ||
2118 | if (cfg->conf->mode == WL_MODE_AP) { | 2130 | if (cfg->conf->mode == WL_MODE_AP) { |
2119 | memcpy(&sta_info_le, mac, ETH_ALEN); | 2131 | memcpy(&sta_info_le, mac, ETH_ALEN); |
2120 | err = brcmf_fil_iovar_data_get(netdev_priv(ndev), "sta_info", | 2132 | err = brcmf_fil_iovar_data_get(ifp, "sta_info", |
2121 | &sta_info_le, | 2133 | &sta_info_le, |
2122 | sizeof(sta_info_le)); | 2134 | sizeof(sta_info_le)); |
2123 | if (err < 0) { | 2135 | if (err < 0) { |
@@ -2140,7 +2152,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2140 | goto done; | 2152 | goto done; |
2141 | } | 2153 | } |
2142 | /* Report the current tx rate */ | 2154 | /* Report the current tx rate */ |
2143 | err = brcmf_fil_cmd_int_get(netdev_priv(ndev), BRCMF_C_GET_RATE, &rate); | 2155 | err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate); |
2144 | if (err) { | 2156 | if (err) { |
2145 | WL_ERR("Could not get rate (%d)\n", err); | 2157 | WL_ERR("Could not get rate (%d)\n", err); |
2146 | goto done; | 2158 | goto done; |
@@ -2152,8 +2164,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2152 | 2164 | ||
2153 | if (test_bit(WL_STATUS_CONNECTED, &cfg->status)) { | 2165 | if (test_bit(WL_STATUS_CONNECTED, &cfg->status)) { |
2154 | memset(&scb_val, 0, sizeof(scb_val)); | 2166 | memset(&scb_val, 0, sizeof(scb_val)); |
2155 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), | 2167 | err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scb_val, |
2156 | BRCMF_C_GET_RSSI, &scb_val, | ||
2157 | sizeof(scb_val)); | 2168 | sizeof(scb_val)); |
2158 | if (err) { | 2169 | if (err) { |
2159 | WL_ERR("Could not get rssi (%d)\n", err); | 2170 | WL_ERR("Could not get rssi (%d)\n", err); |
@@ -2216,6 +2227,7 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *ndev, | |||
2216 | const u8 *addr, | 2227 | const u8 *addr, |
2217 | const struct cfg80211_bitrate_mask *mask) | 2228 | const struct cfg80211_bitrate_mask *mask) |
2218 | { | 2229 | { |
2230 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
2219 | struct brcm_rateset_le rateset_le; | 2231 | struct brcm_rateset_le rateset_le; |
2220 | s32 rate; | 2232 | s32 rate; |
2221 | s32 val; | 2233 | s32 val; |
@@ -2225,12 +2237,12 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *ndev, | |||
2225 | s32 err = 0; | 2237 | s32 err = 0; |
2226 | 2238 | ||
2227 | WL_TRACE("Enter\n"); | 2239 | WL_TRACE("Enter\n"); |
2228 | if (!check_sys_up(wiphy)) | 2240 | if (!check_sys_up(ifp->vif)) |
2229 | return -EIO; | 2241 | return -EIO; |
2230 | 2242 | ||
2231 | /* addr param is always NULL. ignore it */ | 2243 | /* addr param is always NULL. ignore it */ |
2232 | /* Get current rateset */ | 2244 | /* Get current rateset */ |
2233 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCM_GET_CURR_RATESET, | 2245 | err = brcmf_fil_cmd_data_get(ifp, BRCM_GET_CURR_RATESET, |
2234 | &rateset_le, sizeof(rateset_le)); | 2246 | &rateset_le, sizeof(rateset_le)); |
2235 | if (err) { | 2247 | if (err) { |
2236 | WL_ERR("could not get current rateset (%d)\n", err); | 2248 | WL_ERR("could not get current rateset (%d)\n", err); |
@@ -2258,8 +2270,8 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *ndev, | |||
2258 | * Set rate override, | 2270 | * Set rate override, |
2259 | * Since the is a/b/g-blind, both a/bg_rate are enforced. | 2271 | * Since the is a/b/g-blind, both a/bg_rate are enforced. |
2260 | */ | 2272 | */ |
2261 | err_bg = brcmf_fil_iovar_int_set(netdev_priv(ndev), "bg_rate", rate); | 2273 | err_bg = brcmf_fil_iovar_int_set(ifp, "bg_rate", rate); |
2262 | err_a = brcmf_fil_iovar_int_set(netdev_priv(ndev), "a_rate", rate); | 2274 | err_a = brcmf_fil_iovar_int_set(ifp, "a_rate", rate); |
2263 | if (err_bg && err_a) { | 2275 | if (err_bg && err_a) { |
2264 | WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a); | 2276 | WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a); |
2265 | err = err_bg | err_a; | 2277 | err = err_bg | err_a; |
@@ -3072,13 +3084,14 @@ brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *ndev, | |||
3072 | struct cfg80211_pmksa *pmksa) | 3084 | struct cfg80211_pmksa *pmksa) |
3073 | { | 3085 | { |
3074 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 3086 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
3087 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
3075 | struct pmkid_list *pmkids = &cfg->pmk_list->pmkids; | 3088 | struct pmkid_list *pmkids = &cfg->pmk_list->pmkids; |
3076 | s32 err = 0; | 3089 | s32 err = 0; |
3077 | int i; | 3090 | int i; |
3078 | int pmkid_len; | 3091 | int pmkid_len; |
3079 | 3092 | ||
3080 | WL_TRACE("Enter\n"); | 3093 | WL_TRACE("Enter\n"); |
3081 | if (!check_sys_up(wiphy)) | 3094 | if (!check_sys_up(ifp->vif)) |
3082 | return -EIO; | 3095 | return -EIO; |
3083 | 3096 | ||
3084 | pmkid_len = le32_to_cpu(pmkids->npmkid); | 3097 | pmkid_len = le32_to_cpu(pmkids->npmkid); |
@@ -3111,12 +3124,13 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *ndev, | |||
3111 | struct cfg80211_pmksa *pmksa) | 3124 | struct cfg80211_pmksa *pmksa) |
3112 | { | 3125 | { |
3113 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 3126 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
3127 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
3114 | struct pmkid_list pmkid; | 3128 | struct pmkid_list pmkid; |
3115 | s32 err = 0; | 3129 | s32 err = 0; |
3116 | int i, pmkid_len; | 3130 | int i, pmkid_len; |
3117 | 3131 | ||
3118 | WL_TRACE("Enter\n"); | 3132 | WL_TRACE("Enter\n"); |
3119 | if (!check_sys_up(wiphy)) | 3133 | if (!check_sys_up(ifp->vif)) |
3120 | return -EIO; | 3134 | return -EIO; |
3121 | 3135 | ||
3122 | memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN); | 3136 | memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN); |
@@ -3161,10 +3175,11 @@ static s32 | |||
3161 | brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *ndev) | 3175 | brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *ndev) |
3162 | { | 3176 | { |
3163 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 3177 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
3178 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
3164 | s32 err = 0; | 3179 | s32 err = 0; |
3165 | 3180 | ||
3166 | WL_TRACE("Enter\n"); | 3181 | WL_TRACE("Enter\n"); |
3167 | if (!check_sys_up(wiphy)) | 3182 | if (!check_sys_up(ifp->vif)) |
3168 | return -EIO; | 3183 | return -EIO; |
3169 | 3184 | ||
3170 | memset(cfg->pmk_list, 0, sizeof(*cfg->pmk_list)); | 3185 | memset(cfg->pmk_list, 0, sizeof(*cfg->pmk_list)); |
@@ -4106,6 +4121,7 @@ brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, | |||
4106 | u8 *mac) | 4121 | u8 *mac) |
4107 | { | 4122 | { |
4108 | struct brcmf_scb_val_le scbval; | 4123 | struct brcmf_scb_val_le scbval; |
4124 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
4109 | s32 err; | 4125 | s32 err; |
4110 | 4126 | ||
4111 | if (!mac) | 4127 | if (!mac) |
@@ -4113,13 +4129,12 @@ brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, | |||
4113 | 4129 | ||
4114 | WL_TRACE("Enter %pM\n", mac); | 4130 | WL_TRACE("Enter %pM\n", mac); |
4115 | 4131 | ||
4116 | if (!check_sys_up(wiphy)) | 4132 | if (!check_sys_up(ifp->vif)) |
4117 | return -EIO; | 4133 | return -EIO; |
4118 | 4134 | ||
4119 | memcpy(&scbval.ea, mac, ETH_ALEN); | 4135 | memcpy(&scbval.ea, mac, ETH_ALEN); |
4120 | scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING); | 4136 | scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING); |
4121 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), | 4137 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, |
4122 | BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, | ||
4123 | &scbval, sizeof(scbval)); | 4138 | &scbval, sizeof(scbval)); |
4124 | if (err) | 4139 | if (err) |
4125 | WL_ERR("SCB_DEAUTHENTICATE_FOR_REASON failed %d\n", err); | 4140 | WL_ERR("SCB_DEAUTHENTICATE_FOR_REASON failed %d\n", err); |