Skip to content

Commit

Permalink
Plan 9 from Bell Labs 2003-05-08
Browse files Browse the repository at this point in the history
  • Loading branch information
0intro committed May 8, 2003
1 parent d4433de commit 9b4ec8b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions bitsy/wavelan.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,33 +557,44 @@ w_scaninfo(Ether* ether, Ctlr *ctlr, int len)
Netfile **ep, *f, **fp;
Block *bp;
WScan *wsp;
ushort *scanbuf;

scanbuf = malloc(len*2);
if(scanbuf == nil)
return;

for (i = 0; i < len ; i++)
ctlr->scanbuf[i] = csr_ins(ctlr, WR_Data1);
scanbuf[i] = csr_ins(ctlr, WR_Data1);

/* calculate number of samples */
len /= 25;
if(len == 0)
goto out;

len *= 2;
i = ether->scan;
ep = &ether->f[Ntypes];
for(fp = ether->f; fp < ep && i > 0; fp++){
f = *fp;
if(f == nil || f->scan == 0)
continue;

bp = iallocb(2048);
bp = iallocb(100*len);
if(bp == nil)
break;
for(j = 0; j < len/(2*25); j++){
wsp = (WScan*)(&ctlr->scanbuf[j*25]);
for(j = 0; j < len; j++){
wsp = (WScan*)(&scanbuf[j*25]);
if(wsp->ssid_len > 32)
wsp->ssid_len = 32;
bp->wp += snprint((char*)bp->wp, 2048,
bp->wp = (uchar*)seprint((char*)bp->wp, (char*)bp->lim,
"ssid=%.*s;bssid=%E;signal=%d;noise=%d;chan=%d%s\n",
wsp->ssid_len, wsp->ssid, wsp->bssid, wsp->signal,
wsp->noise, wsp->chan, (wsp->capinfo&(1<<4))?";wep":"");
}
qpass(f->in, bp);
i--;
}
out:
free(scanbuf);
}

static int
Expand Down Expand Up @@ -1197,7 +1208,7 @@ wavelanreset(Ether* ether, Ctlr *ctlr)
ether->scanbs = w_scanbs;
ether->arg = ether;

DEBUG("#l%d: irq %ld port %lx type %s",
DEBUG("#l%d: irq %lud port %lx type %s",
ether->ctlrno, ether->intnum, ether->ports[0].port, ether->type);
DEBUG(" %2.2uX%2.2uX%2.2uX%2.2uX%2.2uX%2.2uX\n",
ether->ea[0], ether->ea[1], ether->ea[2],
Expand Down
2 changes: 1 addition & 1 deletion boot/paq.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ char *fparts[] =
"add params 0x0040000 0x0080000",
"add kernel 0x0080000 0x0140000",
"add user 0x0140000 0x0200000",
"add ramdisk 0x0200000 0x0800000",
"add ramdisk 0x0200000 0x0c00000",
};

void
Expand Down

0 comments on commit 9b4ec8b

Please sign in to comment.