drivers/media/usb/uvc/uvcvideo.h
Source file repositories/reference/linux-study-clean/drivers/media/usb/uvc/uvcvideo.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/uvc/uvcvideo.h- Extension
.h- Size
- 21840 bytes
- Lines
- 816
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/kernel.hlinux/poll.hlinux/usb.hlinux/usb/video.hlinux/uvcvideo.hlinux/videodev2.hlinux/workqueue.hmedia/media-device.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-fh.hmedia/videobuf2-v4l2.h
Detected Declarations
struct gpio_descstruct sg_tablestruct uvc_controlstruct uvc_devicestruct uvc_video_chainstruct uvc_control_infostruct uvc_control_mappingstruct uvc_controlstruct uvc_entitystruct uvc_framestruct uvc_formatstruct uvc_streaming_headerstruct uvc_bufferstruct uvc_video_queuestruct uvc_video_chainstruct uvc_stats_framestruct uvc_stats_streamstruct uvc_copy_opstruct uvc_urbstruct uvc_streamingstruct uvc_clockstruct uvc_clock_samplestruct uvc_device_infostruct uvc_rectstruct uvc_status_streamingstruct uvc_status_controlstruct uvc_statusstruct uvc_devicestruct uvc_ctrl_workstruct uvc_fhenum uvc_buffer_statefunction uvc_urb_indexfunction uvc_queue_streamingfunction uvc_ctrl_commitfunction uvc_ctrl_rollback
Annotated Snippet
struct uvc_control_info {
struct list_head mappings;
u8 entity[16];
u8 index; /* Bit index in bmControls */
u8 selector;
u16 size;
u32 flags;
};
struct uvc_control_mapping {
struct list_head list;
struct list_head ev_subs;
u32 id;
char *name;
u8 entity[16];
u8 selector;
/*
* Size of the control data in the payload of the UVC control GET and
* SET requests, expressed in bits.
*/
u8 size;
u8 offset;
enum v4l2_ctrl_type v4l2_type;
u32 data_type;
const u32 *menu_mapping;
const char (*menu_names)[UVC_MENU_NAME_LEN];
unsigned long menu_mask;
u32 master_id;
s32 master_manual;
u32 slave_ids[2];
bool disabled;
const struct uvc_control_mapping *(*filter_mapping)
(struct uvc_video_chain *chain,
struct uvc_control *ctrl);
int (*get)(struct uvc_control_mapping *mapping, u8 query,
const void *uvc_in, size_t v4l2_size, void *v4l2_out);
int (*set)(struct uvc_control_mapping *mapping, size_t v4l2_size,
const void *v4l2_in, void *uvc_out);
};
struct uvc_control {
struct uvc_entity *entity;
struct uvc_control_info info;
u8 index; /* Used to match the uvc_control entry with a uvc_control_info. */
u8 dirty:1,
loaded:1,
modified:1,
cached:1,
initialized:1;
u8 *uvc_data;
struct uvc_fh *handle; /* File handle that last changed the control. */
};
/*
* The term 'entity' refers to both UVC units and UVC terminals.
*
* The type field is either the terminal type (wTerminalType in the terminal
* descriptor), or the unit type (bDescriptorSubtype in the unit descriptor).
* As the bDescriptorSubtype field is one byte long, the type value will
* always have a null MSB for units. All terminal types defined by the UVC
* specification have a non-null MSB, so it is safe to use the MSB to
* differentiate between units and terminals as long as the descriptor parsing
* code makes sure terminal types have a non-null MSB.
*
* For terminals, the type's most significant bit stores the terminal
* direction (either UVC_TERM_INPUT or UVC_TERM_OUTPUT). The type field should
* always be accessed with the UVC_ENTITY_* macros and never directly.
*/
#define UVC_ENTITY_FLAG_DEFAULT (1 << 0)
struct uvc_entity {
struct list_head list; /* Entity as part of a UVC device. */
struct list_head chain; /* Entity as part of a video device chain. */
unsigned int flags;
/*
* Entities exposed by the UVC device use IDs 0-255, extra entities
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/kernel.h`, `linux/poll.h`, `linux/usb.h`, `linux/usb/video.h`, `linux/uvcvideo.h`, `linux/videodev2.h`, `linux/workqueue.h`.
- Detected declarations: `struct gpio_desc`, `struct sg_table`, `struct uvc_control`, `struct uvc_device`, `struct uvc_video_chain`, `struct uvc_control_info`, `struct uvc_control_mapping`, `struct uvc_control`, `struct uvc_entity`, `struct uvc_frame`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.