UVC gadget updates for v4.20 - configfs cleanups, fixes and extensions - Endianness fixes - Miscellaneous cleanups
Showing the changes to include/uapi/linux (1 of 9 files). Show all
Unified · Split
| @@ -192,14 +192,14 @@ struct uvc_descriptor_header { · 191 unmodified lines | |||
| 192 | 192 | ||
| 193 | /* 3.7.2. Video Control Interface Header Descriptor */ | 193 | /* 3.7.2. Video Control Interface Header Descriptor */ |
| 194 | struct uvc_header_descriptor { | 194 | struct uvc_header_descriptor { |
| 195 | __u8 bLength; | 195 | __u8 bLength; |
| 196 | __u8 bDescriptorType; | 196 | __u8 bDescriptorType; |
| 197 | __u8 bDescriptorSubType; | 197 | __u8 bDescriptorSubType; |
| 198 | __u16 bcdUVC; | 198 | __le16 bcdUVC; |
| 199 | __u16 wTotalLength; | 199 | __le16 wTotalLength; |
| 200 | __u32 dwClockFrequency; | 200 | __le32 dwClockFrequency; |
| 201 | __u8 bInCollection; | 201 | __u8 bInCollection; |
| 202 | __u8 baInterfaceNr[]; | 202 | __u8 baInterfaceNr[]; |
| 203 | } __attribute__((__packed__)); | 203 | } __attribute__((__packed__)); |
| 204 | 204 | ||
| 205 | #define UVC_DT_HEADER_SIZE(n) (12+(n)) | 205 | #define UVC_DT_HEADER_SIZE(n) (12+(n)) |
| @@ -209,57 +209,57 @@ struct uvc_header_descriptor { · 3 unmodified lines | |||
| 209 | 209 | ||
| 210 | #define DECLARE_UVC_HEADER_DESCRIPTOR(n) \ | 210 | #define DECLARE_UVC_HEADER_DESCRIPTOR(n) \ |
| 211 | struct UVC_HEADER_DESCRIPTOR(n) { \ | 211 | struct UVC_HEADER_DESCRIPTOR(n) { \ |
| 212 | __u8 bLength; \ | 212 | __u8 bLength; \ |
| 213 | __u8 bDescriptorType; \ | 213 | __u8 bDescriptorType; \ |
| 214 | __u8 bDescriptorSubType; \ | 214 | __u8 bDescriptorSubType; \ |
| 215 | __u16 bcdUVC; \ | 215 | __le16 bcdUVC; \ |
| 216 | __u16 wTotalLength; \ | 216 | __le16 wTotalLength; \ |
| 217 | __u32 dwClockFrequency; \ | 217 | __le32 dwClockFrequency; \ |
| 218 | __u8 bInCollection; \ | 218 | __u8 bInCollection; \ |
| 219 | __u8 baInterfaceNr[n]; \ | 219 | __u8 baInterfaceNr[n]; \ |
| 220 | } __attribute__ ((packed)) | 220 | } __attribute__ ((packed)) |
| 221 | 221 | ||
| 222 | /* 3.7.2.1. Input Terminal Descriptor */ | 222 | /* 3.7.2.1. Input Terminal Descriptor */ |
| 223 | struct uvc_input_terminal_descriptor { | 223 | struct uvc_input_terminal_descriptor { |
| 224 | __u8 bLength; | 224 | __u8 bLength; |
| 225 | __u8 bDescriptorType; | 225 | __u8 bDescriptorType; |
| 226 | __u8 bDescriptorSubType; | 226 | __u8 bDescriptorSubType; |
| 227 | __u8 bTerminalID; | 227 | __u8 bTerminalID; |
| 228 | __u16 wTerminalType; | 228 | __le16 wTerminalType; |
| 229 | __u8 bAssocTerminal; | 229 | __u8 bAssocTerminal; |
| 230 | __u8 iTerminal; | 230 | __u8 iTerminal; |
| 231 | } __attribute__((__packed__)); | 231 | } __attribute__((__packed__)); |
| 232 | 232 | ||
| 233 | #define UVC_DT_INPUT_TERMINAL_SIZE 8 | 233 | #define UVC_DT_INPUT_TERMINAL_SIZE 8 |
| 234 | 234 | ||
| 235 | /* 3.7.2.2. Output Terminal Descriptor */ | 235 | /* 3.7.2.2. Output Terminal Descriptor */ |
| 236 | struct uvc_output_terminal_descriptor { | 236 | struct uvc_output_terminal_descriptor { |
| 237 | __u8 bLength; | 237 | __u8 bLength; |
| 238 | __u8 bDescriptorType; | 238 | __u8 bDescriptorType; |
| 239 | __u8 bDescriptorSubType; | 239 | __u8 bDescriptorSubType; |
| 240 | __u8 bTerminalID; | 240 | __u8 bTerminalID; |
| 241 | __u16 wTerminalType; | 241 | __le16 wTerminalType; |
| 242 | __u8 bAssocTerminal; | 242 | __u8 bAssocTerminal; |
| 243 | __u8 bSourceID; | 243 | __u8 bSourceID; |
| 244 | __u8 iTerminal; | 244 | __u8 iTerminal; |
| 245 | } __attribute__((__packed__)); | 245 | } __attribute__((__packed__)); |
| 246 | 246 | ||
| 247 | #define UVC_DT_OUTPUT_TERMINAL_SIZE 9 | 247 | #define UVC_DT_OUTPUT_TERMINAL_SIZE 9 |
| 248 | 248 | ||
| 249 | /* 3.7.2.3. Camera Terminal Descriptor */ | 249 | /* 3.7.2.3. Camera Terminal Descriptor */ |
| 250 | struct uvc_camera_terminal_descriptor { | 250 | struct uvc_camera_terminal_descriptor { |
| 251 | __u8 bLength; | 251 | __u8 bLength; |
| 252 | __u8 bDescriptorType; | 252 | __u8 bDescriptorType; |
| 253 | __u8 bDescriptorSubType; | 253 | __u8 bDescriptorSubType; |
| 254 | __u8 bTerminalID; | 254 | __u8 bTerminalID; |
| 255 | __u16 wTerminalType; | 255 | __le16 wTerminalType; |
| 256 | __u8 bAssocTerminal; | 256 | __u8 bAssocTerminal; |
| 257 | __u8 iTerminal; | 257 | __u8 iTerminal; |
| 258 | __u16 wObjectiveFocalLengthMin; | 258 | __le16 wObjectiveFocalLengthMin; |
| 259 | __u16 wObjectiveFocalLengthMax; | 259 | __le16 wObjectiveFocalLengthMax; |
| 260 | __u16 wOcularFocalLength; | 260 | __le16 wOcularFocalLength; |
| 261 | __u8 bControlSize; | 261 | __u8 bControlSize; |
| 262 | __u8 bmControls[3]; | 262 | __u8 bmControls[3]; |
| 263 | } __attribute__((__packed__)); | 263 | } __attribute__((__packed__)); |
| 264 | 264 | ||
| 265 | #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n)) | 265 | #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n)) |
| @@ -293,15 +293,15 @@ struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \ · 27 unmodified lines | |||
| 293 | 293 | ||
| 294 | /* 3.7.2.5. Processing Unit Descriptor */ | 294 | /* 3.7.2.5. Processing Unit Descriptor */ |
| 295 | struct uvc_processing_unit_descriptor { | 295 | struct uvc_processing_unit_descriptor { |
| 296 | __u8 bLength; | 296 | __u8 bLength; |
| 297 | __u8 bDescriptorType; | 297 | __u8 bDescriptorType; |
| 298 | __u8 bDescriptorSubType; | 298 | __u8 bDescriptorSubType; |
| 299 | __u8 bUnitID; | 299 | __u8 bUnitID; |
| 300 | __u8 bSourceID; | 300 | __u8 bSourceID; |
| 301 | __u16 wMaxMultiplier; | 301 | __le16 wMaxMultiplier; |
| 302 | __u8 bControlSize; | 302 | __u8 bControlSize; |
| 303 | __u8 bmControls[2]; | 303 | __u8 bmControls[2]; |
| 304 | __u8 iProcessing; | 304 | __u8 iProcessing; |
| 305 | } __attribute__((__packed__)); | 305 | } __attribute__((__packed__)); |
| 306 | 306 | ||
| 307 | #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n)) | 307 | #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n)) |
| @@ -343,29 +343,29 @@ struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \ · 35 unmodified lines | |||
| 343 | 343 | ||
| 344 | /* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */ | 344 | /* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */ |
| 345 | struct uvc_control_endpoint_descriptor { | 345 | struct uvc_control_endpoint_descriptor { |
| 346 | __u8 bLength; | 346 | __u8 bLength; |
| 347 | __u8 bDescriptorType; | 347 | __u8 bDescriptorType; |
| 348 | __u8 bDescriptorSubType; | 348 | __u8 bDescriptorSubType; |
| 349 | __u16 wMaxTransferSize; | 349 | __le16 wMaxTransferSize; |
| 350 | } __attribute__((__packed__)); | 350 | } __attribute__((__packed__)); |
| 351 | 351 | ||
| 352 | #define UVC_DT_CONTROL_ENDPOINT_SIZE 5 | 352 | #define UVC_DT_CONTROL_ENDPOINT_SIZE 5 |
| 353 | 353 | ||
| 354 | /* 3.9.2.1. Input Header Descriptor */ | 354 | /* 3.9.2.1. Input Header Descriptor */ |
| 355 | struct uvc_input_header_descriptor { | 355 | struct uvc_input_header_descriptor { |
| 356 | __u8 bLength; | 356 | __u8 bLength; |
| 357 | __u8 bDescriptorType; | 357 | __u8 bDescriptorType; |
| 358 | __u8 bDescriptorSubType; | 358 | __u8 bDescriptorSubType; |
| 359 | __u8 bNumFormats; | 359 | __u8 bNumFormats; |
| 360 | __u16 wTotalLength; | 360 | __le16 wTotalLength; |
| 361 | __u8 bEndpointAddress; | 361 | __u8 bEndpointAddress; |
| 362 | __u8 bmInfo; | 362 | __u8 bmInfo; |
| 363 | __u8 bTerminalLink; | 363 | __u8 bTerminalLink; |
| 364 | __u8 bStillCaptureMethod; | 364 | __u8 bStillCaptureMethod; |
| 365 | __u8 bTriggerSupport; | 365 | __u8 bTriggerSupport; |
| 366 | __u8 bTriggerUsage; | 366 | __u8 bTriggerUsage; |
| 367 | __u8 bControlSize; | 367 | __u8 bControlSize; |
| 368 | __u8 bmaControls[]; | 368 | __u8 bmaControls[]; |
| 369 | } __attribute__((__packed__)); | 369 | } __attribute__((__packed__)); |
| 370 | 370 | ||
| 371 | #define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p)) | 371 | #define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p)) |
| @@ -375,32 +375,32 @@ struct uvc_input_header_descriptor { · 3 unmodified lines | |||
| 375 | 375 | ||
| 376 | #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ | 376 | #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ |
| 377 | struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \ | 377 | struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \ |
| 378 | __u8 bLength; \ | 378 | __u8 bLength; \ |
| 379 | __u8 bDescriptorType; \ | 379 | __u8 bDescriptorType; \ |
| 380 | __u8 bDescriptorSubType; \ | 380 | __u8 bDescriptorSubType; \ |
| 381 | __u8 bNumFormats; \ | 381 | __u8 bNumFormats; \ |
| 382 | __u16 wTotalLength; \ | 382 | __le16 wTotalLength; \ |
| 383 | __u8 bEndpointAddress; \ | 383 | __u8 bEndpointAddress; \ |
| 384 | __u8 bmInfo; \ | 384 | __u8 bmInfo; \ |
| 385 | __u8 bTerminalLink; \ | 385 | __u8 bTerminalLink; \ |
| 386 | __u8 bStillCaptureMethod; \ | 386 | __u8 bStillCaptureMethod; \ |
| 387 | __u8 bTriggerSupport; \ | 387 | __u8 bTriggerSupport; \ |
| 388 | __u8 bTriggerUsage; \ | 388 | __u8 bTriggerUsage; \ |
| 389 | __u8 bControlSize; \ | 389 | __u8 bControlSize; \ |
| 390 | __u8 bmaControls[p][n]; \ | 390 | __u8 bmaControls[p][n]; \ |
| 391 | } __attribute__ ((packed)) | 391 | } __attribute__ ((packed)) |
| 392 | 392 | ||
| 393 | /* 3.9.2.2. Output Header Descriptor */ | 393 | /* 3.9.2.2. Output Header Descriptor */ |
| 394 | struct uvc_output_header_descriptor { | 394 | struct uvc_output_header_descriptor { |
| 395 | __u8 bLength; | 395 | __u8 bLength; |
| 396 | __u8 bDescriptorType; | 396 | __u8 bDescriptorType; |
| 397 | __u8 bDescriptorSubType; | 397 | __u8 bDescriptorSubType; |
| 398 | __u8 bNumFormats; | 398 | __u8 bNumFormats; |
| 399 | __u16 wTotalLength; | 399 | __le16 wTotalLength; |
| 400 | __u8 bEndpointAddress; | 400 | __u8 bEndpointAddress; |
| 401 | __u8 bTerminalLink; | 401 | __u8 bTerminalLink; |
| 402 | __u8 bControlSize; | 402 | __u8 bControlSize; |
| 403 | __u8 bmaControls[]; | 403 | __u8 bmaControls[]; |
| 404 | } __attribute__((__packed__)); | 404 | } __attribute__((__packed__)); |
| 405 | 405 | ||
| 406 | #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p)) | 406 | #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p)) |
| @@ -410,15 +410,15 @@ struct uvc_output_header_descriptor { · 3 unmodified lines | |||
| 410 | 410 | ||
| 411 | #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ | 411 | #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ |
| 412 | struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \ | 412 | struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \ |
| 413 | __u8 bLength; \ | 413 | __u8 bLength; \ |
| 414 | __u8 bDescriptorType; \ | 414 | __u8 bDescriptorType; \ |
| 415 | __u8 bDescriptorSubType; \ | 415 | __u8 bDescriptorSubType; \ |
| 416 | __u8 bNumFormats; \ | 416 | __u8 bNumFormats; \ |
| 417 | __u16 wTotalLength; \ | 417 | __le16 wTotalLength; \ |
| 418 | __u8 bEndpointAddress; \ | 418 | __u8 bEndpointAddress; \ |
| 419 | __u8 bTerminalLink; \ | 419 | __u8 bTerminalLink; \ |
| 420 | __u8 bControlSize; \ | 420 | __u8 bControlSize; \ |
| 421 | __u8 bmaControls[p][n]; \ | 421 | __u8 bmaControls[p][n]; \ |
| 422 | } __attribute__ ((packed)) | 422 | } __attribute__ ((packed)) |
| 423 | 423 | ||
| 424 | /* 3.9.2.6. Color matching descriptor */ | 424 | /* 3.9.2.6. Color matching descriptor */ |
| @@ -473,19 +473,19 @@ struct uvc_format_uncompressed { · 48 unmodified lines | |||
| 473 | 473 | ||
| 474 | /* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */ | 474 | /* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */ |
| 475 | struct uvc_frame_uncompressed { | 475 | struct uvc_frame_uncompressed { |
| 476 | __u8 bLength; | 476 | __u8 bLength; |
| 477 | __u8 bDescriptorType; | 477 | __u8 bDescriptorType; |
| 478 | __u8 bDescriptorSubType; | 478 | __u8 bDescriptorSubType; |
| 479 | __u8 bFrameIndex; | 479 | __u8 bFrameIndex; |
| 480 | __u8 bmCapabilities; | 480 | __u8 bmCapabilities; |
| 481 | __u16 wWidth; | 481 | __le16 wWidth; |
| 482 | __u16 wHeight; | 482 | __le16 wHeight; |
| 483 | __u32 dwMinBitRate; | 483 | __le32 dwMinBitRate; |
| 484 | __u32 dwMaxBitRate; | 484 | __le32 dwMaxBitRate; |
| 485 | __u32 dwMaxVideoFrameBufferSize; | 485 | __le32 dwMaxVideoFrameBufferSize; |
| 486 | __u32 dwDefaultFrameInterval; | 486 | __le32 dwDefaultFrameInterval; |
| 487 | __u8 bFrameIntervalType; | 487 | __u8 bFrameIntervalType; |
| 488 | __u32 dwFrameInterval[]; | 488 | __le32 dwFrameInterval[]; |
| 489 | } __attribute__((__packed__)); | 489 | } __attribute__((__packed__)); |
| 490 | 490 | ||
| 491 | #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n)) | 491 | #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n)) |
| @@ -495,19 +495,19 @@ struct uvc_frame_uncompressed { · 3 unmodified lines | |||
| 495 | 495 | ||
| 496 | #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \ | 496 | #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \ |
| 497 | struct UVC_FRAME_UNCOMPRESSED(n) { \ | 497 | struct UVC_FRAME_UNCOMPRESSED(n) { \ |
| 498 | __u8 bLength; \ | 498 | __u8 bLength; \ |
| 499 | __u8 bDescriptorType; \ | 499 | __u8 bDescriptorType; \ |
| 500 | __u8 bDescriptorSubType; \ | 500 | __u8 bDescriptorSubType; \ |
| 501 | __u8 bFrameIndex; \ | 501 | __u8 bFrameIndex; \ |
| 502 | __u8 bmCapabilities; \ | 502 | __u8 bmCapabilities; \ |
| 503 | __u16 wWidth; \ | 503 | __le16 wWidth; \ |
| 504 | __u16 wHeight; \ | 504 | __le16 wHeight; \ |
| 505 | __u32 dwMinBitRate; \ | 505 | __le32 dwMinBitRate; \ |
| 506 | __u32 dwMaxBitRate; \ | 506 | __le32 dwMaxBitRate; \ |
| 507 | __u32 dwMaxVideoFrameBufferSize; \ | 507 | __le32 dwMaxVideoFrameBufferSize; \ |
| 508 | __u32 dwDefaultFrameInterval; \ | 508 | __le32 dwDefaultFrameInterval; \ |
| 509 | __u8 bFrameIntervalType; \ | 509 | __u8 bFrameIntervalType; \ |
| 510 | __u32 dwFrameInterval[n]; \ | 510 | __le32 dwFrameInterval[n]; \ |
| 511 | } __attribute__ ((packed)) | 511 | } __attribute__ ((packed)) |
| 512 | 512 | ||
| 513 | /* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */ | 513 | /* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */ |
| @@ -529,19 +529,19 @@ struct uvc_format_mjpeg { · 15 unmodified lines | |||
| 529 | 529 | ||
| 530 | /* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */ | 530 | /* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */ |
| 531 | struct uvc_frame_mjpeg { | 531 | struct uvc_frame_mjpeg { |
| 532 | __u8 bLength; | 532 | __u8 bLength; |
| 533 | __u8 bDescriptorType; | 533 | __u8 bDescriptorType; |
| 534 | __u8 bDescriptorSubType; | 534 | __u8 bDescriptorSubType; |
| 535 | __u8 bFrameIndex; | 535 | __u8 bFrameIndex; |
| 536 | __u8 bmCapabilities; | 536 | __u8 bmCapabilities; |
| 537 | __u16 wWidth; | 537 | __le16 wWidth; |
| 538 | __u16 wHeight; | 538 | __le16 wHeight; |
| 539 | __u32 dwMinBitRate; | 539 | __le32 dwMinBitRate; |
| 540 | __u32 dwMaxBitRate; | 540 | __le32 dwMaxBitRate; |
| 541 | __u32 dwMaxVideoFrameBufferSize; | 541 | __le32 dwMaxVideoFrameBufferSize; |
| 542 | __u32 dwDefaultFrameInterval; | 542 | __le32 dwDefaultFrameInterval; |
| 543 | __u8 bFrameIntervalType; | 543 | __u8 bFrameIntervalType; |
| 544 | __u32 dwFrameInterval[]; | 544 | __le32 dwFrameInterval[]; |
| 545 | } __attribute__((__packed__)); | 545 | } __attribute__((__packed__)); |
| 546 | 546 | ||
| 547 | #define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n)) | 547 | #define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n)) |
| @@ -551,19 +551,19 @@ struct uvc_frame_mjpeg { · 3 unmodified lines | |||
| 551 | 551 | ||
| 552 | #define DECLARE_UVC_FRAME_MJPEG(n) \ | 552 | #define DECLARE_UVC_FRAME_MJPEG(n) \ |
| 553 | struct UVC_FRAME_MJPEG(n) { \ | 553 | struct UVC_FRAME_MJPEG(n) { \ |
| 554 | __u8 bLength; \ | 554 | __u8 bLength; \ |
| 555 | __u8 bDescriptorType; \ | 555 | __u8 bDescriptorType; \ |
| 556 | __u8 bDescriptorSubType; \ | 556 | __u8 bDescriptorSubType; \ |
| 557 | __u8 bFrameIndex; \ | 557 | __u8 bFrameIndex; \ |
| 558 | __u8 bmCapabilities; \ | 558 | __u8 bmCapabilities; \ |
| 559 | __u16 wWidth; \ | 559 | __le16 wWidth; \ |
| 560 | __u16 wHeight; \ | 560 | __le16 wHeight; \ |
| 561 | __u32 dwMinBitRate; \ | 561 | __le32 dwMinBitRate; \ |
| 562 | __u32 dwMaxBitRate; \ | 562 | __le32 dwMaxBitRate; \ |
| 563 | __u32 dwMaxVideoFrameBufferSize; \ | 563 | __le32 dwMaxVideoFrameBufferSize; \ |
| 564 | __u32 dwDefaultFrameInterval; \ | 564 | __le32 dwDefaultFrameInterval; \ |
| 565 | __u8 bFrameIntervalType; \ | 565 | __u8 bFrameIntervalType; \ |
| 566 | __u32 dwFrameInterval[n]; \ | 566 | __le32 dwFrameInterval[n]; \ |
| 567 | } __attribute__ ((packed)) | 567 | } __attribute__ ((packed)) |
| 568 | 568 | ||
| 569 | #endif /* __LINUX_USB_VIDEO_H */ | 569 | #endif /* __LINUX_USB_VIDEO_H */ |