diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-08 11:44:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-11 15:53:36 -0400 |
commit | 491775a50787b9fbb09b5735be3d111c65935f5c (patch) | |
tree | d09e49e53ea9913c5077ba591d44a18555fd7d58 | |
parent | 60f8b39c9406752ea5e0d3bbf5df6f903d61cacf (diff) |
mac80211: use sdata pointer for scan interface
Since we now use sdata pointers most of the time, using a netdev
pointer here is somewhat artificial, use an sdata pointer instead.
Replace a netdev-prefix in a few messages by a wiphy-prefix.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/main.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 24 |
3 files changed, 13 insertions, 15 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c68d4df11196..a33bbd1ca2b1 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -636,7 +636,7 @@ struct ieee80211_local { | |||
636 | enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state; | 636 | enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state; |
637 | unsigned long last_scan_completed; | 637 | unsigned long last_scan_completed; |
638 | struct delayed_work scan_work; | 638 | struct delayed_work scan_work; |
639 | struct net_device *scan_dev; | 639 | struct ieee80211_sub_if_data *scan_sdata; |
640 | struct ieee80211_channel *oper_channel, *scan_channel; | 640 | struct ieee80211_channel *oper_channel, *scan_channel; |
641 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; | 641 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; |
642 | size_t scan_ssid_len; | 642 | size_t scan_ssid_len; |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 7dc063197259..6df4a2e15098 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -551,7 +551,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
551 | synchronize_rcu(); | 551 | synchronize_rcu(); |
552 | skb_queue_purge(&sdata->u.sta.skb_queue); | 552 | skb_queue_purge(&sdata->u.sta.skb_queue); |
553 | 553 | ||
554 | if (local->scan_dev == sdata->dev) { | 554 | if (local->scan_sdata == sdata) { |
555 | if (!local->ops->hw_scan) { | 555 | if (!local->ops->hw_scan) { |
556 | local->sta_sw_scanning = 0; | 556 | local->sta_sw_scanning = 0; |
557 | cancel_delayed_work(&local->scan_work); | 557 | cancel_delayed_work(&local->scan_work); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 67c38235a3c5..f60212b75005 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3507,19 +3507,18 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) | |||
3507 | void ieee80211_scan_completed(struct ieee80211_hw *hw) | 3507 | void ieee80211_scan_completed(struct ieee80211_hw *hw) |
3508 | { | 3508 | { |
3509 | struct ieee80211_local *local = hw_to_local(hw); | 3509 | struct ieee80211_local *local = hw_to_local(hw); |
3510 | struct net_device *dev = local->scan_dev; | ||
3511 | struct ieee80211_sub_if_data *sdata; | 3510 | struct ieee80211_sub_if_data *sdata; |
3512 | union iwreq_data wrqu; | 3511 | union iwreq_data wrqu; |
3513 | 3512 | ||
3514 | local->last_scan_completed = jiffies; | 3513 | local->last_scan_completed = jiffies; |
3515 | memset(&wrqu, 0, sizeof(wrqu)); | 3514 | memset(&wrqu, 0, sizeof(wrqu)); |
3516 | wireless_send_event(dev, SIOCGIWSCAN, &wrqu, NULL); | 3515 | wireless_send_event(local->scan_sdata->dev, SIOCGIWSCAN, &wrqu, NULL); |
3517 | 3516 | ||
3518 | if (local->sta_hw_scanning) { | 3517 | if (local->sta_hw_scanning) { |
3519 | local->sta_hw_scanning = 0; | 3518 | local->sta_hw_scanning = 0; |
3520 | if (ieee80211_hw_config(local)) | 3519 | if (ieee80211_hw_config(local)) |
3521 | printk(KERN_DEBUG "%s: failed to restore operational " | 3520 | printk(KERN_DEBUG "%s: failed to restore operational " |
3522 | "channel after scan\n", dev->name); | 3521 | "channel after scan\n", wiphy_name(local->hw.wiphy)); |
3523 | /* Restart STA timer for HW scan case */ | 3522 | /* Restart STA timer for HW scan case */ |
3524 | rcu_read_lock(); | 3523 | rcu_read_lock(); |
3525 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | 3524 | list_for_each_entry_rcu(sdata, &local->interfaces, list) |
@@ -3532,7 +3531,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
3532 | local->sta_sw_scanning = 0; | 3531 | local->sta_sw_scanning = 0; |
3533 | if (ieee80211_hw_config(local)) | 3532 | if (ieee80211_hw_config(local)) |
3534 | printk(KERN_DEBUG "%s: failed to restore operational " | 3533 | printk(KERN_DEBUG "%s: failed to restore operational " |
3535 | "channel after scan\n", dev->name); | 3534 | "channel after scan\n", wiphy_name(local->hw.wiphy)); |
3536 | 3535 | ||
3537 | 3536 | ||
3538 | netif_tx_lock_bh(local->mdev); | 3537 | netif_tx_lock_bh(local->mdev); |
@@ -3562,8 +3561,8 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
3562 | } | 3561 | } |
3563 | rcu_read_unlock(); | 3562 | rcu_read_unlock(); |
3564 | 3563 | ||
3565 | done: | 3564 | done: |
3566 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 3565 | sdata = local->scan_sdata; |
3567 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 3566 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
3568 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 3567 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
3569 | if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || | 3568 | if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || |
@@ -3578,8 +3577,7 @@ void ieee80211_sta_scan_work(struct work_struct *work) | |||
3578 | { | 3577 | { |
3579 | struct ieee80211_local *local = | 3578 | struct ieee80211_local *local = |
3580 | container_of(work, struct ieee80211_local, scan_work.work); | 3579 | container_of(work, struct ieee80211_local, scan_work.work); |
3581 | struct net_device *dev = local->scan_dev; | 3580 | struct ieee80211_sub_if_data *sdata = local->scan_sdata; |
3582 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
3583 | struct ieee80211_supported_band *sband; | 3581 | struct ieee80211_supported_band *sband; |
3584 | struct ieee80211_channel *chan; | 3582 | struct ieee80211_channel *chan; |
3585 | int skip; | 3583 | int skip; |
@@ -3627,7 +3625,7 @@ void ieee80211_sta_scan_work(struct work_struct *work) | |||
3627 | local->scan_channel = chan; | 3625 | local->scan_channel = chan; |
3628 | if (ieee80211_hw_config(local)) { | 3626 | if (ieee80211_hw_config(local)) { |
3629 | printk(KERN_DEBUG "%s: failed to set freq to " | 3627 | printk(KERN_DEBUG "%s: failed to set freq to " |
3630 | "%d MHz for scan\n", dev->name, | 3628 | "%d MHz for scan\n", wiphy_name(local->hw.wiphy), |
3631 | chan->center_freq); | 3629 | chan->center_freq); |
3632 | skip = 1; | 3630 | skip = 1; |
3633 | } | 3631 | } |
@@ -3697,7 +3695,7 @@ static int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
3697 | */ | 3695 | */ |
3698 | 3696 | ||
3699 | if (local->sta_sw_scanning || local->sta_hw_scanning) { | 3697 | if (local->sta_sw_scanning || local->sta_hw_scanning) { |
3700 | if (local->scan_dev == scan_sdata->dev) | 3698 | if (local->scan_sdata == scan_sdata) |
3701 | return 0; | 3699 | return 0; |
3702 | return -EBUSY; | 3700 | return -EBUSY; |
3703 | } | 3701 | } |
@@ -3707,7 +3705,7 @@ static int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
3707 | ssid, ssid_len); | 3705 | ssid, ssid_len); |
3708 | if (!rc) { | 3706 | if (!rc) { |
3709 | local->sta_hw_scanning = 1; | 3707 | local->sta_hw_scanning = 1; |
3710 | local->scan_dev = scan_sdata->dev; | 3708 | local->scan_sdata = scan_sdata; |
3711 | } | 3709 | } |
3712 | return rc; | 3710 | return rc; |
3713 | } | 3711 | } |
@@ -3734,7 +3732,7 @@ static int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
3734 | local->scan_state = SCAN_SET_CHANNEL; | 3732 | local->scan_state = SCAN_SET_CHANNEL; |
3735 | local->scan_channel_idx = 0; | 3733 | local->scan_channel_idx = 0; |
3736 | local->scan_band = IEEE80211_BAND_2GHZ; | 3734 | local->scan_band = IEEE80211_BAND_2GHZ; |
3737 | local->scan_dev = scan_sdata->dev; | 3735 | local->scan_sdata = scan_sdata; |
3738 | 3736 | ||
3739 | netif_addr_lock_bh(local->mdev); | 3737 | netif_addr_lock_bh(local->mdev); |
3740 | local->filter_flags |= FIF_BCN_PRBRESP_PROMISC; | 3738 | local->filter_flags |= FIF_BCN_PRBRESP_PROMISC; |
@@ -3762,7 +3760,7 @@ int ieee80211_sta_req_scan(struct ieee80211_sub_if_data *sdata, u8 *ssid, size_t | |||
3762 | return ieee80211_sta_start_scan(sdata, ssid, ssid_len); | 3760 | return ieee80211_sta_start_scan(sdata, ssid, ssid_len); |
3763 | 3761 | ||
3764 | if (local->sta_sw_scanning || local->sta_hw_scanning) { | 3762 | if (local->sta_sw_scanning || local->sta_hw_scanning) { |
3765 | if (local->scan_dev == sdata->dev) | 3763 | if (local->scan_sdata == sdata) |
3766 | return 0; | 3764 | return 0; |
3767 | return -EBUSY; | 3765 | return -EBUSY; |
3768 | } | 3766 | } |