qcacmn: Add hal macros for fisa assist

Add 6490 chip specific HAL macros to extract FISA assist from TLV header.

Change-Id: I269431b2708f07b10e7e02715d8940fea27a66f6
CRs-Fixed: 2599917
This commit is contained in:
Venkata Sharath Chandra Manchala
2020-01-09 19:57:42 -08:00
committed by nshrivas
parent 44aeb7256a
commit d2ceaf472c
9 changed files with 350 additions and 3 deletions

View File

@@ -464,6 +464,12 @@ struct hal_hw_txrx_ops {
void (*hal_rx_get_rtt_info)(void *rx_tlv, void *ppdu_info_handle); void (*hal_rx_get_rtt_info)(void *rx_tlv, void *ppdu_info_handle);
void (*hal_rx_msdu_packet_metadata_get)(uint8_t *buf, void (*hal_rx_msdu_packet_metadata_get)(uint8_t *buf,
void *msdu_pkt_metadata); void *msdu_pkt_metadata);
uint16_t (*hal_rx_get_fisa_cumulative_l4_checksum)(uint8_t *buf);
uint16_t (*hal_rx_get_fisa_cumulative_ip_length)(uint8_t *buf);
bool (*hal_rx_get_udp_proto)(uint8_t *buf);
bool (*hal_rx_get_fisa_flow_agg_continuation)(uint8_t *buf);
uint8_t (*hal_rx_get_fisa_flow_agg_count)(uint8_t *buf);
bool (*hal_rx_get_fisa_timeout)(uint8_t *buf);
}; };
/** /**

View File

@@ -995,6 +995,14 @@ hal_rx_mpdu_peer_meta_data_set(uint8_t *buf, uint32_t peer_mdata)
RX_MSDU_START_2_TCP_PROTO_MASK, \ RX_MSDU_START_2_TCP_PROTO_MASK, \
RX_MSDU_START_2_TCP_PROTO_LSB)) RX_MSDU_START_2_TCP_PROTO_LSB))
#define HAL_RX_TLV_GET_UDP_PROTO(buf) \
(_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
msdu_start_tlv.rx_msdu_start), \
RX_MSDU_START_2_UDP_PROTO_OFFSET)), \
RX_MSDU_START_2_UDP_PROTO_MASK, \
RX_MSDU_START_2_UDP_PROTO_LSB))
#define HAL_RX_TLV_GET_IPV6(buf) \ #define HAL_RX_TLV_GET_IPV6(buf) \
(_HAL_MS( \ (_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\ (*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
@@ -3461,4 +3469,151 @@ hal_rx_msdu_metadata_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf,
return hal_soc->ops->hal_rx_msdu_packet_metadata_get(buf, msdu_md); return hal_soc->ops->hal_rx_msdu_packet_metadata_get(buf, msdu_md);
} }
/**
* hal_rx_get_fisa_cumulative_l4_checksum: API to get cumulative_l4_checksum
* from rx_msdu_end TLV
* @buf: pointer to the start of RX PKT TLV headers
*
* Return: cumulative_l4_checksum
*/
static inline uint16_t
hal_rx_get_fisa_cumulative_l4_checksum(hal_soc_handle_t hal_soc_hdl,
uint8_t *buf)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
if (!hal_soc || !hal_soc->ops) {
hal_err("hal handle is NULL");
QDF_BUG(0);
return 0;
}
if (!hal_soc->ops->hal_rx_get_fisa_cumulative_l4_checksum)
return 0;
return hal_soc->ops->hal_rx_get_fisa_cumulative_l4_checksum(buf);
}
/**
* hal_rx_get_fisa_cumulative_ip_length: API to get cumulative_ip_length
* from rx_msdu_end TLV
* @buf: pointer to the start of RX PKT TLV headers
*
* Return: cumulative_ip_length
*/
static inline uint16_t
hal_rx_get_fisa_cumulative_ip_length(hal_soc_handle_t hal_soc_hdl,
uint8_t *buf)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
if (!hal_soc || !hal_soc->ops) {
hal_err("hal handle is NULL");
QDF_BUG(0);
return 0;
}
if (hal_soc->ops->hal_rx_get_fisa_cumulative_ip_length)
return hal_soc->ops->hal_rx_get_fisa_cumulative_ip_length(buf);
return 0;
}
/**
* hal_rx_get_udp_proto: API to get UDP proto field
* from rx_msdu_start TLV
* @buf: pointer to the start of RX PKT TLV headers
*
* Return: UDP proto field value
*/
static inline bool
hal_rx_get_udp_proto(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
if (!hal_soc || !hal_soc->ops) {
hal_err("hal handle is NULL");
QDF_BUG(0);
return 0;
}
if (hal_soc->ops->hal_rx_get_udp_proto)
return hal_soc->ops->hal_rx_get_udp_proto(buf);
return 0;
}
/**
* hal_rx_get_fisa_flow_agg_continuation: API to get fisa flow_agg_continuation
* from rx_msdu_end TLV
* @buf: pointer to the start of RX PKT TLV headers
*
* Return: flow_agg_continuation bit field value
*/
static inline bool
hal_rx_get_fisa_flow_agg_continuation(hal_soc_handle_t hal_soc_hdl,
uint8_t *buf)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
if (!hal_soc || !hal_soc->ops) {
hal_err("hal handle is NULL");
QDF_BUG(0);
return 0;
}
if (hal_soc->ops->hal_rx_get_fisa_flow_agg_continuation)
return hal_soc->ops->hal_rx_get_fisa_flow_agg_continuation(buf);
return 0;
}
/**
* hal_rx_get_fisa_flow_agg_count: API to get fisa flow_agg count from
* rx_msdu_end TLV
* @buf: pointer to the start of RX PKT TLV headers
*
* Return: flow_agg count value
*/
static inline uint8_t
hal_rx_get_fisa_flow_agg_count(hal_soc_handle_t hal_soc_hdl,
uint8_t *buf)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
if (!hal_soc || !hal_soc->ops) {
hal_err("hal handle is NULL");
QDF_BUG(0);
return 0;
}
if (hal_soc->ops->hal_rx_get_fisa_flow_agg_count)
return hal_soc->ops->hal_rx_get_fisa_flow_agg_count(buf);
return 0;
}
/**
* hal_rx_get_fisa_timeout: API to get fisa time out from rx_msdu_end TLV
* @buf: pointer to the start of RX PKT TLV headers
*
* Return: fisa flow_agg timeout bit value
*/
static inline bool
hal_rx_get_fisa_timeout(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
if (!hal_soc || !hal_soc->ops) {
hal_err("hal handle is NULL");
QDF_BUG(0);
return 0;
}
if (hal_soc->ops->hal_rx_get_fisa_timeout)
return hal_soc->ops->hal_rx_get_fisa_timeout(buf);
return 0;
}
#endif /* _HAL_RX_H */ #endif /* _HAL_RX_H */

View File

@@ -1081,6 +1081,12 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
NULL, NULL,
/* rx - msdu end fast path info fields */ /* rx - msdu end fast path info fields */
hal_rx_msdu_packet_metadata_get_generic, hal_rx_msdu_packet_metadata_get_generic,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}; };
struct hal_hw_srng_config hw_srng_table_6290[] = { struct hal_hw_srng_config hw_srng_table_6290[] = {

View File

@@ -1077,6 +1077,12 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
NULL, NULL,
/* rx - msdu end fast path info fields */ /* rx - msdu end fast path info fields */
hal_rx_msdu_packet_metadata_get_generic, hal_rx_msdu_packet_metadata_get_generic,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}; };
struct hal_hw_srng_config hw_srng_table_6390[] = { struct hal_hw_srng_config hw_srng_table_6390[] = {

View File

@@ -316,7 +316,7 @@ static void hal_rx_dump_msdu_end_tlv_6490(void *msduend,
struct rx_msdu_end *msdu_end = (struct rx_msdu_end *)msduend; struct rx_msdu_end *msdu_end = (struct rx_msdu_end *)msduend;
QDF_TRACE(QDF_MODULE_ID_DP, dbg_level, QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
"rx_msdu_end tlv (1/2) - " "rx_msdu_end tlv (1/3) - "
"rxpcu_mpdu_filter_in_category: %x " "rxpcu_mpdu_filter_in_category: %x "
"sw_frame_group_id: %x " "sw_frame_group_id: %x "
"phy_ppdu_id: %x " "phy_ppdu_id: %x "
@@ -363,7 +363,7 @@ static void hal_rx_dump_msdu_end_tlv_6490(void *msduend,
msdu_end->amsdu_parser_error); msdu_end->amsdu_parser_error);
QDF_TRACE(QDF_MODULE_ID_DP, dbg_level, QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
"rx_msdu_end tlv (2/2)- " "rx_msdu_end tlv (2/3)- "
"sa_is_valid: %x " "sa_is_valid: %x "
"da_is_valid: %x " "da_is_valid: %x "
"da_is_mcbc: %x " "da_is_mcbc: %x "
@@ -412,6 +412,18 @@ static void hal_rx_dump_msdu_end_tlv_6490(void *msduend,
msdu_end->fse_metadata, msdu_end->fse_metadata,
msdu_end->cce_metadata, msdu_end->cce_metadata,
msdu_end->sa_sw_peer_id); msdu_end->sa_sw_peer_id);
QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
"rx_msdu_end tlv (3/3)"
"aggregation_count %x "
"flow_aggregation_continuation %x "
"fisa_timeout %x "
"cumulative_l4_checksum %x "
"cumulative_ip_length %x",
msdu_end->aggregation_count,
msdu_end->flow_aggregation_continuation,
msdu_end->fisa_timeout,
msdu_end->cumulative_l4_checksum,
msdu_end->cumulative_ip_length);
} }
/* /*
@@ -1258,6 +1270,30 @@ hal_rx_msdu_cce_metadata_get_6490(uint8_t *buf)
return HAL_RX_MSDU_END_CCE_METADATA_GET(msdu_end); return HAL_RX_MSDU_END_CCE_METADATA_GET(msdu_end);
} }
/**
* hal_rx_msdu_get_flow_params_6490: API to get flow index, flow index invalid
* and flow index timeout from rx_msdu_end TLV
* @buf: pointer to the start of RX PKT TLV headers
* @flow_invalid: pointer to return value of flow_idx_valid
* @flow_timeout: pointer to return value of flow_idx_timeout
* @flow_index: pointer to return value of flow_idx
*
* Return: none
*/
static inline void
hal_rx_msdu_get_flow_params_6490(uint8_t *buf,
bool *flow_invalid,
bool *flow_timeout,
uint32_t *flow_index)
{
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;
*flow_invalid = HAL_RX_MSDU_END_FLOW_IDX_INVALID_GET(msdu_end);
*flow_timeout = HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
*flow_index = HAL_RX_MSDU_END_FLOW_IDX_GET(msdu_end);
}
/** /**
* hal_rx_tlv_get_tcp_chksum_6490() - API to get tcp checksum * hal_rx_tlv_get_tcp_chksum_6490() - API to get tcp checksum
* @buf: rx_tlv_hdr * @buf: rx_tlv_hdr
@@ -1298,6 +1334,81 @@ static inline qdf_iomem_t hal_get_window_address_6490(struct hal_soc *hal_soc,
return addr; return addr;
} }
/**
* hal_rx_get_fisa_cumulative_l4_checksum_6490() - Retrieve cumulative
* checksum
* @buf: buffer pointer
*
* Return: cumulative checksum
*/
static inline
uint16_t hal_rx_get_fisa_cumulative_l4_checksum_6490(uint8_t *buf)
{
return HAL_RX_TLV_GET_FISA_CUMULATIVE_L4_CHECKSUM(buf);
}
/**
* hal_rx_get_fisa_cumulative_ip_length_6490() - Retrieve cumulative
* ip length
* @buf: buffer pointer
*
* Return: cumulative length
*/
static inline
uint16_t hal_rx_get_fisa_cumulative_ip_length_6490(uint8_t *buf)
{
return HAL_RX_TLV_GET_FISA_CUMULATIVE_IP_LENGTH(buf);
}
/**
* hal_rx_get_udp_proto_6490() - Retrieve udp proto value
* @buf: buffer
*
* Return: udp proto bit
*/
static inline
bool hal_rx_get_udp_proto_6490(uint8_t *buf)
{
return HAL_RX_TLV_GET_UDP_PROTO(buf);
}
/**
* hal_rx_get_flow_agg_continuation_6490() - retrieve flow agg
* continuation
* @buf: buffer
*
* Return: flow agg
*/
static inline
bool hal_rx_get_flow_agg_continuation_6490(uint8_t *buf)
{
return HAL_RX_TLV_GET_FLOW_AGGR_CONT(buf);
}
/**
* hal_rx_get_flow_agg_count_6490()- Retrieve flow agg count
* @buf: buffer
*
* Return: flow agg count
*/
static inline
uint8_t hal_rx_get_flow_agg_count_6490(uint8_t *buf)
{
return HAL_RX_TLV_GET_FLOW_AGGR_COUNT(buf);
}
/**
* hal_rx_get_fisa_timeout_6490() - Retrieve fisa timeout
* @buf: buffer
*
* Return: fisa timeout
*/
static inline
bool hal_rx_get_fisa_timeout_6490(uint8_t *buf)
{
return HAL_RX_TLV_GET_FISA_TIMEOUT(buf);
}
struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = { struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
/* init and setup */ /* init and setup */
hal_srng_dst_hw_init_generic, hal_srng_dst_hw_init_generic,
@@ -1383,13 +1494,19 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
hal_rx_msdu_flow_idx_timeout_6490, hal_rx_msdu_flow_idx_timeout_6490,
hal_rx_msdu_fse_metadata_get_6490, hal_rx_msdu_fse_metadata_get_6490,
hal_rx_msdu_cce_metadata_get_6490, hal_rx_msdu_cce_metadata_get_6490,
NULL, hal_rx_msdu_get_flow_params_6490,
hal_rx_tlv_get_tcp_chksum_6490, hal_rx_tlv_get_tcp_chksum_6490,
hal_rx_get_rx_sequence_6490, hal_rx_get_rx_sequence_6490,
NULL, NULL,
NULL, NULL,
/* rx - msdu end fast path info fields */ /* rx - msdu end fast path info fields */
hal_rx_msdu_packet_metadata_get_generic, hal_rx_msdu_packet_metadata_get_generic,
hal_rx_get_fisa_cumulative_l4_checksum_6490,
hal_rx_get_fisa_cumulative_ip_length_6490,
hal_rx_get_udp_proto_6490,
hal_rx_get_flow_agg_continuation_6490,
hal_rx_get_flow_agg_count_6490,
hal_rx_get_fisa_timeout_6490,
}; };
struct hal_hw_srng_config hw_srng_table_6490[] = { struct hal_hw_srng_config hw_srng_table_6490[] = {

View File

@@ -363,4 +363,43 @@ RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
RX_MSDU_END_11_DA_IDX_OR_SW_PEER_ID_MASK, \ RX_MSDU_END_11_DA_IDX_OR_SW_PEER_ID_MASK, \
RX_MSDU_END_11_DA_IDX_OR_SW_PEER_ID_LSB)) RX_MSDU_END_11_DA_IDX_OR_SW_PEER_ID_LSB))
#define HAL_RX_TLV_GET_FLOW_AGGR_CONT(buf) \
(_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
msdu_end_tlv.rx_msdu_end), \
RX_MSDU_END_17_FLOW_AGGREGATION_CONTINUATION_OFFSET)), \
RX_MSDU_END_17_FLOW_AGGREGATION_CONTINUATION_MASK, \
RX_MSDU_END_17_FLOW_AGGREGATION_CONTINUATION_LSB))
#define HAL_RX_TLV_GET_FLOW_AGGR_COUNT(buf) \
(_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
msdu_end_tlv.rx_msdu_end), \
RX_MSDU_END_17_AGGREGATION_COUNT_OFFSET)), \
RX_MSDU_END_17_AGGREGATION_COUNT_MASK, \
RX_MSDU_END_17_AGGREGATION_COUNT_LSB))
#define HAL_RX_TLV_GET_FISA_TIMEOUT(buf) \
(_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
msdu_end_tlv.rx_msdu_end), \
RX_MSDU_END_17_FISA_TIMEOUT_OFFSET)), \
RX_MSDU_END_17_FISA_TIMEOUT_MASK, \
RX_MSDU_END_17_FISA_TIMEOUT_LSB))
#define HAL_RX_TLV_GET_FISA_CUMULATIVE_L4_CHECKSUM(buf) \
(_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
msdu_end_tlv.rx_msdu_end), \
RX_MSDU_END_18_CUMULATIVE_L4_CHECKSUM_OFFSET)), \
RX_MSDU_END_18_CUMULATIVE_L4_CHECKSUM_MASK, \
RX_MSDU_END_18_CUMULATIVE_L4_CHECKSUM_LSB))
#define HAL_RX_TLV_GET_FISA_CUMULATIVE_IP_LENGTH(buf) \
(_HAL_MS( \
(*_OFFSET_TO_WORD_PTR(&(((struct rx_pkt_tlvs *)(buf))->\
msdu_end_tlv.rx_msdu_end), \
RX_MSDU_END_18_CUMULATIVE_IP_LENGTH_OFFSET)), \
RX_MSDU_END_18_CUMULATIVE_IP_LENGTH_MASK, \
RX_MSDU_END_18_CUMULATIVE_IP_LENGTH_LSB))
#endif #endif

View File

@@ -1077,6 +1077,12 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
NULL, NULL,
/* rx - msdu fast path info fields */ /* rx - msdu fast path info fields */
hal_rx_msdu_packet_metadata_get_generic, hal_rx_msdu_packet_metadata_get_generic,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}; };
struct hal_hw_srng_config hw_srng_table_8074[] = { struct hal_hw_srng_config hw_srng_table_8074[] = {

View File

@@ -1082,6 +1082,12 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
#endif #endif
/* rx - msdu fast path info fields */ /* rx - msdu fast path info fields */
hal_rx_msdu_packet_metadata_get_generic, hal_rx_msdu_packet_metadata_get_generic,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}; };
struct hal_hw_srng_config hw_srng_table_8074v2[] = { struct hal_hw_srng_config hw_srng_table_8074v2[] = {

View File

@@ -1460,6 +1460,12 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
NULL, NULL,
/* rx - msdu fast path info fields */ /* rx - msdu fast path info fields */
hal_rx_msdu_packet_metadata_get_9000, hal_rx_msdu_packet_metadata_get_9000,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}; };
struct hal_hw_srng_config hw_srng_table_9000[] = { struct hal_hw_srng_config hw_srng_table_9000[] = {