0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRCM_MAC80211_IF_H_
0018 #define _BRCM_MAC80211_IF_H_
0019
0020 #include <linux/timer.h>
0021 #include <linux/interrupt.h>
0022 #include <linux/workqueue.h>
0023 #include <linux/leds.h>
0024
0025 #include "ucode_loader.h"
0026 #include "led.h"
0027
0028
0029
0030
0031 #define BRCMS_LEGACY_5G_RATE_OFFSET 4
0032
0033
0034 #define BRCMS_SET_SHORTSLOT_OVERRIDE 146
0035
0036 struct brcms_timer {
0037 struct delayed_work dly_wrk;
0038 struct brcms_info *wl;
0039 void (*fn) (void *);
0040 void *arg;
0041 uint ms;
0042 bool periodic;
0043 bool set;
0044 struct brcms_timer *next;
0045 #ifdef DEBUG
0046 char *name;
0047 #endif
0048 };
0049
0050 struct brcms_if {
0051 uint subunit;
0052 struct pci_dev *pci_dev;
0053 };
0054
0055 #define MAX_FW_IMAGES 4
0056 struct brcms_firmware {
0057 u32 fw_cnt;
0058 const struct firmware *fw_bin[MAX_FW_IMAGES];
0059 const struct firmware *fw_hdr[MAX_FW_IMAGES];
0060 u32 hdr_num_entries[MAX_FW_IMAGES];
0061 };
0062
0063 struct brcms_info {
0064 struct brcms_pub *pub;
0065 struct brcms_c_info *wlc;
0066 u32 magic;
0067
0068 int irq;
0069
0070 spinlock_t lock;
0071 spinlock_t isr_lock;
0072
0073
0074 wait_queue_head_t tx_flush_wq;
0075
0076
0077 atomic_t callbacks;
0078 struct brcms_timer *timers;
0079
0080 struct tasklet_struct tasklet;
0081 bool resched;
0082 struct brcms_firmware fw;
0083 struct wiphy *wiphy;
0084 struct brcms_ucode ucode;
0085 bool mute_tx;
0086 struct brcms_led radio_led;
0087 struct led_classdev led_dev;
0088 };
0089
0090
0091 void brcms_init(struct brcms_info *wl);
0092 uint brcms_reset(struct brcms_info *wl);
0093 void brcms_intrson(struct brcms_info *wl);
0094 u32 brcms_intrsoff(struct brcms_info *wl);
0095 void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
0096 int brcms_up(struct brcms_info *wl);
0097 void brcms_down(struct brcms_info *wl);
0098 void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
0099 bool state, int prio);
0100 bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
0101
0102
0103 struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
0104 void (*fn) (void *arg), void *arg,
0105 const char *name);
0106 void brcms_free_timer(struct brcms_timer *timer);
0107 void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
0108 bool brcms_del_timer(struct brcms_timer *timer);
0109 void brcms_dpc(struct tasklet_struct *t);
0110 void brcms_timer(struct brcms_timer *t);
0111 void brcms_fatal_error(struct brcms_info *wl);
0112
0113 #endif