+ * Send a USB port reset to a USB device
+ * gcc -o usbreset usbreset.c
+ * cp ./usbreset /usr/local/bin/usbreset
+#include <linux/usbdevice_fs.h>
+int main(int argc, char **argv) {
+ /* usbreset takes exactly 1 argument: the USB device filename */
+ fprintf(stderr, "Usage: usbreset device-filename\n");
+ /* Our (only) argument is the device filename */
+ /* Open the file descriptor.. */
+ fd = open(filename, O_WRONLY);
+ /* ...and make sure it was sucessful */
+ perror("Error opening output file");
+ printf("Resetting USB device %s\n", filename);
+ rc = ioctl(fd, USBDEVFS_RESET, 0);
+ perror("Error in ioctl");
+ printf("Reset successful\n");