Lines Matching refs:dev
30 usbreset /dev/usbB.D
66 static char *sysfs_attr(const char *dev, const char *attr)
73 snprintf(path, sizeof(path) - 1, "/sys/bus/usb/devices/%s/%s", dev, attr);
91 static struct usbentry dev;
101 memset(&dev, 0, sizeof(dev));
104 dev.bus_num = strtoul(attr, NULL, 10);
107 dev.dev_num = strtoul(attr, NULL, 10);
110 dev.vendor_id = strtoul(attr, NULL, 16);
113 dev.product_id = strtoul(attr, NULL, 16);
116 strcpy(dev.vendor_name, attr);
119 strcpy(dev.product_name, attr);
121 if (dev.bus_num && dev.dev_num && dev.vendor_id && dev.product_id)
122 return &dev;
130 struct usbentry *dev;
135 while ((dev = parse_devlist(devs)) != NULL)
138 dev->bus_num, dev->dev_num,
139 dev->vendor_id, dev->product_id,
140 dev->product_name);
146 struct usbentry * find_device(int *bus, int *dev,
159 if ((bus && (e->bus_num == *bus) && (e->dev_num == *dev)) ||
173 static void reset_device(struct usbentry *dev)
178 snprintf(path, sizeof(path) - 1, "/dev/bus/usb/%03d/%03d",
179 dev->bus_num, dev->dev_num);
181 printf("Resetting %s ... ", dev->product_name);
202 struct usbentry *dev;
206 dev = find_device(&id1, &id2, NULL, NULL, NULL);
210 dev = find_device(NULL, NULL, &id1, &id2, NULL);
214 dev = find_device(NULL, NULL, NULL, NULL, argv[1]);
227 if (!dev)
233 reset_device(dev);