diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-01-05 10:12:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-05 10:13:24 -0500 |
commit | 1032c736e81cdf490ae62f86da7efe67c3c3e61d (patch) | |
tree | a0c3919849f97dbbc5ea7c6a9ac1d7a639e44a73 /drivers/net/wireless/rt2x00/rt2800usb.c | |
parent | 117ff42fd43e92d24c6aa6f3e4f0f1e1edada140 (diff) | |
parent | cb00ec382b57d35b955c085198cd54a0c1fcdc94 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
drivers/net/wireless/b43legacy/dma.c
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index ee01d2e883a..f8eb49f5ac2 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -400,10 +400,10 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry, | |||
400 | /* | 400 | /* |
401 | * The size of TXINFO_W0_USB_DMA_TX_PKT_LEN is | 401 | * The size of TXINFO_W0_USB_DMA_TX_PKT_LEN is |
402 | * TXWI + 802.11 header + L2 pad + payload + pad, | 402 | * TXWI + 802.11 header + L2 pad + payload + pad, |
403 | * so need to decrease size of TXINFO and USB end pad. | 403 | * so need to decrease size of TXINFO. |
404 | */ | 404 | */ |
405 | rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, | 405 | rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, |
406 | entry->skb->len - TXINFO_DESC_SIZE - 4); | 406 | roundup(entry->skb->len, 4) - TXINFO_DESC_SIZE); |
407 | rt2x00_set_field32(&word, TXINFO_W0_WIV, | 407 | rt2x00_set_field32(&word, TXINFO_W0_WIV, |
408 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); | 408 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); |
409 | rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); | 409 | rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); |
@@ -421,37 +421,20 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry, | |||
421 | skbdesc->desc_len = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; | 421 | skbdesc->desc_len = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; |
422 | } | 422 | } |
423 | 423 | ||
424 | static void rt2800usb_write_tx_data(struct queue_entry *entry, | 424 | /* |
425 | struct txentry_desc *txdesc) | 425 | * TX data initialization |
426 | */ | ||
427 | static int rt2800usb_get_tx_data_len(struct queue_entry *entry) | ||
426 | { | 428 | { |
427 | unsigned int len; | ||
428 | int err; | ||
429 | |||
430 | rt2800_write_tx_data(entry, txdesc); | ||
431 | |||
432 | /* | 429 | /* |
433 | * pad(1~3 bytes) is added after each 802.11 payload. | 430 | * pad(1~3 bytes) is needed after each 802.11 payload. |
434 | * USB end pad(4 bytes) is added at each USB bulk out packet end. | 431 | * USB end pad(4 bytes) is needed at each USB bulk out packet end. |
435 | * TX frame format is : | 432 | * TX frame format is : |
436 | * | TXINFO | TXWI | 802.11 header | L2 pad | payload | pad | USB end pad | | 433 | * | TXINFO | TXWI | 802.11 header | L2 pad | payload | pad | USB end pad | |
437 | * |<------------- tx_pkt_len ------------->| | 434 | * |<------------- tx_pkt_len ------------->| |
438 | */ | 435 | */ |
439 | len = roundup(entry->skb->len, 4) + 4; | ||
440 | err = skb_padto(entry->skb, len); | ||
441 | if (unlikely(err)) { | ||
442 | WARNING(entry->queue->rt2x00dev, "TX SKB padding error, out of memory\n"); | ||
443 | return; | ||
444 | } | ||
445 | 436 | ||
446 | entry->skb->len = len; | 437 | return roundup(entry->skb->len, 4) + 4; |
447 | } | ||
448 | |||
449 | /* | ||
450 | * TX data initialization | ||
451 | */ | ||
452 | static int rt2800usb_get_tx_data_len(struct queue_entry *entry) | ||
453 | { | ||
454 | return entry->skb->len; | ||
455 | } | 438 | } |
456 | 439 | ||
457 | /* | 440 | /* |
@@ -807,7 +790,7 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { | |||
807 | .flush_queue = rt2x00usb_flush_queue, | 790 | .flush_queue = rt2x00usb_flush_queue, |
808 | .tx_dma_done = rt2800usb_tx_dma_done, | 791 | .tx_dma_done = rt2800usb_tx_dma_done, |
809 | .write_tx_desc = rt2800usb_write_tx_desc, | 792 | .write_tx_desc = rt2800usb_write_tx_desc, |
810 | .write_tx_data = rt2800usb_write_tx_data, | 793 | .write_tx_data = rt2800_write_tx_data, |
811 | .write_beacon = rt2800_write_beacon, | 794 | .write_beacon = rt2800_write_beacon, |
812 | .clear_beacon = rt2800_clear_beacon, | 795 | .clear_beacon = rt2800_clear_beacon, |
813 | .get_tx_data_len = rt2800usb_get_tx_data_len, | 796 | .get_tx_data_len = rt2800usb_get_tx_data_len, |
@@ -914,12 +897,14 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
914 | { USB_DEVICE(0x050d, 0x8053) }, | 897 | { USB_DEVICE(0x050d, 0x8053) }, |
915 | { USB_DEVICE(0x050d, 0x805c) }, | 898 | { USB_DEVICE(0x050d, 0x805c) }, |
916 | { USB_DEVICE(0x050d, 0x815c) }, | 899 | { USB_DEVICE(0x050d, 0x815c) }, |
900 | { USB_DEVICE(0x050d, 0x825a) }, | ||
917 | { USB_DEVICE(0x050d, 0x825b) }, | 901 | { USB_DEVICE(0x050d, 0x825b) }, |
918 | { USB_DEVICE(0x050d, 0x935a) }, | 902 | { USB_DEVICE(0x050d, 0x935a) }, |
919 | { USB_DEVICE(0x050d, 0x935b) }, | 903 | { USB_DEVICE(0x050d, 0x935b) }, |
920 | /* Buffalo */ | 904 | /* Buffalo */ |
921 | { USB_DEVICE(0x0411, 0x00e8) }, | 905 | { USB_DEVICE(0x0411, 0x00e8) }, |
922 | { USB_DEVICE(0x0411, 0x0158) }, | 906 | { USB_DEVICE(0x0411, 0x0158) }, |
907 | { USB_DEVICE(0x0411, 0x015d) }, | ||
923 | { USB_DEVICE(0x0411, 0x016f) }, | 908 | { USB_DEVICE(0x0411, 0x016f) }, |
924 | { USB_DEVICE(0x0411, 0x01a2) }, | 909 | { USB_DEVICE(0x0411, 0x01a2) }, |
925 | /* Corega */ | 910 | /* Corega */ |
@@ -934,6 +919,8 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
934 | { USB_DEVICE(0x07d1, 0x3c0e) }, | 919 | { USB_DEVICE(0x07d1, 0x3c0e) }, |
935 | { USB_DEVICE(0x07d1, 0x3c0f) }, | 920 | { USB_DEVICE(0x07d1, 0x3c0f) }, |
936 | { USB_DEVICE(0x07d1, 0x3c11) }, | 921 | { USB_DEVICE(0x07d1, 0x3c11) }, |
922 | { USB_DEVICE(0x07d1, 0x3c13) }, | ||
923 | { USB_DEVICE(0x07d1, 0x3c15) }, | ||
937 | { USB_DEVICE(0x07d1, 0x3c16) }, | 924 | { USB_DEVICE(0x07d1, 0x3c16) }, |
938 | /* Draytek */ | 925 | /* Draytek */ |
939 | { USB_DEVICE(0x07fa, 0x7712) }, | 926 | { USB_DEVICE(0x07fa, 0x7712) }, |
@@ -943,6 +930,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
943 | { USB_DEVICE(0x7392, 0x7711) }, | 930 | { USB_DEVICE(0x7392, 0x7711) }, |
944 | { USB_DEVICE(0x7392, 0x7717) }, | 931 | { USB_DEVICE(0x7392, 0x7717) }, |
945 | { USB_DEVICE(0x7392, 0x7718) }, | 932 | { USB_DEVICE(0x7392, 0x7718) }, |
933 | { USB_DEVICE(0x7392, 0x7722) }, | ||
946 | /* Encore */ | 934 | /* Encore */ |
947 | { USB_DEVICE(0x203d, 0x1480) }, | 935 | { USB_DEVICE(0x203d, 0x1480) }, |
948 | { USB_DEVICE(0x203d, 0x14a9) }, | 936 | { USB_DEVICE(0x203d, 0x14a9) }, |
@@ -976,6 +964,8 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
976 | { USB_DEVICE(0x13b1, 0x0031) }, | 964 | { USB_DEVICE(0x13b1, 0x0031) }, |
977 | { USB_DEVICE(0x1737, 0x0070) }, | 965 | { USB_DEVICE(0x1737, 0x0070) }, |
978 | { USB_DEVICE(0x1737, 0x0071) }, | 966 | { USB_DEVICE(0x1737, 0x0071) }, |
967 | { USB_DEVICE(0x1737, 0x0077) }, | ||
968 | { USB_DEVICE(0x1737, 0x0078) }, | ||
979 | /* Logitec */ | 969 | /* Logitec */ |
980 | { USB_DEVICE(0x0789, 0x0162) }, | 970 | { USB_DEVICE(0x0789, 0x0162) }, |
981 | { USB_DEVICE(0x0789, 0x0163) }, | 971 | { USB_DEVICE(0x0789, 0x0163) }, |
@@ -999,9 +989,13 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
999 | { USB_DEVICE(0x0db0, 0x871b) }, | 989 | { USB_DEVICE(0x0db0, 0x871b) }, |
1000 | { USB_DEVICE(0x0db0, 0x871c) }, | 990 | { USB_DEVICE(0x0db0, 0x871c) }, |
1001 | { USB_DEVICE(0x0db0, 0x899a) }, | 991 | { USB_DEVICE(0x0db0, 0x899a) }, |
992 | /* Ovislink */ | ||
993 | { USB_DEVICE(0x1b75, 0x3071) }, | ||
994 | { USB_DEVICE(0x1b75, 0x3072) }, | ||
1002 | /* Para */ | 995 | /* Para */ |
1003 | { USB_DEVICE(0x20b8, 0x8888) }, | 996 | { USB_DEVICE(0x20b8, 0x8888) }, |
1004 | /* Pegatron */ | 997 | /* Pegatron */ |
998 | { USB_DEVICE(0x1d4d, 0x0002) }, | ||
1005 | { USB_DEVICE(0x1d4d, 0x000c) }, | 999 | { USB_DEVICE(0x1d4d, 0x000c) }, |
1006 | { USB_DEVICE(0x1d4d, 0x000e) }, | 1000 | { USB_DEVICE(0x1d4d, 0x000e) }, |
1007 | { USB_DEVICE(0x1d4d, 0x0011) }, | 1001 | { USB_DEVICE(0x1d4d, 0x0011) }, |
@@ -1054,7 +1048,9 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1054 | /* Sparklan */ | 1048 | /* Sparklan */ |
1055 | { USB_DEVICE(0x15a9, 0x0006) }, | 1049 | { USB_DEVICE(0x15a9, 0x0006) }, |
1056 | /* Sweex */ | 1050 | /* Sweex */ |
1051 | { USB_DEVICE(0x177f, 0x0153) }, | ||
1057 | { USB_DEVICE(0x177f, 0x0302) }, | 1052 | { USB_DEVICE(0x177f, 0x0302) }, |
1053 | { USB_DEVICE(0x177f, 0x0313) }, | ||
1058 | /* U-Media */ | 1054 | /* U-Media */ |
1059 | { USB_DEVICE(0x157e, 0x300e) }, | 1055 | { USB_DEVICE(0x157e, 0x300e) }, |
1060 | { USB_DEVICE(0x157e, 0x3013) }, | 1056 | { USB_DEVICE(0x157e, 0x3013) }, |
@@ -1138,25 +1134,20 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1138 | { USB_DEVICE(0x13d3, 0x3322) }, | 1134 | { USB_DEVICE(0x13d3, 0x3322) }, |
1139 | /* Belkin */ | 1135 | /* Belkin */ |
1140 | { USB_DEVICE(0x050d, 0x1003) }, | 1136 | { USB_DEVICE(0x050d, 0x1003) }, |
1141 | { USB_DEVICE(0x050d, 0x825a) }, | ||
1142 | /* Buffalo */ | 1137 | /* Buffalo */ |
1143 | { USB_DEVICE(0x0411, 0x012e) }, | 1138 | { USB_DEVICE(0x0411, 0x012e) }, |
1144 | { USB_DEVICE(0x0411, 0x0148) }, | 1139 | { USB_DEVICE(0x0411, 0x0148) }, |
1145 | { USB_DEVICE(0x0411, 0x0150) }, | 1140 | { USB_DEVICE(0x0411, 0x0150) }, |
1146 | { USB_DEVICE(0x0411, 0x015d) }, | ||
1147 | /* Corega */ | 1141 | /* Corega */ |
1148 | { USB_DEVICE(0x07aa, 0x0041) }, | 1142 | { USB_DEVICE(0x07aa, 0x0041) }, |
1149 | { USB_DEVICE(0x07aa, 0x0042) }, | 1143 | { USB_DEVICE(0x07aa, 0x0042) }, |
1150 | { USB_DEVICE(0x18c5, 0x0008) }, | 1144 | { USB_DEVICE(0x18c5, 0x0008) }, |
1151 | /* D-Link */ | 1145 | /* D-Link */ |
1152 | { USB_DEVICE(0x07d1, 0x3c0b) }, | 1146 | { USB_DEVICE(0x07d1, 0x3c0b) }, |
1153 | { USB_DEVICE(0x07d1, 0x3c13) }, | ||
1154 | { USB_DEVICE(0x07d1, 0x3c15) }, | ||
1155 | { USB_DEVICE(0x07d1, 0x3c17) }, | 1147 | { USB_DEVICE(0x07d1, 0x3c17) }, |
1156 | { USB_DEVICE(0x2001, 0x3c17) }, | 1148 | { USB_DEVICE(0x2001, 0x3c17) }, |
1157 | /* Edimax */ | 1149 | /* Edimax */ |
1158 | { USB_DEVICE(0x7392, 0x4085) }, | 1150 | { USB_DEVICE(0x7392, 0x4085) }, |
1159 | { USB_DEVICE(0x7392, 0x7722) }, | ||
1160 | /* Encore */ | 1151 | /* Encore */ |
1161 | { USB_DEVICE(0x203d, 0x14a1) }, | 1152 | { USB_DEVICE(0x203d, 0x14a1) }, |
1162 | /* Fujitsu Stylistic 550 */ | 1153 | /* Fujitsu Stylistic 550 */ |
@@ -1172,20 +1163,13 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1172 | /* LevelOne */ | 1163 | /* LevelOne */ |
1173 | { USB_DEVICE(0x1740, 0x0605) }, | 1164 | { USB_DEVICE(0x1740, 0x0605) }, |
1174 | { USB_DEVICE(0x1740, 0x0615) }, | 1165 | { USB_DEVICE(0x1740, 0x0615) }, |
1175 | /* Linksys */ | ||
1176 | { USB_DEVICE(0x1737, 0x0077) }, | ||
1177 | { USB_DEVICE(0x1737, 0x0078) }, | ||
1178 | /* Logitec */ | 1166 | /* Logitec */ |
1179 | { USB_DEVICE(0x0789, 0x0168) }, | 1167 | { USB_DEVICE(0x0789, 0x0168) }, |
1180 | { USB_DEVICE(0x0789, 0x0169) }, | 1168 | { USB_DEVICE(0x0789, 0x0169) }, |
1181 | /* Motorola */ | 1169 | /* Motorola */ |
1182 | { USB_DEVICE(0x100d, 0x9032) }, | 1170 | { USB_DEVICE(0x100d, 0x9032) }, |
1183 | /* Ovislink */ | ||
1184 | { USB_DEVICE(0x1b75, 0x3071) }, | ||
1185 | { USB_DEVICE(0x1b75, 0x3072) }, | ||
1186 | /* Pegatron */ | 1171 | /* Pegatron */ |
1187 | { USB_DEVICE(0x05a6, 0x0101) }, | 1172 | { USB_DEVICE(0x05a6, 0x0101) }, |
1188 | { USB_DEVICE(0x1d4d, 0x0002) }, | ||
1189 | { USB_DEVICE(0x1d4d, 0x0010) }, | 1173 | { USB_DEVICE(0x1d4d, 0x0010) }, |
1190 | /* Planex */ | 1174 | /* Planex */ |
1191 | { USB_DEVICE(0x2019, 0x5201) }, | 1175 | { USB_DEVICE(0x2019, 0x5201) }, |
@@ -1204,9 +1188,6 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1204 | { USB_DEVICE(0x083a, 0xc522) }, | 1188 | { USB_DEVICE(0x083a, 0xc522) }, |
1205 | { USB_DEVICE(0x083a, 0xd522) }, | 1189 | { USB_DEVICE(0x083a, 0xd522) }, |
1206 | { USB_DEVICE(0x083a, 0xf511) }, | 1190 | { USB_DEVICE(0x083a, 0xf511) }, |
1207 | /* Sweex */ | ||
1208 | { USB_DEVICE(0x177f, 0x0153) }, | ||
1209 | { USB_DEVICE(0x177f, 0x0313) }, | ||
1210 | /* Zyxel */ | 1191 | /* Zyxel */ |
1211 | { USB_DEVICE(0x0586, 0x341a) }, | 1192 | { USB_DEVICE(0x0586, 0x341a) }, |
1212 | #endif | 1193 | #endif |