struct cmd_ds_host_sleep cmd_config;
int ret;
+ cmd_config.hdr.size = cpu_to_le16(sizeof(cmd_config));
cmd_config.criteria = cpu_to_le32(criteria);
cmd_config.gpio = priv->wol_gpio;
cmd_config.gap = priv->wol_gap;
lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
cmd->hdr.command = cpu_to_le16(CMD_MESH_ACCESS);
- cmd->hdr.size = cpu_to_le16(sizeof(struct cmd_ds_mesh_access) + S_DS_GEN);
+ cmd->hdr.size = cpu_to_le16(sizeof(*cmd));
cmd->hdr.result = 0;
cmd->action = cpu_to_le16(cmd_action);
cmd.action = cpu_to_le16(enable);
cmd.channel = cpu_to_le16(chan);
cmd.type = cpu_to_le16(priv->mesh_tlv);
+ cmd.hdr.size = cpu_to_le16(sizeof(cmd));
if (enable) {
cmd.length = cpu_to_le16(priv->mesh_ssid_len);
#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) \
__lbs_cmd(priv, cmdnr, &(cmd)->hdr, sizeof(*(cmd)), cb, cb_arg)
+
+/* lbs_cmd_with_response() infers the size of the command to be _sent_
+ and requires that the caller sets cmd->size to the (LE) size of
+ the _response_ buffer. */
#define lbs_cmd_with_response(priv, cmdnr, cmd) \
lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd))