Skip to content

Commit

Permalink
libertas: disable mesh temporarily while setting eth channel/assoc
Browse files Browse the repository at this point in the history
Otherwise the device won't let us change channels.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 88ae291 commit 8642f1f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/net/wireless/libertas/assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ static int assoc_helper_channel(struct lbs_private *priv,
if (assoc_req->channel == priv->curbssparams.channel)
goto done;

if (priv->mesh_dev) {
/* Disconnect mesh while associating -- otherwise it
won't let us change channels */
lbs_mesh_config(priv, 0);
}

lbs_deb_assoc("ASSOC: channel: %d -> %d\n",
priv->curbssparams.channel, assoc_req->channel);

Expand All @@ -221,7 +227,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
if (assoc_req->channel != priv->curbssparams.channel) {
lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n",
assoc_req->channel);
goto done;
goto restore_mesh;
}

if ( assoc_req->secinfo.wep_enabled
Expand All @@ -236,7 +242,11 @@ static int assoc_helper_channel(struct lbs_private *priv,
/* Must restart/rejoin adhoc networks after channel change */
set_bit(ASSOC_FLAG_SSID, &assoc_req->flags);

done:
restore_mesh:
if (priv->mesh_dev)
lbs_mesh_config(priv, 1);

done:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret;
}
Expand Down

0 comments on commit 8642f1f

Please sign in to comment.