M carrera/fns.h => carrera/fns.h +1 -1
@@ 107,7 107,7 @@ void Xdelay(int);
void serialinit(void);
void ns16552special(int, int, Queue**, Queue**, int (*)(Queue*, int));
-void ns16552setup(ulong, ulong);
+void ns16552setup(ulong, ulong, char*);
void ns16552intr(int);
void etherintr(void);
void iomapinit(void);
M carrera/ns16552.h => carrera/ns16552.h +1 -1
@@ 13,7 13,7 @@ ns16552install(void)
return;
already = 1;
- ns16552setup(Uart1, UartFREQ);
+ ns16552setup(Uart1, UartFREQ, "eia0");
}
#define RD(r) (*(uchar*)((Uart1+r)^7))
M pc/devastar.c => pc/devastar.c +2 -2
@@ 228,7 228,6 @@ struct Astarchan
CCB *ccb; /* control block */
/* buffers */
-
Queue *iq;
Queue *oq;
@@ 268,8 267,9 @@ astarreset(void)
a->ramsize = 256*1024;
else
continue;
+
if(a->mem == 0)
- a->mem = 0xD0000;
+ a->mem = 0xD4000;
if(a->irq == 0)
a->irq = 15;
a->id = i;
M pc/ns16552.h => pc/ns16552.h +8 -5
@@ 14,7 14,7 @@ enum
#define uartwrreg(u,r,v) outb((u)->port + r, (u)->sticky[r] | (v))
#define uartrdreg(u,r) inb((u)->port + r)
-void ns16552setup(ulong, ulong);
+void ns16552setup(ulong, ulong, char*);
/*
* definition of an optional serial card
@@ 87,6 87,7 @@ ns16552install(void)
int i, j, port;
char *p;
Scard *sc;
+ char name[NAMELEN];
static int already;
if(already)
@@ 94,9 95,9 @@ ns16552install(void)
already = 1;
/* first two ports are always there and always the normal frequency */
- ns16552setup(0x3F8, UartFREQ);
+ ns16552setup(0x3F8, UartFREQ, "eia0");
setvec(Uart0vec, ns16552intrx, (void*)0);
- ns16552setup(0x2F8, UartFREQ);
+ ns16552setup(0x2F8, UartFREQ, "eia1");
setvec(Uart1vec, ns16552intrx, (void*)1);
/* set up a serial console */
@@ 128,7 129,8 @@ ns16552install(void)
setvec(Int0vec+sc->irq, mp008intr, sc);
port = sc->port;
for(j=0; j < sc->size; j++){
- ns16552setup(port, sc->freq);
+ sprint(name, "eia%d%2.2d", i, j);
+ ns16552setup(port, sc->freq, name);
port += 8;
}
} else if(strcmp(sc->type, "com") == 0 || strcmp(sc->type, "COM") == 0){
@@ 139,7 141,8 @@ ns16552install(void)
*/
if(sc->freq == 0)
sc->freq = UartFREQ;
- ns16552setup(sc->port, sc->freq);
+ sprint(name, "eia%d00", i);
+ ns16552setup(sc->port, sc->freq, name);
setvec(Int0vec+sc->irq, ns16552intrx, (void*)(nuart-1));
}
}
M port/devns16552.c => port/devns16552.c +6 -4
@@ 75,6 75,7 @@ struct Uart
QLock;
Uart *elist; /* next enabled interface */
+ char name[NAMELEN];
uchar sticky[8]; /* sticky write register values */
ulong port;
@@ 449,7 450,7 @@ ns16552setup0(Uart *p)
* called by main() to create a new duart
*/
void
-ns16552setup(ulong port, ulong freq)
+ns16552setup(ulong port, ulong freq, char *name)
{
Uart *p;
@@ 458,6 459,7 @@ ns16552setup(ulong port, ulong freq)
p = xalloc(sizeof(Uart));
uart[nuart] = p;
+ strcpy(p->name, name);
p->dev = nuart;
nuart++;
p->port = port;
@@ 659,15 661,15 @@ ns16552reset(void)
dp = ns16552dir;
for(i = 0; i < nuart; i++){
/* 3 directory entries per port */
- sprint(dp->name, "eia%d", i);
+ strcpy(dp->name, uart[i]->name);
dp->qid.path = NETQID(i, Ndataqid);
dp->perm = 0660;
dp++;
- sprint(dp->name, "eia%dctl", i);
+ sprint(dp->name, "%sctl", uart[i]->name);
dp->qid.path = NETQID(i, Nctlqid);
dp->perm = 0660;
dp++;
- sprint(dp->name, "eia%dstat", i);
+ sprint(dp->name, "%sstat", uart[i]->name);
dp->qid.path = NETQID(i, Nstatqid);
dp->perm = 0444;
dp++;