diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-18 14:15:05 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-18 14:15:05 -0500 |
commit | 4092762aebfe55c1f8e31440b80a053c2dbe519b (patch) | |
tree | 8fb9fd14131194174c12daf5d8195afd3b62bc3e /drivers/net/wireless/p54 | |
parent | 745b1626dd71ce9661a05ea4db57859ed5c773d2 (diff) | |
parent | 1de9e8e70f5acc441550ca75433563d91b269bbe (diff) |
Merge branch 'tracing/ftrace'; commit 'v2.6.29-rc2' into tracing/core
Diffstat (limited to 'drivers/net/wireless/p54')
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54usb.c | 2 |
2 files changed, 32 insertions, 4 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 82354b974a04..c6a370fa9bcb 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -138,6 +138,7 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
138 | u8 *fw_version = NULL; | 138 | u8 *fw_version = NULL; |
139 | size_t len; | 139 | size_t len; |
140 | int i; | 140 | int i; |
141 | int maxlen; | ||
141 | 142 | ||
142 | if (priv->rx_start) | 143 | if (priv->rx_start) |
143 | return 0; | 144 | return 0; |
@@ -195,6 +196,16 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
195 | else | 196 | else |
196 | priv->rx_mtu = (size_t) | 197 | priv->rx_mtu = (size_t) |
197 | 0x620 - priv->tx_hdr_len; | 198 | 0x620 - priv->tx_hdr_len; |
199 | maxlen = priv->tx_hdr_len + /* USB devices */ | ||
200 | sizeof(struct p54_rx_data) + | ||
201 | 4 + /* rx alignment */ | ||
202 | IEEE80211_MAX_FRAG_THRESHOLD; | ||
203 | if (priv->rx_mtu > maxlen && PAGE_SIZE == 4096) { | ||
204 | printk(KERN_INFO "p54: rx_mtu reduced from %d " | ||
205 | "to %d\n", priv->rx_mtu, | ||
206 | maxlen); | ||
207 | priv->rx_mtu = maxlen; | ||
208 | } | ||
198 | break; | 209 | break; |
199 | } | 210 | } |
200 | case BR_CODE_EXPOSED_IF: | 211 | case BR_CODE_EXPOSED_IF: |
@@ -575,6 +586,7 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
575 | u16 freq = le16_to_cpu(hdr->freq); | 586 | u16 freq = le16_to_cpu(hdr->freq); |
576 | size_t header_len = sizeof(*hdr); | 587 | size_t header_len = sizeof(*hdr); |
577 | u32 tsf32; | 588 | u32 tsf32; |
589 | u8 rate = hdr->rate & 0xf; | ||
578 | 590 | ||
579 | /* | 591 | /* |
580 | * If the device is in a unspecified state we have to | 592 | * If the device is in a unspecified state we have to |
@@ -603,8 +615,11 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
603 | rx_status.qual = (100 * hdr->rssi) / 127; | 615 | rx_status.qual = (100 * hdr->rssi) / 127; |
604 | if (hdr->rate & 0x10) | 616 | if (hdr->rate & 0x10) |
605 | rx_status.flag |= RX_FLAG_SHORTPRE; | 617 | rx_status.flag |= RX_FLAG_SHORTPRE; |
606 | rx_status.rate_idx = (dev->conf.channel->band == IEEE80211_BAND_2GHZ ? | 618 | if (dev->conf.channel->band == IEEE80211_BAND_5GHZ) |
607 | hdr->rate : (hdr->rate - 4)) & 0xf; | 619 | rx_status.rate_idx = (rate < 4) ? 0 : rate - 4; |
620 | else | ||
621 | rx_status.rate_idx = rate; | ||
622 | |||
608 | rx_status.freq = freq; | 623 | rx_status.freq = freq; |
609 | rx_status.band = dev->conf.channel->band; | 624 | rx_status.band = dev->conf.channel->band; |
610 | rx_status.antenna = hdr->antenna; | 625 | rx_status.antenna = hdr->antenna; |
@@ -798,6 +813,16 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
798 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 813 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
799 | info->status.ack_signal = p54_rssi_to_dbm(dev, | 814 | info->status.ack_signal = p54_rssi_to_dbm(dev, |
800 | (int)payload->ack_rssi); | 815 | (int)payload->ack_rssi); |
816 | |||
817 | if (entry_data->key_type == P54_CRYPTO_TKIPMICHAEL) { | ||
818 | u8 *iv = (u8 *)(entry_data->align + pad + | ||
819 | entry_data->crypt_offset); | ||
820 | |||
821 | /* Restore the original TKIP IV. */ | ||
822 | iv[2] = iv[0]; | ||
823 | iv[0] = iv[1]; | ||
824 | iv[1] = (iv[0] | 0x20) & 0x7f; /* WEPSeed - 8.3.2.2 */ | ||
825 | } | ||
801 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); | 826 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); |
802 | ieee80211_tx_status_irqsafe(dev, entry); | 827 | ieee80211_tx_status_irqsafe(dev, entry); |
803 | goto out; | 828 | goto out; |
@@ -1383,7 +1408,6 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1383 | hdr->tries = ridx; | 1408 | hdr->tries = ridx; |
1384 | txhdr->rts_rate_idx = 0; | 1409 | txhdr->rts_rate_idx = 0; |
1385 | if (info->control.hw_key) { | 1410 | if (info->control.hw_key) { |
1386 | crypt_offset += info->control.hw_key->iv_len; | ||
1387 | txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); | 1411 | txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); |
1388 | txhdr->key_len = min((u8)16, info->control.hw_key->keylen); | 1412 | txhdr->key_len = min((u8)16, info->control.hw_key->keylen); |
1389 | memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); | 1413 | memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); |
@@ -1397,6 +1421,8 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1397 | } | 1421 | } |
1398 | /* reserve some space for ICV */ | 1422 | /* reserve some space for ICV */ |
1399 | len += info->control.hw_key->icv_len; | 1423 | len += info->control.hw_key->icv_len; |
1424 | memset(skb_put(skb, info->control.hw_key->icv_len), 0, | ||
1425 | info->control.hw_key->icv_len); | ||
1400 | } else { | 1426 | } else { |
1401 | txhdr->key_type = 0; | 1427 | txhdr->key_type = 0; |
1402 | txhdr->key_len = 0; | 1428 | txhdr->key_len = 0; |
@@ -1824,7 +1850,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev, | |||
1824 | 1850 | ||
1825 | static int p54_config(struct ieee80211_hw *dev, u32 changed) | 1851 | static int p54_config(struct ieee80211_hw *dev, u32 changed) |
1826 | { | 1852 | { |
1827 | int ret; | 1853 | int ret = 0; |
1828 | struct p54_common *priv = dev->priv; | 1854 | struct p54_common *priv = dev->priv; |
1829 | struct ieee80211_conf *conf = &dev->conf; | 1855 | struct ieee80211_conf *conf = &dev->conf; |
1830 | 1856 | ||
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index c44a200059d2..6a6a72f6f82c 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -56,6 +56,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
56 | {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */ | 56 | {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */ |
57 | {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */ | 57 | {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */ |
58 | {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */ | 58 | {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */ |
59 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ | ||
59 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ | 60 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
60 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ | 61 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
61 | {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ | 62 | {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ |
@@ -284,6 +285,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
284 | usb_fill_bulk_urb(data_urb, priv->udev, | 285 | usb_fill_bulk_urb(data_urb, priv->udev, |
285 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 286 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
286 | skb->data, skb->len, p54u_tx_cb, skb); | 287 | skb->data, skb->len, p54u_tx_cb, skb); |
288 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
287 | 289 | ||
288 | usb_anchor_urb(data_urb, &priv->submitted); | 290 | usb_anchor_urb(data_urb, &priv->submitted); |
289 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { | 291 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { |