最終更新:2015-11-26 (木) 18:58:23 (3063d)  

probe
Top / probe

デバイスの検出とか。

Linux/プラットフォームデバイス

呼び出され例

platform_driver.probe(platform_device)

コールバック関数の登録

呼び出し元

device_driver.probe

コールバック関数の登録

呼び出し元 (dwc3_driverの例)

USB

  • The probe() function is called by the USB core to see if the driver is willing to manage a particular interface on a device.
    • The driver should then make checks on the information passed to it about the device.
    • If it decides to manage the interface, the probe() function will return 0.  Otherwise, it will return a negative value.
    • The disconnect() function is called by the USB core when a driver should no longer control the device (even if the driver is still loaded), and should do some clean­up.
  • The probe() and disconnect() callbacks are called in the context of the USB hub kernel thread.
    • So, it is legal to call functions which may sleep in these functions.
    • However, all addition and removal of devices is managed by this single thread.
    • Most of the probe function work should indeed be done when the device is actually opened by a userThis way, this doesn't impact the performance of the kernel thread in managing other devices.

usbcore

usb_driver

hid_driver

  • hid_allocate_device? - allocate new hid device descriptor

Linux/USB