Commit d8ec2e2a authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Kalle Valo

ath9k: Add an eeprom_ops callback for retrieving the eepmisc value

This allows deciding if we have to swap the EEPROM data (so it matches
the system's native endianness) even if no byte-swapping (swab16, based on
the first two bytes in the EEPROM) is needed.
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 291478b7
...@@ -5498,6 +5498,11 @@ unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, ...@@ -5498,6 +5498,11 @@ unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah,
} }
} }
static u8 ar9003_get_eepmisc(struct ath_hw *ah)
{
return ah->eeprom.map4k.baseEepHeader.eepMisc;
}
const struct eeprom_ops eep_ar9300_ops = { const struct eeprom_ops eep_ar9300_ops = {
.check_eeprom = ath9k_hw_ar9300_check_eeprom, .check_eeprom = ath9k_hw_ar9300_check_eeprom,
.get_eeprom = ath9k_hw_ar9300_get_eeprom, .get_eeprom = ath9k_hw_ar9300_get_eeprom,
...@@ -5508,5 +5513,6 @@ const struct eeprom_ops eep_ar9300_ops = { ...@@ -5508,5 +5513,6 @@ const struct eeprom_ops eep_ar9300_ops = {
.set_board_values = ath9k_hw_ar9300_set_board_values, .set_board_values = ath9k_hw_ar9300_set_board_values,
.set_addac = ath9k_hw_ar9300_set_addac, .set_addac = ath9k_hw_ar9300_set_addac,
.set_txpower = ath9k_hw_ar9300_set_txpower, .set_txpower = ath9k_hw_ar9300_set_txpower,
.get_spur_channel = ath9k_hw_ar9300_get_spur_channel .get_spur_channel = ath9k_hw_ar9300_get_spur_channel,
.get_eepmisc = ar9003_get_eepmisc
}; };
...@@ -655,6 +655,7 @@ struct eeprom_ops { ...@@ -655,6 +655,7 @@ struct eeprom_ops {
u16 cfgCtl, u8 twiceAntennaReduction, u16 cfgCtl, u8 twiceAntennaReduction,
u8 powerLimit, bool test); u8 powerLimit, bool test);
u16 (*get_spur_channel)(struct ath_hw *ah, u16 i, bool is2GHz); u16 (*get_spur_channel)(struct ath_hw *ah, u16 i, bool is2GHz);
u8 (*get_eepmisc)(struct ath_hw *ah);
}; };
void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val); void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val);
......
...@@ -1064,6 +1064,11 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) ...@@ -1064,6 +1064,11 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
return ah->eeprom.map4k.modalHeader.spurChans[i].spurChan; return ah->eeprom.map4k.modalHeader.spurChans[i].spurChan;
} }
static u8 ath9k_hw_4k_get_eepmisc(struct ath_hw *ah)
{
return ah->eeprom.map4k.baseEepHeader.eepMisc;
}
const struct eeprom_ops eep_4k_ops = { const struct eeprom_ops eep_4k_ops = {
.check_eeprom = ath9k_hw_4k_check_eeprom, .check_eeprom = ath9k_hw_4k_check_eeprom,
.get_eeprom = ath9k_hw_4k_get_eeprom, .get_eeprom = ath9k_hw_4k_get_eeprom,
...@@ -1073,5 +1078,6 @@ const struct eeprom_ops eep_4k_ops = { ...@@ -1073,5 +1078,6 @@ const struct eeprom_ops eep_4k_ops = {
.get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev, .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev,
.set_board_values = ath9k_hw_4k_set_board_values, .set_board_values = ath9k_hw_4k_set_board_values,
.set_txpower = ath9k_hw_4k_set_txpower, .set_txpower = ath9k_hw_4k_set_txpower,
.get_spur_channel = ath9k_hw_4k_get_spur_channel .get_spur_channel = ath9k_hw_4k_get_spur_channel,
.get_eepmisc = ath9k_hw_4k_get_eepmisc
}; };
...@@ -986,6 +986,11 @@ static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah, ...@@ -986,6 +986,11 @@ static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
return ah->eeprom.map9287.modalHeader.spurChans[i].spurChan; return ah->eeprom.map9287.modalHeader.spurChans[i].spurChan;
} }
static u8 ath9k_hw_ar9287_get_eepmisc(struct ath_hw *ah)
{
return ah->eeprom.map9287.baseEepHeader.eepMisc;
}
const struct eeprom_ops eep_ar9287_ops = { const struct eeprom_ops eep_ar9287_ops = {
.check_eeprom = ath9k_hw_ar9287_check_eeprom, .check_eeprom = ath9k_hw_ar9287_check_eeprom,
.get_eeprom = ath9k_hw_ar9287_get_eeprom, .get_eeprom = ath9k_hw_ar9287_get_eeprom,
...@@ -995,5 +1000,6 @@ const struct eeprom_ops eep_ar9287_ops = { ...@@ -995,5 +1000,6 @@ const struct eeprom_ops eep_ar9287_ops = {
.get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev, .get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev,
.set_board_values = ath9k_hw_ar9287_set_board_values, .set_board_values = ath9k_hw_ar9287_set_board_values,
.set_txpower = ath9k_hw_ar9287_set_txpower, .set_txpower = ath9k_hw_ar9287_set_txpower,
.get_spur_channel = ath9k_hw_ar9287_get_spur_channel .get_spur_channel = ath9k_hw_ar9287_get_spur_channel,
.get_eepmisc = ath9k_hw_ar9287_get_eepmisc
}; };
...@@ -1317,6 +1317,11 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) ...@@ -1317,6 +1317,11 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
return ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan; return ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan;
} }
static u8 ath9k_hw_def_get_eepmisc(struct ath_hw *ah)
{
return ah->eeprom.def.baseEepHeader.eepMisc;
}
const struct eeprom_ops eep_def_ops = { const struct eeprom_ops eep_def_ops = {
.check_eeprom = ath9k_hw_def_check_eeprom, .check_eeprom = ath9k_hw_def_check_eeprom,
.get_eeprom = ath9k_hw_def_get_eeprom, .get_eeprom = ath9k_hw_def_get_eeprom,
...@@ -1327,5 +1332,6 @@ const struct eeprom_ops eep_def_ops = { ...@@ -1327,5 +1332,6 @@ const struct eeprom_ops eep_def_ops = {
.set_board_values = ath9k_hw_def_set_board_values, .set_board_values = ath9k_hw_def_set_board_values,
.set_addac = ath9k_hw_def_set_addac, .set_addac = ath9k_hw_def_set_addac,
.set_txpower = ath9k_hw_def_set_txpower, .set_txpower = ath9k_hw_def_set_txpower,
.get_spur_channel = ath9k_hw_def_get_spur_channel .get_spur_channel = ath9k_hw_def_get_spur_channel,
.get_eepmisc = ath9k_hw_def_get_eepmisc
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment