Mercurial > illumos > illumos-gate
changeset 880:0f8e93fcf632
Contributed by Juergen Keil jk@tools.de.
6337131 ehci_detach panics debug kernel with a failed assertion with ALi USB2.0 PCI card
line wrap: on
line diff
--- a/usr/src/cmd/mdb/common/modules/usba/usb.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/cmd/mdb/common/modules/usba/usb.c Thu Nov 10 11:17:25 2005 -0800 @@ -146,7 +146,7 @@ cb_data.u2d_dip_addr = dip_addr; cb_data.u2d_found = FALSE; - if (mdb_vread((void *)&usb_dev, sizeof (usba_device_t), + if (mdb_vread(&usb_dev, sizeof (usba_device_t), usb_dev_addr) == -1) { mdb_warn("failed to read usba_device struct"); @@ -159,7 +159,7 @@ * find_dip does). * Result is placed in cb_data.dip_addr. */ - if (mdb_pwalk("devinfo_children", find_dip, (void *)&cb_data, + if (mdb_pwalk("devinfo_children", find_dip, &cb_data, (uintptr_t)usb_dev.usb_root_hub_dip) != 0) { mdb_warn("failed to walk devinfo_children"); @@ -251,7 +251,7 @@ * Read the usb_ph_list array into local memory. * Set start address to first element/endpoint in usb_pipehandle_list */ - if (mdb_vread((void *)wsp->walk_data, + if (mdb_vread(wsp->walk_data, (sizeof (usba_ph_impl_t)) * USBA_N_ENDPOINTS, (uintptr_t)((size_t)(wsp->walk_addr) + offsetof(usba_device_t, usb_ph_list))) == -1) { @@ -411,7 +411,7 @@ return (WALK_ERR); } - if (mdb_readvar((void*)&list_entry, "usba_device_list") == -1) { + if (mdb_readvar(&list_entry, "usba_device_list") == -1) { mdb_warn("failed to read usba_device_list"); return (WALK_ERR); @@ -493,7 +493,7 @@ /* Figure out what driver (name) is attached to this node. */ (void) mdb_devinfo2driver(dip_addr, (char *)dname, sizeof (dname)); - if (mdb_vread((void *)&devinfo, sizeof (struct dev_info), + if (mdb_vread(&devinfo, sizeof (struct dev_info), dip_addr) == -1) { mdb_warn("failed to read devinfo"); @@ -516,7 +516,7 @@ usb_dev_descr_t usb_dev_descr; usba_device_t usba_device_struct; - if (mdb_vread((void *)&usba_device_struct, + if (mdb_vread(&usba_device_struct, sizeof (usba_device_t), addr) == -1) { mdb_warn("failed to read usba_device struct"); @@ -676,7 +676,7 @@ return (DCMD_USAGE); } - if (mdb_readvar((void*)&being_cleared, "usba_clear_debug_buf_flag") == + if (mdb_readvar(&being_cleared, "usba_clear_debug_buf_flag") == -1) { mdb_warn("failed to read usba_clear_debug_buf_flag"); @@ -687,7 +687,7 @@ return (DCMD_OK); } - if (mdb_readvar((void*)&debug_buf_addr, "usba_debug_buf") == -1) { + if (mdb_readvar(&debug_buf_addr, "usba_debug_buf") == -1) { mdb_warn("failed to read usba_debug_buf"); return (DCMD_ERR); @@ -700,7 +700,7 @@ } - if (mdb_readvar((void*)&debug_buf_size, "usba_debug_buf_size") == -1) { + if (mdb_readvar(&debug_buf_size, "usba_debug_buf_size") == -1) { mdb_warn("failed to read usba_debug_buf_size"); return (DCMD_ERR); @@ -709,7 +709,7 @@ debug_buf_size += USB_DEBUG_SIZE_EXTRA_ALLOC; local_debug_buf = (char *)mdb_alloc(debug_buf_size, UM_SLEEP | UM_GC); - if ((int)(mdb_vread(local_debug_buf, debug_buf_size, + if ((mdb_vread(local_debug_buf, debug_buf_size, (uintptr_t)debug_buf_addr)) == -1) { mdb_warn("failed to read usba_debug_buf at %p", local_debug_buf);
--- a/usr/src/cmd/volmgt/etc/svc-volfs Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/cmd/volmgt/etc/svc-volfs Thu Nov 10 11:17:25 2005 -0800 @@ -47,11 +47,6 @@ config_file=/etc/vold.conf -if [ `/sbin/zonename` != "global" ]; then - echo "vold can only run in the global zone" - exit $SMF_EXIT_ERR_FATAL -fi - val=`svcprop -c -p vold/config_file $FMRI` [ -n "$val" ] && [ "$val" != '""' ] && config_file="$val" @@ -62,11 +57,23 @@ case "$1" in 'start') + # volume management is not supported in a local zone + if [ `/sbin/zonename` != "global" ] ; then + /usr/sbin/svcadm disable -t svc:/system/filesystem/volfs + echo "Volume management is not supported in a local zone" + sleep 5 & + exit $SMF_EXIT_OK + fi + if [ ! -x /usr/sbin/vold ]; then echo "/usr/sbin/vold is not executable" exit $SMF_EXIT_ERR_CONFIG fi + if [ ! -f /dev/volctl ]; then + devfsadm -i vol + fi + args="$args `getpropstring -d vold/root_dir`" args="$args `getpropstring -l vold/log_file`"
--- a/usr/src/pkgdefs/SUNWvolr/preinstall Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/pkgdefs/SUNWvolr/preinstall Thu Nov 10 11:17:25 2005 -0800 @@ -37,7 +37,7 @@ # If this is an upgrade and volfs service was already present we should # not change the state (the user may have disabled volfs service) -if pkginfo SUNWvolr >/dev/null 2>&1; then +if [ "$UPDATE" = yes ]; then if [ -f $BASEDIR/etc/rc3.d/S81volmgt ]; then touch $BASEDIR/var/volfs.tmp fi
--- a/usr/src/uts/common/io/scsi/targets/sd.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/scsi/targets/sd.c Thu Nov 10 11:17:25 2005 -0800 @@ -67,10 +67,10 @@ * Loadable module info. */ #if (defined(__fibre)) -#define SD_MODULE_NAME "SCSI SSA/FCAL Disk Driver 1.471" +#define SD_MODULE_NAME "SCSI SSA/FCAL Disk Driver %I%" char _depends_on[] = "misc/scsi drv/fcp"; #else -#define SD_MODULE_NAME "SCSI Disk Driver 1.471" +#define SD_MODULE_NAME "SCSI Disk Driver %I%" char _depends_on[] = "misc/scsi"; #endif @@ -24112,7 +24112,6 @@ if (resultp->pkt->pkt_reason == CMD_DEV_GONE) { un->un_mediastate = DKIO_DEV_GONE; - printf("sd_media_watch_cb: dev gone\n"); cv_broadcast(&un->un_state_cv); mutex_exit(SD_MUTEX(un));
--- a/usr/src/uts/common/io/usb/clients/audio/usb_ac/usb_ac.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/audio/usb_ac/usb_ac.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -83,16 +83,16 @@ #include <sys/usb/clients/audio/usb_ac/usb_ac.h> /* debug support */ -static uint_t usb_ac_errlevel = USB_LOG_L4; -static uint_t usb_ac_errmask = (uint_t)-1; -static uint_t usb_ac_instance_debug = (uint_t)-1; +uint_t usb_ac_errlevel = USB_LOG_L4; +uint_t usb_ac_errmask = (uint_t)-1; +uint_t usb_ac_instance_debug = (uint_t)-1; #ifdef DEBUG /* * tunable timeout for usb_as response, allow at least 3 secs for control * cmd to timeout */ -static int usb_ac_wait_timeout = 4000000; +int usb_ac_wait_timeout = 4000000; #endif /*
--- a/usr/src/uts/common/io/usb/clients/audio/usb_ah/usb_ah.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/audio/usb_ah/usb_ah.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -62,9 +62,9 @@ #include <sys/usb/clients/audio/usb_ah/usb_ah.h> /* debugging information */ -static uint_t usb_ah_errmask = (uint_t)PRINT_MASK_ALL; -static uint_t usb_ah_errlevel = USB_LOG_L4; -static usb_log_handle_t usb_ah_log_handle; +uint_t usb_ah_errmask = (uint_t)PRINT_MASK_ALL; +uint_t usb_ah_errlevel = USB_LOG_L4; +static usb_log_handle_t usb_ah_log_handle; /* * Internal Function Prototypes
--- a/usr/src/uts/common/io/usb/clients/audio/usb_as/usb_as.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/audio/usb_as/usb_as.c Thu Nov 10 11:17:25 2005 -0800 @@ -84,9 +84,9 @@ #include <sys/usb/clients/audio/usb_as/usb_as.h> /* debug support */ -static uint_t usb_as_errlevel = USB_LOG_L4; -static uint_t usb_as_errmask = (uint_t)-1; -static uint_t usb_as_instance_debug = (uint_t)-1; +uint_t usb_as_errlevel = USB_LOG_L4; +uint_t usb_as_errmask = (uint_t)-1; +uint_t usb_as_instance_debug = (uint_t)-1; /* * Module linkage routines for the kernel @@ -1517,7 +1517,7 @@ } } - USB_DPRINTF_L2(PRINT_MASK_ALL, uasp->usb_as_log_handle, + USB_DPRINTF_L4(PRINT_MASK_ALL, uasp->usb_as_log_handle, "usb_as_play_isoc_data: SEND CNT=%d, RCV COUNT=%d", uasp->usb_as_send_debug_count, uasp->usb_as_rcv_debug_count); @@ -1572,7 +1572,7 @@ uasp->usb_as_rcv_debug_count++; usb_as_continue_play(uasp); - USB_DPRINTF_L2(PRINT_MASK_CB, uasp->usb_as_log_handle, + USB_DPRINTF_L4(PRINT_MASK_CB, uasp->usb_as_log_handle, "usb_as_play_cb: SEND CNT=%d, RCV COUNT=%d", uasp->usb_as_send_debug_count, uasp->usb_as_rcv_debug_count); @@ -2695,7 +2695,7 @@ cs_ep->bDescriptorSubType, cs_ep->bmAttributes, cs_ep->bLockDelayUnits, - cs_ep->bLockDelay); + cs_ep->wLockDelay); uasp->usb_as_alts[alternate].alt_cs_ep = cs_ep;
--- a/usr/src/uts/common/io/usb/clients/hid/hid.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/hid/hid.c Thu Nov 10 11:17:25 2005 -0800 @@ -63,9 +63,9 @@ extern int consconfig_unlink(major_t major, minor_t minor); /* Debugging support */ -static uint_t hid_errmask = (uint_t)PRINT_MASK_ALL; -static uint_t hid_errlevel = USB_LOG_L4; -static uint_t hid_instance_debug = (uint_t)-1; +uint_t hid_errmask = (uint_t)PRINT_MASK_ALL; +uint_t hid_errlevel = USB_LOG_L4; +uint_t hid_instance_debug = (uint_t)-1; /* tunables */ int hid_default_pipe_drain_timeout = HID_DEFAULT_PIPE_DRAIN_TIMEOUT; @@ -2508,17 +2508,25 @@ ddi_get_instance(dip)); if (strcmp(ddi_node_name(dip), "mouse") == 0) { + /* check for overrides first */ + if (hid_pm_mouse || + (ddi_prop_exists(DDI_DEV_T_ANY, dip, + (DDI_PROP_DONTPASS | DDI_PROP_NOTPROM), + "hid-mouse-pm-enable") == 1)) { + + return (USB_SUCCESS); + } + /* - * Always enable PM for new SUN mouse + * Always enable PM for 1.05 or greater SUN mouse * hidp->hid_dev_descr won't be NULL. */ - if (hid_pm_mouse || - ((hidp->hid_dev_descr->idVendor == + if ((hidp->hid_dev_descr->idVendor == HID_SUN_MOUSE_VENDOR_ID) && (hidp->hid_dev_descr->idProduct == HID_SUN_MOUSE_PROD_ID) && (hidp->hid_dev_descr->bcdDevice >= - HID_SUN_MOUSE_BCDDEVICE))) { + HID_SUN_MOUSE_BCDDEVICE)) { return (USB_SUCCESS); }
--- a/usr/src/uts/common/io/usb/clients/hidparser/hidparser.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/hidparser/hidparser.c Thu Nov 10 11:17:25 2005 -0800 @@ -38,8 +38,8 @@ * in HID devices. */ -static uint_t hparser_errmask = (uint_t)PRINT_MASK_ALL; -static uint_t hparser_errlevel = (uint_t)USB_LOG_L1; +uint_t hparser_errmask = (uint_t)PRINT_MASK_ALL; +uint_t hparser_errlevel = (uint_t)USB_LOG_L1; static usb_log_handle_t hparser_log_handle; /*
--- a/usr/src/uts/common/io/usb/clients/printer/usbprn.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/printer/usbprn.c Thu Nov 10 11:17:25 2005 -0800 @@ -63,9 +63,9 @@ #include <sys/usb/clients/printer/usbprn.h> /* Debugging support */ -static uint_t usbprn_errmask = (uint_t)PRINT_MASK_ALL; -static uint_t usbprn_errlevel = USB_LOG_L4; -static uint_t usbprn_instance_debug = (uint_t)-1; +uint_t usbprn_errmask = (uint_t)PRINT_MASK_ALL; +uint_t usbprn_errlevel = USB_LOG_L4; +uint_t usbprn_instance_debug = (uint_t)-1; /* local variables */ static uint_t usbprn_ifcap =
--- a/usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c Thu Nov 10 11:17:25 2005 -0800 @@ -51,8 +51,8 @@ #include <sys/policy.h> /* debugging information */ -static uint_t usbkbm_errmask = (uint_t)PRINT_MASK_ALL; -static uint_t usbkbm_errlevel = USB_LOG_L2; +uint_t usbkbm_errmask = (uint_t)PRINT_MASK_ALL; +uint_t usbkbm_errlevel = USB_LOG_L2; static usb_log_handle_t usbkbm_log_handle; typedef void (*process_key_callback_t)(usbkbm_state_t *, int, enum keystate);
--- a/usr/src/uts/common/io/usb/clients/usbms/usbms.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/usbms/usbms.c Thu Nov 10 11:17:25 2005 -0800 @@ -44,8 +44,8 @@ #include <sys/usb/clients/usbms/usbms.h> /* debugging information */ -static uint_t usbms_errmask = (uint_t)PRINT_MASK_ALL; -static uint_t usbms_errlevel = USB_LOG_L2; +uint_t usbms_errmask = (uint_t)PRINT_MASK_ALL; +uint_t usbms_errlevel = USB_LOG_L2; static usb_log_handle_t usbms_log_handle; static struct streamtab usbms_streamtab;
--- a/usr/src/uts/common/io/usb/clients/usbser/usbser.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/usbser/usbser.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -145,9 +145,9 @@ }; /* debug support */ -static uint_t usbser_errlevel = USB_LOG_L4; -static uint_t usbser_errmask = DPRINT_MASK_ALL; -static uint_t usbser_instance_debug = (uint_t)-1; +uint_t usbser_errlevel = USB_LOG_L4; +uint_t usbser_errmask = DPRINT_MASK_ALL; +uint_t usbser_instance_debug = (uint_t)-1; /* various statistics. TODO: replace with kstats */ static int usbser_st_tx_data_loss = 0;
--- a/usr/src/uts/common/io/usb/clients/usbskel/usbskel.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/clients/usbskel/usbskel.c Thu Nov 10 11:17:25 2005 -0800 @@ -88,7 +88,7 @@ #include <sys/usb/usba.h> #include <sys/usb/clients/usbskel/usbskel.h> -static int usbskel_errlevel = USBSKEL_LOG_LOG; +int usbskel_errlevel = USBSKEL_LOG_LOG; static char *name = "usbskl"; /* Driver name, used all over. */ /*
--- a/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c Thu Nov 10 11:17:25 2005 -0800 @@ -274,6 +274,30 @@ uint8_t addr); /* + * check if this ehci controller can support PM + */ +int +ehci_hcdi_pm_support(dev_info_t *dip) +{ + ehci_state_t *ehcip = ddi_get_soft_state(ehci_statep, + ddi_get_instance(dip)); + + if (((ehcip->ehci_vendor_id == PCI_VENDOR_NEC_COMBO) && + (ehcip->ehci_device_id == PCI_DEVICE_NEC_COMBO)) || + + ((ehcip->ehci_vendor_id == PCI_VENDOR_ULi_M1575) && + (ehcip->ehci_device_id == PCI_DEVICE_ULi_M1575)) || + + (ehcip->ehci_vendor_id == PCI_VENDOR_VIA)) { + + return (USB_SUCCESS); + } + + return (USB_FAILURE); +} + + +/* * Host Controller Driver (HCD) initialization functions */ @@ -631,11 +655,11 @@ * Make sure that the interrupt pin is connected to the * interrupt controller on x86. Interrupt line 255 means * "unknown" or "not connected" (PCI spec 6.2.4, footnote 43). - * If we return failure when interrupt line equals 255, then + * If we would return failure when interrupt line equals 255, then * high speed devices will be routed to companion host controllers. - * Actually it is not necessary to return failure here, and - * o/uhci codes don't check the interrupt line too. - * But it's good to print message here for debug. + * However, it is not necessary to return failure here, and + * o/uhci codes don't check the interrupt line either. + * But it's good to log a message here for debug purposes. */ iline = pci_config_get8(ehcip->ehci_config_handle, PCI_CONF_ILINE); @@ -964,7 +988,7 @@ * VIA chips have some issues and may not work reliably. * Revisions >= 0x80 are part of a southbridge and appear * to be reliable with the workaround. - * For revisions < 0x80, if we were bound using class + * For revisions < 0x80, if we were bound using class * complain, else proceed. This will allow the user to * bind ehci specifically to this chip and not have the * warnings @@ -1415,6 +1439,7 @@ usba_hcdi_ops->usba_hcdi_ops_version = HCDI_OPS_VERSION; + usba_hcdi_ops->usba_hcdi_pm_support = ehci_hcdi_pm_support; usba_hcdi_ops->usba_hcdi_pipe_open = ehci_hcdi_pipe_open; usba_hcdi_ops->usba_hcdi_pipe_close = ehci_hcdi_pipe_close; @@ -1489,9 +1514,6 @@ mutex_enter(&ehcip->ehci_int_mutex); - /* Route all Root hub ports to Classic host controller */ - Set_OpReg(ehci_config_flag, EHCI_CONFIG_FLAG_CLASSIC); - /* Disable all EHCI QH list processing */ Set_OpReg(ehci_command, (Get_OpReg(ehci_command) & ~(EHCI_CMD_ASYNC_SCHED_ENABLE | @@ -1503,6 +1525,9 @@ /* wait for the next SOF */ (void) ehci_wait_for_sof(ehcip); + /* Route all Root hub ports to Classic host controller */ + Set_OpReg(ehci_config_flag, EHCI_CONFIG_FLAG_CLASSIC); + /* Stop the EHCI host controller */ Set_OpReg(ehci_command, Get_OpReg(ehci_command) & ~EHCI_CMD_HOST_CTRL_RUN);
--- a/usr/src/uts/common/io/usb/hcd/openhci/ohci.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/hcd/openhci/ohci.c Thu Nov 10 11:17:25 2005 -0800 @@ -50,8 +50,8 @@ #define OHCI_INSTS 1 /* Adjustable variables for the size of the pools */ -static int ohci_ed_pool_size = OHCI_ED_POOL_SIZE; -static int ohci_td_pool_size = OHCI_TD_POOL_SIZE; +int ohci_ed_pool_size = OHCI_ED_POOL_SIZE; +int ohci_td_pool_size = OHCI_TD_POOL_SIZE; /* * Initialize the values which are used for setting up head pointers for @@ -1752,6 +1752,16 @@ return (DDI_SUCCESS); } +/* + * ohci_pm_support: + * always return success since PM has been quite reliable on ohci + */ +/*ARGSUSED*/ +int +ohci_hcdi_pm_support(dev_info_t *dip) +{ + return (USB_SUCCESS); +} /* * ohci_alloc_hcdi_ops: @@ -1773,6 +1783,7 @@ usba_hcdi_ops->usba_hcdi_ops_version = HCDI_OPS_VERSION; + usba_hcdi_ops->usba_hcdi_pm_support = ohci_hcdi_pm_support; usba_hcdi_ops->usba_hcdi_pipe_open = ohci_hcdi_pipe_open; usba_hcdi_ops->usba_hcdi_pipe_close = ohci_hcdi_pipe_close;
--- a/usr/src/uts/common/io/usb/hcd/uhci/uhci.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/hcd/uhci/uhci.c Thu Nov 10 11:17:25 2005 -0800 @@ -98,9 +98,9 @@ * Globals */ void *uhci_statep; -static uint_t uhci_errlevel = USB_LOG_L2; -static uint_t uhci_errmask = PRINT_MASK_ALL; -static uint_t uhci_instance_debug = (uint_t)-1; +uint_t uhci_errlevel = USB_LOG_L2; +uint_t uhci_errmask = PRINT_MASK_ALL; +uint_t uhci_instance_debug = (uint_t)-1; uint_t uhci_td_pool_size = 256; /* Num TDs */ uint_t uhci_qh_pool_size = 130; /* Num QHs */ @@ -110,7 +110,7 @@ /* * tunable, delay during attach in seconds */ -static int uhci_attach_wait = 1; +int uhci_attach_wait = 1; /* function prototypes */ static void uhci_handle_intr_td_errors(uhci_state_t *uhcip, uhci_td_t *td,
--- a/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/hcd/uhci/uhcitgt.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -58,7 +58,7 @@ /* Maximum bulk transfer size */ -static int uhci_bulk_transfer_size = UHCI_BULK_MAX_XFER_SIZE; +int uhci_bulk_transfer_size = UHCI_BULK_MAX_XFER_SIZE; /* * uhci_hcdi_pipe_open:
--- a/usr/src/uts/common/io/usb/scsa2usb/scsa2usb.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/scsa2usb/scsa2usb.c Thu Nov 10 11:17:25 2005 -0800 @@ -376,11 +376,11 @@ static boolean_t scsa2usb_sync_message = B_TRUE; /* for syncing */ /* for debug messages */ -static uint_t scsa2usb_errmask = (uint_t)DPRINT_MASK_ALL; -static uint_t scsa2usb_errlevel = USB_LOG_L4; -static uint_t scsa2usb_instance_debug = (uint_t)-1; -static uint_t scsa2usb_scsi_bus_config_debug = 0; -static uint_t scsa2usb_long_timeout = 50 * SCSA2USB_BULK_PIPE_TIMEOUT; +uint_t scsa2usb_errmask = (uint_t)DPRINT_MASK_ALL; +uint_t scsa2usb_errlevel = USB_LOG_L4; +uint_t scsa2usb_instance_debug = (uint_t)-1; +uint_t scsa2usb_scsi_bus_config_debug = 0; +uint_t scsa2usb_long_timeout = 50 * SCSA2USB_BULK_PIPE_TIMEOUT; /* @@ -388,7 +388,7 @@ * transfers >= 128kbytes hang the device. This tunable allows to * limit the maximum bulk transfers rate. */ -static uint_t scsa2usb_max_bulk_xfer_size = SCSA2USB_MAX_BULK_XFER_SIZE; +uint_t scsa2usb_max_bulk_xfer_size = SCSA2USB_MAX_BULK_XFER_SIZE; #ifdef SCSA2USB_BULK_ONLY_TEST @@ -1370,7 +1370,7 @@ scsa2usbp->scsa2usb_subclass_override = ov.subclass; scsa2usbp->scsa2usb_protocol_override = ov.protocol; - USB_DPRINTF_L1(DPRINT_MASK_SCSA, + USB_DPRINTF_L2(DPRINT_MASK_SCSA, scsa2usbp->scsa2usb_log_handle, "vid=0x%x pid=0x%x rev=0x%x subclass=0x%x " "protocol=0x%x " @@ -1527,7 +1527,7 @@ return (USB_FAILURE); } } else { - scsa2usb_override_error("entry", scsa2usbp); + scsa2usb_override_error(input_field, scsa2usbp); return (USB_FAILURE); } @@ -1545,7 +1545,7 @@ scsa2usb_override_error(char *input_field, scsa2usb_state_t *scsa2usbp) { USB_DPRINTF_L1(DPRINT_MASK_SCSA, scsa2usbp->scsa2usb_log_handle, - "invalid %s in scsa2usb conf file entry", input_field); + "invalid %s in scsa2usb.conf file entry", input_field); } /* @@ -2052,9 +2052,6 @@ return; } - USB_DPRINTF_L0(DPRINT_MASK_SCSA, scsa2usbp->scsa2usb_log_handle, - "Reinserted device is accessible again."); - /* * if the device had remote wakeup earlier, * enable it again @@ -2941,6 +2938,9 @@ scsa2usb_check_bulkonly_blacklist_attrs(scsa2usb_state_t *scsa2usbp, scsa2usb_cmd_t *cmd, uchar_t opcode) { + struct scsi_inquiry *inq = + &scsa2usbp->scsa2usb_lun_inquiry[cmd->cmd_pkt->pkt_address.a_lun]; + USB_DPRINTF_L4(DPRINT_MASK_SCSA, scsa2usbp->scsa2usb_log_handle, "scsa2usb_check_bulkonly_blacklist_attrs: opcode = %s", scsi_cname(opcode, scsa2usb_cmds)); @@ -2957,10 +2957,16 @@ return (SCSA2USB_JUST_ACCEPT); - } else if (scsa2usbp->scsa2usb_lun_inquiry[cmd->cmd_pkt-> - pkt_address.a_lun].inq_rmb) { - - break; + /* + * only lock the door for CD and DVD drives + */ + } else if ((inq->inq_dtype == DTYPE_RODIRECT) || + (inq->inq_dtype == DTYPE_OPTICAL)) { + + if (inq->inq_rmb) { + + break; + } } return (SCSA2USB_JUST_ACCEPT); @@ -2983,8 +2989,7 @@ * if the device is really a removable then * pass it on to the device, else just accept */ - if (scsa2usbp->scsa2usb_lun_inquiry[cmd->cmd_pkt-> - pkt_address.a_lun].inq_rmb) { + if (inq->inq_rmb) { break; } @@ -3024,8 +3029,8 @@ break; /* - * Fake accepting the following two Opcodes - * (as the drive doesn't support it.) + * Fake accepting the following Opcodes + * (as most drives don't support these) * These are needed by format command. */ case SCMD_RESERVE: @@ -4998,6 +5003,9 @@ scsa2usb_restore_device_state(dip, scsa2usbp); + USB_DPRINTF_L0(DPRINT_MASK_SCSA, scsa2usbp->scsa2usb_log_handle, + "Reinserted device is accessible again."); + ndi_devi_enter(dip, &circ); for (cdip = ddi_get_child(dip); cdip; ) { dev_info_t *next = ddi_get_next_sibling(cdip);
--- a/usr/src/uts/common/io/usb/scsa2usb/usb_ms_bulkonly.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/scsa2usb/usb_ms_bulkonly.c Thu Nov 10 11:17:25 2005 -0800 @@ -86,14 +86,14 @@ * * NOTE: This is for testing only. It will be replaced by a uscsi test. */ -static int scsa2usb_test_case_2 = 0; -static int scsa2usb_test_case_3 = 0; -static int scsa2usb_test_case_4 = 0; -static int scsa2usb_test_case_7 = 0; +int scsa2usb_test_case_2 = 0; +int scsa2usb_test_case_3 = 0; +int scsa2usb_test_case_4 = 0; +int scsa2usb_test_case_7 = 0; extern int scsa2usb_test_case_8; -static int scsa2usb_test_case_9 = 0; +int scsa2usb_test_case_9 = 0; extern int scsa2usb_test_case_10; -static int scsa2usb_test_case_13 = 0; +int scsa2usb_test_case_13 = 0; #endif /* SCSA2USB_BULK_ONLY_TEST */
--- a/usr/src/uts/common/io/usb/usb_mid/usb_mid.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usb_mid/usb_mid.c Thu Nov 10 11:17:25 2005 -0800 @@ -46,10 +46,10 @@ void usba_free_evdata(usba_evdata_t *); /* Debugging support */ -static uint_t usb_mid_errlevel = USB_LOG_L4; -static uint_t usb_mid_errmask = (uint_t)DPRINT_MASK_ALL; -static uint_t usb_mid_instance_debug = (uint_t)-1; -static uint_t usb_mid_bus_config_debug = 0; +uint_t usb_mid_errlevel = USB_LOG_L4; +uint_t usb_mid_errmask = (uint_t)DPRINT_MASK_ALL; +uint_t usb_mid_instance_debug = (uint_t)-1; +uint_t usb_mid_bus_config_debug = 0; _NOTE(DATA_READABLE_WITHOUT_LOCK(usb_mid_errlevel)) _NOTE(DATA_READABLE_WITHOUT_LOCK(usb_mid_errmask)) @@ -1078,6 +1078,11 @@ */ for (i = 0; i < n_ifs; i++) { if (usb_mid->mi_children_dips[i] != NULL) { + if (i_ddi_node_state( + usb_mid->mi_children_dips[i]) >= + DS_BOUND) { + bound_children++; + } continue; }
--- a/usr/src/uts/common/io/usb/usba/hcdi.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/hcdi.c Thu Nov 10 11:17:25 2005 -0800 @@ -62,9 +62,9 @@ void usba_pipe_clear(usb_pipe_handle_t); /* for debug messages */ -static uint_t hcdi_errmask = (uint_t)DPRINT_MASK_ALL; -static uint_t hcdi_errlevel = USB_LOG_L4; -static uint_t hcdi_instance_debug = (uint_t)-1; +uint_t hcdi_errmask = (uint_t)DPRINT_MASK_ALL; +uint_t hcdi_errlevel = USB_LOG_L4; +uint_t hcdi_instance_debug = (uint_t)-1; void usba_hcdi_initialization()
--- a/usr/src/uts/common/io/usb/usba/parser.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/parser.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -157,6 +157,7 @@ } else if (isdigit(fmt)) { multiplier = (multiplier * 10) + (fmt - '0'); format++; + counter--; } else { multiplier = 0; break;
--- a/usr/src/uts/common/io/usb/usba/usba.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/usba.c Thu Nov 10 11:17:25 2005 -0800 @@ -93,8 +93,8 @@ static usb_log_handle_t usba_log_handle; -static uint_t usba_errlevel = USB_LOG_L4; -static uint_t usba_errmask = (uint_t)-1; +uint_t usba_errlevel = USB_LOG_L4; +uint_t usba_errmask = (uint_t)-1; extern usb_log_handle_t hubdi_log_handle;
--- a/usr/src/uts/common/io/usb/usba/usba_devdb.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/usba_devdb.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -32,8 +32,8 @@ #include <sys/usb/usba/usba_devdb_impl.h> static usb_log_handle_t usba_devdb_log_handle; -static uint_t usba_devdb_errlevel = USB_LOG_L4; -static uint_t usba_devdb_errmask = (uint_t)-1; +uint_t usba_devdb_errlevel = USB_LOG_L4; +uint_t usba_devdb_errmask = (uint_t)-1; boolean_t usba_build_devdb = B_FALSE;
--- a/usr/src/uts/common/io/usb/usba/usba_ugen.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/usba_ugen.c Thu Nov 10 11:17:25 2005 -0800 @@ -54,20 +54,20 @@ #include "sys/usb/usba/usba_ugend.h" /* Debugging information */ -static uint_t ugen_errmask = (uint_t)UGEN_PRINT_ALL; -static uint_t ugen_errlevel = USB_LOG_L4; -static uint_t ugen_instance_debug = (uint_t)-1; +uint_t ugen_errmask = (uint_t)UGEN_PRINT_ALL; +uint_t ugen_errlevel = USB_LOG_L4; +uint_t ugen_instance_debug = (uint_t)-1; /* default endpoint descriptor */ static usb_ep_descr_t ugen_default_ep_descr = {7, 5, 0, USB_EP_ATTR_CONTROL, 8, 0}; /* tunables */ -static int ugen_busy_loop = 60; /* secs */ -static int ugen_ctrl_timeout = 10; -static int ugen_bulk_timeout = 10; -static int ugen_intr_timeout = 10; -static int ugen_enable_pm = 0; +int ugen_busy_loop = 60; /* secs */ +int ugen_ctrl_timeout = 10; +int ugen_bulk_timeout = 10; +int ugen_intr_timeout = 10; +int ugen_enable_pm = 0; /* local function prototypes */
--- a/usr/src/uts/common/io/usb/usba/usbai.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/usbai.c Thu Nov 10 11:17:25 2005 -0800 @@ -38,6 +38,7 @@ #define USBA_FRAMEWORK #include <sys/varargs.h> #include <sys/usb/usba/usba_impl.h> +#include <sys/usb/usba/hcdi_impl.h> #include <sys/usb/usba/usba10.h> /* @@ -52,27 +53,30 @@ * debug stuff */ usb_log_handle_t usbai_log_handle; -static uint_t usbai_errlevel = USB_LOG_L4; -static uint_t usbai_errmask = (uint_t)-1; +uint_t usbai_errlevel = USB_LOG_L4; +uint_t usbai_errmask = (uint_t)-1; #define USBA_DEBUG_SIZE_EXTRA_ALLOC 8 #ifdef DEBUG -#define USBA_DEBUG_BUF_SIZE 0x40000 +#define USBA_DEBUG_BUF_SIZE \ + (0x40000 - USBA_DEBUG_SIZE_EXTRA_ALLOC) #else -#define USBA_DEBUG_BUF_SIZE 0x4000 +#define USBA_DEBUG_BUF_SIZE \ + (0x4000 - USBA_DEBUG_SIZE_EXTRA_ALLOC) #endif /* DEBUG */ #define USBA_POWER_STR_SIZE 40 -static int usba_suppress_dprintf; /* Suppress debug printing */ -static int usba_clear_debug_buf_flag; /* clear debug buf */ -static int usba_buffer_dprintf = 1; /* Use a debug print buffer */ -static int usba_timestamp_dprintf = 0; /* get time stamps in trace */ -static hrtime_t usba_last_timestamp; /* last time stamp in trace */ -static int usba_debug_buf_size = USBA_DEBUG_BUF_SIZE; /* Size of debug buf */ -static char *usba_debug_buf = NULL; /* The debug buf */ +int usba_suppress_dprintf; /* Suppress debug printing */ +int usba_clear_debug_buf_flag; /* clear debug buf */ +int usba_buffer_dprintf = 1; /* Use a debug print buffer */ +int usba_timestamp_dprintf = 0; /* get time stamps in trace */ +int usba_debug_buf_size = USBA_DEBUG_BUF_SIZE; /* Size of debug buf */ +int usba_debug_chatty; /* L1 msg on console */ + +static char *usba_debug_buf = NULL; /* The debug buf */ static char *usba_buf_sptr, *usba_buf_eptr; -static int usba_debug_chatty; /* L1 msg on console */ +static hrtime_t usba_last_timestamp; /* last time stamp in trace */ /* * Set to 1 to enable PM. @@ -675,9 +679,7 @@ int usb_is_pm_enabled(dev_info_t *dip) { -#if defined(__sparc) usba_device_t *usba_device = usba_get_usba_device(dip); -#endif switch (usb_force_enable_pm) { case -1: @@ -695,24 +697,34 @@ } -#if defined(__sparc) - /* uhci does not have PM support, ehci has resume problems */ - if (usba_device && - ((strcmp(ddi_driver_name(usba_device->usb_root_hub_dip), - "uhci") == 0) || - (strcmp(ddi_driver_name(usba_device->usb_root_hub_dip), - "ehci") == 0))) { - USB_DPRINTF_L1(DPRINT_MASK_USBA, usbai_log_handle, - "%s%d: no PM enabled for this device", - ddi_driver_name(dip), ddi_get_instance(dip)); + if (usba_device) { + dev_info_t *root_hub_dip; + usba_hcdi_t *hcdi; + int rval; + + root_hub_dip = usba_device->usb_root_hub_dip; + if (root_hub_dip == NULL) { + + return (USB_FAILURE); + } - return (USB_FAILURE); + hcdi = usba_hcdi_get_hcdi(root_hub_dip); + if (hcdi && hcdi->hcdi_ops->usba_hcdi_pm_support) { + rval = hcdi->hcdi_ops-> + usba_hcdi_pm_support(root_hub_dip); + if (rval != USB_SUCCESS) { + USB_DPRINTF_L1(DPRINT_MASK_USBA, + usbai_log_handle, + "%s%d: no PM enabled for this device", + ddi_driver_name(dip), + ddi_get_instance(dip)); + } + + return (rval); + } } - return (USB_SUCCESS); -#else return (USB_FAILURE); -#endif }
--- a/usr/src/uts/common/io/usb/usba/usbai_pipe_mgmt.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/usbai_pipe_mgmt.c Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -62,7 +62,7 @@ usba_pipe_async_req_t *, usb_flags_t); /* local tunables */ -static int usba_drain_timeout = 1000; /* in ms */ +int usba_drain_timeout = 1000; /* in ms */ /* return the default pipe for this device */ usb_pipe_handle_t
--- a/usr/src/uts/common/io/usb/usba/usbai_register.c Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/io/usb/usba/usbai_register.c Thu Nov 10 11:17:25 2005 -0800 @@ -109,9 +109,9 @@ /* Debug stuff */ usb_log_handle_t usbai_reg_log_handle; -static uint_t usbai_register_errlevel = USB_LOG_L2; -static uint_t usbai_register_dump_errlevel = USB_LOG_L2; -static uint_t usbai_register_errmask = (uint_t)-1; +uint_t usbai_register_errlevel = USB_LOG_L2; +uint_t usbai_register_dump_errlevel = USB_LOG_L2; +uint_t usbai_register_errmask = (uint_t)-1; /* Function prototypes */ static int usba_build_descr_tree(dev_info_t *, usba_device_t *,
--- a/usr/src/uts/common/sys/usb/clients/audio/usb_audio.h Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/sys/usb/clients/audio/usb_audio.h Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -150,7 +150,7 @@ } usb_audio_cs_if_descr_t; #define CS_AC_IF_HEADER_FORMAT "cccsscc" -#define CS_AC_IF_HEADER_SIZE 10 +#define CS_AC_IF_HEADER_SIZE 9 /* input terminal descriptor (4.3.2.1) */ typedef struct usb_audio_input_term_descr { @@ -258,8 +258,8 @@ uint8_t baSourceID[1]; /* ID of pins */ } usb_audio_processing_unit_descr1_t; -#define CS_AC_PROCESSING_UNIT_DESCR1_FORMAT "ccccwcc" -#define CS_AC_PROCESSING_UNIT_DESCR1_SIZE 8 +#define CS_AC_PROCESSING_UNIT_DESCR1_FORMAT "ccccccc" +#define CS_AC_PROCESSING_UNIT_DESCR1_SIZE 7 typedef struct usb_audio_processing_unit_descr2 { uint8_t bNrChannels; /* # log. output channels */ @@ -285,8 +285,8 @@ uint8_t baSourceID[1]; /* ID of pins */ } usb_audio_extension_unit_descr1_t; -#define CS_AC_EXTENSION_UNIT_DESCR1_FORMAT "ccccwcc" -#define CS_AC_EXTENSION_UNIT_DESCR1_SIZE 8 +#define CS_AC_EXTENSION_UNIT_DESCR1_FORMAT "ccccccc" +#define CS_AC_EXTENSION_UNIT_DESCR1_SIZE 7 typedef struct usb_audio_extension_unit_descr2 { uint8_t bNrChannels; /* # log. output channels */ @@ -324,7 +324,7 @@ } usb_audio_as_if_descr_t; #define AS_IF_DESCR_FORMAT "cccccs" -#define AS_IF_DESCR_SIZE 8 +#define AS_IF_DESCR_SIZE 7 /* class specific AS isochronous audio data ep descr (4.6.1.2) */ @@ -334,11 +334,11 @@ uint8_t bDescriptorSubType; /* EP_GENERAL */ uint8_t bmAttributes; /* bitmap of attributes */ uint8_t bLockDelayUnits; /* type of units */ - uint8_t bLockDelay; /* lock of internal clock */ + uint16_t wLockDelay; /* lock of internal clock */ } usb_audio_as_isoc_ep_descr_t; -#define AS_ISOC_EP_DESCR_FORMAT "cccccc" -#define AS_ISOC_EP_DESCR_SIZE 6 +#define AS_ISOC_EP_DESCR_FORMAT "5cs" +#define AS_ISOC_EP_DESCR_SIZE 7 /* * data format descriptor, no need for parse format since @@ -356,7 +356,7 @@ uint8_t bSamFreqs[6]; /* sampling freqs */ } usb_audio_type1_format_descr_t; -#define AUDIO_TYPE1_FORMAT_FORMAT "cccccccccc" +#define AUDIO_TYPE1_FORMAT_FORMAT "10c" #define AUDIO_TYPE1_FORMAT_SIZE 10 /* audio data format codes */
--- a/usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/sys/usb/hcd/ehci/ehcid.h Thu Nov 10 11:17:25 2005 -0800 @@ -1013,6 +1013,14 @@ #define PCI_VENDOR_ALI 0x10b9 /* PCI Vendor-id Acer */ /* + * NEC on COMBO and Uli M1575 can support PM + */ +#define PCI_VENDOR_NEC_COMBO 0x1033 +#define PCI_DEVICE_NEC_COMBO 0xe0 +#define PCI_VENDOR_ULi_M1575 0x10b9 +#define PCI_DEVICE_ULi_M1575 0x5239 + +/* * VIA chips have some problems, the workaround can ensure those chips * work reliably. Revisions >= 0x80 are part of a southbridge and appear * to be reliable.
--- a/usr/src/uts/common/sys/usb/usba/hcdi.h Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/common/sys/usb/usba/hcdi.h Thu Nov 10 11:17:25 2005 -0800 @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -58,6 +58,9 @@ dev_info_t *usba_hcdi_dip; /* HCD's devinfo ptr */ + /* can this hcd support pm? */ + int (*usba_hcdi_pm_support)(dev_info_t *dip); + /* * usba_hcdi_pipe_open: * implements the semantics of usb_pipe_open()
--- a/usr/src/uts/sparc/ehci/ehci.wlcmd Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/sparc/ehci/ehci.wlcmd Thu Nov 10 11:17:25 2005 -0800 @@ -46,6 +46,7 @@ root ehci_hcdi_pipe_bulk_xfer root ehci_hcdi_pipe_intr_xfer root ehci_hcdi_pipe_isoc_xfer +root ehci_hcdi_pm_support root hubd_hotplug_thread root hubd_exception_cb
--- a/usr/src/uts/sparc/ohci/ohci.wlcmd Thu Nov 10 08:07:43 2005 -0800 +++ b/usr/src/uts/sparc/ohci/ohci.wlcmd Thu Nov 10 11:17:25 2005 -0800 @@ -45,6 +45,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 hubd_hotplug_thread root hubd_exception_cb