]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Support USB device drivers autoloading
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 17 Jul 2010 01:58:23 +0000 (03:58 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 17 Jul 2010 01:58:23 +0000 (03:58 +0200)
bus/usb/usb.c

index f6a0a8b569abb7a68e0b19d70386f54b15dbbcbe..804cbaff04049dc8ea2806bb6e741a5cfb370e5e 100644 (file)
@@ -22,6 +22,7 @@
 #include <grub/usb.h>
 #include <grub/misc.h>
 #include <grub/list.h>
+#include <grub/dl.h>
 
 static grub_usb_controller_dev_t grub_usb_list;
 struct grub_usb_attach_desc *attach_hooks;
@@ -256,6 +257,19 @@ void grub_usb_device_attach (grub_usb_device_t dev)
       for (desc = attach_hooks; desc; desc = desc->next)
        if (interf->class == desc->class && desc->hook (dev, 0, i))
          dev->config[0].interf[i].attached = 1;
+
+      if (dev->config[0].interf[i].attached)
+       continue;
+
+      switch (interf->class)
+       {
+       case GRUB_USB_CLASS_MASS_STORAGE:
+         grub_dl_load ("usbms");
+         break;
+       case GRUB_USB_CLASS_HID:
+         grub_dl_load ("usb_keyboard");
+         break;
+       }
     }
 }