On Thu, 28 Jun 2012, Lan Tianyu wrote: > Change since v3: Rebase on the patch "make usb port a real device" > > Check the connect type of usb port when getting the usb port's > acpi_handle and store result into connect_type in the struct > usb_port. > > Accoding to ACPI Spec 9.13. PLD indicates whether usb port is > user visible and _UPC indicates whether it is connectable. If > the port was visible and connectable, it could be freely connected > and disconnected with USB devices. If no visible and connectable, > a usb device is directly hard-wired to the port. If no visible and > no connectable, the port would be not used. > > When a device was found on the port, if the connect_type was hot-plug, > then the device would be removable. If the connect_type was hard-wired, > the device would be non-removable. > > Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx> > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -4991,6 +4992,45 @@ struct usb_device *usb_get_hub_child(struct usb_device *hdev, > } > EXPORT_SYMBOL_GPL(usb_get_hub_child); > > +/** > + * usb_set_hub_port_connect_type - set hub port connect type. > + * @hdev: USB device belonging to the usb hub > + * @port1: port num of the port > + * @type: connect type of the port > + * USB_PORT_CONNECT_TYPE_UNKNOWN > + * USB_PORT_CONNECT_TYPE_HOT_PLUG > + * USB_PORT_CONNECT_TYPE_HARD_WIRED > + * USB_PORT_NOT_USED These four lines aren't needed. People can read the declaration of enum usb_port_connect_type easily enough. > +/** > + * usb_get_hub_port_connect_type - Get the port's connect > + * type > + * @hdev: USB device belonging to the usb hub > + * @port1: port num of the port > + * > + * Return connect type of the port annd if input params are s/annd/and/ > + * invalid, return USB_PORT_CONNECT_TYPE_UNKNOWN. > + * USB_PORT_CONNECT_TYPE_UNKNOWN > + * USB_PORT_CONNECT_TYPE_HOT_PLUG > + * USB_PORT_CONNECT_TYPE_HARD_WIRED > + * USB_PORT_NOT_USED Same for these lines. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html