Skip to content

Commit f403ede

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
2 parents 5dc474d + a4278e1 commit f403ede

File tree

21 files changed

+133
-79
lines changed

21 files changed

+133
-79
lines changed

drivers/net/ps3_gelic_wireless.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,6 +2474,8 @@ static void gelic_wl_free(struct gelic_wl_info *wl)
24742474

24752475
pr_debug("%s: <-\n", __func__);
24762476

2477+
free_page((unsigned long)wl->buf);
2478+
24772479
pr_debug("%s: destroy queues\n", __func__);
24782480
destroy_workqueue(wl->eurus_cmd_queue);
24792481
destroy_workqueue(wl->event_queue);

drivers/net/wireless/iwlwifi/iwl-3945.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
666666
rx_status.flag = 0;
667667
rx_status.mactime = le64_to_cpu(rx_end->timestamp);
668668
rx_status.freq =
669-
ieee80211_frequency_to_channel(le16_to_cpu(rx_hdr->channel));
669+
ieee80211_channel_to_frequency(le16_to_cpu(rx_hdr->channel));
670670
rx_status.band = (rx_hdr->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
671671
IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
672672

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ struct iwl4965_lq_sta {
163163
struct dentry *rs_sta_dbgfs_tx_agg_tid_en_file;
164164
#endif
165165
struct iwl4965_rate dbg_fixed;
166-
struct iwl_priv *drv;
167166
#endif
167+
struct iwl_priv *drv;
168168
};
169169

170170
static void rs_rate_scale_perform(struct iwl_priv *priv,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3978,7 +3978,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
39783978

39793979
rx_status.mactime = le64_to_cpu(rx_start->timestamp);
39803980
rx_status.freq =
3981-
ieee80211_frequency_to_channel(le16_to_cpu(rx_start->channel));
3981+
ieee80211_channel_to_frequency(le16_to_cpu(rx_start->channel));
39823982
rx_status.band = (rx_start->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
39833983
IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
39843984
rx_status.rate_idx =

drivers/net/wireless/prism54/islpci_dev.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,15 @@ islpci_open(struct net_device *ndev)
388388

389389
netif_start_queue(ndev);
390390

391-
/* Turn off carrier unless we know we have associated */
392-
netif_carrier_off(ndev);
391+
/* Turn off carrier if in STA or Ad-hoc mode. It will be turned on
392+
* once the firmware receives a trap of being associated
393+
* (GEN_OID_LINKSTATE). In other modes (AP or WDS or monitor) we
394+
* should just leave the carrier on as its expected the firmware
395+
* won't send us a trigger. */
396+
if (priv->iw_mode == IW_MODE_INFRA || priv->iw_mode == IW_MODE_ADHOC)
397+
netif_carrier_off(ndev);
398+
else
399+
netif_carrier_on(ndev);
393400

394401
return 0;
395402
}

drivers/net/wireless/rt2x00/rt2x00dev.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,10 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
10321032
* Initialize the device.
10331033
*/
10341034
status = rt2x00dev->ops->lib->initialize(rt2x00dev);
1035-
if (status)
1036-
goto exit;
1035+
if (status) {
1036+
rt2x00queue_uninitialize(rt2x00dev);
1037+
return status;
1038+
}
10371039

10381040
__set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags);
10391041

@@ -1043,11 +1045,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
10431045
rt2x00rfkill_register(rt2x00dev);
10441046

10451047
return 0;
1046-
1047-
exit:
1048-
rt2x00lib_uninitialize(rt2x00dev);
1049-
1050-
return status;
10511048
}
10521049

10531050
int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)

drivers/net/wireless/rt2x00/rt2x00pci.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,14 @@ int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev)
314314
if (status) {
315315
ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n",
316316
pci_dev->irq, status);
317-
return status;
317+
goto exit;
318318
}
319319

320320
return 0;
321321

322322
exit:
323-
rt2x00pci_uninitialize(rt2x00dev);
323+
queue_for_each(rt2x00dev, queue)
324+
rt2x00pci_free_queue_dma(rt2x00dev, queue);
324325

325326
return status;
326327
}

drivers/net/wireless/rt2x00/rt61pci.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,38 +2366,26 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
23662366
{
23672367
struct rt2x00_dev *rt2x00dev = hw->priv;
23682368
struct rt2x00_intf *intf = vif_to_intf(control->vif);
2369+
struct queue_entry_priv_pci_tx *priv_tx;
23692370
struct skb_frame_desc *skbdesc;
23702371
unsigned int beacon_base;
23712372
u32 reg;
23722373

23732374
if (unlikely(!intf->beacon))
23742375
return -ENOBUFS;
23752376

2376-
/*
2377-
* We need to append the descriptor in front of the
2378-
* beacon frame.
2379-
*/
2380-
if (skb_headroom(skb) < intf->beacon->queue->desc_size) {
2381-
if (pskb_expand_head(skb, intf->beacon->queue->desc_size,
2382-
0, GFP_ATOMIC))
2383-
return -ENOMEM;
2384-
}
2385-
2386-
/*
2387-
* Add the descriptor in front of the skb.
2388-
*/
2389-
skb_push(skb, intf->beacon->queue->desc_size);
2390-
memset(skb->data, 0, intf->beacon->queue->desc_size);
2377+
priv_tx = intf->beacon->priv_data;
2378+
memset(priv_tx->desc, 0, intf->beacon->queue->desc_size);
23912379

23922380
/*
23932381
* Fill in skb descriptor
23942382
*/
23952383
skbdesc = get_skb_frame_desc(skb);
23962384
memset(skbdesc, 0, sizeof(*skbdesc));
23972385
skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED;
2398-
skbdesc->data = skb->data + intf->beacon->queue->desc_size;
2399-
skbdesc->data_len = skb->len - intf->beacon->queue->desc_size;
2400-
skbdesc->desc = skb->data;
2386+
skbdesc->data = skb->data;
2387+
skbdesc->data_len = skb->len;
2388+
skbdesc->desc = priv_tx->desc;
24012389
skbdesc->desc_len = intf->beacon->queue->desc_size;
24022390
skbdesc->entry = intf->beacon;
24032391

@@ -2425,7 +2413,10 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
24252413
*/
24262414
beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx);
24272415
rt2x00pci_register_multiwrite(rt2x00dev, beacon_base,
2428-
skb->data, skb->len);
2416+
skbdesc->desc, skbdesc->desc_len);
2417+
rt2x00pci_register_multiwrite(rt2x00dev,
2418+
beacon_base + skbdesc->desc_len,
2419+
skbdesc->data, skbdesc->data_len);
24292420
rt61pci_kick_tx_queue(rt2x00dev, control->queue);
24302421

24312422
return 0;
@@ -2490,7 +2481,7 @@ static const struct data_queue_desc rt61pci_queue_tx = {
24902481

24912482
static const struct data_queue_desc rt61pci_queue_bcn = {
24922483
.entry_num = 4 * BEACON_ENTRIES,
2493-
.data_size = MGMT_FRAME_SIZE,
2484+
.data_size = 0, /* No DMA required for beacons */
24942485
.desc_size = TXINFO_SIZE,
24952486
.priv_size = sizeof(struct queue_entry_priv_pci_tx),
24962487
};

drivers/net/wireless/wavelan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,9 @@ static void wv_psa_show(psa_t * p)
908908
p->psa_call_code[3], p->psa_call_code[4], p->psa_call_code[5],
909909
p->psa_call_code[6], p->psa_call_code[7]);
910910
#ifdef DEBUG_SHOW_UNUSED
911-
printk(KERN_DEBUG "psa_reserved[]: %02X:%02X:%02X:%02X\n",
911+
printk(KERN_DEBUG "psa_reserved[]: %02X:%02X\n",
912912
p->psa_reserved[0],
913-
p->psa_reserved[1], p->psa_reserved[2], p->psa_reserved[3]);
913+
p->psa_reserved[1]);
914914
#endif /* DEBUG_SHOW_UNUSED */
915915
printk(KERN_DEBUG "psa_conf_status: %d, ", p->psa_conf_status);
916916
printk("psa_crc: 0x%02x%02x, ", p->psa_crc[0], p->psa_crc[1]);

drivers/net/wireless/wavelan_cs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,11 +1074,9 @@ wv_psa_show(psa_t * p)
10741074
p->psa_call_code[6],
10751075
p->psa_call_code[7]);
10761076
#ifdef DEBUG_SHOW_UNUSED
1077-
printk(KERN_DEBUG "psa_reserved[]: %02X:%02X:%02X:%02X\n",
1077+
printk(KERN_DEBUG "psa_reserved[]: %02X:%02X\n",
10781078
p->psa_reserved[0],
1079-
p->psa_reserved[1],
1080-
p->psa_reserved[2],
1081-
p->psa_reserved[3]);
1079+
p->psa_reserved[1]);
10821080
#endif /* DEBUG_SHOW_UNUSED */
10831081
printk(KERN_DEBUG "psa_conf_status: %d, ", p->psa_conf_status);
10841082
printk("psa_crc: 0x%02x%02x, ", p->psa_crc[0], p->psa_crc[1]);

drivers/net/wireless/zd1211rw/zd_usb.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,13 @@ static void tx_urb_complete(struct urb *urb)
889889
}
890890
free_urb:
891891
skb = (struct sk_buff *)urb->context;
892-
zd_mac_tx_to_dev(skb, urb->status);
892+
/*
893+
* grab 'usb' pointer before handing off the skb (since
894+
* it might be freed by zd_mac_tx_to_dev or mac80211)
895+
*/
893896
cb = (struct zd_tx_skb_control_block *)skb->cb;
894897
usb = &zd_hw_mac(cb->hw)->chip.usb;
898+
zd_mac_tx_to_dev(skb, urb->status);
895899
free_tx_urb(usb, urb);
896900
tx_dec_submitted_urbs(usb);
897901
return;

net/mac80211/debugfs_key.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,23 @@ void ieee80211_debugfs_key_remove(struct ieee80211_key *key)
255255
void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
256256
{
257257
char buf[50];
258+
struct ieee80211_key *key;
258259

259260
if (!sdata->debugfsdir)
260261
return;
261262

262-
sprintf(buf, "../keys/%d", sdata->default_key->debugfs.cnt);
263-
sdata->debugfs.default_key =
264-
debugfs_create_symlink("default_key", sdata->debugfsdir, buf);
263+
/* this is running under the key lock */
264+
265+
key = sdata->default_key;
266+
if (key) {
267+
sprintf(buf, "../keys/%d", key->debugfs.cnt);
268+
sdata->debugfs.default_key =
269+
debugfs_create_symlink("default_key",
270+
sdata->debugfsdir, buf);
271+
} else
272+
ieee80211_debugfs_key_remove_default(sdata);
265273
}
274+
266275
void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata)
267276
{
268277
if (!sdata)

net/mac80211/mesh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr,
397397
put_unaligned(cpu_to_le32(sdata->u.sta.mesh_seqnum), &meshhdr->seqnum);
398398
sdata->u.sta.mesh_seqnum++;
399399

400-
return 5;
400+
return 6;
401401
}
402402

403403
void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)

net/mac80211/mesh_hwmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
120120
*pos++ = WLAN_EID_PREP;
121121
break;
122122
default:
123-
kfree(skb);
123+
kfree_skb(skb);
124124
return -ENOTSUPP;
125125
break;
126126
}

net/mac80211/mesh_pathtbl.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,25 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
158158
if (atomic_add_unless(&sdata->u.sta.mpaths, 1, MESH_MAX_MPATHS) == 0)
159159
return -ENOSPC;
160160

161-
read_lock(&pathtbl_resize_lock);
162-
163161
new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL);
164162
if (!new_mpath) {
165163
atomic_dec(&sdata->u.sta.mpaths);
166164
err = -ENOMEM;
167165
goto endadd2;
168166
}
167+
new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL);
168+
if (!new_node) {
169+
kfree(new_mpath);
170+
atomic_dec(&sdata->u.sta.mpaths);
171+
err = -ENOMEM;
172+
goto endadd2;
173+
}
174+
175+
read_lock(&pathtbl_resize_lock);
169176
memcpy(new_mpath->dst, dst, ETH_ALEN);
170177
new_mpath->dev = dev;
171178
new_mpath->flags = 0;
172179
skb_queue_head_init(&new_mpath->frame_queue);
173-
new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL);
174180
new_node->mpath = new_mpath;
175181
new_mpath->timer.data = (unsigned long) new_mpath;
176182
new_mpath->timer.function = mesh_path_timer;
@@ -202,7 +208,6 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
202208

203209
endadd:
204210
spin_unlock(&mesh_paths->hashwlock[hash_idx]);
205-
endadd2:
206211
read_unlock(&pathtbl_resize_lock);
207212
if (!err && grow) {
208213
struct mesh_table *oldtbl, *newtbl;
@@ -215,10 +220,12 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
215220
return -ENOMEM;
216221
}
217222
rcu_assign_pointer(mesh_paths, newtbl);
223+
write_unlock(&pathtbl_resize_lock);
224+
218225
synchronize_rcu();
219226
mesh_table_free(oldtbl, false);
220-
write_unlock(&pathtbl_resize_lock);
221227
}
228+
endadd2:
222229
return err;
223230
}
224231

net/mac80211/mlme.c

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,26 @@ static void ieee80211_authenticate(struct net_device *dev,
665665
mod_timer(&ifsta->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
666666
}
667667

668+
static int ieee80211_compatible_rates(struct ieee80211_sta_bss *bss,
669+
struct ieee80211_supported_band *sband,
670+
u64 *rates)
671+
{
672+
int i, j, count;
673+
*rates = 0;
674+
count = 0;
675+
for (i = 0; i < bss->supp_rates_len; i++) {
676+
int rate = (bss->supp_rates[i] & 0x7F) * 5;
677+
678+
for (j = 0; j < sband->n_bitrates; j++)
679+
if (sband->bitrates[j].bitrate == rate) {
680+
*rates |= BIT(j);
681+
count++;
682+
break;
683+
}
684+
}
685+
686+
return count;
687+
}
668688

669689
static void ieee80211_send_assoc(struct net_device *dev,
670690
struct ieee80211_if_sta *ifsta)
@@ -673,11 +693,12 @@ static void ieee80211_send_assoc(struct net_device *dev,
673693
struct sk_buff *skb;
674694
struct ieee80211_mgmt *mgmt;
675695
u8 *pos, *ies;
676-
int i, len;
696+
int i, len, count, rates_len, supp_rates_len;
677697
u16 capab;
678698
struct ieee80211_sta_bss *bss;
679699
int wmm = 0;
680700
struct ieee80211_supported_band *sband;
701+
u64 rates = 0;
681702

682703
skb = dev_alloc_skb(local->hw.extra_tx_headroom +
683704
sizeof(*mgmt) + 200 + ifsta->extra_ie_len +
@@ -740,24 +761,39 @@ static void ieee80211_send_assoc(struct net_device *dev,
740761
*pos++ = ifsta->ssid_len;
741762
memcpy(pos, ifsta->ssid, ifsta->ssid_len);
742763

764+
/* all supported rates should be added here but some APs
765+
* (e.g. D-Link DAP 1353 in b-only mode) don't like that
766+
* Therefore only add rates the AP supports */
767+
rates_len = ieee80211_compatible_rates(bss, sband, &rates);
768+
supp_rates_len = rates_len;
769+
if (supp_rates_len > 8)
770+
supp_rates_len = 8;
771+
743772
len = sband->n_bitrates;
744-
if (len > 8)
745-
len = 8;
746-
pos = skb_put(skb, len + 2);
773+
pos = skb_put(skb, supp_rates_len + 2);
747774
*pos++ = WLAN_EID_SUPP_RATES;
748-
*pos++ = len;
749-
for (i = 0; i < len; i++) {
750-
int rate = sband->bitrates[i].bitrate;
751-
*pos++ = (u8) (rate / 5);
752-
}
775+
*pos++ = supp_rates_len;
753776

754-
if (sband->n_bitrates > len) {
755-
pos = skb_put(skb, sband->n_bitrates - len + 2);
756-
*pos++ = WLAN_EID_EXT_SUPP_RATES;
757-
*pos++ = sband->n_bitrates - len;
758-
for (i = len; i < sband->n_bitrates; i++) {
777+
count = 0;
778+
for (i = 0; i < sband->n_bitrates; i++) {
779+
if (BIT(i) & rates) {
759780
int rate = sband->bitrates[i].bitrate;
760781
*pos++ = (u8) (rate / 5);
782+
if (++count == 8)
783+
break;
784+
}
785+
}
786+
787+
if (count == 8) {
788+
pos = skb_put(skb, rates_len - count + 2);
789+
*pos++ = WLAN_EID_EXT_SUPP_RATES;
790+
*pos++ = rates_len - count;
791+
792+
for (i++; i < sband->n_bitrates; i++) {
793+
if (BIT(i) & rates) {
794+
int rate = sband->bitrates[i].bitrate;
795+
*pos++ = (u8) (rate / 5);
796+
}
761797
}
762798
}
763799

0 commit comments

Comments
 (0)