diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2012-01-11 23:06:12 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:21:12 -0500 |
commit | f540f9f34b35d3c8a1d4b8d47ad5f00da951bfe7 (patch) | |
tree | 5510785d66c268c31b53fbfcdfd94a5f6627854d | |
parent | 9da9a3b29ba6a9a98e437f24576f13cbe259997b (diff) |
mwifiex: derive priv from net_device instead of wiphy
Currently mwifiex_private pointers are derived from wiphy
structures. This will always work as long as there is only
one net_device associated with one wiphy. In scenarios where
there are multiple net_devices associated with single
wiphy, one should use net_device to derive the priv.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 36f67da8fa4f..00f10059ecb4 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -79,7 +79,7 @@ static int | |||
79 | mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, | 79 | mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, |
80 | u8 key_index, bool pairwise, const u8 *mac_addr) | 80 | u8 key_index, bool pairwise, const u8 *mac_addr) |
81 | { | 81 | { |
82 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 82 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); |
83 | 83 | ||
84 | if (mwifiex_set_encode(priv, NULL, 0, key_index, 1)) { | 84 | if (mwifiex_set_encode(priv, NULL, 0, key_index, 1)) { |
85 | wiphy_err(wiphy, "deleting the crypto keys\n"); | 85 | wiphy_err(wiphy, "deleting the crypto keys\n"); |
@@ -122,7 +122,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy, | |||
122 | struct net_device *dev, | 122 | struct net_device *dev, |
123 | bool enabled, int timeout) | 123 | bool enabled, int timeout) |
124 | { | 124 | { |
125 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 125 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
126 | u32 ps_mode; | 126 | u32 ps_mode; |
127 | 127 | ||
128 | if (timeout) | 128 | if (timeout) |
@@ -143,7 +143,7 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, | |||
143 | u8 key_index, bool unicast, | 143 | u8 key_index, bool unicast, |
144 | bool multicast) | 144 | bool multicast) |
145 | { | 145 | { |
146 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 146 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); |
147 | 147 | ||
148 | /* Return if WEP key not configured */ | 148 | /* Return if WEP key not configured */ |
149 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED) | 149 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED) |
@@ -165,7 +165,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
165 | u8 key_index, bool pairwise, const u8 *mac_addr, | 165 | u8 key_index, bool pairwise, const u8 *mac_addr, |
166 | struct key_params *params) | 166 | struct key_params *params) |
167 | { | 167 | { |
168 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 168 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); |
169 | 169 | ||
170 | if (mwifiex_set_encode(priv, params->key, params->key_len, | 170 | if (mwifiex_set_encode(priv, params->key, params->key_len, |
171 | key_index, 0)) { | 171 | key_index, 0)) { |
@@ -376,7 +376,7 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, | |||
376 | struct ieee80211_channel *chan, | 376 | struct ieee80211_channel *chan, |
377 | enum nl80211_channel_type channel_type) | 377 | enum nl80211_channel_type channel_type) |
378 | { | 378 | { |
379 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 379 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
380 | 380 | ||
381 | if (priv->media_connected) { | 381 | if (priv->media_connected) { |
382 | wiphy_err(wiphy, "This setting is valid only when station " | 382 | wiphy_err(wiphy, "This setting is valid only when station " |
@@ -1004,7 +1004,7 @@ static int | |||
1004 | mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, | 1004 | mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, |
1005 | struct cfg80211_ibss_params *params) | 1005 | struct cfg80211_ibss_params *params) |
1006 | { | 1006 | { |
1007 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 1007 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
1008 | int ret = 0; | 1008 | int ret = 0; |
1009 | 1009 | ||
1010 | if (priv->bss_mode != NL80211_IFTYPE_ADHOC) { | 1010 | if (priv->bss_mode != NL80211_IFTYPE_ADHOC) { |
@@ -1042,7 +1042,7 @@ done: | |||
1042 | static int | 1042 | static int |
1043 | mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) | 1043 | mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) |
1044 | { | 1044 | { |
1045 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 1045 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
1046 | 1046 | ||
1047 | wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n", | 1047 | wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n", |
1048 | priv->cfg_bssid); | 1048 | priv->cfg_bssid); |
@@ -1280,10 +1280,7 @@ EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); | |||
1280 | */ | 1280 | */ |
1281 | int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev) | 1281 | int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev) |
1282 | { | 1282 | { |
1283 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 1283 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
1284 | |||
1285 | if (!priv || !dev) | ||
1286 | return 0; | ||
1287 | 1284 | ||
1288 | #ifdef CONFIG_DEBUG_FS | 1285 | #ifdef CONFIG_DEBUG_FS |
1289 | mwifiex_dev_debugfs_remove(priv); | 1286 | mwifiex_dev_debugfs_remove(priv); |