devkbd: fix missing devdrirread

This commit is contained in:
cinap_lenrek 2011-05-09 10:04:04 +00:00
parent 22ec6165bc
commit 489d71b9ba

View file

@ -355,21 +355,24 @@ kbdclose(Chan *c)
} }
static Block* static Block*
kbdbread(Chan *c, long n, ulong) kbdbread(Chan *c, long n, ulong off)
{ {
if(c->qid.path != Qscancode) if(c->qid.path == Qscancode)
error(Egreg); return qbread(kbd.q, n);
else
return qbread(kbd.q, n); return devbread(c, n, off);
} }
static long static long
kbdread(Chan *c, void *a, long n, vlong) kbdread(Chan *c, void *a, long n, vlong)
{ {
if(c->qid.path != Qscancode) if(c->qid.path == Qscancode)
error(Egreg); return qread(kbd.q, a, n);
if(c->qid.path == Qdir)
return devdirread(c, a, n, kbdtab, nelem(kbdtab), devgen);
return qread(kbd.q, a, n); error(Egreg);
return 0;
} }
static long static long