On Mon, 11 Feb 2008, vichy wrote: > Dear all: > My questions are list below: > 1. Each QHD is assigned to 1 endpoints, right? > Ex: if some device has 3 endpoints, 0,1 and 2, and there must at least 3 > QHDs.
What is a QHD? Do you really mean QH? Each QH is assigned to one endpoint. > 2. What is the "device address" used for in QH? There is no "device address" field in a QH -- at least, there isn't in uhci-hcd or ehci-hcd. Maybe other controller drivers do have such a field. > I cannot find any information about "device address" in device descriptor > at chapter 9 of usb2.0 spec. The device address isn't part of the device descriptor. It is described in section 9.1 of the spec. > Since we can get endpoint address in endpoint descriptor and set the ep# > before controller determine where the data he sent out. > But how about device address? > Is this value randomly set by host when more than 1 device connected to it? The address is set by the host when more than 0 devices are connected. The values are not random; they are chosen sequentially: The first device has address 1, the second device has address 2, and so on. > 3. can 2 QHDs point to the same endpoint? > Ex: QHD[0]--> ep0 > QHD[1]--> ep0 No. > 4. if the answer of 3 is Yes, can we set different device address and > different maximum packet length on several QHs, which point to the same end > point. > Ex: > pQH[0]->bTerminate=0; //data is valid > pQH[0]->bType=0x01; //QH type > pQH[0]->bEp=0x00; //ep0 > pQH[0]->uDeviceAddress= 0x00; > pQH[0]->uMaxPacketSize=0x08; > > pQH[1]->bTerminate=0; //data is valid > pQH[1]->bType=0x01; //QH type > pQH[1]->bEp=0x00; //ep0 > pQH[1]->uDeviceAddress= 0x01; > pQH[1]->uMaxPacketSize=0x40; If the device addresses are different then the QHs don't refer to the same endpoint. In your example, pQH[0] refers to ep0 on device 0 and pQH[1] refers to ep0 on device 1 -- those are two different endpoints. Alan Stern - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html