diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2008-01-16 09:57:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:06 -0500 |
commit | c9d1be36197bf638be68cec6685c68e462273b65 (patch) | |
tree | 0f8e373649d0784c49e02ee6c57559f5116d3418 /drivers/net/wireless/libertas/main.c | |
parent | dac10a9f286c75cffa75c7ec8b05d566a6ece95e (diff) |
libertas: don't blindly try mesh
The CF card only has a very old firmware (5.0.16p0). This firmware doesn't
know anything about mesh config. However, current code blindly calls
mesh_config when the card is inserted. So check the firmware version before
issuing this command.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 91b2f2398a61..8f3e661db986 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -1192,31 +1192,35 @@ int lbs_start_card(struct lbs_private *priv) | |||
1192 | if (device_create_file(&dev->dev, &dev_attr_lbs_rtap)) | 1192 | if (device_create_file(&dev->dev, &dev_attr_lbs_rtap)) |
1193 | lbs_pr_err("cannot register lbs_rtap attribute\n"); | 1193 | lbs_pr_err("cannot register lbs_rtap attribute\n"); |
1194 | 1194 | ||
1195 | /* Enable mesh, if supported, and work out which TLV it uses. | ||
1196 | 0x100 + 291 is an unofficial value used in 5.110.20.pXX | ||
1197 | 0x100 + 37 is the official value used in 5.110.21.pXX | ||
1198 | but we check them in that order because 20.pXX doesn't | ||
1199 | give an error -- it just silently fails. */ | ||
1200 | |||
1201 | /* 5.110.20.pXX firmware will fail the command if the channel | ||
1202 | doesn't match the existing channel. But only if the TLV | ||
1203 | is correct. If the channel is wrong, _BOTH_ versions will | ||
1204 | give an error to 0x100+291, and allow 0x100+37 to succeed. | ||
1205 | It's just that 5.110.20.pXX will not have done anything | ||
1206 | useful */ | ||
1207 | |||
1208 | lbs_update_channel(priv); | 1195 | lbs_update_channel(priv); |
1209 | priv->mesh_tlv = 0x100 + 291; | ||
1210 | if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) { | ||
1211 | priv->mesh_tlv = 0x100 + 37; | ||
1212 | if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) | ||
1213 | priv->mesh_tlv = 0; | ||
1214 | } | ||
1215 | if (priv->mesh_tlv) { | ||
1216 | lbs_add_mesh(priv); | ||
1217 | 1196 | ||
1218 | if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) | 1197 | /* 5.0.16p0 is known to NOT support any mesh */ |
1219 | lbs_pr_err("cannot register lbs_mesh attribute\n"); | 1198 | if (priv->fwrelease > 0x05001000) { |
1199 | /* Enable mesh, if supported, and work out which TLV it uses. | ||
1200 | 0x100 + 291 is an unofficial value used in 5.110.20.pXX | ||
1201 | 0x100 + 37 is the official value used in 5.110.21.pXX | ||
1202 | but we check them in that order because 20.pXX doesn't | ||
1203 | give an error -- it just silently fails. */ | ||
1204 | |||
1205 | /* 5.110.20.pXX firmware will fail the command if the channel | ||
1206 | doesn't match the existing channel. But only if the TLV | ||
1207 | is correct. If the channel is wrong, _BOTH_ versions will | ||
1208 | give an error to 0x100+291, and allow 0x100+37 to succeed. | ||
1209 | It's just that 5.110.20.pXX will not have done anything | ||
1210 | useful */ | ||
1211 | |||
1212 | priv->mesh_tlv = 0x100 + 291; | ||
1213 | if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) { | ||
1214 | priv->mesh_tlv = 0x100 + 37; | ||
1215 | if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) | ||
1216 | priv->mesh_tlv = 0; | ||
1217 | } | ||
1218 | if (priv->mesh_tlv) { | ||
1219 | lbs_add_mesh(priv); | ||
1220 | |||
1221 | if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) | ||
1222 | lbs_pr_err("cannot register lbs_mesh attribute\n"); | ||
1223 | } | ||
1220 | } | 1224 | } |
1221 | 1225 | ||
1222 | lbs_debugfs_init_one(priv, dev); | 1226 | lbs_debugfs_init_one(priv, dev); |