ralinkwifi: Sync with FreeBSD 11.1.
Untested, but the changes are mostly adapations to the new KPIs.
This commit is contained in:
parent
7edcb06f62
commit
28ca187801
@ -6,7 +6,6 @@ SubInclude HAIKU_TOP src add-ons kernel drivers network wlan marvell88w8335 ;
|
||||
# FreeBSD 9.3 drivers
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan broadcom43xx ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan marvell88w8363 ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan ralinkwifi ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan wavelanwifi ;
|
||||
|
||||
# FreeBSD 11.1 drivers
|
||||
@ -15,6 +14,7 @@ SubInclude HAIKU_TOP src add-ons kernel drivers network wlan atheroswifi ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan iprowifi2100 ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan iprowifi3945 ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan iprowifi4965 ;
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan ralinkwifi ;
|
||||
|
||||
# FreeBSD 11.2 drivers
|
||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wlan idualwifi7260 ;
|
||||
|
@ -1,14 +1,14 @@
|
||||
SubDir HAIKU_TOP src add-ons kernel drivers network wlan ralinkwifi ;
|
||||
|
||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ]
|
||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd11_network compat ]
|
||||
: true ;
|
||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_wlan ] : true ;
|
||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd11_wlan ] : true ;
|
||||
UsePrivateHeaders net system ;
|
||||
UsePrivateKernelHeaders ;
|
||||
|
||||
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ]
|
||||
-Wno-format
|
||||
-Wno-unused
|
||||
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ]
|
||||
-Wno-format
|
||||
-Wno-unused
|
||||
-Wno-uninitialized ;
|
||||
|
||||
UseHeaders [ FDirName $(SUBDIR) ] : true ;
|
||||
@ -22,8 +22,8 @@ KernelAddon ralinkwifi :
|
||||
rt2860.c
|
||||
glue.c
|
||||
:
|
||||
libfreebsd_wlan.a
|
||||
libfreebsd_network.a
|
||||
libfreebsd11_wlan.a
|
||||
libfreebsd11_network.a
|
||||
;
|
||||
|
||||
HAIKU_WIFI_FIRMWARE_PACKAGES on ralinkwifi = RT61_Firmware_V1.2
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
__FBSDID("$FreeBSD: releng/11.1/sys/dev/ral/if_ral_pci.c 287197 2015-08-27 08:56:39Z glebius $");
|
||||
|
||||
/*
|
||||
* PCI/Cardbus front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
|
||||
@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/rman.h>
|
||||
@ -93,7 +94,10 @@ static const struct ral_pci_ident ral_pci_ids[] = {
|
||||
{ 0x1814, 0x3562, "Ralink Technology RT3562" },
|
||||
{ 0x1814, 0x3592, "Ralink Technology RT3592" },
|
||||
{ 0x1814, 0x3593, "Ralink Technology RT3593" },
|
||||
{ 0x1814, 0x5360, "Ralink Technology RT5390" },
|
||||
{ 0x1814, 0x5362, "Ralink Technology RT5392" },
|
||||
{ 0x1814, 0x5390, "Ralink Technology RT5390" },
|
||||
{ 0x1814, 0x5392, "Ralink Technology RT5392" },
|
||||
{ 0x1814, 0x539a, "Ralink Technology RT5390" },
|
||||
{ 0x1814, 0x539f, "Ralink Technology RT5390" },
|
||||
{ 0x1a3b, 0x1059, "AWT RT2890" },
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $FreeBSD: releng/11.1/sys/dev/ral/rt2560reg.h 258780 2013-11-30 22:17:27Z eadler $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005, 2006
|
||||
@ -268,7 +268,7 @@ struct rt2560_rx_desc {
|
||||
#define RT2560_BBP_BUSY (1 << 15)
|
||||
#define RT2560_BBP_WRITE (1 << 16)
|
||||
#define RT2560_RF_20BIT (20 << 24)
|
||||
#define RT2560_RF_BUSY (1 << 31)
|
||||
#define RT2560_RF_BUSY (1U << 31)
|
||||
|
||||
#define RT2560_RF_2522 0x00
|
||||
#define RT2560_RF_2523 0x01
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $FreeBSD: releng/11.1/sys/dev/ral/rt2560var.h 289168 2015-10-12 05:21:51Z adrian $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005, 2006
|
||||
@ -97,7 +97,6 @@ struct rt2560_rx_ring {
|
||||
|
||||
struct rt2560_vap {
|
||||
struct ieee80211vap ral_vap;
|
||||
struct ieee80211_beacon_offsets ral_bo;
|
||||
|
||||
int (*ral_newstate)(struct ieee80211vap *,
|
||||
enum ieee80211_state, int);
|
||||
@ -105,13 +104,13 @@ struct rt2560_vap {
|
||||
#define RT2560_VAP(vap) ((struct rt2560_vap *)(vap))
|
||||
|
||||
struct rt2560_softc {
|
||||
struct ifnet *sc_ifp;
|
||||
struct ieee80211com sc_ic;
|
||||
struct mtx sc_mtx;
|
||||
struct mbufq sc_snd;
|
||||
device_t sc_dev;
|
||||
bus_space_tag_t sc_st;
|
||||
bus_space_handle_t sc_sh;
|
||||
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct callout watchdog_ch;
|
||||
|
||||
int sc_tx_timer;
|
||||
@ -147,13 +146,10 @@ struct rt2560_softc {
|
||||
int nb_ant;
|
||||
|
||||
struct rt2560_rx_radiotap_header sc_rxtap;
|
||||
int sc_rxtap_len;
|
||||
|
||||
struct rt2560_tx_radiotap_header sc_txtap;
|
||||
int sc_txtap_len;
|
||||
|
||||
#define RT2560_F_INPUT_RUNNING 0x1
|
||||
#define RT2560_F_PRIO_OACTIVE 0x2
|
||||
#define RT2560_F_DATA_OACTIVE 0x4
|
||||
#define RT2560_F_RUNNING 0x2
|
||||
int sc_flags;
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $FreeBSD: releng/11.1/sys/dev/ral/rt2661reg.h 258780 2013-11-30 22:17:27Z eadler $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006
|
||||
@ -182,7 +182,7 @@
|
||||
|
||||
/* possible flags for register PHY_CSR4 */
|
||||
#define RT2661_RF_21BIT (21 << 24)
|
||||
#define RT2661_RF_BUSY (1 << 31)
|
||||
#define RT2661_RF_BUSY (1U << 31)
|
||||
|
||||
/* possible values for register STA_CSR4 */
|
||||
#define RT2661_TX_STAT_VALID (1 << 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $FreeBSD: releng/11.1/sys/dev/ral/rt2661var.h 300657 2016-05-25 06:29:23Z sgalabov $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005
|
||||
@ -26,7 +26,7 @@ struct rt2661_rx_radiotap_header {
|
||||
uint16_t wr_chan_flags;
|
||||
int8_t wr_antsignal;
|
||||
int8_t wr_antnoise;
|
||||
} __packed;
|
||||
} __packed __aligned(8);
|
||||
|
||||
#define RT2661_RX_RADIOTAP_PRESENT \
|
||||
((1 << IEEE80211_RADIOTAP_TSFT) | \
|
||||
@ -42,7 +42,7 @@ struct rt2661_tx_radiotap_header {
|
||||
uint8_t wt_rate;
|
||||
uint16_t wt_chan_freq;
|
||||
uint16_t wt_chan_flags;
|
||||
} __packed;
|
||||
} __packed __aligned(8);
|
||||
|
||||
#define RT2661_TX_RADIOTAP_PRESENT \
|
||||
((1 << IEEE80211_RADIOTAP_FLAGS) | \
|
||||
@ -97,13 +97,13 @@ struct rt2661_vap {
|
||||
#define RT2661_VAP(vap) ((struct rt2661_vap *)(vap))
|
||||
|
||||
struct rt2661_softc {
|
||||
struct ifnet *sc_ifp;
|
||||
struct ieee80211com sc_ic;
|
||||
struct mtx sc_mtx;
|
||||
struct mbufq sc_snd;
|
||||
device_t sc_dev;
|
||||
bus_space_tag_t sc_st;
|
||||
bus_space_handle_t sc_sh;
|
||||
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct callout watchdog_ch;
|
||||
|
||||
int sc_tx_timer;
|
||||
@ -117,6 +117,7 @@ struct rt2661_softc {
|
||||
int sc_flags;
|
||||
#define RAL_FW_LOADED 0x1
|
||||
#define RAL_INPUT_RUNNING 0x2
|
||||
#define RAL_RUNNING 0x4
|
||||
int sc_id;
|
||||
struct ieee80211_channel *sc_curchan;
|
||||
|
||||
@ -156,9 +157,7 @@ struct rt2661_softc {
|
||||
int dwelltime;
|
||||
|
||||
struct rt2661_rx_radiotap_header sc_rxtap;
|
||||
int sc_rxtap_len;
|
||||
struct rt2661_tx_radiotap_header sc_txtap;
|
||||
int sc_txtap_len;
|
||||
};
|
||||
|
||||
int rt2661_attach(device_t, int);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* $OpenBSD: rt2860reg.h,v 1.30 2010/05/10 18:17:10 damien Exp $
|
||||
* $FreeBSD$
|
||||
* $FreeBSD: releng/11.1/sys/dev/ral/rt2860reg.h 301575 2016-06-08 02:37:23Z kevlo $
|
||||
*/
|
||||
|
||||
#define RT2860_NOISE_FLOOR -95
|
||||
@ -257,8 +257,17 @@
|
||||
#define RT2860_TX_DMA_BUSY (1 << 1)
|
||||
#define RT2860_TX_DMA_EN (1 << 0)
|
||||
|
||||
/* flags for register WPDMA_RST_IDX */
|
||||
#define RT2860_RST_DRX_IDX0 (1 << 16)
|
||||
#define RT2860_RST_DTX_IDX5 (1 << 5)
|
||||
#define RT2860_RST_DTX_IDX4 (1 << 4)
|
||||
#define RT2860_RST_DTX_IDX3 (1 << 3)
|
||||
#define RT2860_RST_DTX_IDX2 (1 << 2)
|
||||
#define RT2860_RST_DTX_IDX1 (1 << 1)
|
||||
#define RT2860_RST_DTX_IDX0 (1 << 0)
|
||||
|
||||
/* possible flags for register DELAY_INT_CFG */
|
||||
#define RT2860_TXDLY_INT_EN (1 << 31)
|
||||
#define RT2860_TXDLY_INT_EN (1U << 31)
|
||||
#define RT2860_TXMAX_PINT_SHIFT 24
|
||||
#define RT2860_TXMAX_PTIME_SHIFT 16
|
||||
#define RT2860_RXDLY_INT_EN (1 << 15)
|
||||
@ -270,7 +279,7 @@
|
||||
#define RT2860_GPIO_O_SHIFT 0
|
||||
|
||||
/* possible flags for register USB_DMA_CFG */
|
||||
#define RT2860_USB_TX_BUSY (1 << 31)
|
||||
#define RT2860_USB_TX_BUSY (1U << 31)
|
||||
#define RT2860_USB_RX_BUSY (1 << 30)
|
||||
#define RT2860_USB_EPOUT_VLD_SHIFT 24
|
||||
#define RT2860_USB_TX_EN (1 << 23)
|
||||
@ -370,7 +379,7 @@
|
||||
#define RT2860_TX0Q_PCNT_MASK 0x000000ff
|
||||
|
||||
/* possible flags for register CAP_CTRL */
|
||||
#define RT2860_CAP_ADC_FEQ (1 << 31)
|
||||
#define RT2860_CAP_ADC_FEQ (1U << 31)
|
||||
#define RT2860_CAP_START (1 << 30)
|
||||
#define RT2860_MAN_TRIG (1 << 29)
|
||||
#define RT2860_TRIG_OFFSET_SHIFT 16
|
||||
@ -381,7 +390,7 @@
|
||||
#define RT3070_RF_WRITE (1 << 16)
|
||||
|
||||
/* possible flags for register EFUSE_CTRL */
|
||||
#define RT3070_SEL_EFUSE (1 << 31)
|
||||
#define RT3070_SEL_EFUSE (1U << 31)
|
||||
#define RT3070_EFSROM_KICK (1 << 30)
|
||||
#define RT3070_EFSROM_AIN_MASK 0x03ff0000
|
||||
#define RT3070_EFSROM_AIN_SHIFT 16
|
||||
@ -420,7 +429,7 @@
|
||||
#define RT2860_BBP_DATA_SHIFT 0
|
||||
|
||||
/* possible flags for register RF_CSR_CFG0 */
|
||||
#define RT2860_RF_REG_CTRL (1 << 31)
|
||||
#define RT2860_RF_REG_CTRL (1U << 31)
|
||||
#define RT2860_RF_LE_SEL1 (1 << 30)
|
||||
#define RT2860_RF_LE_STBY (1 << 29)
|
||||
#define RT2860_RF_REG_WIDTH_SHIFT 24
|
||||
@ -455,7 +464,7 @@
|
||||
#define RT2860_SLOT_TIME 0
|
||||
|
||||
/* possible flags for register NAV_TIME_CFG */
|
||||
#define RT2860_NAV_UPD (1 << 31)
|
||||
#define RT2860_NAV_UPD (1U << 31)
|
||||
#define RT2860_NAV_UPD_VAL_SHIFT 16
|
||||
#define RT2860_NAV_CLR_EN (1 << 15)
|
||||
#define RT2860_NAV_TIMER_SHIFT 0
|
||||
@ -509,7 +518,7 @@
|
||||
#define RT2860_WAKEUP_LEAD_TIME_SHIFT 0
|
||||
|
||||
/* possible flags for register TX_PIN_CFG */
|
||||
#define RT3593_LNA_PE_G2_POL (1 << 31)
|
||||
#define RT3593_LNA_PE_G2_POL (1U << 31)
|
||||
#define RT3593_LNA_PE_A2_POL (1 << 30)
|
||||
#define RT3593_LNA_PE_G2_EN (1 << 29)
|
||||
#define RT3593_LNA_PE_A2_EN (1 << 28)
|
||||
@ -699,6 +708,7 @@
|
||||
|
||||
/* possible flags for RT3020 RF register 1 */
|
||||
#define RT3070_RF_BLOCK (1 << 0)
|
||||
#define RT3070_PLL_PD (1 << 1)
|
||||
#define RT3070_RX0_PD (1 << 2)
|
||||
#define RT3070_TX0_PD (1 << 3)
|
||||
#define RT3070_RX1_PD (1 << 4)
|
||||
@ -750,6 +760,22 @@
|
||||
|
||||
#define RT3090_DEF_LNA 10
|
||||
|
||||
/* possible flags for RT5390 RF register 38 */
|
||||
#define RT5390_RX_LO1 (1 << 5)
|
||||
|
||||
/* possible flags for RT5390 RF register 39 */
|
||||
#define RT5390_RX_LO2 (1 << 7)
|
||||
|
||||
/* possible flags for RT5390 RF register 42 */
|
||||
#define RT5390_RX_CTB (1 << 6)
|
||||
|
||||
/* possible flags for RT5390 BBP register 4 */
|
||||
#define RT5390_MAC_IF_CTRL (1 << 6)
|
||||
|
||||
/* possible flags for RT5390 BBP register 105 */
|
||||
#define RT5390_MLD (1 << 2)
|
||||
#define RT5390_SIG_MODULATION (1 << 3)
|
||||
|
||||
/* RT2860 TX descriptor */
|
||||
struct rt2860_txd {
|
||||
uint32_t sdp0; /* Segment Data Pointer 0 */
|
||||
@ -883,17 +909,19 @@ struct rt2860_rxwi {
|
||||
#define RT2860_RF3 1
|
||||
#define RT2860_RF4 3
|
||||
|
||||
#define RT2860_RF_2820 1 /* 2T3R */
|
||||
#define RT2860_RF_2850 2 /* dual-band 2T3R */
|
||||
#define RT2860_RF_2720 3 /* 1T2R */
|
||||
#define RT2860_RF_2750 4 /* dual-band 1T2R */
|
||||
#define RT3070_RF_3020 5 /* 1T1R */
|
||||
#define RT3070_RF_2020 6 /* b/g */
|
||||
#define RT3070_RF_3021 7 /* 1T2R */
|
||||
#define RT3070_RF_3022 8 /* 2T2R */
|
||||
#define RT3070_RF_3052 9 /* dual-band 2T2R */
|
||||
#define RT3070_RF_3320 11 /* 1T1R */
|
||||
#define RT3070_RF_3053 13 /* dual-band 3T3R */
|
||||
#define RT2860_RF_2820 0x0001 /* 2T3R */
|
||||
#define RT2860_RF_2850 0x0002 /* dual-band 2T3R */
|
||||
#define RT2860_RF_2720 0x0003 /* 1T2R */
|
||||
#define RT2860_RF_2750 0x0004 /* dual-band 1T2R */
|
||||
#define RT3070_RF_3020 0x0005 /* 1T1R */
|
||||
#define RT3070_RF_2020 0x0006 /* b/g */
|
||||
#define RT3070_RF_3021 0x0007 /* 1T2R */
|
||||
#define RT3070_RF_3022 0x0008 /* 2T2R */
|
||||
#define RT3070_RF_3052 0x0009 /* dual-band 2T2R */
|
||||
#define RT3070_RF_3320 0x000b /* 1T1R */
|
||||
#define RT3070_RF_3053 0x000d /* dual-band 3T3R */
|
||||
#define RT5390_RF_5360 0x5360 /* 1T1R */
|
||||
#define RT5390_RF_5390 0x5390 /* 1T1R */
|
||||
|
||||
/* USB commands for RT2870 only */
|
||||
#define RT2870_RESET 1
|
||||
@ -904,6 +932,7 @@ struct rt2860_rxwi {
|
||||
|
||||
#define RT2860_EEPROM_DELAY 1 /* minimum hold time (microsecond) */
|
||||
|
||||
#define RT2860_EEPROM_CHIPID 0x00
|
||||
#define RT2860_EEPROM_VERSION 0x01
|
||||
#define RT2860_EEPROM_MAC01 0x02
|
||||
#define RT2860_EEPROM_MAC23 0x03
|
||||
@ -1006,14 +1035,17 @@ static const struct rt2860_rate {
|
||||
*/
|
||||
#define RT2860_DEF_MAC \
|
||||
{ RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \
|
||||
{ RT2860_BCN_OFFSET1, 0x6f77d0c8 }, \
|
||||
{ RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \
|
||||
{ RT2860_HT_BASIC_RATE, 0x00008003 }, \
|
||||
{ RT2860_MAC_SYS_CTRL, 0x00000000 }, \
|
||||
{ RT2860_RX_FILTR_CFG, 0x00017f97 }, \
|
||||
{ RT2860_BKOFF_SLOT_CFG, 0x00000209 }, \
|
||||
{ RT2860_TX_SW_CFG0, 0x00000000 }, \
|
||||
{ RT2860_TX_SW_CFG1, 0x00080606 }, \
|
||||
{ RT2860_TX_LINK_CFG, 0x00001020 }, \
|
||||
{ RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \
|
||||
{ RT2860_MAX_LEN_CFG, 0x00001f00 }, \
|
||||
{ RT2860_LED_CFG, 0x7f031e46 }, \
|
||||
{ RT2860_WMM_AIFSN_CFG, 0x00002273 }, \
|
||||
{ RT2860_WMM_CWMIN_CFG, 0x00002344 }, \
|
||||
@ -1028,42 +1060,9 @@ static const struct rt2860_rate {
|
||||
{ RT2860_MM20_PROT_CFG, 0x01744004 }, \
|
||||
{ RT2860_MM40_PROT_CFG, 0x03f54084 }, \
|
||||
{ RT2860_TXOP_CTRL_CFG, 0x0000583f }, \
|
||||
{ RT2860_TXOP_HLDR_ET, 0x00000002 }, \
|
||||
{ RT2860_TX_RTS_CFG, 0x00092b20 }, \
|
||||
{ RT2860_EXP_ACK_TIME, 0x002400ca }, \
|
||||
{ RT2860_XIFS_TIME_CFG, 0x33a41010 }, \
|
||||
{ RT2860_PWR_PIN_CFG, 0x00000003 }
|
||||
|
||||
/* XXX only a few registers differ from above, try to merge? */
|
||||
#define RT2870_DEF_MAC \
|
||||
{ RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \
|
||||
{ RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \
|
||||
{ RT2860_HT_BASIC_RATE, 0x00008003 }, \
|
||||
{ RT2860_MAC_SYS_CTRL, 0x00000000 }, \
|
||||
{ RT2860_BKOFF_SLOT_CFG, 0x00000209 }, \
|
||||
{ RT2860_TX_SW_CFG0, 0x00000000 }, \
|
||||
{ RT2860_TX_SW_CFG1, 0x00080606 }, \
|
||||
{ RT2860_TX_LINK_CFG, 0x00001020 }, \
|
||||
{ RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \
|
||||
{ RT2860_LED_CFG, 0x7f031e46 }, \
|
||||
{ RT2860_WMM_AIFSN_CFG, 0x00002273 }, \
|
||||
{ RT2860_WMM_CWMIN_CFG, 0x00002344 }, \
|
||||
{ RT2860_WMM_CWMAX_CFG, 0x000034aa }, \
|
||||
{ RT2860_MAX_PCNT, 0x1f3fbf9f }, \
|
||||
{ RT2860_TX_RTY_CFG, 0x47d01f0f }, \
|
||||
{ RT2860_AUTO_RSP_CFG, 0x00000013 }, \
|
||||
{ RT2860_CCK_PROT_CFG, 0x05740003 }, \
|
||||
{ RT2860_OFDM_PROT_CFG, 0x05740003 }, \
|
||||
{ RT2860_PBF_CFG, 0x00f40006 }, \
|
||||
{ RT2860_WPDMA_GLO_CFG, 0x00000030 }, \
|
||||
{ RT2860_GF20_PROT_CFG, 0x01744004 }, \
|
||||
{ RT2860_GF40_PROT_CFG, 0x03f44084 }, \
|
||||
{ RT2860_MM20_PROT_CFG, 0x01744004 }, \
|
||||
{ RT2860_MM40_PROT_CFG, 0x03f44084 }, \
|
||||
{ RT2860_TXOP_CTRL_CFG, 0x0000583f }, \
|
||||
{ RT2860_TXOP_HLDR_ET, 0x00000002 }, \
|
||||
{ RT2860_TX_RTS_CFG, 0x00092b20 }, \
|
||||
{ RT2860_EXP_ACK_TIME, 0x002400ca }, \
|
||||
{ RT2860_XIFS_TIME_CFG, 0x33a41010 }, \
|
||||
{ RT2860_PWR_PIN_CFG, 0x00000003 }
|
||||
|
||||
@ -1073,6 +1072,7 @@ static const struct rt2860_rate {
|
||||
#define RT2860_DEF_BBP \
|
||||
{ 65, 0x2c }, \
|
||||
{ 66, 0x38 }, \
|
||||
{ 68, 0x0b }, \
|
||||
{ 69, 0x12 }, \
|
||||
{ 70, 0x0a }, \
|
||||
{ 73, 0x10 }, \
|
||||
@ -1087,6 +1087,30 @@ static const struct rt2860_rate {
|
||||
{ 105, 0x05 }, \
|
||||
{ 106, 0x35 }
|
||||
|
||||
#define RT5390_DEF_BBP \
|
||||
{ 31, 0x08 }, \
|
||||
{ 65, 0x2c }, \
|
||||
{ 66, 0x38 }, \
|
||||
{ 68, 0x0b }, \
|
||||
{ 69, 0x12 }, \
|
||||
{ 70, 0x0a }, \
|
||||
{ 73, 0x13 }, \
|
||||
{ 75, 0x46 }, \
|
||||
{ 76, 0x28 }, \
|
||||
{ 77, 0x59 }, \
|
||||
{ 81, 0x37 }, \
|
||||
{ 82, 0x62 }, \
|
||||
{ 83, 0x7a }, \
|
||||
{ 84, 0x19 }, \
|
||||
{ 86, 0x38 }, \
|
||||
{ 91, 0x04 }, \
|
||||
{ 92, 0x02 }, \
|
||||
{ 103, 0xc0 }, \
|
||||
{ 104, 0x92 }, \
|
||||
{ 105, 0x3c }, \
|
||||
{ 106, 0x03 }, \
|
||||
{ 128, 0x12 }, \
|
||||
|
||||
/*
|
||||
* Default settings for RF registers; values derived from the reference driver.
|
||||
*/
|
||||
@ -1204,7 +1228,7 @@ static const struct rt2860_rate {
|
||||
{ 4, 0x40 }, \
|
||||
{ 5, 0x03 }, \
|
||||
{ 6, 0x02 }, \
|
||||
{ 7, 0x70 }, \
|
||||
{ 7, 0x60 }, \
|
||||
{ 9, 0x0f }, \
|
||||
{ 10, 0x41 }, \
|
||||
{ 11, 0x21 }, \
|
||||
@ -1218,38 +1242,125 @@ static const struct rt2860_rate {
|
||||
{ 20, 0xba }, \
|
||||
{ 21, 0xdb }, \
|
||||
{ 24, 0x16 }, \
|
||||
{ 25, 0x01 }, \
|
||||
{ 25, 0x03 }, \
|
||||
{ 29, 0x1f }
|
||||
|
||||
#define RT3572_DEF_RF \
|
||||
{ 0, 0x70 }, \
|
||||
{ 1, 0x81 }, \
|
||||
{ 2, 0xf1 }, \
|
||||
{ 3, 0x02 }, \
|
||||
{ 4, 0x4c }, \
|
||||
{ 5, 0x05 }, \
|
||||
{ 6, 0x4a }, \
|
||||
{ 7, 0xd8 }, \
|
||||
{ 9, 0xc3 }, \
|
||||
{ 10, 0xf1 }, \
|
||||
{ 11, 0xb9 }, \
|
||||
{ 12, 0x70 }, \
|
||||
{ 13, 0x65 }, \
|
||||
{ 14, 0xa0 }, \
|
||||
{ 15, 0x53 }, \
|
||||
{ 16, 0x4c }, \
|
||||
{ 17, 0x23 }, \
|
||||
{ 18, 0xac }, \
|
||||
{ 19, 0x93 }, \
|
||||
{ 20, 0xb3 }, \
|
||||
{ 21, 0xd0 }, \
|
||||
{ 22, 0x00 }, \
|
||||
{ 23, 0x3c }, \
|
||||
{ 24, 0x16 }, \
|
||||
{ 25, 0x15 }, \
|
||||
{ 26, 0x85 }, \
|
||||
{ 27, 0x00 }, \
|
||||
#define RT5390_DEF_RF \
|
||||
{ 1, 0x0f }, \
|
||||
{ 2, 0x80 }, \
|
||||
{ 3, 0x88 }, \
|
||||
{ 5, 0x10 }, \
|
||||
{ 6, 0xe0 }, \
|
||||
{ 7, 0x00 }, \
|
||||
{ 10, 0x53 }, \
|
||||
{ 11, 0x4a }, \
|
||||
{ 12, 0x46 }, \
|
||||
{ 13, 0x9f }, \
|
||||
{ 14, 0x00 }, \
|
||||
{ 15, 0x00 }, \
|
||||
{ 16, 0x00 }, \
|
||||
{ 18, 0x03 }, \
|
||||
{ 19, 0x00 }, \
|
||||
{ 20, 0x00 }, \
|
||||
{ 21, 0x00 }, \
|
||||
{ 22, 0x20 }, \
|
||||
{ 23, 0x00 }, \
|
||||
{ 24, 0x00 }, \
|
||||
{ 25, 0x80 }, \
|
||||
{ 26, 0x00 }, \
|
||||
{ 27, 0x09 }, \
|
||||
{ 28, 0x00 }, \
|
||||
{ 29, 0x9b }, \
|
||||
{ 30, 0x09 }, \
|
||||
{ 31, 0x10 }
|
||||
{ 29, 0x10 }, \
|
||||
{ 30, 0x10 }, \
|
||||
{ 31, 0x80 }, \
|
||||
{ 32, 0x80 }, \
|
||||
{ 33, 0x00 }, \
|
||||
{ 34, 0x07 }, \
|
||||
{ 35, 0x12 }, \
|
||||
{ 36, 0x00 }, \
|
||||
{ 37, 0x08 }, \
|
||||
{ 38, 0x85 }, \
|
||||
{ 39, 0x1b }, \
|
||||
{ 40, 0x0b }, \
|
||||
{ 41, 0xbb }, \
|
||||
{ 42, 0xd2 }, \
|
||||
{ 43, 0x9a }, \
|
||||
{ 44, 0x0e }, \
|
||||
{ 45, 0xa2 }, \
|
||||
{ 46, 0x73 }, \
|
||||
{ 47, 0x00 }, \
|
||||
{ 48, 0x10 }, \
|
||||
{ 49, 0x94 }, \
|
||||
{ 52, 0x38 }, \
|
||||
{ 53, 0x00 }, \
|
||||
{ 54, 0x78 }, \
|
||||
{ 55, 0x23 }, \
|
||||
{ 56, 0x22 }, \
|
||||
{ 57, 0x80 }, \
|
||||
{ 58, 0x7f }, \
|
||||
{ 59, 0x07 }, \
|
||||
{ 60, 0x45 }, \
|
||||
{ 61, 0xd1 }, \
|
||||
{ 62, 0x00 }, \
|
||||
{ 63, 0x00 }
|
||||
|
||||
#define RT5392_DEF_RF \
|
||||
{ 1, 0x17 }, \
|
||||
{ 2, 0x80 }, \
|
||||
{ 3, 0x88 }, \
|
||||
{ 5, 0x10 }, \
|
||||
{ 6, 0xe0 }, \
|
||||
{ 7, 0x00 }, \
|
||||
{ 10, 0x53 }, \
|
||||
{ 11, 0x4a }, \
|
||||
{ 12, 0x46 }, \
|
||||
{ 13, 0x9f }, \
|
||||
{ 14, 0x00 }, \
|
||||
{ 15, 0x00 }, \
|
||||
{ 16, 0x00 }, \
|
||||
{ 18, 0x03 }, \
|
||||
{ 19, 0x4d }, \
|
||||
{ 20, 0x00 }, \
|
||||
{ 21, 0x8d }, \
|
||||
{ 22, 0x20 }, \
|
||||
{ 23, 0x0b }, \
|
||||
{ 24, 0x44 }, \
|
||||
{ 25, 0x80 }, \
|
||||
{ 26, 0x82 }, \
|
||||
{ 27, 0x09 }, \
|
||||
{ 28, 0x00 }, \
|
||||
{ 29, 0x10 }, \
|
||||
{ 30, 0x10 }, \
|
||||
{ 31, 0x80 }, \
|
||||
{ 32, 0x80 }, \
|
||||
{ 33, 0xc0 }, \
|
||||
{ 34, 0x07 }, \
|
||||
{ 35, 0x12 }, \
|
||||
{ 36, 0x00 }, \
|
||||
{ 37, 0x08 }, \
|
||||
{ 38, 0x89 }, \
|
||||
{ 39, 0x1b }, \
|
||||
{ 40, 0x0f }, \
|
||||
{ 41, 0xbb }, \
|
||||
{ 42, 0xd5 }, \
|
||||
{ 43, 0x9b }, \
|
||||
{ 44, 0x0e }, \
|
||||
{ 45, 0xa2 }, \
|
||||
{ 46, 0x73 }, \
|
||||
{ 47, 0x0c }, \
|
||||
{ 48, 0x10 }, \
|
||||
{ 49, 0x94 }, \
|
||||
{ 50, 0x94 }, \
|
||||
{ 51, 0x3a }, \
|
||||
{ 52, 0x48 }, \
|
||||
{ 53, 0x44 }, \
|
||||
{ 54, 0x38 }, \
|
||||
{ 55, 0x43 }, \
|
||||
{ 56, 0xa1 }, \
|
||||
{ 57, 0x00 }, \
|
||||
{ 58, 0x39 }, \
|
||||
{ 59, 0x07 }, \
|
||||
{ 60, 0x45 }, \
|
||||
{ 61, 0x91 }, \
|
||||
{ 62, 0x39 }, \
|
||||
{ 63, 0x00 }
|
||||
|
@ -15,7 +15,7 @@
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* $OpenBSD: rt2860var.h,v 1.20 2010/09/07 16:21:42 deraadt Exp $
|
||||
* $FreeBSD$
|
||||
* $FreeBSD: releng/11.1/sys/dev/ral/rt2860var.h 300657 2016-05-25 06:29:23Z sgalabov $
|
||||
*/
|
||||
|
||||
#define RT2860_TX_RING_COUNT 64
|
||||
@ -38,7 +38,7 @@ struct rt2860_rx_radiotap_header {
|
||||
uint8_t wr_antenna;
|
||||
int8_t wr_antsignal;
|
||||
int8_t wr_antnoise;
|
||||
} __packed;
|
||||
} __packed __aligned(8);
|
||||
|
||||
#define RT2860_RX_RADIOTAP_PRESENT \
|
||||
((1 << IEEE80211_RADIOTAP_TSFT) | \
|
||||
@ -55,7 +55,7 @@ struct rt2860_tx_radiotap_header {
|
||||
uint8_t wt_rate;
|
||||
uint16_t wt_chan_freq;
|
||||
uint16_t wt_chan_flags;
|
||||
} __packed;
|
||||
} __packed __aligned(8);
|
||||
|
||||
#define RT2860_TX_RADIOTAP_PRESENT \
|
||||
((1 << IEEE80211_RADIOTAP_FLAGS) | \
|
||||
@ -115,13 +115,13 @@ struct rt2860_vap {
|
||||
#define RT2860_VAP(vap) ((struct rt2860_vap *)(vap))
|
||||
|
||||
struct rt2860_softc {
|
||||
struct ifnet *sc_ifp;
|
||||
struct ieee80211com sc_ic;
|
||||
struct mbufq sc_snd;
|
||||
struct mtx sc_mtx;
|
||||
device_t sc_dev;
|
||||
bus_space_tag_t sc_st;
|
||||
bus_space_handle_t sc_sh;
|
||||
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct callout watchdog_ch;
|
||||
|
||||
int sc_invalid;
|
||||
@ -139,6 +139,7 @@ struct rt2860_softc {
|
||||
#define RT2860_ENABLED (1 << 0)
|
||||
#define RT2860_ADVANCED_PS (1 << 1)
|
||||
#define RT2860_PCIE (1 << 2)
|
||||
#define RT2860_RUNNING (1 << 3)
|
||||
|
||||
struct ieee80211_node *wcid2ni[RT2860_WCID_MAX];
|
||||
|
||||
@ -158,7 +159,7 @@ struct rt2860_softc {
|
||||
|
||||
uint16_t mac_ver;
|
||||
uint16_t mac_rev;
|
||||
uint8_t rf_rev;
|
||||
uint16_t rf_rev;
|
||||
uint8_t freq;
|
||||
uint8_t ntxchains;
|
||||
uint8_t nrxchains;
|
||||
@ -193,9 +194,7 @@ struct rt2860_softc {
|
||||
uint32_t txpow40mhz_5ghz[5];
|
||||
|
||||
struct rt2860_rx_radiotap_header sc_rxtap;
|
||||
int sc_rxtap_len;
|
||||
struct rt2860_tx_radiotap_header sc_txtap;
|
||||
int sc_txtap_len;
|
||||
|
||||
#if defined(__HAIKU__)
|
||||
uint32_t sc_intr_status;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <dev/ral/rt2560reg.h>
|
||||
#include <dev/ral/rt2560var.h>
|
||||
#include <dev/ral/rt2661var.h>
|
||||
#include <dev/ral/rt2860reg.h>
|
||||
#include <dev/ral/rt2860var.h>
|
||||
|
||||
@ -26,9 +27,12 @@
|
||||
HAIKU_FBSD_WLAN_DRIVER_GLUE(ralinkwifi, ral, pci)
|
||||
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE | FBSD_WLAN);
|
||||
HAIKU_FIRMWARE_VERSION(0);
|
||||
HAIKU_FIRMWARE_NAME_MAP(4) = {{"rt2561fw", "rt2561.bin"},
|
||||
{"rt2561sfw", "rt2561s.bin"}, {"rt2661fw", "rt2661.bin"},
|
||||
{"rt2860fw", "rt2860.bin"}};
|
||||
HAIKU_FIRMWARE_NAME_MAP(4) = {
|
||||
{"rt2561fw", "rt2561.bin"},
|
||||
{"rt2561sfw", "rt2561s.bin"},
|
||||
{"rt2661fw", "rt2661.bin"},
|
||||
{"rt2860fw", "rt2860.bin"}
|
||||
};
|
||||
|
||||
NO_HAIKU_FBSD_MII_DRIVER();
|
||||
NO_HAIKU_REENABLE_INTERRUPTS();
|
||||
@ -43,14 +47,13 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
||||
{
|
||||
struct rt2560_softc* sc = (struct rt2560_softc*)device_get_softc(dev);
|
||||
// sc_ifp is common between context data structures
|
||||
struct ifnet* ifp = sc->sc_ifp;
|
||||
|
||||
switch (pci_get_device(dev)) {
|
||||
case 0x0201:
|
||||
// disable interrupts
|
||||
RAL_WRITE(sc, RT2560_CSR8, 0xffffffff);
|
||||
|
||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
||||
if (!(sc->sc_flags & RT2560_F_RUNNING)) {
|
||||
// don't re-enable interrupts if we're shutting down
|
||||
return 0;
|
||||
}
|
||||
@ -62,7 +65,7 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
||||
RAL_WRITE(sc, RT2661_INT_MASK_CSR, 0xffffff7f);
|
||||
RAL_WRITE(sc, RT2661_MCU_INT_MASK_CSR, 0xffffffff);
|
||||
|
||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
||||
if (!(sc->sc_flags & RAL_RUNNING)) {
|
||||
// don't re-enable interrupts if we're shutting down
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user