Skip to content

Commit

Permalink
iwlwifi: send calibration results as HUGE commands
Browse files Browse the repository at this point in the history
This patch saves memory by reducing the size of the entry in the txq. It
was 640 because of the calibration commands. Calibration commands are now
sent as HUGE commands (using the extra 1024 bytes at the end of the command
txq), hence, there is no need for 640 in every entry any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Emmanuel Grumbach authored and John W. Linville committed Jun 3, 2008
1 parent 6724962 commit d2f18bf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
45 changes: 27 additions & 18 deletions drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,28 +428,37 @@ static int iwl5000_send_calib_results(struct iwl_priv *priv)
{
int ret = 0;

if (priv->calib_results.lo_res)
ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
priv->calib_results.lo_res_len,
priv->calib_results.lo_res);
if (ret)
goto err;
struct iwl_host_cmd hcmd = {
.id = REPLY_PHY_CALIBRATION_CMD,
.meta.flags = CMD_SIZE_HUGE,
};

if (priv->calib_results.lo_res) {
hcmd.len = priv->calib_results.lo_res_len;
hcmd.data = priv->calib_results.lo_res;
ret = iwl_send_cmd_sync(priv, &hcmd);

if (priv->calib_results.tx_iq_res)
ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
priv->calib_results.tx_iq_res_len,
priv->calib_results.tx_iq_res);
if (ret)
goto err;
}

if (ret)
goto err;
if (priv->calib_results.tx_iq_res) {
hcmd.len = priv->calib_results.tx_iq_res_len;
hcmd.data = priv->calib_results.tx_iq_res;
ret = iwl_send_cmd_sync(priv, &hcmd);

if (priv->calib_results.tx_iq_perd_res)
ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
priv->calib_results.tx_iq_perd_res_len,
priv->calib_results.tx_iq_perd_res);
if (ret)
goto err;
if (ret)
goto err;
}

if (priv->calib_results.tx_iq_perd_res) {
hcmd.len = priv->calib_results.tx_iq_perd_res_len;
hcmd.data = priv->calib_results.tx_iq_perd_res;
ret = iwl_send_cmd_sync(priv, &hcmd);

if (ret)
goto err;
}

return 0;
err:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ struct iwl_cmd_meta {

} __attribute__ ((packed));

#define IWL_CMD_MAX_PAYLOAD 640
#define IWL_CMD_MAX_PAYLOAD 320

/**
* struct iwl_cmd
Expand Down

0 comments on commit d2f18bf

Please sign in to comment.