Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Two more DVB CA IOCTL questions



On Friday 30 January 2004 00:52, Johannes Stezenbach wrote:
> Andrew de Quincey wrote:
> > A couple more DVB CA IOCTL questions have occurred to me, and need
> > cleared up:
> >
> > 1) Should the CA_GET_MSG and CA_SEND_MSG ioctls block? Currently the
> > read()/write() interface blocks if there isn't any data/enough buffer
> > space for the message. My feeling is no, and I should return -EAGAIN (or
> > equivalent) for the IOCTLs.
>
> IMHO it should depend on O_NONBLOCK for both the ioctls and read/write.
>
> > 2) Should CA_GET_MSG receive from ANY slot/connection (i.e. overwrite any
> > user passed parameters), or should it only receive from the
> > slot/connection supplied in the sructure.
> >
> > I ask this because the read() interface just returns packets from all
> > slots/connections. My feeling is it should be possible to select, but
> > also to specify ANY (e.g. pass -1 for either parameter). In this case,
> > the parameter(s) in the ca_msg_t structure will be overwritten with the
> > appropriate value. This kind of filtering is very easy with the kernel
> > data structures I've defined.
>
> I think applications / libdvbci want to get messages from ANY slot
> and dispatch them to the upper protocol layers. If you could
> specify a slot # for CA_GET_MSG then you need separate buffers
> in the driver, and that's IMHO not necessary.

Actually, it turns out it is necessary to have multiple buffers 
unfortunately... the CAM interface can return packet fragments for multiple 
connection ids multiplexed in any order... so you have to have a seperate 
buffer per connection id in order to build up the packets correctly. You 
don't know how long a packet is going to be until you've received all the 
fragments, so you can't allocate buffer space in advance.

Its not very nice. And why a control interface really needs something so 
complex, I do not know!


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index