On Thu, Aug 18, 2011 at 07:49:04AM +0300, Grumbach, Emmanuel wrote: > > > > On Wed, 2011-08-17 at 08:16 -0700, Stanislaw Gruszka wrote: > > > On Tue, Aug 16, 2011 at 07:23:52PM +0300, Grumbach, Emmanuel wrote: > > > > > Simply by adding to iwl_priv different struct ops/data for each > > upper > > > > > layer you will have. You need to have the same thing to clue with > > > > > mac80211, whatever upper layer will be. Otherwise, if mac80211 > > clue > > > > > have to be different, new hardware probably needs different > > driver. > > > > > > > > > > > > > I would be reluctant to have all the data / ops needed by all the > > possible HW > > > > all the time in priv. I don't think it is a good idea to have > > unallocated pointers > > > > for a bus that don't need the rings... > > > > > > Not sure why there would be any unallocated pointers. > > > > > > > Instead, I think that having a HW specific area that is allocated > > for each HW is much > > > > nicer and reliable. This is what this patch series is all about. > > > > Furthermore, I don't want the HW layer to dereference iwl_priv, There is no reason for prohibiting dereferencing. Especially if that would make code more complex it should not be done. Look for example at net_device, it does not prohibit anything, but device drivers don't use fields that are not intended to use by them i.e ->napi_list, and use some other fields i.e. ->dev_addr . Note, this is very flexible, net_device works with all range of different devices from 10Gbit Ethernet to wifi. If you want differentiate between layers in iwl_priv, it's enough to use comments like that: struct iwl_priv { /* upper layer private fields */ struct ieee80211_hw *hw; ... /* public fields, can be used by hw layer and upper layer */ struct mutex mutex; ... } > > > We discussed with Wey upper and lower layer, term HW layer confuse me > > > even more here. > > By HW layers I meant lower layers, since these are HW specific So this should be handled by something like that: struct iwl_priv { ... void *hw_priv; } Yes, so simple :-) Stanislaw -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html