public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Oberritter <obi@linuxtv.org>
To: Issa Gorissen <flop.m@usa.net>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] Ngene cam device name
Date: Wed, 04 May 2011 11:59:08 +0200	[thread overview]
Message-ID: <4DC1236C.3000006@linuxtv.org> (raw)
In-Reply-To: <148PeDiAM3760S04.1304497658@web04.cms.usa.net>

On 05/04/2011 10:27 AM, Issa Gorissen wrote:
> From: Andreas Oberritter <obi@linuxtv.org>
>> Also, there's still no mapping between ca and caio devices. Imagine a
>> built-in descrambler ca0 and two CI slots ca1 and ca2.
>>
>> ca0 won't get a caio device, at least for now.
>> ca1 and ca2 might or might not have a caio device.
>>
>> If there is caio0, how am I supposed to know that it's related to ca1 or
>> ca2 (or ca0, if someone implements a caio device to bypass the software
>> demux to use a built-in descrambler)? You must not assume that there are
>> either none or two (or three) caio interfaces. You need to be able to
>> detect (or set up) the connection between the interfaces. Otherwise this
>> "API" will be a mess.
>>
>> Regards,
>> Andreas
> 
> 
> To my understanding, in such a described case, 
> 
> - ca0 would be reached from /dev/dvb/adapter0/ca0
> - ca[12], depending on if they are connected to the same physical adapter
> (PCI, USB, ...), would be reached from /dev/dvb/adapter1/ca[12] or
> /dev/dvb/adapter1/ca1 and /dev/dvb/adapter2/ca2 and there respective caio
> devices.

Of course I'm referring to devices connected to the same physical
adapter. Otherwise they would all be called ca0. Device enumeration
always starts at 0, for each adapter. What you're describing just
doesn't make sense.

> - If the 3 ca devices are on the same adapter, then the driver writer should
> take care of the order of the mapping so that ca1 always map caio1 and
> ca2/caio2, ...; and if this is not feasable, then the driver writer should
> span the ca/caio devices on different /dev/dvb/adapter folders.

You can't create caio1 without creating caio0 first. Of course, you
could require driver writers to register those ca devices first that
have caio devices. But that conflicts with other policies the driver
author might already have chosen, e.g. to map the ca (descrambler)
device numbers to demux and dvr numbers, which seems way more intuitive
to me, because demux hardware usually comes with built-in descramblers.

It's ugly to force random policies on drivers. Please create a proper
interface instead!

Last but not least, using a different adapter number wouldn't fit
either, because a DVB adapter is supposed to
- be one independent piece of hardware
- provide at least a frontend and a demux device

At least on embedded devices, it simply isn't feasible to copy a TS to
userspace from a demux, just to copy it back to the kernel and again
back to userspace through a caio device, when live streaming. But you
may want to provide a way to use the caio device for
offline-descrambling. Unless you want to force users to buy multiple
modules and multiple subscriptions for a single receiver, which in turn
would need multiple CI slots, you need a way to make sure caio can not
be used during live streaming. If this dependency is between different
adapters, then something is really, really wrong.

Why don't you just create a new device, e.g. ciX, deprecate the use of
caX for CI devices, inherit CI-related existing ioctls from the CA API,
translate the existing read and write funtions to ioctls and then use
read and write for TS I/O? IIRC, Ralph suggested something similar. I'm
pretty sure this can be done without too much code and in a backwards
compatible way.

Regards,
Andreas

  reply	other threads:[~2011-05-04  9:59 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04  8:27 [PATCH] Ngene cam device name Issa Gorissen
2011-05-04  9:59 ` Andreas Oberritter [this message]
2011-05-04 11:20   ` Ralph Metzler
2011-05-04 12:30     ` Andreas Oberritter
2011-05-04 13:15       ` Ralph Metzler
2011-05-04 13:35       ` Martin Vidovic
2011-05-04 14:46         ` Andreas Oberritter
2011-05-05 14:43           ` Martin Vidovic
2011-05-06 12:17             ` Andreas Oberritter
2011-05-06 13:43               ` Walter Van Eetvelt
2011-05-08 10:05               ` Martin Vidovic
2011-05-08 17:58                 ` Andreas Oberritter
2011-05-08 23:55                   ` Martin Vidovic
2011-05-09 11:44                     ` Andreas Oberritter
  -- strict thread matches above, loose matches on Subject: below --
2011-05-06 18:29 Issa Gorissen
2011-05-08  9:53 ` Andreas Oberritter
2011-05-08 10:30   ` Issa Gorissen
2011-05-06 13:47 Issa Gorissen
2011-05-06 16:07 ` Andreas Oberritter
2011-05-04 14:51 Issa Gorissen
2011-05-04 14:05 Issa Gorissen
2011-05-04 14:27 ` Andreas Oberritter
2011-05-04 11:09 Issa Gorissen
2011-05-04 11:07 Issa Gorissen
2011-05-04 13:51 ` Andreas Oberritter
2011-04-24 11:38 Issa Gorissen
2011-05-03 23:11 ` Mauro Carvalho Chehab
2011-05-04  7:24   ` Andreas Oberritter
2011-03-12 15:39 Issa Gorissen
2011-03-12 14:34 Issa Gorissen
2011-03-12 14:58 ` Andreas Oberritter
2011-03-28  0:44   ` Ralph Metzler
2011-03-28 21:40     ` Mauro Carvalho Chehab
2011-04-24  9:31       ` Issa Gorissen
2011-03-28 22:57     ` Oliver Endriss
2011-04-05 21:50       ` Issa Gorissen
2011-03-12 14:10 Issa Gorissen
2011-03-12 14:48 ` Andreas Oberritter
2011-03-12 14:57   ` Martin Vidovic
2011-03-12 15:06     ` Andreas Oberritter
2011-03-11 18:33 Issa Gorissen
2011-03-11 20:39 ` Andreas Oberritter
2011-03-11 21:46   ` Ralph Metzler
2011-03-12 13:25     ` Andreas Oberritter
2011-03-12 13:55       ` Ralph Metzler
2011-03-10 15:29 Issa Gorissen
2011-03-11 15:52 ` Andreas Oberritter
2011-03-11 21:44   ` Martin Vidovic
2011-03-12 13:29     ` Andreas Oberritter
2011-03-12 14:05       ` Ralph Metzler
2011-03-12 14:38         ` Andreas Oberritter
2011-03-12 15:06           ` Ralph Metzler
2011-03-12 23:42       ` Oliver Endriss
2011-03-13 10:47         ` Martin Vidovic
2011-03-16 22:07           ` Issa Gorissen
2011-03-18 20:20             ` Martin Vidovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DC1236C.3000006@linuxtv.org \
    --to=obi@linuxtv.org \
    --cc=flop.m@usa.net \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox