goto done;
if (priv->mesh_dev) {
- /* Disconnect mesh while associating -- otherwise it
- won't let us change channels */
- lbs_mesh_config(priv, 0);
+ /* Change mesh channel first; 21.p21 firmware won't let
+ you change channel otherwise (even though it'll return
+ an error to this */
+ lbs_mesh_config(priv, 0, assoc_req->channel);
}
lbs_deb_assoc("ASSOC: channel: %d -> %d\n",
- priv->curbssparams.channel, assoc_req->channel);
+ priv->curbssparams.channel, assoc_req->channel);
ret = lbs_set_channel(priv, assoc_req->channel);
if (ret < 0)
restore_mesh:
if (priv->mesh_dev)
- lbs_mesh_config(priv, 1);
+ lbs_mesh_config(priv, 1, priv->curbssparams.channel);
done:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
}
EXPORT_SYMBOL_GPL(lbs_mesh_access);
-int lbs_mesh_config(struct lbs_private *priv, int enable)
+int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan)
{
struct cmd_ds_mesh_config cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.action = cpu_to_le16(enable);
- cmd.channel = cpu_to_le16(priv->curbssparams.channel);
+ cmd.channel = cpu_to_le16(chan);
cmd.type = cpu_to_le16(priv->mesh_tlv);
if (enable) {
memcpy(cmd.data, priv->mesh_ssid, priv->mesh_ssid_len);
}
lbs_deb_cmd("mesh config enable %d TLV %x channel %d SSID %s\n",
- enable, priv->mesh_tlv, priv->curbssparams.channel,
+ enable, priv->mesh_tlv, chan,
escape_essid(priv->mesh_ssid, priv->mesh_ssid_len));
return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, &cmd);
}
int lbs_get_channel(struct lbs_private *priv);
int lbs_set_channel(struct lbs_private *priv, u8 channel);
-int lbs_mesh_config(struct lbs_private *priv, int enable);
+int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
int lbs_suspend(struct lbs_private *priv);
if (enable == !!priv->mesh_dev)
return count;
- ret = lbs_mesh_config(priv, enable);
+ ret = lbs_mesh_config(priv, enable, priv->curbssparams.channel);
if (ret)
return ret;
lbs_update_channel(priv);
priv->mesh_tlv = 0x100 + 291;
- if (lbs_mesh_config(priv, 1)) {
+ if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) {
priv->mesh_tlv = 0x100 + 37;
- if (lbs_mesh_config(priv, 1))
+ if (lbs_mesh_config(priv, 1, priv->curbssparams.channel))
priv->mesh_tlv = 0;
}
if (priv->mesh_tlv) {
else if (priv->mode == IW_MODE_ADHOC)
lbs_stop_adhoc_network(priv);
}
- priv->curbssparams.channel = fwrq->m;
- lbs_mesh_config(priv, 0);
- lbs_mesh_config(priv, 1);
+ lbs_mesh_config(priv, 1, fwrq->m);
+ lbs_update_channel(priv);
ret = 0;
out:
priv->mesh_ssid_len = dwrq->length;
}
- lbs_mesh_config(priv, 1);
+ lbs_mesh_config(priv, 1, priv->curbssparams.channel);
out:
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
return ret;