diff options
author | fei feng - Sun Microsystems - Beijing China <Fei.Feng@Sun.COM> | 2010-06-05 20:44:25 +0800 |
---|---|---|
committer | fei feng - Sun Microsystems - Beijing China <Fei.Feng@Sun.COM> | 2010-06-05 20:44:25 +0800 |
commit | 32c2ff25c28891b599f49bfaf5b5d848e79308c0 (patch) | |
tree | 822afa671bf0cf3c1de5dfc4b753075e84ee68de | |
parent | 5893fa693b6b67559d0bfdbcab5e1cf0307e6133 (diff) | |
download | illumos-gate-32c2ff25c28891b599f49bfaf5b5d848e79308c0.tar.gz |
6955860 hotplug does not work on uhci keyboard/mouse
-rw-r--r-- | usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c | 24 |
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); } } |