On Sun, 27 Jun 2010, loody wrote: > Dear all: > I have some questions about host driver: Which host driver? And which function in that host driver? > 1. why we use *dummy = *qtd instead of memcpy(dummy,qtd,sizeof(struct ehci_qtd)? Are you talking about qh_append_tds() in ehci-q.c? We use the assignment instead of calling memcpy because it is shorter and easier to understand. It may also generate better code. > Since *dummy = *qtd tried to copy the content of qtd which points > to to where dummy pointed to, right? Wrong. > 2. why we set a limitation about usbdevfs_urb, MAX_USBFS_BUFFER_SIZE (16K)? (How is this question related to $SUBJECT?) Because the URB data has to be allocated in contiguous memory. Limiting it to 4 pages (where each page is 4 KB) increases the chance that the allocation will succeed. > we don't do so with kernel urb, Almost all kernel URBs are smaller than 16 KB anyway. > and why the size is 16k instead of > 20k, the limitation of an qtd? There is no reason why the size should be the same as the maximum size of a qtd. 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