drivers/net/wireless/intel/ipw2x00/ipw2100.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/ipw2x00/ipw2100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/ipw2x00/ipw2100.c- Extension
.c- Size
- 227708 bytes
- Lines
- 8562
- 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/compiler.hlinux/errno.hlinux/if_arp.hlinux/in6.hlinux/in.hlinux/ip.hlinux/kernel.hlinux/kmod.hlinux/module.hlinux/netdevice.hlinux/ethtool.hlinux/pci.hlinux/dma-mapping.hlinux/proc_fs.hlinux/skbuff.hlinux/uaccess.hasm/io.hlinux/fs.hlinux/mm.hlinux/slab.hlinux/unistd.hlinux/stringify.hlinux/tcp.hlinux/types.hlinux/time.hlinux/firmware.hlinux/acpi.hlinux/ctype.hlinux/pm_qos.hipw2100.hipw.hlinux/moduleparam.h
Detected Declarations
struct ipw2100_status_indicatorstruct ipw2100_status_indicatorstruct ipw_rt_hdrstruct security_info_paramsstruct ipw2100_wep_keystruct ipw2100_fw_headerstruct symbol_alive_responsefunction read_registerfunction write_registerfunction read_register_wordfunction read_register_bytefunction write_register_wordfunction write_register_bytefunction read_nic_dwordfunction write_nic_dwordfunction read_nic_wordfunction write_nic_wordfunction read_nic_bytefunction write_nic_bytefunction write_nic_memoryfunction read_nic_memoryfunction ipw2100_hw_is_adapter_in_systemfunction ipw2100_get_ordinalfunction ipw2100_set_ordinalfunction printk_buffunction schedule_resetfunction ipw2100_hw_send_commandfunction ipw2100_verifyfunction ipw2100_wait_for_card_statefunction sw_reset_and_clockfunction ipw2100_download_firmwarefunction ipw2100_enable_interruptsfunction ipw2100_disable_interruptsfunction ipw2100_initialize_ordinalsfunction ipw2100_hw_set_gpiofunction rf_kill_activefunction ipw2100_get_hw_featuresfunction ipw2100_start_adapterfunction ipw2100_reset_fatalerrorfunction ipw2100_power_cycle_adapterfunction ipw2100_hw_phy_offfunction ipw2100_enable_adapterfunction ipw2100_hw_stop_adapterfunction ipw2100_disable_adapterfunction ipw2100_set_scan_optionsfunction ipw2100_start_scanfunction ipw2100_upfunction ipw2100_down
Annotated Snippet
static ssize_t debug_level_show(struct device_driver *d, char *buf)
{
return sprintf(buf, "0x%08X\n", ipw2100_debug_level);
}
static ssize_t debug_level_store(struct device_driver *d,
const char *buf, size_t count)
{
u32 val;
int ret;
ret = kstrtou32(buf, 0, &val);
if (ret)
IPW_DEBUG_INFO(": %s is not in hex or decimal form.\n", buf);
else
ipw2100_debug_level = val;
return strnlen(buf, count);
}
static DRIVER_ATTR_RW(debug_level);
#endif /* CONFIG_IPW2100_DEBUG */
static ssize_t fatal_error_show(struct device *d,
struct device_attribute *attr, char *buf)
{
struct ipw2100_priv *priv = dev_get_drvdata(d);
char *out = buf;
int i;
if (priv->fatal_error)
out += sprintf(out, "0x%08X\n", priv->fatal_error);
else
out += sprintf(out, "0\n");
for (i = 1; i <= IPW2100_ERROR_QUEUE; i++) {
if (!priv->fatal_errors[(priv->fatal_index - i) %
IPW2100_ERROR_QUEUE])
continue;
out += sprintf(out, "%d. 0x%08X\n", i,
priv->fatal_errors[(priv->fatal_index - i) %
IPW2100_ERROR_QUEUE]);
}
return out - buf;
}
static ssize_t fatal_error_store(struct device *d,
struct device_attribute *attr, const char *buf,
size_t count)
{
struct ipw2100_priv *priv = dev_get_drvdata(d);
schedule_reset(priv);
return count;
}
static DEVICE_ATTR_RW(fatal_error);
static ssize_t scan_age_show(struct device *d, struct device_attribute *attr,
char *buf)
{
struct ipw2100_priv *priv = dev_get_drvdata(d);
return sprintf(buf, "%d\n", priv->ieee->scan_age);
}
static ssize_t scan_age_store(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{
struct ipw2100_priv *priv = dev_get_drvdata(d);
struct net_device *dev = priv->net_dev;
unsigned long val;
int ret;
(void)dev; /* kill unused-var warning for debug-only code */
IPW_DEBUG_INFO("enter\n");
ret = kstrtoul(buf, 0, &val);
if (ret) {
IPW_DEBUG_INFO("%s: user supplied invalid value.\n", dev->name);
} else {
priv->ieee->scan_age = val;
IPW_DEBUG_INFO("set scan_age = %u\n", priv->ieee->scan_age);
}
IPW_DEBUG_INFO("exit\n");
return strnlen(buf, count);
}
static DEVICE_ATTR_RW(scan_age);
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/errno.h`, `linux/if_arp.h`, `linux/in6.h`, `linux/in.h`, `linux/ip.h`, `linux/kernel.h`, `linux/kmod.h`.
- Detected declarations: `struct ipw2100_status_indicator`, `struct ipw2100_status_indicator`, `struct ipw_rt_hdr`, `struct security_info_params`, `struct ipw2100_wep_key`, `struct ipw2100_fw_header`, `struct symbol_alive_response`, `function read_register`, `function write_register`, `function read_register_word`.
- 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.