drivers/staging/rtl8723bs/core/rtw_efuse.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_efuse.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_efuse.c- Extension
.c- Size
- 6740 bytes
- Lines
- 262
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drv_types.hhal_data.hlinux/jiffies.h
Detected Declarations
function Copyrightfunction EFUSE_Read1Bytefunction efuse_OneByteReadfunction Efuse_ReadAllMapfunction efuse_ShadowRead1Bytefunction efuse_ShadowRead2Bytefunction efuse_ShadowRead4Bytefunction EFUSE_ShadowMapUpdatefunction EFUSE_ShadowRead
Annotated Snippet
while (!(Bytetemp & 0x80)) {
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL + 3);
k++;
if (k == 1000)
break;
}
return rtw_read8(Adapter, EFUSE_CTRL);
} else
return 0xFF;
} /* EFUSE_Read1Byte */
/* 11/16/2008 MH Read one byte from real Efuse. */
u8
efuse_OneByteRead(
struct adapter *padapter,
u16 addr,
u8 *data)
{
u32 tmpidx = 0;
u8 bResult;
u8 readbyte;
/* <20130121, Kordan> For SMIC EFUSE specificatoin. */
/* 0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) */
/* PHY_SetMacReg(padapter, 0x34, BIT11, 0); */
rtw_write16(padapter, 0x34, rtw_read16(padapter, 0x34) & (~BIT11));
/* -----------------e-fuse reg ctrl --------------------------------- */
/* address */
rtw_write8(padapter, EFUSE_CTRL + 1, (u8)(addr & 0xff));
rtw_write8(padapter, EFUSE_CTRL + 2, ((u8)((addr >> 8) & 0x03)) |
(rtw_read8(padapter, EFUSE_CTRL + 2) & 0xFC));
/* rtw_write8(padapter, EFUSE_CTRL+3, 0x72); read cmd */
/* Write bit 32 0 */
readbyte = rtw_read8(padapter, EFUSE_CTRL + 3);
rtw_write8(padapter, EFUSE_CTRL + 3, (readbyte & 0x7f));
while (!(0x80 & rtw_read8(padapter, EFUSE_CTRL + 3)) && (tmpidx < 1000)) {
mdelay(1);
tmpidx++;
}
if (tmpidx < 100) {
*data = rtw_read8(padapter, EFUSE_CTRL);
bResult = true;
} else {
*data = 0xff;
bResult = false;
}
return bResult;
}
/*-----------------------------------------------------------------------------
* Function: Efuse_ReadAllMap
*
* Overview: Read All Efuse content
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 11/11/2008 MHC Create Version 0.
*
*/
static void Efuse_ReadAllMap(struct adapter *padapter, u8 efuseType, u8 *Efuse)
{
u16 mapLen = 0;
Hal_EfusePowerSwitch(padapter, true);
Hal_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, &mapLen);
Hal_ReadEFuse(padapter, efuseType, 0, mapLen, Efuse);
Hal_EfusePowerSwitch(padapter, false);
}
/*-----------------------------------------------------------------------------
* Function: efuse_ShadowRead1Byte
* efuse_ShadowRead2Byte
* efuse_ShadowRead4Byte
*
* Overview: Read from efuse init map by one/two/four bytes !!!!!
*
Annotation
- Immediate include surface: `drv_types.h`, `hal_data.h`, `linux/jiffies.h`.
- Detected declarations: `function Copyright`, `function EFUSE_Read1Byte`, `function efuse_OneByteRead`, `function Efuse_ReadAllMap`, `function efuse_ShadowRead1Byte`, `function efuse_ShadowRead2Byte`, `function efuse_ShadowRead4Byte`, `function EFUSE_ShadowMapUpdate`, `function EFUSE_ShadowRead`.
- Atlas domain: Driver Families / drivers/staging.
- 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.