drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c- Extension
.c- Size
- 68962 bytes
- Lines
- 2654
- 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.
- 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/kernel.hlinux/module.hlinux/slab.hlinux/etherdevice.hlinux/ethtool.hlinux/if_vlan.hlinux/in.hlinux/ip.hlinux/tcp.hlinux/wireless.hlinux/ieee80211.hlinux/if_arp.hlinux/ctype.hlinux/string.hnet/iw_handler.hlinux/dma-mapping.hnet/checksum.hasm/firmware.hasm/ps3.hasm/lv1call.hps3_gelic_net.hps3_gelic_wireless.h
Detected Declarations
struct eurus_cmd_arg_infostruct ie_itemstruct ie_infofunction wpa2_capablefunction precise_iefunction gelic_eurus_sync_cmd_workerfunction gelic_wl_get_linkfunction gelic_wl_send_iwap_eventfunction gelic_wl_get_namefunction gelic_wl_get_ch_infofunction gelic_wl_get_rangefunction gelic_wl_set_scanfunction gelic_wl_synthesize_iefunction gelic_wl_parse_iefunction gelic_wl_get_scanfunction list_for_each_entryfunction scan_list_dumpfunction gelic_wl_set_authfunction gelic_wl_get_authfunction gelic_wl_set_essidfunction gelic_wl_get_essidfunction gelic_wl_set_encodefunction gelic_wl_get_encodefunction gelic_wl_set_apfunction gelic_wl_get_apfunction gelic_wl_set_encodeextfunction gelic_wl_get_encodeextfunction gelic_wl_set_modefunction gelic_wl_get_modefunction gelic_wl_get_nickfunction gelic_wl_start_scanfunction chipfunction list_for_each_entryfunction update_bestfunction list_for_each_entryfunction gelic_wl_do_wep_setupfunction gelic_wl_do_wpa_setupfunction gelic_wl_associate_bssfunction gelic_wl_connected_eventfunction gelic_wl_disconnect_eventfunction associate_bssfunction gelic_wl_event_workerfunction gelic_wl_assoc_workerfunction gelic_wl_interruptfunction gelic_wl_freefunction gelic_wl_try_associatefunction gelic_wl_openfunction gelic_wl_reset_state
Annotated Snippet
static const struct net_device_ops gelic_wl_netdevice_ops = {
.ndo_open = gelic_wl_open,
.ndo_stop = gelic_wl_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
};
static const struct ethtool_ops gelic_wl_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo,
.get_link = gelic_wl_get_link,
};
static void gelic_wl_setup_netdev_ops(struct net_device *netdev)
{
struct gelic_wl_info *wl;
wl = port_wl(netdev_priv(netdev));
BUG_ON(!wl);
netdev->watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
netdev->ethtool_ops = &gelic_wl_ethtool_ops;
netdev->netdev_ops = &gelic_wl_netdevice_ops;
netdev->wireless_handlers = &gelic_wl_wext_handler_def;
}
/*
* driver probe/remove
*/
int gelic_wl_driver_probe(struct gelic_card *card)
{
int ret;
struct net_device *netdev;
pr_debug("%s:start\n", __func__);
if (ps3_compare_firmware_version(1, 6, 0) < 0)
return 0;
if (!card->vlan[GELIC_PORT_WIRELESS].tx)
return 0;
/* alloc netdevice for wireless */
netdev = gelic_wl_alloc(card);
if (!netdev)
return -ENOMEM;
/* setup net_device structure */
SET_NETDEV_DEV(netdev, &card->dev->core);
gelic_wl_setup_netdev_ops(netdev);
/* setup some of net_device and register it */
ret = gelic_net_setup_netdev(netdev, card);
if (ret)
goto fail_setup;
card->netdev[GELIC_PORT_WIRELESS] = netdev;
/* add enable wireless interrupt */
card->irq_mask |= GELIC_CARD_WLAN_EVENT_RECEIVED |
GELIC_CARD_WLAN_COMMAND_COMPLETED;
/* to allow wireless commands while both interfaces are down */
gelic_card_set_irq_mask(card, GELIC_CARD_WLAN_EVENT_RECEIVED |
GELIC_CARD_WLAN_COMMAND_COMPLETED);
pr_debug("%s:end\n", __func__);
return 0;
fail_setup:
gelic_wl_free(port_wl(netdev_port(netdev)));
return ret;
}
int gelic_wl_driver_remove(struct gelic_card *card)
{
struct gelic_wl_info *wl;
struct net_device *netdev;
pr_debug("%s:start\n", __func__);
if (ps3_compare_firmware_version(1, 6, 0) < 0)
return 0;
if (!card->vlan[GELIC_PORT_WIRELESS].tx)
return 0;
netdev = card->netdev[GELIC_PORT_WIRELESS];
wl = port_wl(netdev_priv(netdev));
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/if_vlan.h`, `linux/in.h`, `linux/ip.h`.
- Detected declarations: `struct eurus_cmd_arg_info`, `struct ie_item`, `struct ie_info`, `function wpa2_capable`, `function precise_ie`, `function gelic_eurus_sync_cmd_worker`, `function gelic_wl_get_link`, `function gelic_wl_send_iwap_event`, `function gelic_wl_get_name`, `function gelic_wl_get_ch_info`.
- 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.
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.