提交 66128b14 编写于 作者: D Don Fry 提交者: Wey-Yi Guy

iwlwifi: replace iwl_priv reference with iwl_trans for ucode.

Replace the references to the iwl_priv structure with the iwl_trans
structure as the priv structure is never referenced other than to
access the trans structure.  Rename from iwlagn to iwl.
Signed-off-by: NDon Fry <donald.h.fry@intel.com>
Signed-off-by: NWey-Yi Guy <wey-yi.w.guy@intel.com>
上级 8a3cb29c
...@@ -1232,14 +1232,14 @@ int iwl_alive_start(struct iwl_priv *priv) ...@@ -1232,14 +1232,14 @@ int iwl_alive_start(struct iwl_priv *priv)
priv->bt_valid = IWLAGN_BT_VALID_ENABLE_FLAGS; priv->bt_valid = IWLAGN_BT_VALID_ENABLE_FLAGS;
priv->cur_rssi_ctx = NULL; priv->cur_rssi_ctx = NULL;
iwlagn_send_prio_tbl(priv); iwl_send_prio_tbl(trans(priv));
/* FIXME: w/a to force change uCode BT state machine */ /* FIXME: w/a to force change uCode BT state machine */
ret = iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_OPEN, ret = iwl_send_bt_env(trans(priv), IWL_BT_COEX_ENV_OPEN,
BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
if (ret) if (ret)
return ret; return ret;
ret = iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_CLOSE, ret = iwl_send_bt_env(trans(priv), IWL_BT_COEX_ENV_CLOSE,
BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
if (ret) if (ret)
return ret; return ret;
......
...@@ -108,8 +108,8 @@ void iwlagn_config_ht40(struct ieee80211_conf *conf, ...@@ -108,8 +108,8 @@ void iwlagn_config_ht40(struct ieee80211_conf *conf,
int iwlagn_rx_calib_result(struct iwl_priv *priv, int iwlagn_rx_calib_result(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb, struct iwl_rx_mem_buffer *rxb,
struct iwl_device_cmd *cmd); struct iwl_device_cmd *cmd);
int iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type); int iwl_send_bt_env(struct iwl_trans *trans, u8 action, u8 type);
void iwlagn_send_prio_tbl(struct iwl_priv *priv); void iwl_send_prio_tbl(struct iwl_trans *trans);
int iwlagn_run_init_ucode(struct iwl_priv *priv); int iwlagn_run_init_ucode(struct iwl_priv *priv);
int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv, int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
enum iwl_ucode_type ucode_type); enum iwl_ucode_type ucode_type);
......
...@@ -122,7 +122,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc, ...@@ -122,7 +122,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc,
/* /*
* ucode * ucode
*/ */
static int iwlagn_load_section(struct iwl_trans *trans, const char *name, static int iwl_load_section(struct iwl_trans *trans, const char *name,
struct fw_desc *image, u32 dst_addr) struct fw_desc *image, u32 dst_addr)
{ {
struct iwl_bus *bus = bus(trans); struct iwl_bus *bus = bus(trans);
...@@ -188,7 +188,7 @@ static inline struct fw_img *iwl_get_ucode_image(struct iwl_trans *trans, ...@@ -188,7 +188,7 @@ static inline struct fw_img *iwl_get_ucode_image(struct iwl_trans *trans,
return NULL; return NULL;
} }
static int iwlagn_load_given_ucode(struct iwl_trans *trans, static int iwl_load_given_ucode(struct iwl_trans *trans,
enum iwl_ucode_type ucode_type) enum iwl_ucode_type ucode_type)
{ {
int ret = 0; int ret = 0;
...@@ -201,19 +201,19 @@ static int iwlagn_load_given_ucode(struct iwl_trans *trans, ...@@ -201,19 +201,19 @@ static int iwlagn_load_given_ucode(struct iwl_trans *trans,
return -EINVAL; return -EINVAL;
} }
ret = iwlagn_load_section(trans, "INST", &image->code, ret = iwl_load_section(trans, "INST", &image->code,
IWLAGN_RTC_INST_LOWER_BOUND); IWLAGN_RTC_INST_LOWER_BOUND);
if (ret) if (ret)
return ret; return ret;
return iwlagn_load_section(trans, "DATA", &image->data, return iwl_load_section(trans, "DATA", &image->data,
IWLAGN_RTC_DATA_LOWER_BOUND); IWLAGN_RTC_DATA_LOWER_BOUND);
} }
/* /*
* Calibration * Calibration
*/ */
static int iwlagn_set_Xtal_calib(struct iwl_priv *priv) static int iwl_set_Xtal_calib(struct iwl_priv *priv)
{ {
struct iwl_calib_xtal_freq_cmd cmd; struct iwl_calib_xtal_freq_cmd cmd;
__le16 *xtal_calib = __le16 *xtal_calib =
...@@ -225,7 +225,7 @@ static int iwlagn_set_Xtal_calib(struct iwl_priv *priv) ...@@ -225,7 +225,7 @@ static int iwlagn_set_Xtal_calib(struct iwl_priv *priv)
return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd)); return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd));
} }
static int iwlagn_set_temperature_offset_calib(struct iwl_priv *priv) static int iwl_set_temperature_offset_calib(struct iwl_priv *priv)
{ {
struct iwl_calib_temperature_offset_cmd cmd; struct iwl_calib_temperature_offset_cmd cmd;
__le16 *offset_calib = __le16 *offset_calib =
...@@ -242,7 +242,7 @@ static int iwlagn_set_temperature_offset_calib(struct iwl_priv *priv) ...@@ -242,7 +242,7 @@ static int iwlagn_set_temperature_offset_calib(struct iwl_priv *priv)
return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd)); return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd));
} }
static int iwlagn_set_temperature_offset_calib_v2(struct iwl_priv *priv) static int iwl_set_temperature_offset_calib_v2(struct iwl_priv *priv)
{ {
struct iwl_calib_temperature_offset_v2_cmd cmd; struct iwl_calib_temperature_offset_v2_cmd cmd;
__le16 *offset_calib_high = (__le16 *)iwl_eeprom_query_addr(priv, __le16 *offset_calib_high = (__le16 *)iwl_eeprom_query_addr(priv,
...@@ -277,7 +277,7 @@ static int iwlagn_set_temperature_offset_calib_v2(struct iwl_priv *priv) ...@@ -277,7 +277,7 @@ static int iwlagn_set_temperature_offset_calib_v2(struct iwl_priv *priv)
return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd)); return iwl_calib_set(priv, (void *)&cmd, sizeof(cmd));
} }
static int iwlagn_send_calib_cfg(struct iwl_priv *priv) static int iwl_send_calib_cfg(struct iwl_trans *trans)
{ {
struct iwl_calib_cfg_cmd calib_cfg_cmd; struct iwl_calib_cfg_cmd calib_cfg_cmd;
struct iwl_host_cmd cmd = { struct iwl_host_cmd cmd = {
...@@ -293,7 +293,7 @@ static int iwlagn_send_calib_cfg(struct iwl_priv *priv) ...@@ -293,7 +293,7 @@ static int iwlagn_send_calib_cfg(struct iwl_priv *priv)
calib_cfg_cmd.ucd_calib_cfg.flags = calib_cfg_cmd.ucd_calib_cfg.flags =
IWL_CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_MSK; IWL_CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_MSK;
return iwl_trans_send_cmd(trans(priv), &cmd); return iwl_trans_send_cmd(trans, &cmd);
} }
int iwlagn_rx_calib_result(struct iwl_priv *priv, int iwlagn_rx_calib_result(struct iwl_priv *priv,
...@@ -326,14 +326,14 @@ int iwlagn_init_alive_start(struct iwl_priv *priv) ...@@ -326,14 +326,14 @@ int iwlagn_init_alive_start(struct iwl_priv *priv)
* no need to close the envlope since we are going * no need to close the envlope since we are going
* to load the runtime uCode later. * to load the runtime uCode later.
*/ */
ret = iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_OPEN, ret = iwl_send_bt_env(trans(priv), IWL_BT_COEX_ENV_OPEN,
BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
if (ret) if (ret)
return ret; return ret;
} }
ret = iwlagn_send_calib_cfg(priv); ret = iwl_send_calib_cfg(trans(priv));
if (ret) if (ret)
return ret; return ret;
...@@ -343,15 +343,15 @@ int iwlagn_init_alive_start(struct iwl_priv *priv) ...@@ -343,15 +343,15 @@ int iwlagn_init_alive_start(struct iwl_priv *priv)
*/ */
if (priv->cfg->need_temp_offset_calib) { if (priv->cfg->need_temp_offset_calib) {
if (priv->cfg->temp_offset_v2) if (priv->cfg->temp_offset_v2)
return iwlagn_set_temperature_offset_calib_v2(priv); return iwl_set_temperature_offset_calib_v2(priv);
else else
return iwlagn_set_temperature_offset_calib(priv); return iwl_set_temperature_offset_calib(priv);
} }
return 0; return 0;
} }
static int iwlagn_send_wimax_coex(struct iwl_priv *priv) static int iwl_send_wimax_coex(struct iwl_priv *priv)
{ {
struct iwl_wimax_coex_cmd coex_cmd; struct iwl_wimax_coex_cmd coex_cmd;
...@@ -379,7 +379,7 @@ static int iwlagn_send_wimax_coex(struct iwl_priv *priv) ...@@ -379,7 +379,7 @@ static int iwlagn_send_wimax_coex(struct iwl_priv *priv)
sizeof(coex_cmd), &coex_cmd); sizeof(coex_cmd), &coex_cmd);
} }
static const u8 iwlagn_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = { static const u8 iwl_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = {
((BT_COEX_PRIO_TBL_PRIO_BYPASS << IWL_BT_COEX_PRIO_TBL_PRIO_POS) | ((BT_COEX_PRIO_TBL_PRIO_BYPASS << IWL_BT_COEX_PRIO_TBL_PRIO_POS) |
(0 << IWL_BT_COEX_PRIO_TBL_SHARED_ANTENNA_POS)), (0 << IWL_BT_COEX_PRIO_TBL_SHARED_ANTENNA_POS)),
((BT_COEX_PRIO_TBL_PRIO_BYPASS << IWL_BT_COEX_PRIO_TBL_PRIO_POS) | ((BT_COEX_PRIO_TBL_PRIO_BYPASS << IWL_BT_COEX_PRIO_TBL_PRIO_POS) |
...@@ -401,42 +401,42 @@ static const u8 iwlagn_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = { ...@@ -401,42 +401,42 @@ static const u8 iwlagn_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = {
0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0
}; };
void iwlagn_send_prio_tbl(struct iwl_priv *priv) void iwl_send_prio_tbl(struct iwl_trans *trans)
{ {
struct iwl_bt_coex_prio_table_cmd prio_tbl_cmd; struct iwl_bt_coex_prio_table_cmd prio_tbl_cmd;
memcpy(prio_tbl_cmd.prio_tbl, iwlagn_bt_prio_tbl, memcpy(prio_tbl_cmd.prio_tbl, iwl_bt_prio_tbl,
sizeof(iwlagn_bt_prio_tbl)); sizeof(iwl_bt_prio_tbl));
if (iwl_trans_send_cmd_pdu(trans(priv), if (iwl_trans_send_cmd_pdu(trans,
REPLY_BT_COEX_PRIO_TABLE, CMD_SYNC, REPLY_BT_COEX_PRIO_TABLE, CMD_SYNC,
sizeof(prio_tbl_cmd), &prio_tbl_cmd)) sizeof(prio_tbl_cmd), &prio_tbl_cmd))
IWL_ERR(priv, "failed to send BT prio tbl command\n"); IWL_ERR(trans, "failed to send BT prio tbl command\n");
} }
int iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type) int iwl_send_bt_env(struct iwl_trans *trans, u8 action, u8 type)
{ {
struct iwl_bt_coex_prot_env_cmd env_cmd; struct iwl_bt_coex_prot_env_cmd env_cmd;
int ret; int ret;
env_cmd.action = action; env_cmd.action = action;
env_cmd.type = type; env_cmd.type = type;
ret = iwl_trans_send_cmd_pdu(trans(priv), ret = iwl_trans_send_cmd_pdu(trans,
REPLY_BT_COEX_PROT_ENV, CMD_SYNC, REPLY_BT_COEX_PROT_ENV, CMD_SYNC,
sizeof(env_cmd), &env_cmd); sizeof(env_cmd), &env_cmd);
if (ret) if (ret)
IWL_ERR(priv, "failed to send BT env command\n"); IWL_ERR(trans, "failed to send BT env command\n");
return ret; return ret;
} }
static int iwlagn_alive_notify(struct iwl_priv *priv) static int iwl_alive_notify(struct iwl_priv *priv)
{ {
struct iwl_rxon_context *ctx; struct iwl_rxon_context *ctx;
int ret; int ret;
if (!priv->tx_cmd_pool) if (!priv->tx_cmd_pool)
priv->tx_cmd_pool = priv->tx_cmd_pool =
kmem_cache_create("iwlagn_dev_cmd", kmem_cache_create("iwl_dev_cmd",
sizeof(struct iwl_device_cmd), sizeof(struct iwl_device_cmd),
sizeof(void *), 0, NULL); sizeof(void *), 0, NULL);
...@@ -447,12 +447,12 @@ static int iwlagn_alive_notify(struct iwl_priv *priv) ...@@ -447,12 +447,12 @@ static int iwlagn_alive_notify(struct iwl_priv *priv)
for_each_context(priv, ctx) for_each_context(priv, ctx)
ctx->last_tx_rejected = false; ctx->last_tx_rejected = false;
ret = iwlagn_send_wimax_coex(priv); ret = iwl_send_wimax_coex(priv);
if (ret) if (ret)
return ret; return ret;
if (!priv->cfg->no_xtal_calib) { if (!priv->cfg->no_xtal_calib) {
ret = iwlagn_set_Xtal_calib(priv); ret = iwl_set_Xtal_calib(priv);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -548,7 +548,7 @@ struct iwlagn_alive_data { ...@@ -548,7 +548,7 @@ struct iwlagn_alive_data {
u8 subtype; u8 subtype;
}; };
static void iwlagn_alive_fn(struct iwl_priv *priv, static void iwl_alive_fn(struct iwl_priv *priv,
struct iwl_rx_packet *pkt, struct iwl_rx_packet *pkt,
void *data) void *data)
{ {
...@@ -587,12 +587,12 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv, ...@@ -587,12 +587,12 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
return ret; return ret;
iwlagn_init_notification_wait(priv, &alive_wait, REPLY_ALIVE, iwlagn_init_notification_wait(priv, &alive_wait, REPLY_ALIVE,
iwlagn_alive_fn, &alive_data); iwl_alive_fn, &alive_data);
old_type = priv->ucode_type; old_type = priv->ucode_type;
priv->ucode_type = ucode_type; priv->ucode_type = ucode_type;
ret = iwlagn_load_given_ucode(trans(priv), ucode_type); ret = iwl_load_given_ucode(trans(priv), ucode_type);
if (ret) { if (ret) {
priv->ucode_type = old_type; priv->ucode_type = old_type;
iwlagn_remove_notification(priv, &alive_wait); iwlagn_remove_notification(priv, &alive_wait);
...@@ -633,7 +633,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv, ...@@ -633,7 +633,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
msleep(5); msleep(5);
} }
ret = iwlagn_alive_notify(priv); ret = iwl_alive_notify(priv);
if (ret) { if (ret) {
IWL_WARN(priv, IWL_WARN(priv,
"Could not complete ALIVE transition: %d\n", ret); "Could not complete ALIVE transition: %d\n", ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册