diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 20a5a5c4a2..80e62e5ab5 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -403,12 +403,14 @@ enum cdp_peer_type { * @mld_peer_mac: mld peer mac address pointer * @is_assoc_link: set true for first MLO link peer association * @is_primary_link: for MCC, the first link will always be primary link, - for WIN, other link might be primary link. + * for WIN, other link might be primary link. + * @primary_umac_id: primary umac_id */ struct cdp_peer_setup_info { uint8_t *mld_peer_mac; uint8_t is_assoc_link:1, is_primary_link:1; + uint8_t primary_umac_id; }; /** diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index a42bfbef56..0c4a8fb589 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1094,7 +1094,8 @@ struct ol_if_ops { (*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, uint8_t pdev_id, uint8_t *peer_macaddr, uint8_t vdev_id, - bool hash_based, uint8_t ring_num); + bool hash_based, uint8_t ring_num, + uint8_t lmac_peer_id_msb); QDF_STATUS (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, uint8_t pdev_id, diff --git a/dp/wifi3.0/be/dp_be.c b/dp/wifi3.0/be/dp_be.c index 0754aef7eb..499757849a 100644 --- a/dp/wifi3.0/be/dp_be.c +++ b/dp/wifi3.0/be/dp_be.c @@ -220,6 +220,7 @@ dp_hw_cookie_conversion_attach(struct dp_soc_be *be_soc, uint32_t num_spt_pages, i = 0; struct dp_spt_page_desc *spt_desc; struct qdf_mem_dma_page_t *dma_page; + uint8_t chip_id; /* estimate how many SPT DDR pages needed */ num_spt_pages = num_descs / DP_CC_SPT_PAGE_MAX_ENTRIES; @@ -241,7 +242,8 @@ dp_hw_cookie_conversion_attach(struct dp_soc_be *be_soc, goto fail_0; } - cc_ctx->cmem_offset = dp_desc_pool_get_cmem_base(0, desc_pool_id, + chip_id = dp_mlo_get_chip_id(soc); + cc_ctx->cmem_offset = dp_desc_pool_get_cmem_base(chip_id, desc_pool_id, desc_type); /* initial page desc */ @@ -1236,6 +1238,82 @@ static void dp_tx_implicit_rbm_set_be(struct dp_soc *soc, } #endif +#ifdef WLAN_MLO_MULTI_CHIP +static void dp_peer_get_reo_hash_be(struct dp_vdev *vdev, + struct cdp_peer_setup_info *setup_info, + enum cdp_host_reo_dest_ring *reo_dest, + bool *hash_based, + uint8_t *lmac_peer_id_msb) +{ + struct dp_soc *soc = vdev->pdev->soc; + struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc); + uint8_t default_rx_ring_id; + uint8_t chip_id; + + if (!be_soc->mlo_enabled) + return dp_vdev_get_default_reo_hash(vdev, reo_dest, + hash_based); + + /* Not a ML link peer configure local chip*/ + if (!setup_info) + chip_id = be_soc->mlo_chip_id; + else + chip_id = setup_info->primary_umac_id; + + default_rx_ring_id = + wlan_cfg_mlo_default_rx_ring_get_by_chip_id(soc->wlan_cfg_ctx, + chip_id); + *reo_dest = hal_reo_ring_remap_value_get_be(default_rx_ring_id); + *hash_based = wlan_cfg_is_rx_hash_enabled(soc->wlan_cfg_ctx); + *lmac_peer_id_msb = + wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(soc->wlan_cfg_ctx, + chip_id); +} + +static bool dp_reo_remap_config_be(struct dp_soc *soc, + uint32_t *remap0, + uint32_t *remap1, + uint32_t *remap2) +{ + uint8_t rx_ring_mask; + struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc); + + if (!be_soc->mlo_enabled) + return dp_reo_remap_config(soc, remap0, remap1, remap2); + + rx_ring_mask = + wlan_cfg_mlo_rx_ring_map_get_by_chip_id(soc->wlan_cfg_ctx, 0); + *remap0 = hal_reo_ix_remap_value_get_be(soc->hal_soc, rx_ring_mask); + + rx_ring_mask = + wlan_cfg_mlo_rx_ring_map_get_by_chip_id(soc->wlan_cfg_ctx, 1); + *remap1 = hal_reo_ix_remap_value_get_be(soc->hal_soc, rx_ring_mask); + + rx_ring_mask = + wlan_cfg_mlo_rx_ring_map_get_by_chip_id(soc->wlan_cfg_ctx, 2); + *remap2 = hal_reo_ix_remap_value_get_be(soc->hal_soc, rx_ring_mask); + + return true; +} +#else +static void dp_peer_get_reo_hash_be(struct dp_vdev *vdev, + struct cdp_peer_setup_info *setup_info, + enum cdp_host_reo_dest_ring *reo_dest, + bool *hash_based, + uint8_t *lmac_peer_id_msb) +{ + dp_vdev_get_default_reo_hash(vdev, reo_dest, hash_based); +} + +static bool dp_reo_remap_config_be(struct dp_soc *soc, + uint32_t *remap0, + uint32_t *remap1, + uint32_t *remap2) +{ + return dp_reo_remap_config(soc, remap0, remap1, remap2); +} +#endif + void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops) { #ifndef QCA_HOST_MODE_WIFI_DISABLED @@ -1271,6 +1349,8 @@ void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops) dp_rx_peer_metadata_peer_id_get_be; arch_ops->soc_cfg_attach = dp_soc_cfg_attach_be; arch_ops->tx_implicit_rbm_set = dp_tx_implicit_rbm_set_be; + arch_ops->peer_get_reo_hash = dp_peer_get_reo_hash_be; + arch_ops->reo_remap_config = dp_reo_remap_config_be; #ifdef WLAN_FEATURE_11BE_MLO arch_ops->mlo_peer_find_hash_detach = diff --git a/dp/wifi3.0/be/dp_be.h b/dp/wifi3.0/be/dp_be.h index ea80409860..a3183c0ce0 100644 --- a/dp/wifi3.0/be/dp_be.h +++ b/dp/wifi3.0/be/dp_be.h @@ -23,6 +23,8 @@ #include #ifdef WLAN_MLO_MULTI_CHIP #include "mlo/dp_mlo.h" +#else +#include #endif /* maximum number of entries in one page of secondary page table */ diff --git a/dp/wifi3.0/be/dp_be_rx.c b/dp/wifi3.0/be/dp_be_rx.c index 68574a07b6..607f112bb9 100644 --- a/dp/wifi3.0/be/dp_be_rx.c +++ b/dp/wifi3.0/be/dp_be_rx.c @@ -176,6 +176,7 @@ uint32_t dp_rx_process_be(struct dp_intr *int_ctx, uint8_t pkt_capture_offload = 0; struct dp_srng *rx_ring = &soc->reo_dest_ring[reo_ring_num]; int max_reap_limit, ring_near_full; + struct dp_soc *replenish_soc; DP_HIST_INIT(); @@ -468,6 +469,7 @@ more_data: done: dp_rx_srng_access_end(int_ctx, soc, hal_ring_hdl); + replenish_soc = dp_rx_replensih_soc_get(soc, reo_ring_num); for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) { /* * continue with next mac_id if no pkts were reaped @@ -476,11 +478,11 @@ done: if (!rx_bufs_reaped[mac_id]) continue; - dp_rxdma_srng = &soc->rx_refill_buf_ring[mac_id]; + dp_rxdma_srng = &replenish_soc->rx_refill_buf_ring[mac_id]; - rx_desc_pool = &soc->rx_desc_buf[mac_id]; + rx_desc_pool = &replenish_soc->rx_desc_buf[mac_id]; - dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng, + dp_rx_buffers_replenish(replenish_soc, mac_id, dp_rxdma_srng, rx_desc_pool, rx_bufs_reaped[mac_id], &head[mac_id], &tail[mac_id]); } diff --git a/dp/wifi3.0/be/dp_be_rx.h b/dp/wifi3.0/be/dp_be_rx.h index f977a1aabe..9c06f981e1 100644 --- a/dp/wifi3.0/be/dp_be_rx.h +++ b/dp/wifi3.0/be/dp_be_rx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -186,4 +187,15 @@ uint32_t dp_rx_nf_process(struct dp_intr *int_ctx, return 0; } #endif /*WLAN_FEATURE_NEAR_FULL_IRQ */ + +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +struct dp_soc * +dp_rx_replensih_soc_get(struct dp_soc *soc, uint8_t reo_ring_num); +#else +static inline struct dp_soc * +dp_rx_replensih_soc_get(struct dp_soc *soc, uint8_t reo_ring_num) +{ + return soc; +} +#endif #endif diff --git a/dp/wifi3.0/be/mlo/dp_mlo.c b/dp/wifi3.0/be/mlo/dp_mlo.c index 63a4d36759..5ec2200445 100644 --- a/dp/wifi3.0/be/mlo/dp_mlo.c +++ b/dp/wifi3.0/be/mlo/dp_mlo.c @@ -289,3 +289,26 @@ dp_link_peer_hash_find_by_chip_id(struct dp_soc *soc, } qdf_export_symbol(dp_link_peer_hash_find_by_chip_id); + +struct dp_soc * +dp_rx_replensih_soc_get(struct dp_soc *soc, uint8_t reo_ring_num) +{ + struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc); + struct dp_mlo_ctxt *mlo_ctxt = be_soc->ml_ctxt; + uint8_t chip_id; + uint8_t rx_ring_mask; + + if (!be_soc->mlo_enabled || !mlo_ctxt) + return soc; + + for (chip_id = 0; chip_id < WLAN_MAX_MLO_CHIPS; chip_id++) { + rx_ring_mask = + wlan_cfg_mlo_rx_ring_map_get_by_chip_id + (soc->wlan_cfg_ctx, chip_id); + + if (rx_ring_mask & (1 << reo_ring_num)) + return dp_mlo_get_soc_ref_by_chip_id(mlo_ctxt, chip_id); + } + + return soc; +} diff --git a/dp/wifi3.0/be/mlo/dp_mlo.h b/dp/wifi3.0/be/mlo/dp_mlo.h index db3c0059af..b88544d9a2 100644 --- a/dp/wifi3.0/be/mlo/dp_mlo.h +++ b/dp/wifi3.0/be/mlo/dp_mlo.h @@ -20,7 +20,7 @@ #include /* Max number of chips that can participate in MLO */ -#define DP_MAX_MLO_CHIPS 3 +#define DP_MAX_MLO_CHIPS WLAN_MAX_MLO_CHIPS /* Max number of peers supported */ #define DP_MAX_MLO_PEER 512 diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c index 7b3f6344ff..259a0b889d 100644 --- a/dp/wifi3.0/dp_ipa.c +++ b/dp/wifi3.0/dp_ipa.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 above @@ -1762,6 +1763,7 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id); uint8_t ix0_map[8]; uint32_t ix0; + uint32_t ix1; uint32_t ix2; uint32_t ix3; @@ -1790,7 +1792,7 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) ix0_map); if (wlan_cfg_is_rx_hash_enabled(soc->wlan_cfg_ctx)) { - dp_reo_remap_config(soc, &ix2, &ix3); + dp_reo_remap_config(soc, &ix1, &ix2, &ix3); hal_reo_read_write_ctrl_ix(soc->hal_soc, false, &ix0, NULL, &ix2, &ix3); diff --git a/dp/wifi3.0/dp_ipa.h b/dp/wifi3.0/dp_ipa.h index 7935ca3963..702db254bf 100644 --- a/dp/wifi3.0/dp_ipa.h +++ b/dp/wifi3.0/dp_ipa.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 above @@ -268,8 +269,8 @@ QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc, uint32_t size, bool create); -bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap1, - uint32_t *remap2); +bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0, + uint32_t *remap1, uint32_t *remap2); bool dp_ipa_is_mdm_platform(void); qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc, qdf_nbuf_t nbuf); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index fe4f80cbb4..7cef2c8d4e 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3958,22 +3958,8 @@ static void dp_soc_reset_intr_mask(struct dp_soc *soc) } #ifdef IPA_OFFLOAD -/** - * dp_reo_remap_config() - configure reo remap register value based - * nss configuration. - * based on offload_radio value below remap configuration - * get applied. - * 0 - both Radios handled by host (remap rings 1, 2, 3 & 4) - * 1 - 1st Radio handled by NSS (remap rings 2, 3 & 4) - * 2 - 2nd Radio handled by NSS (remap rings 1, 2 & 4) - * 3 - both Radios handled by NSS (remap not required) - * 4 - IPA OFFLOAD enabled (remap rings 1,2 & 3) - * - * @remap1: output parameter indicates reo remap 1 register value - * @remap2: output parameter indicates reo remap 2 register value - * Return: bool type, true if remap is configured else false. - */ -bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap1, uint32_t *remap2) +bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0, + uint32_t *remap1, uint32_t *remap2) { uint32_t ring[8] = {REO_REMAP_SW1, REO_REMAP_SW2, REO_REMAP_SW3}; int target_type; @@ -4154,9 +4140,10 @@ static uint8_t dp_reo_ring_selection(uint32_t value, uint32_t *ring) return num; } -static bool dp_reo_remap_config(struct dp_soc *soc, - uint32_t *remap1, - uint32_t *remap2) +bool dp_reo_remap_config(struct dp_soc *soc, + uint32_t *remap0, + uint32_t *remap1, + uint32_t *remap2) { uint8_t offload_radio = wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx); uint32_t reo_config = wlan_cfg_get_reo_rings_mapping(soc->wlan_cfg_ctx); @@ -6843,15 +6830,6 @@ static void dp_mlo_peer_authorize(struct dp_soc *soc, } #endif -/* - * dp_vdev_get_default_reo_hash() - get reo dest ring and hash values for a vdev - * @vdev: Datapath VDEV handle - * @reo_dest: pointer to default reo_dest ring for vdev to be populated - * @hash_based: pointer to hash value (enabled/disabled) to be populated - * - * Return: None - */ -static void dp_vdev_get_default_reo_hash(struct dp_vdev *vdev, enum cdp_host_reo_dest_ring *reo_dest, bool *hash_based) @@ -6904,8 +6882,10 @@ static inline bool dp_is_vdev_subtype_p2p(struct dp_vdev *vdev) * Return: None */ static void dp_peer_setup_get_reo_hash(struct dp_vdev *vdev, + struct cdp_peer_setup_info *setup_info, enum cdp_host_reo_dest_ring *reo_dest, - bool *hash_based) + bool *hash_based, + uint8_t *lmac_peer_id_msb) { struct dp_soc *soc; struct dp_pdev *pdev; @@ -6952,12 +6932,16 @@ static void dp_peer_setup_get_reo_hash(struct dp_vdev *vdev, * Use system config values for hash based steering. * Return: None */ - static void dp_peer_setup_get_reo_hash(struct dp_vdev *vdev, + struct cdp_peer_setup_info *setup_info, enum cdp_host_reo_dest_ring *reo_dest, - bool *hash_based) + bool *hash_based, + uint8_t *lmac_peer_id_msb) { - dp_vdev_get_default_reo_hash(vdev, reo_dest, hash_based); + struct dp_soc *soc = vdev->pdev->soc; + + soc->arch_ops.peer_get_reo_hash(vdev, setup_info, reo_dest, hash_based, + lmac_peer_id_msb); } #endif /* IPA_OFFLOAD */ @@ -6985,6 +6969,7 @@ dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, dp_peer_find_hash_find(soc, peer_mac, 0, vdev_id, DP_MOD_ID_CDP); enum wlan_op_mode vdev_opmode; + uint8_t lmac_peer_id_msb = 0; if (!peer) return QDF_STATUS_E_FAILURE; @@ -6998,7 +6983,9 @@ dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, /* save vdev related member in case vdev freed */ vdev_opmode = vdev->opmode; pdev = vdev->pdev; - dp_peer_setup_get_reo_hash(vdev, &reo_dest, &hash_based); + dp_peer_setup_get_reo_hash(vdev, setup_info, + &reo_dest, &hash_based, + &lmac_peer_id_msb); dp_info("pdev: %d vdev :%d opmode:%u hash-based-steering:%d default-reo_dest:%u", pdev->pdev_id, vdev->vdev_id, @@ -7023,7 +7010,8 @@ dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, soc->ctrl_psoc, peer->vdev->pdev->pdev_id, peer->mac_addr.raw, - peer->vdev->vdev_id, hash_based, reo_dest); + peer->vdev->vdev_id, hash_based, reo_dest, + lmac_peer_id_msb); } qdf_atomic_set(&peer->is_default_route_set, 1); @@ -12731,9 +12719,9 @@ void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle, * Reo ring remap is not required if both radios * are offloaded to NSS */ - if (dp_reo_remap_config(soc, - &reo_params.remap1, - &reo_params.remap2)) + if (soc->arch_ops.reo_remap_config(soc, &reo_params.remap0, + &reo_params.remap1, + &reo_params.remap2)) reo_params.rx_hash_enabled = true; else reo_params.rx_hash_enabled = false; diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 2abe14edb6..285b802aa6 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1619,6 +1619,13 @@ struct dp_arch_ops { void (*txrx_peer_detach)(struct dp_soc *soc); QDF_STATUS (*dp_rxdma_ring_sel_cfg)(struct dp_soc *soc); void (*soc_cfg_attach)(struct dp_soc *soc); + void (*peer_get_reo_hash)(struct dp_vdev *vdev, + struct cdp_peer_setup_info *setup_info, + enum cdp_host_reo_dest_ring *reo_dest, + bool *hash_based, + uint8_t *lmac_peer_id_msb); + bool (*reo_remap_config)(struct dp_soc *soc, uint32_t *remap0, + uint32_t *remap1, uint32_t *remap2); /* TX RX Arch Ops */ QDF_STATUS (*tx_hw_enqueue)(struct dp_soc *soc, struct dp_vdev *vdev, @@ -3622,4 +3629,36 @@ void dp_srng_deinit(struct dp_soc *soc, struct dp_srng *srng, enum timer_yield_status dp_should_timer_irq_yield(struct dp_soc *soc, uint32_t work_done, uint64_t start_time); + +/* + * dp_vdev_get_default_reo_hash() - get reo dest ring and hash values for a vdev + * @vdev: Datapath VDEV handle + * @reo_dest: pointer to default reo_dest ring for vdev to be populated + * @hash_based: pointer to hash value (enabled/disabled) to be populated + * + * Return: None + */ +void dp_vdev_get_default_reo_hash(struct dp_vdev *vdev, + enum cdp_host_reo_dest_ring *reo_dest, + bool *hash_based); + +/** + * dp_reo_remap_config() - configure reo remap register value based + * nss configuration. + * based on offload_radio value below remap configuration + * get applied. + * 0 - both Radios handled by host (remap rings 1, 2, 3 & 4) + * 1 - 1st Radio handled by NSS (remap rings 2, 3 & 4) + * 2 - 2nd Radio handled by NSS (remap rings 1, 2 & 4) + * 3 - both Radios handled by NSS (remap not required) + * 4 - IPA OFFLOAD enabled (remap rings 1,2 & 3) + * + * @remap0: output parameter indicates reo remap 0 register value + * @remap1: output parameter indicates reo remap 1 register value + * @remap2: output parameter indicates reo remap 2 register value + * Return: bool type, true if remap is configured else false. + */ + +bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0, + uint32_t *remap1, uint32_t *remap2); #endif /* _DP_TYPES_H_ */ diff --git a/dp/wifi3.0/li/dp_li.c b/dp/wifi3.0/li/dp_li.c index 7a3e2d38f7..119c4d1b18 100644 --- a/dp/wifi3.0/li/dp_li.c +++ b/dp/wifi3.0/li/dp_li.c @@ -341,6 +341,23 @@ static void dp_tx_implicit_rbm_set_li(struct dp_soc *soc, { } +static void dp_peer_get_reo_hash_li(struct dp_vdev *vdev, + struct cdp_peer_setup_info *setup_info, + enum cdp_host_reo_dest_ring *reo_dest, + bool *hash_based, + uint8_t *lmac_peer_id_msb) +{ + dp_vdev_get_default_reo_hash(vdev, reo_dest, hash_based); +} + +static bool dp_reo_remap_config_li(struct dp_soc *soc, + uint32_t *remap0, + uint32_t *remap1, + uint32_t *remap2) +{ + return dp_reo_remap_config(soc, remap0, remap1, remap2); +} + void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops) { #ifndef QCA_HOST_MODE_WIFI_DISABLED @@ -382,5 +399,7 @@ void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops) dp_rx_peer_metadata_peer_id_get_li; arch_ops->soc_cfg_attach = dp_soc_cfg_attach_li; arch_ops->tx_implicit_rbm_set = dp_tx_implicit_rbm_set_li; + arch_ops->peer_get_reo_hash = dp_peer_get_reo_hash_li; + arch_ops->reo_remap_config = dp_reo_remap_config_li; } diff --git a/hal/wifi3.0/be/hal_be_api.h b/hal/wifi3.0/be/hal_be_api.h index 093e4ea176..e462f51cca 100644 --- a/hal/wifi3.0/be/hal_be_api.h +++ b/hal/wifi3.0/be/hal_be_api.h @@ -120,4 +120,36 @@ void hal_reo_qdesc_setup_be(hal_soc_handle_t hal_soc_hdl, void hal_cookie_conversion_reg_cfg_be(hal_soc_handle_t hal_soc_hdl, struct hal_hw_cc_config *cc_cfg); +/** + * hal_reo_ix_remap_value_get() - Calculate reo remap register value from + * ring_id_mask which is used for hash based + * reo distribution + * + * @hal_soc: Handle to HAL SoC structure + * @ring_id_mask: mask value indicating the rx rings 0th bit set indicate + * REO2SW1 is included in hash distribution + * + * Return: REO remap value + */ +uint32_t +hal_reo_ix_remap_value_get_be(hal_soc_handle_t hal_soc_hdl, + uint8_t rx_ring_mask); + +/** + * hal_reo_ring_remap_value_get_be() - return REO remap value + * + * @ring_id: REO2SW ring id + * + * Return: REO remap value + */ +uint8_t +hal_reo_ring_remap_value_get_be(uint8_t rx_ring_id); + +/** + * hal_setup_reo_swap() - Set the swap flag for big endian machines + * @soc: HAL soc handle + * + * Return: None + */ +void hal_setup_reo_swap(struct hal_soc *soc); #endif /* _HAL_BE_API_H_ */ diff --git a/hal/wifi3.0/be/hal_be_generic_api.c b/hal/wifi3.0/be/hal_be_generic_api.c index c8eb3d3877..37e860bc33 100644 --- a/hal/wifi3.0/be/hal_be_generic_api.c +++ b/hal/wifi3.0/be/hal_be_generic_api.c @@ -24,14 +24,19 @@ #include "hal_tx.h" //HAL_SET_FLD #include "hal_be_rx.h" //HAL_RX_BUF_RBM_GET -#if defined(QDF_BIG_ENDIAN_MACHINE) -/** - * hal_setup_reo_swap() - Set the swap flag for big endian machines - * @soc: HAL soc handle +/* + * The 4 bits REO destination ring value is defined as: 0: TCL + * 1:SW1 2:SW2 3:SW3 4:SW4 5:Release 6:FW(WIFI) 7:SW5 + * 8:SW6 9:SW7 10:SW8 11: NOT_USED. * - * Return: None */ -static void hal_setup_reo_swap(struct hal_soc *soc) +uint32_t reo_dest_ring_remap[] = {REO_REMAP_SW1, REO_REMAP_SW2, + REO_REMAP_SW3, REO_REMAP_SW4, + REO_REMAP_SW5, REO_REMAP_SW6, + REO_REMAP_SW7, REO_REMAP_SW8}; + +#if defined(QDF_BIG_ENDIAN_MACHINE) +void hal_setup_reo_swap(struct hal_soc *soc) { uint32_t reg_val; @@ -45,7 +50,7 @@ static void hal_setup_reo_swap(struct hal_soc *soc) REO_REG_REG_BASE), reg_val); } #else -static inline void hal_setup_reo_swap(struct hal_soc *soc) +void hal_setup_reo_swap(struct hal_soc *soc) { } #endif @@ -891,6 +896,60 @@ uint32_t hal_rx_msdu_reo_dst_ind_get_be(hal_soc_handle_t hal_soc_hdl, return dst_ind; } +uint32_t +hal_reo_ix_remap_value_get_be(hal_soc_handle_t hal_soc_hdl, + uint8_t rx_ring_mask) +{ + uint32_t num_rings = 0; + uint32_t i = 0; + uint32_t ring_remap_arr[HAL_MAX_REO2SW_RINGS] = {0}; + uint32_t reo_remap_val = 0; + uint32_t ring_idx = 0; + uint8_t ix_map[HAL_NUM_RX_RING_PER_IX_MAP] = {0}; + + /* create reo ring remap array */ + while (i < HAL_MAX_REO2SW_RINGS) { + if (rx_ring_mask & (1 << i)) { + ring_remap_arr[num_rings] = reo_dest_ring_remap[i]; + num_rings++; + } + i++; + } + + for (i = 0; i < HAL_NUM_RX_RING_PER_IX_MAP; i++) { + if (rx_ring_mask) { + ix_map[i] = ring_remap_arr[ring_idx]; + ring_idx = ((ring_idx + 1) % num_rings); + } else { + /* if ring mask is zero configure to release to WBM */ + ix_map[i] = REO_REMAP_RELEASE; + } + } + + reo_remap_val = HAL_REO_REMAP_IX0(ix_map[0], 0) | + HAL_REO_REMAP_IX0(ix_map[1], 1) | + HAL_REO_REMAP_IX0(ix_map[2], 2) | + HAL_REO_REMAP_IX0(ix_map[3], 3) | + HAL_REO_REMAP_IX0(ix_map[4], 4) | + HAL_REO_REMAP_IX0(ix_map[5], 5) | + HAL_REO_REMAP_IX0(ix_map[6], 6) | + HAL_REO_REMAP_IX0(ix_map[7], 7); + + return reo_remap_val; +} + +qdf_export_symbol(hal_reo_ix_remap_value_get_be); + +uint8_t hal_reo_ring_remap_value_get_be(uint8_t rx_ring_id) +{ + if (rx_ring_id > HAL_MAX_REO2SW_RINGS) + return REO_REMAP_RELEASE; + + return reo_dest_ring_remap[rx_ring_id]; +} + +qdf_export_symbol(hal_reo_ring_remap_value_get_be); + /** * hal_hw_txrx_default_ops_attach_be() - Attach the default hal ops for * beryllium chipsets. diff --git a/hal/wifi3.0/be/hal_be_reo.h b/hal/wifi3.0/be/hal_be_reo.h index 09dd217058..a3ebdf1aea 100644 --- a/hal/wifi3.0/be/hal_be_reo.h +++ b/hal/wifi3.0/be/hal_be_reo.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -24,6 +25,8 @@ #include "hal_reo.h" #define HAL_REO_QUEUE_EXT_DESC 10 +#define HAL_MAX_REO2SW_RINGS 8 +#define HAL_NUM_RX_RING_PER_IX_MAP 8 /* Proto-types */ void hal_get_ba_aging_timeout_be(hal_soc_handle_t hal_soc_hdl, uint8_t ac, diff --git a/hal/wifi3.0/hal_internal.h b/hal/wifi3.0/hal_internal.h index 8014fc4a72..d1f58d38e9 100644 --- a/hal/wifi3.0/hal_internal.h +++ b/hal/wifi3.0/hal_internal.h @@ -683,6 +683,8 @@ struct shadow_reg_config { struct hal_reo_params { /** rx hash steering enabled or disabled */ bool rx_hash_enabled; + /** reo remap 0 register */ + uint32_t remap0; /** reo remap 1 register */ uint32_t remap1; /** reo remap 2 register */ diff --git a/hal/wifi3.0/qcn9224/hal_9224.c b/hal/wifi3.0/qcn9224/hal_9224.c index 4b9a5e66d9..a5b5b3cde6 100644 --- a/hal/wifi3.0/qcn9224/hal_9224.c +++ b/hal/wifi3.0/qcn9224/hal_9224.c @@ -1548,6 +1548,92 @@ static uint8_t hal_get_idle_link_bm_id_9224(uint8_t chip_id) return (WBM_IDLE_DESC_LIST + chip_id); } +static void hal_reo_setup_generic_9224(struct hal_soc *soc, void *reoparams) +{ + uint32_t reg_val; + struct hal_reo_params *reo_params = (struct hal_reo_params *)reoparams; + + reg_val = HAL_REG_READ(soc, HWIO_REO_R0_GENERAL_ENABLE_ADDR( + REO_REG_REG_BASE)); + + hal_reo_config_9224(soc, reg_val, reo_params); + /* Other ring enable bits and REO_ENABLE will be set by FW */ + + /* TODO: Setup destination ring mapping if enabled */ + + /* TODO: Error destination ring setting is left to default. + * Default setting is to send all errors to release ring. + */ + + /* Set the reo descriptor swap bits in case of BIG endian platform */ + hal_setup_reo_swap(soc); + + HAL_REG_WRITE(soc, + HWIO_REO_R0_AGING_THRESHOLD_IX_0_ADDR(REO_REG_REG_BASE), + HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000); + + HAL_REG_WRITE(soc, + HWIO_REO_R0_AGING_THRESHOLD_IX_1_ADDR(REO_REG_REG_BASE), + (HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000)); + + HAL_REG_WRITE(soc, + HWIO_REO_R0_AGING_THRESHOLD_IX_2_ADDR(REO_REG_REG_BASE), + (HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000)); + + HAL_REG_WRITE(soc, + HWIO_REO_R0_AGING_THRESHOLD_IX_3_ADDR(REO_REG_REG_BASE), + (HAL_DEFAULT_VO_REO_TIMEOUT_MS * 1000)); + + /* + * When hash based routing is enabled, routing of the rx packet + * is done based on the following value: 1 _ _ _ _ The last 4 + * bits are based on hash[3:0]. This means the possible values + * are 0x10 to 0x1f. This value is used to look-up the + * ring ID configured in Destination_Ring_Ctrl_IX_* register. + * The Destination_Ring_Ctrl_IX_2 and Destination_Ring_Ctrl_IX_3 + * registers need to be configured to set-up the 16 entries to + * map the hash values to a ring number. There are 3 bits per + * hash entry – which are mapped as follows: + * 0: TCL, 1:SW1, 2:SW2, * 3:SW3, 4:SW4, 5:Release, 6:FW(WIFI), + * 7: NOT_USED. + */ + if (reo_params->rx_hash_enabled) { + HAL_REG_WRITE(soc, + HWIO_REO_R0_DESTINATION_RING_CTRL_IX_1_ADDR + (REO_REG_REG_BASE), reo_params->remap0); + + hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR 0x%x", + HAL_REG_READ(soc, + HWIO_REO_R0_DESTINATION_RING_CTRL_IX_1_ADDR( + REO_REG_REG_BASE))); + + HAL_REG_WRITE(soc, + HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR + (REO_REG_REG_BASE), reo_params->remap1); + + hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR 0x%x", + HAL_REG_READ(soc, + HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR( + REO_REG_REG_BASE))); + + HAL_REG_WRITE(soc, + HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR + (REO_REG_REG_BASE), reo_params->remap2); + + hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR 0x%x", + HAL_REG_READ(soc, + HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR( + REO_REG_REG_BASE))); + } + + /* TODO: Check if the following registers shoould be setup by host: + * AGING_CONTROL + * HIGH_MEMORY_THRESHOLD + * GLOBAL_LINK_DESC_COUNT_THRESH_IX_0[1,2] + * GLOBAL_LINK_DESC_COUNT_CTRL + */ +} + static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc) { /* init and setup */ @@ -1743,6 +1829,7 @@ static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc) hal_rx_priv_info_get_from_tlv_be; hal_soc->ops->hal_rx_pkt_hdr_get = hal_rx_pkt_hdr_get_be; hal_soc->ops->hal_get_idle_link_bm_id = hal_get_idle_link_bm_id_9224; + hal_soc->ops->hal_reo_setup = hal_reo_setup_generic_9224; }; struct hal_hw_srng_config hw_srng_table_9224[] = { diff --git a/target_if/dp/inc/target_if_dp.h b/target_if/dp/inc/target_if_dp.h index dcb6327b42..293b692974 100644 --- a/target_if/dp/inc/target_if_dp.h +++ b/target_if/dp/inc/target_if_dp.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -31,6 +32,8 @@ #include #include +#define PEER_ROUTING_LMAC_ID_INDEX 6 +#define PEER_ROUTING_LMAC_ID_BITS 2 /** * struct reorder_q_setup - reorder queue setup params * @psoc: psoc @@ -63,6 +66,7 @@ struct reorder_q_setup { * @vdev_id: vdev id * @hash_based: hash based routing * @ring_num: ring number + * @lmac_peer_id_msb: lmac_peer_id_msb * * return: void */ @@ -70,7 +74,8 @@ void target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id, uint8_t *peer_macaddr, uint8_t vdev_id, - bool hash_based, uint8_t ring_num); + bool hash_based, uint8_t ring_num, + uint8_t lmac_peer_id_msb); /** * target_if_peer_rx_reorder_queue_setup() - setup rx reorder queue * @pdev: pdev pointer diff --git a/target_if/dp/src/target_if_dp.c b/target_if/dp/src/target_if_dp.c index 7879aa61ce..cbcc68c0fe 100644 --- a/target_if/dp/src/target_if_dp.c +++ b/target_if/dp/src/target_if_dp.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -28,7 +29,8 @@ void target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id, uint8_t *peer_macaddr, uint8_t vdev_id, - bool hash_based, uint8_t ring_num) + bool hash_based, uint8_t ring_num, + uint8_t lmac_peer_id_msb) { uint32_t value; struct peer_set_params param; @@ -56,6 +58,10 @@ target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_psoc *psoc, */ value = ((hash_based) ? 1 : 0) | (ring_num << 1); + if (lmac_peer_id_msb) + QDF_SET_BITS(value, PEER_ROUTING_LMAC_ID_INDEX, + PEER_ROUTING_LMAC_ID_BITS, lmac_peer_id_msb); + param.param_id = WMI_HOST_PEER_SET_DEFAULT_ROUTING; param.vdev_id = vdev_id; param.param_value = value; diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 31372fb7d3..b2e8b8e58b 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -440,6 +440,12 @@ #define WLAN_CFG_PPE_RELEASE_RING_SIZE_MIN 64 #define WLAN_CFG_PPE_RELEASE_RING_SIZE_MAX 1024 +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +#define WLAN_CFG_MLO_RX_RING_MAP 0xF +#define WLAN_CFG_MLO_RX_RING_MAP_MIN 0x0 +#define WLAN_CFG_MLO_RX_RING_MAP_MAX 0xFF +#endif + /* DP INI Declerations */ #define CFG_DP_HTT_PACKET_TYPE \ CFG_INI_UINT("dp_htt_packet_type", \ @@ -1364,6 +1370,75 @@ #define CFG_DP_PPE_CONFIG #endif +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +/* + * + * dp_chip0_rx_ring_map - Set Rx ring map for CHIP 0 + * @Min: 0x0 + * @Max: 0xFF + * @Default: 0xF + * + * This ini sets Rx ring map for CHIP 0 + * + * Usage: Internal + * + * + */ +#define CFG_DP_MLO_CHIP0_RX_RING_MAP \ + CFG_INI_UINT("dp_chip0_rx_ring_map", \ + WLAN_CFG_MLO_RX_RING_MAP_MIN, \ + WLAN_CFG_MLO_RX_RING_MAP_MAX, \ + WLAN_CFG_MLO_RX_RING_MAP, \ + CFG_VALUE_OR_DEFAULT, "DP Rx ring map chip0") + +/* + * + * dp_chip1_rx_ring_map - Set Rx ring map for CHIP 1 + * @Min: 0x0 + * @Max: 0xFF + * @Default: 0xF + * + * This ini sets Rx ring map for CHIP 1 + * + * Usage: Internal + * + * + */ +#define CFG_DP_MLO_CHIP1_RX_RING_MAP \ + CFG_INI_UINT("dp_chip1_rx_ring_map", \ + WLAN_CFG_MLO_RX_RING_MAP_MIN, \ + WLAN_CFG_MLO_RX_RING_MAP_MAX, \ + WLAN_CFG_MLO_RX_RING_MAP, \ + CFG_VALUE_OR_DEFAULT, "DP Rx ring map chip1") + +/* + * + * dp_chip2_rx_ring_map - Set Rx ring map for CHIP 2 + * @Min: 0x0 + * @Max: 0xFF + * @Default: 0xF + * + * This ini sets Rx ring map for CHIP 2 + * + * Usage: Internal + * + * + */ +#define CFG_DP_MLO_CHIP2_RX_RING_MAP \ + CFG_INI_UINT("dp_chip2_rx_ring_map", \ + WLAN_CFG_MLO_RX_RING_MAP_MIN, \ + WLAN_CFG_MLO_RX_RING_MAP_MAX, \ + WLAN_CFG_MLO_RX_RING_MAP, \ + CFG_VALUE_OR_DEFAULT, "DP Rx ring map chip2") + +#define CFG_DP_MLO_CONFIG \ + CFG(CFG_DP_MLO_CHIP0_RX_RING_MAP) \ + CFG(CFG_DP_MLO_CHIP1_RX_RING_MAP) \ + CFG(CFG_DP_MLO_CHIP2_RX_RING_MAP) +#else +#define CFG_DP_MLO_CONFIG +#endif + #define CFG_DP \ CFG(CFG_DP_HTT_PACKET_TYPE) \ CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \ @@ -1464,5 +1539,6 @@ CFG(CFG_DP_TX_MONITOR_DST_RING) \ CFG_DP_IPA_TX_RING_CFG \ CFG_DP_PPE_CONFIG \ - CFG_DP_IPA_TX_ALT_RING_CFG + CFG_DP_IPA_TX_ALT_RING_CFG \ + CFG_DP_MLO_CONFIG #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 1cbeb3989e..bc5a0a765f 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -1695,6 +1695,92 @@ wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, } #endif +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +/** + * wlan_cfg_get_lsb_set_pos() - returns position of LSB which is set + * + * Return: position of LSB which is set + */ +static uint8_t wlan_cfg_get_lsb_set_pos(uint8_t val) +{ + uint8_t pos = 0; + + while (pos < 8) { + if (val & (1 << pos)) + return pos; + + pos++; + } + + return 0; +} + +/** + * wlan_multi_soc_mlo_cfg_attach() - Update multi soc mlo config in dp soc + * cfg context + * @psoc - Object manager psoc + * @wlan_cfg_ctx - dp soc cfg ctx + * + * Return: None + */ +static void +wlan_multi_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ + uint8_t rx_ring_map; + + rx_ring_map = + cfg_get(psoc, CFG_DP_MLO_CHIP0_RX_RING_MAP); + wlan_cfg_ctx->mlo_chip_rx_ring_map[0] = rx_ring_map; + wlan_cfg_ctx->mlo_chip_default_rx_ring_id[0] = + wlan_cfg_get_lsb_set_pos(rx_ring_map); + wlan_cfg_ctx->lmac_peer_id_msb[0] = 1; + + rx_ring_map = + cfg_get(psoc, CFG_DP_MLO_CHIP1_RX_RING_MAP); + wlan_cfg_ctx->mlo_chip_rx_ring_map[1] = rx_ring_map; + wlan_cfg_ctx->mlo_chip_default_rx_ring_id[1] = + wlan_cfg_get_lsb_set_pos(rx_ring_map); + wlan_cfg_ctx->lmac_peer_id_msb[1] = 2; + + rx_ring_map = + cfg_get(psoc, CFG_DP_MLO_CHIP2_RX_RING_MAP); + wlan_cfg_ctx->mlo_chip_rx_ring_map[2] = rx_ring_map; + wlan_cfg_ctx->mlo_chip_default_rx_ring_id[2] = + wlan_cfg_get_lsb_set_pos(rx_ring_map); + wlan_cfg_ctx->lmac_peer_id_msb[2] = 3; +} +#else +static inline void +wlan_multi_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ +} +#endif + +#ifdef WLAN_FEATURE_11BE_MLO +/** + * wlan_soc_mlo_cfg_attach() - Update mlo config in dp soc + * cfg context + * @psoc - Object manager psoc + * @wlan_cfg_ctx - dp soc cfg ctx + * + * Return: None + */ +static void +wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ + wlan_multi_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx); +} +#else +static inline void +wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ +} +#endif + /** * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration * @psoc - Object manager psoc @@ -1884,6 +1970,7 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx); wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx); wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx); + wlan_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx); #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) & PKT_CAPTURE_MODE_DATA_ONLY; @@ -2992,3 +3079,26 @@ wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg, { cfg->rx_rel_wbm2sw_ring_id = wbm2sw_ring_id; } + +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +uint8_t +wlan_cfg_mlo_rx_ring_map_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg, + uint8_t chip_id) +{ + return cfg->mlo_chip_rx_ring_map[chip_id]; +} + +uint8_t +wlan_cfg_mlo_default_rx_ring_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg, + uint8_t chip_id) +{ + return cfg->mlo_chip_default_rx_ring_id[chip_id]; +} + +uint8_t +wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg, + uint8_t chip_id) +{ + return cfg->lmac_peer_id_msb[chip_id]; +} +#endif diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index f25cc76184..34845f3be1 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -87,6 +87,13 @@ #endif #endif +/* Max number of chips that can participate in MLO */ +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +#define WLAN_MAX_MLO_CHIPS 3 +#else +#define WLAN_MAX_MLO_CHIPS 1 +#endif + struct wlan_cfg_dp_pdev_ctxt; /** @@ -234,6 +241,9 @@ struct wlan_srng_cfg { * @tx_mon_buf_ring_size: Tx monitor buf ring size * @tx_rings_grp_bitmap: bitmap of group intr contexts which have * non-zero tx ring mask + * @mlo_chip_rx_ring_map: map of chip_id to rx ring map + * @mlo_chip_default_rx_ring_id: default rx_ring of chip when hash is not found + * @lmac_peer_id_msb: value used for hash based routing */ struct wlan_cfg_dp_soc_ctxt { int num_int_ctxts; @@ -382,6 +392,11 @@ struct wlan_cfg_dp_soc_ctxt { uint32_t tx_mon_buf_ring_size; uint8_t rx_rel_wbm2sw_ring_id; uint32_t tx_rings_grp_bitmap; +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) + uint8_t mlo_chip_rx_ring_map[WLAN_MAX_MLO_CHIPS]; + uint8_t mlo_chip_default_rx_ring_id[WLAN_MAX_MLO_CHIPS]; + uint8_t lmac_peer_id_msb[WLAN_MAX_MLO_CHIPS]; +#endif }; /** @@ -1933,3 +1948,38 @@ void wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint8_t wbm2sw_ring_id); #endif + +#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) +/** + * wlan_cfg_mlo_rx_ring_map_get_by_chip_id() - get rx ring map + * @cfg: soc configuration context + * @chip_id: mlo_chip_id + * + * Return: rx_ring_map + */ +uint8_t +wlan_cfg_mlo_rx_ring_map_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg, + uint8_t chip_id); + +/** + * wlan_cfg_mlo_default_rx_ring_get_by_chip_id() - get default RX ring + * @cfg: soc configuration context + * @chip_id: mlo_chip_id + * + * Return: default rx ring + */ +uint8_t +wlan_cfg_mlo_default_rx_ring_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg, + uint8_t chip_id); + +/** + * wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id() - get chip's lmac_peer_id_msb + * @cfg: soc configuration context + * @chip_id: mlo_chip_id + * + * Return: lmac_peer_id_msb + */ +uint8_t +wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg, + uint8_t chip_id); +#endif