static Ctlr* pnpprobe(SDev *sd) { ulong start; char *p; static int i; if(i > nprobe) return 0; p = probef[i++]; if(strlen(p) < 2) return 0; if(p[1] == '!') p += 2; start = TK2MS(MACHP(0)->ticks); if(waserror()){ print("#æ: pnpprobe failed in %lud ms: %s: %s\n", TK2MS(MACHP(0)->ticks) - start, probef[i-1], up->errstr); return nil; } sd = aoeprobe(p, sd); /* does a round of probing */ poperror(); print("#æ: pnpprobe established %s in %lud ms\n", probef[i-1], TK2MS(MACHP(0)->ticks) - start); return sd->ctlr; }
static Ctlr* pnpprobe(SDev *sd) { int j; char *p; static int i; if(i > nprobe) return 0; p = probef[i++]; if(strlen(p) < 2) return 0; if(p[1] == '!') p += 2; for(j = 0;; j += Probeintvl) { if(j > Probemax) { print("#æ: pnpprobe: %s: %s\n", probef[i-1], up->errstr); return 0; } if(waserror()) { tsleep(&up->sleep, return0, 0, Probeintvl); continue; } sd = aoeprobe(p, sd); poperror(); break; } print("#æ: pnpprobe establishes %s in %dms\n", probef[i-1], j); aoectl(sd->ctlr, "nofail on"); return sd->ctlr; }
static SDev* aoeprobew(DevConf *c) { char *p; p = strchr(c->type, '/'); if(p == nil || strlen(p) > Maxpath - 11) error(Ebadarg); if(p[1] == '#') p++; /* hack */ if(ctlrlookup(p)) error(Einuse); return aoeprobe(p, 0); }