Skip to content

Commit d9045f6

Browse files
committed
refactor(usbh): Cleaned up parent_dev_hdl from the usbh object
1 parent ac14663 commit d9045f6

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

host/usb/private_include/usbh.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ typedef struct {
5959
} dev_gone_data;
6060
struct {
6161
unsigned int dev_uid;
62-
usb_device_handle_t parent_dev_hdl;
63-
uint8_t port_num;
6462
} dev_free_data;
6563
};
6664
} usbh_event_data_t;
@@ -139,8 +137,6 @@ typedef struct {
139137
unsigned int uid; /**< Unique ID assigned to the device */
140138
usb_speed_t speed; /**< Device's speed */
141139
hcd_port_handle_t root_port_hdl; /**< Handle of the port that the device is connected to */
142-
usb_device_handle_t parent_dev_hdl; /**< Parent's device handle */
143-
uint8_t parent_port_num; /**< Parent's port number */
144140
} usbh_dev_params_t;
145141

146142
// ---------------------- USBH Processing Functions ----------------------------

host/usb/src/hub.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ static esp_err_t dev_tree_node_new(void *parent, uint8_t port_num, usb_speed_t s
189189
.uid = dev_tree_node->uid,
190190
.speed = speed,
191191
.root_port_hdl = p_hub_driver_obj->constant.root_port_hdl, // Always the same for all devices
192-
// TODO: IDF-10023 Move parent-child tree management responsibility to Hub Driver
193-
.parent_dev_hdl = NULL,
194-
.parent_port_num = port_num,
195192
};
196193

197194
ret = usbh_devs_add(&params);

host/usb/src/usbh.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ struct device_s {
7979
// Assigned on device allocation and remain constant for the device's lifetime
8080
hcd_pipe_handle_t default_pipe; /**< Pipe handle for Control EP0 */
8181
hcd_port_handle_t port_hdl; /**< HCD port handle */
82-
usb_device_handle_t parent_dev_hdl; /**< Device's parent device handle. NULL if device is connected to the root port */
83-
uint8_t parent_port_num; /**< Device's parent port number. 0 if device connected to the root port */
8482
usb_speed_t speed; /**< Device's speed */
8583
unsigned int uid; /**< Device's Unique ID */
8684
/*
@@ -388,8 +386,6 @@ static esp_err_t device_alloc(usbh_dev_params_t *params, device_t **dev_obj_ret)
388386
dev_obj->dynamic.state = USB_DEVICE_STATE_DEFAULT;
389387
dev_obj->constant.default_pipe = default_pipe_hdl;
390388
dev_obj->constant.port_hdl = params->root_port_hdl;
391-
dev_obj->constant.parent_dev_hdl = params->parent_dev_hdl;
392-
dev_obj->constant.parent_port_num = params->parent_port_num;
393389
dev_obj->constant.speed = params->speed;
394390
dev_obj->constant.uid = params->uid;
395391
// Note: Enumeration related dev_obj->constant fields are initialized later using usbh_dev_set_...() functions
@@ -587,8 +583,6 @@ static inline void handle_free(device_t *dev_obj)
587583
{
588584
// Cache a copy of the device's address as we are about to free the device object
589585
const unsigned int dev_uid = dev_obj->constant.uid;
590-
usb_device_handle_t parent_dev_hdl = dev_obj->constant.parent_dev_hdl;
591-
const uint8_t parent_port_num = dev_obj->constant.parent_port_num;
592586
bool all_free;
593587
ESP_LOGD(USBH_TAG, "Freeing device %d", dev_obj->constant.address);
594588

@@ -613,8 +607,6 @@ static inline void handle_free(device_t *dev_obj)
613607
.event = USBH_EVENT_DEV_FREE,
614608
.dev_free_data = {
615609
.dev_uid = dev_uid,
616-
.parent_dev_hdl = parent_dev_hdl,
617-
.port_num = parent_port_num,
618610
}
619611
};
620612
p_usbh_obj->constant.event_cb(&event_data, p_usbh_obj->constant.event_cb_arg);

0 commit comments

Comments
 (0)