aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-09-16 20:01:24 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-16 20:01:24 -0400
commitc127bdf9f6c8a8aaa531321721b29ab15f250a72 (patch)
tree1799546ce128e5425002ea9a0893cf86a2747490 /net
parent4e36a95e591e9c58dd10bb4103c00993917c27fd (diff)
parentbbac31f4c0339f6c51afbd0edfb4959df9b53fa9 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/rc80211_minstrel.c2
-rw-r--r--net/wireless/scan.c7
-rw-r--r--net/wireless/sme.c21
3 files changed, 20 insertions, 10 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 7c5142988bbb..6e5d68b4e427 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -418,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
418 418
419 /* contention window */ 419 /* contention window */
420 tx_time_single += t_slot + min(cw, mp->cw_max); 420 tx_time_single += t_slot + min(cw, mp->cw_max);
421 cw = (cw + 1) << 1; 421 cw = (cw << 1) | 1;
422 422
423 tx_time += tx_time_single; 423 tx_time += tx_time_single;
424 tx_time_cts += tx_time_single + mi->sp_ack_dur; 424 tx_time_cts += tx_time_single + mi->sp_ack_dur;
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 4c210c2debc6..e5f92ee758f4 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -662,7 +662,7 @@ int cfg80211_wext_siwscan(struct net_device *dev,
662 int k; 662 int k;
663 int wiphy_freq = wiphy->bands[band]->channels[j].center_freq; 663 int wiphy_freq = wiphy->bands[band]->channels[j].center_freq;
664 for (k = 0; k < wreq->num_channels; k++) { 664 for (k = 0; k < wreq->num_channels; k++) {
665 int wext_freq = wreq->channel_list[k].m / 100000; 665 int wext_freq = cfg80211_wext_freq(wiphy, &wreq->channel_list[k]);
666 if (wext_freq == wiphy_freq) 666 if (wext_freq == wiphy_freq)
667 goto wext_freq_found; 667 goto wext_freq_found;
668 } 668 }
@@ -675,6 +675,11 @@ int cfg80211_wext_siwscan(struct net_device *dev,
675 wext_freq_not_found: ; 675 wext_freq_not_found: ;
676 } 676 }
677 } 677 }
678 /* No channels found? */
679 if (!i) {
680 err = -EINVAL;
681 goto out;
682 }
678 683
679 /* Set real number of channels specified in creq->channels[] */ 684 /* Set real number of channels specified in creq->channels[] */
680 creq->n_channels = i; 685 creq->n_channels = i;
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 68307883ec87..7fae7eee65de 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -188,7 +188,7 @@ void cfg80211_conn_work(struct work_struct *work)
188 rtnl_unlock(); 188 rtnl_unlock();
189} 189}
190 190
191static bool cfg80211_get_conn_bss(struct wireless_dev *wdev) 191static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
192{ 192{
193 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); 193 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
194 struct cfg80211_bss *bss; 194 struct cfg80211_bss *bss;
@@ -205,7 +205,7 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
205 WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY, 205 WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY,
206 capa); 206 capa);
207 if (!bss) 207 if (!bss)
208 return false; 208 return NULL;
209 209
210 memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN); 210 memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN);
211 wdev->conn->params.bssid = wdev->conn->bssid; 211 wdev->conn->params.bssid = wdev->conn->bssid;
@@ -213,14 +213,14 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
213 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; 213 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
214 schedule_work(&rdev->conn_work); 214 schedule_work(&rdev->conn_work);
215 215
216 cfg80211_put_bss(bss); 216 return bss;
217 return true;
218} 217}
219 218
220static void __cfg80211_sme_scan_done(struct net_device *dev) 219static void __cfg80211_sme_scan_done(struct net_device *dev)
221{ 220{
222 struct wireless_dev *wdev = dev->ieee80211_ptr; 221 struct wireless_dev *wdev = dev->ieee80211_ptr;
223 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); 222 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
223 struct cfg80211_bss *bss;
224 224
225 ASSERT_WDEV_LOCK(wdev); 225 ASSERT_WDEV_LOCK(wdev);
226 226
@@ -234,7 +234,10 @@ static void __cfg80211_sme_scan_done(struct net_device *dev)
234 wdev->conn->state != CFG80211_CONN_SCAN_AGAIN) 234 wdev->conn->state != CFG80211_CONN_SCAN_AGAIN)
235 return; 235 return;
236 236
237 if (!cfg80211_get_conn_bss(wdev)) { 237 bss = cfg80211_get_conn_bss(wdev);
238 if (bss) {
239 cfg80211_put_bss(bss);
240 } else {
238 /* not found */ 241 /* not found */
239 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN) 242 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN)
240 schedule_work(&rdev->conn_work); 243 schedule_work(&rdev->conn_work);
@@ -670,6 +673,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
670{ 673{
671 struct wireless_dev *wdev = dev->ieee80211_ptr; 674 struct wireless_dev *wdev = dev->ieee80211_ptr;
672 struct ieee80211_channel *chan; 675 struct ieee80211_channel *chan;
676 struct cfg80211_bss *bss = NULL;
673 int err; 677 int err;
674 678
675 ASSERT_WDEV_LOCK(wdev); 679 ASSERT_WDEV_LOCK(wdev);
@@ -760,7 +764,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
760 764
761 /* don't care about result -- but fill bssid & channel */ 765 /* don't care about result -- but fill bssid & channel */
762 if (!wdev->conn->params.bssid || !wdev->conn->params.channel) 766 if (!wdev->conn->params.bssid || !wdev->conn->params.channel)
763 cfg80211_get_conn_bss(wdev); 767 bss = cfg80211_get_conn_bss(wdev);
764 768
765 wdev->sme_state = CFG80211_SME_CONNECTING; 769 wdev->sme_state = CFG80211_SME_CONNECTING;
766 wdev->connect_keys = connkeys; 770 wdev->connect_keys = connkeys;
@@ -770,10 +774,11 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
770 wdev->conn->prev_bssid_valid = true; 774 wdev->conn->prev_bssid_valid = true;
771 } 775 }
772 776
773 /* we're good if we have both BSSID and channel */ 777 /* we're good if we have a matching bss struct */
774 if (wdev->conn->params.bssid && wdev->conn->params.channel) { 778 if (bss) {
775 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; 779 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
776 err = cfg80211_conn_do_work(wdev); 780 err = cfg80211_conn_do_work(wdev);
781 cfg80211_put_bss(bss);
777 } else { 782 } else {
778 /* otherwise we'll need to scan for the AP first */ 783 /* otherwise we'll need to scan for the AP first */
779 err = cfg80211_conn_scan(wdev); 784 err = cfg80211_conn_scan(wdev);