iPXE
base.h
Go to the documentation of this file.
1/*-
2 * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Modified for iPXE, July 2009, by Joshua Oreman <oremanj@rwcr.net>
6 * Original from Linux kernel 2.6.30.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer,
13 * without modification.
14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15 * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
16 * redistribution must be conditioned upon including a substantially
17 * similar Disclaimer requirement for further binary redistribution.
18 * 3. Neither the names of the above-listed copyright holders nor the names
19 * of any contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * Alternatively, this software may be distributed under the terms of the
23 * GNU General Public License ("GPL") version 2 as published by the Free
24 * Software Foundation.
25 *
26 * NO WARRANTY
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
30 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
31 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
32 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
35 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
37 * THE POSSIBILITY OF SUCH DAMAGES.
38 *
39 */
40
41/*
42 * Defintions for the Atheros Wireless LAN controller driver.
43 */
44#ifndef _DEV_ATH_ATHVAR_H
45#define _DEV_ATH_ATHVAR_H
46
47FILE_LICENCE ( BSD3 );
48FILE_SECBOOT ( FORBIDDEN );
49
50#include "ath5k.h"
51#include <ipxe/iobuf.h>
52
53#define ATH_RXBUF 16 /* number of RX buffers */
54#define ATH_TXBUF 16 /* number of TX buffers */
55
56struct ath5k_buf {
58 unsigned int flags; /* rx descriptor flags */
59 struct ath5k_desc *desc; /* virtual addr of desc */
60 u32 daddr; /* physical addr of desc */
61 struct io_buffer *iob; /* I/O buffer for buf */
62 u32 iobaddr;/* physical addr of iob data */
63};
64
65/*
66 * Data transmit queue state. One of these exists for each
67 * hardware transmit queue. Packets sent to us from above
68 * are assigned to queues based on their priority. Not all
69 * devices support a complete set of hardware transmit queues.
70 * For those devices the array sc_ac2q will map multiple
71 * priorities to fewer hardware queues (typically all to one
72 * hardware queue).
73 */
74struct ath5k_txq {
75 unsigned int qnum; /* hardware q number */
76 u32 *link; /* link ptr in last TX desc */
77 struct list_head q; /* transmit queue */
78 int setup;
79};
80
81#if CHAN_DEBUG
82#define ATH_CHAN_MAX (26+26+26+200+200)
83#else
84#define ATH_CHAN_MAX (14+14+14+252+20)
85#endif
86
87/* Software Carrier, keeps track of the driver state
88 * associated with an instance of a device */
90 struct pci_device *pdev; /* for dma mapping */
91 void *iobase; /* address of the device */
92 struct net80211_device *dev; /* IEEE 802.11 common */
93 struct ath5k_hw *ah; /* Atheros HW */
96 int irq_ena; /* interrupts enabled */
97
98 struct ath5k_buf *bufptr; /* allocated buffer ptr */
99 struct ath5k_desc *desc; /* TX/RX descriptors */
100 u32 desc_daddr; /* DMA (physical) address */
101 size_t desc_len; /* size of TX/RX descriptors */
102 u16 cachelsz; /* cache line size */
103
105#define ATH_STAT_INVALID 0x01 /* disable hardware accesses */
106#define ATH_STAT_MRRETRY 0x02 /* multi-rate retry support */
107#define ATH_STAT_PROMISC 0x04
108#define ATH_STAT_LEDSOFT 0x08 /* enable LED gpio status */
109#define ATH_STAT_STARTED 0x10 /* opened & irqs enabled */
110
111 unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */
112 unsigned int curmode; /* current phy mode */
113 struct net80211_channel *curchan; /* current h/w channel */
114
115 enum ath5k_int imask; /* interrupt mask copy */
116
118
119 unsigned int rxbufsize; /* rx size based on mtu */
120 struct list_head rxbuf; /* receive buffer */
121 u32 *rxlink; /* link ptr in last RX desc */
122
123 struct list_head txbuf; /* transmit buffer */
124 unsigned int txbuf_len; /* buf count in txbuf list */
125 struct ath5k_txq txq; /* tx queue */
126
127 struct {
129 unsigned polarity;
131
133
134 int power_level; /* Requested tx power in dbm */
135 int assoc; /* assocate state */
136
137 int hw_rate; /* Hardware tx rate code */
138 int hw_rtscts_rate; /* Hardware rts/cts rate code */
139};
140
141#define ath5k_hw_hasbssidmask(_ah) \
142 (ath5k_hw_get_capability(_ah, AR5K_CAP_BSSIDMASK, 0, NULL) == 0)
143#define ath5k_hw_hasveol(_ah) \
144 (ath5k_hw_get_capability(_ah, AR5K_CAP_VEOL, 0, NULL) == 0)
145
146#endif
ath5k_int
enum ath5k_int - Hardware interrupt masks helpers
Definition ath5k.h:806
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define ETH_ALEN
Definition if_ether.h:9
#define u8
Definition igbvf_osdep.h:40
I/O buffers.
u32 daddr
Definition base.h:60
struct list_head list
Definition base.h:57
u32 iobaddr
Definition base.h:62
struct io_buffer * iob
Definition base.h:61
struct ath5k_desc * desc
Definition base.h:59
unsigned int flags
Definition base.h:58
ath5k_hw_get_isr - Get interrupt status
Definition ath5k.h:955
struct ath5k_buf * bufptr
Definition base.h:98
unsigned int rxbufsize
Definition base.h:119
struct list_head txbuf
Definition base.h:123
u32 desc_daddr
Definition base.h:100
int assoc
Definition base.h:135
int curband
Definition base.h:95
int status
Definition base.h:104
int last_calib_ticks
Definition base.h:132
unsigned int txbuf_len
Definition base.h:124
struct ath5k_hw * ah
Definition base.h:93
struct net80211_device * dev
Definition base.h:92
struct list_head rxbuf
Definition base.h:120
int hw_rate
Definition base.h:137
u8 bssidmask[ETH_ALEN]
Definition base.h:117
struct ath5k_desc * desc
Definition base.h:99
size_t desc_len
Definition base.h:101
struct ath5k_txq txq
Definition base.h:125
int irq_ena
Definition base.h:96
struct net80211_hw_info * hwinfo
Definition base.h:94
u32 * rxlink
Definition base.h:121
unsigned int curmode
Definition base.h:112
u16 gpio
Definition base.h:128
struct pci_device * pdev
Definition base.h:90
enum ath5k_int imask
Definition base.h:115
struct net80211_channel * curchan
Definition base.h:113
u16 cachelsz
Definition base.h:102
int hw_rtscts_rate
Definition base.h:138
struct ath5k_softc::@344164377243325166301233055376377150275233304000 rf_kill
unsigned int filter_flags
Definition base.h:111
void * iobase
Definition base.h:91
unsigned polarity
Definition base.h:129
int power_level
Definition base.h:134
unsigned int qnum
Definition base.h:75
u32 * link
Definition base.h:76
struct list_head q
Definition base.h:77
int setup
Definition base.h:78
A persistent I/O buffer.
Definition iobuf.h:38
A doubly-linked list entry (or list head)
Definition list.h:19
An 802.11 RF channel.
Definition net80211.h:386
Structure encapsulating the complete state of an 802.11 device.
Definition net80211.h:787
Information on the capabilities of an 802.11 hardware device.
Definition net80211.h:437
A PCI device.
Definition pci.h:211
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21