blob: bc45ad0666bed9c95c397203b53efb12f0357051 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/* Bitsy pcmcia code for wavelan.c */
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
#include "../port/error.h"
#include "../port/netif.h"
#include "etherif.h"
#include "../pc/wavelan.h"
static int
wavelanpcmciareset(Ether *ether)
{
Ctlr *ctlr;
if((ctlr = malloc(sizeof(Ctlr))) == nil)
return -1;
ilock(ctlr);
ctlr->ctlrno = ether->ctlrno;
if (ether->ports == nil){
ether->ports = malloc(sizeof(Devport));
ether->ports[0].port = 0;
ether->ports[0].size = 0;
ether->nports= 1;
}
if (ether->ports[0].port==0)
ether->ports[0].port=WDfltIOB;
ctlr->iob = ether->ports[0].port;
if(wavelanreset(ether, ctlr) < 0){
iunlock(ctlr);
free(ctlr);
ether->ctlr = nil;
return -1;
}
iunlock(ctlr);
return 0;
}
void
etherwavelanlink(void)
{
addethercard("wavelan", wavelanpcmciareset);
}
|