memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN);
- ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, cmd);
+ ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, &cmd);
if (ret)
goto out;
cmd_config.gpio = gpio;
cmd_config.gap = gap;
- ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, cmd_config);
+ ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, &cmd_config);
if (ret) {
lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret);
return ret;
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_GET_TX_RATE);
- ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd);
+ ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd);
if (ret)
goto out;
lbs_deb_cmd("DATA_RATE: setting auto\n");
}
- ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd);
+ ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd);
if (ret)
goto out;
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET);
- ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd);
+ ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd);
if (ret)
goto out;
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET);
cmd.channel = cpu_to_le16(channel);
- ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd);
+ ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd);
if (ret)
goto out;
cmd->action = cpu_to_le16(cmd_action);
- ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, (*cmd));
+ ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, cmd);
lbs_deb_leave(LBS_DEB_CMD);
return ret;
lbs_deb_cmd("mesh config channel %d SSID %s\n",
priv->curbssparams.channel,
escape_essid(priv->mesh_ssid, priv->mesh_ssid_len));
- return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, cmd);
+ return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, &cmd);
}
static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
lbs_deb_leave(LBS_DEB_CMD);
return 0;
}
+EXPORT_SYMBOL_GPL(lbs_cmd_copyback);
/**
* @brief Simple way to call firmware functions
#include "hostcmd.h"
#include "dev.h"
-#define lbs_cmd(priv, cmdnr, cmd, callback, callback_arg) \
- __lbs_cmd(priv, cmdnr, &(cmd).hdr, sizeof(cmd), \
- callback, callback_arg)
+#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) \
+ __lbs_cmd(priv, cmdnr, &(cmd)->hdr, sizeof(*(cmd)), cb, cb_arg)
-#define lbs_cmd_with_response(priv, cmdnr, cmd) \
- __lbs_cmd(priv, cmdnr, &(cmd).hdr, sizeof(cmd), \
- lbs_cmd_copyback, (unsigned long) &cmd)
+#define lbs_cmd_with_response(priv, cmdnr, cmd) \
+ lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd))
int __lbs_cmd(struct lbs_private *priv, uint16_t command,
struct cmd_header *in_cmd, int in_cmd_size,