drivers/net/wireless/quantenna/qtnfmac/bus.h
Source file repositories/reference/linux-study-clean/drivers/net/wireless/quantenna/qtnfmac/bus.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/quantenna/qtnfmac/bus.h- Extension
.h- Size
- 3715 bytes
- Lines
- 159
- Domain
- Driver Families
- Bucket
- drivers/net
- 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/netdevice.hlinux/workqueue.htrans.hcore.h
Detected Declarations
struct qtnf_frame_meta_infostruct qtnf_busstruct qtnf_bus_opsstruct qtnf_busenum qtnf_fw_statefunction qtnf_fw_is_upfunction qtnf_fw_is_attachedfunction qtnf_bus_preinitfunction qtnf_bus_stopfunction qtnf_bus_data_txfunction qtnf_bus_data_tx_timeoutfunction qtnf_bus_control_txfunction qtnf_bus_data_rx_startfunction qtnf_bus_data_rx_stopfunction qtnf_bus_lockfunction qtnf_bus_unlock
Annotated Snippet
struct qtnf_frame_meta_info {
u8 magic_s;
u8 ifidx;
u8 macid;
u8 magic_e;
} __packed;
enum qtnf_fw_state {
QTNF_FW_STATE_DETACHED,
QTNF_FW_STATE_BOOT_DONE,
QTNF_FW_STATE_ACTIVE,
QTNF_FW_STATE_RUNNING,
QTNF_FW_STATE_DEAD,
};
struct qtnf_bus;
struct qtnf_bus_ops {
/* mgmt methods */
int (*preinit)(struct qtnf_bus *);
void (*stop)(struct qtnf_bus *);
/* control path methods */
int (*control_tx)(struct qtnf_bus *, struct sk_buff *);
/* data xfer methods */
int (*data_tx)(struct qtnf_bus *bus, struct sk_buff *skb,
unsigned int macid, unsigned int vifid);
void (*data_tx_timeout)(struct qtnf_bus *, struct net_device *);
void (*data_tx_use_meta_set)(struct qtnf_bus *bus, bool use_meta);
void (*data_rx_start)(struct qtnf_bus *);
void (*data_rx_stop)(struct qtnf_bus *);
};
struct qtnf_bus {
struct device *dev;
enum qtnf_fw_state fw_state;
u32 chip;
u32 chiprev;
struct qtnf_bus_ops *bus_ops;
struct qtnf_wmac *mac[QTNF_MAX_MAC];
struct qtnf_qlink_transport trans;
struct qtnf_hw_info hw_info;
struct napi_struct mux_napi;
struct net_device *mux_dev;
struct workqueue_struct *workqueue;
struct workqueue_struct *hprio_workqueue;
struct work_struct fw_work;
struct work_struct event_work;
struct mutex bus_lock; /* lock during command/event processing */
struct dentry *dbg_dir;
struct notifier_block netdev_nb;
u8 hw_id[ETH_ALEN];
/* bus private data */
char bus_priv[] __aligned(sizeof(void *));
};
static inline bool qtnf_fw_is_up(struct qtnf_bus *bus)
{
enum qtnf_fw_state state = bus->fw_state;
return ((state == QTNF_FW_STATE_ACTIVE) ||
(state == QTNF_FW_STATE_RUNNING));
}
static inline bool qtnf_fw_is_attached(struct qtnf_bus *bus)
{
enum qtnf_fw_state state = bus->fw_state;
return ((state == QTNF_FW_STATE_ACTIVE) ||
(state == QTNF_FW_STATE_RUNNING) ||
(state == QTNF_FW_STATE_DEAD));
}
static inline void *get_bus_priv(struct qtnf_bus *bus)
{
if (WARN(!bus, "qtnfmac: invalid bus pointer"))
return NULL;
return &bus->bus_priv;
}
/* callback wrappers */
static inline int qtnf_bus_preinit(struct qtnf_bus *bus)
{
if (!bus->bus_ops->preinit)
return 0;
return bus->bus_ops->preinit(bus);
}
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/workqueue.h`, `trans.h`, `core.h`.
- Detected declarations: `struct qtnf_frame_meta_info`, `struct qtnf_bus`, `struct qtnf_bus_ops`, `struct qtnf_bus`, `enum qtnf_fw_state`, `function qtnf_fw_is_up`, `function qtnf_fw_is_attached`, `function qtnf_bus_preinit`, `function qtnf_bus_stop`, `function qtnf_bus_data_tx`.
- Atlas domain: Driver Families / drivers/net.
- 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.