1/*
2 * P2P discovery state machine.
3 *
4 * Copyright (C) 2015, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied
9 * or duplicated in any form, in whole or in part, without the prior
10 * written permission of Broadcom Corporation.
11 *
12 * $Id:$
13 */
14
15#ifndef _BCM_P2P_DISCOVERY_H_
16#define _BCM_P2P_DISCOVERY_H_
17
18typedef struct bcm_p2p_discovery bcm_p2p_discovery_t;
19
20/* Opaque driver handle type. In dongle this is struct wlc_info_t, representing
21 * the driver. On linux host this is struct ifreq, representing the primary OS
22 * interface for a driver instance. To specify a virtual interface this should
23 * be used together with a bsscfg index.
24 */
25struct bcm_p2p_discovery_wl_drv_hdl;
26
27/* initialize P2P discovery */
28int bcm_p2p_discovery_initialize(void);
29
30/* deinitialize P2P discovery */
31int bcm_p2p_discovery_deinitialize(void);
32
33/* create P2P discovery */
34bcm_p2p_discovery_t *bcm_p2p_discovery_create(
35	struct bcm_p2p_discovery_wl_drv_hdl *drv, uint16 listenChannel);
36
37/* destroy P2P discovery */
38int bcm_p2p_discovery_destroy(bcm_p2p_discovery_t *disc);
39
40/* reset P2P discovery */
41int bcm_p2p_discovery_reset(bcm_p2p_discovery_t *disc);
42
43/* start P2P discovery */
44int bcm_p2p_discovery_start_discovery(bcm_p2p_discovery_t *disc);
45
46/* start P2P extended listen */
47/* for continuous listen set on=non-zero (e.g. 5000), off=0 */
48int bcm_p2p_discovery_start_ext_listen(bcm_p2p_discovery_t *disc,
49	uint16 listenOnTimeout, uint16 listenOffTimeout);
50
51/* get bsscfg index of P2P discovery interface */
52/* bsscfg index is valid only after started */
53int bcm_p2p_discovery_get_bsscfg_index(bcm_p2p_discovery_t *disc);
54
55/* wlan event handler */
56void bcm_p2p_discovery_process_wlan_event(void *context, uint32 eventType,
57	wl_event_msg_t *wlEvent, uint8 *data, uint32 length);
58
59#endif /* _BCM_P2P_DISCOVERY_H_ */
60