Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1243832 > unrolled thread
| Started by | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| First post | 2015-10-10 08:30 +0200 |
| Last post | 2015-10-13 17:40 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 2/3] staging: rtl8188eu: bugfix: correct channels range is set in Hal_ReadTxPowerInfo88E Ivan Safonov <insafonov@gmail.com> - 2015-10-10 08:30 +0200
Re: [PATCH 2/3] staging: rtl8188eu: bugfix: correct channels range is set in Hal_ReadTxPowerInfo88E Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-13 07:50 +0200
Re: [PATCH 2/3] staging: rtl8188eu: bugfix: correct channels range is set in Hal_ReadTxPowerInfo88E Ivan Safonov <insafonov@gmail.com> - 2015-10-13 17:40 +0200
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2015-10-10 08:30 +0200 |
| Subject | [PATCH 2/3] staging: rtl8188eu: bugfix: correct channels range is set in Hal_ReadTxPowerInfo88E |
| Message-ID | <qhVPk-134-17@gated-at.bofh.it> |
Correct channels range is 1..14 (numbering from 1) but not 0..13.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 4fa2c78..46e0fdd 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -481,18 +481,18 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
pHalData->bTXPowerDataReadFromEEPORM = true;
for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
- for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
+ for (ch = 1; ch <= CHANNEL_MAX_NUMBER; ch++) {
group = get_channel_group(ch);
- pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
+ pHalData->Index24G_CCK_Base[rfPath][ch - 1] = pwrInfo24G.IndexCCK_Base[rfPath][group];
if (ch == 14)
- pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
+ pHalData->Index24G_BW40_Base[rfPath][ch - 1] = pwrInfo24G.IndexBW40_Base[rfPath][4];
else
- pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
+ pHalData->Index24G_BW40_Base[rfPath][ch - 1] = pwrInfo24G.IndexBW40_Base[rfPath][group];
DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
- DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
- DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
+ DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch - 1]);
+ DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch - 1]);
}
for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
pHalData->CCK_24G_Diff[rfPath][TxCount] = pwrInfo24G.CCK_Diff[rfPath][TxCount];
--
2.4.9
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2015-10-13 07:50 +0200 |
| Subject | Re: [PATCH 2/3] staging: rtl8188eu: bugfix: correct channels range is set in Hal_ReadTxPowerInfo88E |
| Message-ID | <qj0Dg-5EA-5@gated-at.bofh.it> |
| In reply to | #1243832 |
On Sat, Oct 10, 2015 at 01:27:00PM +0700, Ivan Safonov wrote: > Correct channels range is 1..14 (numbering from 1) but not 0..13. Why? Have you tested this? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2015-10-13 17:40 +0200 |
| Message-ID | <qj9Qe-2jW-31@gated-at.bofh.it> |
| In reply to | #1245355 |
On 10/13/2015 10:47 AM, Greg Kroah-Hartman wrote:
> On Sat, Oct 10, 2015 at 01:27:00PM +0700, Ivan Safonov wrote:
>> Correct channels range is 1..14 (numbering from 1) but not 0..13.
> Have you tested this?
I have not tested it.
> Why?
From condition
if (chnl <= 14) {
bIn24G = true;
it shows that the highest number of channels at a frequency of 2.4 GHz
is 14.
And first comment tells us that only 2 channels has the numbers <3,
which means that the numbering starts from 1:
static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
{
u8 bIn24G = true;
if (chnl <= 14) {
bIn24G = true;
if (chnl < 3) /* Channel 1-2 */
*pGroup = 0;
else if (chnl < 6) /* Channel 3-5 */
*pGroup = 1;
else if (chnl < 9) /* Channel 6-8 */
*pGroup = 2;
else if (chnl < 12) /* Channel 9-11 */
*pGroup = 3;
else if (chnl < 14) /* Channel 12-13 */
*pGroup = 4;
else if (chnl == 14) /* Channel 14 */
*pGroup = 5;
} else {
... // 5 GHz groups
Hal_ReadTxPowerInfo88E function raises questions in this location(->):
if (bIn24G) {
pHalData->Index24G_CCK_Base[rfPath][ch] =
pwrInfo24G.IndexCCK_Base[rfPath][group];
-> if (ch == 14)
-> pHalData->Index24G_BW40_Base[rfPath][ch] =
pwrInfo24G.IndexBW40_Base[rfPath][4];
-> else
-> pHalData->Index24G_BW40_Base[rfPath][ch] =
pwrInfo24G.IndexBW40_Base[rfPath][group];
}
If channel range is 0..(CHANNEL_MAX_NUMBER - 1) code is dead
(CHANNEL_MAX_NUMBER = 14):
But if channel range is 1..14 will the right to remove branching if (ch
== 14) in Hal_ReadTxPowerInfo88E, changing Hal_GetChnlGroup88E so that
when chnl == 14 itreturned 4?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web