diff --git a/components/cfg/cfg_all.h b/components/cfg/cfg_all.h index 6cf85d87d9..7f997e1530 100644 --- a/components/cfg/cfg_all.h +++ b/components/cfg/cfg_all.h @@ -45,6 +45,7 @@ #include "cfg_ftm_time_sync.h" #include "wlan_pmo_cfg.h" +#include "wlan_dp_cfg.h" #include "hdd_config.h" #include "hdd_dp_cfg.h" #include "cfg_legacy_dp.h" @@ -59,6 +60,7 @@ CFG_POLICY_MGR_ALL \ CFG_HDD_ALL \ CFG_HDD_DP_ALL \ + CFG_DP_ALL \ CFG_LEGACY_DP_ALL \ CFG_MLME_ALL \ CFG_NAN_ALL \ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index ceba918994..efd76410d7 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -113,6 +113,7 @@ #include "wlan_hdd_pre_cac.h" #include "wlan_osif_features.h" #include "wlan_pre_cac_ucfg_api.h" +#include #define ACS_SCAN_EXPIRY_TIMEOUT_S 4 @@ -787,6 +788,7 @@ static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) } hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr, &mac_addr); + ucfg_dp_update_inf_mac(hdd_ctx->psoc, &adapter->mac_addr, &mac_addr); memcpy(&adapter->mac_addr, psta_mac_addr->sa_data, ETH_ALEN); memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); hdd_exit(); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9177fd4dbf..82b42ba1cc 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -233,6 +233,9 @@ #ifdef WLAN_FEATURE_DYNAMIC_RX_AGGREGATION #include #endif +#include "wlan_dp_public_struct.h" +#include "os_if_dp.h" +#include #ifdef MULTI_CLIENT_LL_SUPPORT #define WLAM_WLM_HOST_DRIVER_PORT_ID 0xFFFFFF @@ -5598,6 +5601,7 @@ static int __hdd_set_mac_address(struct net_device *dev, void *addr) else hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr, &mac_addr); + ucfg_dp_update_inf_mac(hdd_ctx->psoc, &adapter->mac_addr, &mac_addr); memcpy(&adapter->mac_addr, psta_mac_addr->sa_data, ETH_ALEN); memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); @@ -7765,6 +7769,11 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, ndev = adapter->dev; + status = ucfg_dp_create_intf(hdd_ctx->psoc, &adapter->mac_addr, + (qdf_netdev_t)adapter->dev); + if (QDF_IS_STATUS_ERROR(status)) + goto err_free_netdev; + if (QDF_P2P_CLIENT_MODE == session_type) adapter->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT; else if (QDF_P2P_DEVICE_MODE == session_type) @@ -7800,7 +7809,7 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, status = hdd_register_interface(adapter, rtnl_held, params); if (QDF_STATUS_SUCCESS != status) - goto err_free_netdev; + goto err_destroy_dp_intf; /* Stop the Interface TX queue. */ hdd_debug("Disabling queues"); wlan_hdd_netif_queue_control(adapter, @@ -7827,6 +7836,11 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, ndev = adapter->dev; + status = ucfg_dp_create_intf(hdd_ctx->psoc, &adapter->mac_addr, + (qdf_netdev_t)adapter->dev); + if (QDF_IS_STATUS_ERROR(status)) + goto err_free_netdev; + adapter->wdev.iftype = (session_type == QDF_SAP_MODE) ? NL80211_IFTYPE_AP : @@ -7835,7 +7849,7 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, status = hdd_register_interface(adapter, rtnl_held, params); if (QDF_STATUS_SUCCESS != status) - goto err_free_netdev; + goto err_destroy_dp_intf; hdd_debug("Disabling queues"); wlan_hdd_netif_queue_control(adapter, @@ -7872,11 +7886,16 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, ndev = adapter->dev; + status = ucfg_dp_create_intf(hdd_ctx->psoc, &adapter->mac_addr, + (qdf_netdev_t)adapter->dev); + if (QDF_IS_STATUS_ERROR(status)) + goto err_free_netdev; + adapter->wdev.iftype = NL80211_IFTYPE_STATION; adapter->device_mode = session_type; status = hdd_register_interface(adapter, rtnl_held, params); if (QDF_STATUS_SUCCESS != status) - goto err_free_netdev; + goto err_destroy_dp_intf; /* Stop the Interface TX queue. */ hdd_debug("Disabling queues"); @@ -7953,6 +7972,9 @@ err_cleanup_adapter: adapter = NULL; } +err_destroy_dp_intf: + ucfg_dp_destroy_intf(hdd_ctx->psoc, &adapter->mac_addr); + err_free_netdev: if (ndev) free_netdev(ndev); @@ -7964,6 +7986,9 @@ static void __hdd_close_adapter(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter, bool rtnl_held) { + struct qdf_mac_addr adapter_mac; + + qdf_copy_macaddr(&adapter_mac, &adapter->mac_addr); if (adapter->device_mode == QDF_STA_MODE) hdd_cleanup_conn_info(adapter); qdf_list_destroy(&adapter->blocked_scan_request_q); @@ -7973,6 +7998,7 @@ static void __hdd_close_adapter(struct hdd_context *hdd_ctx, qdf_event_destroy(&adapter->peer_cleanup_done); hdd_adapter_feature_update_work_deinit(adapter); hdd_cleanup_adapter(hdd_ctx, adapter, rtnl_held); + ucfg_dp_destroy_intf(hdd_ctx->psoc, &adapter_mac); } void hdd_close_adapter(struct hdd_context *hdd_ctx, @@ -18351,6 +18377,10 @@ static QDF_STATUS hdd_component_init(void) if (QDF_IS_STATUS_ERROR(status)) goto pre_cac_deinit; + status = ucfg_dp_init(); + if (QDF_IS_STATUS_ERROR(status)) + goto pre_cac_deinit; + return QDF_STATUS_SUCCESS; pre_cac_deinit: @@ -18401,6 +18431,7 @@ mlme_global_deinit: static void hdd_component_deinit(void) { /* deinitialize non-converged components */ + ucfg_dp_deinit(); ucfg_pre_cac_deinit(); ucfg_ftm_time_sync_deinit(); ucfg_pkt_capture_deinit(); @@ -18468,8 +18499,14 @@ QDF_STATUS hdd_component_psoc_open(struct wlan_objmgr_psoc *psoc) if (QDF_IS_STATUS_ERROR(status)) goto err_wifi_pos; + status = ucfg_dp_psoc_open(psoc); + if (QDF_IS_STATUS_ERROR(status)) + goto err_dp; + return status; +err_dp: + ucfg_wifi_pos_psoc_close(psoc); err_wifi_pos: ucfg_twt_psoc_close(psoc); err_twt: @@ -18494,6 +18531,7 @@ err_dlm: void hdd_component_psoc_close(struct wlan_objmgr_psoc *psoc) { + ucfg_dp_psoc_close(psoc); ucfg_wifi_pos_psoc_close(psoc); ucfg_twt_psoc_close(psoc); ucfg_nan_psoc_close(psoc); @@ -19592,8 +19630,7 @@ static void hdd_update_hif_config(struct hdd_context *hdd_ctx) cfg.enable_self_recovery = self_recovery; hdd_populate_runtime_cfg(hdd_ctx, &cfg); cfg.rx_softirq_max_yield_duration_ns = - cfg_get(hdd_ctx->psoc, - CFG_DP_RX_SOFTIRQ_MAX_YIELD_TIME_NS); + ucfg_dp_get_rx_softirq_yield_duration(hdd_ctx->psoc); hif_init_ini_config(scn, &cfg); @@ -19601,53 +19638,6 @@ static void hdd_update_hif_config(struct hdd_context *hdd_ctx) hif_vote_link_up(scn); } -#ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT -/** - * hdd_update_dp_config_rx_softirq_limits() - Update DP rx softirq limit config - * datapath - * @hdd_ctx: HDD Context - * @params: pointer to cdp_config_params to be updated - * - * Void - */ -static -void hdd_update_dp_config_rx_softirq_limits(struct hdd_context *hdd_ctx, - struct cdp_config_params *params) -{ - params->tx_comp_loop_pkt_limit = cfg_get(hdd_ctx->psoc, - CFG_DP_TX_COMP_LOOP_PKT_LIMIT); - params->rx_reap_loop_pkt_limit = cfg_get(hdd_ctx->psoc, - CFG_DP_RX_REAP_LOOP_PKT_LIMIT); - params->rx_hp_oos_update_limit = cfg_get(hdd_ctx->psoc, - CFG_DP_RX_HP_OOS_UPDATE_LIMIT); -} -#else -static -void hdd_update_dp_config_rx_softirq_limits(struct hdd_context *hdd_ctx, - struct cdp_config_params *params) -{ -} -#endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */ - -#if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL) -static void -hdd_update_dp_config_queue_threshold(struct hdd_context *hdd_ctx, - struct cdp_config_params *params) -{ - params->tx_flow_stop_queue_threshold = - cfg_get(hdd_ctx->psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH); - params->tx_flow_start_queue_offset = - cfg_get(hdd_ctx->psoc, - CFG_DP_TX_FLOW_START_QUEUE_OFFSET); -} -#else -static inline void -hdd_update_dp_config_queue_threshold(struct hdd_context *hdd_ctx, - struct cdp_config_params *params) -{ -} -#endif - /** * hdd_update_dp_config() - Propagate config parameters to Lithium * datapath @@ -19657,40 +19647,16 @@ hdd_update_dp_config_queue_threshold(struct hdd_context *hdd_ctx, */ static int hdd_update_dp_config(struct hdd_context *hdd_ctx) { - struct cdp_config_params params = {0}; + struct wlan_dp_user_config dp_cfg; QDF_STATUS status; - void *soc; - soc = cds_get_context(QDF_MODULE_ID_SOC); - params.tso_enable = cfg_get(hdd_ctx->psoc, CFG_DP_TSO); - params.lro_enable = cfg_get(hdd_ctx->psoc, CFG_DP_LRO); - hdd_update_dp_config_queue_threshold(hdd_ctx, ¶ms); - params.flow_steering_enable = - cfg_get(hdd_ctx->psoc, CFG_DP_FLOW_STEERING_ENABLED); - params.napi_enable = hdd_ctx->napi_enable; - params.p2p_tcp_udp_checksumoffload = - cfg_get(hdd_ctx->psoc, - CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD); - params.nan_tcp_udp_checksumoffload = - cfg_get(hdd_ctx->psoc, - CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD); - params.tcp_udp_checksumoffload = - cfg_get(hdd_ctx->psoc, - CFG_DP_TCP_UDP_CKSUM_OFFLOAD); - params.ipa_enable = ucfg_ipa_is_enabled(); - params.gro_enable = cfg_get(hdd_ctx->psoc, CFG_DP_GRO); - params.tx_comp_loop_pkt_limit = cfg_get(hdd_ctx->psoc, - CFG_DP_TX_COMP_LOOP_PKT_LIMIT); - params.rx_reap_loop_pkt_limit = cfg_get(hdd_ctx->psoc, - CFG_DP_RX_REAP_LOOP_PKT_LIMIT); - params.rx_hp_oos_update_limit = cfg_get(hdd_ctx->psoc, - CFG_DP_RX_HP_OOS_UPDATE_LIMIT); - hdd_update_dp_config_rx_softirq_limits(hdd_ctx, ¶ms); + dp_cfg.ipa_enable = ucfg_ipa_is_enabled(); + dp_cfg.arp_connectivity_map = CONNECTIVITY_CHECK_SET_ARP; - status = cdp_update_config_parameters(soc, ¶ms); - if (status) { - hdd_err("Failed to attach config parameters"); - return status; + status = ucfg_dp_update_config(hdd_ctx->psoc, &dp_cfg); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("failed DP PSOC configuration update"); + return -EINVAL; } return 0; diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index b914f6a42c..e99768c262 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -759,6 +759,8 @@ int hdd_ndi_set_mode(const char *iface_name) return -EFAULT; } ndi_mac_addr = &random_ndi_mac.bytes[0]; + ucfg_dp_update_inf_mac(hdd_ctx->psoc, &adapter->mac_addr, + (struct qdf_mac_addr *)ndi_mac_addr); hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr, (struct qdf_mac_addr *)ndi_mac_addr); qdf_mem_copy(&adapter->mac_addr, ndi_mac_addr, ETH_ALEN);