Commit 518099a8 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

iwl3945: Use iwl-hcmd host command routines

With the previously added tfd related ops, we can now use the iwl-tx.c host
command enqueue routine. Since the 3945 host command specific
routines are identical to the agn ones, we can just remove them from the 3945
code.
Signed-off-by: default avatarSamuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7aaa1d79
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#include "iwl-commands.h" #include "iwl-commands.h"
#include "iwl-3945.h" #include "iwl-3945.h"
#include "iwl-core.h"
#include "iwl-dev.h"
static const struct { static const struct {
...@@ -91,7 +93,7 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, ...@@ -91,7 +93,7 @@ static int iwl_send_led_cmd(struct iwl_priv *priv,
.meta.u.callback = iwl3945_led_cmd_callback, .meta.u.callback = iwl3945_led_cmd_callback,
}; };
return iwl3945_send_cmd(priv, &cmd); return iwl_send_cmd(priv, &cmd);
} }
......
...@@ -1766,8 +1766,9 @@ int iwl3945_hw_reg_send_txpower(struct iwl_priv *priv) ...@@ -1766,8 +1766,9 @@ int iwl3945_hw_reg_send_txpower(struct iwl_priv *priv)
txpower.power[i].rate); txpower.power[i].rate);
} }
return iwl3945_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD, return iwl_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD,
sizeof(struct iwl3945_txpowertable_cmd), &txpower); sizeof(struct iwl3945_txpowertable_cmd),
&txpower);
} }
...@@ -2463,14 +2464,14 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv) ...@@ -2463,14 +2464,14 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
/* Update the rate scaling for control frame Tx */ /* Update the rate scaling for control frame Tx */
rate_cmd.table_id = 0; rate_cmd.table_id = 0;
rc = iwl3945_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd), rc = iwl_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
&rate_cmd); &rate_cmd);
if (rc) if (rc)
return rc; return rc;
/* Update the rate scaling for data frame Tx */ /* Update the rate scaling for data frame Tx */
rate_cmd.table_id = 1; rate_cmd.table_id = 1;
return iwl3945_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd), return iwl_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
&rate_cmd); &rate_cmd);
} }
......
...@@ -1004,7 +1004,8 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) ...@@ -1004,7 +1004,8 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
phys_addr += offsetof(struct iwl_cmd, hdr); phys_addr += offsetof(struct iwl_cmd, hdr);
priv->cfg->ops->lib->txq_attach_buf_to_tfd(priv, txq, priv->cfg->ops->lib->txq_attach_buf_to_tfd(priv, txq,
phys_addr, fix_size, 1, 0); phys_addr, fix_size, 1,
U32_PAD(cmd->len));
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
switch (out_cmd->hdr.cmd) { switch (out_cmd->hdr.cmd) {
...@@ -1028,8 +1029,9 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) ...@@ -1028,8 +1029,9 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
#endif #endif
txq->need_update = 1; txq->need_update = 1;
/* Set up entry in queue's byte count circular buffer */ if (priv->cfg->ops->lib->txq_update_byte_cnt_tbl)
priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 0); /* Set up entry in queue's byte count circular buffer */
priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 0);
/* Increment and update queue's write index */ /* Increment and update queue's write index */
q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
......
This diff is collapsed.
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