diff options
author | Avinash Patil <patila@marvell.com> | 2015-01-28 05:12:00 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-29 03:20:09 -0500 |
commit | 4facc34a1f1d6ba8fafc9afdb84f9c6ed4334c4c (patch) | |
tree | 3d6043f8200b5be8404ce522e48d5128732aea83 | |
parent | 09f63ae65f907a7fadf7fcf408f80909cbf2af4b (diff) |
mwifiex: do not declare wdev as pointer
wdev is used even after del_virtual_interface handler in cfg80211
in nl80211_post_doit. Since we have freed wdev in handling of
del_virtual_intf, this can result into crash while deleting
interface.
Avoid this be not declaring wdev which part of
mwifiex_private structure but struct wireless_dev type.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/mwifiex/11h.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/11n.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/11n_rxreorder.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 70 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfp.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_event.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/txrx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/util.c | 2 |
12 files changed, 44 insertions, 63 deletions
diff --git a/drivers/net/wireless/mwifiex/11h.c b/drivers/net/wireless/mwifiex/11h.c index 2668e83afbb6..f23b647a1411 100644 --- a/drivers/net/wireless/mwifiex/11h.c +++ b/drivers/net/wireless/mwifiex/11h.c | |||
@@ -39,7 +39,7 @@ mwifiex_11h_process_infra_join(struct mwifiex_private *priv, u8 **buffer, | |||
39 | return; | 39 | return; |
40 | 40 | ||
41 | radio_type = mwifiex_band_to_radio_type((u8) bss_desc->bss_band); | 41 | radio_type = mwifiex_band_to_radio_type((u8) bss_desc->bss_band); |
42 | sband = priv->wdev->wiphy->bands[radio_type]; | 42 | sband = priv->wdev.wiphy->bands[radio_type]; |
43 | 43 | ||
44 | cap = (struct mwifiex_ie_types_pwr_capability *)*buffer; | 44 | cap = (struct mwifiex_ie_types_pwr_capability *)*buffer; |
45 | cap->header.type = cpu_to_le16(WLAN_EID_PWR_CAPABILITY); | 45 | cap->header.type = cpu_to_le16(WLAN_EID_PWR_CAPABILITY); |
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c index c5c83cf664d8..543148d27b01 100644 --- a/drivers/net/wireless/mwifiex/11n.c +++ b/drivers/net/wireless/mwifiex/11n.c | |||
@@ -39,7 +39,7 @@ int mwifiex_fill_cap_info(struct mwifiex_private *priv, u8 radio_type, | |||
39 | { | 39 | { |
40 | uint16_t ht_ext_cap = le16_to_cpu(ht_cap->extended_ht_cap_info); | 40 | uint16_t ht_ext_cap = le16_to_cpu(ht_cap->extended_ht_cap_info); |
41 | struct ieee80211_supported_band *sband = | 41 | struct ieee80211_supported_band *sband = |
42 | priv->wdev->wiphy->bands[radio_type]; | 42 | priv->wdev.wiphy->bands[radio_type]; |
43 | 43 | ||
44 | if (WARN_ON_ONCE(!sband)) { | 44 | if (WARN_ON_ONCE(!sband)) { |
45 | dev_err(priv->adapter->dev, "Invalid radio type!\n"); | 45 | dev_err(priv->adapter->dev, "Invalid radio type!\n"); |
@@ -314,7 +314,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv, | |||
314 | return ret_len; | 314 | return ret_len; |
315 | 315 | ||
316 | radio_type = mwifiex_band_to_radio_type((u8) bss_desc->bss_band); | 316 | radio_type = mwifiex_band_to_radio_type((u8) bss_desc->bss_band); |
317 | sband = priv->wdev->wiphy->bands[radio_type]; | 317 | sband = priv->wdev.wiphy->bands[radio_type]; |
318 | 318 | ||
319 | if (bss_desc->bcn_ht_cap) { | 319 | if (bss_desc->bcn_ht_cap) { |
320 | ht_cap = (struct mwifiex_ie_types_htcap *) *buffer; | 320 | ht_cap = (struct mwifiex_ie_types_htcap *) *buffer; |
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c index c7ca5b734875..a2e8817b56d8 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c | |||
@@ -45,7 +45,7 @@ static int mwifiex_11n_dispatch_amsdu_pkt(struct mwifiex_private *priv, | |||
45 | skb_trim(skb, le16_to_cpu(local_rx_pd->rx_pkt_length)); | 45 | skb_trim(skb, le16_to_cpu(local_rx_pd->rx_pkt_length)); |
46 | 46 | ||
47 | ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, | 47 | ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, |
48 | priv->wdev->iftype, 0, false); | 48 | priv->wdev.iftype, 0, false); |
49 | 49 | ||
50 | while (!skb_queue_empty(&list)) { | 50 | while (!skb_queue_empty(&list)) { |
51 | rx_skb = __skb_dequeue(&list); | 51 | rx_skb = __skb_dequeue(&list); |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index dd0e410559f8..9710b23f65a9 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1590,15 +1590,15 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv) | |||
1590 | ie_len = ie_buf[1] + sizeof(struct ieee_types_header); | 1590 | ie_len = ie_buf[1] + sizeof(struct ieee_types_header); |
1591 | 1591 | ||
1592 | band = mwifiex_band_to_radio_type(priv->curr_bss_params.band); | 1592 | band = mwifiex_band_to_radio_type(priv->curr_bss_params.band); |
1593 | chan = __ieee80211_get_channel(priv->wdev->wiphy, | 1593 | chan = __ieee80211_get_channel(priv->wdev.wiphy, |
1594 | ieee80211_channel_to_frequency(bss_info.bss_chan, | 1594 | ieee80211_channel_to_frequency(bss_info.bss_chan, |
1595 | band)); | 1595 | band)); |
1596 | 1596 | ||
1597 | bss = cfg80211_inform_bss(priv->wdev->wiphy, chan, | 1597 | bss = cfg80211_inform_bss(priv->wdev.wiphy, chan, |
1598 | CFG80211_BSS_FTYPE_UNKNOWN, | 1598 | CFG80211_BSS_FTYPE_UNKNOWN, |
1599 | bss_info.bssid, 0, WLAN_CAPABILITY_IBSS, | 1599 | bss_info.bssid, 0, WLAN_CAPABILITY_IBSS, |
1600 | 0, ie_buf, ie_len, 0, GFP_KERNEL); | 1600 | 0, ie_buf, ie_len, 0, GFP_KERNEL); |
1601 | cfg80211_put_bss(priv->wdev->wiphy, bss); | 1601 | cfg80211_put_bss(priv->wdev.wiphy, bss); |
1602 | memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN); | 1602 | memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN); |
1603 | 1603 | ||
1604 | return 0; | 1604 | return 0; |
@@ -1719,12 +1719,12 @@ done: | |||
1719 | 1719 | ||
1720 | /* Find the BSS we want using available scan results */ | 1720 | /* Find the BSS we want using available scan results */ |
1721 | if (mode == NL80211_IFTYPE_ADHOC) | 1721 | if (mode == NL80211_IFTYPE_ADHOC) |
1722 | bss = cfg80211_get_bss(priv->wdev->wiphy, channel, | 1722 | bss = cfg80211_get_bss(priv->wdev.wiphy, channel, |
1723 | bssid, ssid, ssid_len, | 1723 | bssid, ssid, ssid_len, |
1724 | WLAN_CAPABILITY_IBSS, | 1724 | WLAN_CAPABILITY_IBSS, |
1725 | WLAN_CAPABILITY_IBSS); | 1725 | WLAN_CAPABILITY_IBSS); |
1726 | else | 1726 | else |
1727 | bss = cfg80211_get_bss(priv->wdev->wiphy, channel, | 1727 | bss = cfg80211_get_bss(priv->wdev.wiphy, channel, |
1728 | bssid, ssid, ssid_len, | 1728 | bssid, ssid, ssid_len, |
1729 | WLAN_CAPABILITY_ESS, | 1729 | WLAN_CAPABILITY_ESS, |
1730 | WLAN_CAPABILITY_ESS); | 1730 | WLAN_CAPABILITY_ESS); |
@@ -1781,7 +1781,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1781 | return -EINVAL; | 1781 | return -EINVAL; |
1782 | } | 1782 | } |
1783 | 1783 | ||
1784 | if (priv->wdev && priv->wdev->current_bss) { | 1784 | if (priv->wdev.current_bss) { |
1785 | wiphy_warn(wiphy, "%s: already connected\n", dev->name); | 1785 | wiphy_warn(wiphy, "%s: already connected\n", dev->name); |
1786 | return -EALREADY; | 1786 | return -EALREADY; |
1787 | } | 1787 | } |
@@ -1839,7 +1839,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1839 | static int mwifiex_set_ibss_params(struct mwifiex_private *priv, | 1839 | static int mwifiex_set_ibss_params(struct mwifiex_private *priv, |
1840 | struct cfg80211_ibss_params *params) | 1840 | struct cfg80211_ibss_params *params) |
1841 | { | 1841 | { |
1842 | struct wiphy *wiphy = priv->wdev->wiphy; | 1842 | struct wiphy *wiphy = priv->wdev.wiphy; |
1843 | struct mwifiex_adapter *adapter = priv->adapter; | 1843 | struct mwifiex_adapter *adapter = priv->adapter; |
1844 | int index = 0, i; | 1844 | int index = 0, i; |
1845 | u8 config_bands = 0; | 1845 | u8 config_bands = 0; |
@@ -2177,7 +2177,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2177 | struct mwifiex_private *priv; | 2177 | struct mwifiex_private *priv; |
2178 | struct net_device *dev; | 2178 | struct net_device *dev; |
2179 | void *mdev_priv; | 2179 | void *mdev_priv; |
2180 | struct wireless_dev *wdev; | ||
2181 | 2180 | ||
2182 | if (!adapter) | 2181 | if (!adapter) |
2183 | return ERR_PTR(-EFAULT); | 2182 | return ERR_PTR(-EFAULT); |
@@ -2193,13 +2192,8 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2193 | return ERR_PTR(-EINVAL); | 2192 | return ERR_PTR(-EINVAL); |
2194 | } | 2193 | } |
2195 | 2194 | ||
2196 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 2195 | priv->wdev.wiphy = wiphy; |
2197 | if (!wdev) | 2196 | priv->wdev.iftype = NL80211_IFTYPE_STATION; |
2198 | return ERR_PTR(-ENOMEM); | ||
2199 | |||
2200 | wdev->wiphy = wiphy; | ||
2201 | priv->wdev = wdev; | ||
2202 | wdev->iftype = NL80211_IFTYPE_STATION; | ||
2203 | 2197 | ||
2204 | if (type == NL80211_IFTYPE_UNSPECIFIED) | 2198 | if (type == NL80211_IFTYPE_UNSPECIFIED) |
2205 | priv->bss_mode = NL80211_IFTYPE_STATION; | 2199 | priv->bss_mode = NL80211_IFTYPE_STATION; |
@@ -2221,13 +2215,8 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2221 | return ERR_PTR(-EINVAL); | 2215 | return ERR_PTR(-EINVAL); |
2222 | } | 2216 | } |
2223 | 2217 | ||
2224 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 2218 | priv->wdev.wiphy = wiphy; |
2225 | if (!wdev) | 2219 | priv->wdev.iftype = NL80211_IFTYPE_AP; |
2226 | return ERR_PTR(-ENOMEM); | ||
2227 | |||
2228 | priv->wdev = wdev; | ||
2229 | wdev->wiphy = wiphy; | ||
2230 | wdev->iftype = NL80211_IFTYPE_AP; | ||
2231 | 2220 | ||
2232 | priv->bss_type = MWIFIEX_BSS_TYPE_UAP; | 2221 | priv->bss_type = MWIFIEX_BSS_TYPE_UAP; |
2233 | priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; | 2222 | priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; |
@@ -2246,17 +2235,12 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2246 | return ERR_PTR(-EINVAL); | 2235 | return ERR_PTR(-EINVAL); |
2247 | } | 2236 | } |
2248 | 2237 | ||
2249 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 2238 | priv->wdev.wiphy = wiphy; |
2250 | if (!wdev) | ||
2251 | return ERR_PTR(-ENOMEM); | ||
2252 | |||
2253 | priv->wdev = wdev; | ||
2254 | wdev->wiphy = wiphy; | ||
2255 | 2239 | ||
2256 | /* At start-up, wpa_supplicant tries to change the interface | 2240 | /* At start-up, wpa_supplicant tries to change the interface |
2257 | * to NL80211_IFTYPE_STATION if it is not managed mode. | 2241 | * to NL80211_IFTYPE_STATION if it is not managed mode. |
2258 | */ | 2242 | */ |
2259 | wdev->iftype = NL80211_IFTYPE_P2P_CLIENT; | 2243 | priv->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT; |
2260 | priv->bss_mode = NL80211_IFTYPE_P2P_CLIENT; | 2244 | priv->bss_mode = NL80211_IFTYPE_P2P_CLIENT; |
2261 | 2245 | ||
2262 | /* Setting bss_type to P2P tells firmware that this interface | 2246 | /* Setting bss_type to P2P tells firmware that this interface |
@@ -2272,8 +2256,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2272 | priv->bss_num = 0; | 2256 | priv->bss_num = 0; |
2273 | 2257 | ||
2274 | if (mwifiex_cfg80211_init_p2p_client(priv)) { | 2258 | if (mwifiex_cfg80211_init_p2p_client(priv)) { |
2275 | wdev = ERR_PTR(-EFAULT); | 2259 | memset(&priv->wdev, 0, sizeof(priv->wdev)); |
2276 | goto done; | 2260 | priv->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; |
2261 | return ERR_PTR(-EFAULT); | ||
2277 | } | 2262 | } |
2278 | 2263 | ||
2279 | break; | 2264 | break; |
@@ -2287,9 +2272,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2287 | IEEE80211_NUM_ACS, 1); | 2272 | IEEE80211_NUM_ACS, 1); |
2288 | if (!dev) { | 2273 | if (!dev) { |
2289 | wiphy_err(wiphy, "no memory available for netdevice\n"); | 2274 | wiphy_err(wiphy, "no memory available for netdevice\n"); |
2275 | memset(&priv->wdev, 0, sizeof(priv->wdev)); | ||
2276 | priv->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; | ||
2290 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | 2277 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
2291 | wdev = ERR_PTR(-ENOMEM); | 2278 | return ERR_PTR(-ENOMEM); |
2292 | goto done; | ||
2293 | } | 2279 | } |
2294 | 2280 | ||
2295 | mwifiex_init_priv_params(priv, dev); | 2281 | mwifiex_init_priv_params(priv, dev); |
@@ -2309,7 +2295,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2309 | &wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap, priv); | 2295 | &wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap, priv); |
2310 | 2296 | ||
2311 | dev_net_set(dev, wiphy_net(wiphy)); | 2297 | dev_net_set(dev, wiphy_net(wiphy)); |
2312 | dev->ieee80211_ptr = priv->wdev; | 2298 | dev->ieee80211_ptr = &priv->wdev; |
2313 | dev->ieee80211_ptr->iftype = priv->bss_mode; | 2299 | dev->ieee80211_ptr->iftype = priv->bss_mode; |
2314 | memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN); | 2300 | memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN); |
2315 | SET_NETDEV_DEV(dev, wiphy_dev(wiphy)); | 2301 | SET_NETDEV_DEV(dev, wiphy_dev(wiphy)); |
@@ -2330,8 +2316,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2330 | free_netdev(dev); | 2316 | free_netdev(dev); |
2331 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | 2317 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
2332 | priv->netdev = NULL; | 2318 | priv->netdev = NULL; |
2333 | wdev = ERR_PTR(-EFAULT); | 2319 | memset(&priv->wdev, 0, sizeof(priv->wdev)); |
2334 | goto done; | 2320 | priv->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; |
2321 | return ERR_PTR(-EFAULT); | ||
2335 | } | 2322 | } |
2336 | 2323 | ||
2337 | sema_init(&priv->async_sem, 1); | 2324 | sema_init(&priv->async_sem, 1); |
@@ -2342,13 +2329,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2342 | mwifiex_dev_debugfs_init(priv); | 2329 | mwifiex_dev_debugfs_init(priv); |
2343 | #endif | 2330 | #endif |
2344 | 2331 | ||
2345 | done: | 2332 | return &priv->wdev; |
2346 | if (IS_ERR(wdev)) { | ||
2347 | kfree(priv->wdev); | ||
2348 | priv->wdev = NULL; | ||
2349 | } | ||
2350 | |||
2351 | return wdev; | ||
2352 | } | 2333 | } |
2353 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); | 2334 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); |
2354 | 2335 | ||
@@ -2374,8 +2355,7 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
2374 | /* Clear the priv in adapter */ | 2355 | /* Clear the priv in adapter */ |
2375 | priv->netdev->ieee80211_ptr = NULL; | 2356 | priv->netdev->ieee80211_ptr = NULL; |
2376 | priv->netdev = NULL; | 2357 | priv->netdev = NULL; |
2377 | kfree(wdev); | 2358 | priv->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; |
2378 | priv->wdev = NULL; | ||
2379 | 2359 | ||
2380 | priv->media_connected = false; | 2360 | priv->media_connected = false; |
2381 | 2361 | ||
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c index f494fc7eeb62..e9df8826f124 100644 --- a/drivers/net/wireless/mwifiex/cfp.c +++ b/drivers/net/wireless/mwifiex/cfp.c | |||
@@ -322,9 +322,9 @@ mwifiex_get_cfp(struct mwifiex_private *priv, u8 band, u16 channel, u32 freq) | |||
322 | return cfp; | 322 | return cfp; |
323 | 323 | ||
324 | if (mwifiex_band_to_radio_type(band) == HostCmd_SCAN_RADIO_TYPE_BG) | 324 | if (mwifiex_band_to_radio_type(band) == HostCmd_SCAN_RADIO_TYPE_BG) |
325 | sband = priv->wdev->wiphy->bands[IEEE80211_BAND_2GHZ]; | 325 | sband = priv->wdev.wiphy->bands[IEEE80211_BAND_2GHZ]; |
326 | else | 326 | else |
327 | sband = priv->wdev->wiphy->bands[IEEE80211_BAND_5GHZ]; | 327 | sband = priv->wdev.wiphy->bands[IEEE80211_BAND_5GHZ]; |
328 | 328 | ||
329 | if (!sband) { | 329 | if (!sband) { |
330 | dev_err(priv->adapter->dev, "%s: cannot find cfp by band %d\n", | 330 | dev_err(priv->adapter->dev, "%s: cannot find cfp by band %d\n", |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 99cd3604b3f3..49dec6b4dc96 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -1203,8 +1203,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
1203 | continue; | 1203 | continue; |
1204 | 1204 | ||
1205 | rtnl_lock(); | 1205 | rtnl_lock(); |
1206 | if (priv->wdev && priv->netdev) | 1206 | if (priv->netdev && |
1207 | mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev); | 1207 | priv->wdev.iftype != NL80211_IFTYPE_UNSPECIFIED) |
1208 | mwifiex_del_virtual_intf(adapter->wiphy, &priv->wdev); | ||
1208 | rtnl_unlock(); | 1209 | rtnl_unlock(); |
1209 | } | 1210 | } |
1210 | 1211 | ||
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 99792b885b79..a560179cdb7b 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -547,7 +547,7 @@ struct mwifiex_private { | |||
547 | u32 curr_bcn_size; | 547 | u32 curr_bcn_size; |
548 | /* spin lock for beacon buffer */ | 548 | /* spin lock for beacon buffer */ |
549 | spinlock_t curr_bcn_buf_lock; | 549 | spinlock_t curr_bcn_buf_lock; |
550 | struct wireless_dev *wdev; | 550 | struct wireless_dev wdev; |
551 | struct mwifiex_chan_freq_power cfp; | 551 | struct mwifiex_chan_freq_power cfp; |
552 | char version_str[128]; | 552 | char version_str[128]; |
553 | #ifdef CONFIG_DEBUG_FS | 553 | #ifdef CONFIG_DEBUG_FS |
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index e304f0731647..0ffdb7c5afd2 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -496,10 +496,10 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv, | |||
496 | 496 | ||
497 | for (band = 0; (band < IEEE80211_NUM_BANDS) ; band++) { | 497 | for (band = 0; (band < IEEE80211_NUM_BANDS) ; band++) { |
498 | 498 | ||
499 | if (!priv->wdev->wiphy->bands[band]) | 499 | if (!priv->wdev.wiphy->bands[band]) |
500 | continue; | 500 | continue; |
501 | 501 | ||
502 | sband = priv->wdev->wiphy->bands[band]; | 502 | sband = priv->wdev.wiphy->bands[band]; |
503 | 503 | ||
504 | for (i = 0; (i < sband->n_channels) ; i++) { | 504 | for (i = 0; (i < sband->n_channels) ; i++) { |
505 | ch = &sband->channels[i]; | 505 | ch = &sband->channels[i]; |
@@ -1733,10 +1733,10 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info, | |||
1733 | 1733 | ||
1734 | freq = cfp ? cfp->freq : 0; | 1734 | freq = cfp ? cfp->freq : 0; |
1735 | 1735 | ||
1736 | chan = ieee80211_get_channel(priv->wdev->wiphy, freq); | 1736 | chan = ieee80211_get_channel(priv->wdev.wiphy, freq); |
1737 | 1737 | ||
1738 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { | 1738 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { |
1739 | bss = cfg80211_inform_bss(priv->wdev->wiphy, | 1739 | bss = cfg80211_inform_bss(priv->wdev.wiphy, |
1740 | chan, CFG80211_BSS_FTYPE_UNKNOWN, | 1740 | chan, CFG80211_BSS_FTYPE_UNKNOWN, |
1741 | bssid, timestamp, | 1741 | bssid, timestamp, |
1742 | cap_info_bitmap, beacon_period, | 1742 | cap_info_bitmap, beacon_period, |
@@ -1748,7 +1748,7 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info, | |||
1748 | !memcmp(bssid, priv->curr_bss_params.bss_descriptor | 1748 | !memcmp(bssid, priv->curr_bss_params.bss_descriptor |
1749 | .mac_address, ETH_ALEN)) | 1749 | .mac_address, ETH_ALEN)) |
1750 | mwifiex_update_curr_bss_params(priv, bss); | 1750 | mwifiex_update_curr_bss_params(priv, bss); |
1751 | cfg80211_put_bss(priv->wdev->wiphy, bss); | 1751 | cfg80211_put_bss(priv->wdev.wiphy, bss); |
1752 | } | 1752 | } |
1753 | } else { | 1753 | } else { |
1754 | dev_dbg(adapter->dev, "missing BSS channel IE\n"); | 1754 | dev_dbg(adapter->dev, "missing BSS channel IE\n"); |
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 419e35f1dbf3..c37e8cb2dd32 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -487,7 +487,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
487 | 487 | ||
488 | case EVENT_REMAIN_ON_CHAN_EXPIRED: | 488 | case EVENT_REMAIN_ON_CHAN_EXPIRED: |
489 | dev_dbg(adapter->dev, "event: Remain on channel expired\n"); | 489 | dev_dbg(adapter->dev, "event: Remain on channel expired\n"); |
490 | cfg80211_remain_on_channel_expired(priv->wdev, | 490 | cfg80211_remain_on_channel_expired(&priv->wdev, |
491 | priv->roc_cfg.cookie, | 491 | priv->roc_cfg.cookie, |
492 | &priv->roc_cfg.chan, | 492 | &priv->roc_cfg.chan, |
493 | GFP_ATOMIC); | 493 | GFP_ATOMIC); |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index fb9c5fc83e5d..329cd515316c 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -219,7 +219,7 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv, | |||
219 | 219 | ||
220 | if (!strncmp(priv->adapter->country_code, &country_ie[2], 2)) { | 220 | if (!strncmp(priv->adapter->country_code, &country_ie[2], 2)) { |
221 | rcu_read_unlock(); | 221 | rcu_read_unlock(); |
222 | wiphy_dbg(priv->wdev->wiphy, | 222 | wiphy_dbg(priv->wdev.wiphy, |
223 | "11D: skip setting domain info in FW\n"); | 223 | "11D: skip setting domain info in FW\n"); |
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index 6ae133333363..ac93557cbdc9 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -227,7 +227,7 @@ void mwifiex_parse_tx_status_event(struct mwifiex_private *priv, | |||
227 | /* consumes ack_skb */ | 227 | /* consumes ack_skb */ |
228 | skb_complete_wifi_ack(ack_skb, !tx_status->status); | 228 | skb_complete_wifi_ack(ack_skb, !tx_status->status); |
229 | } else { | 229 | } else { |
230 | cfg80211_mgmt_tx_status(priv->wdev, tx_info->cookie, | 230 | cfg80211_mgmt_tx_status(&priv->wdev, tx_info->cookie, |
231 | ack_skb->data, ack_skb->len, | 231 | ack_skb->data, ack_skb->len, |
232 | !tx_status->status, GFP_ATOMIC); | 232 | !tx_status->status, GFP_ATOMIC); |
233 | dev_kfree_skb_any(ack_skb); | 233 | dev_kfree_skb_any(ack_skb); |
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c index 707319799942..308550611f22 100644 --- a/drivers/net/wireless/mwifiex/util.c +++ b/drivers/net/wireless/mwifiex/util.c | |||
@@ -387,7 +387,7 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, | |||
387 | pkt_len -= ETH_ALEN + sizeof(pkt_len); | 387 | pkt_len -= ETH_ALEN + sizeof(pkt_len); |
388 | rx_pd->rx_pkt_length = cpu_to_le16(pkt_len); | 388 | rx_pd->rx_pkt_length = cpu_to_le16(pkt_len); |
389 | 389 | ||
390 | cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq, | 390 | cfg80211_rx_mgmt(&priv->wdev, priv->roc_cfg.chan.center_freq, |
391 | CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len, | 391 | CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len, |
392 | 0); | 392 | 0); |
393 | 393 | ||