Commit 5d852905 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: support new TX header, noticed to be used by 598.314+ fw

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent efe0249b
...@@ -695,6 +695,7 @@ struct b43_firmware_file { ...@@ -695,6 +695,7 @@ struct b43_firmware_file {
}; };
enum b43_firmware_hdr_format { enum b43_firmware_hdr_format {
B43_FW_HDR_598,
B43_FW_HDR_410, B43_FW_HDR_410,
B43_FW_HDR_351, B43_FW_HDR_351,
}; };
...@@ -883,7 +884,7 @@ struct b43_wl { ...@@ -883,7 +884,7 @@ struct b43_wl {
struct b43_leds leds; struct b43_leds leds;
/* Kmalloc'ed scratch space for PIO TX/RX. Protected by wl->mutex. */ /* Kmalloc'ed scratch space for PIO TX/RX. Protected by wl->mutex. */
u8 pio_scratchspace[110] __attribute__((__aligned__(8))); u8 pio_scratchspace[118] __attribute__((__aligned__(8)));
u8 pio_tailspace[4] __attribute__((__aligned__(8))); u8 pio_tailspace[4] __attribute__((__aligned__(8)));
}; };
......
...@@ -2514,7 +2514,9 @@ static int b43_upload_microcode(struct b43_wldev *dev) ...@@ -2514,7 +2514,9 @@ static int b43_upload_microcode(struct b43_wldev *dev)
} }
dev->fw.rev = fwrev; dev->fw.rev = fwrev;
dev->fw.patch = fwpatch; dev->fw.patch = fwpatch;
if (dev->fw.rev >= 410) if (dev->fw.rev >= 598)
dev->fw.hdr_format = B43_FW_HDR_598;
else if (dev->fw.rev >= 410)
dev->fw.hdr_format = B43_FW_HDR_410; dev->fw.hdr_format = B43_FW_HDR_410;
else else
dev->fw.hdr_format = B43_FW_HDR_351; dev->fw.hdr_format = B43_FW_HDR_351;
......
...@@ -338,6 +338,10 @@ int b43_generate_txhdr(struct b43_wldev *dev, ...@@ -338,6 +338,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
} }
} }
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->format_598.plcp),
plcp_fragment_len, rate);
break;
case B43_FW_HDR_351: case B43_FW_HDR_351:
b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->format_351.plcp), b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->format_351.plcp),
plcp_fragment_len, rate); plcp_fragment_len, rate);
...@@ -435,6 +439,10 @@ int b43_generate_txhdr(struct b43_wldev *dev, ...@@ -435,6 +439,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
struct ieee80211_cts *uninitialized_var(cts); struct ieee80211_cts *uninitialized_var(cts);
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
cts = (struct ieee80211_cts *)
(txhdr->format_598.rts_frame);
break;
case B43_FW_HDR_351: case B43_FW_HDR_351:
cts = (struct ieee80211_cts *) cts = (struct ieee80211_cts *)
(txhdr->format_351.rts_frame); (txhdr->format_351.rts_frame);
...@@ -453,6 +461,10 @@ int b43_generate_txhdr(struct b43_wldev *dev, ...@@ -453,6 +461,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
struct ieee80211_rts *uninitialized_var(rts); struct ieee80211_rts *uninitialized_var(rts);
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
rts = (struct ieee80211_rts *)
(txhdr->format_598.rts_frame);
break;
case B43_FW_HDR_351: case B43_FW_HDR_351:
rts = (struct ieee80211_rts *) rts = (struct ieee80211_rts *)
(txhdr->format_351.rts_frame); (txhdr->format_351.rts_frame);
...@@ -472,6 +484,9 @@ int b43_generate_txhdr(struct b43_wldev *dev, ...@@ -472,6 +484,9 @@ int b43_generate_txhdr(struct b43_wldev *dev,
/* Generate the PLCP headers for the RTS/CTS frame */ /* Generate the PLCP headers for the RTS/CTS frame */
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
plcp = &txhdr->format_598.rts_plcp;
break;
case B43_FW_HDR_351: case B43_FW_HDR_351:
plcp = &txhdr->format_351.rts_plcp; plcp = &txhdr->format_351.rts_plcp;
break; break;
...@@ -486,6 +501,10 @@ int b43_generate_txhdr(struct b43_wldev *dev, ...@@ -486,6 +501,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,
len, rts_rate_fb); len, rts_rate_fb);
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
hdr = (struct ieee80211_hdr *)
(&txhdr->format_598.rts_frame);
break;
case B43_FW_HDR_351: case B43_FW_HDR_351:
hdr = (struct ieee80211_hdr *) hdr = (struct ieee80211_hdr *)
(&txhdr->format_351.rts_frame); (&txhdr->format_351.rts_frame);
...@@ -522,6 +541,9 @@ int b43_generate_txhdr(struct b43_wldev *dev, ...@@ -522,6 +541,9 @@ int b43_generate_txhdr(struct b43_wldev *dev,
/* Magic cookie */ /* Magic cookie */
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
txhdr->format_598.cookie = cpu_to_le16(cookie);
break;
case B43_FW_HDR_351: case B43_FW_HDR_351:
txhdr->format_351.cookie = cpu_to_le16(cookie); txhdr->format_351.cookie = cpu_to_le16(cookie);
break; break;
......
...@@ -46,6 +46,23 @@ struct b43_txhdr { ...@@ -46,6 +46,23 @@ struct b43_txhdr {
__le32 timeout; /* Timeout */ __le32 timeout; /* Timeout */
union { union {
/* Tested with 598.314, 644.1001 and 666.2 */
struct {
__le16 mimo_antenna; /* MIMO antenna select */
__le16 preload_size; /* Preload size */
PAD_BYTES(2);
__le16 cookie; /* TX frame cookie */
__le16 tx_status; /* TX status */
__le16 max_n_mpdus;
__le16 max_a_bytes_mrt;
__le16 max_a_bytes_fbr;
__le16 min_m_bytes;
struct b43_plcp_hdr6 rts_plcp; /* RTS PLCP header */
__u8 rts_frame[16]; /* The RTS frame (if used) */
PAD_BYTES(2);
struct b43_plcp_hdr6 plcp; /* Main PLCP header */
} format_598 __packed;
/* Tested with 410.2160, 478.104 and 508.* */ /* Tested with 410.2160, 478.104 and 508.* */
struct { struct {
__le16 mimo_antenna; /* MIMO antenna select */ __le16 mimo_antenna; /* MIMO antenna select */
...@@ -170,6 +187,8 @@ static inline ...@@ -170,6 +187,8 @@ static inline
size_t b43_txhdr_size(struct b43_wldev *dev) size_t b43_txhdr_size(struct b43_wldev *dev)
{ {
switch (dev->fw.hdr_format) { switch (dev->fw.hdr_format) {
case B43_FW_HDR_598:
return 112 + sizeof(struct b43_plcp_hdr6);
case B43_FW_HDR_410: case B43_FW_HDR_410:
return 104 + sizeof(struct b43_plcp_hdr6); return 104 + sizeof(struct b43_plcp_hdr6);
case B43_FW_HDR_351: case B43_FW_HDR_351:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment