aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-hub.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/xhci-hub.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/xhci-hub.c')
-rw-r--r--drivers/usb/host/xhci-hub.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index dd69df1e4558..325b47a267b9 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -205,27 +205,27 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
205 205
206 /* wPortChange bits */ 206 /* wPortChange bits */
207 if (temp & PORT_CSC) 207 if (temp & PORT_CSC)
208 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 208 status |= USB_PORT_STAT_C_CONNECTION << 16;
209 if (temp & PORT_PEC) 209 if (temp & PORT_PEC)
210 status |= 1 << USB_PORT_FEAT_C_ENABLE; 210 status |= USB_PORT_STAT_C_ENABLE << 16;
211 if ((temp & PORT_OCC)) 211 if ((temp & PORT_OCC))
212 status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; 212 status |= USB_PORT_STAT_C_OVERCURRENT << 16;
213 /* 213 /*
214 * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific 214 * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific
215 * changes 215 * changes
216 */ 216 */
217 if (temp & PORT_CONNECT) { 217 if (temp & PORT_CONNECT) {
218 status |= 1 << USB_PORT_FEAT_CONNECTION; 218 status |= USB_PORT_STAT_CONNECTION;
219 status |= xhci_port_speed(temp); 219 status |= xhci_port_speed(temp);
220 } 220 }
221 if (temp & PORT_PE) 221 if (temp & PORT_PE)
222 status |= 1 << USB_PORT_FEAT_ENABLE; 222 status |= USB_PORT_STAT_ENABLE;
223 if (temp & PORT_OC) 223 if (temp & PORT_OC)
224 status |= 1 << USB_PORT_FEAT_OVER_CURRENT; 224 status |= USB_PORT_STAT_OVERCURRENT;
225 if (temp & PORT_RESET) 225 if (temp & PORT_RESET)
226 status |= 1 << USB_PORT_FEAT_RESET; 226 status |= USB_PORT_STAT_RESET;
227 if (temp & PORT_POWER) 227 if (temp & PORT_POWER)
228 status |= 1 << USB_PORT_FEAT_POWER; 228 status |= USB_PORT_STAT_POWER;
229 xhci_dbg(xhci, "Get port status returned 0x%x\n", status); 229 xhci_dbg(xhci, "Get port status returned 0x%x\n", status);
230 put_unaligned(cpu_to_le32(status), (__le32 *) buf); 230 put_unaligned(cpu_to_le32(status), (__le32 *) buf);
231 break; 231 break;