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 /* softmac ioctl definitions */
21 #define WLC_SET_SHORTSLOT_OVERRIDE 146
24 /* BMAC Note: High-only driver is no longer working in softirq context as it needs to block and
25 * sleep so perimeter lock has to be a semaphore instead of spinlock. This requires timers to be
26 * submitted to workqueue instead of being on kernel timer
29 struct timer_list timer;
30 struct brcms_info *wl;
32 void *arg; /* argument to fn */
36 struct brcms_timer *next;
38 char *name; /* Description of the timer */
43 uint subunit; /* WDS/BSS unit */
44 struct pci_dev *pci_dev;
47 #define MAX_FW_IMAGES 4
48 struct brcms_firmware {
50 const struct firmware *fw_bin[MAX_FW_IMAGES];
51 const struct firmware *fw_hdr[MAX_FW_IMAGES];
52 u32 hdr_num_entries[MAX_FW_IMAGES];
56 struct wlc_pub *pub; /* pointer to public wlc state */
57 void *wlc; /* pointer to private common os-independent data */
62 spinlock_t lock; /* per-device perimeter lock */
63 spinlock_t isr_lock; /* per-device ISR synchronization lock */
65 /* bus type and regsva for unmap in brcms_free() */
66 uint bcm_bustype; /* bus type */
67 void *regsva; /* opaque chip registers virtual address */
69 /* timer related fields */
70 atomic_t callbacks; /* # outstanding callback functions */
71 struct brcms_timer *timers; /* timer cleanup queue */
73 struct tasklet_struct tasklet; /* dpc tasklet */
74 bool resched; /* dpc needs to be and is rescheduled */
76 u32 pci_psstate[16]; /* pci ps-state save/restore */
78 struct brcms_firmware fw;
86 extern void brcms_init(struct brcms_info *wl);
87 extern uint brcms_reset(struct brcms_info *wl);
88 extern void brcms_intrson(struct brcms_info *wl);
89 extern u32 brcms_intrsoff(struct brcms_info *wl);
90 extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
91 extern int brcms_up(struct brcms_info *wl);
92 extern void brcms_down(struct brcms_info *wl);
93 extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
94 bool state, int prio);
95 extern bool wl_alloc_dma_resources(struct brcms_info *wl, uint dmaddrwidth);
96 extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
100 extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
101 void (*fn) (void *arg), void *arg,
103 extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer);
104 extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer,
105 uint ms, int periodic);
106 extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer);
107 extern void brcms_msleep(struct brcms_info *wl, uint ms);
109 #endif /* _BRCM_MAC80211_IF_H_ */