|
@@ -134,6 +134,33 @@ void hal_reo_setup_generic_li(struct hal_soc *soc, void *reoparams)
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
+static uint32_t hal_get_reo_qdesc_size_li(uint32_t ba_window_size, int tid)
|
|
|
+{
|
|
|
+ /* Return descriptor size corresponding to window size of 2 since
|
|
|
+ * we set ba_window_size to 2 while setting up REO descriptors as
|
|
|
+ * a WAR to get 2k jump exception aggregates are received without
|
|
|
+ * a BA session.
|
|
|
+ */
|
|
|
+ if (ba_window_size <= 1) {
|
|
|
+ if (tid != HAL_NON_QOS_TID)
|
|
|
+ return sizeof(struct rx_reo_queue) +
|
|
|
+ sizeof(struct rx_reo_queue_ext);
|
|
|
+ else
|
|
|
+ return sizeof(struct rx_reo_queue);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ba_window_size <= 105)
|
|
|
+ return sizeof(struct rx_reo_queue) +
|
|
|
+ sizeof(struct rx_reo_queue_ext);
|
|
|
+
|
|
|
+ if (ba_window_size <= 210)
|
|
|
+ return sizeof(struct rx_reo_queue) +
|
|
|
+ (2 * sizeof(struct rx_reo_queue_ext));
|
|
|
+
|
|
|
+ return sizeof(struct rx_reo_queue) +
|
|
|
+ (3 * sizeof(struct rx_reo_queue_ext));
|
|
|
+}
|
|
|
+
|
|
|
void hal_set_link_desc_addr_li(void *desc, uint32_t cookie,
|
|
|
qdf_dma_addr_t link_desc_paddr)
|
|
|
{
|
|
@@ -761,17 +788,84 @@ uint8_t hal_rx_ret_buf_manager_get_li(hal_ring_desc_t ring_desc)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * hal_rx_reo_ent_buf_paddr_get_li: Gets the physical address and
|
|
|
- * cookie from the REO entrance ring element
|
|
|
+ * hal_rx_reo_buf_paddr_get_li: Gets the physical address and
|
|
|
+ * cookie from the REO destination ring element
|
|
|
*
|
|
|
- * @ hal_rx_desc_cookie: Opaque cookie pointer used by HAL to get to
|
|
|
+ * @ rx_desc: Opaque cookie pointer used by HAL to get to
|
|
|
* the current descriptor
|
|
|
* @ buf_info: structure to return the buffer information
|
|
|
- * @ msdu_cnt: pointer to msdu count in MPDU
|
|
|
* Return: void
|
|
|
*/
|
|
|
+static void hal_rx_reo_buf_paddr_get_li(hal_ring_desc_t rx_desc,
|
|
|
+ struct hal_buf_info *buf_info)
|
|
|
+{
|
|
|
+ struct reo_destination_ring *reo_ring =
|
|
|
+ (struct reo_destination_ring *)rx_desc;
|
|
|
+
|
|
|
+ buf_info->paddr =
|
|
|
+ (HAL_RX_REO_BUFFER_ADDR_31_0_GET(reo_ring) |
|
|
|
+ ((uint64_t)(HAL_RX_REO_BUFFER_ADDR_39_32_GET(reo_ring)) << 32));
|
|
|
+ buf_info->sw_cookie = HAL_RX_REO_BUF_COOKIE_GET(reo_ring);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_rx_msdu_link_desc_set_li: Retrieves MSDU Link Descriptor to WBM
|
|
|
+ *
|
|
|
+ * @ hal_soc_hdl : HAL version of the SOC pointer
|
|
|
+ * @ src_srng_desc : void pointer to the WBM Release Ring descriptor
|
|
|
+ * @ buf_addr_info : void pointer to the buffer_addr_info
|
|
|
+ * @ bm_action : put in IDLE list or release to MSDU_LIST
|
|
|
+ *
|
|
|
+ * Return: void
|
|
|
+ */
|
|
|
+/* look at implementation at dp_hw_link_desc_pool_setup()*/
|
|
|
+static void hal_rx_msdu_link_desc_set_li(hal_soc_handle_t hal_soc_hdl,
|
|
|
+ void *src_srng_desc,
|
|
|
+ hal_buff_addrinfo_t buf_addr_info,
|
|
|
+ uint8_t bm_action)
|
|
|
+{
|
|
|
+ /*
|
|
|
+ * The offsets for fields used in this function are same in
|
|
|
+ * wbm_release_ring for Lithium and wbm_release_ring_tx
|
|
|
+ * for Beryllium. hence we can use wbm_release_ring directly.
|
|
|
+ */
|
|
|
+ struct wbm_release_ring *wbm_rel_srng =
|
|
|
+ (struct wbm_release_ring *)src_srng_desc;
|
|
|
+ uint32_t addr_31_0;
|
|
|
+ uint8_t addr_39_32;
|
|
|
+
|
|
|
+ /* Structure copy !!! */
|
|
|
+ wbm_rel_srng->released_buff_or_desc_addr_info =
|
|
|
+ *(struct buffer_addr_info *)buf_addr_info;
|
|
|
+
|
|
|
+ addr_31_0 =
|
|
|
+ wbm_rel_srng->released_buff_or_desc_addr_info.buffer_addr_31_0;
|
|
|
+ addr_39_32 =
|
|
|
+ wbm_rel_srng->released_buff_or_desc_addr_info.buffer_addr_39_32;
|
|
|
+
|
|
|
+ HAL_DESC_SET_FIELD(src_srng_desc, HAL_SW2WBM_RELEASE_RING,
|
|
|
+ RELEASE_SOURCE_MODULE, HAL_RX_WBM_ERR_SRC_SW);
|
|
|
+ HAL_DESC_SET_FIELD(src_srng_desc, HAL_SW2WBM_RELEASE_RING, BM_ACTION,
|
|
|
+ bm_action);
|
|
|
+ HAL_DESC_SET_FIELD(src_srng_desc, HAL_SW2WBM_RELEASE_RING,
|
|
|
+ BUFFER_OR_DESC_TYPE,
|
|
|
+ HAL_RX_WBM_BUF_TYPE_MSDU_LINK_DESC);
|
|
|
+
|
|
|
+ /* WBM error is indicated when any of the link descriptors given to
|
|
|
+ * WBM has a NULL address, and one those paths is the link descriptors
|
|
|
+ * released from host after processing RXDMA errors,
|
|
|
+ * or from Rx defrag path, and we want to add an assert here to ensure
|
|
|
+ * host is not releasing descriptors with NULL address.
|
|
|
+ */
|
|
|
+
|
|
|
+ if (qdf_unlikely(!addr_31_0 && !addr_39_32)) {
|
|
|
+ hal_dump_wbm_rel_desc(src_srng_desc);
|
|
|
+ qdf_assert_always(0);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static
|
|
|
-void hal_rx_buf_cookie_rbm_get_li(hal_buff_addrinfo_t buf_addr_info_hdl,
|
|
|
+void hal_rx_buf_cookie_rbm_get_li(uint32_t *buf_addr_info_hdl,
|
|
|
hal_buf_info_t buf_info_hdl)
|
|
|
{
|
|
|
struct hal_buf_info *buf_info =
|
|
@@ -784,8 +878,84 @@ void hal_rx_buf_cookie_rbm_get_li(hal_buff_addrinfo_t buf_addr_info_hdl,
|
|
|
* buffer addr info is the first member of ring desc, so the typecast
|
|
|
* can be done.
|
|
|
*/
|
|
|
- buf_info->rbm = hal_rx_ret_buf_manager_get_li(
|
|
|
- (hal_ring_desc_t)buf_addr_info);
|
|
|
+ buf_info->rbm = hal_rx_ret_buf_manager_get_li
|
|
|
+ ((hal_ring_desc_t)buf_addr_info);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_rx_msdu_link_desc_get(): API to get the MSDU information
|
|
|
+ * from the MSDU link descriptor
|
|
|
+ *
|
|
|
+ * @ hal_soc_hdl : HAL version of the SOC pointer
|
|
|
+ * @msdu_link_desc: Opaque pointer used by HAL to get to the
|
|
|
+ * MSDU link descriptor (struct rx_msdu_link)
|
|
|
+ *
|
|
|
+ * @msdu_list: Return the list of MSDUs contained in this link descriptor
|
|
|
+ *
|
|
|
+ * @num_msdus: Number of MSDUs in the MPDU
|
|
|
+ *
|
|
|
+ * Return: void
|
|
|
+ */
|
|
|
+static inline void hal_rx_msdu_list_get_li(hal_soc_handle_t hal_soc_hdl,
|
|
|
+ void *msdu_link_desc,
|
|
|
+ void *hal_msdu_list,
|
|
|
+ uint16_t *num_msdus)
|
|
|
+{
|
|
|
+ struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
|
|
|
+ struct rx_msdu_details *msdu_details;
|
|
|
+ struct rx_msdu_desc_info *msdu_desc_info;
|
|
|
+ struct hal_rx_msdu_list *msdu_list = hal_msdu_list;
|
|
|
+ struct rx_msdu_link *msdu_link = (struct rx_msdu_link *)msdu_link_desc;
|
|
|
+ int i;
|
|
|
+ struct hal_buf_info buf_info;
|
|
|
+
|
|
|
+ msdu_details = hal_rx_link_desc_msdu0_ptr(msdu_link, hal_soc);
|
|
|
+
|
|
|
+ hal_debug("msdu_link=%pK msdu_details=%pK", msdu_link, msdu_details);
|
|
|
+ for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) {
|
|
|
+ /* num_msdus received in mpdu descriptor may be incorrect
|
|
|
+ * sometimes due to HW issue. Check msdu buffer address also
|
|
|
+ */
|
|
|
+ if (!i && (HAL_RX_BUFFER_ADDR_31_0_GET(
|
|
|
+ &msdu_details[i].buffer_addr_info_details) == 0))
|
|
|
+ break;
|
|
|
+ if (HAL_RX_BUFFER_ADDR_31_0_GET(
|
|
|
+ &msdu_details[i].buffer_addr_info_details) == 0) {
|
|
|
+ /* set the last msdu bit in the prev msdu_desc_info */
|
|
|
+ msdu_desc_info =
|
|
|
+ hal_rx_msdu_desc_info_get_ptr
|
|
|
+ (&msdu_details[i - 1], hal_soc);
|
|
|
+ HAL_RX_LAST_MSDU_IN_MPDU_FLAG_SET(msdu_desc_info, 1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ msdu_desc_info = hal_rx_msdu_desc_info_get_ptr(&msdu_details[i],
|
|
|
+ hal_soc);
|
|
|
+
|
|
|
+ /* set first MSDU bit or the last MSDU bit */
|
|
|
+ if (!i)
|
|
|
+ HAL_RX_FIRST_MSDU_IN_MPDU_FLAG_SET(msdu_desc_info, 1);
|
|
|
+ else if (i == (HAL_RX_NUM_MSDU_DESC - 1))
|
|
|
+ HAL_RX_LAST_MSDU_IN_MPDU_FLAG_SET(msdu_desc_info, 1);
|
|
|
+
|
|
|
+ msdu_list->msdu_info[i].msdu_flags =
|
|
|
+ hal_rx_msdu_flags_get(hal_soc_hdl, msdu_desc_info);
|
|
|
+ msdu_list->msdu_info[i].msdu_len =
|
|
|
+ HAL_RX_MSDU_PKT_LENGTH_GET(msdu_desc_info);
|
|
|
+
|
|
|
+ /* addr field in buf_info will not be valid */
|
|
|
+ hal_rx_buf_cookie_rbm_get_li(
|
|
|
+ (uint32_t *)
|
|
|
+ &msdu_details[i].buffer_addr_info_details,
|
|
|
+ &buf_info);
|
|
|
+ msdu_list->sw_cookie[i] = buf_info.sw_cookie;
|
|
|
+ msdu_list->rbm[i] = buf_info.rbm;
|
|
|
+ msdu_list->paddr[i] = HAL_RX_BUFFER_ADDR_31_0_GET(
|
|
|
+ &msdu_details[i].buffer_addr_info_details) |
|
|
|
+ (uint64_t)HAL_RX_BUFFER_ADDR_39_32_GET(
|
|
|
+ &msdu_details[i].buffer_addr_info_details) << 32;
|
|
|
+ hal_debug("i=%d sw_cookie=%d", i, msdu_list->sw_cookie[i]);
|
|
|
+ }
|
|
|
+ *num_msdus = i;
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -809,45 +979,6 @@ static void hal_rxdma_buff_addr_info_set_li(void *rxdma_entry,
|
|
|
HAL_RXDMA_MANAGER_SET(rxdma_entry, manager);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * hal_rx_msdu_flags_get_li() - Get msdu flags from ring desc
|
|
|
- * @msdu_desc_info_hdl: msdu desc info handle
|
|
|
- *
|
|
|
- * Return: msdu flags
|
|
|
- */
|
|
|
-static uint32_t hal_rx_msdu_flags_get_li(rx_msdu_desc_info_t msdu_desc_info_hdl)
|
|
|
-{
|
|
|
- struct rx_msdu_desc_info *msdu_desc_info =
|
|
|
- (struct rx_msdu_desc_info *)msdu_desc_info_hdl;
|
|
|
- uint32_t flags = 0;
|
|
|
-
|
|
|
- if (HAL_RX_FIRST_MSDU_IN_MPDU_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_FIRST_MSDU_IN_MPDU;
|
|
|
-
|
|
|
- if (HAL_RX_LAST_MSDU_IN_MPDU_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_LAST_MSDU_IN_MPDU;
|
|
|
-
|
|
|
- if (HAL_RX_MSDU_CONTINUATION_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_MSDU_CONTINUATION;
|
|
|
-
|
|
|
- if (HAL_RX_MSDU_SA_IS_VALID_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_SA_IS_VALID;
|
|
|
-
|
|
|
- if (HAL_RX_MSDU_SA_IDX_TIMEOUT_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_SA_IDX_TIMEOUT;
|
|
|
-
|
|
|
- if (HAL_RX_MSDU_DA_IS_VALID_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_DA_IS_VALID;
|
|
|
-
|
|
|
- if (HAL_RX_MSDU_DA_IDX_TIMEOUT_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_DA_IDX_TIMEOUT;
|
|
|
-
|
|
|
- if (HAL_RX_MSDU_DA_IS_MCBC_FLAG_GET(msdu_desc_info))
|
|
|
- flags |= HAL_MSDU_F_DA_IS_MCBC;
|
|
|
-
|
|
|
- return flags;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* hal_rx_get_reo_error_code_li() - Get REO error code from ring desc
|
|
|
* @rx_desc: rx descriptor
|
|
@@ -1045,8 +1176,349 @@ hal_rx_msdu_start_msdu_len_set_li(uint8_t *buf, uint32_t len)
|
|
|
*(uint32_t *)wrd1 |= len;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * hal_rx_tlv_bw_get_li(): API to get the Bandwidth
|
|
|
+ * Interval from rx_msdu_start
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV header
|
|
|
+ * Return: uint32_t(bw)
|
|
|
+ */
|
|
|
+static inline uint32_t hal_rx_tlv_bw_get_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_msdu_start *msdu_start =
|
|
|
+ &pkt_tlvs->msdu_start_tlv.rx_msdu_start;
|
|
|
+ uint32_t bw;
|
|
|
+
|
|
|
+ bw = HAL_RX_MSDU_START_BW_GET(msdu_start);
|
|
|
+
|
|
|
+ return bw;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * hal_rx_tlv_get_freq_li(): API to get the frequency of operating channel
|
|
|
+ * from rx_msdu_start
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV header
|
|
|
+ * Return: uint32_t(frequency)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_get_freq_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_msdu_start *msdu_start =
|
|
|
+ &pkt_tlvs->msdu_start_tlv.rx_msdu_start;
|
|
|
+ uint32_t freq;
|
|
|
+
|
|
|
+ freq = HAL_RX_MSDU_START_FREQ_GET(msdu_start);
|
|
|
+
|
|
|
+ return freq;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
- * hal_hw_txrx_default_ops_attach_be() - Attach the default hal ops for
|
|
|
+ * hal_rx_tlv_sgi_get_li(): API to get the Short Gaurd
|
|
|
+ * Interval from rx_msdu_start TLV
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV headers
|
|
|
+ * Return: uint32_t(sgi)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_sgi_get_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_msdu_start *msdu_start =
|
|
|
+ &pkt_tlvs->msdu_start_tlv.rx_msdu_start;
|
|
|
+ uint32_t sgi;
|
|
|
+
|
|
|
+ sgi = HAL_RX_MSDU_START_SGI_GET(msdu_start);
|
|
|
+
|
|
|
+ return sgi;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_rx_tlv_rate_mcs_get_li(): API to get the MCS rate
|
|
|
+ * from rx_msdu_start TLV
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV headers
|
|
|
+ * Return: uint32_t(rate_mcs)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_rate_mcs_get_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_msdu_start *msdu_start =
|
|
|
+ &pkt_tlvs->msdu_start_tlv.rx_msdu_start;
|
|
|
+ uint32_t rate_mcs;
|
|
|
+
|
|
|
+ rate_mcs = HAL_RX_MSDU_START_RATE_MCS_GET(msdu_start);
|
|
|
+
|
|
|
+ return rate_mcs;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * hal_rx_tlv_get_pkt_type_li(): API to get the pkt type
|
|
|
+ * from rx_msdu_start
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV header
|
|
|
+ * Return: uint32_t(pkt type)
|
|
|
+ */
|
|
|
+
|
|
|
+static inline uint32_t hal_rx_tlv_get_pkt_type_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_msdu_start *msdu_start =
|
|
|
+ &pkt_tlvs->msdu_start_tlv.rx_msdu_start;
|
|
|
+ uint32_t pkt_type;
|
|
|
+
|
|
|
+ pkt_type = HAL_RX_MSDU_START_PKT_TYPE_GET(msdu_start);
|
|
|
+
|
|
|
+ return pkt_type;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_rx_tlv_mic_err_get_li(): API to get the MIC ERR
|
|
|
+ * from rx_mpdu_end TLV
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV headers
|
|
|
+ * Return: uint32_t(mic_err)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_mic_err_get_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_mpdu_end *mpdu_end =
|
|
|
+ &pkt_tlvs->mpdu_end_tlv.rx_mpdu_end;
|
|
|
+ uint32_t mic_err;
|
|
|
+
|
|
|
+ mic_err = HAL_RX_MPDU_END_MIC_ERR_GET(mpdu_end);
|
|
|
+
|
|
|
+ return mic_err;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_rx_tlv_decrypt_err_get_li(): API to get the Decrypt ERR
|
|
|
+ * from rx_mpdu_end TLV
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV headers
|
|
|
+ * Return: uint32_t(decrypt_err)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_decrypt_err_get_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_mpdu_end *mpdu_end =
|
|
|
+ &pkt_tlvs->mpdu_end_tlv.rx_mpdu_end;
|
|
|
+ uint32_t decrypt_err;
|
|
|
+
|
|
|
+ decrypt_err = HAL_RX_MPDU_END_DECRYPT_ERR_GET(mpdu_end);
|
|
|
+
|
|
|
+ return decrypt_err;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * hal_rx_tlv_first_mpdu_get_li(): get fist_mpdu bit from rx attention
|
|
|
+ * @buf: pointer to rx_pkt_tlvs
|
|
|
+ *
|
|
|
+ * reutm: uint32_t(first_msdu)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_first_mpdu_get_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_attention *rx_attn = &pkt_tlvs->attn_tlv.rx_attn;
|
|
|
+ uint32_t first_mpdu;
|
|
|
+
|
|
|
+ first_mpdu = HAL_RX_ATTN_FIRST_MPDU_GET(rx_attn);
|
|
|
+
|
|
|
+ return first_mpdu;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * hal_rx_msdu_get_keyid_li(): API to get the key id if the decrypted packet
|
|
|
+ * from rx_msdu_end
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV header
|
|
|
+ * Return: uint32_t(key id)
|
|
|
+ */
|
|
|
+static inline uint8_t
|
|
|
+hal_rx_msdu_get_keyid_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
|
|
|
+ uint32_t keyid_octet;
|
|
|
+
|
|
|
+ keyid_octet = HAL_RX_MSDU_END_KEYID_OCTET_GET(msdu_end);
|
|
|
+
|
|
|
+ return keyid_octet & 0x3;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * hal_rx_tlv_get_is_decrypted_li(): API to get the decrypt status of the
|
|
|
+ * packet from rx_attention
|
|
|
+ *
|
|
|
+ * @buf: pointer to the start of RX PKT TLV header
|
|
|
+ * Return: uint32_t(decryt status)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_tlv_get_is_decrypted_li(uint8_t *buf)
|
|
|
+{
|
|
|
+ struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
|
|
|
+ struct rx_attention *rx_attn = &pkt_tlvs->attn_tlv.rx_attn;
|
|
|
+ uint32_t is_decrypt = 0;
|
|
|
+ uint32_t decrypt_status;
|
|
|
+
|
|
|
+ decrypt_status = HAL_RX_ATTN_DECRYPT_STATUS_GET(rx_attn);
|
|
|
+
|
|
|
+ if (!decrypt_status)
|
|
|
+ is_decrypt = 1;
|
|
|
+
|
|
|
+ return is_decrypt;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_rx_msdu_reo_dst_ind_get_li: Gets the REO
|
|
|
+ * destination ring ID from the msdu desc info
|
|
|
+ *
|
|
|
+ * @ hal_soc_hdl : HAL version of the SOC pointer
|
|
|
+ * @msdu_link_desc : Opaque cookie pointer used by HAL to get to
|
|
|
+ * the current descriptor
|
|
|
+ *
|
|
|
+ * Return: dst_ind (REO destination ring ID)
|
|
|
+ */
|
|
|
+static inline uint32_t
|
|
|
+hal_rx_msdu_reo_dst_ind_get_li(hal_soc_handle_t hal_soc_hdl,
|
|
|
+ void *msdu_link_desc)
|
|
|
+{
|
|
|
+ struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
|
|
|
+ struct rx_msdu_details *msdu_details;
|
|
|
+ struct rx_msdu_desc_info *msdu_desc_info;
|
|
|
+ struct rx_msdu_link *msdu_link = (struct rx_msdu_link *)msdu_link_desc;
|
|
|
+ uint32_t dst_ind;
|
|
|
+
|
|
|
+ msdu_details = hal_rx_link_desc_msdu0_ptr(msdu_link, hal_soc);
|
|
|
+
|
|
|
+ /* The first msdu in the link should exsist */
|
|
|
+ msdu_desc_info = hal_rx_msdu_desc_info_get_ptr(&msdu_details[0],
|
|
|
+ hal_soc);
|
|
|
+ dst_ind = HAL_RX_MSDU_REO_DST_IND_GET(msdu_desc_info);
|
|
|
+ return dst_ind;
|
|
|
+}
|
|
|
+
|
|
|
+static inline void
|
|
|
+hal_mpdu_desc_info_set_li(hal_soc_handle_t hal_soc_hdl,
|
|
|
+ void *mpdu_desc, uint32_t seq_no)
|
|
|
+{
|
|
|
+ struct rx_mpdu_desc_info *mpdu_desc_info =
|
|
|
+ (struct rx_mpdu_desc_info *)mpdu_desc;
|
|
|
+
|
|
|
+ HAL_RX_MPDU_DESC_INFO_SET(mpdu_desc_info,
|
|
|
+ MSDU_COUNT, 0x1);
|
|
|
+ HAL_RX_MPDU_DESC_INFO_SET(mpdu_desc_info,
|
|
|
+ MPDU_SEQUENCE_NUMBER, seq_no);
|
|
|
+ /* unset frag bit */
|
|
|
+ HAL_RX_MPDU_DESC_INFO_SET(mpdu_desc_info,
|
|
|
+ FRAGMENT_FLAG, 0x0);
|
|
|
+ /* set sa/da valid bits */
|
|
|
+ HAL_RX_MPDU_DESC_INFO_SET(mpdu_desc_info,
|
|
|
+ SA_IS_VALID, 0x1);
|
|
|
+ HAL_RX_MPDU_DESC_INFO_SET(mpdu_desc_info,
|
|
|
+ DA_IS_VALID, 0x1);
|
|
|
+ HAL_RX_MPDU_DESC_INFO_SET(mpdu_desc_info,
|
|
|
+ RAW_MPDU, 0x0);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void
|
|
|
+hal_msdu_desc_info_set_li(hal_soc_handle_t hal_soc_hdl,
|
|
|
+ void *msdu_desc, uint32_t dst_ind,
|
|
|
+ uint32_t nbuf_len)
|
|
|
+{
|
|
|
+ struct rx_msdu_desc_info *msdu_desc_info =
|
|
|
+ (struct rx_msdu_desc_info *)msdu_desc;
|
|
|
+
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ FIRST_MSDU_IN_MPDU_FLAG, 1);
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ LAST_MSDU_IN_MPDU_FLAG, 1);
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ MSDU_CONTINUATION, 0x0);
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ REO_DESTINATION_INDICATION,
|
|
|
+ dst_ind);
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ MSDU_LENGTH, nbuf_len);
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ SA_IS_VALID, 1);
|
|
|
+ HAL_RX_MSDU_DESC_INFO_SET(msdu_desc_info,
|
|
|
+ DA_IS_VALID, 1);
|
|
|
+}
|
|
|
+
|
|
|
+static QDF_STATUS hal_reo_status_update_li(hal_soc_handle_t hal_soc_hdl,
|
|
|
+ hal_ring_desc_t reo_desc,
|
|
|
+ void *st_handle,
|
|
|
+ uint32_t tlv, int *num_ref)
|
|
|
+{
|
|
|
+ union hal_reo_status *reo_status_ref;
|
|
|
+
|
|
|
+ reo_status_ref = (union hal_reo_status *)st_handle;
|
|
|
+
|
|
|
+ switch (tlv) {
|
|
|
+ case HAL_REO_QUEUE_STATS_STATUS_TLV:
|
|
|
+ hal_reo_queue_stats_status_li(reo_desc,
|
|
|
+ &reo_status_ref->queue_status,
|
|
|
+ hal_soc_hdl);
|
|
|
+ *num_ref = reo_status_ref->queue_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
|
|
|
+ hal_reo_flush_queue_status_li(reo_desc,
|
|
|
+ &reo_status_ref->fl_queue_status,
|
|
|
+ hal_soc_hdl);
|
|
|
+ *num_ref = reo_status_ref->fl_queue_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ case HAL_REO_FLUSH_CACHE_STATUS_TLV:
|
|
|
+ hal_reo_flush_cache_status_li(reo_desc,
|
|
|
+ &reo_status_ref->fl_cache_status,
|
|
|
+ hal_soc_hdl);
|
|
|
+ *num_ref = reo_status_ref->fl_cache_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ case HAL_REO_UNBLK_CACHE_STATUS_TLV:
|
|
|
+ hal_reo_unblock_cache_status_li(
|
|
|
+ reo_desc, hal_soc_hdl,
|
|
|
+ &reo_status_ref->unblk_cache_status);
|
|
|
+ *num_ref = reo_status_ref->unblk_cache_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ case HAL_REO_TIMOUT_LIST_STATUS_TLV:
|
|
|
+ hal_reo_flush_timeout_list_status_li(
|
|
|
+ reo_desc,
|
|
|
+ &reo_status_ref->fl_timeout_status,
|
|
|
+ hal_soc_hdl);
|
|
|
+ *num_ref = reo_status_ref->fl_timeout_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ case HAL_REO_DESC_THRES_STATUS_TLV:
|
|
|
+ hal_reo_desc_thres_reached_status_li(
|
|
|
+ reo_desc,
|
|
|
+ &reo_status_ref->thres_status,
|
|
|
+ hal_soc_hdl);
|
|
|
+ *num_ref = reo_status_ref->thres_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
|
|
|
+ hal_reo_rx_update_queue_status_li(
|
|
|
+ reo_desc,
|
|
|
+ &reo_status_ref->rx_queue_status,
|
|
|
+ hal_soc_hdl);
|
|
|
+ *num_ref = reo_status_ref->rx_queue_status.header.cmd_num;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_DP_REO, QDF_TRACE_LEVEL_WARN,
|
|
|
+ "hal_soc %pK: no handler for TLV:%d",
|
|
|
+ hal_soc_hdl, tlv);
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ } /* switch */
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_hw_txrx_default_ops_attach_li() - Attach the default hal ops for
|
|
|
* lithium chipsets.
|
|
|
* @hal_soc_hdl: HAL soc handle
|
|
|
*
|
|
@@ -1054,6 +1526,7 @@ hal_rx_msdu_start_msdu_len_set_li(uint8_t *buf, uint32_t len)
|
|
|
*/
|
|
|
void hal_hw_txrx_default_ops_attach_li(struct hal_soc *hal_soc)
|
|
|
{
|
|
|
+ hal_soc->ops->hal_get_reo_qdesc_size = hal_get_reo_qdesc_size_li;
|
|
|
hal_soc->ops->hal_set_link_desc_addr = hal_set_link_desc_addr_li;
|
|
|
hal_soc->ops->hal_tx_init_data_ring = hal_tx_init_data_ring_li;
|
|
|
hal_soc->ops->hal_get_ba_aging_timeout = hal_get_ba_aging_timeout_li;
|
|
@@ -1080,6 +1553,8 @@ void hal_hw_txrx_default_ops_attach_li(struct hal_soc *hal_soc)
|
|
|
hal_soc->ops->hal_rx_get_proto_params = hal_rx_get_proto_params_li;
|
|
|
hal_soc->ops->hal_rx_get_l3_l4_offsets = hal_rx_get_l3_l4_offsets_li;
|
|
|
|
|
|
+ hal_soc->ops->hal_rx_reo_buf_paddr_get = hal_rx_reo_buf_paddr_get_li;
|
|
|
+ hal_soc->ops->hal_rx_msdu_link_desc_set = hal_rx_msdu_link_desc_set_li;
|
|
|
hal_soc->ops->hal_rx_buf_cookie_rbm_get = hal_rx_buf_cookie_rbm_get_li;
|
|
|
hal_soc->ops->hal_rx_ret_buf_manager_get =
|
|
|
hal_rx_ret_buf_manager_get_li;
|
|
@@ -1108,21 +1583,6 @@ void hal_hw_txrx_default_ops_attach_li(struct hal_soc *hal_soc)
|
|
|
hal_soc->ops->hal_rx_tlv_mpdu_fcs_err_get =
|
|
|
hal_rx_tlv_mpdu_fcs_err_get_li;
|
|
|
hal_soc->ops->hal_reo_send_cmd = hal_reo_send_cmd_li;
|
|
|
- hal_soc->ops->hal_reo_queue_stats_status =
|
|
|
- hal_reo_queue_stats_status_li;
|
|
|
- hal_soc->ops->hal_reo_flush_queue_status =
|
|
|
- hal_reo_flush_queue_status_li;
|
|
|
- hal_soc->ops->hal_reo_flush_cache_status =
|
|
|
- hal_reo_flush_cache_status_li;
|
|
|
- hal_soc->ops->hal_reo_unblock_cache_status =
|
|
|
- hal_reo_unblock_cache_status_li;
|
|
|
- hal_soc->ops->hal_reo_flush_timeout_list_status =
|
|
|
- hal_reo_flush_timeout_list_status_li;
|
|
|
- hal_soc->ops->hal_reo_desc_thres_reached_status =
|
|
|
- hal_reo_desc_thres_reached_status_li;
|
|
|
- hal_soc->ops->hal_reo_rx_update_queue_status =
|
|
|
- hal_reo_rx_update_queue_status_li;
|
|
|
-
|
|
|
hal_soc->ops->hal_rx_tlv_get_pkt_capture_flags =
|
|
|
hal_rx_tlv_get_pkt_capture_flags_li;
|
|
|
hal_soc->ops->hal_rx_desc_get_80211_hdr = hal_rx_desc_get_80211_hdr_li;
|
|
@@ -1131,4 +1591,22 @@ void hal_hw_txrx_default_ops_attach_li(struct hal_soc *hal_soc)
|
|
|
hal_soc->ops->hal_reo_qdesc_setup = hal_reo_qdesc_setup_li;
|
|
|
hal_soc->ops->hal_rx_tlv_msdu_len_set =
|
|
|
hal_rx_msdu_start_msdu_len_set_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_bw_get = hal_rx_tlv_bw_get_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_get_freq = hal_rx_tlv_get_freq_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_sgi_get = hal_rx_tlv_sgi_get_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_rate_mcs_get = hal_rx_tlv_rate_mcs_get_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_get_pkt_type = hal_rx_tlv_get_pkt_type_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_mic_err_get = hal_rx_tlv_mic_err_get_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_decrypt_err_get =
|
|
|
+ hal_rx_tlv_decrypt_err_get_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_first_mpdu_get = hal_rx_tlv_first_mpdu_get_li;
|
|
|
+ hal_soc->ops->hal_rx_tlv_get_is_decrypted =
|
|
|
+ hal_rx_tlv_get_is_decrypted_li;
|
|
|
+ hal_soc->ops->hal_rx_msdu_get_keyid = hal_rx_msdu_get_keyid_li;
|
|
|
+ hal_soc->ops->hal_rx_msdu_reo_dst_ind_get =
|
|
|
+ hal_rx_msdu_reo_dst_ind_get_li;
|
|
|
+ hal_soc->ops->hal_msdu_desc_info_set = hal_msdu_desc_info_set_li;
|
|
|
+ hal_soc->ops->hal_mpdu_desc_info_set = hal_mpdu_desc_info_set_li;
|
|
|
+ hal_soc->ops->hal_reo_status_update = hal_reo_status_update_li;
|
|
|
+ hal_soc->ops->hal_get_tlv_hdr_size = hal_get_tlv_hdr_size_li;
|
|
|
}
|