qcacmn: Support for 8021p pcp to tid mapping

Add HAL and DP support to configure
8021p PCP to TID mapping tables into Hardware.

Change-Id: I8a54970c8c4ef56f3c487b6e648c4411b3abde0e
这个提交包含在:
Debasis Das
2019-01-28 17:02:06 +05:30
提交者 nshrivas
父节点 c736e83257
当前提交 c39a68da37
修改 10 个文件,包含 310 行新增9 行删除

查看文件

@@ -1919,7 +1919,6 @@ static inline void hal_rx_dump_mpdu_start_tlv_generic(void *mpdustart,
mpdu_info->mpdu_qos_control_field,
mpdu_info->mpdu_ht_control_field);
}
#endif
/**
* hal_tx_desc_set_search_type - Set the search type value
@@ -1968,3 +1967,89 @@ static void hal_tx_desc_set_search_index_generic(void *desc,
{
}
#endif
/**
* hal_tx_set_pcp_tid_map_generic() - Configure default PCP to TID map table
* @soc: HAL SoC context
* @map: PCP-TID mapping table
*
* PCP are mapped to 8 TID values using TID values programmed
* in one set of mapping registers PCP_TID_MAP_<0 to 6>
* The mapping register has TID mapping for 8 PCP values
*
* Return: none
*/
static void hal_tx_set_pcp_tid_map_generic(void *hal_soc, uint8_t *map)
{
uint32_t addr, value;
struct hal_soc *soc = (struct hal_soc *)hal_soc;
addr = HWIO_TCL_R0_PCP_TID_MAP_ADDR(
SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
value = (map[0] |
(map[1] << HWIO_TCL_R0_PCP_TID_MAP_PCP_1_SHFT) |
(map[2] << HWIO_TCL_R0_PCP_TID_MAP_PCP_2_SHFT) |
(map[3] << HWIO_TCL_R0_PCP_TID_MAP_PCP_3_SHFT) |
(map[4] << HWIO_TCL_R0_PCP_TID_MAP_PCP_4_SHFT) |
(map[5] << HWIO_TCL_R0_PCP_TID_MAP_PCP_5_SHFT) |
(map[6] << HWIO_TCL_R0_PCP_TID_MAP_PCP_6_SHFT) |
(map[7] << HWIO_TCL_R0_PCP_TID_MAP_PCP_7_SHFT));
HAL_REG_WRITE(soc, addr, (value & HWIO_TCL_R0_PCP_TID_MAP_RMSK));
}
/**
* hal_tx_update_pcp_tid_generic() - Update the pcp tid map table with
* value received from user-space
* @soc: HAL SoC context
* @pcp: pcp value
* @tid : tid value
*
* Return: void
*/
static
void hal_tx_update_pcp_tid_generic(void *hal_soc, uint8_t pcp, uint8_t tid)
{
uint32_t addr, value, regval;
struct hal_soc *soc = (struct hal_soc *)hal_soc;
addr = HWIO_TCL_R0_PCP_TID_MAP_ADDR(
SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
value = (uint32_t)tid << (HAL_TX_BITS_PER_TID * pcp);
/* Read back previous PCP TID config and update
* with new config.
*/
regval = HAL_REG_READ(soc, addr);
regval &= ~(HAL_TX_TID_BITS_MASK << (HAL_TX_BITS_PER_TID * pcp));
regval |= value;
HAL_REG_WRITE(soc, addr,
(regval & HWIO_TCL_R0_PCP_TID_MAP_RMSK));
}
/**
* hal_tx_update_tidmap_prty_generic() - Update the tid map priority
* @soc: HAL SoC context
* @val: priority value
*
* Return: void
*/
static
void hal_tx_update_tidmap_prty_generic(void *hal_soc, uint8_t value)
{
uint32_t addr;
struct hal_soc *soc = (struct hal_soc *)hal_soc;
addr = HWIO_TCL_R0_TID_MAP_PRTY_ADDR(
SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
HAL_REG_WRITE(soc, addr,
(value & HWIO_TCL_R0_TID_MAP_PRTY_RMSK));
}
#endif /* _HAL_GENERIC_API_H_ */

查看文件

@@ -343,6 +343,11 @@ struct hal_hw_txrx_ops {
void *wbm_er_info);
void (*hal_rx_dump_mpdu_start_tlv)(void *mpdustart,
uint8_t dbg_level);
void (*hal_tx_set_pcp_tid_map)(void *hal_soc, uint8_t *map);
void (*hal_tx_update_pcp_tid_map)(void *hal_soc, uint8_t pcp,
uint8_t id);
void (*hal_tx_set_tidmap_prty)(void *hal_soc, uint8_t prio);
};
/**

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -85,6 +85,8 @@ do { \
#define HAL_TX_EXT_DESC_WITH_META_DATA \
(HTT_META_HEADER_LEN_BYTES + HAL_TX_EXTENSION_DESC_LEN_BYTES)
#define HAL_TX_NUM_PCP_PER_REGISTER 8
/* Length of WBM release ring without the status words */
#define HAL_TX_COMPLETION_DESC_BASE_LEN 12
@@ -990,4 +992,46 @@ static inline void hal_tx_desc_set_buf_addr(void *desc, dma_addr_t paddr,
desc_id, type);
}
/**
* hal_tx_set_pcp_tid_map_default() - Configure default PCP to TID map table
*
* @soc: HAL SoC context
* @map: PCP-TID mapping table
*
* Return: void
*/
static inline void hal_tx_set_pcp_tid_map_default(struct hal_soc *hal_soc,
uint8_t *map)
{
hal_soc->ops->hal_tx_set_pcp_tid_map(hal_soc, map);
}
/**
* hal_tx_update_pcp_tid_map() - Update PCP to TID map table
*
* @soc: HAL SoC context
* @pcp: pcp value
* @tid: tid no
*
* Return: void
*/
static inline void hal_tx_update_pcp_tid_map(struct hal_soc *hal_soc,
uint8_t pcp, uint8_t tid)
{
hal_soc->ops->hal_tx_update_pcp_tid_map(hal_soc, tid, tid);
}
/**
* hal_tx_set_tidmap_prty() - Configure TIDmap priority
*
* @soc: HAL SoC context
* @val: priority value
*
* Return: void
*/
static inline void hal_tx_set_tidmap_prty(struct hal_soc *hal_soc, uint8_t val)
{
hal_soc->ops->hal_tx_set_tidmap_prty(hal_soc, val);
}
#endif /* HAL_TX_H */

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -139,6 +139,10 @@ struct hal_hw_txrx_ops qca6018_hal_hw_txrx_ops = {
hal_rx_status_get_tlv_info_generic,
hal_rx_wbm_err_info_get_generic,
hal_rx_dump_mpdu_start_tlv_generic,
hal_tx_set_pcp_tid_map_generic,
hal_tx_update_pcp_tid_generic,
hal_tx_update_tidmap_prty_generic,
};
struct hal_hw_srng_config hw_srng_table_6018[] = {

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -144,6 +144,10 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
hal_rx_status_get_tlv_info_generic,
hal_rx_wbm_err_info_get_generic,
hal_rx_dump_mpdu_start_tlv_generic,
hal_tx_set_pcp_tid_map_generic,
hal_tx_update_pcp_tid_generic,
hal_tx_update_tidmap_prty_generic,
};
struct hal_hw_srng_config hw_srng_table_6290[] = {

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -144,6 +144,10 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
hal_rx_status_get_tlv_info_generic,
hal_rx_wbm_err_info_get_generic,
hal_rx_dump_mpdu_start_tlv_generic,
hal_tx_set_pcp_tid_map_generic,
hal_tx_update_pcp_tid_generic,
hal_tx_update_tidmap_prty_generic,
};
struct hal_hw_srng_config hw_srng_table_6390[] = {

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -140,6 +140,10 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
hal_rx_status_get_tlv_info_generic,
hal_rx_wbm_err_info_get_generic,
hal_rx_dump_mpdu_start_tlv_generic,
hal_tx_set_pcp_tid_map_generic,
hal_tx_update_pcp_tid_generic,
hal_tx_update_tidmap_prty_generic,
};
struct hal_hw_srng_config hw_srng_table_8074[] = {

查看文件

@@ -140,6 +140,10 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
hal_rx_status_get_tlv_info_generic,
hal_rx_wbm_err_info_get_generic,
hal_rx_dump_mpdu_start_tlv_generic,
hal_tx_set_pcp_tid_map_generic,
hal_tx_update_pcp_tid_generic,
hal_tx_update_tidmap_prty_generic,
};
struct hal_hw_srng_config hw_srng_table_8074v2[] = {