Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
11e35925
Commit
11e35925
authored
12 years ago
by
Felix Fietkau
Browse files
Options
Downloads
Patches
Plain Diff
ath9k: add support for more antenna mask combinations on AR93xx
SVN-Revision: 35264
parent
38080ae5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package/mac80211/patches/300-pending_work.patch
+69
-2
69 additions, 2 deletions
package/mac80211/patches/300-pending_work.patch
package/mac80211/patches/554-ath9k_ani_mrc_fix.patch
+1
-1
1 addition, 1 deletion
package/mac80211/patches/554-ath9k_ani_mrc_fix.patch
with
70 additions
and
3 deletions
package/mac80211/patches/300-pending_work.patch
+
69
−
2
View file @
11e35925
...
@@ -480,6 +480,16 @@
...
@@ -480,6 +480,16 @@
ath9k_ps_restore(sc);
ath9k_ps_restore(sc);
ieee80211_wake_queues(hw);
ieee80211_wake_queues(hw);
@@ -1835,6 +1825,9 @@
static u32 fill_chainmask(u32 cap, u32 n
static bool validate_antenna_mask(struct ath_hw *ah, u32 val)
{
+ if (AR_SREV_9300_20_OR_LATER(ah))
+ return true;
+
switch (val & 0x7) {
case 0x1:
case 0x3:
--- a/drivers/net/wireless/ath/ath9k/recv.c
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -248,8 +248,6 @@
rx_init_fail:
@@ -248,8 +248,6 @@
rx_init_fail:
...
@@ -863,6 +873,46 @@
...
@@ -863,6 +873,46 @@
channelSel = freq / 75;
channelSel = freq / 75;
chan_frac = ((freq % 75) * 0x20000) / 75;
chan_frac = ((freq % 75) * 0x20000) / 75;
channelSel = (channelSel << 17) | chan_frac;
channelSel = (channelSel << 17) | chan_frac;
@@ -586,32 +589,19 @@
static void ar9003_hw_init_bb(struct ath
ath9k_hw_synth_delay(ah, chan, synthDelay);
}
-static void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx)
+void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx)
{
- switch (rx) {
- case 0x5:
+ if (ah->caps.tx_chainmask == 5 || ah->caps.rx_chainmask == 5)
REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
AR_PHY_SWAP_ALT_CHAIN);
- case 0x3:
- case 0x1:
- case 0x2:
- case 0x7:
- REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx);
- REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx);
- break;
- default:
- break;
- }
+
+ REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx);
+ REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx);
if ((ah->caps.hw_caps & ATH9K_HW_CAP_APM) && (tx == 0x7))
- REG_WRITE(ah, AR_SELFGEN_MASK, 0x3);
- else
- REG_WRITE(ah, AR_SELFGEN_MASK, tx);
+ tx = 3;
- if (tx == 0x5) {
- REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
- AR_PHY_SWAP_ALT_CHAIN);
- }
+ REG_WRITE(ah, AR_SELFGEN_MASK, tx);
}
/*
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -1028,7 +1028,7 @@
@@ -1028,7 +1028,7 @@
...
@@ -1178,7 +1228,16 @@
...
@@ -1178,7 +1228,16 @@
bool rtt = !!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT);
bool rtt = !!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT);
u32 agc_ctrl = 0, agc_supp_cals = AR_PHY_AGC_CONTROL_OFFSET_CAL |
u32 agc_ctrl = 0, agc_supp_cals = AR_PHY_AGC_CONTROL_OFFSET_CAL |
AR_PHY_AGC_CONTROL_FLTR_CAL |
AR_PHY_AGC_CONTROL_FLTR_CAL |
@@ -1013,7 +1013,8 @@
static bool ar9003_hw_init_cal(struct at
@@ -977,6 +977,8 @@
static bool ar9003_hw_init_cal(struct at
AR_PHY_CL_TAB_1,
AR_PHY_CL_TAB_2 };
+ ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
+
if (rtt) {
if (!ar9003_hw_rtt_restore(ah, chan))
run_rtt_cal = true;
@@ -1013,7 +1015,8 @@
static bool ar9003_hw_init_cal(struct at
}
}
}
}
...
@@ -1188,7 +1247,7 @@
...
@@ -1188,7 +1247,7 @@
goto skip_tx_iqcal;
goto skip_tx_iqcal;
/* Do Tx IQ Calibration */
/* Do Tx IQ Calibration */
@@ -1033,21 +103
4
,22 @@
static bool ar9003_hw_init_cal(struct at
@@ -1033,21 +103
6
,22 @@
static bool ar9003_hw_init_cal(struct at
REG_CLR_BIT(ah, AR_PHY_TX_IQCAL_CONTROL_0,
REG_CLR_BIT(ah, AR_PHY_TX_IQCAL_CONTROL_0,
AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL);
AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL);
txiqcal_done = run_agc_cal = true;
txiqcal_done = run_agc_cal = true;
...
@@ -2233,6 +2292,14 @@
...
@@ -2233,6 +2292,14 @@
int column, unsigned int *writecnt);
int column, unsigned int *writecnt);
u32 ath9k_hw_reverse_bits(u32 val, u32 n);
u32 ath9k_hw_reverse_bits(u32 val, u32 n);
u16 ath9k_hw_computetxtime(struct ath_hw *ah,
u16 ath9k_hw_computetxtime(struct ath_hw *ah,
@@ -1062,6 +1043,7 @@
void ar9003_paprd_setup_gain_table(struc
int ar9003_paprd_init_table(struct ath_hw *ah);
bool ar9003_paprd_is_done(struct ath_hw *ah);
bool ar9003_is_paprd_enabled(struct ath_hw *ah);
+void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx);
/* Hardware family op attach helpers */
int ar5008_hw_attach_phy_ops(struct ath_hw *ah);
--- a/net/mac80211/tx.c
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1677,10 +1677,10 @@
netdev_tx_t ieee80211_monitor_start_xmit
@@ -1677,10 +1677,10 @@
netdev_tx_t ieee80211_monitor_start_xmit
...
...
This diff is collapsed.
Click to expand it.
package/mac80211/patches/554-ath9k_ani_mrc_fix.patch
+
1
−
1
View file @
11e35925
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -10
88
,6 +10
88
,10 @@
static bool ar9003_hw_ani_control(struct
@@ -10
75
,6 +10
75
,10 @@
static bool ar9003_hw_ani_control(struct
* is_on == 0 means MRC CCK is OFF (more noise imm)
* is_on == 0 means MRC CCK is OFF (more noise imm)
*/
*/
bool is_on = param ? 1 : 0;
bool is_on = param ? 1 : 0;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment