@@ -179,15 +179,15 @@ static int parse_hub_descriptor(struct usb_hub_descriptor *desc, uint16_t length
179179 USB_LOG_ERR ("unexpected descriptor 0x%02x\r\n" , desc -> bDescriptorType );
180180 return -2 ;
181181 } else {
182- USB_LOG_RAW ("Hub Descriptor:\r\n" );
183- USB_LOG_RAW ("bLength: 0x%02x \r\n" , desc -> bLength );
184- USB_LOG_RAW ("bDescriptorType: 0x%02x \r\n" , desc -> bDescriptorType );
185- USB_LOG_RAW ("bNbrPorts: 0x%02x \r\n" , desc -> bNbrPorts );
186- USB_LOG_RAW ("wHubCharacteristics: 0x%04x \r\n" , desc -> wHubCharacteristics );
187- USB_LOG_RAW ("bPwrOn2PwrGood: 0x%02x \r\n" , desc -> bPwrOn2PwrGood );
188- USB_LOG_RAW ("bHubContrCurrent: 0x%02x \r\n" , desc -> bHubContrCurrent );
189- USB_LOG_RAW ("DeviceRemovable: 0x%02x \r\n" , desc -> DeviceRemovable );
190- USB_LOG_RAW ("PortPwrCtrlMask: 0x%02x \r\n" , desc -> PortPwrCtrlMask );
182+ USB_LOG_DBG ("Hub Descriptor:\r\n" );
183+ USB_LOG_DBG ("bLength: 0x%02x \r\n" , desc -> bLength );
184+ USB_LOG_DBG ("bDescriptorType: 0x%02x \r\n" , desc -> bDescriptorType );
185+ USB_LOG_DBG ("bNbrPorts: 0x%02x \r\n" , desc -> bNbrPorts );
186+ USB_LOG_DBG ("wHubCharacteristics: 0x%04x \r\n" , desc -> wHubCharacteristics );
187+ USB_LOG_DBG ("bPwrOn2PwrGood: 0x%02x \r\n" , desc -> bPwrOn2PwrGood );
188+ USB_LOG_DBG ("bHubContrCurrent: 0x%02x \r\n" , desc -> bHubContrCurrent );
189+ USB_LOG_DBG ("DeviceRemovable: 0x%02x \r\n" , desc -> DeviceRemovable );
190+ USB_LOG_DBG ("PortPwrCtrlMask: 0x%02x \r\n" , desc -> PortPwrCtrlMask );
191191 }
192192 return 0 ;
193193}
@@ -203,14 +203,14 @@ static int parse_hub_ss_descriptor(struct usb_hub_ss_descriptor *desc, uint16_t
203203 USB_LOG_ERR ("unexpected descriptor 0x%02x\r\n" , desc -> bDescriptorType );
204204 return -2 ;
205205 } else {
206- USB_LOG_RAW ("SuperSpeed Hub Descriptor:\r\n" );
207- USB_LOG_RAW ("bLength: 0x%02x \r\n" , desc -> bLength );
208- USB_LOG_RAW ("bDescriptorType: 0x%02x \r\n" , desc -> bDescriptorType );
209- USB_LOG_RAW ("bNbrPorts: 0x%02x \r\n" , desc -> bNbrPorts );
210- USB_LOG_RAW ("wHubCharacteristics: 0x%04x \r\n" , desc -> wHubCharacteristics );
211- USB_LOG_RAW ("bPwrOn2PwrGood: 0x%02x \r\n" , desc -> bPwrOn2PwrGood );
212- USB_LOG_RAW ("bHubContrCurrent: 0x%02x \r\n" , desc -> bHubContrCurrent );
213- USB_LOG_RAW ("DeviceRemovable: 0x%02x \r\n" , desc -> DeviceRemovable );
206+ USB_LOG_DBG ("SuperSpeed Hub Descriptor:\r\n" );
207+ USB_LOG_DBG ("bLength: 0x%02x \r\n" , desc -> bLength );
208+ USB_LOG_DBG ("bDescriptorType: 0x%02x \r\n" , desc -> bDescriptorType );
209+ USB_LOG_DBG ("bNbrPorts: 0x%02x \r\n" , desc -> bNbrPorts );
210+ USB_LOG_DBG ("wHubCharacteristics: 0x%04x \r\n" , desc -> wHubCharacteristics );
211+ USB_LOG_DBG ("bPwrOn2PwrGood: 0x%02x \r\n" , desc -> bPwrOn2PwrGood );
212+ USB_LOG_DBG ("bHubContrCurrent: 0x%02x \r\n" , desc -> bHubContrCurrent );
213+ USB_LOG_DBG ("DeviceRemovable: 0x%02x \r\n" , desc -> DeviceRemovable );
214214 }
215215 return 0 ;
216216}
@@ -403,7 +403,7 @@ static int usbh_hub_connect(struct usbh_hubport *hport, uint8_t intf)
403403
404404 for (uint8_t port = 0 ; port < hub -> nports ; port ++ ) {
405405 ret = usbh_hub_get_portstatus (hub , port + 1 , & port_status );
406- USB_LOG_INFO ("port %u, status:0x%02x , change:0x%02x\r\n" , port + 1 , port_status .wPortStatus , port_status .wPortChange );
406+ USB_LOG_DBG ("port %u, status:0x%03x , change:0x%02x\r\n" , port + 1 , port_status .wPortStatus , port_status .wPortChange );
407407 if (ret < 0 ) {
408408 return ret ;
409409 }
@@ -497,7 +497,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
497497 portstatus = port_status .wPortStatus ;
498498 portchange = port_status .wPortChange ;
499499
500- USB_LOG_DBG ("port %u, status:0x%02x , change:0x%02x\r\n" , port + 1 , portstatus , portchange );
500+ USB_LOG_DBG ("port %u, status:0x%03x , change:0x%02x\r\n" , port + 1 , portstatus , portchange );
501501
502502 /* First, clear all change bits */
503503 mask = 1 ;
@@ -532,7 +532,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
532532 portstatus = port_status .wPortStatus ;
533533 portchange = port_status .wPortChange ;
534534
535- USB_LOG_DBG ("Port %u, status:0x%02x , change:0x%02x\r\n" , port + 1 , portstatus , portchange );
535+ USB_LOG_DBG ("Port %u, status:0x%03x , change:0x%02x\r\n" , port + 1 , portstatus , portchange );
536536
537537 if (!(portchange & HUB_PORT_STATUS_C_CONNECTION ) &&
538538 ((portstatus & HUB_PORT_STATUS_CONNECTION ) == connection )) {
@@ -562,7 +562,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
562562 if (portstatus & HUB_PORT_STATUS_CONNECTION ) {
563563 ret = usbh_hub_set_feature (hub , port + 1 , HUB_PORT_FEATURE_RESET );
564564 if (ret < 0 ) {
565- USB_LOG_ERR ("Failed to reset port %u,errorcode:%d\r\n" , port , ret );
565+ USB_LOG_ERR ("Failed to reset port %u, errorcode: %d\r\n" , port + 1 , ret );
566566 continue ;
567567 }
568568
@@ -576,11 +576,15 @@ static void usbh_hub_events(struct usbh_hub *hub)
576576
577577 portstatus = port_status .wPortStatus ;
578578 portchange = port_status .wPortChange ;
579+
580+ USB_LOG_DBG ("Port %u, status:0x%03x, change:0x%02x\r\n" , port + 1 , portstatus , portchange );
581+
579582 if (!(portstatus & HUB_PORT_STATUS_RESET ) && (portstatus & HUB_PORT_STATUS_ENABLE )) {
580583 if (portchange & HUB_PORT_STATUS_C_RESET ) {
581584 ret = usbh_hub_clear_feature (hub , port + 1 , HUB_PORT_FEATURE_C_RESET );
582585 if (ret < 0 ) {
583- USB_LOG_ERR ("Failed to clear port %u reset change, errorcode: %d\r\n" , port , ret );
586+ USB_LOG_ERR ("Failed to clear port %u reset change, errorcode: %d\r\n" , port + 1 , ret );
587+ continue ;
584588 }
585589 }
586590
0 commit comments