Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/pc/pcmciamodem.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname pc/pcmciamodem.c 1998/0221
## diff -e /dev/null /n/emeliedump/1998/0221/sys/src/brazil/pc/pcmciamodem.c
0a
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
#include "ureg.h"
#include "../port/error.h"

/*
 *  PCMCIA modem.
 *  By default, this will set it up with the port and irq of
 *  COM2 unless a serialx=type=com line is found in plan9.ini.
 *  The assumption is that a laptop with a pcmcia will have only
 *  one com port.
 */

enum {
	Maxcard=	8,
};

static char* modems[] = {
	"IBM 33.6 Data/Fax/Voice Modem",
	"KeepInTouch",
	0,
};

void
pcmciamodemlink(void)
{
	ISAConf isa;
	int i, slot;

	i = 0;
	for(;;){
		memset(&isa, 0, sizeof(isa));

		/* look for a configuration line */
		for(; i < Maxcard; i++){
			if(isaconfig("serial", i, &isa))
			if(cistrcmp(isa.type, "com") == 0)
				break;
			memset(&isa, 0, sizeof(isa));
		}

		/* default is COM2 */
		if(isa.irq == 0)
			isa.irq = 3;
		if(isa.port == 0)
			isa.port = 0x2F8;

		slot = pcmspecial(modems[0], &isa);
		if(slot < 0)
			break;
	}
}	
.
## diffname pc/pcmciamodem.c 1998/0811
## diff -e /n/emeliedump/1998/0221/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1998/0811/sys/src/brazil/pc/pcmciamodem.c
52c
		for(j = 0; modems[j]; j++){
			slot = pcmspecial(modems[0], &isa);
			if(slot >= 0)
				break;
		}
.
32c
	int i, j, slot;
.
## diffname pc/pcmciamodem.c 1998/0819
## diff -e /n/emeliedump/1998/0811/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1998/0819/sys/src/brazil/pc/pcmciamodem.c
53c
			slot = pcmspecial(modems[j], &isa);
.
## diffname pc/pcmciamodem.c 1998/0910
## diff -e /n/emeliedump/1998/0819/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1998/0910/sys/src/brazil/pc/pcmciamodem.c
51a
		slot = -1;
.
## diffname pc/pcmciamodem.c 1998/0918
## diff -e /n/emeliedump/1998/0910/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1998/0918/sys/src/brazil/pc/pcmciamodem.c
23a
	"CM-56G",				/* Xircom CreditCard Modem 56 - GlobalACCESS */
.
## diffname pc/pcmciamodem.c 1999/0220
## diff -e /n/emeliedump/1998/0918/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1999/0220/sys/src/brazil/pc/pcmciamodem.c
57a
			}
.
56c
			if(slot >= 0){
				print("%s in pcmcia slot %d port %0xlx irq %d\n",
					modems[j], slot, isa.port, isa.irq);
.
## diffname pc/pcmciamodem.c 1999/0222
## diff -e /n/emeliedump/1999/0220/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1999/0222/sys/src/brazil/pc/pcmciamodem.c
57c
				print("%s in pcmcia slot %d port 0x%lx irq %d\n",
.
## diffname pc/pcmciamodem.c 1999/0301
## diff -e /n/emeliedump/1999/0222/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1999/0301/sys/src/brazil/pc/pcmciamodem.c
57c
				print("%s in pcmcia slot %d port 0x%lux irq %lud\n",
.
## diffname pc/pcmciamodem.c 1999/0312
## diff -e /n/emeliedump/1999/0301/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/1999/0312/sys/src/brazil/pc/pcmciamodem.c
25a
	"CEM56",
.
## diffname pc/pcmciamodem.c 2000/1006
## diff -e /n/emeliedump/1999/0312/sys/src/brazil/pc/pcmciamodem.c /n/emeliedump/2000/1006/sys/src/9/pc/pcmciamodem.c
63,64c

		slot = pcmspecial(modems[j], &isa);
		if(slot >= 0){
			print("%s in pcmcia slot %d port 0x%lux irq %lud\n",
				modems[j], slot, isa.port, isa.irq);
		}
.
61d
48,59c
		if (isa.irq == 0 && isa.port == 0) {
			if (com2used == 0) {
				/* default is COM2 */
				isa.irq = 3;
				isa.port = 0x2F8;
				com2used++;
			} else
.
37c
	com2used = 0;
	for(j = 0; modems[j]; j++){
.
34c
	int i, j, slot, com2used;
.
## diffname pc/pcmciamodem.c 2001/1201
## diff -e /n/emeliedump/2000/1006/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2001/1201/sys/src/9/pc/pcmciamodem.c
60a
			if(ioalloc(isa.port, 8, 0, modems[j]) < 0)
				print("%s port %lux already in use\n", modems[j], isa.port);
.
24c
	"CM-56G",			/* Xircom CreditCard Modem 56 - GlobalACCESS */
.
## diffname pc/pcmciamodem.c 2001/1222
## diff -e /n/emeliedump/2001/1201/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2001/1222/sys/src/9/pc/pcmciamodem.c
60a
			if(usingcom2)
				com2used = 1;
.
54c
				usingcom2 = 1;
.
48a
		usingcom2 = 0;
.
34c
	int i, j, slot, com2used, usingcom2;
.
## diffname pc/pcmciamodem.c 2002/0122
## diff -e /n/emeliedump/2001/1222/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2002/0122/sys/src/9/pc/pcmciamodem.c
26a
	"MONTANA V.34 FAX/MODEM",	/* Motorola */
.
## diffname pc/pcmciamodem.c 2002/0505
## diff -e /n/emeliedump/2002/0122/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2002/0505/sys/src/9/pc/pcmciamodem.c
27a
	"REM10",
.
## diffname pc/pcmciamodem.c 2002/1016
## diff -e /n/emeliedump/2002/0505/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2002/1016/sys/src/9/pc/pcmciamodem.c
28a
	"GSM/GPRS",
.
## diffname pc/pcmciamodem.c 2002/1105
## diff -e /n/emeliedump/2002/1016/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2002/1105/sys/src/9/pc/pcmciamodem.c
29a
	"AirCard 555",
.
## diffname pc/pcmciamodem.c 2003/0301
## diff -e /n/emeliedump/2002/1105/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2003/0301/sys/src/9/pc/pcmciamodem.c
70c
			print("%s in pcmcia slot %d port 0x%lux irq %d\n",
.
## diffname pc/pcmciamodem.c 2003/0326
## diff -e /n/emeliedump/2003/0301/sys/src/9/pc/pcmciamodem.c /n/emeliedump/2003/0326/sys/src/9/pc/pcmciamodem.c
30a
	"Gold Card Global",		/* Psion V90 Gold card */
.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].