drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c- Extension
.c- Size
- 12688 bytes
- Lines
- 482
- 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.
- 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/slab.hlinux/netdevice.hnet/cfg80211.hbrcmu_wifi.hbrcmu_utils.hdefs.hcore.hdebug.hfwil.hfwil_types.hbtcoex.hp2p.hcfg80211.h
Detected Declarations
struct brcmf_btcoex_infoenum brcmf_btcoex_statefunction brcmf_btcoex_params_writefunction brcmf_btcoex_params_readfunction brcmf_btcoex_boost_wififunction brcmf_btcoex_is_sco_activefunction btcmf_btcoex_save_part1function brcmf_btcoex_restore_part1function brcmf_btcoex_timerfuncfunction brcmf_btcoex_handlerfunction brcmf_btcoex_attachfunction brcmf_btcoex_detachfunction brcmf_btcoex_dhcp_startfunction brcmf_btcoex_dhcp_endfunction brcmf_btcoex_set_mode
Annotated Snippet
struct brcmf_btcoex_info {
struct brcmf_cfg80211_vif *vif;
struct timer_list timer;
u16 timeout;
bool timer_on;
bool dhcp_done;
enum brcmf_btcoex_state bt_state;
struct work_struct work;
struct brcmf_cfg80211_info *cfg;
u32 reg66;
u32 reg41;
u32 reg68;
bool saved_regs_part1;
u32 reg50;
u32 reg51;
u32 reg64;
u32 reg65;
u32 reg71;
bool saved_regs_part2;
};
/**
* brcmf_btcoex_params_write() - write btc_params firmware variable
* @ifp: interface
* @addr: btc_params register number
* @data: data to write
*/
static s32 brcmf_btcoex_params_write(struct brcmf_if *ifp, u32 addr, u32 data)
{
struct {
__le32 addr;
__le32 data;
} reg_write;
reg_write.addr = cpu_to_le32(addr);
reg_write.data = cpu_to_le32(data);
return brcmf_fil_iovar_data_set(ifp, "btc_params",
®_write, sizeof(reg_write));
}
/**
* brcmf_btcoex_params_read() - read btc_params firmware variable
* @ifp: interface
* @addr: btc_params register number
* @data: read data
*/
static s32 brcmf_btcoex_params_read(struct brcmf_if *ifp, u32 addr, u32 *data)
{
*data = addr;
return brcmf_fil_iovar_int_query(ifp, "btc_params", data);
}
/**
* brcmf_btcoex_boost_wifi() - control BT SCO/eSCO parameters
* @btci: BT coex info
* @trump_sco:
* true - set SCO/eSCO parameters for compatibility
* during DHCP window
* false - restore saved parameter values
*
* Enhanced BT COEX settings for eSCO compatibility during DHCP window
*/
static void brcmf_btcoex_boost_wifi(struct brcmf_btcoex_info *btci,
bool trump_sco)
{
struct brcmf_if *ifp = brcmf_get_ifp(btci->cfg->pub, 0);
if (trump_sco && !btci->saved_regs_part2) {
/* this should reduce eSCO agressive
* retransmit w/o breaking it
*/
/* save current */
brcmf_dbg(INFO, "new SCO/eSCO coex algo {save & override}\n");
brcmf_btcoex_params_read(ifp, 50, &btci->reg50);
brcmf_btcoex_params_read(ifp, 51, &btci->reg51);
brcmf_btcoex_params_read(ifp, 64, &btci->reg64);
brcmf_btcoex_params_read(ifp, 65, &btci->reg65);
brcmf_btcoex_params_read(ifp, 71, &btci->reg71);
btci->saved_regs_part2 = true;
brcmf_dbg(INFO,
"saved bt_params[50,51,64,65,71]: 0x%x 0x%x 0x%x 0x%x 0x%x\n",
btci->reg50, btci->reg51, btci->reg64,
btci->reg65, btci->reg71);
/* pacify the eSco */
brcmf_btcoex_params_write(ifp, 50, BRCMF_BT_DHCP_REG50);
brcmf_btcoex_params_write(ifp, 51, BRCMF_BT_DHCP_REG51);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/netdevice.h`, `net/cfg80211.h`, `brcmu_wifi.h`, `brcmu_utils.h`, `defs.h`, `core.h`, `debug.h`.
- Detected declarations: `struct brcmf_btcoex_info`, `enum brcmf_btcoex_state`, `function brcmf_btcoex_params_write`, `function brcmf_btcoex_params_read`, `function brcmf_btcoex_boost_wifi`, `function brcmf_btcoex_is_sco_active`, `function btcmf_btcoex_save_part1`, `function brcmf_btcoex_restore_part1`, `function brcmf_btcoex_timerfunc`, `function brcmf_btcoex_handler`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.