/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
C Header | 114 lines | 69 code | 17 blank | 28 comment | 0 complexity | 92d25361be141f27ffe1f6d804030392 MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
1/* 2 * Copyright (c) 2010 Broadcom Corporation 3 * 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. 7 * 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. 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 23/* 24 * Starting index for 5G rates in the 25 * legacy rate table. 26 */ 27#define BRCMS_LEGACY_5G_RATE_OFFSET 4 28 29/* softmac ioctl definitions */ 30#define BRCMS_SET_SHORTSLOT_OVERRIDE 146 31 32 33/* BMAC Note: High-only driver is no longer working in softirq context as it needs to block and 34 * sleep so perimeter lock has to be a semaphore instead of spinlock. This requires timers to be 35 * submitted to workqueue instead of being on kernel timer 36 */ 37struct brcms_timer { 38 struct timer_list timer; 39 struct brcms_info *wl; 40 void (*fn) (void *); 41 void *arg; /* argument to fn */ 42 uint ms; 43 bool periodic; 44 bool set; 45 struct brcms_timer *next; 46#ifdef BCMDBG 47 char *name; /* Description of the timer */ 48#endif 49}; 50 51struct brcms_if { 52 uint subunit; /* WDS/BSS unit */ 53 struct pci_dev *pci_dev; 54}; 55 56#define MAX_FW_IMAGES 4 57struct brcms_firmware { 58 u32 fw_cnt; 59 const struct firmware *fw_bin[MAX_FW_IMAGES]; 60 const struct firmware *fw_hdr[MAX_FW_IMAGES]; 61 u32 hdr_num_entries[MAX_FW_IMAGES]; 62}; 63 64struct brcms_info { 65 struct brcms_pub *pub; /* pointer to public wlc state */ 66 void *wlc; /* pointer to private common os-independent data */ 67 u32 magic; 68 69 int irq; 70 71 spinlock_t lock; /* per-device perimeter lock */ 72 spinlock_t isr_lock; /* per-device ISR synchronization lock */ 73 74 /* bus type and regsva for unmap in brcms_free() */ 75 uint bcm_bustype; /* bus type */ 76 void *regsva; /* opaque chip registers virtual address */ 77 78 /* timer related fields */ 79 atomic_t callbacks; /* # outstanding callback functions */ 80 struct brcms_timer *timers; /* timer cleanup queue */ 81 82 struct tasklet_struct tasklet; /* dpc tasklet */ 83 bool resched; /* dpc needs to be and is rescheduled */ 84#ifdef LINUXSTA_PS 85 u32 pci_psstate[16]; /* pci ps-state save/restore */ 86#endif 87 struct brcms_firmware fw; 88 struct wiphy *wiphy; 89}; 90 91/* misc callbacks */ 92extern void brcms_init(struct brcms_info *wl); 93extern uint brcms_reset(struct brcms_info *wl); 94extern void brcms_intrson(struct brcms_info *wl); 95extern u32 brcms_intrsoff(struct brcms_info *wl); 96extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask); 97extern int brcms_up(struct brcms_info *wl); 98extern void brcms_down(struct brcms_info *wl); 99extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif, 100 bool state, int prio); 101extern bool wl_alloc_dma_resources(struct brcms_info *wl, uint dmaddrwidth); 102extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl); 103 104/* timer functions */ 105extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl, 106 void (*fn) (void *arg), void *arg, 107 const char *name); 108extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer); 109extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer, 110 uint ms, int periodic); 111extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer); 112extern void brcms_msleep(struct brcms_info *wl, uint ms); 113 114#endif /* _BRCM_MAC80211_IF_H_ */