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