1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef _BRCM_MAC80211_IF_H_
18 #define _BRCM_MAC80211_IF_H_
19
20 #include <linux/timer.h>
21 #include <linux/interrupt.h>
22 #include <linux/workqueue.h>
23 #include <linux/leds.h>
24
25 #include "ucode_loader.h"
26 #include "led.h"
27
28
29
30
31 #define BRCMS_LEGACY_5G_RATE_OFFSET 4
32
33
34 #define BRCMS_SET_SHORTSLOT_OVERRIDE 146
35
36 struct brcms_timer {
37 struct delayed_work dly_wrk;
38 struct brcms_info *wl;
39 void (*fn) (void *);
40 void *arg;
41 uint ms;
42 bool periodic;
43 bool set;
44 struct brcms_timer *next;
45 #ifdef DEBUG
46 char *name;
47 #endif
48 };
49
50 struct brcms_if {
51 uint subunit;
52 struct pci_dev *pci_dev;
53 };
54
55 #define MAX_FW_IMAGES 4
56 struct brcms_firmware {
57 u32 fw_cnt;
58 const struct firmware *fw_bin[MAX_FW_IMAGES];
59 const struct firmware *fw_hdr[MAX_FW_IMAGES];
60 u32 hdr_num_entries[MAX_FW_IMAGES];
61 };
62
63 struct brcms_info {
64 struct brcms_pub *pub;
65 struct brcms_c_info *wlc;
66 u32 magic;
67
68 int irq;
69
70 spinlock_t lock;
71 spinlock_t isr_lock;
72
73
74 wait_queue_head_t tx_flush_wq;
75
76
77 atomic_t callbacks;
78 struct brcms_timer *timers;
79
80 struct tasklet_struct tasklet;
81 bool resched;
82 struct brcms_firmware fw;
83 struct wiphy *wiphy;
84 struct brcms_ucode ucode;
85 bool mute_tx;
86 struct brcms_led radio_led;
87 struct led_classdev led_dev;
88 };
89
90
91 void brcms_init(struct brcms_info *wl);
92 uint brcms_reset(struct brcms_info *wl);
93 void brcms_intrson(struct brcms_info *wl);
94 u32 brcms_intrsoff(struct brcms_info *wl);
95 void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
96 int brcms_up(struct brcms_info *wl);
97 void brcms_down(struct brcms_info *wl);
98 void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
99 bool state, int prio);
100 bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
101
102
103 struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
104 void (*fn) (void *arg), void *arg,
105 const char *name);
106 void brcms_free_timer(struct brcms_timer *timer);
107 void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
108 bool brcms_del_timer(struct brcms_timer *timer);
109 void brcms_dpc(unsigned long data);
110 void brcms_timer(struct brcms_timer *t);
111 void brcms_fatal_error(struct brcms_info *wl);
112
113 #endif