Re: [PATCH 16/16] usb: dwc3: convert structures into bitshifts

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

 



On 10/13/2011 08:21 AM, Felipe Balbi wrote:
Hi,
Hi,

our parameter structures need to be written to
HW, so instead of assuming little endian, we
convert those into bit shifts.
It seems this patch is not complete. You are also using bitfields for the
TRBs and events. Any plans to fix those?
OTOH, Sebastian had already taken care of endianness by using that
struct dwc3_trb and struct dwc3_trb_hw trick. Let's wait for his
comment.

Sebastian ?

There should be no issues with this. The bit fields which are used as
parameters to commands are written handled with readl()/writel() which
should do the swap before writing to the hardware. For TRBs we have
dwc3_trb_to_hw() and dwc3_trb_to_nat().
The only affected piece is probably only the event interrupt handling:
we read the content via memcpy() instead of doing the swapping here.
Right now we assume that every event is 4 bytes in size so a
le32_to_cpu() should fix this. Later we should think what to do with
the >4 bytes events :)

Sebastian
--
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