drivers/net/fjes/fjes_hw.c
Source file repositories/reference/linux-study-clean/drivers/net/fjes/fjes_hw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/fjes/fjes_hw.c- Extension
.c- Size
- 31324 bytes
- Lines
- 1329
- 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.
- 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
fjes_hw.hfjes.hfjes_trace.h
Detected Declarations
struct my_sfunction fjes_hw_rd32function fjes_hw_iounmapfunction fjes_hw_resetfunction fjes_hw_get_max_epidfunction fjes_hw_get_my_epidfunction fjes_hw_alloc_shared_status_regionfunction fjes_hw_free_shared_status_regionfunction fjes_hw_alloc_epbuffunction fjes_hw_free_epbuffunction fjes_hw_setup_epbuffunction fjes_hw_init_command_registersfunction fjes_hw_setupfunction fjes_hw_cleanupfunction fjes_hw_initfunction fjes_hw_exitfunction fjes_hw_issue_request_commandfunction fjes_hw_request_infofunction fjes_hw_register_buff_addrfunction fjes_hw_unregister_buff_addrfunction fjes_hw_raise_interruptfunction fjes_hw_capture_interrupt_statusfunction fjes_hw_set_irqmaskfunction fjes_hw_epid_is_same_zonefunction fjes_hw_epid_is_sharedfunction fjes_hw_epid_is_stop_requestedfunction fjes_hw_epid_is_stop_process_donefunction fjes_hw_get_partner_ep_statusfunction fjes_hw_raise_epstopfunction fjes_hw_wait_epstopfunction fjes_hw_check_epbuf_versionfunction fjes_hw_check_mtufunction fjes_hw_check_vlan_idfunction fjes_hw_set_vlan_idfunction fjes_hw_del_vlan_idfunction fjes_hw_epbuf_rx_is_emptyfunction fjes_hw_epbuf_rx_curpkt_dropfunction fjes_hw_epbuf_tx_pkt_sendfunction fjes_hw_update_zone_taskfunction fjes_hw_epstop_taskfunction fjes_hw_start_debugfunction fjes_hw_stop_debug
Annotated Snippet
struct my_s {u8 es_status; u8 zone; } *info;
union fjes_device_command_res *res_buf;
enum ep_partner_status pstatus;
struct fjes_adapter *adapter;
struct net_device *netdev;
unsigned long flags;
ulong unshare_bit = 0;
ulong share_bit = 0;
ulong irq_bit = 0;
int epidx;
int ret;
adapter = (struct fjes_adapter *)hw->back;
netdev = adapter->netdev;
res_buf = hw->hw_info.res_buf;
info = (struct my_s *)&res_buf->info.info;
mutex_lock(&hw->hw_info.lock);
ret = fjes_hw_request_info(hw);
switch (ret) {
case -ENOMSG:
case -EBUSY:
default:
if (!work_pending(&adapter->force_close_task)) {
adapter->force_reset = true;
schedule_work(&adapter->force_close_task);
}
break;
case 0:
for (epidx = 0; epidx < hw->max_epid; epidx++) {
if (epidx == hw->my_epid) {
hw->ep_shm_info[epidx].es_status =
info[epidx].es_status;
hw->ep_shm_info[epidx].zone =
info[epidx].zone;
continue;
}
pstatus = fjes_hw_get_partner_ep_status(hw, epidx);
switch (pstatus) {
case EP_PARTNER_UNSHARE:
default:
if ((info[epidx].zone !=
FJES_ZONING_ZONE_TYPE_NONE) &&
(info[epidx].es_status ==
FJES_ZONING_STATUS_ENABLE) &&
(info[epidx].zone ==
info[hw->my_epid].zone))
set_bit(epidx, &share_bit);
else
set_bit(epidx, &unshare_bit);
break;
case EP_PARTNER_COMPLETE:
case EP_PARTNER_WAITING:
if ((info[epidx].zone ==
FJES_ZONING_ZONE_TYPE_NONE) ||
(info[epidx].es_status !=
FJES_ZONING_STATUS_ENABLE) ||
(info[epidx].zone !=
info[hw->my_epid].zone)) {
set_bit(epidx,
&adapter->unshare_watch_bitmask);
set_bit(epidx,
&hw->hw_info.buffer_unshare_reserve_bit);
}
break;
case EP_PARTNER_SHARED:
if ((info[epidx].zone ==
FJES_ZONING_ZONE_TYPE_NONE) ||
(info[epidx].es_status !=
FJES_ZONING_STATUS_ENABLE) ||
(info[epidx].zone !=
info[hw->my_epid].zone))
set_bit(epidx, &irq_bit);
break;
}
hw->ep_shm_info[epidx].es_status =
info[epidx].es_status;
hw->ep_shm_info[epidx].zone = info[epidx].zone;
}
break;
Annotation
- Immediate include surface: `fjes_hw.h`, `fjes.h`, `fjes_trace.h`.
- Detected declarations: `struct my_s`, `function fjes_hw_rd32`, `function fjes_hw_iounmap`, `function fjes_hw_reset`, `function fjes_hw_get_max_epid`, `function fjes_hw_get_my_epid`, `function fjes_hw_alloc_shared_status_region`, `function fjes_hw_free_shared_status_region`, `function fjes_hw_alloc_epbuf`, `function fjes_hw_free_epbuf`.
- 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.
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.