drivers/net/ethernet/toshiba/ps3_gelic_net.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/toshiba/ps3_gelic_net.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/toshiba/ps3_gelic_net.c- Extension
.c- Size
- 49719 bytes
- Lines
- 1917
- 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.
- 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
linux/interrupt.hlinux/kernel.hlinux/module.hlinux/slab.hlinux/etherdevice.hlinux/ethtool.hlinux/if_vlan.hlinux/in.hlinux/ip.hlinux/tcp.hlinux/dma-mapping.hnet/checksum.hasm/firmware.hasm/ps3.hasm/lv1call.hps3_gelic_net.hps3_gelic_wireless.h
Detected Declarations
function gelic_card_set_irq_maskfunction gelic_card_rx_irq_onfunction gelic_card_rx_irq_offfunction gelic_card_get_ether_port_statusfunction gelic_descr_get_statusfunction gelic_card_set_link_modefunction gelic_card_disable_txdmacfunction gelic_card_enable_rxdmacfunction gelic_card_disable_rxdmacfunction gelic_descr_set_statusfunction gelic_card_reset_chainfunction gelic_card_upfunction gelic_card_downfunction gelic_card_free_chainfunction gelic_card_init_chainfunction gelic_descr_prepare_rxfunction gelic_card_release_rx_chainfunction gelic_card_fill_rx_chainfunction gelic_card_alloc_rx_skbsfunction descriptorfunction gelic_card_stop_queuesfunction gelic_card_wake_queuesfunction gelic_card_release_tx_chainfunction gelic_net_set_multifunction gelic_net_stopfunction gelic_card_get_next_tx_descrfunction gelic_descr_set_tx_cmdstatfunction gelic_descr_prepare_txfunction gelic_card_kick_txdmafunction gelic_net_xmitfunction gelic_net_pass_skb_upfunction gelic_card_decode_one_descrfunction gelic_rx_oom_timerfunction gelic_net_pollfunction gelic_card_interruptfunction gelic_net_poll_controllerfunction gelic_net_openfunction gelic_net_get_drvinfofunction gelic_ether_get_link_ksettingsfunction gelic_ether_set_link_ksettingsfunction gelic_net_get_wolfunction gelic_net_set_wolfunction functionfunction gelic_net_tx_timeoutfunction gelic_ether_setup_netdev_opsfunction gelic_net_setup_netdevfunction gelic_card_get_vlan_infofunction ps3_gelic_driver_probe
Annotated Snippet
static const struct net_device_ops gelic_netdevice_ops = {
.ndo_open = gelic_net_open,
.ndo_stop = gelic_net_stop,
.ndo_start_xmit = gelic_net_xmit,
.ndo_set_rx_mode = gelic_net_set_multi,
.ndo_tx_timeout = gelic_net_tx_timeout,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = gelic_net_poll_controller,
#endif
};
/**
* gelic_ether_setup_netdev_ops - initialization of net_device operations
* @netdev: net_device structure
* @napi: napi structure
*
* fills out function pointers in the net_device structure
*/
static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
struct napi_struct *napi)
{
netdev->watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
/* NAPI */
netif_napi_add(netdev, napi, gelic_net_poll);
netdev->ethtool_ops = &gelic_ether_ethtool_ops;
netdev->netdev_ops = &gelic_netdevice_ops;
}
/**
* gelic_net_setup_netdev - initialization of net_device
* @netdev: net_device structure
* @card: card structure
*
* Returns 0 on success or <0 on failure
*
* gelic_ether_setup_netdev initializes the net_device structure
* and register it.
**/
int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
{
int status;
u64 v1, v2;
netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
netdev->features = NETIF_F_IP_CSUM;
if (GELIC_CARD_RX_CSUM_DEFAULT)
netdev->features |= NETIF_F_RXCSUM;
status = lv1_net_control(bus_id(card), dev_id(card),
GELIC_LV1_GET_MAC_ADDRESS,
0, 0, 0, &v1, &v2);
v1 <<= 16;
if (status || !is_valid_ether_addr((u8 *)&v1)) {
dev_info(ctodev(card),
"%s:lv1_net_control GET_MAC_ADDR failed %d\n",
__func__, status);
return -EINVAL;
}
eth_hw_addr_set(netdev, (u8 *)&v1);
if (card->vlan_required) {
netdev->hard_header_len += VLAN_HLEN;
/*
* As vlan is internally used,
* we can not receive vlan packets
*/
netdev->features |= NETIF_F_VLAN_CHALLENGED;
}
/* MTU range: 64 - 1518 */
netdev->min_mtu = GELIC_NET_MIN_MTU;
netdev->max_mtu = GELIC_NET_MAX_MTU;
status = register_netdev(netdev);
if (status) {
dev_err(ctodev(card), "%s:Couldn't register %s %d\n",
__func__, netdev->name, status);
return status;
}
dev_info(ctodev(card), "%s: MAC addr %pM\n",
netdev->name, netdev->dev_addr);
return 0;
}
#define GELIC_ALIGN (32)
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/if_vlan.h`, `linux/in.h`.
- Detected declarations: `function gelic_card_set_irq_mask`, `function gelic_card_rx_irq_on`, `function gelic_card_rx_irq_off`, `function gelic_card_get_ether_port_status`, `function gelic_descr_get_status`, `function gelic_card_set_link_mode`, `function gelic_card_disable_txdmac`, `function gelic_card_enable_rxdmac`, `function gelic_card_disable_rxdmac`, `function gelic_descr_set_status`.
- Atlas domain: Driver Families / drivers/net.
- 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.