Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 301031
b: refs/heads/master
c: cfd8544
h: refs/heads/master
i:
  301029: dd466e1
  301027: e04c85f
  301023: 5f5f61d
v: v3
  • Loading branch information
David Spinadel authored and Wey-Yi Guy committed Apr 16, 2012
1 parent 13e275e commit 325da6c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfb45f5422deb3bbf12d8f67f5f76e4b9a7eb766
refs/heads/master: cfd8544e9e350848cf580380418cbebcd09015be
20 changes: 18 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-phy-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,24 @@ static u16 channel_id_to_papd(u16 ch_id)

static u16 channel_id_to_txp(struct iwl_phy_db *phy_db, u16 ch_id)
{
/* TODO David*/
return 0;
struct iwl_phy_db_chg_txp *txp_chg;
int i;
u8 ch_index = ch_id_to_ch_index(ch_id);
if (ch_index == 0xff)
return 0xff;

for (i = 0; i < IWL_NUM_TXP_CH_GROUPS; i++) {
txp_chg = (void *)phy_db->calib_ch_group_txp[i].data;
if (!txp_chg)
return 0xff;
/*
* Looking for the first channel group that its max channel is
* higher then wanted channel.
*/
if (le16_to_cpu(txp_chg->max_channel_idx) >= ch_index)
return i;
}
return 0xff;
}

int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db,
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-phy-db.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ enum iwl_phy_db_section_type {
IWL_PHY_DB_MAX
};

/* for parsing of tx power channel group data that comes from the firmware*/
struct iwl_phy_db_chg_txp {
__le32 space;
__le16 max_channel_idx;
} __packed;

struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd);

void iwl_phy_db_free(struct iwl_phy_db *phy_db);
Expand Down

0 comments on commit 325da6c

Please sign in to comment.