Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[pandora-kernel.git] / drivers / staging / brcm80211 / sys / wlc_event.h
1 /*
2  * Copyright (c) 2010 Broadcom Corporation
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #ifndef _WLC_EVENT_H_
18 #define _WLC_EVENT_H_
19
20 typedef struct wlc_eventq wlc_eventq_t;
21
22 typedef void (*wlc_eventq_cb_t) (void *arg);
23
24 extern wlc_eventq_t *wlc_eventq_attach(wlc_pub_t *pub, struct wlc_info *wlc,
25                                        void *wl, wlc_eventq_cb_t cb);
26 extern int wlc_eventq_detach(wlc_eventq_t *eq);
27 extern int wlc_eventq_down(wlc_eventq_t *eq);
28 extern void wlc_event_free(wlc_eventq_t *eq, wlc_event_t *e);
29 extern wlc_event_t *wlc_eventq_next(wlc_eventq_t *eq, wlc_event_t *e);
30 extern int wlc_eventq_cnt(wlc_eventq_t *eq);
31 extern bool wlc_eventq_avail(wlc_eventq_t *eq);
32 extern wlc_event_t *wlc_eventq_deq(wlc_eventq_t *eq);
33 extern void wlc_eventq_enq(wlc_eventq_t *eq, wlc_event_t *e);
34 extern wlc_event_t *wlc_event_alloc(wlc_eventq_t *eq);
35
36 extern int wlc_eventq_register_ind(wlc_eventq_t *eq, void *bitvect);
37 extern int wlc_eventq_query_ind(wlc_eventq_t *eq, void *bitvect);
38 extern int wlc_eventq_test_ind(wlc_eventq_t *eq, int et);
39 extern int wlc_eventq_set_ind(wlc_eventq_t *eq, uint et, bool on);
40 extern void wlc_eventq_flush(wlc_eventq_t *eq);
41 extern void wlc_assign_event_msg(wlc_info_t *wlc, wl_event_msg_t *msg,
42                                  const wlc_event_t *e, u8 *data,
43                                  u32 len);
44
45 #ifdef MSGTRACE
46 extern void wlc_event_sendup_trace(struct wlc_info *wlc, hndrte_dev_t *bus,
47                                    u8 *hdr, u16 hdrlen, u8 *buf,
48                                    u16 buflen);
49 #endif
50
51 #endif                          /* _WLC_EVENT_H_ */