aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-phy-db.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-phy-db.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-phy-db.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-phy-db.c b/drivers/net/wireless/iwlwifi/iwl-phy-db.c
index d65305d08ebf..1a791af82d15 100644
--- a/drivers/net/wireless/iwlwifi/iwl-phy-db.c
+++ b/drivers/net/wireless/iwlwifi/iwl-phy-db.c
@@ -228,8 +228,24 @@ static u16 channel_id_to_papd(u16 ch_id)
228 228
229static u16 channel_id_to_txp(struct iwl_phy_db *phy_db, u16 ch_id) 229static u16 channel_id_to_txp(struct iwl_phy_db *phy_db, u16 ch_id)
230{ 230{
231 /* TODO David*/ 231 struct iwl_phy_db_chg_txp *txp_chg;
232 return 0; 232 int i;
233 u8 ch_index = ch_id_to_ch_index(ch_id);
234 if (ch_index == 0xff)
235 return 0xff;
236
237 for (i = 0; i < IWL_NUM_TXP_CH_GROUPS; i++) {
238 txp_chg = (void *)phy_db->calib_ch_group_txp[i].data;
239 if (!txp_chg)
240 return 0xff;
241 /*
242 * Looking for the first channel group that its max channel is
243 * higher then wanted channel.
244 */
245 if (le16_to_cpu(txp_chg->max_channel_idx) >= ch_index)
246 return i;
247 }
248 return 0xff;
233} 249}
234 250
235int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db, 251int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db,