1 /* usbreset -- send a USB port reset to a USB device */
9 #include <linux/usbdevice_fs.h>
12 int main(int argc
, char **argv
)
19 fprintf(stderr
, "Usage: usbreset device-filename\n");
24 fd
= open(filename
, O_WRONLY
);
26 perror("Error opening output file");
30 printf("Resetting USB device %s\n", filename
);
31 rc
= ioctl(fd
, USBDEVFS_RESET
, 0);
33 perror("Error in ioctl");
36 printf("Reset successful\n");