drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qed/qed_sp_commands.c- Extension
.c- Size
- 16830 bytes
- Lines
- 596
- 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/types.hasm/byteorder.hlinux/bitops.hlinux/errno.hlinux/kernel.hlinux/string.hqed.hlinux/qed/qed_chain.hqed_cxt.hqed_dcbx.hqed_hsi.hqed_hw.hqed_int.hqed_reg_addr.hqed_sp.hqed_sriov.h
Detected Declarations
function Copyrightfunction qed_sp_init_requestfunction qed_tunn_clss_to_fw_clssfunction qed_set_pf_update_tunn_modefunction qed_set_tunn_cls_infofunction qed_set_tunn_portsfunction __qed_set_ramrod_tunnel_paramfunction qed_set_ramrod_tunnel_paramfunction qed_tunn_set_pf_update_paramsfunction qed_set_hw_tunn_modefunction qed_set_hw_tunn_mode_portfunction qed_tunn_set_pf_start_paramsfunction qed_sp_pf_startfunction qed_sp_pf_updatefunction qed_sp_pf_update_ufpfunction qed_sp_pf_update_tunn_cfgfunction qed_sp_pf_stopfunction qed_sp_heartbeat_ramrodfunction qed_sp_pf_update_stag
Annotated Snippet
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
/* QLogic qed NIC Driver
* Copyright (c) 2015-2017 QLogic Corporation
* Copyright (c) 2019-2020 Marvell International Ltd.
*/
#include <linux/types.h>
#include <asm/byteorder.h>
#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include "qed.h"
#include <linux/qed/qed_chain.h>
#include "qed_cxt.h"
#include "qed_dcbx.h"
#include "qed_hsi.h"
#include "qed_hw.h"
#include "qed_int.h"
#include "qed_reg_addr.h"
#include "qed_sp.h"
#include "qed_sriov.h"
void qed_sp_destroy_request(struct qed_hwfn *p_hwfn,
struct qed_spq_entry *p_ent)
{
/* qed_spq_get_entry() can either get an entry from the free_pool,
* or, if no entries are left, allocate a new entry and add it to
* the unlimited_pending list.
*/
if (p_ent->queue == &p_hwfn->p_spq->unlimited_pending)
kfree(p_ent);
else
qed_spq_return_entry(p_hwfn, p_ent);
}
int qed_sp_init_request(struct qed_hwfn *p_hwfn,
struct qed_spq_entry **pp_ent,
u8 cmd, u8 protocol, struct qed_sp_init_data *p_data)
{
u32 opaque_cid = p_data->opaque_fid << 16 | p_data->cid;
struct qed_spq_entry *p_ent = NULL;
int rc;
if (!pp_ent)
return -ENOMEM;
rc = qed_spq_get_entry(p_hwfn, pp_ent);
if (rc)
return rc;
p_ent = *pp_ent;
p_ent->elem.hdr.cid = cpu_to_le32(opaque_cid);
p_ent->elem.hdr.cmd_id = cmd;
p_ent->elem.hdr.protocol_id = protocol;
p_ent->priority = QED_SPQ_PRIORITY_NORMAL;
p_ent->comp_mode = p_data->comp_mode;
p_ent->comp_done.done = 0;
switch (p_ent->comp_mode) {
case QED_SPQ_MODE_EBLOCK:
p_ent->comp_cb.cookie = &p_ent->comp_done;
break;
case QED_SPQ_MODE_BLOCK:
if (!p_data->p_comp_data)
goto err;
p_ent->comp_cb.cookie = p_data->p_comp_data->cookie;
break;
case QED_SPQ_MODE_CB:
if (!p_data->p_comp_data)
p_ent->comp_cb.function = NULL;
else
p_ent->comp_cb = *p_data->p_comp_data;
break;
default:
DP_NOTICE(p_hwfn, "Unknown SPQE completion mode %d\n",
p_ent->comp_mode);
goto err;
}
DP_VERBOSE(p_hwfn,
QED_MSG_SPQ,
"Initialized: CID %08x %s:[%02x] %s:%02x data_addr %llx comp_mode [%s]\n",
Annotation
- Immediate include surface: `linux/types.h`, `asm/byteorder.h`, `linux/bitops.h`, `linux/errno.h`, `linux/kernel.h`, `linux/string.h`, `qed.h`, `linux/qed/qed_chain.h`.
- Detected declarations: `function Copyright`, `function qed_sp_init_request`, `function qed_tunn_clss_to_fw_clss`, `function qed_set_pf_update_tunn_mode`, `function qed_set_tunn_cls_info`, `function qed_set_tunn_ports`, `function __qed_set_ramrod_tunnel_param`, `function qed_set_ramrod_tunnel_param`, `function qed_tunn_set_pf_update_params`, `function qed_set_hw_tunn_mode`.
- 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.