Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Aug 2000 11:33:04 -0700
From:      Devin Butterfield <dbutter@wireless.net>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Need help with driver....
Message-ID:  <399446E0.D4F51CCA@wireless.net>

next in thread | raw e-mail | index | archive | help
Hi all,

I'm a newbie to device driver writing and I have been learning well by
reading the code of the other drivers in the system. I would ultimately
like to port a linux driver for a VoIP telephony card (Quicknet
PhoneJack) to FreeBSD, and so far I have a skeleton driver which does
successfully probe the card.

The problem I'm having is that I don't know how to tell whether or not
the card is attaching correctly. How can I determine this? I thought
that I would be able to make a device file in /dev if it correctly
attached but MAKEDEV responds with:

{root@dbm /dev]# ./MAKEDEV phone
phone - no such device name

For reference, here is my attach routine:

static int                         	
ixj_isa_attach (dev)                    /* attach device		*/
	device_t dev;
{
	int unit = device_get_unit(dev);
	struct ixj_softc *sc = device_get_softc(dev);
	struct resource *res;
	int rid;
	int size;
	
	if (sc->port_used > 0) {
		size = sc->port_used;
		rid = sc->port_rid;
		res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
					0, ~0, size, RF_ACTIVE);
		if (res) {
			sc->port_rid = rid;
			sc->port_res = res;
			sc->port_used = size;
		}
	
	}
     	make_dev(&ixj_cdevsw, UNIT(dev), UID_ROOT, GID_WHEEL,
			0666, "phone%d", unit);
	
	return (0);
}


What am I doing wrong? How can I tell if this is working? Why can't I
make the device file?

Thanks in advance.
--
Regards, Devin.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?399446E0.D4F51CCA>