drivers/usb/typec/ucsi/trace.c
Source file repositories/reference/linux-study-clean/drivers/usb/typec/ucsi/trace.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/typec/ucsi/trace.c- Extension
.c- Size
- 1447 bytes
- Lines
- 47
- Domain
- Driver Families
- Bucket
- drivers/usb
- 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.
Dependency Surface
ucsi.htrace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#define CREATE_TRACE_POINTS
#include "ucsi.h"
#include "trace.h"
static const char * const ucsi_cmd_strs[] = {
[0] = "Unknown command",
[UCSI_PPM_RESET] = "PPM_RESET",
[UCSI_CANCEL] = "CANCEL",
[UCSI_CONNECTOR_RESET] = "CONNECTOR_RESET",
[UCSI_ACK_CC_CI] = "ACK_CC_CI",
[UCSI_SET_NOTIFICATION_ENABLE] = "SET_NOTIFICATION_ENABLE",
[UCSI_GET_CAPABILITY] = "GET_CAPABILITY",
[UCSI_GET_CONNECTOR_CAPABILITY] = "GET_CONNECTOR_CAPABILITY",
[UCSI_SET_CCOM] = "SET_CCOM",
[UCSI_SET_UOR] = "SET_UOR",
[UCSI_SET_PDM] = "SET_PDM",
[UCSI_SET_PDR] = "SET_PDR",
[UCSI_GET_ALTERNATE_MODES] = "GET_ALTERNATE_MODES",
[UCSI_GET_CAM_SUPPORTED] = "GET_CAM_SUPPORTED",
[UCSI_GET_CURRENT_CAM] = "GET_CURRENT_CAM",
[UCSI_SET_NEW_CAM] = "SET_NEW_CAM",
[UCSI_GET_PDOS] = "GET_PDOS",
[UCSI_GET_CABLE_PROPERTY] = "GET_CABLE_PROPERTY",
[UCSI_GET_CONNECTOR_STATUS] = "GET_CONNECTOR_STATUS",
[UCSI_GET_ERROR_STATUS] = "GET_ERROR_STATUS",
};
const char *ucsi_cmd_str(u64 raw_cmd)
{
u8 cmd = raw_cmd & GENMASK(7, 0);
return ucsi_cmd_strs[(cmd >= ARRAY_SIZE(ucsi_cmd_strs)) ? 0 : cmd];
}
static const char * const ucsi_recipient_strs[] = {
[UCSI_RECIPIENT_CON] = "port",
[UCSI_RECIPIENT_SOP] = "partner",
[UCSI_RECIPIENT_SOP_P] = "plug (prime)",
[UCSI_RECIPIENT_SOP_PP] = "plug (double prime)",
};
const char *ucsi_recipient_str(u8 recipient)
{
return ucsi_recipient_strs[recipient];
}
Annotation
- Immediate include surface: `ucsi.h`, `trace.h`.
- Atlas domain: Driver Families / drivers/usb.
- 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.