drivers/net/wireless/broadcom/b43/phy_common.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/phy_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/phy_common.c- Extension
.c- Size
- 14189 bytes
- Lines
- 594
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
phy_common.hphy_g.hphy_a.hphy_n.hphy_lp.hphy_ht.hphy_lcn.hphy_ac.hb43.hmain.h
Detected Declarations
function Copyrightfunction b43_phy_freefunction b43_phy_initfunction b43_phy_exitfunction b43_has_hardware_pctlfunction b43_radio_lockfunction b43_radio_unlockfunction b43_phy_lockfunction b43_phy_unlockfunction assert_mac_suspendedfunction b43_radio_readfunction b43_radio_writefunction b43_radio_maskfunction b43_radio_setfunction b43_radio_masksetfunction b43_radio_wait_valuefunction b43_phy_readfunction b43_phy_writefunction b43_phy_copyfunction b43_phy_maskfunction b43_phy_setfunction b43_phy_masksetfunction b43_phy_put_into_resetfunction b43_phy_take_out_of_resetfunction b43_switch_channelfunction b43_software_rfkillfunction b43_phy_txpower_adjust_workfunction b43_phy_txpower_checkfunction b43_phy_shm_tssi_readfunction b43_phyop_switch_analog_genericfunction b43_is_40mhzfunction b43_phy_force_clock
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
Broadcom B43 wireless driver
Common PHY routines
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
Copyright (c) 2005-2007 Stefano Brivio <stefano.brivio@polimi.it>
Copyright (c) 2005-2008 Michael Buesch <m@bues.ch>
Copyright (c) 2005, 2006 Danny van Dyk <kugelfang@gentoo.org>
Copyright (c) 2005, 2006 Andreas Jaggi <andreas.jaggi@waterwave.ch>
*/
#include "phy_common.h"
#include "phy_g.h"
#include "phy_a.h"
#include "phy_n.h"
#include "phy_lp.h"
#include "phy_ht.h"
#include "phy_lcn.h"
#include "phy_ac.h"
#include "b43.h"
#include "main.h"
int b43_phy_allocate(struct b43_wldev *dev)
{
struct b43_phy *phy = &(dev->phy);
int err;
phy->ops = NULL;
switch (phy->type) {
case B43_PHYTYPE_G:
#ifdef CONFIG_B43_PHY_G
phy->ops = &b43_phyops_g;
#endif
break;
case B43_PHYTYPE_N:
#ifdef CONFIG_B43_PHY_N
phy->ops = &b43_phyops_n;
#endif
break;
case B43_PHYTYPE_LP:
#ifdef CONFIG_B43_PHY_LP
phy->ops = &b43_phyops_lp;
#endif
break;
case B43_PHYTYPE_HT:
#ifdef CONFIG_B43_PHY_HT
phy->ops = &b43_phyops_ht;
#endif
break;
case B43_PHYTYPE_LCN:
#ifdef CONFIG_B43_PHY_LCN
phy->ops = &b43_phyops_lcn;
#endif
break;
case B43_PHYTYPE_AC:
#ifdef CONFIG_B43_PHY_AC
phy->ops = &b43_phyops_ac;
#endif
break;
}
if (B43_WARN_ON(!phy->ops))
return -ENODEV;
err = phy->ops->allocate(dev);
if (err)
phy->ops = NULL;
return err;
}
void b43_phy_free(struct b43_wldev *dev)
{
dev->phy.ops->free(dev);
dev->phy.ops = NULL;
}
int b43_phy_init(struct b43_wldev *dev)
{
struct b43_phy *phy = &dev->phy;
const struct b43_phy_operations *ops = phy->ops;
int err;
/* During PHY init we need to use some channel. On the first init this
* function is called *before* b43_op_config, so our pointer is NULL.
Annotation
- Immediate include surface: `phy_common.h`, `phy_g.h`, `phy_a.h`, `phy_n.h`, `phy_lp.h`, `phy_ht.h`, `phy_lcn.h`, `phy_ac.h`.
- Detected declarations: `function Copyright`, `function b43_phy_free`, `function b43_phy_init`, `function b43_phy_exit`, `function b43_has_hardware_pctl`, `function b43_radio_lock`, `function b43_radio_unlock`, `function b43_phy_lock`, `function b43_phy_unlock`, `function assert_mac_suspended`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.