drivers/net/fddi/skfp/skfddi.c
Source file repositories/reference/linux-study-clean/drivers/net/fddi/skfp/skfddi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/fddi/skfp/skfddi.c- Extension
.c- Size
- 64278 bytes
- Lines
- 2235
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/capability.hlinux/compat.hlinux/module.hlinux/kernel.hlinux/errno.hlinux/ioport.hlinux/interrupt.hlinux/pci.hlinux/netdevice.hlinux/etherdevice.hlinux/fddidevice.hlinux/skbuff.hlinux/bitops.hlinux/gfp.hasm/byteorder.hasm/io.hlinux/uaccess.hh/types.hh/skfbi.hh/fddi.hh/smc.hh/smtstate.h
Detected Declarations
function adaptersfunction skfp_remove_onefunction skfp_openfunction skfp_openfunction skfp_openfunction levelfunction canonicalfunction skfp_ctl_set_multicast_list_wo_lockfunction canonicalfunction skfp_siocdevprivatefunction dma_map_singlefunction freedfunction CheckSourceAddressfunction ResetAdapterfunction bitsfunction mac_drv_virt2physfunction DMA_RDfunction dma_masterfunction mac_drv_tx_completefunction dump_datafunction mac_drv_rx_completefunction bufferfunction mac_drv_fill_rxdfunction mac_drv_clear_rxdfunction bufferfunction smt_timer_pollfunction smt_get_timefunction updatefunction cfm_state_changefunction SC5_THRU_Bfunction rmt_state_changefunction drv_reset_indication
Annotated Snippet
static const struct net_device_ops skfp_netdev_ops = {
.ndo_open = skfp_open,
.ndo_stop = skfp_close,
.ndo_start_xmit = skfp_send_pkt,
.ndo_get_stats = skfp_ctl_get_stats,
.ndo_set_rx_mode = skfp_ctl_set_multicast_list,
.ndo_set_mac_address = skfp_ctl_set_mac_address,
.ndo_siocdevprivate = skfp_siocdevprivate,
};
/*
* =================
* = skfp_init_one =
* =================
*
* Overview:
* Probes for supported FDDI PCI controllers
*
* Returns:
* Condition code
*
* Arguments:
* pdev - pointer to PCI device information
*
* Functional Description:
* This is now called by PCI driver registration process
* for each board found.
*
* Return Codes:
* 0 - This device (fddi0, fddi1, etc) configured successfully
* -ENODEV - No devices present, or no SysKonnect FDDI PCI device
* present for this device name
*
*
* Side Effects:
* Device structures for FDDI adapters (fddi0, fddi1, etc) are
* initialized and the board resources are read and stored in
* the device structure.
*/
static int skfp_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct net_device *dev;
struct s_smc *smc; /* board pointer */
void __iomem *mem;
int err;
pr_debug("entering skfp_init_one\n");
if (num_boards == 0)
printk("%s\n", boot_msg);
err = pci_enable_device(pdev);
if (err)
return err;
err = pci_request_regions(pdev, "skfddi");
if (err)
goto err_out1;
pci_set_master(pdev);
#ifdef MEM_MAPPED_IO
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
printk(KERN_ERR "skfp: region is not an MMIO resource\n");
err = -EIO;
goto err_out2;
}
mem = ioremap(pci_resource_start(pdev, 0), 0x4000);
#else
if (!(pci_resource_flags(pdev, 1) & IO_RESOURCE_IO)) {
printk(KERN_ERR "skfp: region is not PIO resource\n");
err = -EIO;
goto err_out2;
}
mem = ioport_map(pci_resource_start(pdev, 1), FP_IO_LEN);
#endif
if (!mem) {
printk(KERN_ERR "skfp: Unable to map register, "
"FDDI adapter will be disabled.\n");
err = -EIO;
goto err_out2;
}
dev = alloc_fddidev(sizeof(struct s_smc));
if (!dev) {
printk(KERN_ERR "skfp: Unable to allocate fddi device, "
"FDDI adapter will be disabled.\n");
Annotation
- Immediate include surface: `linux/capability.h`, `linux/compat.h`, `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/ioport.h`, `linux/interrupt.h`, `linux/pci.h`.
- Detected declarations: `function adapters`, `function skfp_remove_one`, `function skfp_open`, `function skfp_open`, `function skfp_open`, `function level`, `function canonical`, `function skfp_ctl_set_multicast_list_wo_lock`, `function canonical`, `function skfp_siocdevprivate`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.