aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/usbh/dev/hub.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/include/usbh/dev/hub.h')
-rw-r--r--os/hal/include/usbh/dev/hub.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/os/hal/include/usbh/dev/hub.h b/os/hal/include/usbh/dev/hub.h
index 07e88e6..406fbaf 100644
--- a/os/hal/include/usbh/dev/hub.h
+++ b/os/hal/include/usbh/dev/hub.h
@@ -1,6 +1,6 @@
/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
- Copyright (C) 2015 Diego Ismirlian, TISA, (dismirlian (at) google's mail)
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+ Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
#if HAL_USE_USBH
#if HAL_USBH_USE_HUB
-typedef struct USBHHubDriver {
+struct USBHHubDriver {
/* inherited from abstract class driver */
_usbh_base_classdriver_data
@@ -32,19 +32,19 @@ typedef struct USBHHubDriver {
usbh_ep_t epint;
usbh_urb_t urb;
- USBH_DEFINE_BUFFER(uint8_t, scbuff[4]);
+ USBH_DECLARE_STRUCT_MEMBER(uint8_t scbuff[4]);
volatile uint32_t statuschange;
uint16_t status;
uint16_t c_status;
usbh_port_t *ports;
- USBH_DEFINE_BUFFER(usbh_hub_descriptor_t, hubDesc);
+ USBH_DECLARE_STRUCT_MEMBER(usbh_hub_descriptor_t hubDesc);
/* Low level part */
_usbh_hub_ll_data
-} USBHHubDriver;
+};
extern USBHHubDriver USBHHUBD[HAL_USBHHUB_MAX_INSTANCES];
@@ -60,7 +60,7 @@ usbh_urbstatus_t usbhhubControlRequest(USBHDriver *host, USBHHubDriver *hub,
static inline usbh_urbstatus_t usbhhubClearFeaturePort(usbh_port_t *port, uint8_t feature) {
return usbhhubControlRequest(port->device.host, port->hub,
- USBH_REQTYPE_OUT | USBH_REQTYPE_CLASS | USBH_REQTYPE_OTHER,
+ USBH_REQTYPE_DIR_OUT | USBH_REQTYPE_TYPE_CLASS | USBH_REQTYPE_RECIP_OTHER,
USBH_REQ_CLEAR_FEATURE,
feature,
port->number,
@@ -70,7 +70,7 @@ static inline usbh_urbstatus_t usbhhubClearFeaturePort(usbh_port_t *port, uint8_
static inline usbh_urbstatus_t usbhhubClearFeatureHub(USBHDriver *host, USBHHubDriver *hub, uint8_t feature) {
return usbhhubControlRequest(host, hub,
- USBH_REQTYPE_OUT | USBH_REQTYPE_CLASS | USBH_REQTYPE_DEVICE,
+ USBH_REQTYPE_DIR_OUT | USBH_REQTYPE_TYPE_CLASS | USBH_REQTYPE_RECIP_DEVICE,
USBH_REQ_CLEAR_FEATURE,
feature,
0,
@@ -80,7 +80,7 @@ static inline usbh_urbstatus_t usbhhubClearFeatureHub(USBHDriver *host, USBHHubD
static inline usbh_urbstatus_t usbhhubSetFeaturePort(usbh_port_t *port, uint8_t feature) {
return usbhhubControlRequest(port->device.host, port->hub,
- USBH_REQTYPE_OUT | USBH_REQTYPE_CLASS | USBH_REQTYPE_OTHER,
+ USBH_REQTYPE_DIR_OUT | USBH_REQTYPE_TYPE_CLASS | USBH_REQTYPE_RECIP_OTHER,
USBH_REQ_SET_FEATURE,
feature,
port->number,
@@ -88,7 +88,6 @@ static inline usbh_urbstatus_t usbhhubSetFeaturePort(usbh_port_t *port, uint8_t
0);
}
-void usbhhubObjectInit(USBHHubDriver *hubdp);
#else
static inline usbh_urbstatus_t usbhhubControlRequest(USBHDriver *host,
@@ -103,7 +102,7 @@ static inline usbh_urbstatus_t usbhhubControlRequest(USBHDriver *host,
static inline usbh_urbstatus_t usbhhubClearFeaturePort(usbh_port_t *port, uint8_t feature) {
return usbhhubControlRequest(port->device.host,
- USBH_REQTYPE_OUT | USBH_REQTYPE_CLASS | USBH_REQTYPE_OTHER,
+ USBH_REQTYPE_DIR_OUT | USBH_REQTYPE_TYPE_CLASS | USBH_REQTYPE_RECIP_OTHER,
USBH_REQ_CLEAR_FEATURE,
feature,
port->number,
@@ -113,7 +112,7 @@ static inline usbh_urbstatus_t usbhhubClearFeaturePort(usbh_port_t *port, uint8_
static inline usbh_urbstatus_t usbhhubClearFeatureHub(USBHDriver *host, uint8_t feature) {
return usbhhubControlRequest(host,
- USBH_REQTYPE_OUT | USBH_REQTYPE_CLASS | USBH_REQTYPE_DEVICE,
+ USBH_REQTYPE_DIR_OUT | USBH_REQTYPE_TYPE_CLASS | USBH_REQTYPE_RECIP_DEVICE,
USBH_REQ_CLEAR_FEATURE,
feature,
0,
@@ -123,7 +122,7 @@ static inline usbh_urbstatus_t usbhhubClearFeatureHub(USBHDriver *host, uint8_t
static inline usbh_urbstatus_t usbhhubSetFeaturePort(usbh_port_t *port, uint8_t feature) {
return usbhhubControlRequest(port->device.host,
- USBH_REQTYPE_OUT | USBH_REQTYPE_CLASS | USBH_REQTYPE_OTHER,
+ USBH_REQTYPE_DIR_OUT | USBH_REQTYPE_TYPE_CLASS | USBH_REQTYPE_RECIP_OTHER,
USBH_REQ_SET_FEATURE,
feature,
port->number,