drivers/media/usb/go7007/go7007-fw.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/go7007/go7007-fw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/go7007/go7007-fw.c- Extension
.c- Size
- 40584 bytes
- Lines
- 1624
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/time.hlinux/mm.hlinux/device.hlinux/i2c.hlinux/firmware.hlinux/slab.hasm/byteorder.hgo7007-priv.h
Detected Declarations
struct code_genenum mpeg_frame_typefunction copy_packagesfunction mjpeg_frame_headerfunction gen_mjpeghdr_to_packagefunction mpeg1_frame_headerfunction mpeg1_sequence_headerfunction gen_mpeg1hdr_to_packagefunction vti_bitlenfunction mpeg4_frame_headerfunction mpeg4_sequence_headerfunction gen_mpeg4hdr_to_packagefunction brctrl_to_packagefunction config_packagefunction seqhead_to_packagefunction relative_primefunction avsync_to_packagefunction final_packagefunction audio_to_packagefunction modet_to_packagefunction do_specialfunction go7007_construct_fw_image
Annotated Snippet
struct code_gen {
unsigned char *p; /* destination */
u32 a; /* collects bits at the top of the variable */
int b; /* bit position of most recently-written bit */
int len; /* written out so far */
};
#define CODE_GEN(name, dest) struct code_gen name = { dest, 0, 32, 0 }
#define CODE_ADD(name, val, length) do { \
name.b -= (length); \
name.a |= (val) << name.b; \
while (name.b <= 24) { \
*name.p = name.a >> 24; \
++name.p; \
name.a <<= 8; \
name.b += 8; \
name.len += 8; \
} \
} while (0)
#define CODE_LENGTH(name) (name.len + (32 - name.b))
/* Tables for creating the bitrate control data */
static const s16 converge_speed_ip[101] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
5, 5, 5, 6, 6, 6, 7, 7, 8, 8,
9, 10, 10, 11, 12, 13, 14, 15, 16, 17,
19, 20, 22, 23, 25, 27, 30, 32, 35, 38,
41, 45, 49, 53, 58, 63, 69, 76, 83, 91,
100
};
static const s16 converge_speed_ipb[101] = {
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
4, 4, 4, 4, 5, 5, 5, 5, 5, 6,
6, 6, 6, 7, 7, 7, 7, 8, 8, 9,
9, 9, 10, 10, 11, 12, 12, 13, 14, 14,
15, 16, 17, 18, 19, 20, 22, 23, 25, 26,
28, 30, 32, 34, 37, 40, 42, 46, 49, 53,
57, 61, 66, 71, 77, 83, 90, 97, 106, 115,
125, 135, 147, 161, 175, 191, 209, 228, 249, 273,
300
};
static const s16 LAMBDA_table[4][101] = {
{ 16, 16, 16, 16, 17, 17, 17, 18, 18, 18,
19, 19, 19, 20, 20, 20, 21, 21, 22, 22,
22, 23, 23, 24, 24, 25, 25, 25, 26, 26,
27, 27, 28, 28, 29, 29, 30, 31, 31, 32,
32, 33, 33, 34, 35, 35, 36, 37, 37, 38,
39, 39, 40, 41, 42, 42, 43, 44, 45, 46,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
67, 68, 69, 70, 72, 73, 74, 76, 77, 78,
80, 81, 83, 84, 86, 87, 89, 90, 92, 94,
96
},
{
20, 20, 20, 21, 21, 21, 22, 22, 23, 23,
23, 24, 24, 25, 25, 26, 26, 27, 27, 28,
28, 29, 29, 30, 30, 31, 31, 32, 33, 33,
34, 34, 35, 36, 36, 37, 38, 38, 39, 40,
40, 41, 42, 43, 43, 44, 45, 46, 47, 48,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 64, 65, 66, 67, 68,
70, 71, 72, 73, 75, 76, 78, 79, 80, 82,
83, 85, 86, 88, 90, 91, 93, 95, 96, 98,
100, 102, 103, 105, 107, 109, 111, 113, 115, 117,
120
},
{
24, 24, 24, 25, 25, 26, 26, 27, 27, 28,
28, 29, 29, 30, 30, 31, 31, 32, 33, 33,
34, 34, 35, 36, 36, 37, 38, 38, 39, 40,
41, 41, 42, 43, 44, 44, 45, 46, 47, 48,
49, 50, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 62, 63, 64, 65, 66, 67, 69,
70, 71, 72, 74, 75, 76, 78, 79, 81, 82,
84, 85, 87, 88, 90, 92, 93, 95, 97, 98,
100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
120, 122, 124, 127, 129, 131, 134, 136, 138, 141,
Annotation
- Immediate include surface: `linux/module.h`, `linux/time.h`, `linux/mm.h`, `linux/device.h`, `linux/i2c.h`, `linux/firmware.h`, `linux/slab.h`, `asm/byteorder.h`.
- Detected declarations: `struct code_gen`, `enum mpeg_frame_type`, `function copy_packages`, `function mjpeg_frame_header`, `function gen_mjpeghdr_to_package`, `function mpeg1_frame_header`, `function mpeg1_sequence_header`, `function gen_mpeg1hdr_to_package`, `function vti_bitlen`, `function mpeg4_frame_header`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.