[Asterisk-Dev] Zaptel development question

creslin at digium.com creslin at digium.com
Wed Oct 13 16:14:36 MST 2004


On Wed, Oct 13, 2004 at 11:02:33AM -0700, Kevin P. Fleming wrote:
> Steven Sokol wrote:
> 
> >Does anybody else see what I am missing -- an ioctl call to the control 
> >interface (/dev/zap/ctl) that will return card-specific information?  
> >The generic ZT_GET_PARAMS doesn't seem to pass that bit of data back, 
> >and I don't see any other driver calls that would return structures with 
> >module (driver) specific data.
> >
> >Anybody else have thoughts?
> 
> Well, yeah, I have thoughts, but they are along a different line. I 
> would suggest enhancing the Zaptel modules to support sysfs (/sys), and 
> report this information there. That's exactly what it's intended for, 
> and it's much easier to use than ioctls, plus it doesn't have to mangled 
> for different platforms (unlike ioctls, which work differently on 
> 32-bit, 64-bit and mixed 32/64-bit environments).
> 
> Just exactly how to present the information there (as a device, or a 
> class, or whatever) would have to be figured out with the help of the 
> kernel devs that work on this stuff, but that wouldn't be too difficult 
> to manage. I haven't tried, though, since I haven't got time to 
> implement it in Zaptel... if someone else does, I'll be happy to help 
> figure out what the interface should be.

It's relatively simple.  I did the zaptel udev support code (including /sysfs
support) and it's pretty straightforward.  You shouldn't have too much
difficulty presenting the information in /sysfs and exposing it to the
outside world.  I didn't do any file-information interfaces though for
zaptel but the basic framework should be there, just look at the existing
code that sets up the sysfs entries for zaptel to start.

Matthew Fredrickson



More information about the asterisk-dev mailing list