drivers/soc/qcom/pdr_interface.c
Source file repositories/reference/linux-study-clean/drivers/soc/qcom/pdr_interface.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/qcom/pdr_interface.c- Extension
.c- Size
- 18481 bytes
- Lines
- 741
- Domain
- Driver Families
- Bucket
- drivers/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cleanup.hlinux/kernel.hlinux/module.hlinux/slab.hlinux/string.hlinux/workqueue.hpdr_internal.h
Detected Declarations
struct pdr_servicestruct pdr_handlestruct pdr_list_nodefunction pdr_locator_new_serverfunction pdr_locator_del_serverfunction pdr_register_listenerfunction pdr_notifier_workfunction pdr_notifier_new_serverfunction pdr_notifier_del_serverfunction pdr_send_indack_msgfunction pdr_indack_workfunction list_for_each_entry_safefunction pdr_indication_cbfunction pdr_get_domain_listfunction pdr_locate_servicefunction pdr_notify_lookup_failurefunction pdr_locator_workfunction pdr_add_lookupfunction pdr_restart_pdfunction pdr_handle_allocfunction pdr_handle_releaseexport pdr_add_lookupexport pdr_restart_pdexport pdr_handle_allocexport pdr_handle_release
Annotated Snippet
struct pdr_service {
char service_name[SERVREG_NAME_LENGTH + 1];
char service_path[SERVREG_NAME_LENGTH + 1];
struct sockaddr_qrtr addr;
unsigned int instance;
unsigned int service;
u8 service_data_valid;
u32 service_data;
int state;
bool need_notifier_register;
bool need_notifier_remove;
bool need_locator_lookup;
bool service_connected;
struct list_head node;
};
struct pdr_handle {
struct qmi_handle locator_hdl;
struct qmi_handle notifier_hdl;
struct sockaddr_qrtr locator_addr;
struct list_head lookups;
struct list_head indack_list;
/* control access to pdr lookup/indack lists */
struct mutex list_lock;
/* serialize pd status invocation */
struct mutex status_lock;
/* control access to the locator state */
struct mutex lock;
bool locator_init_complete;
struct work_struct locator_work;
struct work_struct notifier_work;
struct work_struct indack_work;
struct workqueue_struct *notifier_wq;
struct workqueue_struct *indack_wq;
void (*status)(int state, char *service_path, void *priv);
void *priv;
};
struct pdr_list_node {
enum servreg_service_state curr_state;
u16 transaction_id;
struct pdr_service *pds;
struct list_head node;
};
static int pdr_locator_new_server(struct qmi_handle *qmi,
struct qmi_service *svc)
{
struct pdr_handle *pdr = container_of(qmi, struct pdr_handle,
locator_hdl);
mutex_lock(&pdr->lock);
/* Create a local client port for QMI communication */
pdr->locator_addr.sq_family = AF_QIPCRTR;
pdr->locator_addr.sq_node = svc->node;
pdr->locator_addr.sq_port = svc->port;
pdr->locator_init_complete = true;
mutex_unlock(&pdr->lock);
/* Service pending lookup requests */
schedule_work(&pdr->locator_work);
return 0;
}
static void pdr_locator_del_server(struct qmi_handle *qmi,
struct qmi_service *svc)
{
struct pdr_handle *pdr = container_of(qmi, struct pdr_handle,
locator_hdl);
mutex_lock(&pdr->lock);
pdr->locator_init_complete = false;
pdr->locator_addr.sq_node = 0;
pdr->locator_addr.sq_port = 0;
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/string.h`, `linux/workqueue.h`, `pdr_internal.h`.
- Detected declarations: `struct pdr_service`, `struct pdr_handle`, `struct pdr_list_node`, `function pdr_locator_new_server`, `function pdr_locator_del_server`, `function pdr_register_listener`, `function pdr_notifier_work`, `function pdr_notifier_new_server`, `function pdr_notifier_del_server`, `function pdr_send_indack_msg`.
- Atlas domain: Driver Families / drivers/soc.
- Implementation status: integration 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.