diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.h')
| -rw-r--r-- | drivers/net/wireless/ath/ath5k/base.h | 64 |
1 files changed, 55 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h index dc1241f9c4e8..b294f3305011 100644 --- a/drivers/net/wireless/ath/ath5k/base.h +++ b/drivers/net/wireless/ath/ath5k/base.h | |||
| @@ -58,7 +58,9 @@ | |||
| 58 | 58 | ||
| 59 | #define ATH_RXBUF 40 /* number of RX buffers */ | 59 | #define ATH_RXBUF 40 /* number of RX buffers */ |
| 60 | #define ATH_TXBUF 200 /* number of TX buffers */ | 60 | #define ATH_TXBUF 200 /* number of TX buffers */ |
| 61 | #define ATH_BCBUF 1 /* number of beacon buffers */ | 61 | #define ATH_BCBUF 4 /* number of beacon buffers */ |
| 62 | #define ATH5K_TXQ_LEN_MAX (ATH_TXBUF / 4) /* bufs per queue */ | ||
| 63 | #define ATH5K_TXQ_LEN_LOW (ATH5K_TXQ_LEN_MAX / 2) /* low mark */ | ||
| 62 | 64 | ||
| 63 | struct ath5k_buf { | 65 | struct ath5k_buf { |
| 64 | struct list_head list; | 66 | struct list_head list; |
| @@ -83,6 +85,10 @@ struct ath5k_txq { | |||
| 83 | struct list_head q; /* transmit queue */ | 85 | struct list_head q; /* transmit queue */ |
| 84 | spinlock_t lock; /* lock on q and link */ | 86 | spinlock_t lock; /* lock on q and link */ |
| 85 | bool setup; | 87 | bool setup; |
| 88 | int txq_len; /* number of queued buffers */ | ||
| 89 | int txq_max; /* max allowed num of queued buffers */ | ||
| 90 | bool txq_poll_mark; | ||
| 91 | unsigned int txq_stuck; /* informational counter */ | ||
| 86 | }; | 92 | }; |
| 87 | 93 | ||
| 88 | #define ATH5K_LED_MAX_NAME_LEN 31 | 94 | #define ATH5K_LED_MAX_NAME_LEN 31 |
| @@ -116,6 +122,13 @@ struct ath5k_statistics { | |||
| 116 | /* frame errors */ | 122 | /* frame errors */ |
| 117 | unsigned int rx_all_count; /* all RX frames, including errors */ | 123 | unsigned int rx_all_count; /* all RX frames, including errors */ |
| 118 | unsigned int tx_all_count; /* all TX frames, including errors */ | 124 | unsigned int tx_all_count; /* all TX frames, including errors */ |
| 125 | unsigned int rx_bytes_count; /* all RX bytes, including errored pks | ||
| 126 | * and the MAC headers for each packet | ||
| 127 | */ | ||
| 128 | unsigned int tx_bytes_count; /* all TX bytes, including errored pkts | ||
| 129 | * and the MAC headers and padding for | ||
| 130 | * each packet. | ||
| 131 | */ | ||
| 119 | unsigned int rxerr_crc; | 132 | unsigned int rxerr_crc; |
| 120 | unsigned int rxerr_phy; | 133 | unsigned int rxerr_phy; |
| 121 | unsigned int rxerr_phy_code[32]; | 134 | unsigned int rxerr_phy_code[32]; |
| @@ -146,10 +159,21 @@ struct ath5k_statistics { | |||
| 146 | #define ATH_CHAN_MAX (14+14+14+252+20) | 159 | #define ATH_CHAN_MAX (14+14+14+252+20) |
| 147 | #endif | 160 | #endif |
| 148 | 161 | ||
| 162 | struct ath5k_vif { | ||
| 163 | bool assoc; /* are we associated or not */ | ||
| 164 | enum nl80211_iftype opmode; | ||
| 165 | int bslot; | ||
| 166 | struct ath5k_buf *bbuf; /* beacon buffer */ | ||
| 167 | u8 lladdr[ETH_ALEN]; | ||
| 168 | }; | ||
| 169 | |||
| 149 | /* Software Carrier, keeps track of the driver state | 170 | /* Software Carrier, keeps track of the driver state |
| 150 | * associated with an instance of a device */ | 171 | * associated with an instance of a device */ |
| 151 | struct ath5k_softc { | 172 | struct ath5k_softc { |
| 152 | struct pci_dev *pdev; /* for dma mapping */ | 173 | struct pci_dev *pdev; |
| 174 | struct device *dev; /* for dma mapping */ | ||
| 175 | int irq; | ||
| 176 | u16 devid; | ||
| 153 | void __iomem *iobase; /* address of the device */ | 177 | void __iomem *iobase; /* address of the device */ |
| 154 | struct mutex lock; /* dev-level lock */ | 178 | struct mutex lock; /* dev-level lock */ |
| 155 | struct ieee80211_hw *hw; /* IEEE 802.11 common */ | 179 | struct ieee80211_hw *hw; /* IEEE 802.11 common */ |
| @@ -160,8 +184,6 @@ struct ath5k_softc { | |||
| 160 | enum nl80211_iftype opmode; | 184 | enum nl80211_iftype opmode; |
| 161 | struct ath5k_hw *ah; /* Atheros HW */ | 185 | struct ath5k_hw *ah; /* Atheros HW */ |
| 162 | 186 | ||
| 163 | struct ieee80211_supported_band *curband; | ||
| 164 | |||
| 165 | #ifdef CONFIG_ATH5K_DEBUG | 187 | #ifdef CONFIG_ATH5K_DEBUG |
| 166 | struct ath5k_dbg_info debug; /* debug info */ | 188 | struct ath5k_dbg_info debug; /* debug info */ |
| 167 | #endif /* CONFIG_ATH5K_DEBUG */ | 189 | #endif /* CONFIG_ATH5K_DEBUG */ |
| @@ -171,21 +193,26 @@ struct ath5k_softc { | |||
| 171 | dma_addr_t desc_daddr; /* DMA (physical) address */ | 193 | dma_addr_t desc_daddr; /* DMA (physical) address */ |
| 172 | size_t desc_len; /* size of TX/RX descriptors */ | 194 | size_t desc_len; /* size of TX/RX descriptors */ |
| 173 | 195 | ||
| 174 | DECLARE_BITMAP(status, 5); | 196 | DECLARE_BITMAP(status, 6); |
| 175 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ | 197 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ |
| 176 | #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ | 198 | #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ |
| 177 | #define ATH_STAT_PROMISC 2 | 199 | #define ATH_STAT_PROMISC 2 |
| 178 | #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ | 200 | #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ |
| 179 | #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ | 201 | #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ |
| 202 | #define ATH_STAT_2G_DISABLED 5 /* multiband radio without 2G */ | ||
| 180 | 203 | ||
| 181 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ | 204 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ |
| 182 | unsigned int curmode; /* current phy mode */ | ||
| 183 | struct ieee80211_channel *curchan; /* current h/w channel */ | 205 | struct ieee80211_channel *curchan; /* current h/w channel */ |
| 184 | 206 | ||
| 185 | struct ieee80211_vif *vif; | 207 | u16 nvifs; |
| 186 | 208 | ||
| 187 | enum ath5k_int imask; /* interrupt mask copy */ | 209 | enum ath5k_int imask; /* interrupt mask copy */ |
| 188 | 210 | ||
| 211 | spinlock_t irqlock; | ||
| 212 | bool rx_pending; /* rx tasklet pending */ | ||
| 213 | bool tx_pending; /* tx tasklet pending */ | ||
| 214 | |||
| 215 | u8 lladdr[ETH_ALEN]; | ||
| 189 | u8 bssidmask[ETH_ALEN]; | 216 | u8 bssidmask[ETH_ALEN]; |
| 190 | 217 | ||
| 191 | unsigned int led_pin, /* GPIO pin for driving LED */ | 218 | unsigned int led_pin, /* GPIO pin for driving LED */ |
| @@ -204,7 +231,6 @@ struct ath5k_softc { | |||
| 204 | spinlock_t txbuflock; | 231 | spinlock_t txbuflock; |
| 205 | unsigned int txbuf_len; /* buf count in txbuf list */ | 232 | unsigned int txbuf_len; /* buf count in txbuf list */ |
| 206 | struct ath5k_txq txqs[AR5K_NUM_TX_QUEUES]; /* tx queues */ | 233 | struct ath5k_txq txqs[AR5K_NUM_TX_QUEUES]; /* tx queues */ |
| 207 | struct ath5k_txq *txq; /* main tx queue */ | ||
| 208 | struct tasklet_struct txtq; /* tx intr tasklet */ | 234 | struct tasklet_struct txtq; /* tx intr tasklet */ |
| 209 | struct ath5k_led tx_led; /* tx led */ | 235 | struct ath5k_led tx_led; /* tx led */ |
| 210 | 236 | ||
| @@ -214,7 +240,10 @@ struct ath5k_softc { | |||
| 214 | 240 | ||
| 215 | spinlock_t block; /* protects beacon */ | 241 | spinlock_t block; /* protects beacon */ |
| 216 | struct tasklet_struct beacontq; /* beacon intr tasklet */ | 242 | struct tasklet_struct beacontq; /* beacon intr tasklet */ |
| 217 | struct ath5k_buf *bbuf; /* beacon buffer */ | 243 | struct list_head bcbuf; /* beacon buffer */ |
| 244 | struct ieee80211_vif *bslot[ATH_BCBUF]; | ||
| 245 | u16 num_ap_vifs; | ||
| 246 | u16 num_adhoc_vifs; | ||
| 218 | unsigned int bhalq, /* SW q for outgoing beacons */ | 247 | unsigned int bhalq, /* SW q for outgoing beacons */ |
| 219 | bmisscount, /* missed beacon transmits */ | 248 | bmisscount, /* missed beacon transmits */ |
| 220 | bintval, /* beacon interval in TU */ | 249 | bintval, /* beacon interval in TU */ |
| @@ -230,8 +259,25 @@ struct ath5k_softc { | |||
| 230 | 259 | ||
| 231 | struct ath5k_ani_state ani_state; | 260 | struct ath5k_ani_state ani_state; |
| 232 | struct tasklet_struct ani_tasklet; /* ANI calibration */ | 261 | struct tasklet_struct ani_tasklet; /* ANI calibration */ |
| 262 | |||
| 263 | struct delayed_work tx_complete_work; | ||
| 264 | |||
| 265 | struct survey_info survey; /* collected survey info */ | ||
| 233 | }; | 266 | }; |
| 234 | 267 | ||
| 268 | struct ath5k_vif_iter_data { | ||
| 269 | const u8 *hw_macaddr; | ||
| 270 | u8 mask[ETH_ALEN]; | ||
| 271 | u8 active_mac[ETH_ALEN]; /* first active MAC */ | ||
| 272 | bool need_set_hw_addr; | ||
| 273 | bool found_active; | ||
| 274 | bool any_assoc; | ||
| 275 | enum nl80211_iftype opmode; | ||
| 276 | int n_stas; | ||
| 277 | }; | ||
| 278 | void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif); | ||
| 279 | |||
| 280 | |||
| 235 | #define ath5k_hw_hasbssidmask(_ah) \ | 281 | #define ath5k_hw_hasbssidmask(_ah) \ |
| 236 | (ath5k_hw_get_capability(_ah, AR5K_CAP_BSSIDMASK, 0, NULL) == 0) | 282 | (ath5k_hw_get_capability(_ah, AR5K_CAP_BSSIDMASK, 0, NULL) == 0) |
| 237 | #define ath5k_hw_hasveol(_ah) \ | 283 | #define ath5k_hw_hasveol(_ah) \ |
