Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1243831 > unrolled thread

[PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c

Started byIvan Safonov <insafonov@gmail.com>
First post2015-10-10 08:30 +0200
Last post2015-10-13 17:50 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from  /hal/rtl8188e_hal_init.c Ivan Safonov <insafonov@gmail.com> - 2015-10-10 08:30 +0200
    Re: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed  from /hal/rtl8188e_hal_init.c Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-13 07:50 +0200
      Re: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from  /hal/rtl8188e_hal_init.c Ivan Safonov <insafonov@gmail.com> - 2015-10-13 17:00 +0200
        Re: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from  /hal/rtl8188e_hal_init.c Ivan Safonov <insafonov@gmail.com> - 2015-10-13 17:50 +0200
        Re: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed  from /hal/rtl8188e_hal_init.c Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-13 17:50 +0200

#1243831 — [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c

FromIvan Safonov <insafonov@gmail.com>
Date2015-10-10 08:30 +0200
Subject[PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c
Message-ID<qhVPk-134-19@gated-at.bofh.it>
Unnecessary channel groups for 5 GHz removed from Hal_GetChnlGroup88E
and it transformed to pretty get_channel_group(const u8 channel).

Also removed code for 5 GHz frequency in Hal_ReadPowerValueFromPROM_8188E.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 92 +++++++----------------
 1 file changed, 29 insertions(+), 63 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index a6295ca..4fa2c78 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -424,56 +424,24 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
 	}
 }
 
-static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
+static u8 get_channel_group(const u8 channel)
 {
-	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 {
-		bIn24G = false;
-
-		if (chnl <= 40)
-			*pGroup = 0;
-		else if (chnl <= 48)
-			*pGroup = 1;
-		else	 if (chnl <= 56)
-			*pGroup = 2;
-		else if (chnl <= 64)
-			*pGroup = 3;
-		else if (chnl <= 104)
-			*pGroup = 4;
-		else if (chnl <= 112)
-			*pGroup = 5;
-		else if (chnl <= 120)
-			*pGroup = 5;
-		else if (chnl <= 128)
-			*pGroup = 6;
-		else if (chnl <= 136)
-			*pGroup = 7;
-		else if (chnl <= 144)
-			*pGroup = 8;
-		else if (chnl <= 153)
-			*pGroup = 9;
-		else if (chnl <= 161)
-			*pGroup = 10;
-		else if (chnl <= 177)
-			*pGroup = 11;
-	}
-	return bIn24G;
+	u8 group;
+
+	if (channel < 3)        /* Channel 1-2 */
+		group = 0;
+	else if (channel < 6)   /* Channel 3-5 */
+		group = 1;
+	else if (channel < 9)   /* Channel 6-8 */
+		group = 2;
+	else if (channel < 12)  /* Channel 9-11 */
+		group = 3;
+	else if (channel < 14)  /* Channel 12-13 */
+		group = 4;
+	else                    /* Channel 14 */
+		group = 5;
+
+	return group;
 }
 
 void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
@@ -505,7 +473,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
 	struct hal_data_8188e	*pHalData = GET_HAL_DATA(padapter);
 	struct txpowerinfo24g pwrInfo24G;
 	u8 rfPath, ch, group;
-	u8 bIn24G, TxCount;
+	u8 TxCount;
 
 	Hal_ReadPowerValueFromPROM_8188E(&pwrInfo24G, PROMContent, AutoLoadFail);
 
@@ -514,19 +482,17 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
 
 	for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
 		for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
-			bIn24G = Hal_GetChnlGroup88E(ch, &group);
-			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 (bIn24G) {
-				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]);
-			}
+			group = get_channel_group(ch);
+
+			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];
+
+			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]);
 		}
 		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]


#1245354 — Re: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-10-13 07:50 +0200
SubjectRe: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c
Message-ID<qj0Dg-5EA-11@gated-at.bofh.it>
In reply to#1243831
On Sat, Oct 10, 2015 at 01:23:13PM +0700, Ivan Safonov wrote:
> Unnecessary channel groups for 5 GHz removed from Hal_GetChnlGroup88E
> and it transformed to pretty get_channel_group(const u8 channel).
> 
> Also removed code for 5 GHz frequency in Hal_ReadPowerValueFromPROM_8188E.

Why did you do two different things in this patch?

Have you tested this?

thanks,

greg k-h
--
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]


#1245820

FromIvan Safonov <insafonov@gmail.com>
Date2015-10-13 17:00 +0200
Message-ID<qj9dx-1jL-47@gated-at.bofh.it>
In reply to#1245354
On 10/13/2015 10:47 AM, Greg Kroah-Hartman wrote:
> On Sat, Oct 10, 2015 at 01:23:13PM +0700, Ivan Safonov wrote:
>> Unnecessary channel groups for 5 GHz removed from Hal_GetChnlGroup88E
>> and it transformed to pretty get_channel_group(const u8 channel).
>>
>> Also removed code for 5 GHz frequency in Hal_ReadPowerValueFromPROM_8188E.
> Why did you do two different things in this patch?
>
> Have you tested this?
>
> thanks,
>
> greg k-h

Split this patch into two parts?

I have not tested it.
--
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]


#1245856

FromIvan Safonov <insafonov@gmail.com>
Date2015-10-13 17:50 +0200
Message-ID<qj9ZT-2xR-9@gated-at.bofh.it>
In reply to#1245820
On 10/13/2015 10:40 PM, Greg Kroah-Hartman wrote:
> On Tue, Oct 13, 2015 at 10:00:41PM +0700, Ivan Safonov wrote:
>> On 10/13/2015 10:47 AM, Greg Kroah-Hartman wrote:
>>> On Sat, Oct 10, 2015 at 01:23:13PM +0700, Ivan Safonov wrote:
>>>> Unnecessary channel groups for 5 GHz removed from Hal_GetChnlGroup88E
>>>> and it transformed to pretty get_channel_group(const u8 channel).
>>>>
>>>> Also removed code for 5 GHz frequency in Hal_ReadPowerValueFromPROM_8188E.
>>> Why did you do two different things in this patch?
>>>
>>> Have you tested this?
>>>
>>> thanks,
>>>
>>> greg k-h
>> Split this patch into two parts?
> Why wouldn't you?
>
>> I have not tested it.
> Please test it.
>
> thanks,
>
> greg k-h

It is possible to test the driverwithout device?
--
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]


#1245872 — Re: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-10-13 17:50 +0200
SubjectRe: [PATCH 1/3] staging: rtl8188eu: 5 GHz channel groups removed from /hal/rtl8188e_hal_init.c
Message-ID<qj9ZU-2xR-11@gated-at.bofh.it>
In reply to#1245820
On Tue, Oct 13, 2015 at 10:00:41PM +0700, Ivan Safonov wrote:
> On 10/13/2015 10:47 AM, Greg Kroah-Hartman wrote:
> >On Sat, Oct 10, 2015 at 01:23:13PM +0700, Ivan Safonov wrote:
> >>Unnecessary channel groups for 5 GHz removed from Hal_GetChnlGroup88E
> >>and it transformed to pretty get_channel_group(const u8 channel).
> >>
> >>Also removed code for 5 GHz frequency in Hal_ReadPowerValueFromPROM_8188E.
> >Why did you do two different things in this patch?
> >
> >Have you tested this?
> >
> >thanks,
> >
> >greg k-h
> 
> Split this patch into two parts?

Why wouldn't you?

> I have not tested it.

Please test it.

thanks,

greg k-h
--
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