various changes
[ppcskel.git] / usb / drivers / class / hid.c
index 60d3a4db118b0283b134ced18ccd086b98aa8c84..fe5a17c2fecfa5e8600a452b1cb2ac8eeb2cae3b 100644 (file)
@@ -36,6 +36,9 @@ void usb_hidkb_probe()
        
        while(iterator != NULL) {
                dev = (struct usb_device*)iterator->data;
+               if(dev == NULL) {
+                       continue;
+               }
 
                if(dev->conf->intf->bInterfaceClass == HID_CLASSCODE &&
                                dev->conf->intf->bInterfaceSubClass == 1 && /* keyboard support boot protocol? */
@@ -51,6 +54,11 @@ void usb_hidkb_check()
 {
 }
 
+u8 usb_hidkb_inuse()
+{
+       return hidkb.data ? 1 : 0;
+}
+
 struct kbrep *usb_hidkb_getChars() {
        struct usb_device *dev = (struct usb_device*) hidkb.data;
        struct kbrep *ret = (struct kbrep*) malloc(sizeof(struct kbrep));