rtlwifi: access skb->data to get C2H data by macro

The format of C2H data is ID(1 byte) + Length(1 byte) + value, and it is
more readable to use macros to access C2H data.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Ping-Ke Shih
2018-05-18 17:30:06 +08:00
zatwierdzone przez Kalle Valo
rodzic 9ae6ed271a
commit 9644032e30
2 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@@ -177,6 +177,11 @@ enum rtl_c2h_evt_v2 {
C2H_V2_CCX_RPT = 0x0F,
};
#define GET_C2H_CMD_ID(c2h) ({u8 *__c2h = c2h; __c2h[0]; })
#define GET_C2H_SEQ(c2h) ({u8 *__c2h = c2h; __c2h[1]; })
#define C2H_DATA_OFFSET 2
#define GET_C2H_DATA_PTR(c2h) ({u8 *__c2h = c2h; &__c2h[C2H_DATA_OFFSET]; })
#define GET_TX_REPORT_SN_V1(c2h) (c2h[6])
#define GET_TX_REPORT_ST_V1(c2h) (c2h[0] & 0xC0)
#define GET_TX_REPORT_RETRY_V1(c2h) (c2h[2] & 0x3F)