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

Commit 0692fe41 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

iwlwifi: split out firmware store



Through the driver, struct iwl_fw will
store the firmware. Split this out into
a separate file, iwl-fw.h, and make all
other code use it. To do this, also move
the log pointers into it, and remove the
knowledge of "nic" from everything.

Now the op_mode has a fw pointer, and
(unfortunately) for now the shared data
also needs to keep one for the transport
to access dump the error log -- I think
that will move later.

Since I wanted to constify the firmware
pointers, some more changes were needed.

Signed-off-by: default avatarJohannes Berg <johannes.berg@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 e1991885
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@
#include "iwl-trans.h"
#include "iwl-agn.h"
#include "iwl-wifi.h"
#include "iwl-ucode.h"

/*****************************************************************************
 * INIT calibrations framework
@@ -644,7 +643,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
	data->last_bad_plcp_cnt_cck = 0;
	data->last_fa_cnt_cck = 0;

	if (nic(priv)->fw.enhance_sensitivity_table)
	if (priv->fw->enhance_sensitivity_table)
		ret |= iwl_enhance_sensitivity_write(priv);
	else
		ret |= iwl_sensitivity_write(priv);
@@ -754,7 +753,7 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)

	iwl_sens_auto_corr_ofdm(priv, norm_fa_ofdm, rx_enable_time);
	iwl_sens_energy_cck(priv, norm_fa_cck, rx_enable_time, &statis);
	if (nic(priv)->fw.enhance_sensitivity_table)
	if (priv->fw->enhance_sensitivity_table)
		iwl_enhance_sensitivity_write(priv);
	else
		iwl_sensitivity_write(priv);
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
	tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED;
	tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO;

	if (IWL_UCODE_API(nic(priv)->fw.ucode_ver) == 1)
	if (IWL_UCODE_API(priv->fw->ucode_ver) == 1)
		tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD_V1;
	else
		tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;
+6 −4
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@

#include <asm/div64.h>

#include "iwl-ucode.h"
#include "iwl-eeprom.h"
#include "iwl-wifi.h"
#include "iwl-dev.h"
@@ -616,7 +615,7 @@ static int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant)
	  .valid = cpu_to_le32(valid_tx_ant),
	};

	if (IWL_UCODE_API(nic(priv)->fw.ucode_ver) > 1) {
	if (IWL_UCODE_API(priv->fw->ucode_ver) > 1) {
		IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant);
		return iwl_trans_send_cmd_pdu(trans(priv),
					TX_ANT_CONFIGURATION_CMD,
@@ -1174,9 +1173,9 @@ static void iwl_debug_config(struct iwl_priv *priv)
#endif
}

static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans)
static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
						 const struct iwl_fw *fw)
{
	struct iwl_fw *fw = &nic(trans)->fw;
	int err = 0;
	struct iwl_priv *priv;
	struct ieee80211_hw *hw;
@@ -1200,6 +1199,9 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans)
	priv = IWL_OP_MODE_GET_DVM(op_mode);
	priv->shrd = trans->shrd;
	priv->shrd->priv = priv;
	priv->fw = fw;
	/* TODO: remove fw from shared data later */
	priv->shrd->fw = fw;

	iwl_trans_configure(trans(priv), op_mode);

+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ void iwl_nic_error(struct iwl_op_mode *op_mode);
/* MAC80211 */
struct ieee80211_hw *iwl_alloc_all(void);
int iwlagn_mac_setup_register(struct iwl_priv *priv,
			      struct iwl_ucode_capabilities *capa);
			      const struct iwl_ucode_capabilities *capa);
void iwlagn_mac_unregister(struct iwl_priv *priv);

/* RXON */
+0 −12
Original line number Diff line number Diff line
@@ -74,13 +74,6 @@

struct iwl_priv;

/* uCode version contains 4 values: Major/Minor/API/Serial */
#define IWL_UCODE_MAJOR(ver)	(((ver) & 0xFF000000) >> 24)
#define IWL_UCODE_MINOR(ver)	(((ver) & 0x00FF0000) >> 16)
#define IWL_UCODE_API(ver)	(((ver) & 0x0000FF00) >> 8)
#define IWL_UCODE_SERIAL(ver)	((ver) & 0x000000FF)


/* Tx rates */
#define IWL_CCK_RATES	4
#define IWL_OFDM_RATES	8
@@ -3151,8 +3144,6 @@ struct iwl_enhance_sensitivity_cmd {
 */

/* Phy calibration command for series */
/* The default calibrate table size if not specified by firmware */
#define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE	18
enum {
	IWL_PHY_CALIBRATE_DC_CMD		= 8,
	IWL_PHY_CALIBRATE_LO_CMD		= 9,
@@ -3161,11 +3152,8 @@ enum {
	IWL_PHY_CALIBRATE_BASE_BAND_CMD		= 16,
	IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD	= 17,
	IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD	= 18,
	IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE	= 19,
};

#define IWL_MAX_PHY_CALIBRATE_TBL_SIZE		(253)

/* This enum defines the bitmap of various calibrations to enable in both
 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
 */
Loading