diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-06-15 18:00:26 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-07-12 06:08:10 -0400 |
commit | 84efbb84cf76238faf26facf481c8675859bfaeb (patch) | |
tree | 3cc01b479a4c2db70b1b9ed59e1451d93acb5769 /drivers/net/wireless/ath/ath6kl | |
parent | 71bbc9943883cffaf5d7a7728a4e4c50b3ac44d3 (diff) |
cfg80211: use wireless_dev for interface management
In order to be able to create P2P Device wdevs, move
the virtual interface management over to wireless_dev
structures.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/core.c | 8 |
3 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 5f0c66bb6bdf..88bed02f7521 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -1487,14 +1487,14 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, | |||
1487 | return 0; | 1487 | return 0; |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | static struct net_device *ath6kl_cfg80211_add_iface(struct wiphy *wiphy, | 1490 | static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy, |
1491 | char *name, | 1491 | char *name, |
1492 | enum nl80211_iftype type, | 1492 | enum nl80211_iftype type, |
1493 | u32 *flags, | 1493 | u32 *flags, |
1494 | struct vif_params *params) | 1494 | struct vif_params *params) |
1495 | { | 1495 | { |
1496 | struct ath6kl *ar = wiphy_priv(wiphy); | 1496 | struct ath6kl *ar = wiphy_priv(wiphy); |
1497 | struct net_device *ndev; | 1497 | struct wireless_dev *wdev; |
1498 | u8 if_idx, nw_type; | 1498 | u8 if_idx, nw_type; |
1499 | 1499 | ||
1500 | if (ar->num_vif == ar->vif_max) { | 1500 | if (ar->num_vif == ar->vif_max) { |
@@ -1507,20 +1507,20 @@ static struct net_device *ath6kl_cfg80211_add_iface(struct wiphy *wiphy, | |||
1507 | return ERR_PTR(-EINVAL); | 1507 | return ERR_PTR(-EINVAL); |
1508 | } | 1508 | } |
1509 | 1509 | ||
1510 | ndev = ath6kl_interface_add(ar, name, type, if_idx, nw_type); | 1510 | wdev = ath6kl_interface_add(ar, name, type, if_idx, nw_type); |
1511 | if (!ndev) | 1511 | if (!wdev) |
1512 | return ERR_PTR(-ENOMEM); | 1512 | return ERR_PTR(-ENOMEM); |
1513 | 1513 | ||
1514 | ar->num_vif++; | 1514 | ar->num_vif++; |
1515 | 1515 | ||
1516 | return ndev; | 1516 | return wdev; |
1517 | } | 1517 | } |
1518 | 1518 | ||
1519 | static int ath6kl_cfg80211_del_iface(struct wiphy *wiphy, | 1519 | static int ath6kl_cfg80211_del_iface(struct wiphy *wiphy, |
1520 | struct net_device *ndev) | 1520 | struct wireless_dev *wdev) |
1521 | { | 1521 | { |
1522 | struct ath6kl *ar = wiphy_priv(wiphy); | 1522 | struct ath6kl *ar = wiphy_priv(wiphy); |
1523 | struct ath6kl_vif *vif = netdev_priv(ndev); | 1523 | struct ath6kl_vif *vif = netdev_priv(wdev->netdev); |
1524 | 1524 | ||
1525 | spin_lock_bh(&ar->list_lock); | 1525 | spin_lock_bh(&ar->list_lock); |
1526 | list_del(&vif->list); | 1526 | list_del(&vif->list); |
@@ -3477,9 +3477,9 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif) | |||
3477 | ar->num_vif--; | 3477 | ar->num_vif--; |
3478 | } | 3478 | } |
3479 | 3479 | ||
3480 | struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | 3480 | struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, char *name, |
3481 | enum nl80211_iftype type, u8 fw_vif_idx, | 3481 | enum nl80211_iftype type, |
3482 | u8 nw_type) | 3482 | u8 fw_vif_idx, u8 nw_type) |
3483 | { | 3483 | { |
3484 | struct net_device *ndev; | 3484 | struct net_device *ndev; |
3485 | struct ath6kl_vif *vif; | 3485 | struct ath6kl_vif *vif; |
@@ -3533,7 +3533,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | |||
3533 | list_add_tail(&vif->list, &ar->vif_list); | 3533 | list_add_tail(&vif->list, &ar->vif_list); |
3534 | spin_unlock_bh(&ar->list_lock); | 3534 | spin_unlock_bh(&ar->list_lock); |
3535 | 3535 | ||
3536 | return ndev; | 3536 | return &vif->wdev; |
3537 | 3537 | ||
3538 | err: | 3538 | err: |
3539 | aggr_module_destroy(vif->aggr_cntxt); | 3539 | aggr_module_destroy(vif->aggr_cntxt); |
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h index b992046a1b0e..56b1ebe79812 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.h +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h | |||
@@ -25,9 +25,9 @@ enum ath6kl_cfg_suspend_mode { | |||
25 | ATH6KL_CFG_SUSPEND_SCHED_SCAN, | 25 | ATH6KL_CFG_SUSPEND_SCHED_SCAN, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | 28 | struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, char *name, |
29 | enum nl80211_iftype type, | 29 | enum nl80211_iftype type, |
30 | u8 fw_vif_idx, u8 nw_type); | 30 | u8 fw_vif_idx, u8 nw_type); |
31 | void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, | 31 | void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, |
32 | enum wmi_phy_mode mode); | 32 | enum wmi_phy_mode mode); |
33 | void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted); | 33 | void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted); |
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c index fdb3b1decc76..82c4dd2a960e 100644 --- a/drivers/net/wireless/ath/ath6kl/core.c +++ b/drivers/net/wireless/ath/ath6kl/core.c | |||
@@ -56,7 +56,7 @@ EXPORT_SYMBOL(ath6kl_core_rx_complete); | |||
56 | int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) | 56 | int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) |
57 | { | 57 | { |
58 | struct ath6kl_bmi_target_info targ_info; | 58 | struct ath6kl_bmi_target_info targ_info; |
59 | struct net_device *ndev; | 59 | struct wireless_dev *wdev; |
60 | int ret = 0, i; | 60 | int ret = 0, i; |
61 | 61 | ||
62 | switch (htc_type) { | 62 | switch (htc_type) { |
@@ -187,12 +187,12 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) | |||
187 | rtnl_lock(); | 187 | rtnl_lock(); |
188 | 188 | ||
189 | /* Add an initial station interface */ | 189 | /* Add an initial station interface */ |
190 | ndev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0, | 190 | wdev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0, |
191 | INFRA_NETWORK); | 191 | INFRA_NETWORK); |
192 | 192 | ||
193 | rtnl_unlock(); | 193 | rtnl_unlock(); |
194 | 194 | ||
195 | if (!ndev) { | 195 | if (!wdev) { |
196 | ath6kl_err("Failed to instantiate a network device\n"); | 196 | ath6kl_err("Failed to instantiate a network device\n"); |
197 | ret = -ENOMEM; | 197 | ret = -ENOMEM; |
198 | wiphy_unregister(ar->wiphy); | 198 | wiphy_unregister(ar->wiphy); |
@@ -200,7 +200,7 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) | |||
200 | } | 200 | } |
201 | 201 | ||
202 | ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n", | 202 | ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n", |
203 | __func__, ndev->name, ndev, ar); | 203 | __func__, wdev->netdev->name, wdev->netdev, ar); |
204 | 204 | ||
205 | return ret; | 205 | return ret; |
206 | 206 | ||