Path: blob/main/sys/contrib/dev/broadcom/brcm80211/brcmsmac/mac80211_if.h
178665 views
/*1* Copyright (c) 2010 Broadcom Corporation2*3* Permission to use, copy, modify, and/or distribute this software for any4* purpose with or without fee is hereby granted, provided that the above5* copyright notice and this permission notice appear in all copies.6*7* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES8* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF9* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY10* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES11* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION12* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN13* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.14*/1516#ifndef _BRCM_MAC80211_IF_H_17#define _BRCM_MAC80211_IF_H_1819#include <linux/timer.h>20#include <linux/interrupt.h>21#include <linux/workqueue.h>22#include <linux/leds.h>2324#include "ucode_loader.h"25#include "led.h"26/*27* Starting index for 5G rates in the28* legacy rate table.29*/30#define BRCMS_LEGACY_5G_RATE_OFFSET 43132/* softmac ioctl definitions */33#define BRCMS_SET_SHORTSLOT_OVERRIDE 1463435struct brcms_timer {36struct delayed_work dly_wrk;37struct brcms_info *wl;38void (*fn) (void *); /* function called upon expiration */39void *arg; /* fixed argument provided to called function */40uint ms;41bool periodic;42bool set; /* indicates if timer is active */43struct brcms_timer *next; /* for freeing on unload */44#ifdef DEBUG45char *name; /* Description of the timer */46#endif47};4849struct brcms_if {50uint subunit; /* WDS/BSS unit */51struct pci_dev *pci_dev;52};5354#define MAX_FW_IMAGES 455struct brcms_firmware {56u32 fw_cnt;57const struct firmware *fw_bin[MAX_FW_IMAGES];58const struct firmware *fw_hdr[MAX_FW_IMAGES];59u32 hdr_num_entries[MAX_FW_IMAGES];60};6162struct brcms_info {63struct brcms_pub *pub; /* pointer to public wlc state */64struct brcms_c_info *wlc; /* pointer to private common data */65u32 magic;6667int irq;6869spinlock_t lock; /* per-device perimeter lock */70spinlock_t isr_lock; /* per-device ISR synchronization lock */7172/* tx flush */73wait_queue_head_t tx_flush_wq;7475/* timer related fields */76atomic_t callbacks; /* # outstanding callback functions */77struct brcms_timer *timers; /* timer cleanup queue */7879struct tasklet_struct tasklet; /* dpc tasklet */80bool resched; /* dpc needs to be and is rescheduled */81struct brcms_firmware fw;82struct wiphy *wiphy;83struct brcms_ucode ucode;84bool mute_tx;85struct brcms_led radio_led;86struct led_classdev led_dev;87};8889/* misc callbacks */90void brcms_init(struct brcms_info *wl);91uint brcms_reset(struct brcms_info *wl);92void brcms_intrson(struct brcms_info *wl);93u32 brcms_intrsoff(struct brcms_info *wl);94void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);95int brcms_up(struct brcms_info *wl);96void brcms_down(struct brcms_info *wl);97void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,98bool state, int prio);99bool brcms_rfkill_set_hw_state(struct brcms_info *wl);100101/* timer functions */102struct brcms_timer *brcms_init_timer(struct brcms_info *wl,103void (*fn) (void *arg), void *arg,104const char *name);105void brcms_free_timer(struct brcms_timer *timer);106void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);107bool brcms_del_timer(struct brcms_timer *timer);108void brcms_dpc(struct tasklet_struct *t);109void brcms_timer(struct brcms_timer *t);110void brcms_fatal_error(struct brcms_info *wl);111112#endif /* _BRCM_MAC80211_IF_H_ */113114115