Diff for /src/sys/dev/raid/asr/asr.c between versions 1.13 and 1.14

version 1.13, 2004/03/15 03:05:08 version 1.14, 2004/05/19 22:52:46
Line 602  STATIC u_int32_t         asr_time_delta Line 602  STATIC u_int32_t         asr_time_delta
  * Initialize the dynamic cdevsw hooks.   * Initialize the dynamic cdevsw hooks.
  */   */
 STATIC void  STATIC void
asr_drvinit (asr_drvinit (void * unused)
        void * unused) 
 {  {
         static int asr_devsw_installed = 0;          static int asr_devsw_installed = 0;
   
Line 614  asr_drvinit ( Line 613  asr_drvinit (
         /*          /*
          * Find a free spot (the report during driver load used by           * Find a free spot (the report during driver load used by
          * osd layer in engine to generate the controlling nodes).           * osd layer in engine to generate the controlling nodes).
         */         *
        while ((asr_cdevsw.d_maj < NUMCDEVSW)         * XXX this is garbage code, store a unit number in asr_cdevsw
         && (dev_dport(makedev(asr_cdevsw.d_maj,0)) != NULL)) {         * and iterate through that instead?
          */
         while (asr_cdevsw.d_maj < NUMCDEVSW &&
                 cdevsw_get(asr_cdevsw.d_maj, -1) != NULL
         ) {
                 ++asr_cdevsw.d_maj;                  ++asr_cdevsw.d_maj;
         }          }
        if (asr_cdevsw.d_maj >= NUMCDEVSW) for (        if (asr_cdevsw.d_maj >= NUMCDEVSW) {
          asr_cdevsw.d_maj = 0;                asr_cdevsw.d_maj = 0;
          (asr_cdevsw.d_maj < CDEV_MAJOR)                while (asr_cdevsw.d_maj < CDEV_MAJOR &&
           && (dev_dport(makedev(asr_cdevsw.d_maj,0)) != NULL);                        cdevsw_get(asr_cdevsw.d_maj, -1) != NULL
          ++asr_cdevsw.d_maj);                ) {
                         ++asr_cdevsw.d_maj;
                 }
         }
 
         /*          /*
          *      Come to papa           *      Come to papa
          */           */
        cdevsw_add(&asr_cdevsw);        cdevsw_add(&asr_cdevsw, 0, 0);
        /* 
         *      delete any nodes that would attach to the primary adapter, 
         * let the adapter scans add them. 
         */ 
        destroy_dev(makedev(asr_cdevsw.d_maj,0)); 
 } /* asr_drvinit */  } /* asr_drvinit */
   
 /* Must initialize before CAM layer picks up our HBA driver */  /* Must initialize before CAM layer picks up our HBA driver */
Line 3176  asr_attach (ATTACH_ARGS) Line 3178  asr_attach (ATTACH_ARGS)
         /*          /*
          *      Generate the device node information           *      Generate the device node information
          */           */
        (void)make_dev(&asr_cdevsw, unit, 0, 0, S_IRWXU, "rasr%d", unit);        make_dev(&asr_cdevsw, unit, 0, 0, S_IRWXU, "rasr%d", unit);
        destroy_dev(makedev(asr_cdevsw.d_maj,unit+1)); 
         ATTACH_RETURN(0);          ATTACH_RETURN(0);
 } /* asr_attach */  } /* asr_attach */
   

Removed from v.1.13  
changed lines
  Added in v.1.14