Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 1998 14:36:11 +0200
From:      Bert Driehuis <bert_driehuis@nl.compuware.com>
To:        freebsd-isdn@FreeBSD.ORG
Subject:   Preparations for BSD/OS port
Message-ID:  <35C1BA3B.19A3A3B8@nl.compuware.com>

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

I'm working on porting ISDN4BSD to BSD/OS 3.0. The telephony part works, and
at that moment I needed sleep so I don't know what the actual status is. My
bits will need a major cleanup anyhow, so BSD/OS users should not hold their
breath!

Anyways, there are some questions I have for the developers of the FreeBSD and
NetBSD ports.

To reduce the number of #ifdeffed sections, I'd like to propose using some
#defines, along the lines of the PDEVSTATIC and FLAGS macro's that are used to
hide differences between the *BSD's. One that springs to mind is the type of
the second argument to the ioctl driver routine: on NetBSD it's an int, on
FreeBSD and BSD/OS it's a u_long. How 'bout doing this in i4b_ioctl.h:

#if defined(__FreeBSD__) || defined(__bsdi__)
#define I4B_IOCTL_CMD_T u_long
#else
#define I4B_IOCTL_CMD_T int
#endif

Another, along the lines of the FLAGS definition in layer1/i4b_isic.c, is to
use a #define PARMS to pass the right info down to the probe and attach
routines (I should check my current sources to see if I still need those extra
arguments for BSD/OS, but for the sake of argument let's assume it is still
needed). This #define of course is #undeffed at the end of the routine.

The biggest gain might come from removing "all" platform dependancies from the
card drivers, and moving the OS dependent probe/attach stuff into i4b_isic.c
(or at least into isolated sections in the card specific file). For example,
the tel_s0163_probe in i4b_tel_s0163.c is defined now in two and soon three
radically different ifdeffed routines, with the guts of the probe duplicated
two or three times. This would require some serious thinking. Anyway, I'm not
going to even *think* about tackling that issue :-)

What do you think? #ifdef or #define? And if we want to use definitions like
I4B_IOCTL_CMD_T throughout ISDN4BSD, which include file do we stick it in?
i4b_ioctl.h was a easy choice for the ioctl routine, but it might be handy to
stick it into an include file that each routine is guaranteed to include.

Cheers,

					-- Bert

-- 
Bert Driehuis, MIS -- bert_driehuis@nl.compuware.com -- +31-20-3116119
The grand leap of the whale up the Fall of Niagara is esteemed, by all
who have seen it, as one of the finest spectacles in nature.
                -- Benjamin Franklin.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35C1BA3B.19A3A3B8>