qcacld-3.0: Refine the RSSI Threshold Breach callback API
The RSSI Threshold Breach callback currently specifies a void pointer for the context. In the case of this API the context is actually known to be an HDD handle, so update the API to explicitly use this type. This will allow the compiler to verify that the correct type of parameter is being passed. Change-Id: Ifbedc0a0b38f4f9251524842595af296034153f9 CRs-Fixed: 2277278
Esse commit está contido em:
@@ -8419,20 +8419,10 @@ wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_rssi_threshold_breached() - rssi breached NL event
|
||||
* @hddctx: HDD context
|
||||
* @data: rssi breached event data
|
||||
*
|
||||
* This function reads the rssi breached event %data and fill in the skb with
|
||||
* NL attributes and send up the NL event.
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hdd_rssi_threshold_breached(void *hddctx,
|
||||
void hdd_rssi_threshold_breached(hdd_handle_t hdd_handle,
|
||||
struct rssi_breach_event *data)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = hddctx;
|
||||
struct hdd_context *hdd_ctx = hdd_handle_to_context(hdd_handle);
|
||||
struct sk_buff *skb;
|
||||
|
||||
hdd_enter();
|
||||
@@ -8456,16 +8446,16 @@ void hdd_rssi_threshold_breached(void *hddctx,
|
||||
}
|
||||
|
||||
hdd_debug("Req Id: %u Current rssi: %d",
|
||||
data->request_id, data->curr_rssi);
|
||||
hdd_debug("Current BSSID: "MAC_ADDRESS_STR,
|
||||
MAC_ADDR_ARRAY(data->curr_bssid.bytes));
|
||||
data->request_id, data->curr_rssi);
|
||||
hdd_debug("Current BSSID: " MAC_ADDRESS_STR,
|
||||
MAC_ADDR_ARRAY(data->curr_bssid.bytes));
|
||||
|
||||
if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID,
|
||||
data->request_id) ||
|
||||
data->request_id) ||
|
||||
nla_put(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_BSSID,
|
||||
sizeof(data->curr_bssid), data->curr_bssid.bytes) ||
|
||||
sizeof(data->curr_bssid), data->curr_bssid.bytes) ||
|
||||
nla_put_s8(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI,
|
||||
data->curr_rssi)) {
|
||||
data->curr_rssi)) {
|
||||
hdd_err("nla put fail");
|
||||
goto fail;
|
||||
}
|
||||
|
@@ -368,7 +368,17 @@ void wlan_hdd_cfg80211_extscan_callback(hdd_handle_t hdd_handle,
|
||||
*/
|
||||
void wlan_hdd_rso_cmd_status_cb(void *ctx, struct rso_cmd_status *rso_status);
|
||||
|
||||
void hdd_rssi_threshold_breached(void *hddctx,
|
||||
/**
|
||||
* hdd_rssi_threshold_breached() - rssi breached NL event
|
||||
* @hdd_handle: HDD handle
|
||||
* @data: rssi breached event data
|
||||
*
|
||||
* This function reads the rssi breached event %data and fill in the skb with
|
||||
* NL attributes and send up the NL event.
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hdd_rssi_threshold_breached(hdd_handle_t hdd_handle,
|
||||
struct rssi_breach_event *data);
|
||||
|
||||
struct cfg80211_bss *
|
||||
|
@@ -1116,9 +1116,29 @@ QDF_STATUS sme_disable_uapsd_for_ac(uint8_t sta_id,
|
||||
|
||||
QDF_STATUS sme_set_rssi_monitoring(tHalHandle hal,
|
||||
struct rssi_monitor_req *input);
|
||||
QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle hal,
|
||||
void (*cb)(void *, struct rssi_breach_event *));
|
||||
QDF_STATUS sme_reset_rssi_threshold_breached_cb(tHalHandle hal);
|
||||
|
||||
/**
|
||||
* sme_set_rssi_threshold_breached_cb() - Set RSSI threshold breached callback
|
||||
* @mac_handle: global MAC handle
|
||||
* @cb: callback function pointer
|
||||
*
|
||||
* This function registers the RSSI threshold breached callback function.
|
||||
*
|
||||
* Return: QDF_STATUS enumeration.
|
||||
*/
|
||||
QDF_STATUS sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,
|
||||
rssi_threshold_breached_cb cb);
|
||||
|
||||
/**
|
||||
* sme_reset_rssi_threshold_breached_cb() - Reset RSSI threshold breached
|
||||
* callback
|
||||
* @mac_handle: global MAC handle
|
||||
*
|
||||
* This function de-registers the RSSI threshold breached callback function.
|
||||
*
|
||||
* Return: QDF_STATUS enumeration.
|
||||
*/
|
||||
QDF_STATUS sme_reset_rssi_threshold_breached_cb(mac_handle_t mac_handle);
|
||||
|
||||
QDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal,
|
||||
sir_mgmt_frame_ind_callback callback);
|
||||
|
@@ -156,6 +156,14 @@ typedef void (*apf_read_mem_cb)(void *context,
|
||||
*evt);
|
||||
#endif /* FEATURE_WLAN_APF */
|
||||
|
||||
/**
|
||||
* typedef rssi_threshold_breached_cb - RSSI threshold breach callback
|
||||
* @hdd_handle: Opaque handle to the HDD context
|
||||
* @event: The RSSI breach event
|
||||
*/
|
||||
typedef void (*rssi_threshold_breached_cb)(hdd_handle_t hdd_handle,
|
||||
struct rssi_breach_event *event);
|
||||
|
||||
/**
|
||||
* typedef sme_encrypt_decrypt_callback - encrypt/decrypt callback
|
||||
* signature
|
||||
@@ -250,7 +258,7 @@ typedef struct tagSmeStruct {
|
||||
void (*pGetTemperatureCb)(int temperature, void *context);
|
||||
uint8_t miracast_value;
|
||||
struct ps_global_info ps_global_info;
|
||||
void (*rssi_threshold_breached_cb)(void *, struct rssi_breach_event *);
|
||||
rssi_threshold_breached_cb rssi_threshold_breached_cb;
|
||||
hw_mode_transition_cb sme_hw_mode_trans_cb;
|
||||
/* OCB callbacks */
|
||||
void *ocb_set_config_context;
|
||||
|
@@ -12976,33 +12976,21 @@ QDF_STATUS sme_set_nud_debug_stats_cb(tHalHandle hal,
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_set_rssi_threshold_breached_cb() - set rssi threshold breached callback
|
||||
* @h_hal: global hal handle
|
||||
* @cb: callback function pointer
|
||||
* @context: callback context
|
||||
*
|
||||
* This function stores the rssi threshold breached callback function.
|
||||
*
|
||||
* Return: QDF_STATUS enumeration.
|
||||
*/
|
||||
QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle h_hal,
|
||||
void (*cb)(void *, struct rssi_breach_event *))
|
||||
QDF_STATUS sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,
|
||||
rssi_threshold_breached_cb cb)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
QDF_STATUS status;
|
||||
tpAniSirGlobal mac;
|
||||
|
||||
if (!h_hal) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("hHal is not valid"));
|
||||
mac = MAC_CONTEXT(mac_handle);
|
||||
if (!mac) {
|
||||
sme_err("Invalid mac context");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
mac = PMAC_STRUCT(h_hal);
|
||||
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("sme_acquire_global_lock failed!(status=%d)"),
|
||||
sme_err("sme_acquire_global_lock failed!(status=%d)",
|
||||
status);
|
||||
return status;
|
||||
}
|
||||
@@ -13012,28 +13000,9 @@ QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle h_hal,
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_set_rssi_threshold_breached_cb() - Reset rssi threshold breached callback
|
||||
* @hal: global hal handle
|
||||
*
|
||||
* This function de-registers the rssi threshold breached callback function.
|
||||
*
|
||||
* Return: QDF_STATUS enumeration.
|
||||
*/
|
||||
QDF_STATUS sme_reset_rssi_threshold_breached_cb(tHalHandle hal)
|
||||
QDF_STATUS sme_reset_rssi_threshold_breached_cb(mac_handle_t mac_handle)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
tpAniSirGlobal mac = PMAC_STRUCT(hal);
|
||||
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
sme_err("sme_acquire_global_lock failed!(status=%d)", status);
|
||||
return status;
|
||||
}
|
||||
|
||||
mac->sme.rssi_threshold_breached_cb = NULL;
|
||||
sme_release_global_lock(&mac->sme);
|
||||
return status;
|
||||
return sme_set_rssi_threshold_breached_cb(mac_handle, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Referência em uma nova issue
Block a user