diff --git a/core/hdd/inc/wlan_hdd_tx_rx.h b/core/hdd/inc/wlan_hdd_tx_rx.h index 9b156a7d22c4..2e633e6349d8 100644 --- a/core/hdd/inc/wlan_hdd_tx_rx.h +++ b/core/hdd/inc/wlan_hdd_tx_rx.h @@ -108,14 +108,14 @@ void hdd_tx_rx_collect_connectivity_stats_info(struct sk_buff *skb, /** * hdd_tx_queue_cb() - Disable/Enable the Transmit Queues - * @context: HDD context + * @hdd_handle: HDD handle * @vdev_id: vdev id * @action: Action to be taken on the Tx Queues * @reason: Reason for the netif action * * Return: None */ -void hdd_tx_queue_cb(void *context, uint32_t vdev_id, +void hdd_tx_queue_cb(hdd_handle_t hdd_handle, uint32_t vdev_id, enum netif_action_type action, enum netif_reason_type reason); diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index c17a97c9e538..39efa5ae1eca 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -2545,12 +2545,12 @@ void hdd_send_rps_disable_ind(struct hdd_adapter *adapter) cds_cfg->rps_enabled = false; } -void hdd_tx_queue_cb(void *context, uint32_t vdev_id, +void hdd_tx_queue_cb(hdd_handle_t hdd_handle, uint32_t vdev_id, enum netif_action_type action, enum netif_reason_type reason) { - struct hdd_context *hdd_ctx = (struct hdd_context *)context; - struct hdd_adapter *adapter = NULL; + struct hdd_context *hdd_ctx = hdd_handle_to_context(hdd_handle); + struct hdd_adapter *adapter; /* * Validating the context is not required here. @@ -2559,13 +2559,13 @@ void hdd_tx_queue_cb(void *context, uint32_t vdev_id, * driver got a firmware event of sta kick out, then it is * good to disable the Tx Queue to stop the influx of traffic. */ - if (hdd_ctx == NULL) { + if (!hdd_ctx) { hdd_err("Invalid context passed"); return; } adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id); - if (adapter == NULL) { + if (!adapter) { hdd_err("vdev_id %d does not exist with host", vdev_id); return; } diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 8b3e31e15282..e656fe20b37b 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1748,24 +1748,21 @@ QDF_STATUS sme_congestion_register_callback(tHalHandle hal, /** * sme_register_tx_queue_cb(): Register tx queue callback - * @hal: handler for HAL + * @mac_handle: Opaque handle for MAC context * @tx_queue_cb: Transmit Queues callback * * Return: QDF_STATUS */ -QDF_STATUS sme_register_tx_queue_cb(tHalHandle hal, - void (*tx_queue_cb)(void *, - uint32_t vdev_id, - enum netif_action_type action, - enum netif_reason_type reason)); +QDF_STATUS sme_register_tx_queue_cb(mac_handle_t mac_handle, + tx_queue_cb tx_queue_cb); /** * sme_deregister_tx_queue_cb() - Deregister the tx queue callback - * @hal: HAL handle + * @mac_handle: Opaque handle for MAC context * * Return: QDF status */ -QDF_STATUS sme_deregister_tx_queue_cb(tHalHandle hal); +QDF_STATUS sme_deregister_tx_queue_cb(mac_handle_t mac_handle); /** * sme_rso_cmd_status_cb() - Set RSO cmd status callback diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h index 5e832ddbb611..1f1565f7d88d 100644 --- a/core/sme/inc/sme_internal.h +++ b/core/sme/inc/sme_internal.h @@ -186,6 +186,10 @@ struct chain_rssi_result; typedef void (*get_chain_rssi_callback)(void *context, struct chain_rssi_result *data); +typedef void (*tx_queue_cb)(hdd_handle_t hdd_handle, uint32_t vdev_id, + enum netif_action_type action, + enum netif_reason_type reason); + /** * typedef pwr_save_fail_cb - power save fail callback function * @hdd_handle: HDD handle registered with SME @@ -296,9 +300,7 @@ typedef struct tagSmeStruct { void (*get_arp_stats_cb)(void *, struct rsp_stats *, void *); get_chain_rssi_callback get_chain_rssi_cb; void *get_chain_rssi_context; - void (*tx_queue_cb)(void *, uint32_t vdev_id, - enum netif_action_type action, - enum netif_reason_type reason); + tx_queue_cb tx_queue_cb; twt_enable_cb twt_enable_cb; twt_disable_cb twt_disable_cb; #ifdef FEATURE_WLAN_APF diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 7ea5edecfa4e..cd2d72b7b8f1 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -15375,14 +15375,11 @@ QDF_STATUS sme_congestion_register_callback(tHalHandle hal, return status; } -QDF_STATUS sme_register_tx_queue_cb(tHalHandle hal, - void (*tx_queue_cb)(void *, - uint32_t vdev_id, - enum netif_action_type action, - enum netif_reason_type reason)) +QDF_STATUS sme_register_tx_queue_cb(mac_handle_t mac_handle, + tx_queue_cb tx_queue_cb) { QDF_STATUS status; - tpAniSirGlobal mac = PMAC_STRUCT(hal); + tpAniSirGlobal mac = MAC_CONTEXT(mac_handle); status = sme_acquire_global_lock(&mac->sme); if (QDF_IS_STATUS_SUCCESS(status)) { @@ -15396,9 +15393,9 @@ QDF_STATUS sme_register_tx_queue_cb(tHalHandle hal, return status; } -QDF_STATUS sme_deregister_tx_queue_cb(tHalHandle hal) +QDF_STATUS sme_deregister_tx_queue_cb(mac_handle_t mac_handle) { - return sme_register_tx_queue_cb(hal, NULL); + return sme_register_tx_queue_cb(mac_handle, NULL); } #ifdef WLAN_SUPPORT_TWT