diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 62fd69761584..dc4698b533a4 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12492,10 +12492,10 @@ end: return err; } -void hdd_update_cca_info_cb(void *context, uint32_t congestion, +void hdd_update_cca_info_cb(hdd_handle_t hdd_handle, uint32_t congestion, uint32_t vdev_id) { - struct hdd_context *hdd_ctx = (struct hdd_context *)context; + struct hdd_context *hdd_ctx = hdd_handle_to_context(hdd_handle); int status; struct hdd_adapter *adapter = NULL; struct hdd_station_ctx *hdd_sta_ctx; diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 2a8db153a0f7..ad449dc7fb1b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -520,14 +520,14 @@ int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason); /** * hdd_update_cca_info_cb() - stores congestion value in station context - * @context : HDD context - * @congestion : congestion - * @vdev_id : vdev id + * @hdd_handle: HDD handle + * @congestion: congestion + * @vdev_id: vdev id * * Return: None */ -void hdd_update_cca_info_cb(void *context, uint32_t congestion, - uint32_t vdev_id); +void hdd_update_cca_info_cb(hdd_handle_t hdd_handle, uint32_t congestion, + uint32_t vdev_id); /** * wlan_hdd_get_adjacent_chan(): Gets next/previous channel diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 107bbf37bc61..7f6685da1f47 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1706,14 +1706,14 @@ QDF_STATUS sme_fast_reassoc(tHalHandle hal, struct csr_roam_profile *profile, uint8_t vdev_id, const tSirMacAddr connected_bssid); #endif /** - * sme_congestion_register_callback(): registers congestion callback + * sme_congestion_register_callback() - registers congestion callback * @hal: handler for HAL * @congestion_cb: congestion callback * * Return: QDF_STATUS */ QDF_STATUS sme_congestion_register_callback(tHalHandle hal, - void (*congestion_cb)(void *, uint32_t congestion, uint32_t vdev_id)); + congestion_cb congestion_cb); /** * sme_register_tx_queue_cb(): Register tx queue callback diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h index c412d4ed87eb..2ba17393fc74 100644 --- a/core/sme/inc/sme_internal.h +++ b/core/sme/inc/sme_internal.h @@ -176,6 +176,15 @@ struct chip_pwr_save_fail_detected_params; typedef void (*pwr_save_fail_cb)(hdd_handle_t hdd_handle, struct chip_pwr_save_fail_detected_params *params); +/** + * typedef congestion_cb - congestion callback function + * @hdd_handle: HDD handle registered with SME + * @congestion: Current congestion value + * @vdev_id: ID of the vdev for which congestion is being reported + */ +typedef void (*congestion_cb)(hdd_handle_t hdd_handle, uint32_t congestion, + uint32_t vdev_id); + typedef struct tagSmeStruct { eSmeState state; qdf_mutex_t lkSmeGlobalLock; @@ -261,7 +270,7 @@ typedef struct tagSmeStruct { enum scan_reject_states *reason); void (*rso_cmd_status_cb)(void *hdd_context, struct rso_cmd_status *rso_status); - void (*congestion_cb)(void *, uint32_t congestion, uint32_t vdev_id); + congestion_cb congestion_cb; void (*stats_ext2_cb)(void *, struct sir_sme_rx_aggr_hole_ind *); pwr_save_fail_cb chip_power_save_fail_cb; void (*bt_activity_info_cb)(void *context, uint32_t bt_activity); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index c68e06368d9d..fd227cb7552f 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -15398,7 +15398,7 @@ void sme_store_pdev(tHalHandle hal, struct wlan_objmgr_pdev *pdev) } QDF_STATUS sme_congestion_register_callback(tHalHandle hal, - void (*congestion_cb)(void *, uint32_t congestion, uint32_t vdev_id)) + congestion_cb congestion_cb) { QDF_STATUS status; tpAniSirGlobal mac = PMAC_STRUCT(hal);