diff options
Diffstat (limited to 'package/mac80211')
11 files changed, 768 insertions, 1 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index 3a5ceca24c..a17655f2fc 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_RELEASE:=1 +PKG_RELEASE:=2 ifneq ($(CONFIG_LINUX_2_6_27)$(CONFIG_LINUX_2_6_28),) PKG_VERSION:=2009-02-07 diff --git a/package/mac80211/patches/304-rt2x00-Remove-unused-define-rt2800pci.patch b/package/mac80211/patches/304-rt2x00-Remove-unused-define-rt2800pci.patch new file mode 100644 index 0000000000..b14dc21856 --- /dev/null +++ b/package/mac80211/patches/304-rt2x00-Remove-unused-define-rt2800pci.patch @@ -0,0 +1,24 @@ +From 811f05ec4e4ac26e1956be2a9073418e3b99a30b Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Wed, 4 Feb 2009 22:58:52 +0100 +Subject: [PATCH] rt2x00: Remove unused define (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.h | 5 ----- + 1 files changed, 0 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.h ++++ b/drivers/net/wireless/rt2x00/rt2800pci.h +@@ -250,11 +250,6 @@ + #define WMM_TXOP1_CFG_AC3TXOP FIELD32(0xffff0000) + + /* +- * RINGREG_DIFF +- */ +-#define RINGREG_DIFF 0x0010 +- +-/* + * GPIO_CTRL_CFG: + */ + #define GPIO_CTRL_CFG 0x0228 diff --git a/package/mac80211/patches/305-rt2x00-Remove-unused-define-rt2800usb.patch b/package/mac80211/patches/305-rt2x00-Remove-unused-define-rt2800usb.patch new file mode 100644 index 0000000000..144791d01e --- /dev/null +++ b/package/mac80211/patches/305-rt2x00-Remove-unused-define-rt2800usb.patch @@ -0,0 +1,24 @@ +From a2cdea8b8b14160b17a208ceacdbeaff8b71e99a Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Wed, 4 Feb 2009 22:59:27 +0100 +Subject: [PATCH] rt2x00: Remove unused define (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.h | 5 ----- + 1 files changed, 0 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.h ++++ b/drivers/net/wireless/rt2x00/rt2800usb.h +@@ -229,11 +229,6 @@ + #define WMM_TXOP1_CFG_AC3TXOP FIELD32(0xffff0000) + + /* +- * RINGREG_DIFF +- */ +-#define RINGREG_DIFF 0x0010 +- +-/* + * GPIO_CTRL_CFG: + */ + #define GPIO_CTRL_CFG 0x0228 diff --git a/package/mac80211/patches/306-rt2x00-Clean-header-rt2800pci.patch b/package/mac80211/patches/306-rt2x00-Clean-header-rt2800pci.patch new file mode 100644 index 0000000000..b913306f1f --- /dev/null +++ b/package/mac80211/patches/306-rt2x00-Clean-header-rt2800pci.patch @@ -0,0 +1,39 @@ +From f335adbc7a8fdd3a856be2d0e45d2d7a74e64a3a Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Thu, 5 Feb 2009 22:43:50 +0100 +Subject: [PATCH] rt2x00: Clean header (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.h | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.h ++++ b/drivers/net/wireless/rt2x00/rt2800pci.h +@@ -342,7 +342,7 @@ + #define PBF_SYS_CTRL_HOST_RAM_WRITE FIELD32(0x00010000) + + /* +- * PBF registers ++ * PBF registers + * Most are for debug. Driver doesn't touch PBF register. + */ + #define PBF_CFG 0x0408 +@@ -370,7 +370,7 @@ + #define BCN_OFFSET1_BCN7 FIELD32(0xff000000) + + /* +- * PBF registers ++ * PBF registers + * Most are for debug. Driver doesn't touch PBF register. + */ + #define TXRXQ_PCNT 0x0438 +@@ -1630,7 +1630,7 @@ struct mac_iveiv_entry { + #define EEPROM_TXPOWER_DELTA_TXPOWER FIELD16(0x0080) + + /* +- * EEPROM TXPOWER 802.11G ++ * EEPROM TXPOWER 802.11BG + */ + #define EEPROM_TXPOWER_BG1 0x0029 + #define EEPROM_TXPOWER_BG2 0x0030 diff --git a/package/mac80211/patches/307-rt2x00-Clean-header-rt2800usb.patch b/package/mac80211/patches/307-rt2x00-Clean-header-rt2800usb.patch new file mode 100644 index 0000000000..0a4f4dadd6 --- /dev/null +++ b/package/mac80211/patches/307-rt2x00-Clean-header-rt2800usb.patch @@ -0,0 +1,30 @@ +From 620724c1db862bbb09824855a19a8d1836752be2 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Thu, 5 Feb 2009 22:44:30 +0100 +Subject: [PATCH] rt2x00: Clean header (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.h ++++ b/drivers/net/wireless/rt2x00/rt2800usb.h +@@ -1213,7 +1213,7 @@ + * TX_STA_FIFO: TX Result for specific PID status fifo register + */ + #define TX_STA_FIFO 0x1718 +-#define TX_STA_FIFO_B_VALID FIELD32(0x00000001) ++#define TX_STA_FIFO_VALID FIELD32(0x00000001) + #define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e) + #define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020) + #define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040) +@@ -1436,7 +1436,7 @@ struct mac_iveiv_entry { + /* + * HW_BEACON_BASE + * In order to support maximum 8 MBSS and its maximum length +- * is 512 bytes for each beacon ++ * is 512 bytes for each beacon + * Three section discontinue memory segments will be used. + * 1. The original region for BCN 0~3 + * 2. Extract memory from FCE table for BCN 4~5 diff --git a/package/mac80211/patches/308-rt2x00-uncomment-get_tsf.patch b/package/mac80211/patches/308-rt2x00-uncomment-get_tsf.patch new file mode 100644 index 0000000000..de007cea2a --- /dev/null +++ b/package/mac80211/patches/308-rt2x00-uncomment-get_tsf.patch @@ -0,0 +1,40 @@ +From 6ad5c6dd7471b066e5f83aeec3919296c1fd817a Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 7 Feb 2009 15:21:48 +0100 +Subject: [PATCH] rt2x00: uncomment get_tsf + +The atomic requirement for get_tsf() has been removed +by mac80211. This means the USB drivers can add support +for the callback function again. + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt73usb.c | 10 ---------- + 1 files changed, 0 insertions(+), 10 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt73usb.c ++++ b/drivers/net/wireless/rt2x00/rt73usb.c +@@ -2241,13 +2241,6 @@ static int rt73usb_conf_tx(struct ieee80 + return 0; + } + +-#if 0 +-/* +- * Mac80211 demands get_tsf must be atomic. +- * This is not possible for rt73usb since all register access +- * functions require sleeping. Untill mac80211 no longer needs +- * get_tsf to be atomic, this function should be disabled. +- */ + static u64 rt73usb_get_tsf(struct ieee80211_hw *hw) + { + struct rt2x00_dev *rt2x00dev = hw->priv; +@@ -2261,9 +2254,6 @@ static u64 rt73usb_get_tsf(struct ieee80 + + return tsf; + } +-#else +-#define rt73usb_get_tsf NULL +-#endif + + static const struct ieee80211_ops rt73usb_mac80211_ops = { + .tx = rt2x00mac_tx, diff --git a/package/mac80211/patches/309-rt2x00-Uncomment-get_tsf-rt2800usb.patch b/package/mac80211/patches/309-rt2x00-Uncomment-get_tsf-rt2800usb.patch new file mode 100644 index 0000000000..da3e819af7 --- /dev/null +++ b/package/mac80211/patches/309-rt2x00-Uncomment-get_tsf-rt2800usb.patch @@ -0,0 +1,36 @@ +From 0779847f2c13b0170e4905138a61f7f98164a41e Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 7 Feb 2009 15:22:52 +0100 +Subject: [PATCH] rt2x00: Uncomment get_tsf (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 10 ---------- + 1 files changed, 0 insertions(+), 10 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -2696,13 +2696,6 @@ static int rt2800usb_conf_tx(struct ieee + return 0; + } + +-#if 0 +-/* +- * Mac80211 demands get_tsf must be atomic. +- * This is not possible for rt2800usb since all register access +- * functions require sleeping. Untill mac80211 no longer needs +- * get_tsf to be atomic, this function should be disabled. +- */ + static u64 rt2800usb_get_tsf(struct ieee80211_hw *hw) + { + struct rt2x00_dev *rt2x00dev = hw->priv; +@@ -2716,9 +2709,6 @@ static u64 rt2800usb_get_tsf(struct ieee + + return tsf; + } +-#else +-#define rt2800usb_get_tsf NULL +-#endif + + static const struct ieee80211_ops rt2800usb_mac80211_ops = { + .tx = rt2x00mac_tx, diff --git a/package/mac80211/patches/310-rt2x00-Fix-MCS-rx_mask-rt2800pci.patch b/package/mac80211/patches/310-rt2x00-Fix-MCS-rx_mask-rt2800pci.patch new file mode 100644 index 0000000000..31da8534c3 --- /dev/null +++ b/package/mac80211/patches/310-rt2x00-Fix-MCS-rx_mask-rt2800pci.patch @@ -0,0 +1,65 @@ +From 4009f1317cb51ac89f37241de48970f2ee6a8ec5 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 7 Feb 2009 17:18:03 +0100 +Subject: [PATCH] rt2x00: Fix MCS rx_mask (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 22 ++++++++++++++++++++-- + 1 files changed, 20 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -2193,6 +2193,13 @@ static int rt2800pci_validate_eeprom(str + rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2820); + rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word); + EEPROM(rt2x00dev, "Antenna: 0x%04x\n", word); ++ } else if (rt2x00_rev(&rt2x00dev->chip) < RT2883_VERSION) { ++ /* ++ * There is a max of 2 RX streams for RT2860 series ++ */ ++ if (rt2x00_get_field16(word, EEPROM_ANTENNA_RXPATH) > 2) ++ rt2x00_set_field16(&word, EEPROM_ANTENNA_RXPATH, 2); ++ rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word); + } + + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); +@@ -2416,6 +2423,7 @@ static int rt2800pci_probe_hw_mode(struc + char *tx_power1; + char *tx_power2; + unsigned int i; ++ u16 eeprom; + + /* + * Initialize all hw fields. +@@ -2432,6 +2440,8 @@ static int rt2800pci_probe_hw_mode(struc + rt2x00_eeprom_addr(rt2x00dev, + EEPROM_MAC_ADDR_0)); + ++ rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); ++ + /* + * Initialize hw_mode information. + */ +@@ -2463,11 +2473,19 @@ static int rt2800pci_probe_hw_mode(struc + IEEE80211_HT_CAP_PSMP_SUPPORT; + spec->ht.ampdu_factor = 3; + spec->ht.ampdu_density = 4; +- spec->ht.mcs.rx_mask[0] = 0xff; +- spec->ht.mcs.rx_mask[1] = 0xff; + spec->ht.mcs.tx_params = + IEEE80211_HT_MCS_TX_DEFINED; + ++ switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) { ++ case 3: ++ spec->ht.mcs.rx_mask[2] = 0xff; ++ case 2: ++ spec->ht.mcs.rx_mask[1] = 0xff; ++ case 1: ++ spec->ht.mcs.rx_mask[0] = 0xff; ++ break; ++ } ++ + /* + * Create channel information array + */ diff --git a/package/mac80211/patches/311-rt2x00-Fix-MCS-rx_mask-rt2800usb.patch b/package/mac80211/patches/311-rt2x00-Fix-MCS-rx_mask-rt2800usb.patch new file mode 100644 index 0000000000..4e27c01ca4 --- /dev/null +++ b/package/mac80211/patches/311-rt2x00-Fix-MCS-rx_mask-rt2800usb.patch @@ -0,0 +1,65 @@ +From 583272d9d8fba6f8d36c5f99b176f5225560b151 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 7 Feb 2009 17:18:34 +0100 +Subject: [PATCH] rt2x00: Fix MCS rx_mask (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 22 ++++++++++++++++++++-- + 1 files changed, 20 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -2215,6 +2215,13 @@ static int rt2800usb_validate_eeprom(str + rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2820); + rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word); + EEPROM(rt2x00dev, "Antenna: 0x%04x\n", word); ++ } else if (rt2x00_rev(&rt2x00dev->chip) < RT2883_VERSION) { ++ /* ++ * There is a max of 2 RX streams for RT2860 series ++ */ ++ if (rt2x00_get_field16(word, EEPROM_ANTENNA_RXPATH) > 2) ++ rt2x00_set_field16(&word, EEPROM_ANTENNA_RXPATH, 2); ++ rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word); + } + + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); +@@ -2465,6 +2472,7 @@ static int rt2800usb_probe_hw_mode(struc + char *tx_power1; + char *tx_power2; + unsigned int i; ++ u16 eeprom; + + /* + * Initialize all hw fields. +@@ -2481,6 +2489,8 @@ static int rt2800usb_probe_hw_mode(struc + rt2x00_eeprom_addr(rt2x00dev, + EEPROM_MAC_ADDR_0)); + ++ rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); ++ + /* + * Initialize HT information. + */ +@@ -2495,11 +2505,19 @@ static int rt2800usb_probe_hw_mode(struc + IEEE80211_HT_CAP_PSMP_SUPPORT; + spec->ht.ampdu_factor = 3; + spec->ht.ampdu_density = 4; +- spec->ht.mcs.rx_mask[0] = 0xff; +- spec->ht.mcs.rx_mask[1] = 0xff; + spec->ht.mcs.tx_params = + IEEE80211_HT_MCS_TX_DEFINED; + ++ switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) { ++ case 3: ++ spec->ht.mcs.rx_mask[2] = 0xff; ++ case 2: ++ spec->ht.mcs.rx_mask[1] = 0xff; ++ case 1: ++ spec->ht.mcs.rx_mask[0] = 0xff; ++ break; ++ } ++ + /* + * Initialize hw_mode information. + */ diff --git a/package/mac80211/patches/312-rt2x00-Channel-HT40-fixes-rt2800pci.patch b/package/mac80211/patches/312-rt2x00-Channel-HT40-fixes-rt2800pci.patch new file mode 100644 index 0000000000..8edcbc7904 --- /dev/null +++ b/package/mac80211/patches/312-rt2x00-Channel-HT40-fixes-rt2800pci.patch @@ -0,0 +1,186 @@ +From 1dabaea63944d04d03f29817f7641bcb3ed22014 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sun, 8 Feb 2009 00:08:37 +0100 +Subject: [PATCH] rt2x00: Channel HT40+/- fixes (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 69 +++++++++++++++---------------- + drivers/net/wireless/rt2x00/rt2800pci.h | 3 +- + 2 files changed, 36 insertions(+), 36 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -603,7 +603,7 @@ static void rt2800pci_config_ant(struct + rt2x00_set_field8(&r3, BBP3_RX_ANTENNA, 0); + break; + case 2: +- rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 16); ++ rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 2); + break; + case 3: + /* Do nothing */ +@@ -653,6 +653,7 @@ static void rt2800pci_config_lna_gain(st + } + + static void rt2800pci_config_channel(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_conf *conf, + struct rf_channel *rf, + struct channel_info *info) + { +@@ -660,34 +661,20 @@ static void rt2800pci_config_channel(str + unsigned int tx_pin; + u16 eeprom; + +- tx_pin = 0; +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); +- + rt2x00_set_field32(&rf->rf4, RF4_FREQ_OFFSET, rt2x00dev->freq_offset); + + /* + * Determine antenna settings from EEPROM + */ + rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); ++ + if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) == 1) { + rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_TX1, 1); +- /* Turn off unused PA or LNA when only 1T or 1R */ +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 0); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 0); + } + + if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH) == 1) { + rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_RX1, 1); + rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_RX2, 1); +- /* Turn off unused PA or LNA when only 1T or 1R */ +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 0); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 0); + } else if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH) == 2) + rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_RX2, 1); + +@@ -715,19 +702,14 @@ static void rt2800pci_config_channel(str + + rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A, + TXPOWER_A_TO_DEV(info->tx_power2)); +- +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, 1); + } else { + rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_G, + TXPOWER_G_TO_DEV(info->tx_power1)); + rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_G, + TXPOWER_G_TO_DEV(info->tx_power2)); +- +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1); + } + +- rt2x00_set_field32(&rf->rf4, RF4_BW40, +- test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)); ++ rt2x00_set_field32(&rf->rf4, RF4_HT40, conf_is_ht40(conf)); + + rt2800pci_rf_write(rt2x00dev, 1, rf->rf1); + rt2800pci_rf_write(rt2x00dev, 2, rf->rf2); +@@ -764,11 +746,6 @@ static void rt2800pci_config_channel(str + rt2800pci_bbp_write(rt2x00dev, 82, 0x84); + rt2800pci_bbp_write(rt2x00dev, 75, 0x50); + } +- +- rt2x00pci_register_read(rt2x00dev, TX_BAND_CFG, ®); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_A, 0); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_BG, 1); +- rt2x00pci_register_write(rt2x00dev, TX_BAND_CFG, reg); + } else { + rt2800pci_bbp_write(rt2x00dev, 82, 0xf2); + +@@ -776,13 +753,35 @@ static void rt2800pci_config_channel(str + rt2800pci_bbp_write(rt2x00dev, 75, 0x46); + else + rt2800pci_bbp_write(rt2x00dev, 75, 0x50); ++ } + +- rt2x00pci_register_read(rt2x00dev, TX_BAND_CFG, ®); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_A, 1); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_BG, 0); +- rt2x00pci_register_write(rt2x00dev, TX_BAND_CFG, reg); ++ rt2x00pci_register_read(rt2x00dev, TX_BAND_CFG, ®); ++ rt2x00_set_field32(®, TX_BAND_CFG_HT40_PLUS, conf_is_ht40_plus(conf)); ++ rt2x00_set_field32(®, TX_BAND_CFG_A, rf->channel > 14); ++ rt2x00_set_field32(®, TX_BAND_CFG_BG, rf->channel <= 14); ++ rt2x00pci_register_write(rt2x00dev, TX_BAND_CFG, reg); ++ ++ tx_pin = 0; ++ ++ /* Turn on unused PA or LNA when not using 1T or 1R */ ++ if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) != 1) { ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1); ++ } ++ ++ /* Turn on unused PA or LNA when not using 1T or 1R */ ++ if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH) != 1) { ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1); + } + ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, rf->channel <= 14); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, rf->channel > 14); ++ + rt2x00pci_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); + + msleep(1); +@@ -917,8 +916,8 @@ static void rt2800pci_config(struct rt2x + rt2800pci_config_lna_gain(rt2x00dev, libconf); + + if (flags & IEEE80211_CONF_CHANGE_CHANNEL) +- rt2800pci_config_channel(rt2x00dev, &libconf->rf, +- &libconf->channel); ++ rt2800pci_config_channel(rt2x00dev, libconf->conf, ++ &libconf->rf, &libconf->channel); + if (flags & IEEE80211_CONF_CHANGE_POWER) + rt2800pci_config_txpower(rt2x00dev, libconf->conf->power_level); + if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) +@@ -2724,14 +2723,14 @@ static const struct rt2x00lib_ops rt2800 + + static const struct data_queue_desc rt2800pci_queue_rx = { + .entry_num = RX_ENTRIES, +- .data_size = DATA_FRAME_SIZE, ++ .data_size = AGGREGATION_SIZE, + .desc_size = RXD_DESC_SIZE, + .priv_size = sizeof(struct queue_entry_priv_pci), + }; + + static const struct data_queue_desc rt2800pci_queue_tx = { + .entry_num = TX_ENTRIES, +- .data_size = DATA_FRAME_SIZE, ++ .data_size = AGGREGATION_SIZE, + .desc_size = TXD_DESC_SIZE, + .priv_size = sizeof(struct queue_entry_priv_pci), + }; +--- a/drivers/net/wireless/rt2x00/rt2800pci.h ++++ b/drivers/net/wireless/rt2x00/rt2800pci.h +@@ -791,6 +791,7 @@ + * TX_BAND_CFG: 0x1 use upper 20MHz, 0x0 use lower 20MHz + */ + #define TX_BAND_CFG 0x132c ++#define TX_BAND_CFG_HT40_PLUS FIELD32(0x00000001) + #define TX_BAND_CFG_A FIELD32(0x00000002) + #define TX_BAND_CFG_BG FIELD32(0x00000004) + +@@ -1496,7 +1497,7 @@ struct mac_iveiv_entry { + #define RF4_TXPOWER_A_7DBM_BOOST FIELD32(0x00000040) + #define RF4_TXPOWER_A FIELD32(0x00000780) + #define RF4_FREQ_OFFSET FIELD32(0x001f8000) +-#define RF4_BW40 FIELD32(0x00200000) ++#define RF4_HT40 FIELD32(0x00200000) + + /* + * EEPROM content. diff --git a/package/mac80211/patches/313-rt2x00-Channel-HT40-fixes-rt2800usb.patch b/package/mac80211/patches/313-rt2x00-Channel-HT40-fixes-rt2800usb.patch new file mode 100644 index 0000000000..14191c2a7a --- /dev/null +++ b/package/mac80211/patches/313-rt2x00-Channel-HT40-fixes-rt2800usb.patch @@ -0,0 +1,258 @@ +From c2288ea288283cea727dfa547339d245458071fc Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sun, 8 Feb 2009 00:09:22 +0100 +Subject: [PATCH] rt2x00: Channel HT40+/- fixes (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 107 ++++++++++++++++-------------- + drivers/net/wireless/rt2x00/rt2800usb.h | 5 +- + 2 files changed, 61 insertions(+), 51 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -641,7 +641,7 @@ static void rt2800usb_config_ant(struct + rt2x00_set_field8(&r3, BBP3_RX_ANTENNA, 0); + break; + case 2: +- rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 16); ++ rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 2); + break; + case 3: + /* Do nothing */ +@@ -691,6 +691,7 @@ static void rt2800usb_config_lna_gain(st + } + + static void rt2800usb_config_channel_rt2x(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_conf *conf, + struct rf_channel *rf, + struct channel_info *info) + { +@@ -702,6 +703,7 @@ static void rt2800usb_config_channel_rt2 + * Determine antenna settings from EEPROM + */ + rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); ++ + if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) == 1) + rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_TX1, 1); + +@@ -742,8 +744,7 @@ static void rt2800usb_config_channel_rt2 + TXPOWER_G_TO_DEV(info->tx_power2)); + } + +- rt2x00_set_field32(&rf->rf4, RF4_BW40, +- test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)); ++ rt2x00_set_field32(&rf->rf4, RF4_HT40, conf_is_ht40(conf)); + + rt2800usb_rf_write(rt2x00dev, 1, rf->rf1); + rt2800usb_rf_write(rt2x00dev, 2, rf->rf2); +@@ -766,6 +767,7 @@ static void rt2800usb_config_channel_rt2 + } + + static void rt2800usb_config_channel_rt3x(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_conf *conf, + struct rf_channel *rf, + struct channel_info *info) + { +@@ -787,10 +789,12 @@ static void rt2800usb_config_channel_rt3 + rt2x00_set_field8(&rfcsr, RFCSR23_FREQ_OFFSET, rt2x00dev->freq_offset); + rt2800usb_rfcsr_write(rt2x00dev, 23, rfcsr); + +- if (test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) +- rt2800usb_rfcsr_write(rt2x00dev, 24, rt2x00dev->calibration_bw40); ++ if (conf_is_ht40(conf)) ++ rt2800usb_rfcsr_write(rt2x00dev, 24, ++ rt2x00dev->calibration_bw40); + else +- rt2800usb_rfcsr_write(rt2x00dev, 24, rt2x00dev->calibration_bw20); ++ rt2800usb_rfcsr_write(rt2x00dev, 24, ++ rt2x00dev->calibration_bw20); + + rt2800usb_rfcsr_read(rt2x00dev, 23, &rfcsr); + rt2x00_set_field8(&rfcsr, RFCSR7_RF_TUNING, 1); +@@ -798,46 +802,24 @@ static void rt2800usb_config_channel_rt3 + } + + static void rt2800usb_config_channel(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_conf *conf, + struct rf_channel *rf, + struct channel_info *info) + { + u32 reg; + unsigned int tx_pin; + u16 eeprom; ++ u8 bbp; + +- if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION) +- rt2800usb_config_channel_rt2x(rt2x00dev, rf, info); +- else +- rt2800usb_config_channel_rt3x(rt2x00dev, rf, info); +- +- tx_pin = 0; +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); +- ++ /* ++ * Determine antenna settings from EEPROM ++ */ + rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); + +- /* Turn off unused PA or LNA when only 1T or 1R */ +- if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) == 1) { +- +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 0); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 0); +- } +- +- /* Turn off unused PA or LNA when only 1T or 1R */ +- if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH) == 1) { +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 0); +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 0); +- } +- +- if (rf->channel > 14) +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, 1); ++ if (rt2x00_rev(&rt2x00dev->chip) != RT3070_VERSION) ++ rt2800usb_config_channel_rt2x(rt2x00dev, conf, rf, info); + else +- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1); ++ rt2800usb_config_channel_rt3x(rt2x00dev, conf, rf, info); + + /* + * Change BBP settings +@@ -855,11 +837,6 @@ static void rt2800usb_config_channel(str + rt2800usb_bbp_write(rt2x00dev, 82, 0x84); + rt2800usb_bbp_write(rt2x00dev, 75, 0x50); + } +- +- rt2x00usb_register_read(rt2x00dev, TX_BAND_CFG, ®); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_A, 0); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_BG, 1); +- rt2x00usb_register_write(rt2x00dev, TX_BAND_CFG, reg); + } else { + rt2800usb_bbp_write(rt2x00dev, 82, 0xf2); + +@@ -867,15 +844,45 @@ static void rt2800usb_config_channel(str + rt2800usb_bbp_write(rt2x00dev, 75, 0x46); + else + rt2800usb_bbp_write(rt2x00dev, 75, 0x50); ++ } ++ ++ rt2x00usb_register_read(rt2x00dev, TX_BAND_CFG, ®); ++ rt2x00_set_field32(®, TX_BAND_CFG_HT40_PLUS, conf_is_ht40_plus(conf)); ++ rt2x00_set_field32(®, TX_BAND_CFG_A, rf->channel > 14); ++ rt2x00_set_field32(®, TX_BAND_CFG_BG, rf->channel <= 14); ++ rt2x00usb_register_write(rt2x00dev, TX_BAND_CFG, reg); ++ ++ tx_pin = 0; ++ ++ /* Turn on unused PA or LNA when not using 1T or 1R */ ++ if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) != 1) { ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1); ++ } + +- rt2x00usb_register_read(rt2x00dev, TX_BAND_CFG, ®); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_A, 1); +- rt2x00_set_field32(&rf->rf3, TX_BAND_CFG_BG, 0); +- rt2x00usb_register_write(rt2x00dev, TX_BAND_CFG, reg); ++ /* Turn on unused PA or LNA when not using 1T or 1R */ ++ if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH) != 1) { ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1); + } + ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, rf->channel <= 14); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, rf->channel > 14); ++ + rt2x00usb_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); + ++ rt2800usb_bbp_read(rt2x00dev, 4, &bbp); ++ rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf)); ++ rt2800usb_bbp_write(rt2x00dev, 4, bbp); ++ ++ rt2800usb_bbp_read(rt2x00dev, 3, &bbp); ++ rt2x00_set_field8(&bbp, BBP3_HT40_PLUS, conf_is_ht40_plus(conf)); ++ rt2800usb_bbp_write(rt2x00dev, 3, bbp); ++ + msleep(1); + } + +@@ -1008,8 +1015,8 @@ static void rt2800usb_config(struct rt2x + rt2800usb_config_lna_gain(rt2x00dev, libconf); + + if (flags & IEEE80211_CONF_CHANGE_CHANNEL) +- rt2800usb_config_channel(rt2x00dev, &libconf->rf, +- &libconf->channel); ++ rt2800usb_config_channel(rt2x00dev, libconf->conf, ++ &libconf->rf, &libconf->channel); + if (flags & IEEE80211_CONF_CHANGE_POWER) + rt2800usb_config_txpower(rt2x00dev, libconf->conf->power_level); + if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) +@@ -1643,7 +1650,7 @@ static u8 rt2800usb_init_rx_filter(struc + + if (bw40) { + rt2800usb_bbp_read(rt2x00dev, 4, &bbp); +- rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 0x10); ++ rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2); + rt2800usb_bbp_write(rt2x00dev, 4, bbp); + } + +@@ -2777,14 +2784,14 @@ static const struct rt2x00lib_ops rt2800 + + static const struct data_queue_desc rt2800usb_queue_rx = { + .entry_num = RX_ENTRIES, +- .data_size = DATA_FRAME_SIZE, ++ .data_size = AGGREGATION_SIZE, + .desc_size = RXD_DESC_SIZE + RXWI_DESC_SIZE, + .priv_size = sizeof(struct queue_entry_priv_usb), + }; + + static const struct data_queue_desc rt2800usb_queue_tx = { + .entry_num = TX_ENTRIES, +- .data_size = DATA_FRAME_SIZE, ++ .data_size = AGGREGATION_SIZE, + .desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE, + .priv_size = sizeof(struct queue_entry_priv_usb), + }; +--- a/drivers/net/wireless/rt2x00/rt2800usb.h ++++ b/drivers/net/wireless/rt2x00/rt2800usb.h +@@ -803,6 +803,7 @@ + * TX_BAND_CFG: 0x1 use upper 20MHz, 0x0 use lower 20MHz + */ + #define TX_BAND_CFG 0x132c ++#define TX_BAND_CFG_HT40_PLUS FIELD32(0x00000001) + #define TX_BAND_CFG_A FIELD32(0x00000002) + #define TX_BAND_CFG_BG FIELD32(0x00000004) + +@@ -1482,10 +1483,12 @@ struct mac_iveiv_entry { + * BBP 3: RX Antenna + */ + #define BBP3_RX_ANTENNA FIELD8(0x18) ++#define BBP3_HT40_PLUS FIELD8(0x20) + + /* + * BBP 4: Bandwidth + */ ++#define BBP4_TX_BF FIELD8(0x01) + #define BBP4_BANDWIDTH FIELD8(0x18) + + /* +@@ -1548,7 +1551,7 @@ struct mac_iveiv_entry { + #define RF4_TXPOWER_A_7DBM_BOOST FIELD32(0x00000040) + #define RF4_TXPOWER_A FIELD32(0x00000780) + #define RF4_FREQ_OFFSET FIELD32(0x001f8000) +-#define RF4_BW40 FIELD32(0x00200000) ++#define RF4_HT40 FIELD32(0x00200000) + + /* + * EEPROM content. |