1/*****************************************************************************
2 * WPS adaptation layer
3 * Header file for WPS adaptation layer
4 * Copyright (C) 2014, 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 * $Id: wps_al.h,v 1.1 2010-08-09 19:28:58 $
12 *****************************************************************************
13*/
14
15
16#if !defined(__WPS_AL_H__)
17#define __WPS_AL_H__
18
19struct wps_dat;
20struct cfg_ctx;
21struct cfg_ctx_set_cfg;
22struct bcmseclib_ev_wps;
23
24struct wps_cbs {
25	void (*result)(struct cfg_ctx *, const struct bcmseclib_ev_wps *);
26};
27
28/* sup/enrollee */
29
30extern int
31wps_sup_enr_cfg(struct wps_dat *);
32
33extern int
34wps_sup_enr_cleanup(struct wps_dat *);
35
36extern int
37wps_sup_eapol_hdlr(void *arg, void *frame, int len);
38
39extern int
40wps_sup_handle_event(void *arg, void *event, int len);
41
42extern int
43wps_sup_unpack(struct cfg_ctx *, struct wps_dat *,
44			   const struct cfg_ctx_set_cfg *);
45
46/* auth/registrar */
47
48extern int
49wps_auth_cfg(struct wps_dat *dat);
50
51extern int
52wps_auth_cleanup(struct wps_dat *dat);
53
54extern int
55wps_auth_eapol_hdlr(void *arg, void *pkt, int len);
56
57extern int
58wps_auth_handle_event(void *arg, void *pevt, int len);
59
60extern int
61wps_auth_unpack(struct cfg_ctx *, struct wps_dat *,
62				const struct cfg_ctx_set_cfg *);
63
64/* common */
65
66extern void
67wps_cbs(struct wps_dat *, const struct wps_cbs *);
68
69extern void
70wps_set_eapol_tx(struct wps_dat *, void *);
71
72extern void
73wps_events(void *ctx, void *priv);
74
75extern struct cfg_ctx *
76wps_get_ctx(struct wps_dat *);
77
78extern void
79wps_set_ctx(struct wps_dat *, struct cfg_ctx *);
80
81#if defined(WPS_CFG_PRIVATE)
82
83/*
84 * wps private
85*/
86
87struct wps_dat {
88
89	/* al dat */
90	uchar is_started : 1;
91	uchar is_session : 1;
92	struct bcmseclib_timer *timer;
93
94	/* svc */
95	const struct wps_cbs *cb;
96
97	/* cfg */
98	char pin[9];
99	uint8 ssid[DOT11_MAX_SSID_LEN];
100	int ssid_len;
101	char nw_key[64+1];
102	unsigned auth_type;
103	unsigned encr_type;
104	uint16 wep_index;
105	uint8 peer_mac_addr[6];
106
107	/* svc wiring */
108	struct cfg_ctx *ctx; /* back pointer */
109	struct bind_sk eapol, wlss;
110	void *eapol_tx;
111
112}; /* struct wps_dat */
113
114#endif /* defined(WPS_CFG_PRIVATE) */
115
116#endif /* __WPS_AL_H__ */
117