include/linux/usb/otg-fsm.h
Source file repositories/reference/linux-study-clean/include/linux/usb/otg-fsm.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/otg-fsm.h- Extension
.h- Size
- 8118 bytes
- Lines
- 313
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mutex.hlinux/errno.h
Detected Declarations
struct otg_fsmstruct otg_fsm_opsenum otg_fsm_timerfunction otg_chrg_vbusfunction otg_drv_vbusfunction otg_loc_connfunction otg_loc_soffunction otg_start_pulsefunction otg_start_adp_prbfunction otg_start_adp_snsfunction otg_add_timerfunction otg_del_timerfunction otg_start_hostfunction otg_start_gadget
Annotated Snippet
struct otg_fsm {
/* Input */
int id;
int adp_change;
int power_up;
int a_srp_det;
int a_vbus_vld;
int b_conn;
int a_bus_resume;
int a_bus_suspend;
int a_conn;
int b_se0_srp;
int b_ssend_srp;
int b_sess_vld;
int test_device;
int a_bus_drop;
int a_bus_req;
int b_bus_req;
/* Auxiliary inputs */
int a_sess_vld;
int b_bus_resume;
int b_bus_suspend;
/* Output */
int drv_vbus;
int loc_conn;
int loc_sof;
int adp_prb;
int adp_sns;
int data_pulse;
/* Internal variables */
int a_set_b_hnp_en;
int b_srp_done;
int b_hnp_enable;
int a_clr_err;
/* Informative variables. All unused as of now */
int a_bus_drop_inf;
int a_bus_req_inf;
int a_clr_err_inf;
int b_bus_req_inf;
/* Auxiliary informative variables */
int a_suspend_req_inf;
/* Timeout indicator for timers */
int a_wait_vrise_tmout;
int a_wait_vfall_tmout;
int a_wait_bcon_tmout;
int a_aidl_bdis_tmout;
int b_ase0_brst_tmout;
int a_bidl_adis_tmout;
struct otg_fsm_ops *ops;
struct usb_otg *otg;
/* Current usb protocol used: 0:undefine; 1:host; 2:client */
int protocol;
struct mutex lock;
u8 *host_req_flag;
struct delayed_work hnp_polling_work;
bool hnp_work_inited;
bool state_changed;
};
struct otg_fsm_ops {
void (*chrg_vbus)(struct otg_fsm *fsm, int on);
void (*drv_vbus)(struct otg_fsm *fsm, int on);
void (*loc_conn)(struct otg_fsm *fsm, int on);
void (*loc_sof)(struct otg_fsm *fsm, int on);
void (*start_pulse)(struct otg_fsm *fsm);
void (*start_adp_prb)(struct otg_fsm *fsm);
void (*start_adp_sns)(struct otg_fsm *fsm);
void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
int (*start_host)(struct otg_fsm *fsm, int on);
int (*start_gadget)(struct otg_fsm *fsm, int on);
};
static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on)
{
if (!fsm->ops->chrg_vbus)
return -EOPNOTSUPP;
fsm->ops->chrg_vbus(fsm, on);
return 0;
}
static inline int otg_drv_vbus(struct otg_fsm *fsm, int on)
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/errno.h`.
- Detected declarations: `struct otg_fsm`, `struct otg_fsm_ops`, `enum otg_fsm_timer`, `function otg_chrg_vbus`, `function otg_drv_vbus`, `function otg_loc_conn`, `function otg_loc_sof`, `function otg_start_pulse`, `function otg_start_adp_prb`, `function otg_start_adp_sns`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.