M pc/devether.c => pc/devether.c +10 -6
@@ 214,6 214,8 @@ etherreset(void)
if(ctlr == 0)
ctlr = malloc(sizeof(Ether));
memset(ctlr, 0, sizeof(Ether));
+ ctlr->ctlrno = ctlrno;
+ ctlr->mbps = 10;
if(isaconfig("ether", ctlrno, ctlr) == 0)
continue;
for(n = 0; cards[n].type; n++){
@@ 231,23 233,25 @@ etherreset(void)
ctlr->irq = 9;
setvec(Int0vec+ctlr->irq, ctlr->interrupt, ctlr);
- print("ether%d: %s: port 0x%luX irq %d",
- ctlrno, ctlr->type, ctlr->port, ctlr->irq);
+ print("ether%d: %s: %dMbps port 0x%luX irq %d",
+ ctlrno, ctlr->type, ctlr->mbps, ctlr->port, ctlr->irq);
if(ctlr->mem)
print(" addr 0x%luX", ctlr->mem & ~KZERO);
if(ctlr->size)
print(" size 0x%luX", ctlr->size);
- print(":");
+ print(": ");
for(i = 0; i < sizeof(ctlr->ea); i++)
- print(" %2.2uX", ctlr->ea[i]);
+ print("%2.2uX", ctlr->ea[i]);
print("\n");
- netifinit(ctlr, "ether", Ntypes, 32*1024);
+ if(ctlr->mbps == 100)
+ netifinit(ctlr, "ether", Ntypes, 100*1024);
+ else
+ netifinit(ctlr, "ether", Ntypes, 32*1024);
ctlr->alen = Eaddrlen;
memmove(ctlr->addr, ctlr->ea, sizeof(ctlr->ea));
memmove(ctlr->bcast, etherbcast, sizeof(etherbcast));
- ctlr->ctlrno = ctlrno;
ether[ctlrno] = ctlr;
ctlr = 0;
break;
M pc/ether82557.c => pc/ether82557.c +3 -2
@@ 214,7 214,7 @@ static uchar configdata[24] = {
0x60, /* inter-frame spacing */
0x00,
0xF2,
- 0x48, /* promiscuous mode off */
+ 0xC8, /* promiscuous mode off */
0x00,
0x40,
0xF2, /* transmit padding enable */
@@ 652,7 652,8 @@ reset(Ether* ether)
x = dp83840r(ctlr, i, 0x1B);
if((x & 0x0200) == 0){
ctlr->configdata[8] = 1;
- ctlr->configdata[15] |= 0x80;
+ ctlr->configdata[15] &= ~0x80;
+ ether->mbps = 100;
}
break;
}
M pc/etherif.h => pc/etherif.h +1 -0
@@ 7,6 7,7 @@ typedef struct Ether Ether;
struct Ether {
ISAConf; /* hardware info */
int ctlrno;
+ int mbps; /* Mbps */
void (*attach)(Ether*); /* filled in by reset routine */
long (*write)(Ether*, void*, long);
M port/devssl.c => port/devssl.c +1 -1
@@ 184,7 184,7 @@ sslclose(Chan *c)
s = c->aux;
dighangup(s);
if(s->c)
- cclose(s->c);
+ close(s->c);
if(s->in.secret)
free(s->in.secret);
if(s->out.secret)