~kris/9p

9hist

ref: 5a961254452c977be271ee78076a3f73cd33b5f8 9hist/bitsy/etherwavelan.c -rw-r--r-- 689 bytes
5a961254 — David du Colombier Plan 9 from Bell Labs 2002-06-22 24 years ago
                                                                                
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
/* 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 "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->port==0)
		ether->port=WDfltIOB;
	ctlr->iob = ether->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);
}