qcacmn: Framework to use pdev_id to lmac_id mapping from FW

FW assigns the pdev_id to lmac_id mapping for each platform(HK, CYP, etc).
This information is passed on to host via WMI_MAC_PHY_CAPABILITIES tlv.

Instead of hard-coding the mapping again in host, use the info sent by FW.

Change-Id: I01ad81e97a1b4aa1f0fea3951f6e8285a0f0c039
This commit is contained in:
Padma Raghunathan
2019-02-28 14:30:55 +05:30
committed by nshrivas
parent 69e39d9aa8
commit 93549e15a1
5 changed files with 53 additions and 0 deletions

View File

@@ -1880,6 +1880,33 @@ cdp_soc_set_dp_txrx_handle(ol_txrx_soc_handle soc, void *dp_handle)
dp_handle); dp_handle);
} }
/**
* cdp_soc_map_pdev_to_lmac() - Save pdev_id to lmac_id mapping
* @soc: opaque soc handle
* @pdev_handle: data path pdev handle
* @lmac_id: lmac id
*
* Return: void
*/
static inline void
cdp_soc_map_pdev_to_lmac(ol_txrx_soc_handle soc, void *pdev_handle,
uint32_t lmac_id)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->map_pdev_to_lmac)
return;
soc->ops->cmn_drv_ops->map_pdev_to_lmac((struct cdp_pdev *)pdev_handle,
lmac_id);
}
/** /**
* cdp_tx_send() - enqueue frame for transmission * cdp_tx_send() - enqueue frame for transmission
* @soc: soc opaque handle * @soc: soc opaque handle

View File

@@ -405,6 +405,9 @@ struct cdp_cmn_ops {
void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle, void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
void *dp_txrx_handle); void *dp_txrx_handle);
void (*map_pdev_to_lmac)(struct cdp_pdev *pdev_hdl,
uint32_t lmac_id);
void (*txrx_peer_reset_ast) void (*txrx_peer_reset_ast)
(ol_txrx_soc_handle soc, uint8_t *ast_macaddr, (ol_txrx_soc_handle soc, uint8_t *ast_macaddr,
uint8_t *peer_macaddr, void *vdev_hdl); uint8_t *peer_macaddr, void *vdev_hdl);

View File

@@ -9368,6 +9368,25 @@ dp_soc_set_dp_txrx_handle(struct cdp_soc *soc_handle, void *txrx_handle)
soc->external_txrx_handle = txrx_handle; soc->external_txrx_handle = txrx_handle;
} }
/**
* dp_soc_map_pdev_to_lmac() - Save pdev_id to lmac_id mapping
* @pdev_hdl: datapath pdev handle
* @lmac_id: lmac id
*
* Return: void
*/
static void
dp_soc_map_pdev_to_lmac(struct cdp_pdev *pdev_hdl, uint32_t lmac_id)
{
struct dp_pdev *pdev = (struct dp_pdev *)pdev_hdl;
struct dp_soc *soc = pdev->soc;
pdev->lmac_id = lmac_id;
wlan_cfg_set_hw_macid(soc->wlan_cfg_ctx,
pdev->pdev_id,
(lmac_id + 1));
}
/** /**
* dp_get_cfg_capabilities() - get dp capabilities * dp_get_cfg_capabilities() - get dp capabilities
* @soc_handle: datapath soc handle * @soc_handle: datapath soc handle
@@ -9895,6 +9914,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
.set_dp_txrx_handle = dp_pdev_set_dp_txrx_handle, .set_dp_txrx_handle = dp_pdev_set_dp_txrx_handle,
.get_soc_dp_txrx_handle = dp_soc_get_dp_txrx_handle, .get_soc_dp_txrx_handle = dp_soc_get_dp_txrx_handle,
.set_soc_dp_txrx_handle = dp_soc_set_dp_txrx_handle, .set_soc_dp_txrx_handle = dp_soc_set_dp_txrx_handle,
.map_pdev_to_lmac = dp_soc_map_pdev_to_lmac,
.txrx_set_ba_aging_timeout = dp_set_ba_aging_timeout, .txrx_set_ba_aging_timeout = dp_set_ba_aging_timeout,
.txrx_get_ba_aging_timeout = dp_get_ba_aging_timeout, .txrx_get_ba_aging_timeout = dp_get_ba_aging_timeout,
.tx_send = dp_tx_send, .tx_send = dp_tx_send,

View File

@@ -156,6 +156,7 @@ struct wlan_psoc_host_ppe_threshold {
* @he_ppet2G: 2G HE PPET info * @he_ppet2G: 2G HE PPET info
* @he_ppet5G: 5G HE PPET info * @he_ppet5G: 5G HE PPET info
* @chainmask_table_id: chain mask table id * @chainmask_table_id: chain mask table id
* @lmac_id: hw mac id
*/ */
struct wlan_psoc_host_mac_phy_caps { struct wlan_psoc_host_mac_phy_caps {
uint32_t hw_mode_id; uint32_t hw_mode_id;
@@ -192,6 +193,7 @@ struct wlan_psoc_host_mac_phy_caps {
struct wlan_psoc_host_ppe_threshold he_ppet2G; struct wlan_psoc_host_ppe_threshold he_ppet2G;
struct wlan_psoc_host_ppe_threshold he_ppet5G; struct wlan_psoc_host_ppe_threshold he_ppet5G;
uint32_t chainmask_table_id; uint32_t chainmask_table_id;
uint32_t lmac_id;
}; };
/** /**

View File

@@ -9374,6 +9374,7 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv(
qdf_mem_copy(&param->he_ppet5G, &mac_phy_caps->he_ppet5G, qdf_mem_copy(&param->he_ppet5G, &mac_phy_caps->he_ppet5G,
sizeof(param->he_ppet5G)); sizeof(param->he_ppet5G));
param->chainmask_table_id = mac_phy_caps->chainmask_table_id; param->chainmask_table_id = mac_phy_caps->chainmask_table_id;
param->lmac_id = mac_phy_caps->lmac_id;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }