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
* @context_ptr - hdd context pointer
* @event_ptr - event structure pointer
* @context: context registered with sme_register_p2p_lo_event(). HDD
* always registers a hdd context pointer
* @evt:event structure pointer
*
* This is the p2p listen offload stop event handler, it sends vendor
* event back to supplicant to notify the stop reason.
*
* Return: None
*/
static void wlan_hdd_p2p_lo_event_callback(void *context_ptr,
void *event_ptr)
static void wlan_hdd_p2p_lo_event_callback(void *context,
struct sir_p2p_lo_event *evt)
{
struct hdd_context *hdd_ctx = (struct hdd_context *)context_ptr;
struct sir_p2p_lo_event *evt = event_ptr;
struct hdd_context *hdd_ctx = context;
struct sk_buff *vendor_event;
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 (*sme_set_thermal_level_callback)(hdd_handle_t hdd_handle,
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
typedef void (*sme_send_oem_data_rsp_msg)(struct oem_data_rsp *);
#endif

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->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;