drivers/net/ethernet/broadcom/b44.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/b44.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/b44.c- Extension
.c- Size
- 64640 bytes
- Lines
- 2600
- 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/kernel.hlinux/module.hlinux/moduleparam.hlinux/types.hlinux/netdevice.hlinux/ethtool.hlinux/mii.hlinux/if_ether.hlinux/if_vlan.hlinux/etherdevice.hlinux/pci.hlinux/delay.hlinux/init.hlinux/interrupt.hlinux/dma-mapping.hlinux/ssb/ssb.hlinux/slab.hlinux/phy.hlinux/phy_fixed.hlinux/uaccess.hasm/io.hasm/irq.hb44.hlinux/bcm47xx_nvram.h
Detected Declarations
function b44_sync_dma_desc_for_devicefunction b44_sync_dma_desc_for_cpufunction br32function bw32function b44_wait_bitfunction __b44_cam_writefunction __b44_disable_intsfunction b44_disable_intsfunction b44_enable_intsfunction __b44_readphyfunction __b44_writephyfunction b44_readphyfunction b44_writephyfunction b44_mdio_read_miifunction b44_mdio_write_miifunction b44_mdio_read_phylibfunction b44_mdio_write_phylibfunction b44_phy_resetfunction __b44_set_flow_ctrlfunction b44_set_flow_ctrlfunction b44_wap54g10_workaroundfunction b44_wap54g10_workaroundfunction b44_stats_updatefunction b44_link_reportfunction b44_check_phyfunction b44_timerfunction b44_txfunction b44_alloc_rx_skbfunction b44_recycle_rxfunction b44_rxfunction b44_pollfunction b44_interruptfunction b44_tx_timeoutfunction b44_start_xmitfunction b44_change_mtufunction b44_free_ringsfunction b44_init_ringsfunction b44_free_consistentfunction b44_alloc_consistentfunction b44_clear_statsfunction b44_chip_resetfunction b44_haltfunction __b44_set_mac_addrfunction b44_set_mac_addrfunction b44_init_hwfunction b44_openfunction b44_poll_controllerfunction bwfilter_table
Annotated Snippet
static struct pci_driver b44_pci_driver = {
.name = DRV_MODULE_NAME,
.id_table = b44_pci_tbl,
};
#endif /* CONFIG_B44_PCI */
static const struct ssb_device_id b44_ssb_tbl[] = {
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_ETHERNET, SSB_ANY_REV),
{},
};
MODULE_DEVICE_TABLE(ssb, b44_ssb_tbl);
static void b44_halt(struct b44 *);
static void b44_init_rings(struct b44 *);
#define B44_FULL_RESET 1
#define B44_FULL_RESET_SKIP_PHY 2
#define B44_PARTIAL_RESET 3
#define B44_CHIP_RESET_FULL 4
#define B44_CHIP_RESET_PARTIAL 5
static void b44_init_hw(struct b44 *, int);
static int dma_desc_sync_size;
static int instance;
static const char b44_gstrings[][ETH_GSTRING_LEN] = {
#define _B44(x...) # x,
B44_STAT_REG_DECLARE
#undef _B44
};
static inline void b44_sync_dma_desc_for_device(struct ssb_device *sdev,
dma_addr_t dma_base,
unsigned long offset,
enum dma_data_direction dir)
{
dma_sync_single_for_device(sdev->dma_dev, dma_base + offset,
dma_desc_sync_size, dir);
}
static inline void b44_sync_dma_desc_for_cpu(struct ssb_device *sdev,
dma_addr_t dma_base,
unsigned long offset,
enum dma_data_direction dir)
{
dma_sync_single_for_cpu(sdev->dma_dev, dma_base + offset,
dma_desc_sync_size, dir);
}
static inline unsigned long br32(const struct b44 *bp, unsigned long reg)
{
return ssb_read32(bp->sdev, reg);
}
static inline void bw32(const struct b44 *bp,
unsigned long reg, unsigned long val)
{
ssb_write32(bp->sdev, reg, val);
}
static int b44_wait_bit(struct b44 *bp, unsigned long reg,
u32 bit, unsigned long timeout, const int clear)
{
unsigned long i;
for (i = 0; i < timeout; i++) {
u32 val = br32(bp, reg);
if (clear && !(val & bit))
break;
if (!clear && (val & bit))
break;
udelay(10);
}
if (i == timeout) {
if (net_ratelimit())
netdev_err(bp->dev, "BUG! Timeout waiting for bit %08x of register %lx to %s\n",
bit, reg, clear ? "clear" : "set");
return -ENODEV;
}
return 0;
}
static inline void __b44_cam_write(struct b44 *bp,
const unsigned char *data, int index)
{
u32 val;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/types.h`, `linux/netdevice.h`, `linux/ethtool.h`, `linux/mii.h`, `linux/if_ether.h`.
- Detected declarations: `function b44_sync_dma_desc_for_device`, `function b44_sync_dma_desc_for_cpu`, `function br32`, `function bw32`, `function b44_wait_bit`, `function __b44_cam_write`, `function __b44_disable_ints`, `function b44_disable_ints`, `function b44_enable_ints`, `function __b44_readphy`.
- 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.