diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-26 23:14:27 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-26 23:14:27 +0000 |
commit | 8f6700143c5b021a5a1bd3e21a8c20f177e8e9f2 (patch) | |
tree | 4bd1111e23d7cdb1b43685aa7f699c694f7c8d7f /nuttx/drivers/usbdev/usbmsc.c | |
parent | c1f3ba20b6959401b4e259c13c80d9fbd4a50f2c (diff) | |
download | px4-nuttx-8f6700143c5b021a5a1bd3e21a8c20f177e8e9f2.tar.gz px4-nuttx-8f6700143c5b021a5a1bd3e21a8c20f177e8e9f2.tar.bz2 px4-nuttx-8f6700143c5b021a5a1bd3e21a8c20f177e8e9f2.zip |
Add a text for the new composite USB device
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4341 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbdev/usbmsc.c')
-rw-r--r-- | nuttx/drivers/usbdev/usbmsc.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/nuttx/drivers/usbdev/usbmsc.c b/nuttx/drivers/usbdev/usbmsc.c index a264ab232..0c444c156 100644 --- a/nuttx/drivers/usbdev/usbmsc.c +++ b/nuttx/drivers/usbdev/usbmsc.c @@ -83,7 +83,7 @@ #include "usbmsc.h" #ifdef CONFIG_USBMSC_COMPOSITE -# include <nuttx/composite.h> +# include <nuttx/usb/composite.h> # include "composite.h" #endif @@ -139,6 +139,9 @@ static void usbmsc_disconnect(FAR struct usbdevclass_driver_s *driver, /* Initialization/Uninitialization ******************************************/ static void usbmsc_lununinitialize(struct usbmsc_lun_s *lun); +#ifndef CONFIG_USBMSC_COMPOSITE +static int usbmsc_exportluns(FAR void *handle); +#endif /**************************************************************************** * Private Data @@ -1571,6 +1574,9 @@ int usbmsc_unbindlun(FAR void *handle, unsigned int lunno) * ****************************************************************************/ +#ifndef CONFIG_USBMSC_COMPOSITE +static +#endif int usbmsc_exportluns(FAR void *handle) { FAR struct usbmsc_alloc_s *alloc = (FAR struct usbmsc_alloc_s *)handle; @@ -1635,6 +1641,46 @@ errout_with_mutex: } /**************************************************************************** + * Name: usbmsc_classobject + * + * Description: + * Register USB mass storage device and return the class object. + * + * Input Parameters: + * classdev - The location to return the CDC serial class' device + * instance. + * + * Returned Value: + * 0 on success; a negated errno on failure + + * + ****************************************************************************/ + +#ifdef CONFIG_USBMSC_COMPOSITE +int usbmsc_classobject(FAR void *handle, + FAR struct usbdevclass_driver_s **classdev) +{ + int ret; + + DEBUGASSERT(handle && classdev); + + /* Export the LUNs as with the "standalone" USB mass storage driver, but + * don't register the class instance with the USB device infrastructure. + */ + + ret = usbmsc_exportluns(handle); + if (ret == OK) + { + /* On sucess, return an (typed) instance of the class instance */ + + *classdev = (FAR struct usbdevclass_driver_s *) + &((FAR struct usbmsc_alloc_s *)handle)->dev; + } + return ret; +} +#endif + +/**************************************************************************** * Name: usbmsc_uninitialize * * Description: |