Restructure usbms as a preparation for hotplug
This commit is contained in:
parent
4f034dd24d
commit
440ab68551
3 changed files with 227 additions and 169 deletions
|
@ -125,6 +125,13 @@ struct grub_usb_interface
|
|||
struct grub_usb_desc_if *descif;
|
||||
|
||||
struct grub_usb_desc_endp *descendp;
|
||||
|
||||
/* A driver is handling this interface. Do we need to support multiple drivers
|
||||
for single interface?
|
||||
*/
|
||||
int attached;
|
||||
|
||||
void (*detach_hook) (struct grub_usb_device *dev, int config, int interface);
|
||||
};
|
||||
|
||||
struct grub_usb_configuration
|
||||
|
@ -207,4 +214,17 @@ grub_usb_get_config_interface (struct grub_usb_desc_config *config)
|
|||
return interf;
|
||||
}
|
||||
|
||||
typedef int (*grub_usb_attach_hook_class) (grub_usb_device_t usbdev,
|
||||
int configno, int interfno);
|
||||
|
||||
struct grub_usb_attach_desc
|
||||
{
|
||||
struct grub_usb_attach_desc *next;
|
||||
int class;
|
||||
grub_usb_attach_hook_class hook;
|
||||
};
|
||||
|
||||
void grub_usb_register_attach_hook_class (struct grub_usb_attach_desc *desc);
|
||||
void grub_usb_unregister_attach_hook_class (struct grub_usb_attach_desc *desc);
|
||||
|
||||
#endif /* GRUB_USB_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue