u32 beacon_energy_c;
};
-int iwl_send_calib_results(struct iwl_priv *priv)
+int iwl_send_calib_results(struct iwl_trans *trans)
{
struct iwl_host_cmd hcmd = {
.id = REPLY_PHY_CALIBRATION_CMD,
};
struct iwl_calib_result *res;
- list_for_each_entry(res, &priv->calib_results, list) {
+ list_for_each_entry(res, &trans->calib_results, list) {
int ret;
hcmd.len[0] = res->cmd_len;
hcmd.data[0] = &res->hdr;
hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY;
- ret = iwl_trans_send_cmd(trans(priv), &hcmd);
+ ret = iwl_trans_send_cmd(trans, &hcmd);
if (ret) {
- IWL_ERR(priv, "Error %d on calib cmd %d\n",
+ IWL_ERR(trans, "Error %d on calib cmd %d\n",
ret, res->hdr.op_code);
return ret;
}
return 0;
}
-int iwl_calib_set(struct iwl_priv *priv,
+int iwl_calib_set(struct iwl_trans *trans,
const struct iwl_calib_hdr *cmd, int len)
{
struct iwl_calib_result *res, *tmp;
memcpy(&res->hdr, cmd, len);
res->cmd_len = len;
- list_for_each_entry(tmp, &priv->calib_results, list) {
+ list_for_each_entry(tmp, &trans->calib_results, list) {
if (tmp->hdr.op_code == res->hdr.op_code) {
list_replace(&tmp->list, &res->list);
kfree(tmp);
}
/* wasn't in list already */
- list_add_tail(&res->list, &priv->calib_results);
+ list_add_tail(&res->list, &trans->calib_results);
return 0;
}
-void iwl_calib_free_results(struct iwl_priv *priv)
+void iwl_calib_free_results(struct iwl_trans *trans)
{
struct iwl_calib_result *res, *tmp;
- list_for_each_entry_safe(res, tmp, &priv->calib_results, list) {
+ list_for_each_entry_safe(res, tmp, &trans->calib_results, list) {
list_del(&res->list);
kfree(res);
}
void iwl_init_sensitivity(struct iwl_priv *priv);
void iwl_reset_run_time_calib(struct iwl_priv *priv);
-int iwl_send_calib_results(struct iwl_priv *priv);
-int iwl_calib_set(struct iwl_priv *priv,
- const struct iwl_calib_hdr *cmd, int len);
-void iwl_calib_free_results(struct iwl_priv *priv);
-
#endif /* __iwl_calib_h__ */
mutex_init(&priv->shrd->mutex);
- INIT_LIST_HEAD(&priv->calib_results);
+ INIT_LIST_HEAD(&trans(priv)->calib_results);
priv->ieee_channels = NULL;
priv->ieee_rates = NULL;
static void iwl_uninit_drv(struct iwl_priv *priv)
{
- iwl_calib_free_results(priv);
iwl_free_geos(priv);
iwl_free_channel_map(priv);
if (priv->tx_cmd_pool)
IWL_CHAIN_NOISE_DONE,
};
-
-/* Opaque calibration results */
-struct iwl_calib_result {
- struct list_head list;
- size_t cmd_len;
- struct iwl_calib_hdr hdr;
- /* data follows */
-};
-
/* Sensitivity calib data */
struct iwl_sensitivity_data {
u32 auto_corr_ofdm;
s32 temperature; /* Celsius */
s32 last_temperature;
- /* init calibration results */
- struct list_head calib_results;
-
struct iwl_wipan_noa_data __rcu *noa_data;
/* Scan related variables */
static void iwl_trans_pcie_free(struct iwl_trans *trans)
{
+ iwl_calib_free_results(trans);
iwl_trans_pcie_tx_free(trans);
iwl_trans_pcie_rx_free(trans);
free_irq(bus(trans)->irq, trans);
struct fw_desc data; /* firmware data image */
};
+/* Opaque calibration results */
+struct iwl_calib_result {
+ struct list_head list;
+ size_t cmd_len;
+ struct iwl_calib_hdr hdr;
+ /* data follows */
+};
+
/**
* struct iwl_trans - transport common data
* @ops - pointer to iwl_trans_ops
* @ucode_rt: run time ucode image
* @ucode_init: init ucode image
* @ucode_wowlan: wake on wireless ucode image (optional)
+ * @nvm_device_type: indicates OTP or eeprom
+ * @calib_results: list head for init calibration results
*/
struct iwl_trans {
const struct iwl_trans_ops *ops;
/* eeprom related variables */
int nvm_device_type;
+ /* init calibration results */
+ struct list_head calib_results;
+
/* pointer to trans specific struct */
/*Ensure that this pointer will always be aligned to sizeof pointer */
char trans_specific[0] __attribute__((__aligned__(sizeof(void *))));
const void *data, size_t len);
void iwl_dealloc_ucode(struct iwl_trans *trans);
+int iwl_send_calib_results(struct iwl_trans *trans);
+int iwl_calib_set(struct iwl_trans *trans,
+ const struct iwl_calib_hdr *cmd, int len);
+void iwl_calib_free_results(struct iwl_trans *trans);
+
#endif /* __iwl_trans_h__ */
iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD);
cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]);
cmd.cap_pin2 = le16_to_cpu(xtal_calib[1]);
- return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd));
+ return iwl_calib_set(trans(priv), (void *)&cmd, sizeof(cmd));
}
static int iwl_set_temperature_offset_calib(struct iwl_priv *priv)
IWL_DEBUG_CALIB(priv, "Radio sensor offset: %d\n",
le16_to_cpu(cmd.radio_sensor_offset));
- return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd));
+ return iwl_calib_set(trans(priv), (void *)&cmd, sizeof(cmd));
}
static int iwl_set_temperature_offset_calib_v2(struct iwl_priv *priv)
IWL_DEBUG_CALIB(priv, "Voltage Ref: %d\n",
le16_to_cpu(cmd.burntVoltageRef));
- return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd));
+ return iwl_calib_set(trans(priv), (void *)&cmd, sizeof(cmd));
}
static int iwl_send_calib_cfg(struct iwl_trans *trans)
/* reduce the size of the length field itself */
len -= 4;
- if (iwl_calib_set(priv, hdr, len))
+ if (iwl_calib_set(trans(priv), hdr, len))
IWL_ERR(priv, "Failed to record calibration data %d\n",
hdr->op_code);
return ret;
}
- return iwl_send_calib_results(priv);
+ return iwl_send_calib_results(trans(priv));
}