drivers/misc/bcm-vk/bcm_vk.h
Source file repositories/reference/linux-study-clean/drivers/misc/bcm-vk/bcm_vk.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/bcm-vk/bcm_vk.h- Extension
.h- Size
- 15939 bytes
- Lines
- 549
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/firmware.hlinux/irq.hlinux/kref.hlinux/miscdevice.hlinux/mutex.hlinux/pci.hlinux/poll.hlinux/sched/signal.hlinux/tty.hlinux/uaccess.huapi/linux/misc/bcm_vk.hbcm_vk_msg.h
Detected Declarations
struct bcm_vk_ttystruct bcm_vk_card_infostruct bcm_vk_dauth_keystruct bcm_vk_dauth_infostruct bcm_vk_peer_logstruct bcm_vk_proc_mon_entry_tstruct bcm_vk_proc_mon_infostruct bcm_vk_hb_ctrlstruct bcm_vk_alertstruct bcm_vk_alert_cntsstruct bcm_vkstruct bcm_vk_entryenum pci_barnoenum bcm_vk_wq_offload_flagsfunction vkread32function vkwrite32function vkread8function vkwrite8function bcm_vk_msgq_marker_validfunction bcm_vk_tty_set_irq_enabledfunction bcm_vk_tty_initfunction bcm_vk_tty_exit
Annotated Snippet
struct bcm_vk_tty {
struct tty_port port;
u32 to_offset; /* bar offset to use */
u32 to_size; /* to VK buffer size */
u32 wr; /* write offset shadow */
u32 from_offset; /* bar offset to use */
u32 from_size; /* from VK buffer size */
u32 rd; /* read offset shadow */
pid_t pid;
bool irq_enabled;
bool is_opened; /* tracks tty open/close */
};
/* VK device max power state, supports 3, full, reduced and low */
#define MAX_OPP 3
#define MAX_CARD_INFO_TAG_SIZE 64
struct bcm_vk_card_info {
u32 version;
char os_tag[MAX_CARD_INFO_TAG_SIZE];
char cmpt_tag[MAX_CARD_INFO_TAG_SIZE];
u32 cpu_freq_mhz;
u32 cpu_scale[MAX_OPP];
u32 ddr_freq_mhz;
u32 ddr_size_MB;
u32 video_core_freq_mhz;
};
/* DAUTH related info */
struct bcm_vk_dauth_key {
char store[VK_BAR1_DAUTH_STORE_SIZE];
char valid[VK_BAR1_DAUTH_VALID_SIZE];
};
struct bcm_vk_dauth_info {
struct bcm_vk_dauth_key keys[VK_BAR1_DAUTH_MAX];
};
/*
* Control structure of logging messages from the card. This
* buffer is for logmsg that comes from vk
*/
struct bcm_vk_peer_log {
u32 rd_idx;
u32 wr_idx;
u32 buf_size;
u32 mask;
};
/* max buf size allowed */
#define BCM_VK_PEER_LOG_BUF_MAX SZ_16K
/* max size per line of peer log */
#define BCM_VK_PEER_LOG_LINE_MAX 256
/*
* single entry for processing type + utilization
*/
#define BCM_VK_PROC_TYPE_TAG_LEN 8
struct bcm_vk_proc_mon_entry_t {
char tag[BCM_VK_PROC_TYPE_TAG_LEN];
u32 used;
u32 max; /**< max capacity */
};
/**
* Structure for run time utilization
*/
#define BCM_VK_PROC_MON_MAX 8 /* max entries supported */
struct bcm_vk_proc_mon_info {
u32 num; /**< no of entries */
u32 entry_size; /**< per entry size */
struct bcm_vk_proc_mon_entry_t entries[BCM_VK_PROC_MON_MAX];
};
struct bcm_vk_hb_ctrl {
struct delayed_work work;
u32 last_uptime;
u32 lost_cnt;
};
struct bcm_vk_alert {
u16 flags;
u16 notfs;
};
/* some alert counters that the driver will keep track */
struct bcm_vk_alert_cnts {
u16 ecc;
u16 uecc;
};
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/firmware.h`, `linux/irq.h`, `linux/kref.h`, `linux/miscdevice.h`, `linux/mutex.h`, `linux/pci.h`, `linux/poll.h`.
- Detected declarations: `struct bcm_vk_tty`, `struct bcm_vk_card_info`, `struct bcm_vk_dauth_key`, `struct bcm_vk_dauth_info`, `struct bcm_vk_peer_log`, `struct bcm_vk_proc_mon_entry_t`, `struct bcm_vk_proc_mon_info`, `struct bcm_vk_hb_ctrl`, `struct bcm_vk_alert`, `struct bcm_vk_alert_cnts`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.