aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/assoc.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-12-11 16:54:15 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:06:50 -0500
commit2dd4b26264d48f10e802cc9f2d75542be5a3c7fa (patch)
tree2d79fa1cde5146df36c2add9c357e404512def94 /drivers/net/wireless/libertas/assoc.c
parent8e3c91bb70372da692a5fefae9f698c94bb1e641 (diff)
libertas: convert RF_CHANNEL to a direct command
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r--drivers/net/wireless/libertas/assoc.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 63bd692c7239..bd9cfe118c44 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -9,6 +9,7 @@
9#include "decl.h" 9#include "decl.h"
10#include "hostcmd.h" 10#include "hostcmd.h"
11#include "host.h" 11#include "host.h"
12#include "cmd.h"
12 13
13 14
14static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; 15static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
@@ -165,11 +166,14 @@ done:
165static int update_channel(struct lbs_private *priv) 166static int update_channel(struct lbs_private *priv)
166{ 167{
167 int ret; 168 int ret;
169
168 /* the channel in f/w could be out of sync, get the current channel */ 170 /* the channel in f/w could be out of sync, get the current channel */
169 lbs_deb_enter(LBS_DEB_ASSOC); 171 lbs_deb_enter(LBS_DEB_ASSOC);
170 ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, 172
171 CMD_OPT_802_11_RF_CHANNEL_GET, 173 ret = lbs_get_channel(priv);
172 CMD_OPTION_WAITFORRSP, 0, NULL); 174 if (ret > 0)
175 priv->curbssparams.channel = (u8) ret;
176
173 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 177 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
174 return ret; 178 return ret;
175} 179}
@@ -203,17 +207,16 @@ static int assoc_helper_channel(struct lbs_private *priv,
203 lbs_deb_assoc("ASSOC: channel: %d -> %d\n", 207 lbs_deb_assoc("ASSOC: channel: %d -> %d\n",
204 priv->curbssparams.channel, assoc_req->channel); 208 priv->curbssparams.channel, assoc_req->channel);
205 209
206 ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, 210 ret = lbs_set_channel(priv, assoc_req->channel);
207 CMD_OPT_802_11_RF_CHANNEL_SET, 211 if (ret < 0)
208 CMD_OPTION_WAITFORRSP, 0, &assoc_req->channel);
209 if (ret < 0) {
210 lbs_deb_assoc("ASSOC: channel: error setting channel."); 212 lbs_deb_assoc("ASSOC: channel: error setting channel.");
211 }
212 213
214 /* FIXME: shouldn't need to grab the channel _again_ after setting
215 * it since the firmware is supposed to return the new channel, but
216 * whatever... */
213 ret = update_channel(priv); 217 ret = update_channel(priv);
214 if (ret < 0) { 218 if (ret < 0)
215 lbs_deb_assoc("ASSOC: channel: error getting channel."); 219 lbs_deb_assoc("ASSOC: channel: error getting channel.");
216 }
217 220
218 if (assoc_req->channel != priv->curbssparams.channel) { 221 if (assoc_req->channel != priv->curbssparams.channel) {
219 lbs_deb_assoc("ASSOC: channel: failed to update channel to %d", 222 lbs_deb_assoc("ASSOC: channel: failed to update channel to %d",