| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2010 Broadcom Corporation | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Permission to use, copy, modify, and/or distribute this software for any | 
					
						
							|  |  |  |  * purpose with or without fee is hereby granted, provided that the above | 
					
						
							|  |  |  |  * copyright notice and this permission notice appear in all copies. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 
					
						
							|  |  |  |  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 
					
						
							|  |  |  |  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | 
					
						
							|  |  |  |  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 
					
						
							|  |  |  |  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | 
					
						
							|  |  |  |  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | 
					
						
							|  |  |  |  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _BRCM_MAC80211_IF_H_
 | 
					
						
							|  |  |  | #define _BRCM_MAC80211_IF_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/timer.h>
 | 
					
						
							|  |  |  | #include <linux/interrupt.h>
 | 
					
						
							| 
									
										
										
										
											2011-10-12 20:51:12 +02:00
										 |  |  | #include <linux/workqueue.h>
 | 
					
						
							| 
									
										
										
										
											2013-03-03 12:45:20 +01:00
										 |  |  | #include <linux/leds.h>
 | 
					
						
							| 
									
										
										
										
											2011-10-12 20:51:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | #include "ucode_loader.h"
 | 
					
						
							| 
									
										
										
										
											2013-03-03 12:45:20 +01:00
										 |  |  | #include "led.h"
 | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Starting index for 5G rates in the | 
					
						
							|  |  |  |  * legacy rate table. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #define BRCMS_LEGACY_5G_RATE_OFFSET	4
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* softmac ioctl definitions */ | 
					
						
							|  |  |  | #define BRCMS_SET_SHORTSLOT_OVERRIDE		146
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct brcms_timer { | 
					
						
							| 
									
										
										
										
											2011-10-12 20:51:12 +02:00
										 |  |  | 	struct delayed_work dly_wrk; | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | 	struct brcms_info *wl; | 
					
						
							| 
									
										
										
										
											2011-10-12 20:51:12 +02:00
										 |  |  | 	void (*fn) (void *);	/* function called upon expiration */ | 
					
						
							|  |  |  | 	void *arg;		/* fixed argument provided to called function */ | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | 	uint ms; | 
					
						
							|  |  |  | 	bool periodic; | 
					
						
							| 
									
										
										
										
											2011-10-12 20:51:12 +02:00
										 |  |  | 	bool set;		/* indicates if timer is active */ | 
					
						
							|  |  |  | 	struct brcms_timer *next;	/* for freeing on unload */ | 
					
						
							| 
									
										
										
										
											2012-01-15 00:38:38 -08:00
										 |  |  | #ifdef DEBUG
 | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | 	char *name;		/* Description of the timer */ | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct brcms_if { | 
					
						
							|  |  |  | 	uint subunit;		/* WDS/BSS unit */ | 
					
						
							|  |  |  | 	struct pci_dev *pci_dev; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define MAX_FW_IMAGES		4
 | 
					
						
							|  |  |  | struct brcms_firmware { | 
					
						
							|  |  |  | 	u32 fw_cnt; | 
					
						
							|  |  |  | 	const struct firmware *fw_bin[MAX_FW_IMAGES]; | 
					
						
							|  |  |  | 	const struct firmware *fw_hdr[MAX_FW_IMAGES]; | 
					
						
							|  |  |  | 	u32 hdr_num_entries[MAX_FW_IMAGES]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct brcms_info { | 
					
						
							|  |  |  | 	struct brcms_pub *pub;		/* pointer to public wlc state */ | 
					
						
							|  |  |  | 	struct brcms_c_info *wlc;	/* pointer to private common data */ | 
					
						
							|  |  |  | 	u32 magic; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	int irq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	spinlock_t lock;	/* per-device perimeter lock */ | 
					
						
							|  |  |  | 	spinlock_t isr_lock;	/* per-device ISR synchronization lock */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-02 14:36:50 +01:00
										 |  |  | 	/* tx flush */ | 
					
						
							|  |  |  | 	wait_queue_head_t tx_flush_wq; | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* timer related fields */ | 
					
						
							|  |  |  | 	atomic_t callbacks;	/* # outstanding callback functions */ | 
					
						
							|  |  |  | 	struct brcms_timer *timers;	/* timer cleanup queue */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	struct tasklet_struct tasklet;	/* dpc tasklet */ | 
					
						
							|  |  |  | 	bool resched;		/* dpc needs to be and is rescheduled */ | 
					
						
							|  |  |  | 	struct brcms_firmware fw; | 
					
						
							|  |  |  | 	struct wiphy *wiphy; | 
					
						
							|  |  |  | 	struct brcms_ucode ucode; | 
					
						
							| 
									
										
										
										
											2011-10-21 16:16:28 +02:00
										 |  |  | 	bool mute_tx; | 
					
						
							| 
									
										
										
										
											2013-03-03 12:45:20 +01:00
										 |  |  | 	struct brcms_led radio_led; | 
					
						
							|  |  |  | 	struct led_classdev led_dev; | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* misc callbacks */ | 
					
						
							| 
									
										
										
										
											2013-09-23 11:37:59 -07:00
										 |  |  | void brcms_init(struct brcms_info *wl); | 
					
						
							|  |  |  | uint brcms_reset(struct brcms_info *wl); | 
					
						
							|  |  |  | void brcms_intrson(struct brcms_info *wl); | 
					
						
							|  |  |  | u32 brcms_intrsoff(struct brcms_info *wl); | 
					
						
							|  |  |  | void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask); | 
					
						
							|  |  |  | int brcms_up(struct brcms_info *wl); | 
					
						
							|  |  |  | void brcms_down(struct brcms_info *wl); | 
					
						
							|  |  |  | void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif, | 
					
						
							|  |  |  | 			 bool state, int prio); | 
					
						
							|  |  |  | bool brcms_rfkill_set_hw_state(struct brcms_info *wl); | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* timer functions */ | 
					
						
							| 
									
										
										
										
											2013-09-23 11:37:59 -07:00
										 |  |  | struct brcms_timer *brcms_init_timer(struct brcms_info *wl, | 
					
						
							|  |  |  | 				     void (*fn) (void *arg), void *arg, | 
					
						
							|  |  |  | 				     const char *name); | 
					
						
							|  |  |  | void brcms_free_timer(struct brcms_timer *timer); | 
					
						
							|  |  |  | void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); | 
					
						
							|  |  |  | bool brcms_del_timer(struct brcms_timer *timer); | 
					
						
							|  |  |  | void brcms_dpc(unsigned long data); | 
					
						
							|  |  |  | void brcms_timer(struct brcms_timer *t); | 
					
						
							|  |  |  | void brcms_fatal_error(struct brcms_info *wl); | 
					
						
							| 
									
										
										
										
											2011-10-05 13:19:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif				/* _BRCM_MAC80211_IF_H_ */
 |