Skip to content

Commit 1beee8d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits) llc: Fix double accounting of received packets netfilter: nf_conntrack_expect: fix error path unwind in nf_conntrack_expect_init() bluetooth: fix locking bug in the rfcomm socket cleanup handling mac80211: fix alignment issue with compare_ether_addr() mac80211: Fix for NULL pointer dereference in sta_info_get() mac80211: fix a typo in ieee80211_handle_filtered_frame comment rndis_wlan: add missing range check for power_output modparam iwlwifi: fix rate scale TLC column selection bug iwlwifi: fix exit from stay_in_table state rndis_wlan: Make connections to TKIP PSK networks work mac80211 : Fixes the status message for iwconfig rt2x00: Use atomic interface iteration in irq context rt2x00: Reset antenna RSSI after switch rt2x00: Don't count retries as failure rt2x00: Fix memleak in tx() path mac80211: reorder channel and freq reporting in wext scan report b43: Fix controller restart crash mac80211: fix ieee80211_rx_bss_put/get imbalance net/mac80211: always true conditionals b43: Upload both beacon templates on initial load ...
2 parents 9db8ee3 + 3446b9d commit 1beee8d

22 files changed

Lines changed: 180 additions & 70 deletions

File tree

‎drivers/net/wireless/b43/b43.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ struct b43_wl {
737737
struct ieee80211_tx_control beacon_txctl;
738738
bool beacon0_uploaded;
739739
bool beacon1_uploaded;
740+
bool beacon_templates_virgin; /* Never wrote the templates? */
740741
struct work_struct beacon_update_trigger;
741742

742743
/* The current QOS parameters for the 4 queues.

‎drivers/net/wireless/b43/main.c‎

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,30 @@ static void b43_write_probe_resp_template(struct b43_wldev *dev,
15441544
kfree(probe_resp_data);
15451545
}
15461546

1547+
static void b43_upload_beacon0(struct b43_wldev *dev)
1548+
{
1549+
struct b43_wl *wl = dev->wl;
1550+
1551+
if (wl->beacon0_uploaded)
1552+
return;
1553+
b43_write_beacon_template(dev, 0x68, 0x18);
1554+
/* FIXME: Probe resp upload doesn't really belong here,
1555+
* but we don't use that feature anyway. */
1556+
b43_write_probe_resp_template(dev, 0x268, 0x4A,
1557+
&__b43_ratetable[3]);
1558+
wl->beacon0_uploaded = 1;
1559+
}
1560+
1561+
static void b43_upload_beacon1(struct b43_wldev *dev)
1562+
{
1563+
struct b43_wl *wl = dev->wl;
1564+
1565+
if (wl->beacon1_uploaded)
1566+
return;
1567+
b43_write_beacon_template(dev, 0x468, 0x1A);
1568+
wl->beacon1_uploaded = 1;
1569+
}
1570+
15471571
static void handle_irq_beacon(struct b43_wldev *dev)
15481572
{
15491573
struct b43_wl *wl = dev->wl;
@@ -1568,24 +1592,27 @@ static void handle_irq_beacon(struct b43_wldev *dev)
15681592
return;
15691593
}
15701594

1571-
if (!beacon0_valid) {
1572-
if (!wl->beacon0_uploaded) {
1573-
b43_write_beacon_template(dev, 0x68, 0x18);
1574-
b43_write_probe_resp_template(dev, 0x268, 0x4A,
1575-
&__b43_ratetable[3]);
1576-
wl->beacon0_uploaded = 1;
1577-
}
1595+
if (unlikely(wl->beacon_templates_virgin)) {
1596+
/* We never uploaded a beacon before.
1597+
* Upload both templates now, but only mark one valid. */
1598+
wl->beacon_templates_virgin = 0;
1599+
b43_upload_beacon0(dev);
1600+
b43_upload_beacon1(dev);
15781601
cmd = b43_read32(dev, B43_MMIO_MACCMD);
15791602
cmd |= B43_MACCMD_BEACON0_VALID;
15801603
b43_write32(dev, B43_MMIO_MACCMD, cmd);
1581-
} else if (!beacon1_valid) {
1582-
if (!wl->beacon1_uploaded) {
1583-
b43_write_beacon_template(dev, 0x468, 0x1A);
1584-
wl->beacon1_uploaded = 1;
1604+
} else {
1605+
if (!beacon0_valid) {
1606+
b43_upload_beacon0(dev);
1607+
cmd = b43_read32(dev, B43_MMIO_MACCMD);
1608+
cmd |= B43_MACCMD_BEACON0_VALID;
1609+
b43_write32(dev, B43_MMIO_MACCMD, cmd);
1610+
} else if (!beacon1_valid) {
1611+
b43_upload_beacon1(dev);
1612+
cmd = b43_read32(dev, B43_MMIO_MACCMD);
1613+
cmd |= B43_MACCMD_BEACON1_VALID;
1614+
b43_write32(dev, B43_MMIO_MACCMD, cmd);
15851615
}
1586-
cmd = b43_read32(dev, B43_MMIO_MACCMD);
1587-
cmd |= B43_MACCMD_BEACON1_VALID;
1588-
b43_write32(dev, B43_MMIO_MACCMD, cmd);
15891616
}
15901617
}
15911618

@@ -4073,6 +4100,9 @@ static int b43_op_start(struct ieee80211_hw *hw)
40734100
wl->filter_flags = 0;
40744101
wl->radiotap_enabled = 0;
40754102
b43_qos_clear(wl);
4103+
wl->beacon0_uploaded = 0;
4104+
wl->beacon1_uploaded = 0;
4105+
wl->beacon_templates_virgin = 1;
40764106

40774107
/* First register RFkill.
40784108
* LEDs that are registered later depend on it. */
@@ -4241,7 +4271,9 @@ static void b43_chip_reset(struct work_struct *work)
42414271
goto out;
42424272
}
42434273
}
4244-
out:
4274+
out:
4275+
if (err)
4276+
wl->current_dev = NULL; /* Failed to init the dev. */
42454277
mutex_unlock(&wl->mutex);
42464278
if (err)
42474279
b43err(wl, "Controller restart FAILED\n");
@@ -4382,9 +4414,11 @@ static void b43_one_core_detach(struct ssb_device *dev)
43824414
struct b43_wldev *wldev;
43834415
struct b43_wl *wl;
43844416

4417+
/* Do not cancel ieee80211-workqueue based work here.
4418+
* See comment in b43_remove(). */
4419+
43854420
wldev = ssb_get_drvdata(dev);
43864421
wl = wldev->wl;
4387-
cancel_work_sync(&wldev->restart_work);
43884422
b43_debugfs_remove_device(wldev);
43894423
b43_wireless_core_detach(wldev);
43904424
list_del(&wldev->list);
@@ -4569,6 +4603,10 @@ static void b43_remove(struct ssb_device *dev)
45694603
struct b43_wl *wl = ssb_get_devtypedata(dev);
45704604
struct b43_wldev *wldev = ssb_get_drvdata(dev);
45714605

4606+
/* We must cancel any work here before unregistering from ieee80211,
4607+
* as the ieee80211 unreg will destroy the workqueue. */
4608+
cancel_work_sync(&wldev->restart_work);
4609+
45724610
B43_WARN_ON(!wl);
45734611
if (wl->current_dev == wldev)
45744612
ieee80211_unregister_hw(wl->hw);

‎drivers/net/wireless/iwlwifi/iwl-4965-rs.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,6 @@ static s32 rs_get_best_rate(struct iwl_priv *priv,
11621162

11631163
/* Higher rate not available, use the original */
11641164
} else {
1165-
new_rate = rate;
11661165
break;
11671166
}
11681167
}
@@ -2009,7 +2008,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
20092008
* 2) Not just finishing up a search
20102009
* 3) Allowing a new search
20112010
*/
2012-
if (!update_lq && !done_search && !lq_sta->stay_in_tbl) {
2011+
if (!update_lq && !done_search && !lq_sta->stay_in_tbl && window->counter) {
20132012
/* Save current throughput to compare with "search" throughput*/
20142013
lq_sta->last_tpt = current_tpt;
20152014

‎drivers/net/wireless/rndis_wlan.c‎

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ MODULE_PARM_DESC(workaround_interval,
116116
#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b)
117117
#define OID_802_11_ADD_KEY ccpu2(0x0d01011d)
118118
#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e)
119+
#define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f)
119120
#define OID_802_11_PMKID ccpu2(0x0d010123)
120121
#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203)
121122
#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204)
@@ -271,6 +272,26 @@ struct ndis_config_param {
271272
__le32 value_length;
272273
} __attribute__((packed));
273274

275+
struct ndis_80211_assoc_info {
276+
__le32 length;
277+
__le16 req_ies;
278+
struct req_ie {
279+
__le16 capa;
280+
__le16 listen_interval;
281+
u8 cur_ap_address[6];
282+
} req_ie;
283+
__le32 req_ie_length;
284+
__le32 offset_req_ies;
285+
__le16 resp_ies;
286+
struct resp_ie {
287+
__le16 capa;
288+
__le16 status_code;
289+
__le16 assoc_id;
290+
} resp_ie;
291+
__le32 resp_ie_length;
292+
__le32 offset_resp_ies;
293+
} __attribute__((packed));
294+
274295
/* these have to match what is in wpa_supplicant */
275296
enum wpa_alg { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP };
276297
enum wpa_cipher { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
@@ -674,6 +695,12 @@ static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
674695
return ret;
675696
}
676697

698+
static int get_association_info(struct usbnet *usbdev,
699+
struct ndis_80211_assoc_info *info, int len)
700+
{
701+
return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION,
702+
info, &len);
703+
}
677704

678705
static int is_associated(struct usbnet *usbdev)
679706
{
@@ -2182,11 +2209,40 @@ static void rndis_wext_worker(struct work_struct *work)
21822209
struct usbnet *usbdev = priv->usbdev;
21832210
union iwreq_data evt;
21842211
unsigned char bssid[ETH_ALEN];
2185-
int ret;
2212+
struct ndis_80211_assoc_info *info;
2213+
int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32;
2214+
int ret, offset;
21862215

21872216
if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) {
2188-
ret = get_bssid(usbdev, bssid);
2217+
info = kzalloc(assoc_size, GFP_KERNEL);
2218+
if (!info)
2219+
goto get_bssid;
2220+
2221+
/* Get association info IEs from device and send them back to
2222+
* userspace. */
2223+
ret = get_association_info(usbdev, info, assoc_size);
2224+
if (!ret) {
2225+
evt.data.length = le32_to_cpu(info->req_ie_length);
2226+
if (evt.data.length > 0) {
2227+
offset = le32_to_cpu(info->offset_req_ies);
2228+
wireless_send_event(usbdev->net,
2229+
IWEVASSOCREQIE, &evt,
2230+
(char *)info + offset);
2231+
}
2232+
2233+
evt.data.length = le32_to_cpu(info->resp_ie_length);
2234+
if (evt.data.length > 0) {
2235+
offset = le32_to_cpu(info->offset_resp_ies);
2236+
wireless_send_event(usbdev->net,
2237+
IWEVASSOCRESPIE, &evt,
2238+
(char *)info + offset);
2239+
}
2240+
}
2241+
2242+
kfree(info);
21892243

2244+
get_bssid:
2245+
ret = get_bssid(usbdev, bssid);
21902246
if (!ret) {
21912247
evt.data.flags = 0;
21922248
evt.data.length = 0;
@@ -2414,6 +2470,11 @@ static int bcm4320_early_init(struct usbnet *dev)
24142470
else if (priv->param_power_save > 2)
24152471
priv->param_power_save = 2;
24162472

2473+
if (priv->param_power_output < 0)
2474+
priv->param_power_output = 0;
2475+
else if (priv->param_power_output > 3)
2476+
priv->param_power_output = 3;
2477+
24172478
if (priv->param_roamtrigger < -80)
24182479
priv->param_roamtrigger = -80;
24192480
else if (priv->param_roamtrigger > -60)

‎drivers/net/wireless/rt2x00/rt2x00.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ static inline int rt2x00_get_link_ant_rssi(struct link *link)
328328
return DEFAULT_RSSI;
329329
}
330330

331+
static inline void rt2x00_reset_link_ant_rssi(struct link *link)
332+
{
333+
link->ant.rssi_ant = 0;
334+
}
335+
331336
static inline int rt2x00_get_link_ant_rssi_history(struct link *link,
332337
enum antenna ant)
333338
{

‎drivers/net/wireless/rt2x00/rt2x00config.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
129129
*/
130130
rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA);
131131
rt2x00lib_reset_link_tuner(rt2x00dev);
132+
rt2x00_reset_link_ant_rssi(&rt2x00dev->link);
132133

133134
rt2x00dev->link.ant.active.rx = libconf.ant.rx;
134135
rt2x00dev->link.ant.active.tx = libconf.ant.tx;

‎drivers/net/wireless/rt2x00/rt2x00dev.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
483483
if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
484484
return;
485485

486-
ieee80211_iterate_active_interfaces(rt2x00dev->hw,
487-
rt2x00lib_beacondone_iter,
488-
rt2x00dev);
486+
ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
487+
rt2x00lib_beacondone_iter,
488+
rt2x00dev);
489489

490490
queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work);
491491
}
@@ -507,7 +507,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
507507
* Update TX statistics.
508508
*/
509509
rt2x00dev->link.qual.tx_success += success;
510-
rt2x00dev->link.qual.tx_failed += txdesc->retry + fail;
510+
rt2x00dev->link.qual.tx_failed += fail;
511511

512512
/*
513513
* Initialize TX status

‎drivers/net/wireless/rt2x00/rt2x00mac.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
9393
*/
9494
if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) {
9595
ieee80211_stop_queues(hw);
96+
dev_kfree_skb_any(skb);
9697
return NETDEV_TX_OK;
9798
}
9899

‎drivers/net/wireless/rtl8180_grf5101.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static void grf5101_rf_set_channel(struct ieee80211_hw *dev,
8888
write_grf5101(dev, 0x0B, chan);
8989
write_grf5101(dev, 0x07, 0x1000);
9090

91-
grf5101_write_phy_antenna(dev, chan);
91+
grf5101_write_phy_antenna(dev, channel);
9292
}
9393

9494
static void grf5101_rf_stop(struct ieee80211_hw *dev)

‎drivers/net/wireless/rtl8180_max2820.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ static void max2820_rf_set_channel(struct ieee80211_hw *dev,
7878
struct ieee80211_conf *conf)
7979
{
8080
struct rtl8180_priv *priv = dev->priv;
81-
int channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
81+
int channel = conf ?
82+
ieee80211_frequency_to_channel(conf->channel->center_freq) : 1;
8283
unsigned int chan_idx = channel - 1;
8384
u32 txpw = priv->channels[chan_idx].hw_value & 0xFF;
8485
u32 chan = max2820_chan[chan_idx];
@@ -87,7 +88,7 @@ static void max2820_rf_set_channel(struct ieee80211_hw *dev,
8788
* sa2400, for MAXIM we do this directly from BB */
8889
rtl8180_write_phy(dev, 3, txpw);
8990

90-
max2820_write_phy_antenna(dev, chan);
91+
max2820_write_phy_antenna(dev, channel);
9192
write_max2820(dev, 3, chan);
9293
}
9394

0 commit comments

Comments
 (0)