diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 3290e01055..508bd8ca71 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -153,7 +153,8 @@ cdp_soc_set_nss_cfg(ol_txrx_soc_handle soc, uint32_t config) static inline struct cdp_vdev * cdp_vdev_attach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, - uint8_t *vdev_mac_addr, uint8_t vdev_id, enum wlan_op_mode op_mode) + uint8_t *vdev_mac_addr, uint8_t vdev_id, + enum wlan_op_mode op_mode, enum wlan_op_subtype subtype) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -167,7 +168,7 @@ cdp_vdev_attach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, return NULL; return soc->ops->cmn_drv_ops->txrx_vdev_attach(pdev, - vdev_mac_addr, vdev_id, op_mode); + vdev_mac_addr, vdev_id, op_mode, subtype); } #ifdef DP_FLOW_CTL diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index c3dca28c29..8050ba9f13 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -561,6 +561,23 @@ enum wlan_op_mode { wlan_op_mode_ndi, }; +/** + * enum wlan_op_subtype - Virtual device subtype + * @wlan_op_subtype_none: Subtype not applicable + * @wlan_op_subtype_p2p_device: P2P device + * @wlan_op_subtye_p2p_cli: P2P Client + * @wlan_op_subtype_p2p_go: P2P GO + * + * This enum lists the subtypes of a particular virtual + * device. + */ +enum wlan_op_subtype { + wlan_op_subtype_none, + wlan_op_subtype_p2p_device, + wlan_op_subtype_p2p_cli, + wlan_op_subtype_p2p_go, +}; + /** * connectivity_stats_pkt_status - data pkt type * @PKT_TYPE_REQ: Request packet diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 4bd1f15db1..a2d096b1ff 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -69,7 +69,8 @@ struct cdp_cmn_ops { struct cdp_vdev *(*txrx_vdev_attach) (struct cdp_pdev *pdev, uint8_t *vdev_mac_addr, - uint8_t vdev_id, enum wlan_op_mode op_mode); + uint8_t vdev_id, enum wlan_op_mode op_mode, + enum wlan_op_subtype subtype); void (*txrx_vdev_detach) (struct cdp_vdev *vdev, ol_txrx_vdev_delete_cb callback, diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 31623af33b..ff2a4fbdaf 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -4626,11 +4626,13 @@ static void dp_soc_set_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc, int config) * @vdev_mac_addr: MAC address of the virtual interface * @vdev_id: VDEV Id * @wlan_op_mode: VDEV operating mode +* @subtype: VDEV operating subtype * * Return: DP VDEV handle on success, NULL on failure */ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev, - uint8_t *vdev_mac_addr, uint8_t vdev_id, enum wlan_op_mode op_mode) + uint8_t *vdev_mac_addr, uint8_t vdev_id, enum wlan_op_mode op_mode, + enum wlan_op_subtype subtype) { struct dp_pdev *pdev = (struct dp_pdev *)txrx_pdev; struct dp_soc *soc = pdev->soc; @@ -4645,6 +4647,7 @@ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev, vdev->pdev = pdev; vdev->vdev_id = vdev_id; vdev->opmode = op_mode; + vdev->subtype = subtype; vdev->osdev = soc->osdev; vdev->osif_rx = NULL; @@ -5264,6 +5267,23 @@ void dp_vdev_get_default_reo_hash(struct dp_vdev *vdev, } #ifdef IPA_OFFLOAD +/** + * dp_is_vdev_subtype_p2p() - Check if the subtype for vdev is P2P + * @vdev: Virtual device + * + * Return: true if the vdev is of subtype P2P + * false if the vdev is of any other subtype + */ +static inline bool dp_is_vdev_subtype_p2p(struct dp_vdev *vdev) +{ + if (vdev->subtype == wlan_op_subtype_p2p_device || + vdev->subtype == wlan_op_subtype_p2p_cli || + vdev->subtype == wlan_op_subtype_p2p_go) + return true; + + return false; +} + /* * dp_peer_setup_get_reo_hash() - get reo dest ring and hash values for a peer * @vdev: Datapath VDEV handle @@ -5286,6 +5306,12 @@ static void dp_peer_setup_get_reo_hash(struct dp_vdev *vdev, dp_vdev_get_default_reo_hash(vdev, reo_dest, hash_based); + /* For P2P-GO interfaces we do not need to change the REO + * configuration even if IPA config is enabled + */ + if (dp_is_vdev_subtype_p2p(vdev)) + return; + /* * If IPA is enabled, disable hash-based flow steering and set * reo_dest_ring_4 as the REO ring to receive packets on. diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index a9b4b91673..e4187369d3 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1771,6 +1771,9 @@ struct dp_vdev { /* VDEV operating mode */ enum wlan_op_mode opmode; + /* VDEV subtype */ + enum wlan_op_subtype subtype; + /* Tx encapsulation type for this VAP */ enum htt_cmn_pkt_type tx_encap_type; /* Rx Decapsulation type for this VAP */ diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_utils_api.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_utils_api.h index ea774c750e..296fba7b87 100644 --- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_utils_api.h +++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_utils_api.h @@ -39,6 +39,15 @@ enum wlan_op_mode wlan_util_vdev_get_cdp_txrx_opmode(struct wlan_objmgr_vdev *vdev); +/** + * wlan_util_vdev_get_cdp_txrx_subtype - get cdp txrx subtype from qdf mode + * @vdev: pointer to vdev object + * + * Return: wlan_opmode + */ +enum wlan_op_subtype +wlan_util_vdev_get_cdp_txrx_subtype(struct wlan_objmgr_vdev *vdev); + /** * wlan_util_vdev_mlme_set_ratemask_config) – common MLME API to set * ratemask configuration and send it to FW diff --git a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c index e03d7d6056..bd6bc25062 100644 --- a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c +++ b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c @@ -60,6 +60,7 @@ QDF_STATUS tgt_vdev_mgr_create_send( struct cdp_pdev *pdev_txrx_handle; struct cdp_vdev *vdev_txrx_handle; enum wlan_op_mode cdp_txrx_opmode; + enum wlan_op_subtype cdp_txrx_subtype; uint32_t vdev_id; uint8_t *vdev_addr; struct vdev_response_timer *vdev_rsp; @@ -88,6 +89,7 @@ QDF_STATUS tgt_vdev_mgr_create_send( } cdp_txrx_opmode = wlan_util_vdev_get_cdp_txrx_opmode(vdev); + cdp_txrx_subtype = wlan_util_vdev_get_cdp_txrx_subtype(vdev); vdev_addr = wlan_vdev_mlme_get_macaddr(vdev); psoc = wlan_vdev_get_psoc(vdev); pdev = wlan_vdev_get_pdev(vdev); @@ -99,7 +101,8 @@ QDF_STATUS tgt_vdev_mgr_create_send( vdev_txrx_handle = cdp_vdev_attach(soc_txrx_handle, pdev_txrx_handle, vdev_addr, vdev_id, - cdp_txrx_opmode); + cdp_txrx_opmode, + cdp_txrx_subtype); if (!vdev_txrx_handle) return QDF_STATUS_E_FAILURE; diff --git a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_api.c b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_api.c index 05ea2fc9ad..9d08836bd0 100644 --- a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_api.c +++ b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_api.c @@ -45,6 +45,30 @@ static QDF_STATUS vdev_mgr_config_ratemask_update( return QDF_STATUS_SUCCESS; } +enum wlan_op_subtype +wlan_util_vdev_get_cdp_txrx_subtype(struct wlan_objmgr_vdev *vdev) +{ + enum QDF_OPMODE qdf_opmode; + enum wlan_op_subtype cdp_txrx_subtype; + + qdf_opmode = wlan_vdev_mlme_get_opmode(vdev); + switch (qdf_opmode) { + case QDF_P2P_DEVICE_MODE: + cdp_txrx_subtype = wlan_op_subtype_p2p_device; + break; + case QDF_P2P_CLIENT_MODE: + cdp_txrx_subtype = wlan_op_subtype_p2p_cli; + break; + case QDF_P2P_GO_MODE: + cdp_txrx_subtype = wlan_op_subtype_p2p_go; + break; + default: + cdp_txrx_subtype = wlan_op_subtype_none; + }; + + return cdp_txrx_subtype; +} + enum wlan_op_mode wlan_util_vdev_get_cdp_txrx_opmode(struct wlan_objmgr_vdev *vdev) {