Re: [RFC/PATCH 4/8] net: usb: prepare for NCM

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

 



Hi!

>>>>> "eGK" == ext Greg KH writes:
 >  On Thu, Apr 08, 2010 at 11:28:50AM +0300, Yauheni Kaliuta wrote:
 > > >>>>> "eGK" == ext Greg KH writes:
 > > 
 > >  >  On Wed, Apr 07, 2010 at 08:40:56PM +0300, yauheni.kaliuta@xxxxxxxxx wrote:
 > >  > > --- a/include/linux/usb/usbnet.h
 > >  > > +++ b/include/linux/usb/usbnet.h
 > >  > > @@ -43,7 +43,7 @@ struct usbnet {
 > >  > >          /* protocol/interface state */
 > >  > >          struct net_device        *net;
 > >  > >          int                        msg_enable;
 > >  > > -        unsigned long                data [5];
 > >  > > +        unsigned long                data[6];
 > > 
 > >  > Why do you need to change this?
 > > 
 > > well, it's a part of usbnet design. There put struct cdc_state and I'm
 > > adding one pointer to it.

 > Ah, that's obvious :)
 > Shouldn't this be a 'sizeof' type thing somehow?

no, some other protocols (not cdc_ether) store there less size structures
there. But may be the overall design can be changed. For me now the
hierarchy looks like

netdev -> usbnet -> cdc_ether -> cdc_ncm.

netdev asks about private part size, so it can be vary, but anyway it's
freed with the free() call to network device. So other parts should store
private data inside, not pointers to additionally allocated data.

So, "usbnet" should contain enough space. For the most of the protocols it
was needed only few of the space, that's why it contain the static array,
just some spare space. cdc_ether then stores there it's cdc_state.

But for ncm I need much more private data, that's why I had to change the
design a bit -> pass the size of the space I need to usbnet code, inherited
structure from usbnet.

May be it makes sense to change the design to the similar for all of them,
I do not know, that's why I'm asking (it's RFC).

-- 
WBR, Yauheni Kaliuta
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux