[BACK]Return to dev.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/dev.c between version 1.2 and 1.3

version 1.2, 2012/11/30 20:25:32 version 1.3, 2012/11/30 20:44:31
Line 77 
Line 77 
 void  void
 dev_log(struct dev *d)  dev_log(struct dev *d)
 {  {
   #ifdef DEBUG
           static char *pstates[] = {
                   "cfg", "ini", "run"
           };
   #endif
         log_puts("snd");          log_puts("snd");
         log_putu(d->num);          log_putu(d->num);
   #ifdef DEBUG
           if (log_level >= 3) {
                   log_puts(" pst=");
                   log_puts(pstates[d->pstate]);
           }
   #endif
 }  }
   
 void  void
 slot_log(struct slot *s)  slot_log(struct slot *s)
 {  {
 #ifdef DEBUG  #ifdef DEBUG
         static char *pstates[] = {          static char *pstates[] = {
                 "ini", "sta", "rdy", "run", "stp", "mid"                  "ini", "sta", "rdy", "run", "stp", "mid"
Line 1121 
Line 1132 
 void  void
 dev_close(struct dev *d)  dev_close(struct dev *d)
 {  {
         struct slot *s, *snext;          int i;
           struct slot *s;
   
 #ifdef DEBUG  #ifdef DEBUG
         if (log_level >= 3) {          if (log_level >= 3) {
Line 1129 
Line 1141 
                 log_puts(": closing\n");                  log_puts(": closing\n");
         }          }
 #endif  #endif
         while ((s = d->slot_list) != NULL) {          d->pstate = DEV_CFG;
                 snext = s->next;          for (s = d->slot, i = DEV_NSLOT; i > 0; i--, s++) {
                 if (s->ops)                  if (s->ops)
                         s->ops->exit(s->arg);                          s->ops->exit(s->arg);
                 s->ops = NULL;                  s->ops = NULL;
                 d->slot_list = snext;  
         }          }
           d->slot_list = NULL;
         dev_sio_close(d);          dev_sio_close(d);
         if (d->mode & MODE_PLAY) {          if (d->mode & MODE_PLAY) {
                 if (d->encbuf != NULL)                  if (d->encbuf != NULL)
Line 1148 
Line 1160 
                 xfree(d->rbuf);                  xfree(d->rbuf);
         }          }
         dev_clear(d);          dev_clear(d);
         d->pstate = DEV_CFG;  
 }  }
   
 int  int
Line 1734 
Line 1745 
 void  void
 slot_ready(struct slot *s)  slot_ready(struct slot *s)
 {  {
           /*
            * device may be disconnected, and if so we're called from
            * slot->ops->exit() on a closed device
            */
           if (s->dev->pstate == DEV_CFG)
                   return;
         if (s->tstate == MMC_OFF)          if (s->tstate == MMC_OFF)
                 slot_attach(s);                  slot_attach(s);
         else {          else {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3