Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
108f6c2b
Commit
108f6c2b
authored
14 years ago
by
patacongo
Browse files
Options
Downloads
Patches
Plain Diff
update
git-svn-id:
svn://svn.code.sf.net/p/nuttx/code/trunk@3175
42af7a65-404d-4744-a932-0658087f49c3
parent
ce984b70
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/usbhost/usbhost_storage.c
+14
-6
14 additions, 6 deletions
drivers/usbhost/usbhost_storage.c
include/nuttx/usb/usbhost.h
+12
-6
12 additions, 6 deletions
include/nuttx/usb/usbhost.h
with
26 additions
and
12 deletions
drivers/usbhost/usbhost_storage.c
+
14
−
6
View file @
108f6c2b
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
include/nuttx/usb/usbhost.h
+
12
−
6
View file @
108f6c2b
...
...
@@ -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 */
};
/************************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment