Browse Source

qcacmn: Support NO_RX_PKT_HDR_TLV for KIWI

Support NO_RX_PKT_HDR_TLV for KIWI

Change-Id: I489a1dd6ffa7b2fe2a12735459490b8da5f79f5b
CRs-Fixed: 3262204
Jinwei Chen 2 years ago
parent
commit
7b61b2f9d5
2 changed files with 48 additions and 5 deletions
  1. 20 1
      hal/wifi3.0/be/hal_be_rx_tlv.h
  2. 28 4
      hal/wifi3.0/kiwi/hal_kiwi.c

+ 20 - 1
hal/wifi3.0/be/hal_be_rx_tlv.h

@@ -1854,11 +1854,30 @@ static inline uint32_t hal_rx_tlv_get_is_decrypted_be(uint8_t *buf)
 	return is_decrypt;
 	return is_decrypt;
 }
 }
 
 
-//TODO -  Currently going with NO-PKT-HDR, need to add pkt hdr tlv and check
+#ifdef NO_RX_PKT_HDR_TLV
+/**
+ * hal_rx_pkt_hdr_get_be(): API to get 80211 header
+ * @buf: start of rx_pkt_tlv
+ *
+ * If NO_RX_PKT_HDR_TLV is enabled, then this API assume caller gives a raw
+ * data, get 80211 header from packet data directly.
+ * If NO_RX_PKT_HDR_TLV is disabled, then get it from rx_pkt_hdr_tlv in
+ * rx_pkt_tlvs.
+ *
+ * Return: pointer to start of 80211 header
+ */
 static inline uint8_t *hal_rx_pkt_hdr_get_be(uint8_t *buf)
 static inline uint8_t *hal_rx_pkt_hdr_get_be(uint8_t *buf)
 {
 {
 	return buf + RX_PKT_TLVS_LEN;
 	return buf + RX_PKT_TLVS_LEN;
 }
 }
+#else
+static inline uint8_t *hal_rx_pkt_hdr_get_be(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+
+	return pkt_tlvs->pkt_hdr_tlv.rx_pkt_hdr;
+}
+#endif
 
 
 /**
 /**
  * hal_rx_priv_info_set_in_tlv_be(): Save the private info to
  * hal_rx_priv_info_set_in_tlv_be(): Save the private info to

+ 28 - 4
hal/wifi3.0/kiwi/hal_kiwi.c

@@ -763,10 +763,21 @@ static void hal_rx_dump_msdu_end_tlv_kiwi(void *msduend,
 }
 }
 #endif
 #endif
 
 
+#ifdef NO_RX_PKT_HDR_TLV
+static inline void hal_rx_dump_pkt_hdr_tlv_kiwi(struct rx_pkt_tlvs *pkt_tlvs,
+						uint8_t dbg_level)
+{
+}
+
+static inline
+void hal_register_rx_pkt_hdr_tlv_api_kiwi(struct hal_soc *hal_soc)
+{
+}
+#else
 /**
 /**
  * hal_rx_dump_pkt_hdr_tlv: dump RX pkt header TLV in hex format
  * hal_rx_dump_pkt_hdr_tlv: dump RX pkt header TLV in hex format
- * @ pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt.
- * @ dbg_level: log level.
+ * @pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt.
+ * @dbg_level: log level.
  *
  *
  * Return: void
  * Return: void
  */
  */
@@ -785,6 +796,20 @@ static inline void hal_rx_dump_pkt_hdr_tlv_kiwi(struct rx_pkt_tlvs *pkt_tlvs,
 			     sizeof(pkt_hdr_tlv->rx_pkt_hdr));
 			     sizeof(pkt_hdr_tlv->rx_pkt_hdr));
 }
 }
 
 
+/**
+ * hal_register_rx_pkt_hdr_tlv_api_kiwi: register all rx_pkt_hdr_tlv related api
+ * @hal_soc: HAL soc handler
+ *
+ * Return: none
+ */
+static inline
+void hal_register_rx_pkt_hdr_tlv_api_kiwi(struct hal_soc *hal_soc)
+{
+	hal_soc->ops->hal_rx_pkt_tlv_offset_get =
+				hal_rx_pkt_tlv_offset_get_generic;
+}
+#endif
+
 /**
 /**
  * hal_rx_dump_mpdu_start_tlv_generic_be: dump RX mpdu_start TLV in structured
  * hal_rx_dump_mpdu_start_tlv_generic_be: dump RX mpdu_start TLV in structured
  *			       human readable format.
  *			       human readable format.
@@ -1981,12 +2006,11 @@ static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_rx_reo_prev_pn_get = hal_rx_reo_prev_pn_get_kiwi;
 	hal_soc->ops->hal_rx_reo_prev_pn_get = hal_rx_reo_prev_pn_get_kiwi;
 
 
 	/* rx - TLV struct offsets */
 	/* rx - TLV struct offsets */
+	hal_register_rx_pkt_hdr_tlv_api_kiwi(hal_soc);
 	hal_soc->ops->hal_rx_msdu_end_offset_get =
 	hal_soc->ops->hal_rx_msdu_end_offset_get =
 					hal_rx_msdu_end_offset_get_generic;
 					hal_rx_msdu_end_offset_get_generic;
 	hal_soc->ops->hal_rx_mpdu_start_offset_get =
 	hal_soc->ops->hal_rx_mpdu_start_offset_get =
 					hal_rx_mpdu_start_offset_get_generic;
 					hal_rx_mpdu_start_offset_get_generic;
-	hal_soc->ops->hal_rx_pkt_tlv_offset_get =
-					hal_rx_pkt_tlv_offset_get_generic;
 	hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_kiwi;
 	hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_kiwi;
 	hal_soc->ops->hal_rx_flow_get_tuple_info =
 	hal_soc->ops->hal_rx_flow_get_tuple_info =
 					hal_rx_flow_get_tuple_info_be;
 					hal_rx_flow_get_tuple_info_be;