1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef _wl_mac80211_h_
18#define _wl_mac80211_h_
19
20#include <wlc_types.h>
21
22
23
24
25
26typedef struct wl_timer {
27 struct timer_list timer;
28 struct wl_info *wl;
29 void (*fn) (void *);
30 void *arg;
31 uint ms;
32 bool periodic;
33 bool set;
34 struct wl_timer *next;
35#ifdef BCMDBG
36 char *name;
37#endif
38} wl_timer_t;
39
40
41
42
43
44typedef struct wl_task {
45 struct work_struct work;
46 void *context;
47} wl_task_t;
48
49struct wl_if {
50 uint subunit;
51 struct pci_dev *pci_dev;
52};
53
54#define WL_MAX_FW 4
55struct wl_firmware {
56 u32 fw_cnt;
57 const struct firmware *fw_bin[WL_MAX_FW];
58 const struct firmware *fw_hdr[WL_MAX_FW];
59 u32 hdr_num_entries[WL_MAX_FW];
60};
61
62struct wl_info {
63 struct wlc_pub *pub;
64 void *wlc;
65 struct osl_info *osh;
66 u32 magic;
67
68 int irq;
69
70 spinlock_t lock;
71 spinlock_t isr_lock;
72 uint bcm_bustype;
73 bool piomode;
74 void *regsva;
75 atomic_t callbacks;
76 struct wl_timer *timers;
77 struct tasklet_struct tasklet;
78 bool resched;
79#ifdef LINUXSTA_PS
80 u32 pci_psstate[16];
81#endif
82
83 uint stats_id;
84
85 struct net_device_stats stats_watchdog[2];
86 struct wl_firmware fw;
87};
88
89#define WL_LOCK(wl) spin_lock_bh(&(wl)->lock)
90#define WL_UNLOCK(wl) spin_unlock_bh(&(wl)->lock)
91
92
93#define WL_ISRLOCK(wl, flags) do {spin_lock(&(wl)->isr_lock); (void)(flags); } while (0)
94#define WL_ISRUNLOCK(wl, flags) do {spin_unlock(&(wl)->isr_lock); (void)(flags); } while (0)
95
96
97#define INT_LOCK(wl, flags) spin_lock_irqsave(&(wl)->isr_lock, flags)
98#define INT_UNLOCK(wl, flags) spin_unlock_irqrestore(&(wl)->isr_lock, flags)
99
100#ifndef PCI_D0
101#define PCI_D0 0
102#endif
103
104#ifndef PCI_D3hot
105#define PCI_D3hot 3
106#endif
107
108
109
110extern irqreturn_t wl_isr(int irq, void *dev_id);
111
112extern int __devinit wl_pci_probe(struct pci_dev *pdev,
113 const struct pci_device_id *ent);
114extern void wl_free(struct wl_info *wl);
115extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
116
117#endif
118