drivers/net/ethernet/microsoft/mana/hw_channel.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microsoft/mana/hw_channel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microsoft/mana/hw_channel.c- Extension
.c- Size
- 22749 bytes
- Lines
- 938
- 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.
- 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
net/mana/gdma.hnet/mana/mana.hnet/mana/hw_channel.hlinux/vmalloc.h
Detected Declarations
function mana_hwc_get_msg_indexfunction mana_hwc_put_msg_indexfunction mana_hwc_verify_resp_msgfunction mana_hwc_post_rx_wqefunction mana_hwc_handle_respfunction mana_hwc_init_event_handlerfunction mana_hwc_rx_event_handlerfunction mana_hwc_tx_event_handlerfunction mana_hwc_create_gdma_wqfunction mana_hwc_create_gdma_cqfunction mana_hwc_create_gdma_eqfunction mana_hwc_comp_eventfunction mana_hwc_destroy_cqfunction mana_hwc_create_cqfunction mana_hwc_alloc_dma_buffunction mana_hwc_dealloc_dma_buffunction mana_hwc_destroy_wqfunction mana_hwc_create_wqfunction mana_hwc_post_tx_wqefunction mana_hwc_init_inflight_msgfunction mana_hwc_test_channelfunction mana_hwc_establish_channelfunction mana_hwc_init_queuesfunction mana_hwc_create_channelfunction mana_hwc_destroy_channelfunction mana_hwc_send_request
Annotated Snippet
switch (type) {
case HWC_INIT_DATA_CQID:
hwc->cq->gdma_cq->id = val;
break;
case HWC_INIT_DATA_RQID:
hwc->rxq->gdma_wq->id = val;
break;
case HWC_INIT_DATA_SQID:
hwc->txq->gdma_wq->id = val;
break;
case HWC_INIT_DATA_QUEUE_DEPTH:
hwc->hwc_init_q_depth_max = (u16)val;
break;
case HWC_INIT_DATA_MAX_REQUEST:
hwc->hwc_init_max_req_msg_size = val;
break;
case HWC_INIT_DATA_MAX_RESPONSE:
hwc->hwc_init_max_resp_msg_size = val;
break;
case HWC_INIT_DATA_MAX_NUM_CQS:
gd->gdma_context->max_num_cqs = val;
break;
case HWC_INIT_DATA_PDID:
hwc->gdma_dev->pdid = val;
break;
case HWC_INIT_DATA_GPA_MKEY:
hwc->rxq->msg_buf->gpa_mkey = val;
hwc->txq->msg_buf->gpa_mkey = val;
break;
case HWC_INIT_DATA_PF_DEST_RQ_ID:
hwc->pf_dest_vrq_id = val;
break;
case HWC_INIT_DATA_PF_DEST_CQ_ID:
hwc->pf_dest_vrcq_id = val;
break;
}
break;
case GDMA_EQE_HWC_INIT_DONE:
complete(&hwc->hwc_init_eqe_comp);
break;
case GDMA_EQE_HWC_SOC_RECONFIG_DATA:
type_data.as_uint32 = event->details[0];
type = type_data.type;
val = type_data.value;
switch (type) {
case HWC_DATA_CFG_HWC_TIMEOUT:
hwc->hwc_timeout = val;
break;
case HWC_DATA_HW_LINK_CONNECT:
case HWC_DATA_HW_LINK_DISCONNECT:
ac = gd->gdma_context->mana.driver_data;
if (!ac)
break;
WRITE_ONCE(ac->link_event, type);
schedule_work(&ac->link_change_work);
break;
default:
dev_warn(hwc->dev, "Received unknown reconfig type %u\n", type);
break;
}
break;
case GDMA_EQE_HWC_SOC_SERVICE:
service_data.as_uint32 = event->details[0];
type = service_data.type;
switch (type) {
case GDMA_SERVICE_TYPE_RDMA_SUSPEND:
case GDMA_SERVICE_TYPE_RDMA_RESUME:
ret = mana_rdma_service_event(gd->gdma_context, type);
if (ret)
dev_err(hwc->dev, "Failed to schedule adev service event: %d\n",
Annotation
- Immediate include surface: `net/mana/gdma.h`, `net/mana/mana.h`, `net/mana/hw_channel.h`, `linux/vmalloc.h`.
- Detected declarations: `function mana_hwc_get_msg_index`, `function mana_hwc_put_msg_index`, `function mana_hwc_verify_resp_msg`, `function mana_hwc_post_rx_wqe`, `function mana_hwc_handle_resp`, `function mana_hwc_init_event_handler`, `function mana_hwc_rx_event_handler`, `function mana_hwc_tx_event_handler`, `function mana_hwc_create_gdma_wq`, `function mana_hwc_create_gdma_cq`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.