Re: [PATCH 3/4] USB: UHCI: Add support for big endian descriptors

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

 



On 05/09/2011 04:55 PM, Alan Stern wrote:
> On Mon, 9 May 2011, Jan Andersson wrote:
> 
>> This patch adds support for universal host controllers that use
>> big endian descriptors. Support for BE descriptors requires a non-PCI
>> host controller. For kernels with PCI-only UHCI there should be no
>> change in behaviour.
>>
>> This patch tries to replicate the technique used to support BE descriptors
>> in the EHCI HCD. Parts added to uhci-hcd.h are basically copy'n'paste from
>> ehci.h. ehci-hcd.h needed to be rearranged due to added dependencies on
>> uhci_hcd struct.
> 
> ...
> 
>> diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
>> index 04e241f..50aa4a8 100644
>> --- a/drivers/usb/host/uhci-hcd.h
>> +++ b/drivers/usb/host/uhci-hcd.h
> ...
>> +/*
>> + *	The UHCI controller and root hub
>> + */
>> +
>> +/*
>> + * States for the root hub:
>> + *
>> + * To prevent "bouncing" in the presence of electrical noise,
>> + * when there are no devices attached we delay for 1 second in the
>> + * RUNNING_NODEVS state before switching to the AUTO_STOPPED state.
>> + *
>> + * (Note that the AUTO_STOPPED state won't be necessary once the hub
>> + * driver learns to autosuspend.)
>> + */
>> +enum uhci_rh_state {
> 
> ...
> 
>> @@ -336,138 +542,6 @@ static inline u32 td_status(struct uhci_td *td) {
>>  #define SKEL_FSBR		SKEL_FS_CONTROL
>>  #define SKEL_BULK		22
>>  
>> -/*
>> - *	The UHCI controller and root hub
>> - */
>> -
>> -/*
>> - * States for the root hub:
>> - *
>> - * To prevent "bouncing" in the presence of electrical noise,
>> - * when there are no devices attached we delay for 1 second in the
>> - * RUNNING_NODEVS state before switching to the AUTO_STOPPED state.
>> - * 
>> - * (Note that the AUTO_STOPPED state won't be necessary once the hub
>> - * driver learns to autosuspend.)
>> - */
>> -enum uhci_rh_state {
> 
> Why did all this stuff get moved up in the header file?
> 

I moved struct uhci_hcd up as the cpu_to_hc32() and hc32_to_cpu()
functions depend on it, particularly via uhci_big_endian_desc(uhci) that
expands to ((uhci)->big_endian_desc). enum uhci_rh_state is used in
struct uhci_hcd so I moved that part too. cpu_to_hc32() and
hc32_to_cpu() are used in several of the defines that were previously
located before struct uhci_hcd ..

The reason for moving hcd_to_uhci() and uhci_to_hcd() was just to keep
them close to the struct definiton.

Best regards,
  Jan
--
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