diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-12-14 19:02:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-12-14 19:02:49 +0000 |
commit | 047b1eb7659b1c5186b0ab1e549d0dce8a07bcce (patch) | |
tree | 9b4500b6b43e3c801bd852e2603edd638cdfbc25 | |
parent | c50f2a170433a0f85212c81374bbb62806ad3768 (diff) | |
download | nuttx-047b1eb7659b1c5186b0ab1e549d0dce8a07bcce.tar.gz nuttx-047b1eb7659b1c5186b0ab1e549d0dce8a07bcce.tar.bz2 nuttx-047b1eb7659b1c5186b0ab1e549d0dce8a07bcce.zip |
update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3175 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_storage.c | 20 | ||||
-rw-r--r-- | nuttx/include/nuttx/usb/usbhost.h | 18 |
2 files changed, 26 insertions, 12 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index a26a8b37b..f0dc44b9f 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -54,12 +54,17 @@ static struct usbhost_class_s *usbhost_create(struct usbhost_driver_s *drvr); struct usbhost_registry_s g_storage = { - NULL, /* flink */ - usbhost_create, /* create */ + NULL, /* flink */ + usbhost_create, /* create */ + 1, /* nids */ { - USB_CLASS_MASS_STORAGE, /* id.class */ - 0, /* id.vid */ - 0 /* id.pid */ + { + USB_CLASS_MASS_STORAGE, /* id[0].base */ + SUBSTRG_SUBCLASS_SCSI, /* id[0].subclass */ + USBSTRG_PROTO_BULKONLY, /* id[0].proto */ + 0, /* id[0].vid */ + 0 /* id[0].pid */ + } } }; @@ -82,6 +87,8 @@ struct usbhost_registry_s g_storage = * drvr - An instance of struct usbhost_driver_s that the class * implementation will "bind" to its state structure and will * subsequently use to communicate with the USB host driver. + * id - In the case where the device supports multiple base classes, + * subclasses, or protocols, this specifies which to configure for. * * Returned Values: * On success, this function will return a non-NULL instance of struct @@ -92,7 +99,8 @@ struct usbhost_registry_s g_storage = * ****************************************************************************/ -static struct usbhost_class_s *usbhost_create(struct usbhost_driver_s *drvr) +static struct usbhost_class_s *usbhost_create(struct usbhost_driver_s *drvr, + const struct usbhost_id_s *id) { #warning "Not implemented" return NULL; diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h index 972584fd1..291c10892 100644 --- a/nuttx/include/nuttx/usb/usbhost.h +++ b/nuttx/include/nuttx/usb/usbhost.h @@ -71,6 +71,8 @@ * drvr - An instance of struct usbhost_driver_s that the class implementation will * "bind" to its state structure and will subsequently use to communicate with * the USB host driver. + * id - In the case where the device supports multiple base classes, subclasses, or + * protocols, this specifies which to configure for. * * Returned Values: * On success, this function will return a non-NULL instance of struct @@ -81,7 +83,7 @@ * ************************************************************************************/ -#definei CLASS_CREATE(reg, drvr) (reg->create(drvr)) +#definei CLASS_CREATE(reg, drvr, id) (reg->create(drvr)) /************************************************************************************ * Public Types @@ -93,9 +95,11 @@ struct usbhost_id_s { - uint8_t class; /* Device class code (see USB_CLASS_* defines in usb.h) */ - uint16_t vid; /* Vendor ID (for vendor/product specific devices) */ - uint16_t pid; /* Product ID (for vendor/product specific devices) */ + uint8_t base; /* Base device class code (see USB_CLASS_* defines in usb.h) */ + uint8_t subclass; /* Sub-class, depends on base class. Eg., See USBSTRG_SUBCLASS_* */ + uint8_t proto; /* Protocol, depends on base class. Eg., See USBSTRG_PROTO_* */ + uint16_t vid; /* Vendor ID (for vendor/product specific devices) */ + uint16_t pid; /* Product ID (for vendor/product specific devices) */ }; /* The struct usbhost_registry_s type describes information that is kept in the the @@ -122,13 +126,15 @@ struct usbhost_registry_s * simultaneously connected (see the CLASS_CREATE() macro above). */ - struct usbhost_class_s *(*create)(struct usbhost_driver_s *drvr); + struct usbhost_class_s *(*create)(struct usbhost_driver_s *drvr, + const struct usbhost_id_s *id) /* This information uniquely identifies the USB host class implementation that * goes with a specific USB device. */ - struct usbhost_id_s id; + uint8_t nids; /* Number of IDs in the id[] array */ + struct usbhost_id_s id[1]; /* Actual dimension is nids */ }; /************************************************************************************ |