staging: brcm80211: removed unused bus code from softmac
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / brcm80211 / brcmsmac / mac80211_if.h
blobc574723eece8c6f62f5396509cbdca9e6732522f
1 /*
2 * Copyright (c) 2010 Broadcom Corporation
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.
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.
17 #ifndef _BRCM_MAC80211_IF_H_
18 #define _BRCM_MAC80211_IF_H_
20 #include <linux/timer.h>
21 #include <linux/interrupt.h>
23 /* softmac ioctl definitions */
24 #define BRCMS_SET_SHORTSLOT_OVERRIDE 146
26 struct brcms_timer {
27 struct timer_list timer;
28 struct brcms_info *wl;
29 void (*fn) (void *);
30 void *arg; /* argument to fn */
31 uint ms;
32 bool periodic;
33 bool set;
34 struct brcms_timer *next;
35 #ifdef BCMDBG
36 char *name; /* Description of the timer */
37 #endif
40 struct brcms_if {
41 uint subunit; /* WDS/BSS unit */
42 struct pci_dev *pci_dev;
45 #define MAX_FW_IMAGES 4
46 struct brcms_firmware {
47 u32 fw_cnt;
48 const struct firmware *fw_bin[MAX_FW_IMAGES];
49 const struct firmware *fw_hdr[MAX_FW_IMAGES];
50 u32 hdr_num_entries[MAX_FW_IMAGES];
53 struct brcms_info {
54 struct brcms_pub *pub; /* pointer to public wlc state */
55 void *wlc; /* pointer to private common data */
56 u32 magic;
58 int irq;
60 spinlock_t lock; /* per-device perimeter lock */
61 spinlock_t isr_lock; /* per-device ISR synchronization lock */
63 /* regsva for unmap in brcms_free() */
64 void *regsva; /* opaque chip registers virtual address */
66 /* timer related fields */
67 atomic_t callbacks; /* # outstanding callback functions */
68 struct brcms_timer *timers; /* timer cleanup queue */
70 struct tasklet_struct tasklet; /* dpc tasklet */
71 bool resched; /* dpc needs to be and is rescheduled */
72 #ifdef LINUXSTA_PS
73 u32 pci_psstate[16]; /* pci ps-state save/restore */
74 #endif
75 struct brcms_firmware fw;
76 struct wiphy *wiphy;
79 /* misc callbacks */
80 extern void brcms_init(struct brcms_info *wl);
81 extern uint brcms_reset(struct brcms_info *wl);
82 extern void brcms_intrson(struct brcms_info *wl);
83 extern u32 brcms_intrsoff(struct brcms_info *wl);
84 extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
85 extern int brcms_up(struct brcms_info *wl);
86 extern void brcms_down(struct brcms_info *wl);
87 extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
88 bool state, int prio);
89 extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
91 /* timer functions */
92 extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
93 void (*fn) (void *arg), void *arg,
94 const char *name);
95 extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer);
96 extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer,
97 uint ms, int periodic);
98 extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer);
99 extern void brcms_msleep(struct brcms_info *wl, uint ms);
101 #endif /* _BRCM_MAC80211_IF_H_ */