drivers/net/ipa/ipa_uc.c
Source file repositories/reference/linux-study-clean/drivers/net/ipa/ipa_uc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ipa/ipa_uc.c- Extension
.c- Size
- 8030 bytes
- Lines
- 261
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/io.hlinux/pm_runtime.hlinux/types.hipa.hipa_interrupt.hipa_power.hipa_reg.hipa_uc.h
Detected Declarations
struct ipa_uc_mem_areaenum ipa_uc_commandenum ipa_uc_responseenum ipa_uc_eventfunction ipa_uc_event_handlerfunction ipa_uc_response_hdlrfunction ipa_uc_powerfunction ipa_uc_interrupt_handlerfunction ipa_uc_configfunction ipa_uc_deconfigfunction ipa_uc_powerfunction send_uc_commandfunction ipa_uc_panic_notifier
Annotated Snippet
struct ipa_uc_mem_area {
u8 command; /* enum ipa_uc_command */
u8 reserved0[3];
__le32 command_param;
__le32 command_param_hi;
u8 response; /* enum ipa_uc_response */
u8 reserved1[3];
__le32 response_param;
u8 event; /* enum ipa_uc_event */
u8 reserved2[3];
__le32 event_param;
__le32 first_error_address;
u8 hw_state;
u8 warning_counter;
__le16 reserved3;
__le16 interface_version;
__le16 reserved4;
};
/** enum ipa_uc_command - commands from the AP to the microcontroller */
enum ipa_uc_command {
IPA_UC_COMMAND_NO_OP = 0x0,
IPA_UC_COMMAND_UPDATE_FLAGS = 0x1,
IPA_UC_COMMAND_DEBUG_RUN_TEST = 0x2,
IPA_UC_COMMAND_DEBUG_GET_INFO = 0x3,
IPA_UC_COMMAND_ERR_FATAL = 0x4,
IPA_UC_COMMAND_CLK_GATE = 0x5,
IPA_UC_COMMAND_CLK_UNGATE = 0x6,
IPA_UC_COMMAND_MEMCPY = 0x7,
IPA_UC_COMMAND_RESET_PIPE = 0x8,
IPA_UC_COMMAND_REG_WRITE = 0x9,
IPA_UC_COMMAND_GSI_CH_EMPTY = 0xa,
};
/** enum ipa_uc_response - microcontroller response codes */
enum ipa_uc_response {
IPA_UC_RESPONSE_NO_OP = 0x0,
IPA_UC_RESPONSE_INIT_COMPLETED = 0x1,
IPA_UC_RESPONSE_CMD_COMPLETED = 0x2,
IPA_UC_RESPONSE_DEBUG_GET_INFO = 0x3,
};
/** enum ipa_uc_event - common cpu events reported by the microcontroller */
enum ipa_uc_event {
IPA_UC_EVENT_NO_OP = 0x0,
IPA_UC_EVENT_ERROR = 0x1,
IPA_UC_EVENT_LOG_INFO = 0x2,
};
static struct ipa_uc_mem_area *ipa_uc_shared(struct ipa *ipa)
{
const struct ipa_mem *mem = ipa_mem_find(ipa, IPA_MEM_UC_SHARED);
u32 offset = ipa->mem_offset + mem->offset;
return ipa->mem_virt + offset;
}
/* Microcontroller event IPA interrupt handler */
static void ipa_uc_event_handler(struct ipa *ipa)
{
struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa);
struct device *dev = ipa->dev;
if (shared->event == IPA_UC_EVENT_ERROR)
dev_err(dev, "microcontroller error event\n");
else if (shared->event != IPA_UC_EVENT_LOG_INFO)
dev_err(dev, "unsupported microcontroller event %u\n",
shared->event);
/* The LOG_INFO event can be safely ignored */
}
/* Microcontroller response IPA interrupt handler */
static void ipa_uc_response_hdlr(struct ipa *ipa)
{
struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa);
struct device *dev = ipa->dev;
/* An INIT_COMPLETED response message is sent to the AP by the
* microcontroller when it is operational. Other than this, the AP
* should only receive responses from the microcontroller when it has
* sent it a request message.
*
* We can drop the power reference taken in ipa_uc_power() once we
* know the microcontroller has finished its initialization.
*/
switch (shared->response) {
case IPA_UC_RESPONSE_INIT_COMPLETED:
if (ipa->uc_powered) {
ipa->uc_loaded = true;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/io.h`, `linux/pm_runtime.h`, `linux/types.h`, `ipa.h`, `ipa_interrupt.h`, `ipa_power.h`, `ipa_reg.h`.
- Detected declarations: `struct ipa_uc_mem_area`, `enum ipa_uc_command`, `enum ipa_uc_response`, `enum ipa_uc_event`, `function ipa_uc_event_handler`, `function ipa_uc_response_hdlr`, `function ipa_uc_power`, `function ipa_uc_interrupt_handler`, `function ipa_uc_config`, `function ipa_uc_deconfig`.
- Atlas domain: Driver Families / drivers/net.
- 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.