aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-08-11 09:07:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-22 14:45:58 -0400
commit5d852905561a979dfb4d8a68f7313dcb8f055bec (patch)
treef0d88c585de7e886aba645f63c0a1dad08d38690 /drivers
parentefe0249b0fd1e9a32a7e6a5dc9c751d4d97b0adf (diff)
b43: support new TX header, noticed to be used by 598.314+ fw
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/b43.h3
-rw-r--r--drivers/net/wireless/b43/main.c4
-rw-r--r--drivers/net/wireless/b43/xmit.c22
-rw-r--r--drivers/net/wireless/b43/xmit.h19
4 files changed, 46 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 39baaaf4088f..f4e9d8b7d9f8 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -695,6 +695,7 @@ struct b43_firmware_file {
695}; 695};
696 696
697enum b43_firmware_hdr_format { 697enum b43_firmware_hdr_format {
698 B43_FW_HDR_598,
698 B43_FW_HDR_410, 699 B43_FW_HDR_410,
699 B43_FW_HDR_351, 700 B43_FW_HDR_351,
700}; 701};
@@ -883,7 +884,7 @@ struct b43_wl {
883 struct b43_leds leds; 884 struct b43_leds leds;
884 885
885 /* Kmalloc'ed scratch space for PIO TX/RX. Protected by wl->mutex. */ 886 /* Kmalloc'ed scratch space for PIO TX/RX. Protected by wl->mutex. */
886 u8 pio_scratchspace[110] __attribute__((__aligned__(8))); 887 u8 pio_scratchspace[118] __attribute__((__aligned__(8)));
887 u8 pio_tailspace[4] __attribute__((__aligned__(8))); 888 u8 pio_tailspace[4] __attribute__((__aligned__(8)));
888}; 889};
889 890
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index cc3dd800559e..aac883220994 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2514,7 +2514,9 @@ static int b43_upload_microcode(struct b43_wldev *dev)
2514 } 2514 }
2515 dev->fw.rev = fwrev; 2515 dev->fw.rev = fwrev;
2516 dev->fw.patch = fwpatch; 2516 dev->fw.patch = fwpatch;
2517 if (dev->fw.rev >= 410) 2517 if (dev->fw.rev >= 598)
2518 dev->fw.hdr_format = B43_FW_HDR_598;
2519 else if (dev->fw.rev >= 410)
2518 dev->fw.hdr_format = B43_FW_HDR_410; 2520 dev->fw.hdr_format = B43_FW_HDR_410;
2519 else 2521 else
2520 dev->fw.hdr_format = B43_FW_HDR_351; 2522 dev->fw.hdr_format = B43_FW_HDR_351;
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 5ce17d5eed6e..b02170d6614a 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -338,6 +338,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
338 } 338 }
339 } 339 }
340 switch (dev->fw.hdr_format) { 340 switch (dev->fw.hdr_format) {
341 case B43_FW_HDR_598:
342 b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->format_598.plcp),
343 plcp_fragment_len, rate);
344 break;
341 case B43_FW_HDR_351: 345 case B43_FW_HDR_351:
342 b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->format_351.plcp), 346 b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->format_351.plcp),
343 plcp_fragment_len, rate); 347 plcp_fragment_len, rate);
@@ -435,6 +439,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
435 struct ieee80211_cts *uninitialized_var(cts); 439 struct ieee80211_cts *uninitialized_var(cts);
436 440
437 switch (dev->fw.hdr_format) { 441 switch (dev->fw.hdr_format) {
442 case B43_FW_HDR_598:
443 cts = (struct ieee80211_cts *)
444 (txhdr->format_598.rts_frame);
445 break;
438 case B43_FW_HDR_351: 446 case B43_FW_HDR_351:
439 cts = (struct ieee80211_cts *) 447 cts = (struct ieee80211_cts *)
440 (txhdr->format_351.rts_frame); 448 (txhdr->format_351.rts_frame);
@@ -453,6 +461,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
453 struct ieee80211_rts *uninitialized_var(rts); 461 struct ieee80211_rts *uninitialized_var(rts);
454 462
455 switch (dev->fw.hdr_format) { 463 switch (dev->fw.hdr_format) {
464 case B43_FW_HDR_598:
465 rts = (struct ieee80211_rts *)
466 (txhdr->format_598.rts_frame);
467 break;
456 case B43_FW_HDR_351: 468 case B43_FW_HDR_351:
457 rts = (struct ieee80211_rts *) 469 rts = (struct ieee80211_rts *)
458 (txhdr->format_351.rts_frame); 470 (txhdr->format_351.rts_frame);
@@ -472,6 +484,9 @@ int b43_generate_txhdr(struct b43_wldev *dev,
472 484
473 /* Generate the PLCP headers for the RTS/CTS frame */ 485 /* Generate the PLCP headers for the RTS/CTS frame */
474 switch (dev->fw.hdr_format) { 486 switch (dev->fw.hdr_format) {
487 case B43_FW_HDR_598:
488 plcp = &txhdr->format_598.rts_plcp;
489 break;
475 case B43_FW_HDR_351: 490 case B43_FW_HDR_351:
476 plcp = &txhdr->format_351.rts_plcp; 491 plcp = &txhdr->format_351.rts_plcp;
477 break; 492 break;
@@ -486,6 +501,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
486 len, rts_rate_fb); 501 len, rts_rate_fb);
487 502
488 switch (dev->fw.hdr_format) { 503 switch (dev->fw.hdr_format) {
504 case B43_FW_HDR_598:
505 hdr = (struct ieee80211_hdr *)
506 (&txhdr->format_598.rts_frame);
507 break;
489 case B43_FW_HDR_351: 508 case B43_FW_HDR_351:
490 hdr = (struct ieee80211_hdr *) 509 hdr = (struct ieee80211_hdr *)
491 (&txhdr->format_351.rts_frame); 510 (&txhdr->format_351.rts_frame);
@@ -522,6 +541,9 @@ int b43_generate_txhdr(struct b43_wldev *dev,
522 541
523 /* Magic cookie */ 542 /* Magic cookie */
524 switch (dev->fw.hdr_format) { 543 switch (dev->fw.hdr_format) {
544 case B43_FW_HDR_598:
545 txhdr->format_598.cookie = cpu_to_le16(cookie);
546 break;
525 case B43_FW_HDR_351: 547 case B43_FW_HDR_351:
526 txhdr->format_351.cookie = cpu_to_le16(cookie); 548 txhdr->format_351.cookie = cpu_to_le16(cookie);
527 break; 549 break;
diff --git a/drivers/net/wireless/b43/xmit.h b/drivers/net/wireless/b43/xmit.h
index a3ff727d27f2..dccf7c1b20a3 100644
--- a/drivers/net/wireless/b43/xmit.h
+++ b/drivers/net/wireless/b43/xmit.h
@@ -46,6 +46,23 @@ struct b43_txhdr {
46 __le32 timeout; /* Timeout */ 46 __le32 timeout; /* Timeout */
47 47
48 union { 48 union {
49 /* Tested with 598.314, 644.1001 and 666.2 */
50 struct {
51 __le16 mimo_antenna; /* MIMO antenna select */
52 __le16 preload_size; /* Preload size */
53 PAD_BYTES(2);
54 __le16 cookie; /* TX frame cookie */
55 __le16 tx_status; /* TX status */
56 __le16 max_n_mpdus;
57 __le16 max_a_bytes_mrt;
58 __le16 max_a_bytes_fbr;
59 __le16 min_m_bytes;
60 struct b43_plcp_hdr6 rts_plcp; /* RTS PLCP header */
61 __u8 rts_frame[16]; /* The RTS frame (if used) */
62 PAD_BYTES(2);
63 struct b43_plcp_hdr6 plcp; /* Main PLCP header */
64 } format_598 __packed;
65
49 /* Tested with 410.2160, 478.104 and 508.* */ 66 /* Tested with 410.2160, 478.104 and 508.* */
50 struct { 67 struct {
51 __le16 mimo_antenna; /* MIMO antenna select */ 68 __le16 mimo_antenna; /* MIMO antenna select */
@@ -170,6 +187,8 @@ static inline
170size_t b43_txhdr_size(struct b43_wldev *dev) 187size_t b43_txhdr_size(struct b43_wldev *dev)
171{ 188{
172 switch (dev->fw.hdr_format) { 189 switch (dev->fw.hdr_format) {
190 case B43_FW_HDR_598:
191 return 112 + sizeof(struct b43_plcp_hdr6);
173 case B43_FW_HDR_410: 192 case B43_FW_HDR_410:
174 return 104 + sizeof(struct b43_plcp_hdr6); 193 return 104 + sizeof(struct b43_plcp_hdr6);
175 case B43_FW_HDR_351: 194 case B43_FW_HDR_351: