csphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget*/translations/zh_CN/driver-api/usb/hotplugmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/zh_TW/driver-api/usb/hotplugmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/it_IT/driver-api/usb/hotplugmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ja_JP/driver-api/usb/hotplugmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ko_KR/driver-api/usb/hotplugmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/sp_SP/driver-api/usb/hotplugmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hUSB hotpluggingh]hUSB hotplugging}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhD/var/lib/git/docbuild/linux/Documentation/driver-api/usb/hotplug.rsthKubh)}(hhh](h)}(hLinux Hotpluggingh]hLinux Hotplugging}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hIn hotpluggable busses like USB (and Cardbus PCI), end-users plug devices into the bus with power on. In most cases, users expect the devices to become immediately usable. That means the system must do many things, including:h]hIn hotpluggable busses like USB (and Cardbus PCI), end-users plug devices into the bus with power on. In most cases, users expect the devices to become immediately usable. That means the system must do many things, including:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hX- Find a driver that can handle the device. That may involve loading a kernel module; newer drivers can use module-init-tools to publish their device (and class) support to user utilities. - Bind a driver to that device. Bus frameworks do that using a device driver's probe() routine. - Tell other subsystems to configure the new device. Print queues may need to be enabled, networks brought up, disk partitions mounted, and so on. In some cases these will be driver-specific actions. h]h bullet_list)}(hhh](h list_item)}(hFind a driver that can handle the device. That may involve loading a kernel module; newer drivers can use module-init-tools to publish their device (and class) support to user utilities. h]h)}(hFind a driver that can handle the device. That may involve loading a kernel module; newer drivers can use module-init-tools to publish their device (and class) support to user utilities.h]hFind a driver that can handle the device. That may involve loading a kernel module; newer drivers can use module-init-tools to publish their device (and class) support to user utilities.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(h_Bind a driver to that device. Bus frameworks do that using a device driver's probe() routine. h]h)}(h^Bind a driver to that device. Bus frameworks do that using a device driver's probe() routine.h]h`Bind a driver to that device. Bus frameworks do that using a device driver’s probe() routine.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hTell other subsystems to configure the new device. Print queues may need to be enabled, networks brought up, disk partitions mounted, and so on. In some cases these will be driver-specific actions. h]h)}(hTell other subsystems to configure the new device. Print queues may need to be enabled, networks brought up, disk partitions mounted, and so on. In some cases these will be driver-specific actions.h]hTell other subsystems to configure the new device. Print queues may need to be enabled, networks brought up, disk partitions mounted, and so on. In some cases these will be driver-specific actions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]bullet-uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hX[This involves a mix of kernel mode and user mode actions. Making devices be immediately usable means that any user mode actions can't wait for an administrator to do them: the kernel must trigger them, either passively (triggering some monitoring daemon to invoke a helper program) or actively (calling such a user mode helper program directly).h]hX]This involves a mix of kernel mode and user mode actions. Making devices be immediately usable means that any user mode actions can’t wait for an administrator to do them: the kernel must trigger them, either passively (triggering some monitoring daemon to invoke a helper program) or actively (calling such a user mode helper program directly).}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThose triggered actions must support a system's administrative policies; such programs are called "policy agents" here. Typically they involve shell scripts that dispatch to more familiar administration tools.h]hThose triggered actions must support a system’s administrative policies; such programs are called “policy agents” here. Typically they involve shell scripts that dispatch to more familiar administration tools.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hBecause some of those actions rely on information about drivers (metadata) that is currently available only when the drivers are dynamically linked, you get the best hotplugging when you configure a highly modular system.h]hBecause some of those actions rely on information about drivers (metadata) that is currently available only when the drivers are dynamically linked, you get the best hotplugging when you configure a highly modular system.}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hhhhubeh}(h]linux-hotpluggingah ]h"]linux hotpluggingah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h)Kernel Hotplug Helper (``/sbin/hotplug``)h](hKernel Hotplug Helper (}(hjphhhNhNubhliteral)}(h``/sbin/hotplug``h]h /sbin/hotplug}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhjpubh)}(hjphhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjmhhhhhK'ubh)}(hThere is a kernel parameter: ``/proc/sys/kernel/hotplug``, which normally holds the pathname ``/sbin/hotplug``. That parameter names a program which the kernel may invoke at various times.h](hThere is a kernel parameter: }(hjhhhNhNubjy)}(h``/proc/sys/kernel/hotplug``h]h/proc/sys/kernel/hotplug}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhjubh$, which normally holds the pathname }(hjhhhNhNubjy)}(h``/sbin/hotplug``h]h /sbin/hotplug}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhjubhO. That parameter names a program which the kernel may invoke at various times.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK)hjmhhubh)}(hXThe /sbin/hotplug program can be invoked by any subsystem as part of its reaction to a configuration change, from a thread in that subsystem. Only one parameter is required: the name of a subsystem being notified of some kernel event. That name is used as the first key for further event dispatch; any other argument and environment parameters are specified by the subsystem making that invocation.h]hXThe /sbin/hotplug program can be invoked by any subsystem as part of its reaction to a configuration change, from a thread in that subsystem. Only one parameter is required: the name of a subsystem being notified of some kernel event. That name is used as the first key for further event dispatch; any other argument and environment parameters are specified by the subsystem making that invocation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjmhhubh)}(h5Hotplug software and other resources is available at:h]h5Hotplug software and other resources is available at:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjmhhubh)}(h%http://linux-hotplug.sourceforge.net h]h)}(h$http://linux-hotplug.sourceforge.neth]h reference)}(hjh]h$http://linux-hotplug.sourceforge.net}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1hhhhK6hjmhhubh)}(h8Mailing list information is also available at that site.h]h8Mailing list information is also available at that site.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjmhhubeh}(h]"kernel-hotplug-helper-sbin-hotplugah ]h"]%kernel hotplug helper (/sbin/hotplug)ah$]h&]uh1hhhhhhhhK'ubh)}(hhh](h)}(hUSB Policy Agenth]hUSB Policy Agent}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhjhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jUhjRubjV)}(hhh]h}(h]h ]h"]h$]h&]colwidthK,uh1jUhjRubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(hACTIONh]hACTION}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjwubah}(h]h ]h"]h$]h&]uh1juhjrubjv)}(hhh]h)}(h``add``, ``remove``h](jy)}(h``add``h]hadd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhjubh, }(hjhhhNhNubjy)}(h ``remove``h]hremove}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhjubeh}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1juhjrubeh}(h]h ]h"]h$]h&]uh1jphjmubjq)}(hhh](jv)}(hhh]h)}(hPRODUCTh]hPRODUCT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1juhjubjv)}(hhh]h)}(h,USB vendor, product, and version codes (hex)h]h,USB vendor, product, and version codes (hex)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1juhjubeh}(h]h ]h"]h$]h&]uh1jphjmubjq)}(hhh](jv)}(hhh]h)}(hTYPEh]hTYPE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1juhjubjv)}(hhh]h)}(hdevice class codes (decimal)h]hdevice class codes (decimal)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1juhjubeh}(h]h ]h"]h$]h&]uh1jphjmubjq)}(hhh](jv)}(hhh]h)}(h INTERFACEh]h INTERFACE}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhj8ubah}(h]h ]h"]h$]h&]uh1juhj5ubjv)}(hhh]h)}(h!interface 0 class codes (decimal)h]h!interface 0 class codes (decimal)}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjOubah}(h]h ]h"]h$]h&]uh1juhj5ubeh}(h]h ]h"]h$]h&]uh1jphjmubeh}(h]h ]h"]h$]h&]uh1jkhjRubeh}(h]h ]h"]h$]h&]colsKuh1jPhjMubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubh)}(hXIf "usbdevfs" is configured, DEVICE and DEVFS are also passed. DEVICE is the pathname of the device, and is useful for devices with multiple and/or alternate interfaces that complicate driver selection. By design, USB hotplugging is independent of ``usbdevfs``: you can do most essential parts of USB device setup without using that filesystem, and without running a user mode daemon to detect changes in system configuration.h](hIf “usbdevfs” is configured, DEVICE and DEVFS are also passed. DEVICE is the pathname of the device, and is useful for devices with multiple and/or alternate interfaces that complicate driver selection. By design, USB hotplugging is independent of }(hjhhhNhNubjy)}(h ``usbdevfs``h]husbdevfs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhjubh: you can do most essential parts of USB device setup without using that filesystem, and without running a user mode daemon to detect changes in system configuration.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKKhjhhubh)}(hCurrently available policy agent implementations can load drivers for modules, and can invoke driver-specific setup scripts. The newest ones leverage USB module-init-tools support. Later agents might unload drivers.h]hCurrently available policy agent implementations can load drivers for modules, and can invoke driver-specific setup scripts. The newest ones leverage USB module-init-tools support. Later agents might unload drivers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjhhubeh}(h]usb-policy-agentah ]h"]usb policy agentah$]h&]uh1hhhhhhhhK