mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
DM: remove unused function usb_native_is_ss_port
Change-Id: I7991560b40b936776e45f7b81fee085935eb6eae Tracked-On: #3123 Signed-off-by: Ying Liu <ying2.liu@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
7e80a6eee3
commit
2d6e6ca375
@ -131,50 +131,6 @@ usb_native_is_bus_existed(uint8_t bus_num)
|
|||||||
return access(buf, R_OK) ? 0 : 1;
|
return access(buf, R_OK) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
usb_native_is_ss_port(uint8_t bus_of_port)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char speed[8];
|
|
||||||
int rc, fd;
|
|
||||||
int usb2_speed_sz = sizeof(NATIVE_USB2_SPEED);
|
|
||||||
int usb3_speed_sz = sizeof(NATIVE_USB3_SPEED);
|
|
||||||
|
|
||||||
assert(usb_native_is_bus_existed(bus_of_port));
|
|
||||||
snprintf(buf, sizeof(buf), "%s/usb%d/speed", NATIVE_USBSYS_DEVDIR,
|
|
||||||
bus_of_port);
|
|
||||||
if (access(buf, R_OK)) {
|
|
||||||
UPRINTF(LWRN, "can't find speed file\r\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
fd = open(buf, O_RDONLY);
|
|
||||||
if (fd < 0) {
|
|
||||||
UPRINTF(LWRN, "fail to open maxchild file\r\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = read(fd, &speed, sizeof(speed));
|
|
||||||
if (rc < 0) {
|
|
||||||
UPRINTF(LWRN, "fail to read speed file\r\n");
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rc < usb2_speed_sz) {
|
|
||||||
UPRINTF(LWRN, "read invalid speed data\r\n");
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strncmp(speed, NATIVE_USB3_SPEED, usb3_speed_sz))
|
|
||||||
goto errout;
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return 1;
|
|
||||||
errout:
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
usb_native_is_port_existed(uint8_t bus_num, uint8_t port_num)
|
usb_native_is_port_existed(uint8_t bus_num, uint8_t port_num)
|
||||||
{
|
{
|
||||||
|
@ -251,7 +251,6 @@ static inline void usb_set_log_level(int level) { usb_log_level = level; }
|
|||||||
void usb_parse_log_level(char level);
|
void usb_parse_log_level(char level);
|
||||||
struct usb_devemu *usb_emu_finddev(char *name);
|
struct usb_devemu *usb_emu_finddev(char *name);
|
||||||
int usb_native_is_bus_existed(uint8_t bus_num);
|
int usb_native_is_bus_existed(uint8_t bus_num);
|
||||||
int usb_native_is_ss_port(uint8_t bus_of_port);
|
|
||||||
int usb_native_is_port_existed(uint8_t bus_num, uint8_t port_num);
|
int usb_native_is_port_existed(uint8_t bus_num, uint8_t port_num);
|
||||||
struct usb_data_xfer_block *usb_data_xfer_append(struct usb_data_xfer *xfer,
|
struct usb_data_xfer_block *usb_data_xfer_append(struct usb_data_xfer *xfer,
|
||||||
void *buf,
|
void *buf,
|
||||||
|
Loading…
Reference in New Issue
Block a user