rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
/* $OpenBSD: if_rtwnreg.h,v 1.3 2015/06/14 08:02:47 stsp Exp $ */
|
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
|
|
|
|
* Copyright (c) 2015 Stefan Sperling <stsp@openbsd.org>
|
|
|
|
* Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and 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.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RTWN_PCI_VAR_H
|
|
|
|
#define RTWN_PCI_VAR_H
|
|
|
|
|
|
|
|
#define RTWN_PCI_RX_LIST_COUNT 256
|
|
|
|
#define RTWN_PCI_TX_LIST_COUNT 256
|
|
|
|
|
2019-01-02 05:21:06 +00:00
|
|
|
/* sizeof(struct rtwn_rx_stat_common) + R88E_INTR_MSG_LEN */
|
|
|
|
#define RTWN_PCI_RX_TMP_BUF_SIZE 84
|
|
|
|
|
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
struct rtwn_rx_data {
|
|
|
|
bus_dmamap_t map;
|
|
|
|
struct mbuf *m;
|
|
|
|
bus_addr_t paddr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtwn_rx_ring {
|
2017-07-06 07:37:33 +00:00
|
|
|
struct rtwn_rx_stat_pci *desc;
|
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
bus_addr_t paddr;
|
|
|
|
bus_dma_tag_t desc_dmat;
|
|
|
|
bus_dmamap_t desc_map;
|
|
|
|
bus_dma_tag_t data_dmat;
|
|
|
|
bus_dma_segment_t seg;
|
|
|
|
struct rtwn_rx_data rx_data[RTWN_PCI_RX_LIST_COUNT];
|
|
|
|
int cur;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtwn_tx_data {
|
|
|
|
bus_dmamap_t map;
|
|
|
|
struct mbuf *m;
|
|
|
|
struct ieee80211_node *ni;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtwn_tx_ring {
|
|
|
|
bus_addr_t paddr;
|
|
|
|
bus_dma_tag_t desc_dmat;
|
|
|
|
bus_dmamap_t desc_map;
|
|
|
|
bus_dma_tag_t data_dmat;
|
|
|
|
bus_dma_segment_t seg;
|
|
|
|
void *desc;
|
|
|
|
struct rtwn_tx_data tx_data[RTWN_PCI_TX_LIST_COUNT];
|
|
|
|
int queued;
|
|
|
|
int cur;
|
|
|
|
int last;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TX queue indices.
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
RTWN_PCI_BK_QUEUE,
|
|
|
|
RTWN_PCI_BE_QUEUE,
|
|
|
|
RTWN_PCI_VI_QUEUE,
|
|
|
|
RTWN_PCI_VO_QUEUE,
|
|
|
|
RTWN_PCI_BEACON_QUEUE,
|
|
|
|
RTWN_PCI_TXCMD_QUEUE,
|
|
|
|
RTWN_PCI_MGNT_QUEUE,
|
|
|
|
RTWN_PCI_HIGH_QUEUE,
|
|
|
|
RTWN_PCI_HCCA_QUEUE,
|
|
|
|
RTWN_PCI_NTXQUEUES
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Interrupt events.
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
RTWN_PCI_INTR_RX_ERROR = 0x00000001,
|
|
|
|
RTWN_PCI_INTR_RX_OVERFLOW = 0x00000002,
|
|
|
|
RTWN_PCI_INTR_RX_DESC_UNAVAIL = 0x00000004,
|
|
|
|
RTWN_PCI_INTR_RX_DONE = 0x00000008,
|
|
|
|
RTWN_PCI_INTR_TX_ERROR = 0x00000010,
|
|
|
|
RTWN_PCI_INTR_TX_OVERFLOW = 0x00000020,
|
|
|
|
RTWN_PCI_INTR_TX_REPORT = 0x00000040,
|
|
|
|
RTWN_PCI_INTR_PS_TIMEOUT = 0x00000080
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Shortcuts */
|
|
|
|
/* Vendor driver treats RX errors like ROK... */
|
|
|
|
#define RTWN_PCI_INTR_RX \
|
2019-01-02 05:21:06 +00:00
|
|
|
(RTWN_PCI_INTR_RX_ERROR | RTWN_PCI_INTR_RX_OVERFLOW | \
|
|
|
|
RTWN_PCI_INTR_RX_DESC_UNAVAIL | RTWN_PCI_INTR_RX_DONE)
|
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct rtwn_pci_softc {
|
|
|
|
struct rtwn_softc pc_sc; /* must be the first */
|
|
|
|
|
|
|
|
struct resource *irq;
|
|
|
|
struct resource *mem;
|
|
|
|
bus_space_tag_t pc_st;
|
|
|
|
bus_space_handle_t pc_sh;
|
|
|
|
void *pc_ih;
|
|
|
|
bus_size_t pc_mapsize;
|
|
|
|
|
2019-01-02 05:21:06 +00:00
|
|
|
uint8_t pc_rx_buf[RTWN_PCI_RX_TMP_BUF_SIZE];
|
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
struct rtwn_rx_ring rx_ring;
|
|
|
|
struct rtwn_tx_ring tx_ring[RTWN_PCI_NTXQUEUES];
|
|
|
|
|
|
|
|
/* must be set by the driver. */
|
|
|
|
uint16_t pc_qmap;
|
|
|
|
uint32_t tcr;
|
|
|
|
|
|
|
|
void (*pc_setup_tx_desc)(struct rtwn_pci_softc *,
|
|
|
|
void *, uint32_t);
|
|
|
|
void (*pc_tx_postsetup)(struct rtwn_pci_softc *,
|
|
|
|
void *, bus_dma_segment_t *);
|
|
|
|
void (*pc_copy_tx_desc)(void *, const void *);
|
|
|
|
void (*pc_enable_intr)(struct rtwn_pci_softc *);
|
2019-01-02 05:21:06 +00:00
|
|
|
int (*pc_get_intr_status)(struct rtwn_pci_softc *,
|
|
|
|
int *);
|
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
};
|
|
|
|
#define RTWN_PCI_SOFTC(sc) ((struct rtwn_pci_softc *)(sc))
|
|
|
|
|
|
|
|
#define rtwn_pci_setup_tx_desc(_pc, _desc, _addr) \
|
|
|
|
(((_pc)->pc_setup_tx_desc)((_pc), (_desc), (_addr)))
|
|
|
|
#define rtwn_pci_tx_postsetup(_pc, _txd, _segs) \
|
|
|
|
(((_pc)->pc_tx_postsetup)((_pc), (_txd), (_segs)))
|
|
|
|
#define rtwn_pci_copy_tx_desc(_pc, _dest, _src) \
|
|
|
|
(((_pc)->pc_copy_tx_desc)((_dest), (_src)))
|
|
|
|
#define rtwn_pci_enable_intr(_pc) \
|
|
|
|
(((_pc)->pc_enable_intr)((_pc)))
|
2019-01-02 05:21:06 +00:00
|
|
|
#define rtwn_pci_get_intr_status(_pc, _tx_rings) \
|
|
|
|
(((_pc)->pc_get_intr_status)((_pc), (_tx_rings)))
|
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
* for RTL8821AU: 2 VAPs at the same time;
* other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
* bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
* common (if_rtwn*)
* chip-specific (rtl*/*)
- various other bugfixes.
Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga,
Peter Garshtja <peter.garshtja@ambient-md.com>,
Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
<otacilio.neto@bsd.com.br>
Relnotes: yes
2016-10-17 20:38:24 +00:00
|
|
|
|
|
|
|
#endif /* RTWN_PCI_VAR_H */
|