diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-03-04 17:05:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:31 -0400 |
commit | 749da5f82fe33ff68dd4aa1a5e35cd9aa6246dab (patch) | |
tree | 2c0a7c689ab6a58f3a799ae51e41ac885e212194 /drivers/usb/host/oxu210hp-hcd.c | |
parent | 288ead45fa6637e959015d055304f521cbbc0575 (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/oxu210hp-hcd.c')
-rw-r--r-- | drivers/usb/host/oxu210hp-hcd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 8f04c0afa59f..f608dfd09a8a 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
@@ -3201,7 +3201,7 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq, | |||
3201 | * Even if OWNER is set, so the port is owned by the | 3201 | * Even if OWNER is set, so the port is owned by the |
3202 | * companion controller, khubd needs to be able to clear | 3202 | * companion controller, khubd needs to be able to clear |
3203 | * the port-change status bits (especially | 3203 | * the port-change status bits (especially |
3204 | * USB_PORT_FEAT_C_CONNECTION). | 3204 | * USB_PORT_STAT_C_CONNECTION). |
3205 | */ | 3205 | */ |
3206 | 3206 | ||
3207 | switch (wValue) { | 3207 | switch (wValue) { |
@@ -3263,11 +3263,11 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq, | |||
3263 | 3263 | ||
3264 | /* wPortChange bits */ | 3264 | /* wPortChange bits */ |
3265 | if (temp & PORT_CSC) | 3265 | if (temp & PORT_CSC) |
3266 | status |= 1 << USB_PORT_FEAT_C_CONNECTION; | 3266 | status |= USB_PORT_STAT_C_CONNECTION << 16; |
3267 | if (temp & PORT_PEC) | 3267 | if (temp & PORT_PEC) |
3268 | status |= 1 << USB_PORT_FEAT_C_ENABLE; | 3268 | status |= USB_PORT_STAT_C_ENABLE << 16; |
3269 | if ((temp & PORT_OCC) && !ignore_oc) | 3269 | if ((temp & PORT_OCC) && !ignore_oc) |
3270 | status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; | 3270 | status |= USB_PORT_STAT_C_OVERCURRENT << 16; |
3271 | 3271 | ||
3272 | /* whoever resumes must GetPortStatus to complete it!! */ | 3272 | /* whoever resumes must GetPortStatus to complete it!! */ |
3273 | if (temp & PORT_RESUME) { | 3273 | if (temp & PORT_RESUME) { |
@@ -3285,7 +3285,7 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq, | |||
3285 | /* resume completed? */ | 3285 | /* resume completed? */ |
3286 | else if (time_after_eq(jiffies, | 3286 | else if (time_after_eq(jiffies, |
3287 | oxu->reset_done[wIndex])) { | 3287 | oxu->reset_done[wIndex])) { |
3288 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; | 3288 | status |= USB_PORT_STAT_C_SUSPEND << 16; |
3289 | oxu->reset_done[wIndex] = 0; | 3289 | oxu->reset_done[wIndex] = 0; |
3290 | 3290 | ||
3291 | /* stop resume signaling */ | 3291 | /* stop resume signaling */ |
@@ -3308,7 +3308,7 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq, | |||
3308 | if ((temp & PORT_RESET) | 3308 | if ((temp & PORT_RESET) |
3309 | && time_after_eq(jiffies, | 3309 | && time_after_eq(jiffies, |
3310 | oxu->reset_done[wIndex])) { | 3310 | oxu->reset_done[wIndex])) { |
3311 | status |= 1 << USB_PORT_FEAT_C_RESET; | 3311 | status |= USB_PORT_STAT_C_RESET << 16; |
3312 | oxu->reset_done[wIndex] = 0; | 3312 | oxu->reset_done[wIndex] = 0; |
3313 | 3313 | ||
3314 | /* force reset to complete */ | 3314 | /* force reset to complete */ |
@@ -3347,20 +3347,20 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq, | |||
3347 | */ | 3347 | */ |
3348 | 3348 | ||
3349 | if (temp & PORT_CONNECT) { | 3349 | if (temp & PORT_CONNECT) { |
3350 | status |= 1 << USB_PORT_FEAT_CONNECTION; | 3350 | status |= USB_PORT_STAT_CONNECTION; |
3351 | /* status may be from integrated TT */ | 3351 | /* status may be from integrated TT */ |
3352 | status |= oxu_port_speed(oxu, temp); | 3352 | status |= oxu_port_speed(oxu, temp); |
3353 | } | 3353 | } |
3354 | if (temp & PORT_PE) | 3354 | if (temp & PORT_PE) |
3355 | status |= 1 << USB_PORT_FEAT_ENABLE; | 3355 | status |= USB_PORT_STAT_ENABLE; |
3356 | if (temp & (PORT_SUSPEND|PORT_RESUME)) | 3356 | if (temp & (PORT_SUSPEND|PORT_RESUME)) |
3357 | status |= 1 << USB_PORT_FEAT_SUSPEND; | 3357 | status |= USB_PORT_STAT_SUSPEND; |
3358 | if (temp & PORT_OC) | 3358 | if (temp & PORT_OC) |
3359 | status |= 1 << USB_PORT_FEAT_OVER_CURRENT; | 3359 | status |= USB_PORT_STAT_OVERCURRENT; |
3360 | if (temp & PORT_RESET) | 3360 | if (temp & PORT_RESET) |
3361 | status |= 1 << USB_PORT_FEAT_RESET; | 3361 | status |= USB_PORT_STAT_RESET; |
3362 | if (temp & PORT_POWER) | 3362 | if (temp & PORT_POWER) |
3363 | status |= 1 << USB_PORT_FEAT_POWER; | 3363 | status |= USB_PORT_STAT_POWER; |
3364 | 3364 | ||
3365 | #ifndef OXU_VERBOSE_DEBUG | 3365 | #ifndef OXU_VERBOSE_DEBUG |
3366 | if (status & ~0xffff) /* only if wPortChange is interesting */ | 3366 | if (status & ~0xffff) /* only if wPortChange is interesting */ |