PHY TX Power Recalc Target
- Initialize u8 tx_pwr_max to 0
- Initialize u8 tx_pwr_min to 255
- Define u8 array tx_pwr_rate with 101 elements
- If this is an N PHY
- Set max_num_rate to 101
- Else if this is an LCN PHY
- Set max_num_rate to 28
- Otherwise
- Set max_num_rate to 12
- Loop man_num_rate times, start with 0, increment by 1, and use rate as index
- Set tx_pwr_rate[rate] to the maximum for this channel/band
- Set tx_pwr_target[rate] to the minimum of tx_pwr_rate[rate] and 127
If tx_pwr_target[rate] > tx_pwr_max
- Set tx_pwr_max_rate_ind to rate
- Set tx_pwr_max to the maximum of tx_pwr_max and tx_pwr_target[rate]
- Set tx_pwr_min to the minimum of tx_pwr_min and tx_pwr_target[rate]
Set tx_power_max to tx_pwr_max
Set tx_power_min to tx_pwr_min
Set tx_power_max_rate_ind to tx_pwr_max_rate_ind
- Loop man_num_rate times, start with 0, increment by 1, and use rate as index
Clear tx_power_offset[rate] (Probably not needed, but left in specs for now.)
Set tx_power_target[rate] to tx_pwr_target[rate]
If hwpwrctrl is zero or this is a N PHY (This test and its dependencies are probably not needed, but left in specs for now.)
Set tx_power_offset[rate] to tx_power_max - tx_power_target[rate]
- Otherwise
Set tx_power_offset[rate] to tx_power_target[rate] - tx_power_min
- If this is an N PHY
- Else if this is an LCN PHY