drivers/net/wireless/realtek/rtw88/regd.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/regd.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/realtek/rtw88/regd.c
Extension
.c
Size
20957 bytes
Lines
542
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

struct rtw_regd_alternative_t {
	bool set;
	u8 alt;
};

#define DECL_REGD_ALT(_regd, _regd_alt) \
	[(_regd)] = {.set = true, .alt = (_regd_alt)}

static const struct rtw_regd_alternative_t
rtw_regd_alt[RTW_REGD_MAX] = {
	DECL_REGD_ALT(RTW_REGD_IC, RTW_REGD_FCC),
	DECL_REGD_ALT(RTW_REGD_KCC, RTW_REGD_ETSI),
	DECL_REGD_ALT(RTW_REGD_ACMA, RTW_REGD_ETSI),
	DECL_REGD_ALT(RTW_REGD_CHILE, RTW_REGD_FCC),
	DECL_REGD_ALT(RTW_REGD_UKRAINE, RTW_REGD_ETSI),
	DECL_REGD_ALT(RTW_REGD_MEXICO, RTW_REGD_FCC),
	DECL_REGD_ALT(RTW_REGD_CN, RTW_REGD_ETSI),
	DECL_REGD_ALT(RTW_REGD_QATAR, RTW_REGD_ETSI),
	DECL_REGD_ALT(RTW_REGD_UK, RTW_REGD_ETSI),
};

bool rtw_regd_has_alt(u8 regd, u8 *regd_alt)
{
	if (!rtw_regd_alt[regd].set)
		return false;

	*regd_alt = rtw_regd_alt[regd].alt;
	return true;
}

Annotation

Implementation Notes