]> git.lizzy.rs Git - plan9front.git/commitdiff
etheriwl: move runtime dc calibration block to proper place
authorftrvxmtrx <ftrvxmtrx@gmail.com>
Sat, 16 Feb 2013 02:28:21 +0000 (03:28 +0100)
committerftrvxmtrx <ftrvxmtrx@gmail.com>
Sat, 16 Feb 2013 02:28:21 +0000 (03:28 +0100)
sys/src/9/pc/etheriwl.c

index 38b440ee723ea83e5209adacecd634b521c2d022..e80014debccd04fc5af8ba78ae31b0f4f32db6df 100644 (file)
@@ -1230,15 +1230,6 @@ postboot(Ctlr *ctlr)
                                return err;
                }
 
-               if(ctlr->type == Type6005 || ctlr->type == Type6050){
-                       /* runtime DC calibration */
-                       memset(c, 0, sizeof(c));
-                       put32(c + 0*(5*4) + 0, 0xffffffff);
-                       put32(c + 0*(5*4) + 4, 1<<1);
-                       if((err = cmd(ctlr, 101, c, (((2*(5*4))+4)*2)+4)) != nil)
-                               return err;
-               }
-
                if(ctlr->calib.done == 0){
                        /* query calibration (init firmware) */
                        memset(c, 0, sizeof(c));
@@ -1280,6 +1271,15 @@ postboot(Ctlr *ctlr)
                                        return err;
                        }
 
+                       if(ctlr->type == Type6005 || ctlr->type == Type6050){
+                               /* runtime DC calibration */
+                               memset(c, 0, sizeof(c));
+                               put32(c + 0*(5*4) + 0, 0xffffffff);
+                               put32(c + 0*(5*4) + 4, 1<<1);
+                               if((err = cmd(ctlr, 101, c, (((2*(5*4))+4)*2)+4)) != nil)
+                                       return err;
+                       }
+
                        /* set tx antenna config */
                        put32(c, ctlr->rfcfg.txantmask & 7);
                        if((err = cmd(ctlr, 152, c, 4)) != nil)