Skip to content

Commit

Permalink
iwlagn: transport layer receives struct iwl_trans*
Browse files Browse the repository at this point in the history
It still holds a pointer to iwl_priv. But hopefully this will disappear at some point.
Also add the multiple inclusion protection to iwl-trans.h that was forgotten.
Move iwl-trans structures to iwl-trans.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
  • Loading branch information
Emmanuel Grumbach authored and Wey-Yi Guy committed Jul 21, 2011
1 parent 0286cee commit 41c5054
Show file tree
Hide file tree
Showing 18 changed files with 168 additions and 154 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
return -EFAULT;
}

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

static struct iwl_lib_ops iwl5000_lib = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
return -EFAULT;
}

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

static struct iwl_lib_ops iwl6000_lib = {
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/iwlwifi/iwl-agn-calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &hcmd);
ret = trans_send_cmd(&priv->trans, &hcmd);
if (ret) {
IWL_ERR(priv, "Error %d iteration %d\n",
ret, i);
Expand Down Expand Up @@ -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, &cmd_out);
return trans_send_cmd(&priv->trans, &cmd_out);
}

/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */
Expand Down Expand Up @@ -548,7 +548,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, &cmd_out);
return trans_send_cmd(&priv->trans, &cmd_out);
}

void iwl_init_sensitivity(struct iwl_priv *priv)
Expand Down Expand Up @@ -892,7 +892,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
priv->_agn.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, REPLY_PHY_CALIBRATION_CMD,
trans_send_cmd_pdu(&priv->trans, REPLY_PHY_CALIBRATION_CMD,
CMD_ASYNC, sizeof(cmd), &cmd);

data->radio_write = 1;
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/iwlwifi/iwl-agn-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,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, tx_ant_cfg_cmd, CMD_SYNC,
return trans_send_cmd_pdu(&priv->trans, tx_ant_cfg_cmd, CMD_SYNC,
sizeof(tx_power_cmd), &tx_power_cmd);
}

Expand Down Expand Up @@ -1061,7 +1061,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
if (ret)
return ret;

ret = trans_send_cmd(priv, &cmd);
ret = trans_send_cmd(&priv->trans, &cmd);
if (ret) {
clear_bit(STATUS_SCAN_HW, &priv->status);
iwlagn_set_pan_params(priv);
Expand Down Expand Up @@ -1167,7 +1167,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, &cmd);
return trans_send_cmd(&priv->trans, &cmd);
}

void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
Expand Down Expand Up @@ -1361,12 +1361,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, REPLY_BT_CONFIG,
ret = trans_send_cmd_pdu(&priv->trans, 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, REPLY_BT_CONFIG,
ret = trans_send_cmd_pdu(&priv->trans, REPLY_BT_CONFIG,
CMD_SYNC, sizeof(bt_cmd_6000), &bt_cmd_6000);
}
if (ret)
Expand Down
16 changes: 8 additions & 8 deletions drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,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, ctx->rxon_cmd,
ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd,
CMD_SYNC, sizeof(*send), send);

send->filter_flags = old_filter;
Expand All @@ -66,7 +66,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, ctx->rxon_cmd,
ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd,
CMD_SYNC, sizeof(*send), send);

send->filter_flags = old_filter;
Expand All @@ -92,7 +92,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, ctx->rxon_cmd, CMD_SYNC,
ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC,
sizeof(*send), send);

send->filter_flags = old_filter;
Expand Down Expand Up @@ -121,7 +121,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, ctx->qos_cmd, CMD_SYNC,
ret = trans_send_cmd_pdu(&priv->trans, ctx->qos_cmd, CMD_SYNC,
sizeof(struct iwl_qosparam_cmd),
&ctx->qos_data.def_qos_parm);
if (ret)
Expand Down Expand Up @@ -180,7 +180,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, ctx->rxon_assoc_cmd,
ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_assoc_cmd,
CMD_ASYNC, sizeof(rxon_assoc), &rxon_assoc);
return ret;
}
Expand Down Expand Up @@ -266,7 +266,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, ctx->rxon_cmd, CMD_SYNC,
ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC,
sizeof(struct iwl_rxon_cmd), &ctx->staging);
if (ret) {
IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
Expand Down Expand Up @@ -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, REPLY_WIPAN_PARAMS, CMD_SYNC,
ret = trans_send_cmd_pdu(&priv->trans, REPLY_WIPAN_PARAMS, CMD_SYNC,
sizeof(cmd), &cmd);
if (ret)
IWL_ERR(priv, "Error setting PAN parameters (%d)\n", ret);
Expand Down Expand Up @@ -788,7 +788,7 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
memset(&cmd, 0, sizeof(cmd));
iwl_set_calib_hdr(&cmd.hdr,
priv->_agn.phy_calib_chain_noise_reset_cmd);
ret = trans_send_cmd_pdu(priv,
ret = trans_send_cmd_pdu(&priv->trans,
REPLY_PHY_CALIBRATION_CMD,
CMD_SYNC, sizeof(cmd), &cmd);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv,
cmd.len[0] = cmd_size;

if (not_empty || send_if_empty)
return trans_send_cmd(priv, &cmd);
return trans_send_cmd(&priv->trans, &cmd);
else
return 0;
}
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/wireless/iwlwifi/iwl-agn-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
}
}

tx_cmd = trans_get_tx_cmd(priv, txq_id);
tx_cmd = trans_get_tx_cmd(&priv->trans, txq_id);
if (unlikely(!tx_cmd))
goto drop_unlock_sta;

Expand All @@ -455,7 +455,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)

iwl_update_stats(priv, true, fc, len);

if (trans_tx(priv, skb, tx_cmd, txq_id, fc, is_agg, ctx))
if (trans_tx(&priv->trans, skb, tx_cmd, txq_id, fc, is_agg, ctx))
goto drop_unlock_sta;

if (ieee80211_is_data_qos(fc)) {
Expand Down Expand Up @@ -633,7 +633,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
* to deactivate the uCode queue, just return "success" to allow
* mac80211 to clean up it own data.
*/
trans_txq_agg_disable(priv, txq_id, ssn, tx_fifo_id);
trans_txq_agg_disable(&priv->trans, txq_id, ssn, tx_fifo_id);
spin_unlock_irqrestore(&priv->lock, flags);

ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
Expand Down Expand Up @@ -662,7 +662,8 @@ int iwlagn_txq_check_empty(struct iwl_priv *priv,
u16 ssn = SEQ_TO_SN(tid_data->seq_number);
int tx_fifo = get_fifo_from_tid(ctx, tid);
IWL_DEBUG_HT(priv, "HW queue empty: continue DELBA flow\n");
trans_txq_agg_disable(priv, txq_id, ssn, tx_fifo);
trans_txq_agg_disable(&priv->trans, txq_id,
ssn, tx_fifo);
tid_data->agg.state = IWL_AGG_OFF;
ieee80211_stop_tx_ba_cb_irqsafe(ctx->vif, addr, tid);
}
Expand Down
16 changes: 8 additions & 8 deletions drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static int iwlagn_send_calib_cfg(struct iwl_priv *priv)
calib_cfg_cmd.ucd_calib_cfg.flags =
IWL_CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_MSK;

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

void iwlagn_rx_calib_result(struct iwl_priv *priv,
Expand Down Expand Up @@ -291,7 +291,7 @@ static int iwlagn_send_wimax_coex(struct iwl_priv *priv)
/* coexistence is disabled */
memset(&coex_cmd, 0, sizeof(coex_cmd));
}
return trans_send_cmd_pdu(priv,
return trans_send_cmd_pdu(&priv->trans,
COEX_PRIORITY_TABLE_CMD, CMD_SYNC,
sizeof(coex_cmd), &coex_cmd);
}
Expand Down Expand Up @@ -324,7 +324,7 @@ void iwlagn_send_prio_tbl(struct iwl_priv *priv)

memcpy(prio_tbl_cmd.prio_tbl, iwlagn_bt_prio_tbl,
sizeof(iwlagn_bt_prio_tbl));
if (trans_send_cmd_pdu(priv,
if (trans_send_cmd_pdu(&priv->trans,
REPLY_BT_COEX_PRIO_TABLE, CMD_SYNC,
sizeof(prio_tbl_cmd), &prio_tbl_cmd))
IWL_ERR(priv, "failed to send BT prio tbl command\n");
Expand All @@ -337,7 +337,7 @@ int iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type)

env_cmd.action = action;
env_cmd.type = type;
ret = trans_send_cmd_pdu(priv,
ret = trans_send_cmd_pdu(&priv->trans,
REPLY_BT_COEX_PROT_ENV, CMD_SYNC,
sizeof(env_cmd), &env_cmd);
if (ret)
Expand All @@ -350,7 +350,7 @@ static int iwlagn_alive_notify(struct iwl_priv *priv)
{
int ret;

trans_tx_start(priv);
trans_tx_start(&priv->trans);

ret = iwlagn_send_wimax_coex(priv);
if (ret)
Expand Down Expand Up @@ -478,7 +478,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
int ret;
enum iwlagn_ucode_type old_type;

ret = trans_start_device(priv);
ret = trans_start_device(&priv->trans);
if (ret)
return ret;

Expand All @@ -495,7 +495,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
return ret;
}

trans_kick_nic(priv);
trans_kick_nic(&priv->trans);

/*
* Some things may run in the background now, but we
Expand Down Expand Up @@ -573,6 +573,6 @@ int iwlagn_run_init_ucode(struct iwl_priv *priv)
iwlagn_remove_notification(priv, &calib_wait);
out:
/* Whatever happened, stop the device */
trans_stop_device(priv);
trans_stop_device(&priv->trans);
return ret;
}
Loading

0 comments on commit 41c5054

Please sign in to comment.