aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-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/ehci-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/ehci-hub.c')
-rw-r--r--drivers/usb/host/ehci-hub.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index c7178bcde67a..c44018109a13 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -659,7 +659,7 @@ static int ehci_hub_control (
659 * Even if OWNER is set, so the port is owned by the 659 * Even if OWNER is set, so the port is owned by the
660 * companion controller, khubd needs to be able to clear 660 * companion controller, khubd needs to be able to clear
661 * the port-change status bits (especially 661 * the port-change status bits (especially
662 * USB_PORT_FEAT_C_CONNECTION). 662 * USB_PORT_STAT_C_CONNECTION).
663 */ 663 */
664 664
665 switch (wValue) { 665 switch (wValue) {
@@ -729,12 +729,12 @@ static int ehci_hub_control (
729 729
730 // wPortChange bits 730 // wPortChange bits
731 if (temp & PORT_CSC) 731 if (temp & PORT_CSC)
732 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 732 status |= USB_PORT_STAT_C_CONNECTION << 16;
733 if (temp & PORT_PEC) 733 if (temp & PORT_PEC)
734 status |= 1 << USB_PORT_FEAT_C_ENABLE; 734 status |= USB_PORT_STAT_C_ENABLE << 16;
735 735
736 if ((temp & PORT_OCC) && !ignore_oc){ 736 if ((temp & PORT_OCC) && !ignore_oc){
737 status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; 737 status |= USB_PORT_STAT_C_OVERCURRENT << 16;
738 738
739 /* 739 /*
740 * Hubs should disable port power on over-current. 740 * Hubs should disable port power on over-current.
@@ -791,7 +791,7 @@ static int ehci_hub_control (
791 if ((temp & PORT_RESET) 791 if ((temp & PORT_RESET)
792 && time_after_eq(jiffies, 792 && time_after_eq(jiffies,
793 ehci->reset_done[wIndex])) { 793 ehci->reset_done[wIndex])) {
794 status |= 1 << USB_PORT_FEAT_C_RESET; 794 status |= USB_PORT_STAT_C_RESET << 16;
795 ehci->reset_done [wIndex] = 0; 795 ehci->reset_done [wIndex] = 0;
796 796
797 /* force reset to complete */ 797 /* force reset to complete */
@@ -833,7 +833,7 @@ static int ehci_hub_control (
833 */ 833 */
834 834
835 if (temp & PORT_CONNECT) { 835 if (temp & PORT_CONNECT) {
836 status |= 1 << USB_PORT_FEAT_CONNECTION; 836 status |= USB_PORT_STAT_CONNECTION;
837 // status may be from integrated TT 837 // status may be from integrated TT
838 if (ehci->has_hostpc) { 838 if (ehci->has_hostpc) {
839 temp1 = ehci_readl(ehci, hostpc_reg); 839 temp1 = ehci_readl(ehci, hostpc_reg);
@@ -842,11 +842,11 @@ static int ehci_hub_control (
842 status |= ehci_port_speed(ehci, temp); 842 status |= ehci_port_speed(ehci, temp);
843 } 843 }
844 if (temp & PORT_PE) 844 if (temp & PORT_PE)
845 status |= 1 << USB_PORT_FEAT_ENABLE; 845 status |= USB_PORT_STAT_ENABLE;
846 846
847 /* maybe the port was unsuspended without our knowledge */ 847 /* maybe the port was unsuspended without our knowledge */
848 if (temp & (PORT_SUSPEND|PORT_RESUME)) { 848 if (temp & (PORT_SUSPEND|PORT_RESUME)) {
849 status |= 1 << USB_PORT_FEAT_SUSPEND; 849 status |= USB_PORT_STAT_SUSPEND;
850 } else if (test_bit(wIndex, &ehci->suspended_ports)) { 850 } else if (test_bit(wIndex, &ehci->suspended_ports)) {
851 clear_bit(wIndex, &ehci->suspended_ports); 851 clear_bit(wIndex, &ehci->suspended_ports);
852 ehci->reset_done[wIndex] = 0; 852 ehci->reset_done[wIndex] = 0;
@@ -855,13 +855,13 @@ static int ehci_hub_control (
855 } 855 }
856 856
857 if (temp & PORT_OC) 857 if (temp & PORT_OC)
858 status |= 1 << USB_PORT_FEAT_OVER_CURRENT; 858 status |= USB_PORT_STAT_OVERCURRENT;
859 if (temp & PORT_RESET) 859 if (temp & PORT_RESET)
860 status |= 1 << USB_PORT_FEAT_RESET; 860 status |= USB_PORT_STAT_RESET;
861 if (temp & PORT_POWER) 861 if (temp & PORT_POWER)
862 status |= 1 << USB_PORT_FEAT_POWER; 862 status |= USB_PORT_STAT_POWER;
863 if (test_bit(wIndex, &ehci->port_c_suspend)) 863 if (test_bit(wIndex, &ehci->port_c_suspend))
864 status |= 1 << USB_PORT_FEAT_C_SUSPEND; 864 status |= USB_PORT_STAT_C_SUSPEND << 16;
865 865
866#ifndef VERBOSE_DEBUG 866#ifndef VERBOSE_DEBUG
867 if (status & ~0xffff) /* only if wPortChange is interesting */ 867 if (status & ~0xffff) /* only if wPortChange is interesting */