Commit 68e8dfda authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: op_mode holds its pointer to the transport

Instead of using the shared area that we be killed.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 9130bab1
...@@ -60,13 +60,13 @@ static void iwl1000_set_ct_threshold(struct iwl_priv *priv) ...@@ -60,13 +60,13 @@ static void iwl1000_set_ct_threshold(struct iwl_priv *priv)
static void iwl1000_nic_config(struct iwl_priv *priv) static void iwl1000_nic_config(struct iwl_priv *priv)
{ {
/* set CSR_HW_CONFIG_REG for uCode use */ /* set CSR_HW_CONFIG_REG for uCode use */
iwl_set_bit(trans(priv), CSR_HW_IF_CONFIG_REG, iwl_set_bit(priv->trans, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
CSR_HW_IF_CONFIG_REG_BIT_MAC_SI); CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
/* Setting digital SVR for 1000 card to 1.32V */ /* Setting digital SVR for 1000 card to 1.32V */
/* locking is acquired in iwl_set_bits_mask_prph() function */ /* locking is acquired in iwl_set_bits_mask_prph() function */
iwl_set_bits_mask_prph(trans(priv), APMG_DIGITAL_SVR_REG, iwl_set_bits_mask_prph(priv->trans, APMG_DIGITAL_SVR_REG,
APMG_SVR_DIGITAL_VOLTAGE_1_32, APMG_SVR_DIGITAL_VOLTAGE_1_32,
~APMG_SVR_VOLTAGE_CONFIG_BIT_MSK); ~APMG_SVR_VOLTAGE_CONFIG_BIT_MSK);
} }
...@@ -222,7 +222,7 @@ static void iwl2000_nic_config(struct iwl_priv *priv) ...@@ -222,7 +222,7 @@ static void iwl2000_nic_config(struct iwl_priv *priv)
{ {
iwl_rf_config(priv); iwl_rf_config(priv);
iwl_set_bit(trans(priv), CSR_GP_DRIVER_REG, iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER); CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER);
} }
...@@ -318,7 +318,7 @@ static void iwl5000_nic_config(struct iwl_priv *priv) ...@@ -318,7 +318,7 @@ static void iwl5000_nic_config(struct iwl_priv *priv)
* (PCIe power is lost before PERST# is asserted), * (PCIe power is lost before PERST# is asserted),
* causing ME FW to lose ownership and not being able to obtain it back. * causing ME FW to lose ownership and not being able to obtain it back.
*/ */
iwl_set_bits_mask_prph(trans(priv), APMG_PS_CTRL_REG, iwl_set_bits_mask_prph(priv->trans, APMG_PS_CTRL_REG,
APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,
~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);
} }
...@@ -580,21 +580,21 @@ static void iwl6000_nic_config(struct iwl_priv *priv) ...@@ -580,21 +580,21 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
break; break;
case IWL_DEVICE_FAMILY_6000i: case IWL_DEVICE_FAMILY_6000i:
/* 2x2 IPA phy type */ /* 2x2 IPA phy type */
iwl_write32(trans(priv), CSR_GP_DRIVER_REG, iwl_write32(priv->trans, CSR_GP_DRIVER_REG,
CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA); CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
break; break;
case IWL_DEVICE_FAMILY_6050: case IWL_DEVICE_FAMILY_6050:
/* Indicate calibration version to uCode. */ /* Indicate calibration version to uCode. */
if (iwl_eeprom_calib_version(priv) >= 6) if (iwl_eeprom_calib_version(priv) >= 6)
iwl_set_bit(trans(priv), CSR_GP_DRIVER_REG, iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
break; break;
case IWL_DEVICE_FAMILY_6150: case IWL_DEVICE_FAMILY_6150:
/* Indicate calibration version to uCode. */ /* Indicate calibration version to uCode. */
if (iwl_eeprom_calib_version(priv) >= 6) if (iwl_eeprom_calib_version(priv) >= 6)
iwl_set_bit(trans(priv), CSR_GP_DRIVER_REG, iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
iwl_set_bit(trans(priv), CSR_GP_DRIVER_REG, iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
CSR_GP_DRIVER_REG_BIT_6050_1x2); CSR_GP_DRIVER_REG_BIT_6050_1x2);
break; break;
default: default:
......
...@@ -189,7 +189,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control) ...@@ -189,7 +189,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
goto done; goto done;
} }
IWL_DEBUG_INFO(priv, "wait transmit/flush all frames\n"); IWL_DEBUG_INFO(priv, "wait transmit/flush all frames\n");
iwl_trans_wait_tx_queue_empty(trans(priv)); iwl_trans_wait_tx_queue_empty(priv->trans);
done: done:
ieee80211_wake_queues(priv->hw); ieee80211_wake_queues(priv->hw);
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
...@@ -1132,7 +1132,7 @@ int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan) ...@@ -1132,7 +1132,7 @@ int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan)
memcpy(&rxon, &ctx->active, sizeof(rxon)); memcpy(&rxon, &ctx->active, sizeof(rxon));
priv->ucode_loaded = false; priv->ucode_loaded = false;
iwl_trans_stop_device(trans(priv)); iwl_trans_stop_device(priv->trans);
priv->wowlan = true; priv->wowlan = true;
...@@ -1260,7 +1260,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) ...@@ -1260,7 +1260,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
return -EIO; return -EIO;
} }
return iwl_trans_send_cmd(trans(priv), cmd); return iwl_trans_send_cmd(priv->trans, cmd);
} }
int iwl_dvm_send_cmd_pdu(struct iwl_priv *priv, u8 id, int iwl_dvm_send_cmd_pdu(struct iwl_priv *priv, u8 id,
......
...@@ -604,16 +604,16 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv, ...@@ -604,16 +604,16 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv,
if (flags & (SW_CARD_DISABLED | HW_CARD_DISABLED | if (flags & (SW_CARD_DISABLED | HW_CARD_DISABLED |
CT_CARD_DISABLED)) { CT_CARD_DISABLED)) {
iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_SET, iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_SET,
CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
iwl_write_direct32(trans(priv), HBUS_TARG_MBX_C, iwl_write_direct32(priv->trans, HBUS_TARG_MBX_C,
HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED); HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
if (!(flags & RXON_CARD_DISABLED)) { if (!(flags & RXON_CARD_DISABLED)) {
iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_CLR, iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_CLR,
CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
iwl_write_direct32(trans(priv), HBUS_TARG_MBX_C, iwl_write_direct32(priv->trans, HBUS_TARG_MBX_C,
HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED); HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
} }
if (flags & CT_CARD_DISABLED) if (flags & CT_CARD_DISABLED)
...@@ -636,7 +636,7 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv, ...@@ -636,7 +636,7 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv,
wiphy_rfkill_set_hw_state(priv->hw->wiphy, wiphy_rfkill_set_hw_state(priv->hw->wiphy,
test_bit(STATUS_RF_KILL_HW, &priv->status)); test_bit(STATUS_RF_KILL_HW, &priv->status));
else else
wake_up(&trans(priv)->wait_command_queue); wake_up(&priv->trans->wait_command_queue);
return 0; return 0;
} }
......
...@@ -179,19 +179,19 @@ static void iwl_tt_check_exit_ct_kill(unsigned long data) ...@@ -179,19 +179,19 @@ static void iwl_tt_check_exit_ct_kill(unsigned long data)
if (tt->state == IWL_TI_CT_KILL) { if (tt->state == IWL_TI_CT_KILL) {
if (priv->thermal_throttle.ct_kill_toggle) { if (priv->thermal_throttle.ct_kill_toggle) {
iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_CLR, iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_CLR,
CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
priv->thermal_throttle.ct_kill_toggle = false; priv->thermal_throttle.ct_kill_toggle = false;
} else { } else {
iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_SET, iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_SET,
CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
priv->thermal_throttle.ct_kill_toggle = true; priv->thermal_throttle.ct_kill_toggle = true;
} }
iwl_read32(trans(priv), CSR_UCODE_DRV_GP1); iwl_read32(priv->trans, CSR_UCODE_DRV_GP1);
spin_lock_irqsave(&trans(priv)->reg_lock, flags); spin_lock_irqsave(&priv->trans->reg_lock, flags);
if (likely(iwl_grab_nic_access(trans(priv)))) if (likely(iwl_grab_nic_access(priv->trans)))
iwl_release_nic_access(trans(priv)); iwl_release_nic_access(priv->trans);
spin_unlock_irqrestore(&trans(priv)->reg_lock, flags); spin_unlock_irqrestore(&priv->trans->reg_lock, flags);
/* Reschedule the ct_kill timer to occur in /* Reschedule the ct_kill timer to occur in
* CT_KILL_EXIT_DURATION seconds to ensure we get a * CT_KILL_EXIT_DURATION seconds to ensure we get a
......
...@@ -467,7 +467,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) ...@@ -467,7 +467,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
else else
txq_id = ctx->ac_to_queue[skb_get_queue_mapping(skb)]; txq_id = ctx->ac_to_queue[skb_get_queue_mapping(skb)];
if (iwl_trans_tx(trans(priv), skb, dev_cmd, txq_id)) if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id))
goto drop_unlock_sta; goto drop_unlock_sta;
if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) && if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) &&
...@@ -581,7 +581,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, ...@@ -581,7 +581,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
spin_unlock_bh(&priv->sta_lock); spin_unlock_bh(&priv->sta_lock);
if (test_bit(txq_id, priv->agg_q_alloc)) { if (test_bit(txq_id, priv->agg_q_alloc)) {
iwl_trans_tx_agg_disable(trans(priv), txq_id); iwl_trans_tx_agg_disable(priv->trans, txq_id);
iwlagn_dealloc_agg_txq(priv, txq_id); iwlagn_dealloc_agg_txq(priv, txq_id);
} }
...@@ -665,7 +665,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, ...@@ -665,7 +665,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif,
fifo = ctx->ac_to_fifo[tid_to_ac[tid]]; fifo = ctx->ac_to_fifo[tid_to_ac[tid]];
iwl_trans_tx_agg_setup(trans(priv), q, fifo, iwl_trans_tx_agg_setup(priv->trans, q, fifo,
sta_priv->sta_id, tid, sta_priv->sta_id, tid,
buf_size, ssn); buf_size, ssn);
...@@ -732,7 +732,7 @@ static void iwlagn_check_ratid_empty(struct iwl_priv *priv, int sta_id, u8 tid) ...@@ -732,7 +732,7 @@ static void iwlagn_check_ratid_empty(struct iwl_priv *priv, int sta_id, u8 tid)
IWL_DEBUG_TX_QUEUES(priv, IWL_DEBUG_TX_QUEUES(priv,
"Can continue DELBA flow ssn = next_recl =" "Can continue DELBA flow ssn = next_recl ="
" %d", tid_data->next_reclaimed); " %d", tid_data->next_reclaimed);
iwl_trans_tx_agg_disable(trans(priv), iwl_trans_tx_agg_disable(priv->trans,
tid_data->agg.txq_id); tid_data->agg.txq_id);
iwlagn_dealloc_agg_txq(priv, tid_data->agg.txq_id); iwlagn_dealloc_agg_txq(priv, tid_data->agg.txq_id);
tid_data->agg.state = IWL_AGG_OFF; tid_data->agg.state = IWL_AGG_OFF;
...@@ -1092,7 +1092,7 @@ static int iwl_reclaim(struct iwl_priv *priv, int sta_id, int tid, ...@@ -1092,7 +1092,7 @@ static int iwl_reclaim(struct iwl_priv *priv, int sta_id, int tid,
return 1; return 1;
} }
iwl_trans_reclaim(trans(priv), txq_id, ssn, skbs); iwl_trans_reclaim(priv->trans, txq_id, ssn, skbs);
return 0; return 0;
} }
......
...@@ -348,14 +348,14 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, ...@@ -348,14 +348,14 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32)); ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32));
/* Make sure device is powered up for SRAM reads */ /* Make sure device is powered up for SRAM reads */
spin_lock_irqsave(&trans(priv)->reg_lock, reg_flags); spin_lock_irqsave(&priv->trans->reg_lock, reg_flags);
if (unlikely(!iwl_grab_nic_access(trans(priv)))) { if (unlikely(!iwl_grab_nic_access(priv->trans))) {
spin_unlock_irqrestore(&trans(priv)->reg_lock, reg_flags); spin_unlock_irqrestore(&priv->trans->reg_lock, reg_flags);
return; return;
} }
/* Set starting address; reads will auto-increment */ /* Set starting address; reads will auto-increment */
iwl_write32(trans(priv), HBUS_TARG_MEM_RADDR, ptr); iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, ptr);
/* /*
* Refuse to read more than would have fit into the log from * Refuse to read more than would have fit into the log from
...@@ -371,20 +371,20 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, ...@@ -371,20 +371,20 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
* place event id # at far right for easier visual parsing. * place event id # at far right for easier visual parsing.
*/ */
for (i = 0; i < num_events; i++) { for (i = 0; i < num_events; i++) {
ev = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); ev = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
time = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); time = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
if (mode == 0) { if (mode == 0) {
trace_iwlwifi_dev_ucode_cont_event( trace_iwlwifi_dev_ucode_cont_event(
trans(priv)->dev, 0, time, ev); priv->trans->dev, 0, time, ev);
} else { } else {
data = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); data = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
trace_iwlwifi_dev_ucode_cont_event( trace_iwlwifi_dev_ucode_cont_event(
trans(priv)->dev, time, data, ev); priv->trans->dev, time, data, ev);
} }
} }
/* Allow device to power down */ /* Allow device to power down */
iwl_release_nic_access(trans(priv)); iwl_release_nic_access(priv->trans);
spin_unlock_irqrestore(&trans(priv)->reg_lock, reg_flags); spin_unlock_irqrestore(&priv->trans->reg_lock, reg_flags);
} }
static void iwl_continuous_event_trace(struct iwl_priv *priv) static void iwl_continuous_event_trace(struct iwl_priv *priv)
...@@ -403,8 +403,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv) ...@@ -403,8 +403,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
base = priv->device_pointers.log_event_table; base = priv->device_pointers.log_event_table;
if (iwlagn_hw_valid_rtc_data_addr(base)) { if (iwlagn_hw_valid_rtc_data_addr(base)) {
iwl_read_targ_mem_words(trans(priv), base, &read, sizeof(read)); iwl_read_targ_mem_words(priv->trans, base, &read, sizeof(read));
capacity = read.capacity; capacity = read.capacity;
mode = read.mode; mode = read.mode;
num_wraps = read.wrap_counter; num_wraps = read.wrap_counter;
...@@ -444,7 +443,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv) ...@@ -444,7 +443,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
else else
priv->event_log.wraps_once_count++; priv->event_log.wraps_once_count++;
trace_iwlwifi_dev_ucode_wrap_event(trans(priv)->dev, trace_iwlwifi_dev_ucode_wrap_event(priv->trans->dev,
num_wraps - priv->event_log.num_wraps, num_wraps - priv->event_log.num_wraps,
next_entry, priv->event_log.next_entry); next_entry, priv->event_log.next_entry);
...@@ -670,7 +669,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv) ...@@ -670,7 +669,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
struct iwl_ct_kill_throttling_config adv_cmd; struct iwl_ct_kill_throttling_config adv_cmd;
int ret = 0; int ret = 0;
iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_CLR, iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_CLR,
CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
priv->thermal_throttle.ct_kill_toggle = false; priv->thermal_throttle.ct_kill_toggle = false;
...@@ -949,7 +948,7 @@ void iwl_down(struct iwl_priv *priv) ...@@ -949,7 +948,7 @@ void iwl_down(struct iwl_priv *priv)
ieee80211_stop_queues(priv->hw); ieee80211_stop_queues(priv->hw);
priv->ucode_loaded = false; priv->ucode_loaded = false;
iwl_trans_stop_device(trans(priv)); iwl_trans_stop_device(priv->trans);
/* Clear out all status bits but a few that are stable across reset */ /* Clear out all status bits but a few that are stable across reset */
priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) << priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
...@@ -1325,7 +1324,7 @@ static int iwl_init_geos(struct iwl_priv *priv) ...@@ -1325,7 +1324,7 @@ static int iwl_init_geos(struct iwl_priv *priv)
priv->hw_params.sku & EEPROM_SKU_CAP_BAND_52GHZ) { priv->hw_params.sku & EEPROM_SKU_CAP_BAND_52GHZ) {
IWL_INFO(priv, "Incorrectly detected BG card as ABG. " IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
"Please send your %s to maintainer.\n", "Please send your %s to maintainer.\n",
trans(priv)->hw_id_str); priv->trans->hw_id_str);
priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
} }
...@@ -1441,32 +1440,32 @@ void iwl_set_hw_params(struct iwl_priv *priv) ...@@ -1441,32 +1440,32 @@ void iwl_set_hw_params(struct iwl_priv *priv)
void iwl_debug_config(struct iwl_priv *priv) void iwl_debug_config(struct iwl_priv *priv)
{ {
dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUG " dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEBUG "
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
"enabled\n"); "enabled\n");
#else #else
"disabled\n"); "disabled\n");
#endif #endif
dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUGFS " dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEBUGFS "
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
"enabled\n"); "enabled\n");
#else #else
"disabled\n"); "disabled\n");
#endif #endif
dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TRACING " dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEVICE_TRACING "
#ifdef CONFIG_IWLWIFI_DEVICE_TRACING #ifdef CONFIG_IWLWIFI_DEVICE_TRACING
"enabled\n"); "enabled\n");
#else #else
"disabled\n"); "disabled\n");
#endif #endif
dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE " dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE "
#ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE #ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE
"enabled\n"); "enabled\n");
#else #else
"disabled\n"); "disabled\n");
#endif #endif
dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_P2P " dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_P2P "
#ifdef CONFIG_IWLWIFI_P2P #ifdef CONFIG_IWLWIFI_P2P
"enabled\n"); "enabled\n");
#else #else
...@@ -1509,6 +1508,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1509,6 +1508,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
op_mode->ops = &iwl_dvm_ops; op_mode->ops = &iwl_dvm_ops;
priv = IWL_OP_MODE_GET_DVM(op_mode); priv = IWL_OP_MODE_GET_DVM(op_mode);
priv->shrd = trans->shrd; priv->shrd = trans->shrd;
priv->trans = trans;
priv->fw = fw; priv->fw = fw;
switch (cfg(priv)->device_family) { switch (cfg(priv)->device_family) {
...@@ -1587,11 +1587,11 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1587,11 +1587,11 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
} }
/* Configure transport layer */ /* Configure transport layer */
iwl_trans_configure(trans(priv), &trans_cfg); iwl_trans_configure(priv->trans, &trans_cfg);
/* At this point both hw and priv are allocated. */ /* At this point both hw and priv are allocated. */
SET_IEEE80211_DEV(priv->hw, trans(priv)->dev); SET_IEEE80211_DEV(priv->hw, priv->trans->dev);
/* show what debugging capabilities we have */ /* show what debugging capabilities we have */
iwl_debug_config(priv); iwl_debug_config(priv);
...@@ -1615,25 +1615,25 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1615,25 +1615,25 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
/* these spin locks will be used in apm_ops.init and EEPROM access /* these spin locks will be used in apm_ops.init and EEPROM access
* we should init now * we should init now
*/ */
spin_lock_init(&trans(priv)->reg_lock); spin_lock_init(&priv->trans->reg_lock);
spin_lock_init(&priv->statistics.lock); spin_lock_init(&priv->statistics.lock);
/*********************** /***********************
* 2. Read REV register * 2. Read REV register
***********************/ ***********************/
IWL_INFO(priv, "Detected %s, REV=0x%X\n", IWL_INFO(priv, "Detected %s, REV=0x%X\n",
cfg(priv)->name, trans(priv)->hw_rev); cfg(priv)->name, priv->trans->hw_rev);
if (iwl_trans_start_hw(trans(priv))) if (iwl_trans_start_hw(priv->trans))
goto out_free_traffic_mem; goto out_free_traffic_mem;
/* Read the EEPROM */ /* Read the EEPROM */
if (iwl_eeprom_init(priv, trans(priv)->hw_rev)) { if (iwl_eeprom_init(priv, priv->trans->hw_rev)) {
IWL_ERR(priv, "Unable to init EEPROM\n"); IWL_ERR(priv, "Unable to init EEPROM\n");
goto out_free_traffic_mem; goto out_free_traffic_mem;
} }
/* Reset chip to save power until we load uCode during "up". */ /* Reset chip to save power until we load uCode during "up". */
iwl_trans_stop_hw(trans(priv)); iwl_trans_stop_hw(priv->trans);
if (iwl_eeprom_check_version(priv)) if (iwl_eeprom_check_version(priv))
goto out_free_eeprom; goto out_free_eeprom;
...@@ -1676,7 +1676,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1676,7 +1676,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
n_q_to_ac = ARRAY_SIZE(iwlagn_bss_queue_to_ac); n_q_to_ac = ARRAY_SIZE(iwlagn_bss_queue_to_ac);
/* Configure transport layer again*/ /* Configure transport layer again*/
iwl_trans_configure(trans(priv), &trans_cfg); iwl_trans_configure(priv->trans, &trans_cfg);
} }
/******************* /*******************
...@@ -1768,7 +1768,7 @@ void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode) ...@@ -1768,7 +1768,7 @@ void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
/*This will stop the queues, move the device to low power state */ /*This will stop the queues, move the device to low power state */
priv->ucode_loaded = false; priv->ucode_loaded = false;
iwl_trans_stop_device(trans(priv)); iwl_trans_stop_device(priv->trans);
iwl_eeprom_free(priv); iwl_eeprom_free(priv);
...@@ -1860,7 +1860,7 @@ static const char *desc_lookup(u32 num) ...@@ -1860,7 +1860,7 @@ static const char *desc_lookup(u32 num)
static void iwl_dump_nic_error_log(struct iwl_priv *priv) static void iwl_dump_nic_error_log(struct iwl_priv *priv)
{ {
struct iwl_trans *trans = trans(priv); struct iwl_trans *trans = priv->trans;
u32 base; u32 base;
struct iwl_error_event_table table; struct iwl_error_event_table table;
...@@ -1950,7 +1950,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, ...@@ -1950,7 +1950,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
u32 ev, time, data; /* event log data */ u32 ev, time, data; /* event log data */
unsigned long reg_flags; unsigned long reg_flags;
struct iwl_trans *trans = trans(priv); struct iwl_trans *trans = priv->trans;
if (num_events == 0) if (num_events == 0)
return pos; return pos;
...@@ -2068,7 +2068,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, ...@@ -2068,7 +2068,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
u32 logsize; u32 logsize;
int pos = 0; int pos = 0;
size_t bufsz = 0; size_t bufsz = 0;
struct iwl_trans *trans = trans(priv); struct iwl_trans *trans = priv->trans;
base = priv->device_pointers.log_event_table; base = priv->device_pointers.log_event_table;
if (priv->cur_ucode == IWL_UCODE_INIT) { if (priv->cur_ucode == IWL_UCODE_INIT) {
...@@ -2184,7 +2184,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) ...@@ -2184,7 +2184,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
* commands by clearing the ready bit */ * commands by clearing the ready bit */
clear_bit(STATUS_READY, &priv->status); clear_bit(STATUS_READY, &priv->status);
wake_up(&trans(priv)->wait_command_queue); wake_up(&priv->trans->wait_command_queue);
if (!ondemand) { if (!ondemand) {
/* /*
......
...@@ -472,7 +472,7 @@ static inline void iwl_dvm_set_pmi(struct iwl_priv *priv, bool state) ...@@ -472,7 +472,7 @@ static inline void iwl_dvm_set_pmi(struct iwl_priv *priv, bool state)
set_bit(STATUS_POWER_PMI, &priv->status); set_bit(STATUS_POWER_PMI, &priv->status);
else else
clear_bit(STATUS_POWER_PMI, &priv->status); clear_bit(STATUS_POWER_PMI, &priv->status);
iwl_trans_set_pmi(trans(priv), state); iwl_trans_set_pmi(priv->trans, state);
} }
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
......
...@@ -259,7 +259,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, ...@@ -259,7 +259,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
sram = priv->dbgfs_sram_offset & ~0x3; sram = priv->dbgfs_sram_offset & ~0x3;
/* read the first u32 from sram */ /* read the first u32 from sram */
val = iwl_read_targ_mem(trans(priv), sram); val = iwl_read_targ_mem(priv->trans, sram);
for (; len; len--) { for (; len; len--) {
/* put the address at the start of every line */ /* put the address at the start of every line */
...@@ -278,7 +278,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, ...@@ -278,7 +278,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
if (++offset == 4) { if (++offset == 4) {
sram += 4; sram += 4;
offset = 0; offset = 0;
val = iwl_read_targ_mem(trans(priv), sram); val = iwl_read_targ_mem(priv->trans, sram);
} }
/* put in extra spaces and split lines for human readability */ /* put in extra spaces and split lines for human readability */
...@@ -2071,7 +2071,7 @@ static ssize_t iwl_dbgfs_power_save_status_read(struct file *file, ...@@ -2071,7 +2071,7 @@ static ssize_t iwl_dbgfs_power_save_status_read(struct file *file,
const size_t bufsz = sizeof(buf); const size_t bufsz = sizeof(buf);
u32 pwrsave_status; u32 pwrsave_status;
pwrsave_status = iwl_read32(trans(priv), CSR_GP_CNTRL) & pwrsave_status = iwl_read32(priv->trans, CSR_GP_CNTRL) &
CSR_GP_REG_POWER_SAVE_STATUS_MSK; CSR_GP_REG_POWER_SAVE_STATUS_MSK;
pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: "); pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: ");
...@@ -2594,7 +2594,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) ...@@ -2594,7 +2594,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
/* Calibrations disabled/enabled status*/ /* Calibrations disabled/enabled status*/
DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IRUSR); DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IRUSR);
if (iwl_trans_dbgfs_register(trans(priv), dir_debug)) if (iwl_trans_dbgfs_register(priv->trans, dir_debug))
goto err; goto err;
return 0; return 0;
......
...@@ -760,6 +760,7 @@ struct iwl_priv { ...@@ -760,6 +760,7 @@ struct iwl_priv {
/*data shared among all the driver's layers */ /*data shared among all the driver's layers */
struct iwl_shared *shrd; struct iwl_shared *shrd;
struct iwl_trans *trans;
const struct iwl_fw *fw; const struct iwl_fw *fw;
const struct iwl_lib_ops *lib; const struct iwl_lib_ops *lib;
unsigned long status; unsigned long status;
......
...@@ -189,7 +189,7 @@ static void iwl_eeprom_release_semaphore(struct iwl_trans *trans) ...@@ -189,7 +189,7 @@ static void iwl_eeprom_release_semaphore(struct iwl_trans *trans)
static int iwl_eeprom_verify_signature(struct iwl_priv *priv) static int iwl_eeprom_verify_signature(struct iwl_priv *priv)
{ {
u32 gp = iwl_read32(trans(priv), CSR_EEPROM_GP) & u32 gp = iwl_read32(priv->trans, CSR_EEPROM_GP) &
CSR_EEPROM_GP_VALID_MSK; CSR_EEPROM_GP_VALID_MSK;
int ret = 0; int ret = 0;
...@@ -719,14 +719,14 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv) ...@@ -719,14 +719,14 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv)
int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
{ {
__le16 *e; __le16 *e;
u32 gp = iwl_read32(trans(priv), CSR_EEPROM_GP); u32 gp = iwl_read32(priv->trans, CSR_EEPROM_GP);
int sz; int sz;
int ret; int ret;
u16 addr; u16 addr;
u16 validblockaddr = 0; u16 validblockaddr = 0;
u16 cache_addr = 0; u16 cache_addr = 0;
priv->nvm_device_type = iwl_get_nvm_type(trans(priv), hw_rev); priv->nvm_device_type = iwl_get_nvm_type(priv->trans, hw_rev);
if (priv->nvm_device_type == -ENOENT) if (priv->nvm_device_type == -ENOENT)
return -ENOENT; return -ENOENT;
/* allocate eeprom */ /* allocate eeprom */
...@@ -747,7 +747,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -747,7 +747,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
} }
/* Make sure driver (instead of uCode) is allowed to read EEPROM */ /* Make sure driver (instead of uCode) is allowed to read EEPROM */
ret = iwl_eeprom_acquire_semaphore(trans(priv)); ret = iwl_eeprom_acquire_semaphore(priv->trans);
if (ret < 0) { if (ret < 0) {
IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n"); IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n");
ret = -ENOENT; ret = -ENOENT;
...@@ -756,22 +756,22 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -756,22 +756,22 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) {
ret = iwl_init_otp_access(trans(priv)); ret = iwl_init_otp_access(priv->trans);
if (ret) { if (ret) {
IWL_ERR(priv, "Failed to initialize OTP access.\n"); IWL_ERR(priv, "Failed to initialize OTP access.\n");
ret = -ENOENT; ret = -ENOENT;
goto done; goto done;
} }
iwl_write32(trans(priv), CSR_EEPROM_GP, iwl_write32(priv->trans, CSR_EEPROM_GP,
iwl_read32(trans(priv), CSR_EEPROM_GP) & iwl_read32(priv->trans, CSR_EEPROM_GP) &
~CSR_EEPROM_GP_IF_OWNER_MSK); ~CSR_EEPROM_GP_IF_OWNER_MSK);
iwl_set_bit(trans(priv), CSR_OTP_GP_REG, iwl_set_bit(priv->trans, CSR_OTP_GP_REG,
CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK | CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK |
CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK);
/* traversing the linked list if no shadow ram supported */ /* traversing the linked list if no shadow ram supported */
if (!cfg(priv)->base_params->shadow_ram_support) { if (!cfg(priv)->base_params->shadow_ram_support) {
if (iwl_find_otp_image(trans(priv), &validblockaddr)) { if (iwl_find_otp_image(priv->trans, &validblockaddr)) {
ret = -ENOENT; ret = -ENOENT;
goto done; goto done;
} }
...@@ -780,7 +780,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -780,7 +780,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
addr += sizeof(u16)) { addr += sizeof(u16)) {
__le16 eeprom_data; __le16 eeprom_data;
ret = iwl_read_otp_word(trans(priv), addr, ret = iwl_read_otp_word(priv->trans, addr,
&eeprom_data); &eeprom_data);
if (ret) if (ret)
goto done; goto done;
...@@ -792,10 +792,10 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -792,10 +792,10 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
for (addr = 0; addr < sz; addr += sizeof(u16)) { for (addr = 0; addr < sz; addr += sizeof(u16)) {
u32 r; u32 r;
iwl_write32(trans(priv), CSR_EEPROM_REG, iwl_write32(priv->trans, CSR_EEPROM_REG,
CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); CSR_EEPROM_REG_MSK_ADDR & (addr << 1));
ret = iwl_poll_bit(trans(priv), CSR_EEPROM_REG, ret = iwl_poll_bit(priv->trans, CSR_EEPROM_REG,
CSR_EEPROM_REG_READ_VALID_MSK, CSR_EEPROM_REG_READ_VALID_MSK,
CSR_EEPROM_REG_READ_VALID_MSK, CSR_EEPROM_REG_READ_VALID_MSK,
IWL_EEPROM_ACCESS_TIMEOUT); IWL_EEPROM_ACCESS_TIMEOUT);
...@@ -804,7 +804,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -804,7 +804,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
"Time out reading EEPROM[%d]\n", addr); "Time out reading EEPROM[%d]\n", addr);
goto done; goto done;
} }
r = iwl_read32(trans(priv), CSR_EEPROM_REG); r = iwl_read32(priv->trans, CSR_EEPROM_REG);
e[addr / 2] = cpu_to_le16(r >> 16); e[addr / 2] = cpu_to_le16(r >> 16);
} }
} }
...@@ -816,7 +816,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -816,7 +816,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
ret = 0; ret = 0;
done: done:
iwl_eeprom_release_semaphore(trans(priv)); iwl_eeprom_release_semaphore(priv->trans);
err: err:
if (ret) if (ret)
...@@ -1132,7 +1132,7 @@ void iwl_rf_config(struct iwl_priv *priv) ...@@ -1132,7 +1132,7 @@ void iwl_rf_config(struct iwl_priv *priv)
/* write radio config values to register */ /* write radio config values to register */
if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) { if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) {
iwl_set_bit(trans(priv), CSR_HW_IF_CONFIG_REG, iwl_set_bit(priv->trans, CSR_HW_IF_CONFIG_REG,
EEPROM_RF_CFG_TYPE_MSK(radio_cfg) | EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
EEPROM_RF_CFG_STEP_MSK(radio_cfg) | EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
EEPROM_RF_CFG_DASH_MSK(radio_cfg)); EEPROM_RF_CFG_DASH_MSK(radio_cfg));
...@@ -1144,7 +1144,7 @@ void iwl_rf_config(struct iwl_priv *priv) ...@@ -1144,7 +1144,7 @@ void iwl_rf_config(struct iwl_priv *priv)
WARN_ON(1); WARN_ON(1);
/* set CSR_HW_CONFIG_REG for uCode use */ /* set CSR_HW_CONFIG_REG for uCode use */
iwl_set_bit(trans(priv), CSR_HW_IF_CONFIG_REG, iwl_set_bit(priv->trans, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
CSR_HW_IF_CONFIG_REG_BIT_MAC_SI); CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
} }
...@@ -71,7 +71,7 @@ static const struct ieee80211_tpt_blink iwl_blink[] = { ...@@ -71,7 +71,7 @@ static const struct ieee80211_tpt_blink iwl_blink[] = {
/* Set led register off */ /* Set led register off */
void iwlagn_led_enable(struct iwl_priv *priv) void iwlagn_led_enable(struct iwl_priv *priv)
{ {
iwl_write32(trans(priv), CSR_LED_REG, CSR_LED_REG_TRUN_ON); iwl_write32(priv->trans, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
} }
/* /*
...@@ -107,9 +107,9 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd) ...@@ -107,9 +107,9 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd)
}; };
u32 reg; u32 reg;
reg = iwl_read32(trans(priv), CSR_LED_REG); reg = iwl_read32(priv->trans, CSR_LED_REG);
if (reg != (reg & CSR_LED_BSM_CTRL_MSK)) if (reg != (reg & CSR_LED_BSM_CTRL_MSK))
iwl_write32(trans(priv), CSR_LED_REG, iwl_write32(priv->trans, CSR_LED_REG,
reg & CSR_LED_BSM_CTRL_MSK); reg & CSR_LED_BSM_CTRL_MSK);
return iwl_dvm_send_cmd(priv, &cmd); return iwl_dvm_send_cmd(priv, &cmd);
...@@ -207,7 +207,7 @@ void iwl_leds_init(struct iwl_priv *priv) ...@@ -207,7 +207,7 @@ void iwl_leds_init(struct iwl_priv *priv)
break; break;
} }
ret = led_classdev_register(trans(priv)->dev, &priv->led); ret = led_classdev_register(priv->trans->dev, &priv->led);
if (ret) { if (ret) {
kfree(priv->led.name); kfree(priv->led.name);
return; return;
......
...@@ -198,8 +198,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, ...@@ -198,8 +198,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
WIPHY_FLAG_IBSS_RSN; WIPHY_FLAG_IBSS_RSN;
if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len &&
trans(priv)->ops->wowlan_suspend && priv->trans->ops->wowlan_suspend &&
device_can_wakeup(trans(priv)->dev)) { device_can_wakeup(priv->trans->dev)) {
hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
WIPHY_WOWLAN_DISCONNECT | WIPHY_WOWLAN_DISCONNECT |
WIPHY_WOWLAN_EAP_IDENTITY_REQ | WIPHY_WOWLAN_EAP_IDENTITY_REQ |
...@@ -237,7 +237,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, ...@@ -237,7 +237,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
&priv->bands[IEEE80211_BAND_5GHZ]; &priv->bands[IEEE80211_BAND_5GHZ];
hw->wiphy->hw_version = trans(priv)->hw_id; hw->wiphy->hw_version = priv->trans->hw_id;
iwl_leds_init(priv); iwl_leds_init(priv);
...@@ -356,7 +356,7 @@ void iwlagn_mac_stop(struct ieee80211_hw *hw) ...@@ -356,7 +356,7 @@ void iwlagn_mac_stop(struct ieee80211_hw *hw)
* even if interface is down, trans->down will leave the RF * even if interface is down, trans->down will leave the RF
* kill interrupt enabled * kill interrupt enabled
*/ */
iwl_trans_stop_hw(trans(priv)); iwl_trans_stop_hw(priv->trans);
IWL_DEBUG_MAC80211(priv, "leave\n"); IWL_DEBUG_MAC80211(priv, "leave\n");
} }
...@@ -412,9 +412,9 @@ int iwlagn_mac_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) ...@@ -412,9 +412,9 @@ int iwlagn_mac_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
if (ret) if (ret)
goto error; goto error;
device_set_wakeup_enable(trans(priv)->dev, true); device_set_wakeup_enable(priv->trans->dev, true);
iwl_trans_wowlan_suspend(trans(priv)); iwl_trans_wowlan_suspend(priv->trans);
goto out; goto out;
...@@ -441,19 +441,19 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -441,19 +441,19 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
IWL_DEBUG_MAC80211(priv, "enter\n"); IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_CLR, iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_CLR,
CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE); CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE);
base = priv->device_pointers.error_event_table; base = priv->device_pointers.error_event_table;
if (iwlagn_hw_valid_rtc_data_addr(base)) { if (iwlagn_hw_valid_rtc_data_addr(base)) {
spin_lock_irqsave(&trans(priv)->reg_lock, flags); spin_lock_irqsave(&priv->trans->reg_lock, flags);
ret = iwl_grab_nic_access_silent(trans(priv)); ret = iwl_grab_nic_access_silent(priv->trans);
if (likely(ret == 0)) { if (likely(ret == 0)) {
iwl_write32(trans(priv), HBUS_TARG_MEM_RADDR, base); iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, base);
status = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); status = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
iwl_release_nic_access(trans(priv)); iwl_release_nic_access(priv->trans);
} }
spin_unlock_irqrestore(&trans(priv)->reg_lock, flags); spin_unlock_irqrestore(&priv->trans->reg_lock, flags);
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
if (ret == 0) { if (ret == 0) {
...@@ -468,7 +468,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -468,7 +468,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
if (priv->wowlan_sram) if (priv->wowlan_sram)
_iwl_read_targ_mem_words( _iwl_read_targ_mem_words(
trans(priv), 0x800000, priv->trans, 0x800000,
priv->wowlan_sram, priv->wowlan_sram,
img->sec[IWL_UCODE_SECTION_DATA].len / 4); img->sec[IWL_UCODE_SECTION_DATA].len / 4);
} }
...@@ -480,7 +480,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -480,7 +480,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
priv->wowlan = false; priv->wowlan = false;
device_set_wakeup_enable(trans(priv)->dev, false); device_set_wakeup_enable(priv->trans->dev, false);
iwlagn_prepare_restart(priv); iwlagn_prepare_restart(priv);
...@@ -654,7 +654,7 @@ int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, ...@@ -654,7 +654,7 @@ int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
ret = iwl_sta_rx_agg_stop(priv, sta, tid); ret = iwl_sta_rx_agg_stop(priv, sta, tid);
break; break;
case IEEE80211_AMPDU_TX_START: case IEEE80211_AMPDU_TX_START:
if (!trans(priv)->ops->tx_agg_setup) if (!priv->trans->ops->tx_agg_setup)
break; break;
if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
break; break;
...@@ -1006,7 +1006,7 @@ void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop) ...@@ -1006,7 +1006,7 @@ void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
} }
} }
IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n"); IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n");
iwl_trans_wait_tx_queue_empty(trans(priv)); iwl_trans_wait_tx_queue_empty(priv->trans);
done: done:
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n"); IWL_DEBUG_MAC80211(priv, "leave\n");
......
...@@ -378,7 +378,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) ...@@ -378,7 +378,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
/* initialize to default */ /* initialize to default */
void iwl_power_initialize(struct iwl_priv *priv) void iwl_power_initialize(struct iwl_priv *priv)
{ {
priv->power_data.bus_pm = trans(priv)->pm_support; priv->power_data.bus_pm = priv->trans->pm_support;
priv->power_data.debug_sleep_level_override = -1; priv->power_data.debug_sleep_level_override = -1;
......
...@@ -218,7 +218,7 @@ static void iwl_trace_cleanup(struct iwl_priv *priv) ...@@ -218,7 +218,7 @@ static void iwl_trace_cleanup(struct iwl_priv *priv)
if (priv->testmode_trace.trace_enabled) { if (priv->testmode_trace.trace_enabled) {
if (priv->testmode_trace.cpu_addr && if (priv->testmode_trace.cpu_addr &&
priv->testmode_trace.dma_addr) priv->testmode_trace.dma_addr)
dma_free_coherent(trans(priv)->dev, dma_free_coherent(priv->trans->dev,
priv->testmode_trace.total_size, priv->testmode_trace.total_size,
priv->testmode_trace.cpu_addr, priv->testmode_trace.cpu_addr,
priv->testmode_trace.dma_addr); priv->testmode_trace.dma_addr);
...@@ -371,7 +371,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -371,7 +371,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb)
switch (cmd) { switch (cmd) {
case IWL_TM_CMD_APP2DEV_DIRECT_REG_READ32: case IWL_TM_CMD_APP2DEV_DIRECT_REG_READ32:
val32 = iwl_read_direct32(trans(priv), ofs); val32 = iwl_read_direct32(priv->trans, ofs);
IWL_INFO(priv, "32bit value to read 0x%x\n", val32); IWL_INFO(priv, "32bit value to read 0x%x\n", val32);
skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20);
...@@ -391,7 +391,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -391,7 +391,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb)
} else { } else {
val32 = nla_get_u32(tb[IWL_TM_ATTR_REG_VALUE32]); val32 = nla_get_u32(tb[IWL_TM_ATTR_REG_VALUE32]);
IWL_INFO(priv, "32bit value to write 0x%x\n", val32); IWL_INFO(priv, "32bit value to write 0x%x\n", val32);
iwl_write_direct32(trans(priv), ofs, val32); iwl_write_direct32(priv->trans, ofs, val32);
} }
break; break;
case IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8: case IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8:
...@@ -401,7 +401,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -401,7 +401,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb)
} else { } else {
val8 = nla_get_u8(tb[IWL_TM_ATTR_REG_VALUE8]); val8 = nla_get_u8(tb[IWL_TM_ATTR_REG_VALUE8]);
IWL_INFO(priv, "8bit value to write 0x%x\n", val8); IWL_INFO(priv, "8bit value to write 0x%x\n", val8);
iwl_write8(trans(priv), ofs, val8); iwl_write8(priv->trans, ofs, val8);
} }
break; break;
default: default:
...@@ -464,7 +464,7 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv) ...@@ -464,7 +464,7 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv)
static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
{ {
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
struct iwl_trans *trans = trans(priv); struct iwl_trans *trans = priv->trans;
struct sk_buff *skb; struct sk_buff *skb;
unsigned char *rsp_data_ptr = NULL; unsigned char *rsp_data_ptr = NULL;
int status = 0, rsp_data_len = 0; int status = 0, rsp_data_len = 0;
...@@ -577,7 +577,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -577,7 +577,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
break; break;
case IWL_TM_CMD_APP2DEV_GET_DEVICE_ID: case IWL_TM_CMD_APP2DEV_GET_DEVICE_ID:
devid = trans(priv)->hw_id; devid = priv->trans->hw_id;
IWL_INFO(priv, "hw version: 0x%x\n", devid); IWL_INFO(priv, "hw version: 0x%x\n", devid);
skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20);
...@@ -642,7 +642,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -642,7 +642,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb)
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
struct sk_buff *skb; struct sk_buff *skb;
int status = 0; int status = 0;
struct device *dev = trans(priv)->dev; struct device *dev = priv->trans->dev;
switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
case IWL_TM_CMD_APP2DEV_BEGIN_TRACE: case IWL_TM_CMD_APP2DEV_BEGIN_TRACE:
...@@ -782,7 +782,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -782,7 +782,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb)
static int iwl_testmode_indirect_read(struct iwl_priv *priv, u32 addr, u32 size) static int iwl_testmode_indirect_read(struct iwl_priv *priv, u32 addr, u32 size)
{ {
struct iwl_trans *trans = trans(priv); struct iwl_trans *trans = priv->trans;
unsigned long flags; unsigned long flags;
int i; int i;
...@@ -822,7 +822,7 @@ static int iwl_testmode_indirect_read(struct iwl_priv *priv, u32 addr, u32 size) ...@@ -822,7 +822,7 @@ static int iwl_testmode_indirect_read(struct iwl_priv *priv, u32 addr, u32 size)
static int iwl_testmode_indirect_write(struct iwl_priv *priv, u32 addr, static int iwl_testmode_indirect_write(struct iwl_priv *priv, u32 addr,
u32 size, unsigned char *buf) u32 size, unsigned char *buf)
{ {
struct iwl_trans *trans = trans(priv); struct iwl_trans *trans = priv->trans;
u32 val, i; u32 val, i;
unsigned long flags; unsigned long flags;
......
...@@ -244,7 +244,7 @@ static int iwl_alive_notify(struct iwl_priv *priv) ...@@ -244,7 +244,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
{ {
int ret; int ret;
iwl_trans_fw_alive(trans(priv)); iwl_trans_fw_alive(priv->trans);
priv->passive_no_rx = false; priv->passive_no_rx = false;
priv->transport_queue_stop = 0; priv->transport_queue_stop = 0;
...@@ -282,9 +282,9 @@ static int iwl_verify_sec_sparse(struct iwl_priv *priv, ...@@ -282,9 +282,9 @@ static int iwl_verify_sec_sparse(struct iwl_priv *priv,
/* read data comes through single port, auto-incr addr */ /* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log /* NOTE: Use the debugless read so we don't flood kernel log
* if IWL_DL_IO is set */ * if IWL_DL_IO is set */
iwl_write_direct32(trans(priv), HBUS_TARG_MEM_RADDR, iwl_write_direct32(priv->trans, HBUS_TARG_MEM_RADDR,
i + fw_desc->offset); i + fw_desc->offset);
val = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); val = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) if (val != le32_to_cpu(*image))
return -EIO; return -EIO;
} }
...@@ -303,14 +303,14 @@ static void iwl_print_mismatch_sec(struct iwl_priv *priv, ...@@ -303,14 +303,14 @@ static void iwl_print_mismatch_sec(struct iwl_priv *priv,
IWL_DEBUG_FW(priv, "ucode inst image size is %u\n", len); IWL_DEBUG_FW(priv, "ucode inst image size is %u\n", len);
iwl_write_direct32(trans(priv), HBUS_TARG_MEM_RADDR, iwl_write_direct32(priv->trans, HBUS_TARG_MEM_RADDR,
fw_desc->offset); fw_desc->offset);
for (offs = 0; for (offs = 0;
offs < len && errors < 20; offs < len && errors < 20;
offs += sizeof(u32), image++) { offs += sizeof(u32), image++) {
/* read data comes through single port, auto-incr addr */ /* read data comes through single port, auto-incr addr */
val = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); val = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) { if (val != le32_to_cpu(*image)) {
IWL_ERR(priv, "uCode INST section at " IWL_ERR(priv, "uCode INST section at "
"offset 0x%x, is 0x%x, s/b 0x%x\n", "offset 0x%x, is 0x%x, s/b 0x%x\n",
...@@ -402,7 +402,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, ...@@ -402,7 +402,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
alive_cmd, ARRAY_SIZE(alive_cmd), alive_cmd, ARRAY_SIZE(alive_cmd),
iwl_alive_fn, &alive_data); iwl_alive_fn, &alive_data);
ret = iwl_trans_start_fw(trans(priv), fw); ret = iwl_trans_start_fw(priv->trans, fw);
if (ret) { if (ret) {
priv->cur_ucode = old_type; priv->cur_ucode = old_type;
iwl_remove_notification(&priv->notif_wait, &alive_wait); iwl_remove_notification(&priv->notif_wait, &alive_wait);
...@@ -526,7 +526,7 @@ int iwl_run_init_ucode(struct iwl_priv *priv) ...@@ -526,7 +526,7 @@ int iwl_run_init_ucode(struct iwl_priv *priv)
iwl_remove_notification(&priv->notif_wait, &calib_wait); iwl_remove_notification(&priv->notif_wait, &calib_wait);
out: out:
/* Whatever happened, stop the device */ /* Whatever happened, stop the device */
iwl_trans_stop_device(trans(priv)); iwl_trans_stop_device(priv->trans);
priv->ucode_loaded = false; priv->ucode_loaded = false;
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment