diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-13 00:32:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:07 -0500 |
commit | 860621347e88b23517fc4ec93fa5af940401c3ec (patch) | |
tree | 059223640a79bfe60f0dd9fe3c15d5656cac740a /drivers/net | |
parent | 020f3d0001cb249ceae623c1a7ae0c196326ef3f (diff) |
libertas: pass channel argument directly to lbs_mesh_config()
There is weirdness here; the firmware seems to refuse to change channels
at will.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmd.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 7 |
5 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index ff976ebcd014..cd8e043b16f4 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -205,13 +205,14 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
205 | goto done; | 205 | goto done; |
206 | 206 | ||
207 | if (priv->mesh_dev) { | 207 | if (priv->mesh_dev) { |
208 | /* Disconnect mesh while associating -- otherwise it | 208 | /* Change mesh channel first; 21.p21 firmware won't let |
209 | won't let us change channels */ | 209 | you change channel otherwise (even though it'll return |
210 | lbs_mesh_config(priv, 0); | 210 | an error to this */ |
211 | lbs_mesh_config(priv, 0, assoc_req->channel); | ||
211 | } | 212 | } |
212 | 213 | ||
213 | lbs_deb_assoc("ASSOC: channel: %d -> %d\n", | 214 | lbs_deb_assoc("ASSOC: channel: %d -> %d\n", |
214 | priv->curbssparams.channel, assoc_req->channel); | 215 | priv->curbssparams.channel, assoc_req->channel); |
215 | 216 | ||
216 | ret = lbs_set_channel(priv, assoc_req->channel); | 217 | ret = lbs_set_channel(priv, assoc_req->channel); |
217 | if (ret < 0) | 218 | if (ret < 0) |
@@ -244,7 +245,7 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
244 | 245 | ||
245 | restore_mesh: | 246 | restore_mesh: |
246 | if (priv->mesh_dev) | 247 | if (priv->mesh_dev) |
247 | lbs_mesh_config(priv, 1); | 248 | lbs_mesh_config(priv, 1, priv->curbssparams.channel); |
248 | 249 | ||
249 | done: | 250 | done: |
250 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); | 251 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index c4299ae1774e..171acc27ffba 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1114,13 +1114,13 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action, | |||
1114 | } | 1114 | } |
1115 | EXPORT_SYMBOL_GPL(lbs_mesh_access); | 1115 | EXPORT_SYMBOL_GPL(lbs_mesh_access); |
1116 | 1116 | ||
1117 | int lbs_mesh_config(struct lbs_private *priv, int enable) | 1117 | int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan) |
1118 | { | 1118 | { |
1119 | struct cmd_ds_mesh_config cmd; | 1119 | struct cmd_ds_mesh_config cmd; |
1120 | 1120 | ||
1121 | memset(&cmd, 0, sizeof(cmd)); | 1121 | memset(&cmd, 0, sizeof(cmd)); |
1122 | cmd.action = cpu_to_le16(enable); | 1122 | cmd.action = cpu_to_le16(enable); |
1123 | cmd.channel = cpu_to_le16(priv->curbssparams.channel); | 1123 | cmd.channel = cpu_to_le16(chan); |
1124 | cmd.type = cpu_to_le16(priv->mesh_tlv); | 1124 | cmd.type = cpu_to_le16(priv->mesh_tlv); |
1125 | 1125 | ||
1126 | if (enable) { | 1126 | if (enable) { |
@@ -1128,7 +1128,7 @@ int lbs_mesh_config(struct lbs_private *priv, int enable) | |||
1128 | memcpy(cmd.data, priv->mesh_ssid, priv->mesh_ssid_len); | 1128 | memcpy(cmd.data, priv->mesh_ssid, priv->mesh_ssid_len); |
1129 | } | 1129 | } |
1130 | lbs_deb_cmd("mesh config enable %d TLV %x channel %d SSID %s\n", | 1130 | lbs_deb_cmd("mesh config enable %d TLV %x channel %d SSID %s\n", |
1131 | enable, priv->mesh_tlv, priv->curbssparams.channel, | 1131 | enable, priv->mesh_tlv, chan, |
1132 | escape_essid(priv->mesh_ssid, priv->mesh_ssid_len)); | 1132 | escape_essid(priv->mesh_ssid, priv->mesh_ssid_len)); |
1133 | return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, &cmd); | 1133 | return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, &cmd); |
1134 | } | 1134 | } |
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h index 55f2436574df..a4aaa6b34a70 100644 --- a/drivers/net/wireless/libertas/cmd.h +++ b/drivers/net/wireless/libertas/cmd.h | |||
@@ -31,7 +31,7 @@ int lbs_set_data_rate(struct lbs_private *priv, u8 rate); | |||
31 | int lbs_get_channel(struct lbs_private *priv); | 31 | int lbs_get_channel(struct lbs_private *priv); |
32 | int lbs_set_channel(struct lbs_private *priv, u8 channel); | 32 | int lbs_set_channel(struct lbs_private *priv, u8 channel); |
33 | 33 | ||
34 | int lbs_mesh_config(struct lbs_private *priv, int enable); | 34 | int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan); |
35 | 35 | ||
36 | int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria); | 36 | int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria); |
37 | int lbs_suspend(struct lbs_private *priv); | 37 | int lbs_suspend(struct lbs_private *priv); |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 2409df85c2e0..9232b975a42c 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -344,7 +344,7 @@ static ssize_t lbs_mesh_set(struct device *dev, | |||
344 | if (enable == !!priv->mesh_dev) | 344 | if (enable == !!priv->mesh_dev) |
345 | return count; | 345 | return count; |
346 | 346 | ||
347 | ret = lbs_mesh_config(priv, enable); | 347 | ret = lbs_mesh_config(priv, enable, priv->curbssparams.channel); |
348 | if (ret) | 348 | if (ret) |
349 | return ret; | 349 | return ret; |
350 | 350 | ||
@@ -1187,9 +1187,9 @@ int lbs_start_card(struct lbs_private *priv) | |||
1187 | 1187 | ||
1188 | lbs_update_channel(priv); | 1188 | lbs_update_channel(priv); |
1189 | priv->mesh_tlv = 0x100 + 291; | 1189 | priv->mesh_tlv = 0x100 + 291; |
1190 | if (lbs_mesh_config(priv, 1)) { | 1190 | if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) { |
1191 | priv->mesh_tlv = 0x100 + 37; | 1191 | priv->mesh_tlv = 0x100 + 37; |
1192 | if (lbs_mesh_config(priv, 1)) | 1192 | if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) |
1193 | priv->mesh_tlv = 0; | 1193 | priv->mesh_tlv = 0; |
1194 | } | 1194 | } |
1195 | if (priv->mesh_tlv) { | 1195 | if (priv->mesh_tlv) { |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 262d4cc58046..b1e24723f2f9 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1000,9 +1000,8 @@ static int lbs_mesh_set_freq(struct net_device *dev, | |||
1000 | else if (priv->mode == IW_MODE_ADHOC) | 1000 | else if (priv->mode == IW_MODE_ADHOC) |
1001 | lbs_stop_adhoc_network(priv); | 1001 | lbs_stop_adhoc_network(priv); |
1002 | } | 1002 | } |
1003 | priv->curbssparams.channel = fwrq->m; | 1003 | lbs_mesh_config(priv, 1, fwrq->m); |
1004 | lbs_mesh_config(priv, 0); | 1004 | lbs_update_channel(priv); |
1005 | lbs_mesh_config(priv, 1); | ||
1006 | ret = 0; | 1005 | ret = 0; |
1007 | 1006 | ||
1008 | out: | 1007 | out: |
@@ -2010,7 +2009,7 @@ static int lbs_mesh_set_essid(struct net_device *dev, | |||
2010 | priv->mesh_ssid_len = dwrq->length; | 2009 | priv->mesh_ssid_len = dwrq->length; |
2011 | } | 2010 | } |
2012 | 2011 | ||
2013 | lbs_mesh_config(priv, 1); | 2012 | lbs_mesh_config(priv, 1, priv->curbssparams.channel); |
2014 | out: | 2013 | out: |
2015 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | 2014 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); |
2016 | return ret; | 2015 | return ret; |