aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch')
-rw-r--r--package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch43
1 files changed, 8 insertions, 35 deletions
diff --git a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
index d7d07f8bb6..8041580411 100644
--- a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
+++ b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
@@ -1,10 +1,10 @@
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8474,6 +8474,160 @@ void rt2800_rf_self_txdc_cal(struct rt2x
+@@ -8472,6 +8472,155 @@ static void rt2800_rf_self_txdc_cal(stru
+ rt2x00_info(rt2x00dev, "RF Tx self calibration end\n");
}
- EXPORT_SYMBOL_GPL(rt2800_rf_self_txdc_cal);
-+int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2)
++static int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2)
+{
+ int calcode;
+ calcode = ((d2 - d1) * 1000) / 43;
@@ -14,9 +14,8 @@
+
+ return calcode;
+}
-+EXPORT_SYMBOL_GPL(rt2800_calcrcalibrationcode);
+
-+void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev)
++static void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev)
+{
+ u32 savemacsysctrl;
+ u8 saverfb0r1, saverfb0r34, saverfb0r35;
@@ -29,6 +28,8 @@
+ char d1 = 0, d2 = 0;
+ u8 rfvalue;
+ u32 MAC_RF_BYPASS0, MAC_RF_CONTROL0, MAC_PWR_PIN_CFG;
++ u32 maccfg, macstatus;
++ int i;
+
+ saverfb0r1 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 1);
+ saverfb0r34 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 34);
@@ -48,10 +49,6 @@
+ MAC_RF_CONTROL0 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
+ MAC_PWR_PIN_CFG = rt2800_register_read(rt2x00dev, PWR_PIN_CFG);
+
-+ {
-+ u32 maccfg, macstatus;
-+ int i;
-+
+ maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
+ maccfg &= (~0x04);
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
@@ -62,7 +59,7 @@
+ udelay(50);
+ else
+ break;
-+ }
++ }
+
+ if (i == 10000)
+ rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n");
@@ -81,7 +78,6 @@
+
+ if (i == 10000)
+ rt2x00_warn(rt2x00dev, "Wait MAC Rx Status to MAX !!!\n");
-+ }
+
+ rfvalue = (MAC_RF_BYPASS0 | 0x3004);
+ rt2800_register_write(rt2x00dev, RF_BYPASS0, rfvalue);
@@ -156,12 +152,11 @@
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl);
+ rt2800_register_write(rt2x00dev, PWR_PIN_CFG, MAC_PWR_PIN_CFG);
+}
-+EXPORT_SYMBOL_GPL(rt2800_r_calibration);
+
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
bool set_bw, bool is_ht40)
{
-@@ -9081,6 +9235,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9079,6 +9228,7 @@ static void rt2800_init_rfcsr_6352(struc
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
@@ -169,25 +164,3 @@
rt2800_rf_self_txdc_cal(rt2x00dev);
rt2800_bw_filter_calibration(rt2x00dev, true);
rt2800_bw_filter_calibration(rt2x00dev, false);
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
-@@ -243,6 +243,8 @@ void rt2800_link_tuner(struct rt2x00_dev
- void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev);
- void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev);
- void rt2800_rf_self_txdc_cal(struct rt2x00_dev *rt2x00dev);
-+int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2);
-+void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev);
-
- int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev);
- void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
-@@ -563,6 +563,8 @@ struct rt2x00lib_ops {
- void (*gain_calibration) (struct rt2x00_dev *rt2x00dev);
- void (*vco_calibration) (struct rt2x00_dev *rt2x00dev);
- void (*rf_self_txdc_cal) (struct rt2x00_dev *rt2x00dev);
-+ int (*calcrcalibrationcode) (struct rt2x00_dev *rt2x00dev, int d1, int d2);
-+ void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
-
- /*
- * Data queue handlers.