summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorguoqing zhu - Sun Microsystems - Beijing China <Guoqing.Zhu@Sun.COM>2009-03-02 09:43:36 +0800
committerguoqing zhu - Sun Microsystems - Beijing China <Guoqing.Zhu@Sun.COM>2009-03-02 09:43:36 +0800
commit269552cd714f2f1e308fdde0fc69b18a7f1142b2 (patch)
treef0bcbfc1ed139f3ecc1bad76b833b5aa2d9fa31c /usr/src
parent4d53c7addddea6a86730beb59363b8ba12e8252e (diff)
downloadillumos-gate-269552cd714f2f1e308fdde0fc69b18a7f1142b2.tar.gz
6764185 DVD problems during OS usage (READ RETRY)
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/usb/hcd/ehci/ehci.c29
-rw-r--r--usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c4
-rw-r--r--usr/src/uts/common/io/usb/hcd/openhci/ohci.c32
-rw-r--r--usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c27
-rw-r--r--usr/src/uts/common/io/usb/hcd/uhci/uhciutil.c4
-rw-r--r--usr/src/uts/common/io/usb/usba/usbai_util.c46
-rw-r--r--usr/src/uts/common/io/warlock/ehci.wlcmd5
-rw-r--r--usr/src/uts/common/io/warlock/ohci.wlcmd7
-rw-r--r--usr/src/uts/common/io/warlock/uhci.wlcmd7
-rw-r--r--usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h4
-rw-r--r--usr/src/uts/common/sys/usb/hcd/uhci/uhciutil.h4
-rw-r--r--usr/src/uts/common/sys/usb/usba/hcdi.h8
12 files changed, 160 insertions, 17 deletions
diff --git a/usr/src/uts/common/io/usb/hcd/ehci/ehci.c b/usr/src/uts/common/io/usb/hcd/ehci/ehci.c
index b5a1bd60a6..eace16807c 100644
--- a/usr/src/uts/common/io/usb/hcd/ehci/ehci.c
+++ b/usr/src/uts/common/io/usb/hcd/ehci/ehci.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1140,6 +1140,33 @@ ehci_hcdi_pipe_reset(
}
/*
+ * ehci_hcdi_pipe_reset_data_toggle:
+ */
+void
+ehci_hcdi_pipe_reset_data_toggle(
+ usba_pipe_handle_data_t *ph)
+{
+ ehci_state_t *ehcip = ehci_obtain_state(
+ ph->p_usba_device->usb_root_hub_dip);
+ ehci_pipe_private_t *pp = (ehci_pipe_private_t *)ph->p_hcd_private;
+
+ USB_DPRINTF_L4(PRINT_MASK_HCDI, ehcip->ehci_log_hdl,
+ "ehci_hcdi_pipe_reset_data_toggle:");
+
+ mutex_enter(&ehcip->ehci_int_mutex);
+
+ mutex_enter(&ph->p_mutex);
+ usba_hcdi_set_data_toggle(ph->p_usba_device, ph->p_ep.bEndpointAddress,
+ DATA0);
+ mutex_exit(&ph->p_mutex);
+
+ Set_QH(pp->pp_qh->qh_status,
+ Get_QH(pp->pp_qh->qh_status) & (~EHCI_QH_STS_DATA_TOGGLE));
+ mutex_exit(&ehcip->ehci_int_mutex);
+
+}
+
+/*
* ehci_hcdi_pipe_ctrl_xfer:
*/
int
diff --git a/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c b/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c
index 3a0338f1a8..2df26c3820 100644
--- a/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c
+++ b/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1713,6 +1713,8 @@ ehci_alloc_hcdi_ops(ehci_state_t *ehcip)
usba_hcdi_ops->usba_hcdi_pipe_close = ehci_hcdi_pipe_close;
usba_hcdi_ops->usba_hcdi_pipe_reset = ehci_hcdi_pipe_reset;
+ usba_hcdi_ops->usba_hcdi_pipe_reset_data_toggle =
+ ehci_hcdi_pipe_reset_data_toggle;
usba_hcdi_ops->usba_hcdi_pipe_ctrl_xfer = ehci_hcdi_pipe_ctrl_xfer;
usba_hcdi_ops->usba_hcdi_pipe_bulk_xfer = ehci_hcdi_pipe_bulk_xfer;
diff --git a/usr/src/uts/common/io/usb/hcd/openhci/ohci.c b/usr/src/uts/common/io/usb/hcd/openhci/ohci.c
index adc38b78dc..f66d2e7d1b 100644
--- a/usr/src/uts/common/io/usb/hcd/openhci/ohci.c
+++ b/usr/src/uts/common/io/usb/hcd/openhci/ohci.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -92,6 +92,8 @@ static int ohci_hcdi_pipe_close(
static int ohci_hcdi_pipe_reset(
usba_pipe_handle_data_t *ph,
usb_flags_t usb_flags);
+static void ohci_hcdi_pipe_reset_data_toggle(
+ usba_pipe_handle_data_t *ph);
static int ohci_hcdi_pipe_ctrl_xfer(
usba_pipe_handle_data_t *ph,
usb_ctrl_req_t *ctrl_reqp,
@@ -2031,6 +2033,8 @@ ohci_alloc_hcdi_ops(ohci_state_t *ohcip)
usba_hcdi_ops->usba_hcdi_pipe_close = ohci_hcdi_pipe_close;
usba_hcdi_ops->usba_hcdi_pipe_reset = ohci_hcdi_pipe_reset;
+ usba_hcdi_ops->usba_hcdi_pipe_reset_data_toggle =
+ ohci_hcdi_pipe_reset_data_toggle;
usba_hcdi_ops->usba_hcdi_pipe_ctrl_xfer = ohci_hcdi_pipe_ctrl_xfer;
usba_hcdi_ops->usba_hcdi_pipe_bulk_xfer = ohci_hcdi_pipe_bulk_xfer;
@@ -2782,6 +2786,32 @@ ohci_hcdi_pipe_reset(
return (error);
}
+/*
+ * ohci_hcdi_pipe_reset_data_toggle:
+ */
+void
+ohci_hcdi_pipe_reset_data_toggle(
+ usba_pipe_handle_data_t *ph)
+{
+ ohci_state_t *ohcip = ohci_obtain_state(
+ ph->p_usba_device->usb_root_hub_dip);
+ ohci_pipe_private_t *pp = (ohci_pipe_private_t *)ph->p_hcd_private;
+
+ USB_DPRINTF_L4(PRINT_MASK_HCDI, ohcip->ohci_log_hdl,
+ "ohci_hcdi_pipe_reset_data_toggle:");
+
+ mutex_enter(&ohcip->ohci_int_mutex);
+
+ mutex_enter(&ph->p_mutex);
+ usba_hcdi_set_data_toggle(ph->p_usba_device, ph->p_ep.bEndpointAddress,
+ DATA0);
+ mutex_exit(&ph->p_mutex);
+
+ Set_ED(pp->pp_ept->hced_headp,
+ Get_ED(pp->pp_ept->hced_headp) & (~HC_EPT_Carry));
+ mutex_exit(&ohcip->ohci_int_mutex);
+
+}
/*
* ohci_hcdi_pipe_ctrl_xfer:
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 2e73fc8bfc..c7dd4ffb5c 100644
--- a/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c
+++ b/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -556,6 +556,31 @@ uhci_hcdi_pipe_reset(usba_pipe_handle_data_t *ph, usb_flags_t usb_flags)
return (USB_SUCCESS);
}
+/*
+ * uhci_hcdi_pipe_reset_data_toggle:
+ */
+void
+uhci_hcdi_pipe_reset_data_toggle(
+ usba_pipe_handle_data_t *ph)
+{
+ uhci_state_t *uhcip = uhci_obtain_state(
+ ph->p_usba_device->usb_root_hub_dip);
+ uhci_pipe_private_t *pp = (uhci_pipe_private_t *)ph->p_hcd_private;
+
+ USB_DPRINTF_L4(PRINT_MASK_HCDI, uhcip->uhci_log_hdl,
+ "uhci_hcdi_pipe_reset_data_toggle:");
+
+ mutex_enter(&uhcip->uhci_int_mutex);
+
+ mutex_enter(&ph->p_mutex);
+ pp->pp_data_toggle = 0;
+ usba_hcdi_set_data_toggle(ph->p_usba_device, ph->p_ep.bEndpointAddress,
+ pp->pp_data_toggle);
+ mutex_exit(&ph->p_mutex);
+
+ mutex_exit(&uhcip->uhci_int_mutex);
+
+}
/*
* uhci_hcdi_pipe_ctrl_xfer:
diff --git a/usr/src/uts/common/io/usb/hcd/uhci/uhciutil.c b/usr/src/uts/common/io/usb/hcd/uhci/uhciutil.c
index 6a541cf6bc..f885d2f612 100644
--- a/usr/src/uts/common/io/usb/hcd/uhci/uhciutil.c
+++ b/usr/src/uts/common/io/usb/hcd/uhci/uhciutil.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -796,6 +796,8 @@ uhci_alloc_hcdi_ops(uhci_state_t *uhcip)
hcdi_ops->usba_hcdi_pipe_open = uhci_hcdi_pipe_open;
hcdi_ops->usba_hcdi_pipe_close = uhci_hcdi_pipe_close;
hcdi_ops->usba_hcdi_pipe_reset = uhci_hcdi_pipe_reset;
+ hcdi_ops->usba_hcdi_pipe_reset_data_toggle =
+ uhci_hcdi_pipe_reset_data_toggle;
hcdi_ops->usba_hcdi_pipe_ctrl_xfer = uhci_hcdi_pipe_ctrl_xfer;
hcdi_ops->usba_hcdi_pipe_bulk_xfer = uhci_hcdi_pipe_bulk_xfer;
diff --git a/usr/src/uts/common/io/usb/usba/usbai_util.c b/usr/src/uts/common/io/usb/usba/usbai_util.c
index 46545a19f3..17711e0d7b 100644
--- a/usr/src/uts/common/io/usb/usba/usbai_util.c
+++ b/usr/src/uts/common/io/usb/usba/usbai_util.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1597,6 +1597,12 @@ usba_sync_clear_feature(dev_info_t *dip,
uint_t feature = ((uint_t)n >> 8) & 0xff;
uint_t what = (uint_t)n & 0xff;
int rval;
+ usba_device_t *usba_device;
+ usba_pipe_handle_data_t *ph_data;
+ usba_ph_impl_t *ph_im;
+ uchar_t ep_index;
+ usb_ep_descr_t *eptd;
+
USB_DPRINTF_L4(DPRINT_MASK_USBA, usbai_log_handle,
"usb_sync_clear_feature: "
@@ -1606,6 +1612,44 @@ usba_sync_clear_feature(dev_info_t *dip,
rval = usb_clear_feature(dip, (usb_pipe_handle_t)ph_impl, type,
feature, what, usb_flags);
+ /*
+ * Reset data toggle to DATA0 for bulk and interrupt endpoint.
+ * Data toggle synchronization is not supported for isochronous
+ * transfer.Halt feature is not supported by control endpoint.
+ *
+ * From USB2.0 specification:
+ * 1.Section 5.8.5 Bulk Transfer Data Sequences
+ * Removal of the halt condition is achieved via software intervention
+ * through a separate control pipe. This recovery will reset the data
+ * toggle bit to DATA0 for the endpoint on both the host and the device.
+ *
+ * 2.Section 5.7.5 Interrupt Transfer Data Sequences
+ * Removal of the halt condition is achieved via software intervention
+ * through a separate control pipe. This recovery will reset the data
+ * toggle bit to DATA0 for the endpoint on both the host and the device.
+ *
+ * 3.Section 9.4.5
+ * If the condition causing a halt has been removed, clearing the Halt
+ * feature via a ClearFeature(ENDPOINT_HALT) request results in the
+ * endpoint no longer returning a STALL. For endpoints using data
+ * toggle, regardless of whether an endpoint has the Halt feature set, a
+ * ClearFeature(ENDPOINT_HALT) request always results in the data toggle
+ * being reinitialized to DATA0.
+ *
+ */
+ if (rval == USB_SUCCESS && feature == 0) {
+ usba_device = usba_get_usba_device(dip);
+ ep_index = usb_get_ep_index((uint8_t)what);
+ ph_im = &usba_device->usb_ph_list[ep_index];
+ ph_data = usba_get_ph_data((usb_pipe_handle_t)ph_im);
+ eptd = &ph_data->p_ep;
+ if ((eptd->bmAttributes & USB_EP_ATTR_MASK) ==
+ USB_EP_ATTR_BULK || (eptd->bmAttributes &
+ USB_EP_ATTR_MASK) == USB_EP_ATTR_INTR)
+ usba_device->usb_hcdi_ops->
+ usba_hcdi_pipe_reset_data_toggle(ph_data);
+ }
+
usba_release_ph_data(ph_impl);
return (rval);
diff --git a/usr/src/uts/common/io/warlock/ehci.wlcmd b/usr/src/uts/common/io/warlock/ehci.wlcmd
index 8db85909b3..44a82c1047 100644
--- a/usr/src/uts/common/io/warlock/ehci.wlcmd
+++ b/usr/src/uts/common/io/warlock/ehci.wlcmd
@@ -19,11 +19,10 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
one ehci_state
one usba_device
@@ -47,6 +46,8 @@ root ehci_hcdi_pipe_bulk_xfer
root ehci_hcdi_pipe_intr_xfer
root ehci_hcdi_pipe_isoc_xfer
root ehci_hcdi_pm_support
+root ehci_hcdi_pipe_reset_data_toggle
+root ehci_quiesce
root hubd_hotplug_thread
root hubd_exception_cb
diff --git a/usr/src/uts/common/io/warlock/ohci.wlcmd b/usr/src/uts/common/io/warlock/ohci.wlcmd
index edd67a4dec..417fa8fc77 100644
--- a/usr/src/uts/common/io/warlock/ohci.wlcmd
+++ b/usr/src/uts/common/io/warlock/ohci.wlcmd
@@ -19,11 +19,10 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
one ohci_state
one usba_device
@@ -37,7 +36,8 @@ root ohci_hcdi_pipe_open
root ohci_hcdi_pipe_close
root ohci_hcdi_pipe_stop_intr_polling
root ohci_hcdi_pipe_stop_isoc_polling
-root ohci_hcdi_pipe_reset
+root ohci_hcdi_pipe_reset
+root ohci_hcdi_pipe_reset_data_toggle
root ohci_hcdi_bulk_transfer_size
root ohci_hcdi_get_current_frame_number
root ohci_hcdi_get_max_isoc_pkts
@@ -47,6 +47,7 @@ root ohci_hcdi_pipe_bulk_xfer
root ohci_hcdi_pipe_intr_xfer
root ohci_hcdi_pipe_isoc_xfer
root ohci_hcdi_pm_support
+root ohci_quiesce
root hubd_hotplug_thread
root hubd_exception_cb
diff --git a/usr/src/uts/common/io/warlock/uhci.wlcmd b/usr/src/uts/common/io/warlock/uhci.wlcmd
index ece559e66a..c8c03f24e9 100644
--- a/usr/src/uts/common/io/warlock/uhci.wlcmd
+++ b/usr/src/uts/common/io/warlock/uhci.wlcmd
@@ -1,5 +1,5 @@
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
@@ -21,7 +21,6 @@
#
# CDDL HEADER END
#
-#ident "%Z%%M% %I% %E% SMI"
one uhci_state
one usba_device
@@ -35,7 +34,8 @@ root uhci_hcdi_pipe_open
root uhci_hcdi_pipe_close
root uhci_hcdi_pipe_stop_intr_polling
root uhci_hcdi_pipe_stop_isoc_polling
-root uhci_hcdi_pipe_reset
+root uhci_hcdi_pipe_reset
+root uhci_hcdi_pipe_reset_data_toggle
root uhci_hcdi_bulk_transfer_size
root uhci_hcdi_get_current_frame_number
root uhci_hcdi_get_max_isoc_pkts
@@ -44,6 +44,7 @@ root uhci_hcdi_pipe_ctrl_xfer
root uhci_hcdi_pipe_bulk_xfer
root uhci_hcdi_pipe_intr_xfer
root uhci_hcdi_pipe_isoc_xfer
+root uhci_quiesce
root hubd_hotplug_thread
root hubd_exception_cb
diff --git a/usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h b/usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h
index 7790482632..8313edea3a 100644
--- a/usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h
+++ b/usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1101,6 +1101,8 @@ int ehci_hcdi_pipe_close(
int ehci_hcdi_pipe_reset(
usba_pipe_handle_data_t *ph,
usb_flags_t usb_flags);
+void ehci_hcdi_pipe_reset_data_toggle(
+ usba_pipe_handle_data_t *ph);
int ehci_hcdi_pipe_ctrl_xfer(
usba_pipe_handle_data_t *ph,
usb_ctrl_req_t *ctrl_reqp,
diff --git a/usr/src/uts/common/sys/usb/hcd/uhci/uhciutil.h b/usr/src/uts/common/sys/usb/hcd/uhci/uhciutil.h
index 42fa2121af..fdba393c8e 100644
--- a/usr/src/uts/common/sys/usb/hcd/uhci/uhciutil.h
+++ b/usr/src/uts/common/sys/usb/hcd/uhci/uhciutil.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -44,6 +44,8 @@ int uhci_hcdi_pipe_close(usba_pipe_handle_data_t *pipe_handle,
usb_flags_t flags);
int uhci_hcdi_pipe_reset(usba_pipe_handle_data_t *pipe_handle,
usb_flags_t usb_flags);
+void uhci_hcdi_pipe_reset_data_toggle(
+ usba_pipe_handle_data_t *pipe_handle);
int uhci_hcdi_pipe_ctrl_xfer(usba_pipe_handle_data_t *,
usb_ctrl_req_t *, usb_flags_t);
int uhci_hcdi_pipe_bulk_xfer(usba_pipe_handle_data_t *,
diff --git a/usr/src/uts/common/sys/usb/usba/hcdi.h b/usr/src/uts/common/sys/usb/usba/hcdi.h
index 6d5cae632f..f9c645e6fb 100644
--- a/usr/src/uts/common/sys/usb/usba/hcdi.h
+++ b/usr/src/uts/common/sys/usb/usba/hcdi.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -85,6 +85,12 @@ typedef struct usba_hcdi_ops {
usb_flags_t usb_flags);
/*
+ * pipe management
+ */
+ void (*usba_hcdi_pipe_reset_data_toggle)(
+ usba_pipe_handle_data_t *pipe_handle);
+
+ /*
* data transfer management
*/
int (*usba_hcdi_pipe_ctrl_xfer)(