tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: USB 3.0 xhci questions
Date: Sun, 10 Aug 2014 22:44:24 +0900 (JST)
From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>
(1) The definition of XHCI_HCS2_MAXSPBUF macro.
In src/sys/dev/usb/xhcireg.h, there is the following macro definition.
#define XHCI_HCS2_MAXSPBUF(x) (((x) >> 27) & 0x7F)
It seems that XHCI_HCS2_MAXSPBUF is used for reading Max Scratchpad Buffers.
Max Scratchpad Buffers are in 31:27 bit of HCSPARAMS2 in capability
register. 0x7F is 1111111(2). I feel it is too long to mask 31:27.
It would be 0x1F = 11111(2).
Whatever the physical register specification is, please use __BITS and
__SHIFTOUT to describe it -- these is much easier to work with and
have fewer moving parts to get wrong than ands and shifts, and if you
ever need to assemble an hcs2 from its components you can use
__SHIFTIN with the same __BITS.
#define XHCI_HCS2_MAXSPBUF __BITS(31,27)
maxspbuf = __SHIFTOUT(hcs2, XHCI_HCS2_MAXSPBUF);
hcs2 = __SHIFTIN(maxspbuf, XHCI_HCS2_MAXSPBUF) | ...;
Home |
Main Index |
Thread Index |
Old Index