Hooks that the USB stack can callback in case of events. More...
Public Attributes | |
status_t(* | device_added )(usb_device device, void **cookie) |
Called by the stack in case a device is added. | |
status_t(* | device_removed )(void *cookie) |
Called by the stack in case a device you are using is removed. | |
Hooks that the USB stack can callback in case of events.
status_t(* usb_notify_hooks::device_added)(usb_device device, void **cookie) |
Called by the stack in case a device is added.
Once you have registered hooks using the usb_module_info::install_notify() method, this hook will be called as soon as a device is inserted that matches your provided usb_support_descriptor.
device | A unique id that identifies this USB device. | |
[in] | cookie | You can store a pointer to an object in this variable. When the device is removed, this cookie will be provided to you. |
B_OK
in case of success. The USB stack will then request the kernel to republish your device names so that the new device will be shown in the /dev
tree. If you return an error value, the device id will become invalid and you will not be notified if this device is removed. status_t(* usb_notify_hooks::device_removed)(void *cookie) |
Called by the stack in case a device you are using is removed.
If you have accepted a device in the device_added() hook, this hook will be called as soon as the device is removed.
cookie | The cookie you provided in the device_added() hook. Make sure that you free the cookie if necessary. |
B_OK
though.