drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c

Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c

File Facts

System
Linux kernel
Corpus path
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
Extension
.c
Size
75006 bytes
Lines
2637
Domain
Driver Families
Bucket
drivers/staging
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

switch (pCoexDm->curArfrType) {
		case 0:	/*  normal mode */
			pBtCoexist->fBtcWrite4Byte(
				pBtCoexist, 0x430, pCoexDm->backupArfrCnt1
			);
			pBtCoexist->fBtcWrite4Byte(
				pBtCoexist, 0x434, pCoexDm->backupArfrCnt2
			);
			break;
		case 1:
			pBtCoexist->fBtcGet(
				pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
			);
			if (bWifiUnderBMode) {
				pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
				pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101);
			} else {
				pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
				pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x04030201);
			}
			break;
		default:
			break;
		}
	}

	pCoexDm->preArfrType = pCoexDm->curArfrType;
}

static void halbtc8723b1ant_RetryLimit(
	struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
)
{
	pCoexDm->curRetryLimitType = type;

	if (
		bForceExec ||
		(pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)
	) {
		switch (pCoexDm->curRetryLimitType) {
		case 0:	/*  normal mode */
			pBtCoexist->fBtcWrite2Byte(
				pBtCoexist, 0x42a, pCoexDm->backupRetryLimit
			);
			break;
		case 1:	/*  retry limit =8 */
			pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808);
			break;
		default:
			break;
		}
	}

	pCoexDm->preRetryLimitType = pCoexDm->curRetryLimitType;
}

static void halbtc8723b1ant_AmpduMaxTime(
	struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
)
{
	pCoexDm->curAmpduTimeType = type;

	if (
		bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
	) {
		switch (pCoexDm->curAmpduTimeType) {
		case 0:	/*  normal mode */
			pBtCoexist->fBtcWrite1Byte(
				pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime
			);
			break;
		case 1:	/*  AMPDU timw = 0x38 * 32us */
			pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38);
			break;
		default:
			break;
		}
	}

	pCoexDm->preAmpduTimeType = pCoexDm->curAmpduTimeType;
}

static void halbtc8723b1ant_LimitedTx(
	struct btc_coexist *pBtCoexist,
	bool bForceExec,
	u8 raMaskType,
	u8 arfrType,
	u8 retryLimitType,
	u8 ampduTimeType
)

Annotation

Implementation Notes