HardenedBSD/usr.sbin/pccard/misc/skeldrv.c
Poul-Henning Kamp f2b46629be The userland part of Andrew McRae's PCMCIA/PCCARD code.
This is not quite finished yet, and therefore I have not added it to the
usr.sbin/Makefile yet.
I collected a bunch of Andrews small programs into one: pccardc /phk

Reviewed by:	phk
Submitted by:	Andrew McRae <andrew@mega.com.au>
1995-08-24 09:03:04 +00:00

38 lines
585 B
C

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
#include <pccard/cis.h>
main(argc, argv)
int argc;
char *argv[];
{
struct drv_desc drv;
int fd, err;
fd = open("/dev/card0", 0);
if (fd < 0)
{
perror("/dev/card0");
exit(1);
}
strcpy(drv.name, "skel");
if (argc == 2)
drv.unit = atoi(argv[1]);
else
drv.unit = 0;
drv.iobase = 0x300;
drv.mem = 0xD4000;
drv.memsize = 16*1024;
drv.irq = 0xFFFF;
drv.flags = 0x1234;
if (ioctl(fd, PIOCSDRV, &drv))
perror("set driver");
close(fd);
}