[Asterisk-bsd] zaptel device open semantics?

Alexander Timoshenko gonzo at univ.kiev.ua
Mon Nov 8 03:46:53 CST 2004


Jeff Rizzo (riz+asterisk at boogers.sf.ca.us) wrote:
> Hi-
> 
> I'm currently working on porting some of the zaptel drivers to NetBSD, 
> and I'm pretty far along... I have compiling code for zaptel, wcfxs, and 
> ztdummy.  However, I'm now realizing that the 'zaptel' piece is doing 
> something funky, and I hope that someone here can explain to me how it's 
> expecting to operate, so I can translate that into NetBSD semantics... I 
> expect that once I have this piece, I should have something working 
> (FSVO "working") within a few days.
    .. skipped ..
> ... but I'm unclear how these functions then get called.  Obviously, I'm 
> missing something pretty fundamental here, so if someone could whack me 
> with a clue-by-four, I'd greatly appreciate it.
    Let me explain. On linux every open() call generates device private
data(kind of *_softc) for the new file descriptor. On FreeBSD there is only
one cdevsw instance per device, so we should emulate the behaviour of
linux kernel. We could do it by redefining file operations for brand-new
file descriptor (zt_fileops structure) and setting f_data field of
'struct file' to pointer to device private data.

> 
> (I'm sure I'll have a lot more questions, so if someone who's familiar 
> with the workings would like to contact me privately and offer to help, 
> I'd be grateful - riz at boogers.sf.ca.us.
    Feel free to drop me a line if you will have any question regarding 
FreeBSD/Linux version of zaptel drivers.

 
> Thanks in advance,
> +j

-- 
gonzo


More information about the Asterisk-BSD mailing list