Re: [PATCH v2] EHCI: split ehci_qh structure into hw and sw parts

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

 



On Wed, 17 Jun 2009, Alek Du wrote:

> It is not simple just let ehci_qh contain the soft part, since the ehci_shadow requires
> the hardware part to be the first part...
> 
> /*
>  * Entries in periodic shadow table are pointers to one of four kinds
>  * of data structure.  That's dictated by the hardware; a type tag is
>  * encoded in the low bits of the hardware's periodic schedule.  Use
>  * Q_NEXT_TYPE to get the tag.
>  *
>  * For entries in the async schedule, the type tag always says "qh".
>  */
> union ehci_shadow {
>         struct ehci_qh          *qh;            /* 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;
> };
> 
> 
> Unless if I split all the ehci_qh, ehci_itd, ehci_sitd, ehci_fstn part into two parts...
> 
> union ehci_shadow {
>         struct ehci_qh_hw          *qh;            /* Q_TYPE_QH */
>         struct ehci_itd_hw         *itd;           /* Q_TYPE_ITD */
>         struct ehci_sitd_hw        *sitd;          /* Q_TYPE_SITD */
>         struct ehci_fstn_hw        *fstn;          /* Q_TYPE_FSTN */
>         __hc32                  *hw_next;       /* (all types) */
>         void                    *ptr;
> };

I don't see any problem.  Just do this:

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;
};

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

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

  Powered by Linux