I got it.
Thanks for your help,
vichy

-----Original Message-----
From: Alan Stern [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 25, 2008 4:58 AM
To: vichy
Cc: linux-usb@vger.kernel.org
Subject: Re: Question about port reset

On Sun, 24 Feb 2008, vichy wrote:

> Dear all:
> Below is a part of ehci_hub_control function in ehci-hub.c.
> 
> /* force reset to complete */
> writel (temp & ~(PORT_RWC_BITS | PORT_RESET),
>               &ehci->regs->port_status [wIndex]);
> Where PORT_RWC_BITS = (PORT_CSC | PORT_PEC | PORT_OCC) and if I interpret
it
> correctly, it will set PORT_CSC, PORT_PEC, PORT_OCC and PORT_RESET as 0.

You do not interpret it correctly.

The PORT_RWC_BITS are named that way because that are 
Read-and-Write-to-Clear.  That is, when the computer writes a 1 to any 
of those bits, the effect is to set the bit to 0.  Writing a 0 leaves 
the bit unchanged.

> I can understand why we set PORT_RESET as 0, but why we set other 3
> parameters as 0, too.

By including PORT_RWC_BITS in that statement we _avoid_ setting those
bits to 0.

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

Reply via email to