rtw88: correct power limit selection
authorZong-Zhe Yang <kevin_yang@realtek.com>
Wed, 29 May 2019 07:54:43 +0000 (15:54 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Jun 2019 17:24:26 +0000 (20:24 +0300)
commit93f68a865f119393accaf4e09139d2853edfb53e
tree7ca092f0e4e479bafd12171ebdf07f3bf71f3898
parentadf3c676d1d2f7e9b09e0153c7f58b7f87ca1a6f
rtw88: correct power limit selection

If phy rate is decreased, sub bandwidth may be chosen by RA.
We consider possible power limits and apply the min one;
otherwise, the tx power index may be larger than spec.

And we cross-reference power limits of vht and ht with
20/40M bandwidth in 5G to avoid values are not assigned.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h
drivers/net/wireless/realtek/rtw88/phy.c