drivers/net/ethernet/pensando/ionic/ionic_aux.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/pensando/ionic/ionic_aux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/pensando/ionic/ionic_aux.c- Extension
.c- Size
- 2340 bytes
- Lines
- 103
- 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.
- 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/kernel.hionic.hionic_lif.hionic_aux.h
Detected Declarations
function ionic_auxbus_releasefunction ionic_auxbus_registerfunction ionic_auxbus_unregisterfunction ionic_request_rdma_reset
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2018-2025, Advanced Micro Devices, Inc. */
#include <linux/kernel.h>
#include "ionic.h"
#include "ionic_lif.h"
#include "ionic_aux.h"
static DEFINE_IDA(aux_ida);
static void ionic_auxbus_release(struct device *dev)
{
struct ionic_aux_dev *ionic_adev;
ionic_adev = container_of(dev, struct ionic_aux_dev, adev.dev);
ida_free(&aux_ida, ionic_adev->adev.id);
kfree(ionic_adev);
}
int ionic_auxbus_register(struct ionic_lif *lif)
{
struct ionic_aux_dev *ionic_adev;
struct auxiliary_device *aux_dev;
int err, id;
if (!(le64_to_cpu(lif->ionic->ident.lif.capabilities) & IONIC_LIF_CAP_RDMA))
return 0;
ionic_adev = kzalloc_obj(*ionic_adev);
if (!ionic_adev)
return -ENOMEM;
aux_dev = &ionic_adev->adev;
id = ida_alloc(&aux_ida, GFP_KERNEL);
if (id < 0) {
dev_err(lif->ionic->dev, "Failed to allocate aux id: %d\n", id);
kfree(ionic_adev);
return id;
}
aux_dev->id = id;
aux_dev->name = "rdma";
aux_dev->dev.parent = &lif->ionic->pdev->dev;
aux_dev->dev.release = ionic_auxbus_release;
ionic_adev->lif = lif;
err = auxiliary_device_init(aux_dev);
if (err) {
dev_err(lif->ionic->dev, "Failed to initialize %s aux device: %d\n",
aux_dev->name, err);
ida_free(&aux_ida, id);
kfree(ionic_adev);
return err;
}
err = auxiliary_device_add(aux_dev);
if (err) {
dev_err(lif->ionic->dev, "Failed to add %s aux device: %d\n",
aux_dev->name, err);
auxiliary_device_uninit(aux_dev);
return err;
}
lif->ionic_adev = ionic_adev;
return 0;
}
void ionic_auxbus_unregister(struct ionic_lif *lif)
{
mutex_lock(&lif->adev_lock);
if (!lif->ionic_adev)
goto out;
auxiliary_device_delete(&lif->ionic_adev->adev);
auxiliary_device_uninit(&lif->ionic_adev->adev);
lif->ionic_adev = NULL;
out:
mutex_unlock(&lif->adev_lock);
}
void ionic_request_rdma_reset(struct ionic_lif *lif)
{
struct ionic *ionic = lif->ionic;
int err;
union ionic_dev_cmd cmd = {
.cmd.opcode = IONIC_CMD_RDMA_RESET_LIF,
.cmd.lif_index = cpu_to_le16(lif->index),
};
Annotation
- Immediate include surface: `linux/kernel.h`, `ionic.h`, `ionic_lif.h`, `ionic_aux.h`.
- Detected declarations: `function ionic_auxbus_release`, `function ionic_auxbus_register`, `function ionic_auxbus_unregister`, `function ionic_request_rdma_reset`.
- 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.
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.