Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102502
b: refs/heads/master
c: f1f6941
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed May 7, 2008
1 parent 9f55ecf commit 0fd984b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7839fc03862704677902be2d63c0482fee3deae3
refs/heads/master: f1f6941500602504fa9cd97294bfb3df7f22384f
29 changes: 29 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,33 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
return (address & ADDRESS_MSK) + (offset << 1);
}

static int iwl5000_eeprom_check_version(struct iwl_priv *priv)
{
u16 eeprom_ver;
struct iwl_eeprom_calib_hdr {
u8 version;
u8 pa_type;
u16 voltage;
} *hdr;

eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);

hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(priv,
EEPROM_5000_CALIB_ALL);

if (eeprom_ver < EEPROM_5000_EEPROM_VERSION ||
hdr->version < EEPROM_5000_TX_POWER_VERSION)
goto err;

return 0;
err:
IWL_ERROR("Unsuported EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n",
eeprom_ver, EEPROM_5000_EEPROM_VERSION,
hdr->version, EEPROM_5000_TX_POWER_VERSION);
return -EINVAL;

}

#ifdef CONFIG_IWL5000_RUN_TIME_CALIB

static void iwl5000_gain_computation(struct iwl_priv *priv,
Expand Down Expand Up @@ -179,6 +206,7 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
data->beacon_count = 0;
}


static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
{
struct iwl_chain_noise_data *data = &priv->chain_noise_data;
Expand Down Expand Up @@ -394,6 +422,7 @@ static struct iwl_lib_ops iwl5000_lib = {
.verify_signature = iwlcore_eeprom_verify_signature,
.acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
.release_semaphore = iwlcore_eeprom_release_semaphore,
.check_version = iwl5000_eeprom_check_version,
.query_addr = iwl5000_eeprom_query_addr,
},
};
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ struct iwl_eeprom_channel {
#define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */
#define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */

/* 5000 Specific */
#define EEPROM_5000_TX_POWER_VERSION (4)
#define EEPROM_5000_EEPROM_VERSION (0x11A)

/*5000 calibrations */
#define EEPROM_5000_CALIB_ALL (INDIRECT_ADDRESS | INDIRECT_CALIBRATION)

Expand Down

0 comments on commit 0fd984b

Please sign in to comment.