N PHY TX Power Control Enable (u8 type)
If phyhang_avoid
Call N PHY Stay in Carrier Search with argument TRUE
- If type is 0 or 1
Set nphy_txpwrctrl to type
- Otherwise
- Warn on bad value for type
- If type is 0
If PHY revision >= 3
- If PHY register 0x1e7 ANDed with 0x27 is not zero
- Loop 2 times with core as index
- If core is zero
Set nphy_txpwr_idx[core] to phy register 0x1ed ANDed with 0x7f
- else
Set nphy_txpwr_idx[core] to phy register 0x1ee ANDed with 0x7f
- If core is zero
- Loop 2 times with core as index
- If PHY register 0x1e7 ANDed with 0x27 is not zero
- Fill 84-element u16 array regval with 0
- Write N PHY table with ID 26, length 84, offset 64, width 16, and data regval
- Write N PHY table with ID 27, length 84, offset 64, width 16, and data regval
If PHY Revision >= 3
- Mask PHY Register 0x1E7 with mask 0x1FFF
- Otherwise
- Mask PHY Register 0x1E7 with mask 0x9FFF
If PHY Revision >= 3
- Set bit 0x100 in PHY Register 0x8F
- Set bit 0x100 in PHY Register 0xA5
- Otherwise
- Set bit 0x4000 PHY Register 0xA5
- If PHY Revision is 2
- Maskset PHY Register 0xDC with mask 0xFF00 and set with 0x53
- Otherwise
- Maskset PHY Register 0xDC with mask 0xFF00 and set with 0x5A
- Set bit 0x200 in MAC control
- Otherwise
Write N PHY Table with ID 26, length 84, offset 64, and data at adj_pwr_tbl_nphy
Write N PHY Table with ID 27, length 84, offset 64, and data at adj_pwr_tbl_nphy
- Set bmask to 0x6000
- If type is 1
- Set val to 0x6000
- Otherwise
- Set val to 0
If PHY Revision >= 3
- Set bmask to 0xE000
- Set bit 0x8000 in val
MaskSet PHY Register 0x1E7 with mask ~(bmask) and set with val
- If band is 5G
If PHY Revision >= 7
- Otherwise
If PHY Revision >= 3
If nphy_txpwr_idx[0] != 128 and nphy_txpwr_idx[1] != 128
Maskset PHY Register 0x1E7 with mask 0xFF80 and set with nphy_txpwr_idx[0]
If PHY Revision > 1
Maskset PHY Register 0x222 with mask 0xFF00 and set with nphy_txpwr_idx[1]
If PHY Revision >= 3
- Mask PHY Register 0x8F with mask 0xFEFF
- Mask PHY Register 0xA5 with mask 0xFEFF
- Otherwise
- Mask PHY Register 0xA5 with mask 0xBFFF
- If PHY Revision is 2
MaskSet PHY Register 0xDC with mask 0xFF00 and set with 0x003B
Else if PHY Revision < 2
MaskSet PHY Register 0xDC with mask 0xFF00 and set with 0x0040
If PHY Revision < 2 AND the band width is 40 MHz
- Clear bit 0x200 in MAC control
If (nphy_ipa2g_on AND bandtype is 2.4 GHz) OR (nphy_ipa5g_on AND bandtype is 5 GHz)
- Maskset PHY Register 0x297 with mask 0xFFFB and set with 0
- Maskset PHY Register 0x29B with mask 0xFFFB and set with 0
If phyhang_avoid
Call N PHY Stay in Carrier Search with argument FALSE