drivers/net/pse-pd/pse_core.c
Source file repositories/reference/linux-study-clean/drivers/net/pse-pd/pse_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/pse-pd/pse_core.c- Extension
.c- Size
- 48783 bytes
- Lines
- 1984
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/device.hlinux/ethtool.hlinux/ethtool_netlink.hlinux/of.hlinux/phy.hlinux/pse-pd/pse.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/rtnetlink.hnet/net_trackers.h
Detected Declarations
struct pse_controlstruct pse_power_domainstruct pse_irqfunction of_load_single_pse_pi_pairsetfunction of_load_pse_pi_pairsetsfunction pse_release_pisfunction of_load_pse_pisfunction for_each_child_of_nodefunction pse_control_putfunction pse_pi_is_hw_enabledfunction pse_pi_is_admin_enable_pendingfunction pse_pw_d_retry_power_deliveryfunction pse_pw_d_is_sw_pw_controlfunction pse_pi_is_enabledfunction pse_pi_deallocate_pw_budgetfunction _pse_pi_disablefunction pse_disable_pi_polfunction pse_disable_pi_priofunction pse_pi_allocate_pw_budget_static_priofunction pse_pi_allocate_pw_budgetfunction _pse_pi_delivery_power_sw_pw_ctrlfunction pse_pi_enablefunction pse_pi_disablefunction _pse_pi_get_voltagefunction pse_pi_get_voltagefunction pse_pi_get_current_limitfunction pse_pi_set_current_limitfunction devm_pse_pi_regulator_registerfunction __pse_pw_d_releasefunction pse_flush_pw_dsfunction pse_register_pw_dsfunction xa_for_eachfunction pse_send_ntf_workerfunction pse_controller_registerfunction pse_controller_unregisterfunction devm_pse_controller_releasefunction pse_controller_registerfunction pse_to_regulator_notifsfunction pse_set_config_isrfunction pse_isrfunction for_each_set_bitfunction devm_pse_irq_helperfunction __pse_control_releasefunction __pse_control_put_internalfunction pse_control_putfunction pse_control_get_internalfunction list_for_each_entryfunction of_pse_match_pi
Annotated Snippet
struct pse_control {
struct pse_controller_dev *pcdev;
struct regulator *ps;
struct list_head list;
unsigned int id;
struct kref refcnt;
struct phy_device *attached_phydev;
};
/**
* struct pse_power_domain - a PSE power domain
* @id: ID of the power domain
* @supply: Power supply the Power Domain
* @refcnt: Number of gets of this pse_power_domain
* @budget_eval_strategy: Current power budget evaluation strategy of the
* power domain
*/
struct pse_power_domain {
int id;
struct regulator *supply;
struct kref refcnt;
u32 budget_eval_strategy;
};
static int of_load_single_pse_pi_pairset(struct device_node *node,
struct pse_pi *pi,
int pairset_num)
{
struct device_node *pairset_np;
const char *name;
int ret;
ret = of_property_read_string_index(node, "pairset-names",
pairset_num, &name);
if (ret)
return ret;
if (!strcmp(name, "alternative-a")) {
pi->pairset[pairset_num].pinout = ALTERNATIVE_A;
} else if (!strcmp(name, "alternative-b")) {
pi->pairset[pairset_num].pinout = ALTERNATIVE_B;
} else {
pr_err("pse: wrong pairset-names value %s (%pOF)\n",
name, node);
return -EINVAL;
}
pairset_np = of_parse_phandle(node, "pairsets", pairset_num);
if (!pairset_np)
return -ENODEV;
pi->pairset[pairset_num].np = pairset_np;
return 0;
}
/**
* of_load_pse_pi_pairsets - load PSE PI pairsets pinout and polarity
* @node: a pointer of the device node
* @pi: a pointer of the PSE PI to fill
* @npairsets: the number of pairsets (1 or 2) used by the PI
*
* Return: 0 on success and failure value on error
*/
static int of_load_pse_pi_pairsets(struct device_node *node,
struct pse_pi *pi,
int npairsets)
{
int i, ret;
ret = of_property_count_strings(node, "pairset-names");
if (ret != npairsets) {
pr_err("pse: amount of pairsets and pairset-names is not equal %d != %d (%pOF)\n",
npairsets, ret, node);
return -EINVAL;
}
for (i = 0; i < npairsets; i++) {
ret = of_load_single_pse_pi_pairset(node, pi, i);
if (ret)
goto out;
}
if (npairsets == 2 &&
pi->pairset[0].pinout == pi->pairset[1].pinout) {
pr_err("pse: two PI pairsets can not have identical pinout (%pOF)",
node);
ret = -EINVAL;
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/ethtool.h`, `linux/ethtool_netlink.h`, `linux/of.h`, `linux/phy.h`, `linux/pse-pd/pse.h`, `linux/regulator/driver.h`, `linux/regulator/machine.h`.
- Detected declarations: `struct pse_control`, `struct pse_power_domain`, `struct pse_irq`, `function of_load_single_pse_pi_pairset`, `function of_load_pse_pi_pairsets`, `function pse_release_pis`, `function of_load_pse_pis`, `function for_each_child_of_node`, `function pse_control_put`, `function pse_pi_is_hw_enabled`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.