drivers/net/ethernet/cisco/enic/enic_dev.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cisco/enic/enic_dev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/cisco/enic/enic_dev.c- Extension
.c- Size
- 4590 bytes
- Lines
- 231
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/etherdevice.hvnic_dev.hvnic_vic.henic_res.henic.henic_dev.h
Detected Declarations
function enic_dev_fw_infofunction enic_dev_stats_dumpfunction enic_dev_add_station_addrfunction enic_dev_del_station_addrfunction enic_dev_packet_filterfunction enic_dev_add_addrfunction enic_dev_del_addrfunction enic_dev_notify_unsetfunction enic_dev_hang_notifyfunction enic_dev_set_ig_vlan_rewrite_modefunction enic_dev_enablefunction enic_dev_disablefunction enic_dev_intr_coal_timer_infofunction enic_vlan_rx_add_vidfunction enic_vlan_rx_kill_vidfunction enic_dev_status_to_errno
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
// Copyright 2011 Cisco Systems, Inc. All rights reserved.
#include <linux/pci.h>
#include <linux/etherdevice.h>
#include "vnic_dev.h"
#include "vnic_vic.h"
#include "enic_res.h"
#include "enic.h"
#include "enic_dev.h"
int enic_dev_fw_info(struct enic *enic, struct vnic_devcmd_fw_info **fw_info)
{
int err;
spin_lock_bh(&enic->devcmd_lock);
err = vnic_dev_fw_info(enic->vdev, fw_info);
spin_unlock_bh(&enic->devcmd_lock);
return err;
}
int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats)
{
int err;
spin_lock_bh(&enic->devcmd_lock);
err = vnic_dev_stats_dump(enic->vdev, vstats);
spin_unlock_bh(&enic->devcmd_lock);
return err;
}
int enic_dev_add_station_addr(struct enic *enic)
{
int err;
if (!is_valid_ether_addr(enic->netdev->dev_addr))
return -EADDRNOTAVAIL;
spin_lock_bh(&enic->devcmd_lock);
err = vnic_dev_add_addr(enic->vdev, enic->netdev->dev_addr);
spin_unlock_bh(&enic->devcmd_lock);
return err;
}
int enic_dev_del_station_addr(struct enic *enic)
{
int err;
if (!is_valid_ether_addr(enic->netdev->dev_addr))
return -EADDRNOTAVAIL;
spin_lock_bh(&enic->devcmd_lock);
err = vnic_dev_del_addr(enic->vdev, enic->netdev->dev_addr);
spin_unlock_bh(&enic->devcmd_lock);
return err;
}
int enic_dev_packet_filter(struct enic *enic, int directed, int multicast,
int broadcast, int promisc, int allmulti)
{
int err;
spin_lock_bh(&enic->devcmd_lock);
err = vnic_dev_packet_filter(enic->vdev, directed,
multicast, broadcast, promisc, allmulti);
spin_unlock_bh(&enic->devcmd_lock);
return err;
}
int enic_dev_add_addr(struct enic *enic, const u8 *addr)
{
int err;
spin_lock_bh(&enic->devcmd_lock);
err = vnic_dev_add_addr(enic->vdev, addr);
spin_unlock_bh(&enic->devcmd_lock);
return err;
}
int enic_dev_del_addr(struct enic *enic, const u8 *addr)
{
int err;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/etherdevice.h`, `vnic_dev.h`, `vnic_vic.h`, `enic_res.h`, `enic.h`, `enic_dev.h`.
- Detected declarations: `function enic_dev_fw_info`, `function enic_dev_stats_dump`, `function enic_dev_add_station_addr`, `function enic_dev_del_station_addr`, `function enic_dev_packet_filter`, `function enic_dev_add_addr`, `function enic_dev_del_addr`, `function enic_dev_notify_unset`, `function enic_dev_hang_notify`, `function enic_dev_set_ig_vlan_rewrite_mode`.
- 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.