Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9d1be36197bf638be68cec6685c68e462273b65
Commit:     c9d1be36197bf638be68cec6685c68e462273b65
Parent:     dac10a9f286c75cffa75c7ec8b05d566a6ece95e
Author:     Holger Schurig <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 16 15:57:44 2008 +0100
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:10:06 2008 -0800

    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 <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 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 91b2f23..8f3e661 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)
        if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
                lbs_pr_err("cannot register lbs_rtap attribute\n");
 
-       /* Enable mesh, if supported, and work out which TLV it uses.
-          0x100 + 291 is an unofficial value used in 5.110.20.pXX
-          0x100 + 37 is the official value used in 5.110.21.pXX
-          but we check them in that order because 20.pXX doesn't
-          give an error -- it just silently fails. */
-
-       /* 5.110.20.pXX firmware will fail the command if the channel
-          doesn't match the existing channel. But only if the TLV
-          is correct. If the channel is wrong, _BOTH_ versions will
-          give an error to 0x100+291, and allow 0x100+37 to succeed.
-          It's just that 5.110.20.pXX will not have done anything
-          useful */
-
        lbs_update_channel(priv);
-       priv->mesh_tlv = 0x100 + 291;
-       if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) {
-               priv->mesh_tlv = 0x100 + 37;
-               if (lbs_mesh_config(priv, 1, priv->curbssparams.channel))
-                       priv->mesh_tlv = 0;
-       }
-       if (priv->mesh_tlv) {
-               lbs_add_mesh(priv);
 
-               if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
-                       lbs_pr_err("cannot register lbs_mesh attribute\n");
+       /* 5.0.16p0 is known to NOT support any mesh */
+       if (priv->fwrelease > 0x05001000) {
+               /* Enable mesh, if supported, and work out which TLV it uses.
+                  0x100 + 291 is an unofficial value used in 5.110.20.pXX
+                  0x100 + 37 is the official value used in 5.110.21.pXX
+                  but we check them in that order because 20.pXX doesn't
+                  give an error -- it just silently fails. */
+
+               /* 5.110.20.pXX firmware will fail the command if the channel
+                  doesn't match the existing channel. But only if the TLV
+                  is correct. If the channel is wrong, _BOTH_ versions will
+                  give an error to 0x100+291, and allow 0x100+37 to succeed.
+                  It's just that 5.110.20.pXX will not have done anything
+                  useful */
+
+               priv->mesh_tlv = 0x100 + 291;
+               if (lbs_mesh_config(priv, 1, priv->curbssparams.channel)) {
+                       priv->mesh_tlv = 0x100 + 37;
+                       if (lbs_mesh_config(priv, 1, 
priv->curbssparams.channel))
+                               priv->mesh_tlv = 0;
+               }
+               if (priv->mesh_tlv) {
+                       lbs_add_mesh(priv);
+
+                       if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
+                               lbs_pr_err("cannot register lbs_mesh 
attribute\n");
+               }
        }
 
        lbs_debugfs_init_one(priv, dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to