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
このコミットが含まれているのは:
Venkata Sharath Chandra Manchala
2020-01-09 19:57:42 -08:00
committed by nshrivas
コミット d2ceaf472c
9個のファイルの変更350行の追加3行の削除

ファイルの表示

@@ -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_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) \
(_HAL_MS( \
(*_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);
}
/**
* 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 */