| .. | .. |
|---|
| 1127 | 1127 | + n; |
|---|
| 1128 | 1128 | memcpy(unit->extension.bmControls, &buffer[23+p], 2*n); |
|---|
| 1129 | 1129 | |
|---|
| 1130 | | - if (buffer[24+p+2*n] != 0) |
|---|
| 1131 | | - usb_string(udev, buffer[24+p+2*n], unit->name, |
|---|
| 1132 | | - sizeof(unit->name)); |
|---|
| 1133 | | - else |
|---|
| 1130 | + if (buffer[24+p+2*n] == 0 || |
|---|
| 1131 | + usb_string(udev, buffer[24+p+2*n], unit->name, sizeof(unit->name)) < 0) |
|---|
| 1134 | 1132 | sprintf(unit->name, "Extension %u", buffer[3]); |
|---|
| 1135 | 1133 | |
|---|
| 1136 | 1134 | list_add_tail(&unit->list, &dev->entities); |
|---|
| .. | .. |
|---|
| 1255 | 1253 | memcpy(term->media.bmTransportModes, &buffer[10+n], p); |
|---|
| 1256 | 1254 | } |
|---|
| 1257 | 1255 | |
|---|
| 1258 | | - if (buffer[7] != 0) |
|---|
| 1259 | | - usb_string(udev, buffer[7], term->name, |
|---|
| 1260 | | - sizeof(term->name)); |
|---|
| 1261 | | - else if (UVC_ENTITY_TYPE(term) == UVC_ITT_CAMERA) |
|---|
| 1262 | | - sprintf(term->name, "Camera %u", buffer[3]); |
|---|
| 1263 | | - else if (UVC_ENTITY_TYPE(term) == UVC_ITT_MEDIA_TRANSPORT_INPUT) |
|---|
| 1264 | | - sprintf(term->name, "Media %u", buffer[3]); |
|---|
| 1265 | | - else |
|---|
| 1266 | | - sprintf(term->name, "Input %u", buffer[3]); |
|---|
| 1256 | + if (buffer[7] == 0 || |
|---|
| 1257 | + usb_string(udev, buffer[7], term->name, sizeof(term->name)) < 0) { |
|---|
| 1258 | + if (UVC_ENTITY_TYPE(term) == UVC_ITT_CAMERA) |
|---|
| 1259 | + sprintf(term->name, "Camera %u", buffer[3]); |
|---|
| 1260 | + if (UVC_ENTITY_TYPE(term) == UVC_ITT_MEDIA_TRANSPORT_INPUT) |
|---|
| 1261 | + sprintf(term->name, "Media %u", buffer[3]); |
|---|
| 1262 | + else |
|---|
| 1263 | + sprintf(term->name, "Input %u", buffer[3]); |
|---|
| 1264 | + } |
|---|
| 1267 | 1265 | |
|---|
| 1268 | 1266 | list_add_tail(&term->list, &dev->entities); |
|---|
| 1269 | 1267 | break; |
|---|
| .. | .. |
|---|
| 1295 | 1293 | |
|---|
| 1296 | 1294 | memcpy(term->baSourceID, &buffer[7], 1); |
|---|
| 1297 | 1295 | |
|---|
| 1298 | | - if (buffer[8] != 0) |
|---|
| 1299 | | - usb_string(udev, buffer[8], term->name, |
|---|
| 1300 | | - sizeof(term->name)); |
|---|
| 1301 | | - else |
|---|
| 1296 | + if (buffer[8] == 0 || |
|---|
| 1297 | + usb_string(udev, buffer[8], term->name, sizeof(term->name)) < 0) |
|---|
| 1302 | 1298 | sprintf(term->name, "Output %u", buffer[3]); |
|---|
| 1303 | 1299 | |
|---|
| 1304 | 1300 | list_add_tail(&term->list, &dev->entities); |
|---|
| .. | .. |
|---|
| 1320 | 1316 | |
|---|
| 1321 | 1317 | memcpy(unit->baSourceID, &buffer[5], p); |
|---|
| 1322 | 1318 | |
|---|
| 1323 | | - if (buffer[5+p] != 0) |
|---|
| 1324 | | - usb_string(udev, buffer[5+p], unit->name, |
|---|
| 1325 | | - sizeof(unit->name)); |
|---|
| 1326 | | - else |
|---|
| 1319 | + if (buffer[5+p] == 0 || |
|---|
| 1320 | + usb_string(udev, buffer[5+p], unit->name, sizeof(unit->name)) < 0) |
|---|
| 1327 | 1321 | sprintf(unit->name, "Selector %u", buffer[3]); |
|---|
| 1328 | 1322 | |
|---|
| 1329 | 1323 | list_add_tail(&unit->list, &dev->entities); |
|---|
| .. | .. |
|---|
| 1353 | 1347 | if (dev->uvc_version >= 0x0110) |
|---|
| 1354 | 1348 | unit->processing.bmVideoStandards = buffer[9+n]; |
|---|
| 1355 | 1349 | |
|---|
| 1356 | | - if (buffer[8+n] != 0) |
|---|
| 1357 | | - usb_string(udev, buffer[8+n], unit->name, |
|---|
| 1358 | | - sizeof(unit->name)); |
|---|
| 1359 | | - else |
|---|
| 1350 | + if (buffer[8+n] == 0 || |
|---|
| 1351 | + usb_string(udev, buffer[8+n], unit->name, sizeof(unit->name)) < 0) |
|---|
| 1360 | 1352 | sprintf(unit->name, "Processing %u", buffer[3]); |
|---|
| 1361 | 1353 | |
|---|
| 1362 | 1354 | list_add_tail(&unit->list, &dev->entities); |
|---|
| .. | .. |
|---|
| 1384 | 1376 | unit->extension.bmControls = (u8 *)unit + sizeof(*unit); |
|---|
| 1385 | 1377 | memcpy(unit->extension.bmControls, &buffer[23+p], n); |
|---|
| 1386 | 1378 | |
|---|
| 1387 | | - if (buffer[23+p+n] != 0) |
|---|
| 1388 | | - usb_string(udev, buffer[23+p+n], unit->name, |
|---|
| 1389 | | - sizeof(unit->name)); |
|---|
| 1390 | | - else |
|---|
| 1379 | + if (buffer[23+p+n] == 0 || |
|---|
| 1380 | + usb_string(udev, buffer[23+p+n], unit->name, sizeof(unit->name)) < 0) |
|---|
| 1391 | 1381 | sprintf(unit->name, "Extension %u", buffer[3]); |
|---|
| 1392 | 1382 | |
|---|
| 1393 | 1383 | list_add_tail(&unit->list, &dev->entities); |
|---|
| .. | .. |
|---|
| 2575 | 2565 | .bInterfaceSubClass = 1, |
|---|
| 2576 | 2566 | .bInterfaceProtocol = 0, |
|---|
| 2577 | 2567 | .driver_info = (kernel_ulong_t)&uvc_quirk_probe_minmax }, |
|---|
| 2568 | + /* Logitech, Webcam C910 */ |
|---|
| 2569 | + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
|---|
| 2570 | + | USB_DEVICE_ID_MATCH_INT_INFO, |
|---|
| 2571 | + .idVendor = 0x046d, |
|---|
| 2572 | + .idProduct = 0x0821, |
|---|
| 2573 | + .bInterfaceClass = USB_CLASS_VIDEO, |
|---|
| 2574 | + .bInterfaceSubClass = 1, |
|---|
| 2575 | + .bInterfaceProtocol = 0, |
|---|
| 2576 | + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND)}, |
|---|
| 2577 | + /* Logitech, Webcam B910 */ |
|---|
| 2578 | + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
|---|
| 2579 | + | USB_DEVICE_ID_MATCH_INT_INFO, |
|---|
| 2580 | + .idVendor = 0x046d, |
|---|
| 2581 | + .idProduct = 0x0823, |
|---|
| 2582 | + .bInterfaceClass = USB_CLASS_VIDEO, |
|---|
| 2583 | + .bInterfaceSubClass = 1, |
|---|
| 2584 | + .bInterfaceProtocol = 0, |
|---|
| 2585 | + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND)}, |
|---|
| 2578 | 2586 | /* Logitech Quickcam Fusion */ |
|---|
| 2579 | 2587 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
|---|
| 2580 | 2588 | | USB_DEVICE_ID_MATCH_INT_INFO, |
|---|