arch/xtensa/platforms/iss/network.c
Source file repositories/reference/linux-study-clean/arch/xtensa/platforms/iss/network.c
File Facts
- System
- Linux kernel
- Corpus path
arch/xtensa/platforms/iss/network.c- Extension
.c- Size
- 13989 bytes
- Lines
- 643
- Domain
- Architecture Layer
- Bucket
- arch/xtensa
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/hex.hlinux/list.hlinux/irq.hlinux/spinlock.hlinux/slab.hlinux/timer.hlinux/if_ether.hlinux/inetdevice.hlinux/init.hlinux/if_tun.hlinux/etherdevice.hlinux/interrupt.hlinux/ioctl.hlinux/memblock.hlinux/ethtool.hlinux/rtnetlink.hlinux/platform_device.hplatform/simcall.h
Detected Declarations
struct tuntap_infostruct iss_net_privatestruct iss_net_opsstruct iss_net_privatestruct iss_net_initfunction setup_etheraddrfunction tuntap_openfunction tuntap_closefunction tuntap_readfunction tuntap_writefunction tuntap_protocolfunction tuntap_pollfunction tuntap_probefunction iss_net_rxfunction iss_net_pollfunction iss_net_timerfunction iss_net_openfunction iss_net_closefunction iss_net_start_xmitfunction iss_net_get_stats64function iss_net_set_multicast_listfunction iss_net_user_timer_expirefunction iss_net_pdev_releasefunction iss_net_configurefunction iss_net_setupfunction list_for_eachfunction iss_net_initfunction list_for_each_safemodule init iss_net_init
Annotated Snippet
static const struct net_device_ops iss_netdev_ops = {
.ndo_open = iss_net_open,
.ndo_stop = iss_net_close,
.ndo_get_stats64 = iss_net_get_stats64,
.ndo_start_xmit = iss_net_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_change_mtu = iss_net_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_tx_timeout = iss_net_tx_timeout,
.ndo_set_rx_mode = iss_net_set_multicast_list,
};
static void iss_net_pdev_release(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct iss_net_private *lp =
container_of(pdev, struct iss_net_private, pdev);
free_netdev(lp->dev);
}
static void iss_net_configure(int index, char *init)
{
struct net_device *dev;
struct iss_net_private *lp;
dev = alloc_etherdev(sizeof(*lp));
if (dev == NULL) {
pr_err("eth_configure: failed to allocate device\n");
return;
}
/* Initialize private element. */
lp = netdev_priv(dev);
*lp = (struct iss_net_private) {
.dev = dev,
.index = index,
};
spin_lock_init(&lp->lock);
/*
* If this name ends up conflicting with an existing registered
* netdevice, that is OK, register_netdev{,ice}() will notice this
* and fail.
*/
snprintf(dev->name, sizeof(dev->name), "eth%d", index);
/*
* Try all transport protocols.
* Note: more protocols can be added by adding '&& !X_init(lp, eth)'.
*/
if (!tuntap_probe(lp, index, init)) {
pr_err("%s: invalid arguments. Skipping device!\n",
dev->name);
goto err_free_netdev;
}
pr_info("Netdevice %d (%pM)\n", index, dev->dev_addr);
/* sysfs register */
if (!driver_registered) {
if (platform_driver_register(&iss_net_driver))
goto err_free_netdev;
driver_registered = 1;
}
lp->pdev.id = index;
lp->pdev.name = DRIVER_NAME;
lp->pdev.dev.release = iss_net_pdev_release;
if (platform_device_register(&lp->pdev))
goto err_free_netdev;
SET_NETDEV_DEV(dev, &lp->pdev.dev);
dev->netdev_ops = &iss_netdev_ops;
dev->mtu = lp->mtu;
dev->watchdog_timeo = (HZ >> 1);
dev->irq = -1;
rtnl_lock();
if (register_netdevice(dev)) {
rtnl_unlock();
pr_err("%s: error registering net device!\n", dev->name);
platform_device_unregister(&lp->pdev);
/* dev is freed by the iss_net_pdev_release callback */
return;
}
rtnl_unlock();
Annotation
- Immediate include surface: `linux/hex.h`, `linux/list.h`, `linux/irq.h`, `linux/spinlock.h`, `linux/slab.h`, `linux/timer.h`, `linux/if_ether.h`, `linux/inetdevice.h`.
- Detected declarations: `struct tuntap_info`, `struct iss_net_private`, `struct iss_net_ops`, `struct iss_net_private`, `struct iss_net_init`, `function setup_etheraddr`, `function tuntap_open`, `function tuntap_close`, `function tuntap_read`, `function tuntap_write`.
- Atlas domain: Architecture Layer / arch/xtensa.
- Implementation status: pattern 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.