Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
79cda97f
Commit
79cda97f
authored
Nov 10, 2002
by
David Brownell
Committed by
Greg Kroah-Hartman
Nov 10, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: update usb hotplug documentation
parent
60e47e25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
drivers/usb/core/usb.c
drivers/usb/core/usb.c
+8
-16
No files found.
drivers/usb/core/usb.c
View file @
79cda97f
...
@@ -514,17 +514,10 @@ static int usb_device_match (struct device *dev, struct device_driver *drv)
...
@@ -514,17 +514,10 @@ static int usb_device_match (struct device *dev, struct device_driver *drv)
* or other modules, configure the device, and more. Drivers can provide
* or other modules, configure the device, and more. Drivers can provide
* a MODULE_DEVICE_TABLE to help with module loading subtasks.
* a MODULE_DEVICE_TABLE to help with module loading subtasks.
*
*
* Some synchronization is important: removes can't start processing
* We're called either from khubd (the typical case) or from root hub
* before the add-device processing completes, and vice versa. That keeps
* (init, kapmd, modprobe, rmmod, etc), but the agents need to handle
* a stack of USB-related identifiers stable while they're in use. If we
* delays in event delivery. Use sysfs (and DEVPATH) to make sure the
* know that agents won't complete after they return (such as by forking
* device (and this configuration!) are still present.
* a process that completes later), it's enough to just waitpid() for the
* agent -- as is currently done.
*
* The reason: we know we're called either from khubd (the typical case)
* or from root hub initialization (init, kapmd, modprobe, etc). In both
* cases, we know no other thread can recycle our address, since we must
* already have been serialized enough to prevent that.
*/
*/
static
int
usb_hotplug
(
struct
device
*
dev
,
char
**
envp
,
int
num_envp
,
static
int
usb_hotplug
(
struct
device
*
dev
,
char
**
envp
,
int
num_envp
,
char
*
buffer
,
int
buffer_size
)
char
*
buffer
,
int
buffer_size
)
...
@@ -579,7 +572,7 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
...
@@ -579,7 +572,7 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
scratch
+=
length
;
scratch
+=
length
;
#endif
#endif
/* per-device configuration
hack
s are common */
/* per-device configurations are common */
envp
[
i
++
]
=
scratch
;
envp
[
i
++
]
=
scratch
;
length
+=
snprintf
(
scratch
,
buffer_size
-
length
,
"PRODUCT=%x/%x/%x"
,
length
+=
snprintf
(
scratch
,
buffer_size
-
length
,
"PRODUCT=%x/%x/%x"
,
usb_dev
->
descriptor
.
idVendor
,
usb_dev
->
descriptor
.
idVendor
,
...
@@ -604,10 +597,9 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
...
@@ -604,10 +597,9 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
if
(
usb_dev
->
descriptor
.
bDeviceClass
==
0
)
{
if
(
usb_dev
->
descriptor
.
bDeviceClass
==
0
)
{
int
alt
=
intf
->
act_altsetting
;
int
alt
=
intf
->
act_altsetting
;
/* a simple/common case: one config, one interface, one driver
/* 2.4 only exposed interface zero. in 2.5, hotplug
* with current altsetting being a reasonable setting.
* agents are called for all interfaces, and can use
* everything needs a smart agent and usbfs; or can rely on
* $DEVPATH/bInterfaceNumber if necessary.
* device-specific binding policies.
*/
*/
envp
[
i
++
]
=
scratch
;
envp
[
i
++
]
=
scratch
;
length
+=
snprintf
(
scratch
,
buffer_size
-
length
,
length
+=
snprintf
(
scratch
,
buffer_size
-
length
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment