AG903ライブラリリファレンス
内容インデックスホーム
Body Source
本文ソース
1: uhs_status_t Usb_HubApi_GetStatus( struct usb_hub_info* hub_info, void* buf, uhs_ubit16_t port_num ){ 2: 3: uhs_status_t retval = UDI_OK; 4: uhs_status_t result = UDI_OK; 5: 6: 7: 8: 9: if( ( g_usb_hub_stat != USB_HUB_IDLE ) && ( g_usb_hub_stat != USB_HUB_RUN ) ){ 10: uhs_debug_print( DBG_ERR, ( "Usb_HubApi_GetStatus: status error" ) ); 11: HUB_REPORT_ERROR( USBCLS_HUB_INVALID_STATUS, 0 ); 12: return UDI_STAT_INVALID_STATE; 13: } 14: 15: 16: 17: 18: if( ( hub_info == NULL ) || ( buf == NULL ) ){ 19: uhs_debug_print( DBG_ERR, ( "Usb_HubApi_GetStatus: parameter error" ) ); 20: HUB_REPORT_ERROR( USBCLS_HUB_INVALID_PARAMETER, 0 ); 21: return UDI_STAT_DATA_ERROR; 22: } 23: if( hub_info->port_num < port_num ){ 24: uhs_debug_print( DBG_ERR, ( "Usb_HubApi_GetFeature: parameter error" ) ); 25: HUB_REPORT_ERROR( USBCLS_HUB_INVALID_PARAMETER, 0 ); 26: return UDI_STAT_DATA_ERROR; 27: } 28: 29: 30: 31: 32: retval = kernel_acquisition_semaphore( &(hub_info->hub_info_sem), USB_HOST_SEMTIMEOUT, in_interrupt() ); 33: if( retval != UDI_OK ){ 34: uhs_debug_print( DBG_ERR, ( "Usb_HubApi_GetStatus: semaphore error" ) ); 35: HUB_REPORT_WARNING( USBCLS_HUB_RESOURCE_UNAVAIL, 0 ); 36: return retval; 37: } 38: 39: 40: 41: 42: uhs_debug_print( DBG_ERR, ( "Get Status called by external module( Usb_HubApi_GetStatus() )" ) ); 43: result = Usb_Hub_GetStatus( hub_info, buf, port_num ); 44: if( result != UDI_OK ){ 45: uhs_debug_print( DBG_ERR, ( "Usb_HubApi_PortDevDttached: PortDevDetach error" ) ); 46: HUB_REPORT_WARNING( USBCLS_HUB_ILLEGAL_ERROR, 0 ); 47: } 48: 49: 50: 51: 52: retval = kernel_release_semaphore( &(hub_info->hub_info_sem), in_interrupt() ); 53: if( retval != UDI_OK ){ 54: uhs_debug_print( DBG_ERR, ( "Usb_HubApi_GetStatus: semaphore error" ) ); 55: HUB_REPORT_ERROR( USBCLS_HUB_RESOURCE_UNAVAIL, 0 ); 56: 57: if( result == UDI_OK ){ 58: return retval; 59: } 60: } 61: 62: return result; 63: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.