iwlwifi: mvm: add 9000-series RX API
authorJohannes Berg <johannes.berg@intel.com>
Wed, 2 Sep 2015 14:16:49 +0000 (16:16 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 1 Dec 2015 19:17:57 +0000 (21:17 +0200)
Define the RX API that's used by the 9000 series hardware.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rx.h
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index d7903226313ff02c5df1f0ec49ce58ee26107f8e..9a8a37f7fd196555b77209e2754360f2a945f649 100644 (file)
@@ -68,6 +68,8 @@
 #ifndef __fw_api_rx_h__
 #define __fw_api_rx_h__
 
+/* API for pre-9000 hardware */
+
 #define IWL_RX_INFO_PHY_CNT 8
 #define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1
 #define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff
@@ -236,4 +238,115 @@ enum iwl_mvm_rx_status {
        RX_MPDU_RES_STATUS2_FILTERING_MSK               = (0xc0000000),
 };
 
+/* 9000 series API */
+enum iwl_rx_mpdu_mac_flags1 {
+       IWL_RX_MDPU_MFLG1_ADDRTYPE_MASK         = 0x03,
+       IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_MASK      = 0xf0,
+       /* shift should be 4, but the length is measured in 2-byte
+        * words, so shifting only by 3 gives a byte result
+        */
+       IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_SHIFT     = 3,
+};
+
+enum iwl_rx_mpdu_mac_flags2 {
+       /* in 2-byte words */
+       IWL_RX_MPDU_MFLG2_HDR_LEN_MASK          = 0x1f,
+       IWL_RX_MPDU_MFLG2_PAD                   = 0x20,
+       IWL_RX_MPDU_MFLG2_AMSDU                 = 0x40,
+};
+
+enum iwl_rx_mpdu_amsdu_info {
+       IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK     = 0x3f,
+       IWL_RX_MPDU_AMSDU_LAST_SUBFRAME         = 0x40,
+       /* 0x80 bit reserved for now */
+};
+
+enum iwl_rx_l3l4_flags {
+       IWL_RX_L3L4_IP_HDR_CSUM_OK              = BIT(0),
+       IWL_RX_L3L4_TCP_UDP_CSUM_OK             = BIT(1),
+       IWL_RX_L3L4_TCP_FIN_SYN_RST_PSH         = BIT(2),
+       IWL_RX_L3L4_TCP_ACK                     = BIT(3),
+       IWL_RX_L3L4_L3_PROTO_MASK               = 0xf << 4,
+       IWL_RX_L3L4_L4_PROTO_MASK               = 0xf << 8,
+       IWL_RX_L3L4_RSS_HASH_MASK               = 0xf << 12,
+};
+
+enum iwl_rx_mpdu_status {
+       IWL_RX_MPDU_STATUS_CRC_OK               = BIT(0),
+       IWL_RX_MPDU_STATUS_OVERRUN_OK           = BIT(1),
+       IWL_RX_MPDU_STATUS_SRC_STA_FOUND        = BIT(2),
+       IWL_RX_MPDU_STATUS_KEY_VALID            = BIT(3),
+       IWL_RX_MPDU_STATUS_KEY_ERROR            = BIT(4),
+       IWL_RX_MPDU_STATUS_ICV_OK               = BIT(5),
+       IWL_RX_MPDU_STATUS_MIC_OK               = BIT(6),
+       IWL_RX_MPDU_STATUS_SEC_MASK             = 0x7 << 8,
+       IWL_RX_MPDU_STATUS_SEC_NONE             = 0x0 << 8,
+       IWL_RX_MPDU_STATUS_SEC_WEP              = 0x1 << 8,
+       IWL_RX_MPDU_STATUS_SEC_CCM              = 0x2 << 8,
+       IWL_RX_MPDU_STATUS_SEC_TKIP             = 0x3 << 8,
+       IWL_RX_MPDU_STATUS_DECRYPTED            = BIT(11),
+       IWL_RX_MPDU_STATUS_WEP_MATCH            = BIT(12),
+       IWL_RX_MPDU_STATUS_EXT_IV_MATCH         = BIT(13),
+       IWL_RX_MPDU_STATUS_KEY_ID_MATCH         = BIT(14),
+       IWL_RX_MPDU_STATUS_KEY_COLOR            = BIT(15),
+};
+
+enum iwl_rx_mpdu_hash_filter {
+       IWL_RX_MPDU_HF_A1_HASH_MASK             = 0x3f,
+       IWL_RX_MPDU_HF_FILTER_STATUS_MASK       = 0xc0,
+};
+
+enum iwl_rx_mpdu_sta_id_flags {
+       IWL_RX_MPDU_SIF_STA_ID_MASK             = 0x1f,
+       IWL_RX_MPDU_SIF_RRF_ABORT               = 0x20,
+       IWL_RX_MPDU_SIF_FILTER_STATUS_MASK      = 0xc0,
+};
+
+enum iwl_rx_mpdu_reorder_data {
+       IWL_RX_MPDU_REORDER_NSSN_MASK           = 0x00000fff,
+       IWL_RX_MPDU_REORDER_SN_MASK             = 0x00fff000,
+       IWL_RX_MPDU_REORDER_SN_SHIFT            = 12,
+       IWL_RX_MPDU_REORDER_BAID_MASK           = 0x7f000000,
+       IWL_RX_MPDU_REORDER_BAID_SHIFT          = 24,
+       IWL_RX_MPDU_REORDER_BA_OLD_SN           = 0x80000000,
+};
+
+struct iwl_rx_mpdu_desc {
+       /* DW2 */
+       __le16 mpdu_len;
+       u8 mac_flags1;
+       u8 mac_flags2;
+       /* DW3 */
+       u8 amsdu_info;
+       __le16 reserved_for_software;
+       u8 mac_phy_idx;
+       /* DW4 */
+       __le16 raw_csum; /* alledgedly unreliable */
+       __le16 l3l4_flags;
+       /* DW5 */
+       __le16 status;
+       u8 hash_filter;
+       u8 sta_id_flags;
+       /* DW6 */
+       __le32 reorder_data;
+       /* DW7 */
+       __le32 rss_hash;
+       /* DW8 */
+       __le32 filter_match;
+       /* DW9 */
+       __le32 gp2_on_air_rise;
+       /* DW10 */
+       __le32 rate_n_flags;
+       /* DW11 */
+       u8 energy_a, energy_b, energy_c, channel;
+       /* DW12 & DW13 */
+       __le64 tsf_on_air_rise;
+} __packed;
+
+struct iwl_frame_release {
+       u8 baid;
+       u8 reserved;
+       __le16 nssn;
+};
+
 #endif /* __fw_api_rx_h__ */
index 68dfa2848d3e05dabbd2d5087e499d516026bc50..9436798977a018eb1310d875e9d43a81f1121a18 100644 (file)
@@ -213,6 +213,7 @@ enum {
 
        REPLY_RX_PHY_CMD = 0xc0,
        REPLY_RX_MPDU_CMD = 0xc1,
+       FRAME_RELEASE = 0xc3,
        BA_NOTIF = 0xc5,
 
        /* Location Aware Regulatory */
index fa849a284e1ced5d9e346c77bc521c320a982d05..3b0d597f503328f6ce96002de3a0d80ca8dd661b 100644 (file)
@@ -310,6 +310,7 @@ static const char *const iwl_mvm_cmd_strings[REPLY_MAX + 1] = {
        CMD(WEP_KEY),
        CMD(REPLY_RX_PHY_CMD),
        CMD(REPLY_RX_MPDU_CMD),
+       CMD(FRAME_RELEASE),
        CMD(BEACON_NOTIFICATION),
        CMD(BEACON_TEMPLATE_CMD),
        CMD(STATISTICS_CMD),