Re: [PATCH] mISDN cleanup user interface

From: Karsten Keil
Date: Wed Jul 30 2008 - 13:52:07 EST


On Wed, Jul 30, 2008 at 05:57:01PM +0100, David Woodhouse wrote:
> On Wed, 2008-07-30 at 18:33 +0200, Karsten Keil wrote:
> > What about this implementation ?
>
> Looks a lot saner... although it does seem to confirm my earlier
> suspicion that you're not even _using_ the fact that it's a bitmap at
> all. You set the bits for the present channels at init time, which are
> always contiguous, and you never seem to change them them later -- why
> couldn't you do this with a simple 'number of channels' integer?

No it is not contineous on different PRI line setups (E1,T1 ...)
e.g a E1 has the D-channel on channel 15 position, so this bit is not set
then. My idea was, that with such a bitmap, applictions do not need to know
anything about the different channel layouts, it can use the map as base to assign
or validate a channel numbers.

>
> Are you later intending to use the bitmap to mark them as busy/free?
>

Yes exactely, and this was the reason why the original code (which used one u_long
only as channelmap) already used the bit operators, since for a channel allocator
you should be atomic, but since we are now allow 127 channels we need proper
locking for the busy/free map anyways and so we do not need atomic operation
here.

--
Karsten Keil
SuSE Labs
ISDN and VOIP development
SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/