Lines Matching full:line
1061 char line[1024];
1071 snprintf(line, sizeof(line), "%s/devices", usb_host_device_path);
1072 f = fopen(line, "r");
1081 if (fgets(line, sizeof(line), f) == NULL)
1083 if (strlen(line) > 0)
1084 line[strlen(line) - 1] = '\0';
1085 if (line[0] == 'T' && line[1] == ':') {
1093 if (get_tag_value(buf, sizeof(buf), line, "Bus=", " ") < 0)
1096 if (get_tag_value(buf, sizeof(buf), line, "Dev#=", " ") < 0)
1099 if (get_tag_value(buf, sizeof(buf), line, "Spd=", " ") < 0)
1112 } else if (line[0] == 'P' && line[1] == ':') {
1113 if (get_tag_value(buf, sizeof(buf), line, "Vendor=", " ") < 0)
1116 if (get_tag_value(buf, sizeof(buf), line, "ProdID=", " ") < 0)
1119 } else if (line[0] == 'S' && line[1] == ':') {
1120 if (get_tag_value(buf, sizeof(buf), line, "Product=", "") < 0)
1123 } else if (line[0] == 'D' && line[1] == ':') {
1124 if (get_tag_value(buf, sizeof(buf), line, "Cls=", " (") < 0)
1144 * @line address of buffer to put file contents in
1145 * @line_size size of line
1149 * @return 0 failed, 1 succeeded ('line' contains data)
1151 static int usb_host_read_file(char *line, size_t line_size, const char *device_file, const char *device_name)
1162 fgets(line, line_size, f);
1182 char line[1024];
1201 if (!usb_host_read_file(line, sizeof(line), "devnum", de->d_name))
1203 if (sscanf(line, "%d", &addr) != 1)
1206 if (!usb_host_read_file(line, sizeof(line), "bDeviceClass",
1209 if (sscanf(line, "%x", &class_id) != 1)
1212 if (!usb_host_read_file(line, sizeof(line), "idVendor", de->d_name))
1214 if (sscanf(line, "%x", &vendor_id) != 1)
1217 if (!usb_host_read_file(line, sizeof(line), "idProduct",
1220 if (sscanf(line, "%x", &product_id) != 1)
1223 if (!usb_host_read_file(line, sizeof(line), "product",
1227 if (strlen(line) > 0)
1228 line[strlen(line) - 1] = '\0';
1229 pstrcpy(product_name, sizeof(product_name), line);
1232 if (!usb_host_read_file(line, sizeof(line), "speed", de->d_name))
1234 if (!strcmp(line, "480\n"))
1236 else if (!strcmp(line, "1.5\n"))