qcacld-3.0: Refine the P2P LO callback API

The P2P LO Callback currently specifies a void pointer for the event
payload. In the case of this API the event payload is always a struct
sir_p2p_lo_event so update the API to explicitly use this type. In
addition, currently the callback is not using the registered
user-supplied context, so update the callback to correctly use the
user-supplied context.

Change-Id: I566facea3c92b377823c1b3e38f99c84bc65e9d4
CRs-Fixed: 2278587
This commit is contained in:
Jeff Johnson
2018-07-04 21:14:02 -07:00
committed by nshrivas
parent 6619bc276c
commit f7e36d6e4e
4 changed files with 11 additions and 9 deletions

View File

@@ -10088,19 +10088,19 @@ out:
/** /**
* wlan_hdd_p2p_lo_event_callback - P2P listen offload stop event handler * wlan_hdd_p2p_lo_event_callback - P2P listen offload stop event handler
* @context_ptr - hdd context pointer * @context: context registered with sme_register_p2p_lo_event(). HDD
* @event_ptr - event structure pointer * always registers a hdd context pointer
* @evt:event structure pointer
* *
* This is the p2p listen offload stop event handler, it sends vendor * This is the p2p listen offload stop event handler, it sends vendor
* event back to supplicant to notify the stop reason. * event back to supplicant to notify the stop reason.
* *
* Return: None * Return: None
*/ */
static void wlan_hdd_p2p_lo_event_callback(void *context_ptr, static void wlan_hdd_p2p_lo_event_callback(void *context,
void *event_ptr) struct sir_p2p_lo_event *evt)
{ {
struct hdd_context *hdd_ctx = (struct hdd_context *)context_ptr; struct hdd_context *hdd_ctx = context;
struct sir_p2p_lo_event *evt = event_ptr;
struct sk_buff *vendor_event; struct sk_buff *vendor_event;
struct hdd_adapter *adapter; struct hdd_adapter *adapter;

View File

@@ -150,7 +150,8 @@ typedef void (*ext_scan_ind_cb)(hdd_handle_t hdd_handle,
typedef void (*ocb_callback)(void *context, void *response); typedef void (*ocb_callback)(void *context, void *response);
typedef void (*sme_set_thermal_level_callback)(hdd_handle_t hdd_handle, typedef void (*sme_set_thermal_level_callback)(hdd_handle_t hdd_handle,
u_int8_t level); u_int8_t level);
typedef void (*p2p_lo_callback)(void *context, void *event); typedef void (*p2p_lo_callback)(void *context,
struct sir_p2p_lo_event *event);
#ifdef FEATURE_OEM_DATA_SUPPORT #ifdef FEATURE_OEM_DATA_SUPPORT
typedef void (*sme_send_oem_data_rsp_msg)(struct oem_data_rsp *); typedef void (*sme_send_oem_data_rsp_msg)(struct oem_data_rsp *);
#endif #endif

View File

@@ -14382,7 +14382,7 @@ void sme_update_hw_dbs_capable(tHalHandle hal, uint8_t hw_dbs_capable)
* Return: none * Return: none
*/ */
void sme_register_p2p_lo_event(tHalHandle hHal, void *context, void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
p2p_lo_callback callback) p2p_lo_callback callback)
{ {
tpAniSirGlobal pMac = PMAC_STRUCT(hHal); tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;

View File

@@ -5121,7 +5121,8 @@ int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
event->vdev_id = fix_param->vdev_id; event->vdev_id = fix_param->vdev_id;
event->reason_code = fix_param->reason; event->reason_code = fix_param->reason;
p_mac->sme.p2p_lo_event_callback(p_mac->hdd_handle, event); p_mac->sme.p2p_lo_event_callback(p_mac->sme.p2p_lo_event_context,
event);
wma->interfaces[event->vdev_id].p2p_lo_in_progress = false; wma->interfaces[event->vdev_id].p2p_lo_in_progress = false;