drivers/staging/rtl8723bs/include/rtw_cmd.h
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/include/rtw_cmd.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/include/rtw_cmd.h- Extension
.h- Size
- 15586 bytes
- Lines
- 716
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/completion.h
Detected Declarations
struct cmd_objstruct cmd_privstruct evt_privstruct c2h_evt_hdrstruct c2h_evt_hdr_88xxstruct joinbss_parmstruct disconnect_parmstruct createbss_parmstruct setopmode_parmstruct sitesurvey_parmstruct setauth_parmstruct setkey_parmstruct set_stakey_parmstruct set_stakey_rspstruct set_assocsta_parmstruct set_assocsta_rspstruct del_assocsta_parmstruct setstapwrstate_parmstruct setbasicrate_parmstruct getbasicrate_parmstruct setdatarate_parmstruct getdatarate_parmstruct setphyinfo_parmstruct getphyinfo_parmstruct setphy_parmstruct getphy_parmstruct Tx_Beacon_paramstruct drvextra_cmd_parmstruct addBaReq_parmstruct set_ch_parmstruct SetChannelPlan_paramstruct SetChannelSwitch_paramstruct TDLSoption_paramstruct RunInThread_paramstruct sta_infostruct _cmd_callback
Annotated Snippet
struct cmd_obj {
struct adapter *padapter;
u16 cmdcode;
u8 res;
u8 *parmbuf;
u32 cmdsz;
u8 *rsp;
u32 rspsz;
struct submit_ctx *sctx;
struct list_head list;
};
/* cmd flags */
enum {
RTW_CMDF_DIRECTLY = BIT0,
RTW_CMDF_WAIT_ACK = BIT1,
};
struct cmd_priv {
struct completion cmd_queue_comp;
struct completion terminate_cmdthread_comp;
struct __queue cmd_queue;
u8 cmd_seq;
u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */
u8 *cmd_allocated_buf;
u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */
u8 *rsp_allocated_buf;
u32 cmd_issued_cnt;
u32 cmd_done_cnt;
u32 rsp_cnt;
atomic_t cmdthd_running;
/* u8 cmdthd_running; */
u8 stop_req;
struct adapter *padapter;
struct mutex sctx_mutex;
};
struct evt_priv {
struct work_struct c2h_wk;
bool c2h_wk_alive;
struct rtw_cbuf *c2h_queue;
#define C2H_QUEUE_MAX_LEN 10
atomic_t event_seq;
u8 *evt_buf; /* shall be non-paged, and 4 bytes aligned */
u8 *evt_allocated_buf;
u32 evt_done_cnt;
u8 *c2h_mem;
u8 *allocated_c2h_mem;
};
#define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \
do {\
INIT_LIST_HEAD(&pcmd->list);\
pcmd->cmdcode = code;\
pcmd->parmbuf = (u8 *)(pparm);\
pcmd->cmdsz = sizeof(*pparm);\
pcmd->rsp = NULL;\
pcmd->rspsz = 0;\
} while (0)
#define init_h2fwcmd_w_parm_no_parm_rsp(pcmd, code) \
do {\
INIT_LIST_HEAD(&pcmd->list);\
pcmd->cmdcode = code;\
pcmd->parmbuf = NULL;\
pcmd->cmdsz = 0;\
pcmd->rsp = NULL;\
pcmd->rspsz = 0;\
} while (0)
struct c2h_evt_hdr {
u8 id:4;
u8 plen:4;
u8 seq;
u8 payload[];
};
struct c2h_evt_hdr_88xx {
u8 id;
u8 seq;
u8 payload[12];
u8 plen;
u8 trigger;
};
#define c2h_evt_valid(c2h_evt) ((c2h_evt)->id || (c2h_evt)->plen)
int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj);
extern struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
Annotation
- Immediate include surface: `linux/completion.h`.
- Detected declarations: `struct cmd_obj`, `struct cmd_priv`, `struct evt_priv`, `struct c2h_evt_hdr`, `struct c2h_evt_hdr_88xx`, `struct joinbss_parm`, `struct disconnect_parm`, `struct createbss_parm`, `struct setopmode_parm`, `struct sitesurvey_parm`.
- Atlas domain: Driver Families / drivers/staging.
- 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.