]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath10k: add support for qca6174 Rx descriptors
authorMichal Kazior <michal.kazior@tieto.com>
Sat, 24 Jan 2015 10:14:48 +0000 (12:14 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 27 Jan 2015 13:59:34 +0000 (15:59 +0200)
The QCA6174 chip has an extra 4 bytes in
rx_ppdu_end structure which is used in htt_rx_desc
and HTT Rx ring offset setup. This is necessary
for correct Rx for QCA6174 (otherwise Rx
descriptors are overwritten and corrupted).

This means QCA988X will have an extra 4 byte
padding in Rx descriptor layout which is harmless.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/htt_rx.c
drivers/net/wireless/ath/ath10k/rx_desc.h

index 661785fb99061f4b8468b1411a96308e48c8396d..c1da44f65a4d0230bb2aac9461be7ca10a8ceb5c 100644 (file)
@@ -813,7 +813,7 @@ static void ath10k_htt_rx_h_mactime(struct ath10k *ar,
         *
         * FIXME: Can we get/compute 64bit TSF?
         */
-       status->mactime = __le32_to_cpu(rxd->ppdu_end.tsf_timestamp);
+       status->mactime = __le32_to_cpu(rxd->ppdu_end.common.tsf_timestamp);
        status->flag |= RX_FLAG_MACTIME_END;
 }
 
index e1ffdd57a18c8b34d7f2efb0705f65fa2533a655..e9cc7787bf5fd61c788c91212d080e78cde9fcc5 100644 (file)
@@ -850,7 +850,7 @@ struct rx_ppdu_start {
 
 #define RX_PPDU_END_INFO1_PPDU_DONE (1 << 15)
 
-struct rx_ppdu_end {
+struct rx_ppdu_end_common {
        __le32 evm_p0;
        __le32 evm_p1;
        __le32 evm_p2;
@@ -873,10 +873,33 @@ struct rx_ppdu_end {
        u8 phy_err_code;
        __le16 flags; /* %RX_PPDU_END_FLAGS_ */
        __le32 info0; /* %RX_PPDU_END_INFO0_ */
+} __packed;
+
+struct rx_ppdu_end_qca988x {
        __le16 bb_length;
        __le16 info1; /* %RX_PPDU_END_INFO1_ */
 } __packed;
 
+#define RX_PPDU_END_RTT_CORRELATION_VALUE_MASK 0x00ffffff
+#define RX_PPDU_END_RTT_CORRELATION_VALUE_LSB  0
+#define RX_PPDU_END_RTT_UNUSED_MASK            0x7f000000
+#define RX_PPDU_END_RTT_UNUSED_LSB             24
+#define RX_PPDU_END_RTT_NORMAL_MODE            BIT(31)
+
+struct rx_ppdu_end_qca6174 {
+       __le32 rtt; /* %RX_PPDU_END_RTT_ */
+       __le16 bb_length;
+       __le16 info1; /* %RX_PPDU_END_INFO1_ */
+} __packed;
+
+struct rx_ppdu_end {
+       struct rx_ppdu_end_common common;
+       union {
+               struct rx_ppdu_end_qca988x qca988x;
+               struct rx_ppdu_end_qca6174 qca6174;
+       } __packed;
+} __packed;
+
 /*
  * evm_p0
  *             EVM for pilot 0.  Contain EVM for streams: 0, 1, 2 and 3.