diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 599fcb41d984..24c03bed92bc 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -3057,7 +3057,7 @@ void hdd_start_complete(int ret); /** * hdd_chip_pwr_save_fail_detected_cb() - chip power save failure detected * callback - * @hddctx: HDD context + * @hdd_handle: HDD handle * @data: chip power save failure detected data * * This function reads the chip power save failure detected data and fill in @@ -3068,7 +3068,7 @@ void hdd_start_complete(int ret); * Return: none */ -void hdd_chip_pwr_save_fail_detected_cb(void *hddctx, +void hdd_chip_pwr_save_fail_detected_cb(hdd_handle_t hdd_handle, struct chip_pwr_save_fail_detected_params *data); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d01b5c09d351..62fd69761584 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4025,24 +4025,12 @@ wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy, #define PWR_SAVE_FAIL_CMD_INDEX \ QCA_NL80211_VENDOR_SUBCMD_PWR_SAVE_FAIL_DETECTED_INDEX -/** - * hdd_chip_pwr_save_fail_detected_cb() - chip power save failure detected - * callback - * @hddctx: HDD context - * @data: chip power save failure detected data - * - * This function reads the chip power save failure detected data and fill in - * the skb with NL attributes and send up the NL event. - * This callback execute in atomic context and must not invoke any - * blocking calls. - * - * Return: none - */ -void hdd_chip_pwr_save_fail_detected_cb(void *hddctx, + +void hdd_chip_pwr_save_fail_detected_cb(hdd_handle_t hdd_handle, struct chip_pwr_save_fail_detected_params *data) { - struct hdd_context *hdd_ctx = hddctx; + struct hdd_context *hdd_ctx = hdd_handle_to_context(hdd_handle); struct sk_buff *skb; int flags = cds_get_gfp_flags(); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index a5222f49ce6f..107bbf37bc61 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1834,9 +1834,9 @@ QDF_STATUS sme_set_rx_set_blocksize(tHalHandle hal, */ QDF_STATUS sme_get_rcpi(tHalHandle hal, struct sme_rcpi_req *rcpi); -/* +/** * sme_set_chip_pwr_save_fail_cb() - set chip power save failure callback - * @hal: global hal handle + * @mac_handle: opaque handle to the MAC context * @cb: callback function pointer * * This function stores the chip power save failure callback function. @@ -1844,8 +1844,8 @@ QDF_STATUS sme_get_rcpi(tHalHandle hal, struct sme_rcpi_req *rcpi); * Return: QDF_STATUS enumeration. */ -QDF_STATUS sme_set_chip_pwr_save_fail_cb(tHalHandle hal, void (*cb)(void *, - struct chip_pwr_save_fail_detected_params *)); +QDF_STATUS sme_set_chip_pwr_save_fail_cb(mac_handle_t mac_handle, + pwr_save_fail_cb cb); /** * sme_cli_set_command() - SME wrapper API over WMA "set" command * processor cmd diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h index 83d4e77b1495..c412d4ed87eb 100644 --- a/core/sme/inc/sme_internal.h +++ b/core/sme/inc/sme_internal.h @@ -167,6 +167,15 @@ struct chain_rssi_result; typedef void (*get_chain_rssi_callback)(void *context, struct chain_rssi_result *data); +/** + * typedef pwr_save_fail_cb - power save fail callback function + * @hdd_handle: HDD handle registered with SME + * @params: failure parameters + */ +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 struct tagSmeStruct { eSmeState state; qdf_mutex_t lkSmeGlobalLock; @@ -254,8 +263,7 @@ typedef struct tagSmeStruct { struct rso_cmd_status *rso_status); void (*congestion_cb)(void *, uint32_t congestion, uint32_t vdev_id); void (*stats_ext2_cb)(void *, struct sir_sme_rx_aggr_hole_ind *); - void (*chip_power_save_fail_cb)(void *, - struct chip_pwr_save_fail_detected_params *); + pwr_save_fail_cb chip_power_save_fail_cb; void (*bt_activity_info_cb)(void *context, uint32_t bt_activity); void *get_arp_stats_context; void (*get_arp_stats_cb)(void *, struct rsp_stats *, void *); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index c43bb8f96e26..c68e06368d9d 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -13073,12 +13073,11 @@ bool sme_is_any_session_in_connected_state(tHalHandle h_hal) return ret; } -QDF_STATUS sme_set_chip_pwr_save_fail_cb(tHalHandle hal, - void (*cb)(void *, - struct chip_pwr_save_fail_detected_params *)) { - - QDF_STATUS status = QDF_STATUS_SUCCESS; - tpAniSirGlobal mac = PMAC_STRUCT(hal); +QDF_STATUS sme_set_chip_pwr_save_fail_cb(mac_handle_t mac_handle, + pwr_save_fail_cb cb) +{ + QDF_STATUS status; + tpAniSirGlobal mac = MAC_CONTEXT(mac_handle); status = sme_acquire_global_lock(&mac->sme); if (status != QDF_STATUS_SUCCESS) {