Re: [PATCH 2/3] dvb-usb: multi-frontend support (MFE)

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

 



On Wed, Sep 7, 2011 at 5:10 PM, Antti Palosaari <crope@xxxxxx> wrote:
> On 09/07/2011 09:36 PM, Michael Krufky wrote:
>>
>> On Wed, Sep 7, 2011 at 2:20 PM, Antti Palosaari<crope@xxxxxx>  wrote:
>
>>> Yes, I now saw when looked latest anysee driver that you moved
>>> .streaming_ctrl(), .frontend_attach() and .tuner_attach() to frontend
>>> property. OK, it is not then relevant anymore to change register all as
>>> once.
>>>
>>> What is size_of_priv used?
>>
>> size_of_priv is a signal to the dvb-usb framework to allocate memory
>> of size, size_of_priv to track device state at a given context.  If
>> you look in dvb-usb.h, there was always a size_of_priv / void *priv at
>> the dvb_usb_device context level, and there was always a size_of_priv
>> / void *priv at the dvb_usb_adapter context level.   After my MFE
>> patch, there is now a size_of_priv / void *priv at the
>> dvb_usb_fe_adapter context level.  This private state structure is
>> used to track state at the context of each dvb_usb_fe_adap, to manage
>> the environment needed to switch between the various attached
>> frontends.  You may take a look in mxl111sf.c to see how this is used
>> (ie, struct mxl111sf_adap_state *adap_state =
>> adap->fe_adap[fe->id].priv;)
>>
>> If size_of_priv is left undefined, it is initialized to 0, and the
>> void *priv pointer remains null.
>
> I marvel at there was 3 states, one for device, one for each adapter and now
> even one for each frontend. Surely enough, generally only device state is
> used. And your new driver seems to even use that new FE priv added.

My new driver requires state tracking at the dvb_usb_fe_adapter
context level, but it does *not* require state tracking at the
dvb_usb_adapter level.  The driver also has state tracking at the
dvb_usb_device context level.  It needs this tracking at both levels,
but not at the middle adapter level.

dib0700, however, requires state tracking at the dvb_usb_adapter
context level and it also requires state tracking at the
dvb_usb_device context level.  Most devices that have multiple
adapters follow this same schema for tracking state within various
context levels.

The private state tracking structures are allocated dynamically as
needed, and only if size_of_priv is defined.  Device property contexts
that do not define size_of_priv simply do not allocate any additional
memory for state tracking.

Having the ability to track private state within each context level
gives the dvb-usb framework the maximum flexibility to work with
various styles of both simple and complex digital media receiver
devices.

Regards,

Mike Krufky
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux