Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121647
b: refs/heads/master
c: f69f42a
h: refs/heads/master
i:
  121645: 8d33ed9
  121643: 4b37968
  121639: d5c86af
  121631: fbf7cfe
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Oct 31, 2008
1 parent 49df7c2 commit aad0696
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 70 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: 0ef2ca67b19e2286eed8eeb7ef7a35ce57d6d629
refs/heads/master: f69f42a6bbefb311ccb1626fdb61f723160afbfd
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,10 @@ static void iwl4965_chain_noise_reset(struct iwl_priv *priv)
struct iwl_chain_noise_data *data = &(priv->chain_noise_data);

if ((data->state == IWL_CHAIN_NOISE_ALIVE) && iwl_is_associated(priv)) {
struct iwl4965_calibration_cmd cmd;
struct iwl_calib_diff_gain_cmd cmd;

memset(&cmd, 0, sizeof(cmd));
cmd.opCode = PHY_CALIBRATE_DIFF_GAIN_CMD;
cmd.opCode = IWL_PHY_CALIBRATE_DIFF_GAIN_CMD;
cmd.diff_gain_a = 0;
cmd.diff_gain_b = 0;
cmd.diff_gain_c = 0;
Expand Down Expand Up @@ -569,11 +569,11 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,

/* Differential gain gets sent to uCode only once */
if (!data->radio_write) {
struct iwl4965_calibration_cmd cmd;
struct iwl_calib_diff_gain_cmd cmd;
data->radio_write = 1;

memset(&cmd, 0, sizeof(cmd));
cmd.opCode = PHY_CALIBRATE_DIFF_GAIN_CMD;
cmd.opCode = IWL_PHY_CALIBRATE_DIFF_GAIN_CMD;
cmd.diff_gain_a = data->delta_gain_code[0];
cmd.diff_gain_b = data->delta_gain_code[1];
cmd.diff_gain_c = data->delta_gain_code[2];
Expand Down
9 changes: 0 additions & 9 deletions trunk/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,5 @@ struct iwl5000_shared {
__le32 padding2;
} __attribute__ ((packed));

/* calibrations defined for 5000 */
/* defines the order in which results should be sent to the runtime uCode */
enum iwl5000_calib {
IWL5000_CALIB_XTAL,
IWL5000_CALIB_LO,
IWL5000_CALIB_TX_IQ,
IWL5000_CALIB_TX_IQ_PERD,
};

#endif /* __iwl_5000_hw_h__ */

42 changes: 21 additions & 21 deletions trunk/drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
data->delta_gain_code[1], data->delta_gain_code[2]);

if (!data->radio_write) {
struct iwl5000_calibration_chain_noise_gain_cmd cmd;
struct iwl_calib_chain_noise_gain_cmd cmd;
memset(&cmd, 0, sizeof(cmd));

cmd.op_code = IWL5000_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD;
cmd.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD;
cmd.delta_gain_1 = data->delta_gain_code[1];
cmd.delta_gain_2 = data->delta_gain_code[2];
iwl_send_cmd_pdu_async(priv, REPLY_PHY_CALIBRATION_CMD,
Expand All @@ -364,10 +364,10 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
struct iwl_chain_noise_data *data = &priv->chain_noise_data;

if ((data->state == IWL_CHAIN_NOISE_ALIVE) && iwl_is_associated(priv)) {
struct iwl5000_calibration_chain_noise_reset_cmd cmd;
struct iwl_calib_chain_noise_reset_cmd cmd;

memset(&cmd, 0, sizeof(cmd));
cmd.op_code = IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD;
cmd.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD;
if (iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
sizeof(cmd), &cmd))
IWL_ERROR("Could not send REPLY_PHY_CALIBRATION_CMD\n");
Expand Down Expand Up @@ -420,25 +420,25 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
*/
static int iwl5000_set_Xtal_calib(struct iwl_priv *priv)
{
u8 data[sizeof(struct iwl5000_calib_hdr) +
u8 data[sizeof(struct iwl_calib_hdr) +
sizeof(struct iwl_cal_xtal_freq)];
struct iwl5000_calib_cmd *cmd = (struct iwl5000_calib_cmd *)data;
struct iwl_calib_cmd *cmd = (struct iwl_calib_cmd *)data;
struct iwl_cal_xtal_freq *xtal = (struct iwl_cal_xtal_freq *)cmd->data;
u16 *xtal_calib = (u16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL);

cmd->hdr.op_code = IWL5000_PHY_CALIBRATE_CRYSTAL_FRQ_CMD;
cmd->hdr.op_code = IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD;
xtal->cap_pin1 = (u8)xtal_calib[0];
xtal->cap_pin2 = (u8)xtal_calib[1];
return iwl_calib_set(&priv->calib_results[IWL5000_CALIB_XTAL],
return iwl_calib_set(&priv->calib_results[IWL_CALIB_XTAL],
data, sizeof(data));
}

static int iwl5000_send_calib_cfg(struct iwl_priv *priv)
{
struct iwl5000_calib_cfg_cmd calib_cfg_cmd;
struct iwl_calib_cfg_cmd calib_cfg_cmd;
struct iwl_host_cmd cmd = {
.id = CALIBRATION_CFG_CMD,
.len = sizeof(struct iwl5000_calib_cfg_cmd),
.len = sizeof(struct iwl_calib_cfg_cmd),
.data = &calib_cfg_cmd,
};

Expand All @@ -455,7 +455,7 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb)
{
struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
struct iwl5000_calib_hdr *hdr = (struct iwl5000_calib_hdr *)pkt->u.raw;
struct iwl_calib_hdr *hdr = (struct iwl_calib_hdr *)pkt->u.raw;
int len = le32_to_cpu(pkt->len) & FH_RSCSR_FRAME_SIZE_MSK;
int index;

Expand All @@ -466,14 +466,14 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
* uCode. iwl_send_calib_results sends them in a row according to their
* index. We sort them here */
switch (hdr->op_code) {
case IWL5000_PHY_CALIBRATE_LO_CMD:
index = IWL5000_CALIB_LO;
case IWL_PHY_CALIBRATE_LO_CMD:
index = IWL_CALIB_LO;
break;
case IWL5000_PHY_CALIBRATE_TX_IQ_CMD:
index = IWL5000_CALIB_TX_IQ;
case IWL_PHY_CALIBRATE_TX_IQ_CMD:
index = IWL_CALIB_TX_IQ;
break;
case IWL5000_PHY_CALIBRATE_TX_IQ_PERD_CMD:
index = IWL5000_CALIB_TX_IQ_PERD;
case IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD:
index = IWL_CALIB_TX_IQ_PERD;
break;
default:
IWL_ERROR("Unknown calibration notification %d\n",
Expand Down Expand Up @@ -839,10 +839,10 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
case CSR_HW_REV_TYPE_5300:
case CSR_HW_REV_TYPE_5350:
priv->hw_params.calib_init_cfg =
BIT(IWL5000_CALIB_XTAL) |
BIT(IWL5000_CALIB_LO) |
BIT(IWL5000_CALIB_TX_IQ) |
BIT(IWL5000_CALIB_TX_IQ_PERD);
BIT(IWL_CALIB_XTAL) |
BIT(IWL_CALIB_LO) |
BIT(IWL_CALIB_TX_IQ) |
BIT(IWL_CALIB_TX_IQ_PERD);
break;
case CSR_HW_REV_TYPE_5150:
priv->hw_params.calib_init_cfg = 0;
Expand Down
69 changes: 35 additions & 34 deletions trunk/drivers/net/wireless/iwlwifi/iwl-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -2875,36 +2875,25 @@ struct iwl_sensitivity_cmd {
* 1-0: amount of gain, units of 1.5 dB
*/

/* "Differential Gain" opcode used in REPLY_PHY_CALIBRATION_CMD. */
#define PHY_CALIBRATE_DIFF_GAIN_CMD (7)

struct iwl4965_calibration_cmd {
u8 opCode; /* PHY_CALIBRATE_DIFF_GAIN_CMD (7) */
u8 flags; /* not used */
__le16 reserved;
s8 diff_gain_a; /* see above */
s8 diff_gain_b;
s8 diff_gain_c;
u8 reserved1;
} __attribute__ ((packed));

/* Phy calibration command for 5000 series */
/* Phy calibration command for series */

enum {
IWL5000_PHY_CALIBRATE_DC_CMD = 8,
IWL5000_PHY_CALIBRATE_LO_CMD = 9,
IWL5000_PHY_CALIBRATE_RX_BB_CMD = 10,
IWL5000_PHY_CALIBRATE_TX_IQ_CMD = 11,
IWL5000_PHY_CALIBRATE_RX_IQ_CMD = 12,
IWL5000_PHY_CALIBRATION_NOISE_CMD = 13,
IWL5000_PHY_CALIBRATE_AGC_TABLE_CMD = 14,
IWL5000_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15,
IWL5000_PHY_CALIBRATE_BASE_BAND_CMD = 16,
IWL5000_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17,
IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD = 18,
IWL5000_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD = 19,
IWL_PHY_CALIBRATE_DIFF_GAIN_CMD = 7,
IWL_PHY_CALIBRATE_DC_CMD = 8,
IWL_PHY_CALIBRATE_LO_CMD = 9,
IWL_PHY_CALIBRATE_RX_BB_CMD = 10,
IWL_PHY_CALIBRATE_TX_IQ_CMD = 11,
IWL_PHY_CALIBRATE_RX_IQ_CMD = 12,
IWL_PHY_CALIBRATION_NOISE_CMD = 13,
IWL_PHY_CALIBRATE_AGC_TABLE_CMD = 14,
IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15,
IWL_PHY_CALIBRATE_BASE_BAND_CMD = 16,
IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17,
IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD = 18,
IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD = 19,
};


struct iwl_cal_xtal_freq {
u8 cap_pin1;
u8 cap_pin2;
Expand All @@ -2926,32 +2915,44 @@ struct iwl_calib_cfg_status_s {
__le32 flags;
} __attribute__ ((packed));

struct iwl5000_calib_cfg_cmd {
struct iwl_calib_cfg_cmd {
struct iwl_calib_cfg_status_s ucd_calib_cfg;
struct iwl_calib_cfg_status_s drv_calib_cfg;
__le32 reserved1;
} __attribute__ ((packed));

struct iwl5000_calib_hdr {
struct iwl_calib_hdr {
u8 op_code;
u8 first_group;
u8 groups_num;
u8 data_valid;
} __attribute__ ((packed));

struct iwl5000_calib_cmd {
struct iwl5000_calib_hdr hdr;
struct iwl_calib_cmd {
struct iwl_calib_hdr hdr;
u8 data[0];
} __attribute__ ((packed));

struct iwl5000_calibration_chain_noise_reset_cmd {
u8 op_code; /* IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */
/* "Differential Gain" opcode used in REPLY_PHY_CALIBRATION_CMD. */

struct iwl_calib_diff_gain_cmd {
u8 opCode; /* IWL_PHY_CALIBRATE_DIFF_GAIN_CMD (7) */
u8 flags; /* not used */
__le16 reserved;
s8 diff_gain_a; /* see above */
s8 diff_gain_b;
s8 diff_gain_c;
u8 reserved1;
} __attribute__ ((packed));

struct iwl_calib_chain_noise_reset_cmd {
u8 op_code; /* IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */
u8 flags; /* not used */
__le16 reserved;
} __attribute__ ((packed));

struct iwl5000_calibration_chain_noise_gain_cmd {
u8 op_code; /* IWL5000_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD */
struct iwl_calib_chain_noise_gain_cmd {
u8 op_code; /* IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD */
u8 flags; /* not used */
__le16 reserved;
u8 delta_gain_1;
Expand Down
15 changes: 14 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,20 @@ struct statistics_general_data {
u32 beacon_energy_c;
};


/*
* enum iwl_calib
* defines the order in which results of initial calibrations
* should be sent to the runtime uCode
*/
enum iwl_calib {
IWL_CALIB_XTAL,
IWL_CALIB_LO,
IWL_CALIB_TX_IQ,
IWL_CALIB_TX_IQ_PERD,
IWL_CALIB_MAX
};

/* Opaque calibration results */
struct iwl_calib_result {
void *buf;
Expand Down Expand Up @@ -756,7 +770,6 @@ enum {


#define IWL_MAX_NUM_QUEUES 20 /* FIXME: do dynamic allocation */
#define IWL_CALIB_MAX 4

struct iwl_priv {

Expand Down

0 comments on commit aad0696

Please sign in to comment.