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

Commit e6bb4c9c authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlagn: bus layer chooses its transport layer



Remove iwl_transport_register which was a W/A. The bus layer knows what
transport to use. So now, the bus layer gives the upper layer a pointer to the
iwl_trans_ops struct that it wants to use. The upper layer then, allocates the
desired transport layer using iwl_trans_ops->alloc function.

As a result of this, priv->trans, no longer exists, priv holds a pointer to
iwl_shared, which holds a pointer to iwl_trans. This required to change all the
calls to the transport layer from upper layer. While we were at it, trans_X
inlines have been renamed to iwl_trans_X to avoid confusions, which of course
required to rename the functions inside the transport layer because of
conflicts in names. So the static API functions inside the transport layer
implementation have been renamed to iwl_trans_pcie_X.

Until now, the IRQ / Tasklet were initialized in iwl_transport_layer. This is
confusing since the registration doesn't mean to request IRQ, so I added a
handler for that.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f39c95e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
		return -EFAULT;
	}

	return trans_send_cmd(&priv->trans, &hcmd);
	return iwl_trans_send_cmd(trans(priv), &hcmd);
}

static struct iwl_lib_ops iwl5000_lib = {
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
		return -EFAULT;
	}

	return trans_send_cmd(&priv->trans, &hcmd);
	return iwl_trans_send_cmd(trans(priv), &hcmd);
}

static struct iwl_lib_ops iwl6000_lib = {
+4 −4
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ int iwl_send_calib_results(struct iwl_priv *priv)
			hcmd.len[0] = priv->calib_results[i].buf_len;
			hcmd.data[0] = priv->calib_results[i].buf;
			hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY;
			ret = trans_send_cmd(&priv->trans, &hcmd);
			ret = iwl_trans_send_cmd(trans(priv), &hcmd);
			if (ret) {
				IWL_ERR(priv, "Error %d iteration %d\n",
					ret, i);
@@ -484,7 +484,7 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)
	memcpy(&(priv->sensitivity_tbl[0]), &(cmd.table[0]),
	       sizeof(u16)*HD_TABLE_SIZE);

	return trans_send_cmd(&priv->trans, &cmd_out);
	return iwl_trans_send_cmd(trans(priv), &cmd_out);
}

/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */
@@ -573,7 +573,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv)
	       &(cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX]),
	       sizeof(u16)*ENHANCE_HD_TABLE_ENTRIES);

	return trans_send_cmd(&priv->trans, &cmd_out);
	return iwl_trans_send_cmd(trans(priv), &cmd_out);
}

void iwl_init_sensitivity(struct iwl_priv *priv)
@@ -918,7 +918,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
			priv->phy_calib_chain_noise_gain_cmd);
		cmd.delta_gain_1 = data->delta_gain_code[1];
		cmd.delta_gain_2 = data->delta_gain_code[2];
		trans_send_cmd_pdu(&priv->trans, REPLY_PHY_CALIBRATION_CMD,
		iwl_trans_send_cmd_pdu(trans(priv), REPLY_PHY_CALIBRATION_CMD,
			CMD_ASYNC, sizeof(cmd), &cmd);

		data->radio_write = 1;
+5 −5
Original line number Diff line number Diff line
@@ -526,7 +526,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
	else
		tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;

	return trans_send_cmd_pdu(&priv->trans, tx_ant_cfg_cmd, CMD_SYNC,
	return iwl_trans_send_cmd_pdu(trans(priv), tx_ant_cfg_cmd, CMD_SYNC,
			sizeof(tx_power_cmd), &tx_power_cmd);
}

@@ -1054,7 +1054,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
	if (ret)
		return ret;

	ret = trans_send_cmd(&priv->trans, &cmd);
	ret = iwl_trans_send_cmd(trans(priv), &cmd);
	if (ret) {
		clear_bit(STATUS_SCAN_HW, &priv->shrd->status);
		iwlagn_set_pan_params(priv);
@@ -1160,7 +1160,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
		       flush_cmd.fifo_control);
	flush_cmd.flush_control = cpu_to_le16(flush_control);

	return trans_send_cmd(&priv->trans, &cmd);
	return iwl_trans_send_cmd(trans(priv), &cmd);
}

void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
@@ -1354,12 +1354,12 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
	if (priv->cfg->bt_params->bt_session_2) {
		memcpy(&bt_cmd_2000.basic, &basic,
			sizeof(basic));
		ret = trans_send_cmd_pdu(&priv->trans, REPLY_BT_CONFIG,
		ret = iwl_trans_send_cmd_pdu(trans(priv), REPLY_BT_CONFIG,
			CMD_SYNC, sizeof(bt_cmd_2000), &bt_cmd_2000);
	} else {
		memcpy(&bt_cmd_6000.basic, &basic,
			sizeof(basic));
		ret = trans_send_cmd_pdu(&priv->trans, REPLY_BT_CONFIG,
		ret = iwl_trans_send_cmd_pdu(trans(priv), REPLY_BT_CONFIG,
			CMD_SYNC, sizeof(bt_cmd_6000), &bt_cmd_6000);
	}
	if (ret)
+8 −8
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ static int iwlagn_disable_bss(struct iwl_priv *priv,
	int ret;

	send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
	ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd,
	ret = iwl_trans_send_cmd_pdu(trans(priv), ctx->rxon_cmd,
				CMD_SYNC, sizeof(*send), send);

	send->filter_flags = old_filter;
@@ -67,7 +67,7 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,

	send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
	send->dev_type = RXON_DEV_TYPE_P2P;
	ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd,
	ret = iwl_trans_send_cmd_pdu(trans(priv), ctx->rxon_cmd,
				CMD_SYNC, sizeof(*send), send);

	send->filter_flags = old_filter;
@@ -93,7 +93,7 @@ static int iwlagn_disconn_pan(struct iwl_priv *priv,
	int ret;

	send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
	ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC,
	ret = iwl_trans_send_cmd_pdu(trans(priv), ctx->rxon_cmd, CMD_SYNC,
				sizeof(*send), send);

	send->filter_flags = old_filter;
@@ -122,7 +122,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv,
		      ctx->qos_data.qos_active,
		      ctx->qos_data.def_qos_parm.qos_flags);

	ret = trans_send_cmd_pdu(&priv->trans, ctx->qos_cmd, CMD_SYNC,
	ret = iwl_trans_send_cmd_pdu(trans(priv), ctx->qos_cmd, CMD_SYNC,
			       sizeof(struct iwl_qosparam_cmd),
			       &ctx->qos_data.def_qos_parm);
	if (ret)
@@ -181,7 +181,7 @@ static int iwlagn_send_rxon_assoc(struct iwl_priv *priv,
		 ctx->staging.ofdm_ht_triple_stream_basic_rates;
	rxon_assoc.acquisition_data = ctx->staging.acquisition_data;

	ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_assoc_cmd,
	ret = iwl_trans_send_cmd_pdu(trans(priv), ctx->rxon_assoc_cmd,
				CMD_ASYNC, sizeof(rxon_assoc), &rxon_assoc);
	return ret;
}
@@ -267,7 +267,7 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv,
	 * Associated RXON doesn't clear the station table in uCode,
	 * so we don't need to restore stations etc. after this.
	 */
	ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC,
	ret = iwl_trans_send_cmd_pdu(trans(priv), ctx->rxon_cmd, CMD_SYNC,
		      sizeof(struct iwl_rxon_cmd), &ctx->staging);
	if (ret) {
		IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
@@ -388,7 +388,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)
	cmd.slots[0].width = cpu_to_le16(slot0);
	cmd.slots[1].width = cpu_to_le16(slot1);

	ret = trans_send_cmd_pdu(&priv->trans, REPLY_WIPAN_PARAMS, CMD_SYNC,
	ret = iwl_trans_send_cmd_pdu(trans(priv), REPLY_WIPAN_PARAMS, CMD_SYNC,
			sizeof(cmd), &cmd);
	if (ret)
		IWL_ERR(priv, "Error setting PAN parameters (%d)\n", ret);
@@ -771,7 +771,7 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
		memset(&cmd, 0, sizeof(cmd));
		iwl_set_calib_hdr(&cmd.hdr,
			priv->phy_calib_chain_noise_reset_cmd);
		ret = trans_send_cmd_pdu(&priv->trans,
		ret = iwl_trans_send_cmd_pdu(trans(priv),
					REPLY_PHY_CALIBRATION_CMD,
					CMD_SYNC, sizeof(cmd), &cmd);
		if (ret)
Loading