Commit f540f9f3 authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville

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: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9da9a3b2
...@@ -79,7 +79,7 @@ static int ...@@ -79,7 +79,7 @@ static int
mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
u8 key_index, bool pairwise, const u8 *mac_addr) u8 key_index, bool pairwise, const u8 *mac_addr)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
if (mwifiex_set_encode(priv, NULL, 0, key_index, 1)) { if (mwifiex_set_encode(priv, NULL, 0, key_index, 1)) {
wiphy_err(wiphy, "deleting the crypto keys\n"); wiphy_err(wiphy, "deleting the crypto keys\n");
...@@ -122,7 +122,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy, ...@@ -122,7 +122,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
struct net_device *dev, struct net_device *dev,
bool enabled, int timeout) bool enabled, int timeout)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
u32 ps_mode; u32 ps_mode;
if (timeout) if (timeout)
...@@ -143,7 +143,7 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -143,7 +143,7 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
u8 key_index, bool unicast, u8 key_index, bool unicast,
bool multicast) bool multicast)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
/* Return if WEP key not configured */ /* Return if WEP key not configured */
if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED) 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,7 +165,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
u8 key_index, bool pairwise, const u8 *mac_addr, u8 key_index, bool pairwise, const u8 *mac_addr,
struct key_params *params) struct key_params *params)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
if (mwifiex_set_encode(priv, params->key, params->key_len, if (mwifiex_set_encode(priv, params->key, params->key_len,
key_index, 0)) { key_index, 0)) {
...@@ -376,7 +376,7 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, ...@@ -376,7 +376,7 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_channel *chan, struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type) enum nl80211_channel_type channel_type)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
if (priv->media_connected) { if (priv->media_connected) {
wiphy_err(wiphy, "This setting is valid only when station " wiphy_err(wiphy, "This setting is valid only when station "
...@@ -1004,7 +1004,7 @@ static int ...@@ -1004,7 +1004,7 @@ static int
mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params) struct cfg80211_ibss_params *params)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
int ret = 0; int ret = 0;
if (priv->bss_mode != NL80211_IFTYPE_ADHOC) { if (priv->bss_mode != NL80211_IFTYPE_ADHOC) {
...@@ -1042,7 +1042,7 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1042,7 +1042,7 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
static int static int
mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n", wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n",
priv->cfg_bssid); priv->cfg_bssid);
...@@ -1280,10 +1280,7 @@ EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); ...@@ -1280,10 +1280,7 @@ EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
*/ */
int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev) int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev)
{ {
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
if (!priv || !dev)
return 0;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
mwifiex_dev_debugfs_remove(priv); mwifiex_dev_debugfs_remove(priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment