3.2. Finding appropriate device driver

The USB system searches for a device driver as follows:

  1. Sends a message to all listening handlers for a driver for a specific vendor and product ID.

  2. Searches the driver path (if set) for a driver for a specific vendor and product ID

  3. Sends a message to all listening handlers for a device driver for a general class.

  4. Searches the driver path (if set) for a device driver for a general class.

  5. Device is marked as unclaimed and kept for future drivers to claim.

Once an appropriate device driver is located the search does not continue.

Only module based drivers can have a message handler and hence only this form of device driver may be sensibly loaded before the device is connected. This makes module drivers ideal for operation where devices are required to operate the system, are inserted and removed often or need to operate outside a multi tasking environment.

Application drivers have fewer constraints on their environment than modules but are more limited in their use. Application drivers can either be run by the USB system when a device is connected or can claim the device from the unclaimed pool when the driver is started by the user.