1 /******************************************************************************
2 * Copyright (c) 2013 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
13 * All functions concerning interface to slof
24 #define dprintf(_x ...) do { printf(_x); } while(0)
26 #define dprintf(_x ...)
29 int slof_usb_handle(struct usb_dev *dev)
31 struct slof_usb_dev sdev;
32 sdev.port = dev->port;
33 sdev.addr = dev->addr;
34 sdev.hcitype = dev->hcidev->type;
35 sdev.num = dev->hcidev->num;
38 if (dev->class == DEV_HID_KEYB) {
39 dprintf("Keyboard %ld %ld\n", dev->hcidev->type, dev->hcidev->num);
40 sdev.devtype = DEVICE_KEYBOARD;
41 forth_push((long)&sdev);
42 forth_eval("s\" dev-keyb.fs\" INCLUDED");
43 } else if (dev->class == DEV_HID_MOUSE) {
44 dprintf("Mouse %ld %ld\n", dev->hcidev->type, dev->hcidev->num);
45 sdev.devtype = DEVICE_MOUSE;
46 forth_push((long)&sdev);
47 forth_eval("s\" dev-mouse.fs\" INCLUDED");
48 } else if ((dev->class >> 16 & 0xFF) == 8) {
49 dprintf("MASS Storage device %ld %ld\n", dev->hcidev->type, dev->hcidev->num);
50 sdev.devtype = DEVICE_DISK;
51 forth_push((long)&sdev);
52 forth_eval("s\" dev-storage.fs\" INCLUDED");
53 } else if (dev->class == DEV_HUB) {
54 dprintf("Generic hub device %ld %ld\n", dev->hcidev->type,
56 sdev.devtype = DEVICE_HUB;
57 forth_push((long)&sdev);
58 forth_eval("s\" dev-hub.fs\" INCLUDED");