Skip to contentSkip to conversation

Update rf_type_definition

PATCH In review [email protected] 3 participants 4 messages Feb 6, 2018 – Mar 14, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update rf_type_definition

From: Kangmin Park <[email protected]>

enum RT_RF_TYPE_DEFINITION on rtl8723bs/include/rtw_rf.h is different from enum tag_HAL_RF_Type_Definition on rtl8723bs/include/HalVerDef.h

So, update them to be the same reference from enum rf_type on rtlwifi/wifi.h which recent version.

As a result, ODM_RF_TYPE_E needs to be updated as well Therefore, it is updated reference from enum odm_rf_type on rtlwifi/phydm/phydm_pre_define.h too.
And update some additional code to check more chip versions that resulted from it.

Also, fixed some space required errors and line over 80 characters warnings by checkpatch.pl.

---
 drivers/staging/rtl8723bs/hal/odm.h               | 18 +++---
 drivers/staging/rtl8723bs/hal/rtl8723b_dm.c       | 18 +++++-
 drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 12 ++++
 drivers/staging/rtl8723bs/include/HalVerDef.h     | 77 ++++++++++++++++-------
 drivers/staging/rtl8723bs/include/rtw_rf.h        | 14 +++--
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 20 +++---
 6 files changed, 111 insertions(+), 48 deletions(-)
drivers/staging/rtl8723bs/hal/odm.h +10 -8
index 87a76ba..771b894 100644
@@ -511,14 +511,16 @@ typedef enum tag_ODM_RF_Path_Bit_Definition {
 
 
 typedef enum tag_ODM_RF_Type_Definition {
-	ODM_1T1R	=	0,
-	ODM_1T2R	=	1,
-	ODM_2T2R	=	2,
-	ODM_2T3R	=	3,
-	ODM_2T4R	=	4,
-	ODM_3T3R	=	5,
-	ODM_3T4R	=	6,
-	ODM_4T4R	=	7,
+	ODM_1T1R		=	0,
+	ODM_1T2R		=	1,
+	ODM_2T2R		=	2,
+	ODM_2T2R_GREEN	=	3,
+	ODM_2T3R		=	4,
+	ODM_2T4R		=	5,
+	ODM_3T3R		=	6,
+	ODM_3T4R		=	7,
+	ODM_4T4R		=	8,
+	ODM_XTXR		=	9,
 } ODM_RF_TYPE_E;
 
 
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +16 -2
index b162559..6069e1c 100644
@@ -64,10 +64,24 @@ static void Init_ODM_ComInfo_8723b(struct adapter *Adapter)
 
 	if (pHalData->rf_type == RF_1T1R) {
 		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_1T1R);
-	} else if (pHalData->rf_type == RF_2T2R) {
-		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_2T2R);
 	} else if (pHalData->rf_type == RF_1T2R) {
 		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_1T2R);
+	} else if (pHalData->rf_type == RF_2T2R) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_2T2R);
+	} else if (pHalData->rf_type == RF_2T2R_GREEN) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_2T2R_GREEN);
+	} else if (pHalData->rf_type == RF_2T3R) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_2T3R);
+	} else if (pHalData->rf_type == RF_2T4R) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_2T4R);
+	} else if (pHalData->rf_type == RF_3T3R) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_3T3R);
+	} else if (pHalData->rf_type == RF_3T4R) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_3T4R);
+	} else if (pHalData->rf_type == RF_4T4R) {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_4T4R);
+	} else {
+		ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_XTXR);
 	}
 
 	pdmpriv->InitODMFlag = ODM_RF_CALIBRATION|ODM_RF_TX_PWR_TRACK;
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +12 -0
index d6cef9e..a4df098 100644
@@ -1926,6 +1926,18 @@ static HAL_VERSION ReadChipVersion8723B(struct adapter *padapter)
 		pHalData->rf_type = RF_1T2R;
 	else if (IS_2T2R(ChipVersion))
 		pHalData->rf_type = RF_2T2R;
+	else if (IS_2T2R_GREEN(ChipVersion))
+		pHalData->rf_type = RF_2T2R_GREEN;
+	else if (IS_2T3R(ChipVersion))
+		pHalData->rf_type = RF_2T3R;
+	else if (IS_2T4R(ChipVersion))
+		pHalData->rf_type = RF_2T4R;
+	else if (IS_3T3R(ChipVersion))
+		pHalData->rf_type = RF_3T3R;
+	else if (IS_3T4R(ChipVersion))
+		pHalData->rf_type = RF_3T4R;
+	else if (IS_4T4R(ChipVersion))
+		pHalData->rf_type = RF_4T4R;
 	else
 		pHalData->rf_type = RF_1T1R;
 
drivers/staging/rtl8723bs/include/HalVerDef.h +53 -24

94 lines not on this page · raw message

drivers/staging/rtl8723bs/include/rtw_rf.h +9 -5
index f9becab..d1fc396 100644
@@ -146,12 +146,16 @@ enum PROTECTION_MODE {
 
 /* 2007/11/15 MH Define different RF type. */
 enum RT_RF_TYPE_DEFINITION {
-	RF_1T2R = 0,
-	RF_2T4R = 1,
+	RF_1T1R = 0,
+	RF_1T2R = 1,
 	RF_2T2R = 2,
-	RF_1T1R = 3,
-	RF_2T2R_GREEN = 4,
-	RF_MAX_TYPE = 5,
+	RF_2T2R_GREEN = 3,
+	RF_2T3R = 4,
+	RF_2T4R = 5,
+	RF_3T3R = 6,
+	RF_3T4R = 7,
+	RF_4T4R = 8,
+	RF_MAX_TYPE = 9,
 };
 
 u32 rtw_ch2freq(u32 ch);
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +11 -9
index 51d48de..22fc6fa 100644
@@ -3299,7 +3299,7 @@ static int cfg80211_rtw_sched_scan_stop(struct wiphy *wiphy,
 
 static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum nl80211_band band, u8 rf_type)
 {
-
+#define MAX_BIT_RATE_40MHZ_MCS23	450	/* Mbps */
 #define MAX_BIT_RATE_40MHZ_MCS15	300	/* Mbps */
 #define MAX_BIT_RATE_40MHZ_MCS7		150	/* Mbps */
 
@@ -3330,24 +3330,26 @@ static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum
 	 *if BW_40 rx_mask[4]= 0x01;
 	 *highest supported RX rate
 	 */
-	if (rf_type == RF_1T1R)
-	{
+	if (rf_type == RF_1T1R) {
 		ht_cap->mcs.rx_mask[0] = 0xFF;
 		ht_cap->mcs.rx_mask[1] = 0x00;
 		ht_cap->mcs.rx_mask[4] = 0x01;
 
 		ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS7);
-	}
-	else if ((rf_type == RF_1T2R) || (rf_type ==RF_2T2R))
-	{
+	} else if ((rf_type == RF_1T2R) || (rf_type == RF_2T2R)
+			|| (rf_type == RF_2T2R_GREEN)) {
 		ht_cap->mcs.rx_mask[0] = 0xFF;
 		ht_cap->mcs.rx_mask[1] = 0xFF;
 		ht_cap->mcs.rx_mask[4] = 0x01;
 
 		ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15);
-	}
-	else
-	{
+	} else if ((rf_type == RF_2T3R) || (rf_type == RF_3T3R)) {
+		ht_cap->mcs.rx_mask[0] = 0xFF;
+		ht_cap->mcs.rx_mask[1] = 0xFF;
+		ht_cap->mcs.rx_mask[2] = 0x01;
+
+		ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS23);
+	} else {
 		DBG_8192C("%s, error rf_type =%d\n", __func__, rf_type);
 	}
 
Signature · 1 line
2.7.4
#1 lore raw

This is better. But the subject should say [PATCH v2] and we need a driver prefix.

Quoted 9 lines · On Wed, Feb 07, 2018 at 06:23:34AM +0900, [email protected] wrote:

From: Kangmin Park <[email protected]>

enum RT_RF_TYPE_DEFINITION on rtl8723bs/include/rtw_rf.h is different from enum tag_HAL_RF_Type_Definition on rtl8723bs/include/HalVerDef.h

So, update them to be the same reference from enum rf_type on rtlwifi/wifi.h which recent version.

Quoted 8 lines

As a result, ODM_RF_TYPE_E needs to be updated as well Therefore, it is updated reference from enum odm_rf_type on rtlwifi/phydm/phydm_pre_define.h too.
And update some additional code to check more chip versions that resulted from it.

Also, fixed some space required errors and line over 80 characters warnings by checkpatch.pl.

Don't do this. It's considered unrelated white space change and it makes the code hard to review.

To be honest, I don't know the code well enough to say if this patch is a good idea generally... It seems risky and I wish someone would test it or a maintainer would Ack it.

regards,
dan carpenter

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#2 lore raw

Thank you for your feedback. I learned a lot.
I thought I had to fix all warnings by checkpatch.pl.
If the patch is not good, I'll resubmit patch v3 which just fix space required error by checkpatch later.

Regards.
Kangmin Park.

2018. 2. 7. 오후 8:14에 "Dan Carpenter" <[email protected]>님이 작성:

This is better. But the subject should say [PATCH v2] and we need a driver prefix.

Quoted 9 lines · On Wed, Feb 07, 2018 at 06:23:34AM +0900, [email protected] wrote:

From: Kangmin Park <[email protected]>

enum RT_RF_TYPE_DEFINITION on rtl8723bs/include/rtw_rf.h is different from enum tag_HAL_RF_Type_Definition on rtl8723bs/include/HalVerDef.h

So, update them to be the same reference from enum rf_type on rtlwifi/wifi.h which recent version.

Quoted 8 lines

As a result, ODM_RF_TYPE_E needs to be updated as well Therefore, it is updated reference from enum odm_rf_type on rtlwifi/phydm/phydm_pre_define.h too.
And update some additional code to check more chip versions that resulted from it.

Also, fixed some space required errors and line over 80 characters warnings by checkpatch.pl.

Don't do this. It's considered unrelated white space change and it makes the code hard to review.

To be honest, I don't know the code well enough to say if this patch is a good idea generally... It seems risky and I wish someone would test it or a maintainer would Ack it.

regards,
dan carpenter

maintainer
#3 lore raw
In reply to [email protected]
Quoted 1 line · On Wed, Feb 07, 2018 at 06:23:34AM +0900, [email protected] wrote:

From: Kangmin Park <[email protected]>

Your subject line should say the subsystem and driver you are modifying. Look at the hundreds of other patches on the mailing lists for examples of how to properly format it.

Quoted 8 lines

enum RT_RF_TYPE_DEFINITION on rtl8723bs/include/rtw_rf.h is different from enum tag_HAL_RF_Type_Definition on rtl8723bs/include/HalVerDef.h

So, update them to be the same reference from enum rf_type on rtlwifi/wifi.h which recent version.

Quoted 8 lines

As a result, ODM_RF_TYPE_E needs to be updated as well Therefore, it is updated reference from enum odm_rf_type on rtlwifi/phydm/phydm_pre_define.h too.
And update some additional code to check more chip versions that resulted from it.

Also, fixed some space required errors and line over 80 characters warnings by checkpatch.pl.

When you say "also", that means you should be splitting this patch up into multpile patches. Please only do one-thing-per-patch.

This should be a patch series, please fix it up and resend.

thanks,

greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel