drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h
Extension
.h
Size
7674 bytes
Lines
248
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.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2010 Broadcom Corporation
 */

#ifndef	_BRCMU_WIFI_H_
#define	_BRCMU_WIFI_H_

#include <linux/if_ether.h>		/* for ETH_ALEN */
#include <linux/ieee80211.h>		/* for WLAN_PMKID_LEN */

/*
 * A chanspec (u16) holds the channel number, band, bandwidth and control
 * sideband
 */

/* channel defines */
#define CH_UPPER_SB			0x01
#define CH_LOWER_SB			0x02
#define CH_EWA_VALID			0x04
#define CH_70MHZ_APART			14
#define CH_50MHZ_APART			10
#define CH_30MHZ_APART			6
#define CH_20MHZ_APART			4
#define CH_10MHZ_APART			2
#define CH_5MHZ_APART			1 /* 2G band channels are 5 Mhz apart */
#define CH_MIN_2G_CHANNEL		1
#define CH_MAX_2G_CHANNEL		14	/* Max channel in 2G band */
#define CH_MIN_5G_CHANNEL		34

/* bandstate array indices */
#define BAND_2G_INDEX		0	/* wlc->bandstate[x] index */
#define BAND_5G_INDEX		1	/* wlc->bandstate[x] index */

/*
 * max # supported channels. The max channel no is 216, this is that + 1
 * rounded up to a multiple of NBBY (8). DO NOT MAKE it > 255: channels are
 * u8's all over
*/
#define	MAXCHANNEL		224

#define WL_CHANSPEC_CHAN_MASK		0x00ff
#define WL_CHANSPEC_CHAN_SHIFT		0

#define WL_CHANSPEC_CTL_SB_MASK		0x0300
#define WL_CHANSPEC_CTL_SB_SHIFT	     8
#define WL_CHANSPEC_CTL_SB_LOWER	0x0100
#define WL_CHANSPEC_CTL_SB_UPPER	0x0200
#define WL_CHANSPEC_CTL_SB_NONE		0x0300

#define WL_CHANSPEC_BW_MASK		0x0C00
#define WL_CHANSPEC_BW_SHIFT		    10
#define WL_CHANSPEC_BW_10		0x0400
#define WL_CHANSPEC_BW_20		0x0800
#define WL_CHANSPEC_BW_40		0x0C00
#define WL_CHANSPEC_BW_80		0x2000

#define WL_CHANSPEC_BAND_MASK		0xf000
#define WL_CHANSPEC_BAND_SHIFT		12
#define WL_CHANSPEC_BAND_5G		0x1000
#define WL_CHANSPEC_BAND_2G		0x2000
#define INVCHANSPEC			255

#define WL_CHAN_VALID_HW		(1 << 0) /* valid with current HW */
#define WL_CHAN_VALID_SW		(1 << 1) /* valid with country sett. */
#define WL_CHAN_BAND_5G			(1 << 2) /* 5GHz-band channel */
#define WL_CHAN_RADAR			(1 << 3) /* radar sensitive  channel */
#define WL_CHAN_INACTIVE		(1 << 4) /* inactive due to radar */
#define WL_CHAN_PASSIVE			(1 << 5) /* channel in passive mode */
#define WL_CHAN_RESTRICTED		(1 << 6) /* restricted use channel */

/* values for band specific 40MHz capabilities  */
#define WLC_N_BW_20ALL			0
#define WLC_N_BW_40ALL			1
#define WLC_N_BW_20IN2G_40IN5G		2

#define WLC_BW_20MHZ_BIT		BIT(0)
#define WLC_BW_40MHZ_BIT		BIT(1)
#define WLC_BW_80MHZ_BIT		BIT(2)
#define WLC_BW_160MHZ_BIT		BIT(3)

/* Bandwidth capabilities */
#define WLC_BW_CAP_20MHZ		(WLC_BW_20MHZ_BIT)
#define WLC_BW_CAP_40MHZ		(WLC_BW_40MHZ_BIT|WLC_BW_20MHZ_BIT)
#define WLC_BW_CAP_80MHZ		(WLC_BW_80MHZ_BIT|WLC_BW_40MHZ_BIT| \
					 WLC_BW_20MHZ_BIT)
#define WLC_BW_CAP_160MHZ		(WLC_BW_160MHZ_BIT|WLC_BW_80MHZ_BIT| \
					 WLC_BW_40MHZ_BIT|WLC_BW_20MHZ_BIT)
#define WLC_BW_CAP_UNRESTRICTED		0xFF

Annotation

Implementation Notes