summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorfei feng - Sun Microsystems - Beijing China <Fei.Feng@Sun.COM>2010-06-05 20:44:25 +0800
committerfei feng - Sun Microsystems - Beijing China <Fei.Feng@Sun.COM>2010-06-05 20:44:25 +0800
commit32c2ff25c28891b599f49bfaf5b5d848e79308c0 (patch)
tree822afa671bf0cf3c1de5dfc4b753075e84ee68de /usr/src/uts/common
parent5893fa693b6b67559d0bfdbcab5e1cf0307e6133 (diff)
downloadillumos-joyent-32c2ff25c28891b599f49bfaf5b5d848e79308c0.tar.gz
6955860 hotplug does not work on uhci keyboard/mouse
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c b/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c
index 74013d7aae..13cbaaa9d4 100644
--- a/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c
+++ b/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c
@@ -454,8 +454,8 @@ uhci_hcdi_pipe_reset(usba_pipe_handle_data_t *ph, usb_flags_t usb_flags)
ph->p_usba_device->usb_root_hub_dip);
uhci_pipe_private_t *pp = (uhci_pipe_private_t *)ph->p_hcd_private;
usb_ep_descr_t *eptd = &ph->p_ep;
- int i = 0;
- uint_t new_port_status = 0, old_port_status = 0;
+ usb_port_t port;
+ uint_t port_status = 0;
USB_DPRINTF_L2(PRINT_MASK_HCDI, uhcip->uhci_log_hdl,
"uhci_hcdi_pipe_reset: usb_flags = 0x%x", usb_flags);
@@ -470,20 +470,14 @@ uhci_hcdi_pipe_reset(usba_pipe_handle_data_t *ph, usb_flags_t usb_flags)
USB_DPRINTF_L2(PRINT_MASK_HCDI, uhcip->uhci_log_hdl,
"uhci_hcdi_pipe_reset: try "
"to enable disabled ports if necessary.");
- for (i = 0; i < uhcip->uhci_root_hub.rh_num_ports; i++) {
- old_port_status = Get_OpReg16(PORTSC[i]);
- if (!(old_port_status & HCR_PORT_ENABLE)) {
- Set_OpReg16(PORTSC[i],
- (old_port_status | HCR_PORT_ENABLE));
+ for (port = 0; port < uhcip->uhci_root_hub.rh_num_ports; port++) {
+ port_status = Get_OpReg16(PORTSC[port]);
+ if ((!(port_status & HCR_PORT_ENABLE)) &&
+ (port_status & HCR_PORT_CCS) &&
+ (!(port_status & HCR_PORT_CSC))) {
+ Set_OpReg16(PORTSC[port],
+ (port_status | HCR_PORT_ENABLE));
drv_usecwait(UHCI_ONE_MS * 2);
- new_port_status = Get_OpReg16(PORTSC[i]);
- /*
- * Refresh Root Hub port status
- */
- uhcip->uhci_root_hub.rh_port_status[i] =
- new_port_status;
- uhcip->uhci_root_hub.rh_port_changes[i] |=
- ((old_port_status ^ new_port_status) & 0xff);
}
}