Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45c30dba authored by Don Fry's avatar Don Fry Committed by Wey-Yi Guy
Browse files

iwlwifi: move calib_results list from iwl_priv to iwl_trans



Move the calib_results list from the upper layer iwl_priv structure
to the lower layer iwl_trans structure.

Signed-off-by: default avatarDon Fry <donald.h.fry@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent ae6130fc
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ struct statistics_general_data {
	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,
@@ -90,15 +90,15 @@ int iwl_send_calib_results(struct iwl_priv *priv)
	};
	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;
		}
@@ -107,7 +107,7 @@ int iwl_send_calib_results(struct iwl_priv *priv)
	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;
@@ -119,7 +119,7 @@ int iwl_calib_set(struct iwl_priv *priv,
	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);
@@ -128,16 +128,16 @@ int iwl_calib_set(struct iwl_priv *priv,
	}

	/* 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);
	}
+0 −5
Original line number Diff line number Diff line
@@ -72,9 +72,4 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv);
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__ */
+1 −2
Original line number Diff line number Diff line
@@ -1577,7 +1577,7 @@ static int iwl_init_drv(struct iwl_priv *priv)

	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;
@@ -1635,7 +1635,6 @@ err:

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)
+0 −12
Original line number Diff line number Diff line
@@ -440,15 +440,6 @@ enum iwlagn_chain_noise_state {
	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;
@@ -830,9 +821,6 @@ struct iwl_priv {
	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 */
+1 −0
Original line number Diff line number Diff line
@@ -1373,6 +1373,7 @@ static void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,

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);
Loading