aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/isp1760-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-03-04 17:05:08 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:31 -0400
commit749da5f82fe33ff68dd4aa1a5e35cd9aa6246dab (patch)
tree2c0a7c689ab6a58f3a799ae51e41ac885e212194 /drivers/usb/host/isp1760-hcd.c
parent288ead45fa6637e959015d055304f521cbbc0575 (diff)
USB: straighten out port feature vs. port status usage
This patch (as1349b) clears up the confusion in many USB host controller drivers between port features and port statuses. In mosty cases it's true that the status bit is in the position given by the corresponding feature value, but that's not always true and it's not guaranteed in the USB spec. There's no functional change, just replacing expressions of the form (1 << USB_PORT_FEAT_x) with USB_PORT_STAT_x, which has the same value. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/isp1760-hcd.c')
-rw-r--r--drivers/usb/host/isp1760-hcd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index cfdac6da955..13f7d1200bc 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -1923,7 +1923,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
1923 * Even if OWNER is set, so the port is owned by the 1923 * Even if OWNER is set, so the port is owned by the
1924 * companion controller, khubd needs to be able to clear 1924 * companion controller, khubd needs to be able to clear
1925 * the port-change status bits (especially 1925 * the port-change status bits (especially
1926 * USB_PORT_FEAT_C_CONNECTION). 1926 * USB_PORT_STAT_C_CONNECTION).
1927 */ 1927 */
1928 1928
1929 switch (wValue) { 1929 switch (wValue) {
@@ -1987,7 +1987,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
1987 1987
1988 /* wPortChange bits */ 1988 /* wPortChange bits */
1989 if (temp & PORT_CSC) 1989 if (temp & PORT_CSC)
1990 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 1990 status |= USB_PORT_STAT_C_CONNECTION << 16;
1991 1991
1992 1992
1993 /* whoever resumes must GetPortStatus to complete it!! */ 1993 /* whoever resumes must GetPortStatus to complete it!! */
@@ -2007,7 +2007,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
2007 /* resume completed? */ 2007 /* resume completed? */
2008 else if (time_after_eq(jiffies, 2008 else if (time_after_eq(jiffies,
2009 priv->reset_done)) { 2009 priv->reset_done)) {
2010 status |= 1 << USB_PORT_FEAT_C_SUSPEND; 2010 status |= USB_PORT_STAT_C_SUSPEND << 16;
2011 priv->reset_done = 0; 2011 priv->reset_done = 0;
2012 2012
2013 /* stop resume signaling */ 2013 /* stop resume signaling */
@@ -2031,7 +2031,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
2031 if ((temp & PORT_RESET) 2031 if ((temp & PORT_RESET)
2032 && time_after_eq(jiffies, 2032 && time_after_eq(jiffies,
2033 priv->reset_done)) { 2033 priv->reset_done)) {
2034 status |= 1 << USB_PORT_FEAT_C_RESET; 2034 status |= USB_PORT_STAT_C_RESET << 16;
2035 priv->reset_done = 0; 2035 priv->reset_done = 0;
2036 2036
2037 /* force reset to complete */ 2037 /* force reset to complete */
@@ -2062,18 +2062,18 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
2062 printk(KERN_ERR "Warning: PORT_OWNER is set\n"); 2062 printk(KERN_ERR "Warning: PORT_OWNER is set\n");
2063 2063
2064 if (temp & PORT_CONNECT) { 2064 if (temp & PORT_CONNECT) {
2065 status |= 1 << USB_PORT_FEAT_CONNECTION; 2065 status |= USB_PORT_STAT_CONNECTION;
2066 /* status may be from integrated TT */ 2066 /* status may be from integrated TT */
2067 status |= ehci_port_speed(priv, temp); 2067 status |= ehci_port_speed(priv, temp);
2068 } 2068 }
2069 if (temp & PORT_PE) 2069 if (temp & PORT_PE)
2070 status |= 1 << USB_PORT_FEAT_ENABLE; 2070 status |= USB_PORT_STAT_ENABLE;
2071 if (temp & (PORT_SUSPEND|PORT_RESUME)) 2071 if (temp & (PORT_SUSPEND|PORT_RESUME))
2072 status |= 1 << USB_PORT_FEAT_SUSPEND; 2072 status |= USB_PORT_STAT_SUSPEND;
2073 if (temp & PORT_RESET) 2073 if (temp & PORT_RESET)
2074 status |= 1 << USB_PORT_FEAT_RESET; 2074 status |= USB_PORT_STAT_RESET;
2075 if (temp & PORT_POWER) 2075 if (temp & PORT_POWER)
2076 status |= 1 << USB_PORT_FEAT_POWER; 2076 status |= USB_PORT_STAT_POWER;
2077 2077
2078 put_unaligned(cpu_to_le32(status), (__le32 *) buf); 2078 put_unaligned(cpu_to_le32(status), (__le32 *) buf);
2079 break; 2079 break;