On Wed, 24 Jun 2009, Alek Du wrote: > > You really have two choices for the shadow pointers. You can keep the > > pointer to the hardware structure (as you did here), or you could store > > the pointer to the software structure instead. > > > > It seems likely that the patch would be simpler if you took the second > > choice. (You might even find that you never need to use the > > backpointer from ehci_qh_hw to ehci_qh!) Have you considered doing it > > this way? > > No, Alan, > > union ehci_shadow { > struct ehci_qh_hw *qh_hw; /* Q_TYPE_QH */ > struct ehci_itd *itd; /* Q_TYPE_ITD */ > struct ehci_sitd *sitd; /* Q_TYPE_SITD */ > struct ehci_fstn *fstn; /* Q_TYPE_FSTN */ > __hc32 *hw_next; /* (all types) */ > void *ptr; > }; > > the *hw_next requires all hardware structure here. There a lot codes that compare this with hw_next in HCD. Can you give any examples where this would matter? > The hw_next is the first item for the 4 kinds of descriptors. I know. That doesn't mean the shadow pointer has to point to the hw_next field when it points to a QH. Alan Stern -- 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