[PATCH 03/26] staging: rtl8188eu: Rename function odm_TxPwrTrackSetPwr88E()
Rename CamelCase function name. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index e3fcf8e..84df904 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -87,21 +87,16 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type, (pwr_value<<24); } -/* - * Function: odm_TxPwrTrackSetPwr88E() - * - * Overview: 88E change all channel tx power accordign to flag. - * OFDM & CCK are all different. - */ -static void odm_TxPwrTrackSetPwr88E(struct odm_dm_struct *dm_odm) +static void dm_txpwr_track_setpwr(struct odm_dm_struct *dm_odm) { if (dm_odm->BbSwingFlagOfdm || dm_odm->BbSwingFlagCck) { - ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("odm_TxPwrTrackSetPwr88E CH=%d\n", *(dm_odm->pChannel))); + ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, +("dm_txpwr_track_setpwr CH=%d\n", *(dm_odm->pChannel))); phy_set_tx_power_level(dm_odm->Adapter, *(dm_odm->pChannel)); dm_odm->BbSwingFlagOfdm = false; - dm_odm->BbSwingFlagCck = false; + dm_odm->BbSwingFlagCck = false; } -} /* odm_TxPwrTrackSetPwr88E */ +} void odm_TXPowerTrackingCallback_ThermalMeter_8188E( @@ -140,7 +135,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E( struct odm_dm_struct *dm_odm = &pHalData->odmpriv; /* 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E. */ - odm_TxPwrTrackSetPwr88E(dm_odm); + dm_txpwr_track_setpwr(dm_odm); dm_odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; /* cosa add for debug */ dm_odm->RFCalibrateInfo.bTXPowerTrackingInit = true; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/26] staging: rtl8188eu: Rename function ODM_GetRightChnlPlaceforIQK()
Rename CamelCase function name. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 0e58597..be23959 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -23,16 +23,16 @@ #defineODM_TXPWRTRACK_MAX_IDX_88E 6 -static u8 ODM_GetRightChnlPlaceforIQK(u8 chnl) +static u8 get_right_chnl_for_iqk(u8 chnl) { - u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = { + u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153, 155, 157, 159, 161, 163, 165 }; - u8 place = chnl; + u8 place = chnl; if (chnl > 14) { for (place = 14; place < sizeof(channel_all); place++) { @@ -1383,7 +1383,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) pathb_fill_iqk(adapt, pathbok, result, final_candidate, (RegEC4 == 0)); } - Indexforchannel = ODM_GetRightChnlPlaceforIQK(pHalData->CurrentChannel); + Indexforchannel = get_right_chnl_for_iqk(pHalData->CurrentChannel); /* To Fix BSOD when final_candidate is 0xff */ /* by sherry 20120321 */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/26] staging: rtl8188eu: Rework odm_TXPowerTrackingCallback_ThermalMeter_8188E()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 325 drivers/staging/rtl8188eu/hal/odm.c|2 +- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |3 +- 3 files changed, 122 insertions(+), 208 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 84df904..9770106 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -98,203 +98,156 @@ static void dm_txpwr_track_setpwr(struct odm_dm_struct *dm_odm) } } -void -odm_TXPowerTrackingCallback_ThermalMeter_8188E( - struct adapter *Adapter - ) +void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt) { - struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter); - u8 ThermalValue = 0, delta, delta_LCK, delta_IQK, offset; - u8 ThermalValue_AVG_count = 0; - u32 ThermalValue_AVG = 0; - s32 ele_A = 0, ele_D, TempCCk, X, value32; - s32 Y, ele_C = 0; - s8 OFDM_index[2], CCK_index = 0; - s8 OFDM_index_old[2] = {0, 0}, CCK_index_old = 0; + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + u8 thermal_val = 0, delta, delta_lck, delta_iqk, offset; + u8 thermal_avg_count = 0; + u32 thermal_avg = 0; + s32 ele_a = 0, ele_d, temp_cck, x, value32; + s32 y, ele_c = 0; + s8 ofdm_index[2], cck_index = 0; + s8 ofdm_index_old[2] = {0, 0}, cck_index_old = 0; u32 i = 0, j = 0; bool is2t = false; - u8 OFDM_min_index = 6, rf; /* OFDM BB Swing should be less than +3.0dB, which is required by Arthur */ - u8 Indexforchannel = 0/*GetRightChnlPlaceforIQK(pHalData->CurrentChannel)*/; - s8 OFDM_index_mapping[2][index_mapping_NUM_88E] = { - {0, 0, 2, 3, 4, 4, /* 2.4G, decrease power */ - 5, 6, 7, 7, 8, 9, - 10, 10, 11}, /* For lower temperature, 20120220 updated on 20120220. */ - {0, 0, -1, -2, -3, -4, /* 2.4G, increase power */ - -4, -4, -4, -5, -7, -8, - -9, -9, -10}, + u8 ofdm_min_index = 6, rf; /* OFDM BB Swing should be less than +3.0dB */ + u8 indexforchannel = 0; + s8 ofdm_index_mapping[2][index_mapping_NUM_88E] = { + /* 2.4G, decrease power */ + {0, 0, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11}, + /* 2.4G, increase power */ + {0, 0, -1, -2, -3, -4,-4, -4, -4, -5, -7, -8,-9, -9, -10}, }; - u8 Thermal_mapping[2][index_mapping_NUM_88E] = { - {0, 2, 4, 6, 8, 10, /* 2.4G, decrease power */ - 12, 14, 16, 18, 20, 22, - 24, 26, 27}, - {0, 2, 4, 6, 8, 10, /* 2.4G,, increase power */ - 12, 14, 16, 18, 20, 22, - 25, 25, 25}, + u8 thermal_mapping[2][index_mapping_NUM_88E] = { + /* 2.4G, decrease power */ + {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 27}, + /* 2.4G, increase power */ + {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 25, 25, 25}, }; - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; - /* 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E. */ dm_txpwr_track_setpwr(dm_odm); - dm_odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; /* cosa add for debug */ + dm_odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; dm_odm->RFCalibrateInfo.bTXPowerTrackingInit = true; - /* RFCalibrateInfo.RegA24 will be initialized when ODM HW configuring, but MP configures with para files. */ dm_odm->RFCalibrateInfo.RegA24 = 0x090e1317; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("===>dm_TXPowerTrackingCallback_ThermalMeter_8188E txpowercontrol %d\n", -dm_odm->RFCalibrateInfo.TxPowerTrackControl)); - - ThermalValue = (u8)phy_query_rf_reg(Adapter, RF_PATH_A, RF_T_METER_88E, 0xfc00);/* 0x42: RF Reg[15:10] 88E */ - - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("Readback Thermal Meter = 0x%x pre thermal meter 0x%x EEPROMthermalmeter 0x%x\n", -ThermalValue, dm_odm->RFCalibrateInfo.ThermalValue, pHalData->EEPROMThermalMeter)); + thermal_val = (u8)phy_query_rf_reg(adapt, RF_PATH_A, + RF_T_METER_88E, 0xfc00); if (is2t) rf = 2; else rf = 1; - if (ThermalValue) { + if (thermal_val) { /* Query OFDM path A default setting */ - ele_D = phy_query_bb_
[PATCH 02/26] staging: rtl8188eu: Rework function ODM_TxPwrTrackAdjust88E()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 59 +++- drivers/staging/rtl8188eu/hal/rf.c |6 +- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h | 12 ++-- 3 files changed, 31 insertions(+), 46 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index be23959..e3fcf8e 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -43,66 +43,49 @@ static u8 get_right_chnl_for_iqk(u8 chnl) return 0; } -/* 3 Tx Power Tracking */ -/* - * Function: ODM_TxPwrTrackAdjust88E() - * - * Overview: 88E we can not write 0xc80/c94/c4c/ 0xa2x. Instead of write TX agc. - * No matter OFDM & CCK use the same method. - * - * Revised History: - * WhenWho Remark - * 04/23/2012 MHC Create Version 0. - * 04/23/2012 MHC Adjust TX agc directly not throughput BB digital. - * - */ -void ODM_TxPwrTrackAdjust88E(struct odm_dm_struct *dm_odm, u8 Type,/* 0 = OFDM, 1 = CCK */ - u8 *pDirection, /* 1 = +(increase) 2 = -(decrease) */ - u32 *pOutWriteVal /* Tx tracking CCK/OFDM BB swing index adjust */ - ) +void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type, +u8 *direction, u32 *out_write_val) { u8 pwr_value = 0; /* Tx power tracking BB swing table. */ - /* The base index = 12. +((12-n)/2)dB 13~?? = decrease tx pwr by -((n-12)/2)dB */ - if (Type == 0) {/* For OFDM afjust */ + if (type == 0) { /* For OFDM adjust */ ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("BbSwingIdxOfdm = %d BbSwingFlagOfdm=%d\n", dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm)); if (dm_odm->BbSwingIdxOfdm <= dm_odm->BbSwingIdxOfdmBase) { - *pDirection = 1; - pwr_value = (dm_odm->BbSwingIdxOfdmBase - dm_odm->BbSwingIdxOfdm); + *direction = 1; + pwr_value = (dm_odm->BbSwingIdxOfdmBase - +dm_odm->BbSwingIdxOfdm); } else { - *pDirection = 2; - pwr_value = (dm_odm->BbSwingIdxOfdm - dm_odm->BbSwingIdxOfdmBase); + *direction = 2; + pwr_value = (dm_odm->BbSwingIdxOfdm - +dm_odm->BbSwingIdxOfdmBase); } - ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, -("BbSwingIdxOfdm = %d BbSwingFlagOfdm=%d\n", -dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm)); - } else if (Type == 1) { /* For CCK adjust. */ + } else if (type == 1) { /* For CCK adjust. */ ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("dm_odm->BbSwingIdxCck = %d dm_odm->BbSwingIdxCckBase = %d\n", dm_odm->BbSwingIdxCck, dm_odm->BbSwingIdxCckBase)); if (dm_odm->BbSwingIdxCck <= dm_odm->BbSwingIdxCckBase) { - *pDirection = 1; - pwr_value = (dm_odm->BbSwingIdxCckBase - dm_odm->BbSwingIdxCck); + *direction = 1; + pwr_value = (dm_odm->BbSwingIdxCckBase - +dm_odm->BbSwingIdxCck); } else { - *pDirection = 2; - pwr_value = (dm_odm->BbSwingIdxCck - dm_odm->BbSwingIdxCckBase); + *direction = 2; + pwr_value = (dm_odm->BbSwingIdxCck - +dm_odm->BbSwingIdxCckBase); } + } - /* */ - /* 2012/04/25 MH According to Ed/Luke.Lees estimate for EVM the max tx power tracking */ - /* need to be less than 6 power index for 88E. */ - /* */ - if (pwr_value >= ODM_TXPWRTRACK_MAX_IDX_88E && *pDirection == 1) + if (pwr_value >= ODM_TXPWRTRACK_MAX_IDX_88E && *direction == 1) pwr_value = ODM_TXPWRTRACK_MAX_IDX_88E; - *pOutWriteVal = pwr_value | (pwr_value<<8) | (pwr_value<<16) | (pwr_value<<24); -} /* ODM_TxPwrTrackAdjust88E */ + *out_write_val = pwr_value | (pwr_value<<8) | (pwr_value<<16) | +(pwr_value<<24); +} /* * Function: odm_TxPwrTrackSetPwr88
[PATCH 06/26] staging: rtl8188eu: Rework function phy_PathA_IQK_8188E()
Rename CamelCase function name and local variables. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 37 +++- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 186b718..b5c6426 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -358,50 +358,35 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt) #define MAX_TOLERANCE 5 -static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */ -phy_PathA_IQK_8188E(struct adapter *adapt, bool configPathB) +static u8 phy_path_a_iqk(struct adapter *adapt, bool config_pathb) { - u32 regeac, regE94, regE9C, regEA4; + u32 reg_eac, reg_e94, reg_e9c, reg_ea4; u8 result = 0x00; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQK!\n")); /* 1 Tx IQK */ /* path-A IQK setting */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A IQK setting!\n")); phy_set_bb_reg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x10008c1c); phy_set_bb_reg(adapt, rRx_IQK_Tone_A, bMaskDWord, 0x30008c1c); phy_set_bb_reg(adapt, rTx_IQK_PI_A, bMaskDWord, 0x8214032a); phy_set_bb_reg(adapt, rRx_IQK_PI_A, bMaskDWord, 0x2816); /* LO calibration setting */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); phy_set_bb_reg(adapt, rIQK_AGC_Rsp, bMaskDWord, 0x00462911); /* One shot, path A LOK & IQK */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); phy_set_bb_reg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf900); phy_set_bb_reg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf800); - /* delay x ms */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); - /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_88E); - /* Check failed */ - regeac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regeac)); - regE94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x\n", regE94)); - regE9C = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe9c = 0x%x\n", regE9C)); - regEA4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea4 = 0x%x\n", regEA4)); - - if (!(regeac & BIT28) && - (((regE94 & 0x03FF)>>16) != 0x142) && - (((regE9C & 0x03FF)>>16) != 0x42)) + reg_eac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord); + reg_e94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord); + reg_e9c = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord); + reg_ea4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord); + + if (!(reg_eac & BIT28) && + (((reg_e94 & 0x03FF)>>16) != 0x142) && + (((reg_e9c & 0x03FF)>>16) != 0x42)) result |= 0x01; return result; } @@ -987,7 +972,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, phy_set_bb_reg(adapt, rRx_IQK, bMaskDWord, 0x81004800); for (i = 0; i < retryCount; i++) { - PathAOK = phy_PathA_IQK_8188E(adapt, is2t); + PathAOK = phy_path_a_iqk(adapt, is2t); if (PathAOK == 0x01) { ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Tx IQK Success!!\n")); result[t][0] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF)>>16; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/26] staging: rtl8188eu: Rework function phy_PathA_RxIQK()
Rename CamelCase function name and variables. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 78 1 file changed, 27 insertions(+), 51 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 9770106..186b718 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -356,8 +356,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt) dm_odm->RFCalibrateInfo.TXPowercount = 0; } -/* 1 7.IQK */ -#define MAX_TOLERANCE 5 +#define MAX_TOLERANCE 5 static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */ phy_PathA_IQK_8188E(struct adapter *adapt, bool configPathB) @@ -407,18 +406,15 @@ phy_PathA_IQK_8188E(struct adapter *adapt, bool configPathB) return result; } -static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */ -phy_PathA_RxIQK(struct adapter *adapt, bool configPathB) +static u8 phy_path_a_rx_iqk(struct adapter *adapt, bool configPathB) { - u32 regeac, regE94, regE9C, regEA4, u4tmp; + u32 reg_eac, reg_e94, reg_e9c, reg_ea4, u4tmp; u8 result = 0x00; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK!\n")); + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; /* 1 Get TXIMR setting */ /* modify RXIQK mode table */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x); phy_set_rf_reg(adapt, RF_PATH_A, RF_WE_LUT, bRFRegOffsetMask, 0x800a0); phy_set_rf_reg(adapt, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x3); @@ -442,45 +438,34 @@ phy_PathA_RxIQK(struct adapter *adapt, bool configPathB) phy_set_bb_reg(adapt, rRx_IQK_PI_A, bMaskDWord, 0x2816); /* LO calibration setting */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); phy_set_bb_reg(adapt, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911); /* One shot, path A LOK & IQK */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); phy_set_bb_reg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf900); phy_set_bb_reg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf800); - /* delay x ms */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("Delay %d ms for One shot, path A LOK & IQK.\n", -IQK_DELAY_TIME_88E)); + /* delay x ms */ mdelay(IQK_DELAY_TIME_88E); - /* Check failed */ - regeac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xeac = 0x%x\n", regeac)); - regE94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xe94 = 0x%x\n", regE94)); - regE9C = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xe9c = 0x%x\n", regE9C)); + /* Check failed */ + reg_eac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord); + reg_e94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord); + reg_e9c = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord); - if (!(regeac & BIT28) && - (((regE94 & 0x03FF)>>16) != 0x142) && - (((regE9C & 0x03FF)>>16) != 0x42)) + if (!(reg_eac & BIT28) && + (((reg_e94 & 0x03FF)>>16) != 0x142) && + (((reg_e9c & 0x03FF)>>16) != 0x42)) result |= 0x01; - else/* if Tx not OK, ignore Rx */ + else/* if Tx not OK, ignore Rx */ return result; - u4tmp = 0x80007C00 | (regE94&0x3FF) | ((regE9C&0x3FF) >> 16); + u4tmp = 0x80007C00 | (reg_e94&0x3FF) | ((reg_e9c&0x3FF) >> 16); phy_set_bb_reg(adapt, rTx_IQK, bMaskDWord, u4tmp); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe40 = 0x%x u4tmp = 0x%x\n", phy_query_bb_reg(adapt, rTx_IQK, bMaskDWord), u4tmp)); /* 1 RX IQK */ /* modify RXIQK mode tabl
[PATCH 07/26] staging: rtl8188eu: Rework function phy_PathB_IQK_8188E()
Rename CamelCase function name and local variables. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 29 +--- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index b5c6426..d59b4ce 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -496,42 +496,24 @@ static u8 phy_path_a_rx_iqk(struct adapter *adapt, bool configPathB) return result; } -static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */ -phy_PathB_IQK_8188E(struct adapter *adapt) +static u8 phy_path_b_iqk(struct adapter *adapt) { u32 regeac, regeb4, regebc, regec4, regecc; u8 result = 0x00; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK!\n")); + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; /* One shot, path B LOK & IQK */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); phy_set_bb_reg(adapt, rIQK_AGC_Cont, bMaskDWord, 0x0002); phy_set_bb_reg(adapt, rIQK_AGC_Cont, bMaskDWord, 0x); - /* delay x ms */ - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("Delay %d ms for One shot, path B LOK & IQK.\n", -IQK_DELAY_TIME_88E)); mdelay(IQK_DELAY_TIME_88E); - /* Check failed */ regeac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xeac = 0x%x\n", regeac)); regeb4 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xeb4 = 0x%x\n", regeb4)); regebc = phy_query_bb_reg(adapt, rTx_Power_After_IQK_B, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xebc = 0x%x\n", regebc)); regec4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_B_2, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xec4 = 0x%x\n", regec4)); regecc = phy_query_bb_reg(adapt, rRx_Power_After_IQK_B_2, bMaskDWord); - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("0xecc = 0x%x\n", regecc)); if (!(regeac & BIT31) && (((regeb4 & 0x03FF)>>16) != 0x142) && @@ -545,7 +527,8 @@ phy_PathB_IQK_8188E(struct adapter *adapt) (((regecc & 0x03FF)>>16) != 0x36)) result |= 0x02; else - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK fail!!\n")); + ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, +ODM_DBG_LOUD, ("Path B Rx IQK fail!!\n")); return result; } @@ -1004,7 +987,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, _PHY_PathADDAOn(adapt, ADDA_REG, false, is2t); for (i = 0; i < retryCount; i++) { - PathBOK = phy_PathB_IQK_8188E(adapt); + PathBOK = phy_path_b_iqk(adapt); if (PathBOK == 0x03) { ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK Success!!\n")); result[t][4] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B, bMaskDWord)&0x3FF)>>16; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/26] staging: rtl8188eu: Rework function _PHY_ReloadMACRegisters()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 6f81bbd..63e4010 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -655,22 +655,15 @@ static void reload_adda_reg(struct adapter *adapt, u32 *adda_reg, phy_set_bb_reg(adapt, adda_reg[i], bMaskDWord, backup[i]); } -static void -_PHY_ReloadMACRegisters( - struct adapter *adapt, - u32 *MACReg, - u32 *MACBackup - ) +static void reload_mac_registers(struct adapter *adapt, +u32 *mac_reg, u32 *backup) { u32 i; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Reload MAC parameters !\n")); for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) { - usb_write8(adapt, MACReg[i], (u8)MACBackup[i]); + usb_write8(adapt, mac_reg[i], (u8)backup[i]); } - usb_write32(adapt, MACReg[i], MACBackup[i]); + usb_write32(adapt, mac_reg[i], backup[i]); } void @@ -1003,7 +996,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, reload_adda_reg(adapt, ADDA_REG, dm_odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); /* Reload MAC parameters */ - _PHY_ReloadMACRegisters(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); + reload_mac_registers(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); reload_adda_reg(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/26] staging: rtl8188eu: Rework function _PHY_SaveADDARegisters()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Declare it as a static function. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 16 +++- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |3 --- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index d04ac50..732014d 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -625,15 +625,13 @@ static void pathb_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], } } -void _PHY_SaveADDARegisters(struct adapter *adapt, u32 *ADDAReg, u32 *ADDABackup, u32 RegisterNum) +static void save_adda_registers(struct adapter *adapt, u32 *addareg, + u32 *backup, u32 register_num) { u32 i; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save ADDA parameters.\n")); - for (i = 0; i < RegisterNum; i++) { - ADDABackup[i] = phy_query_bb_reg(adapt, ADDAReg[i], bMaskDWord); + for (i = 0; i < register_num; i++) { + backup[i] = phy_query_bb_reg(adapt, addareg[i], bMaskDWord); } } @@ -898,9 +896,9 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2t ? "2T2R" : "1T1R"), t)); /* Save ADDA parameters, turn Path A ADDA on */ - _PHY_SaveADDARegisters(adapt, ADDA_REG, dm_odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); + save_adda_registers(adapt, ADDA_REG, dm_odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); _PHY_SaveMACRegisters(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); - _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); + save_adda_registers(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); } ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2t ? "2T2R" : "1T1R"), t)); @@ -1222,7 +1220,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) } ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("\nIQK OK Indexforchannel %d.\n", Indexforchannel)); - _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); + save_adda_registers(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK finished\n")); } diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h index 96aebf0..67b3471 100644 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h @@ -46,9 +46,6 @@ void PHY_LCCalibrate_8188E(struct adapter *pAdapter); /* AP calibrate */ void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter); -void _PHY_SaveADDARegisters(struct adapter *pAdapter, u32 *ADDAReg, - u32 *ADDABackup, u32 RegisterNum); - void _PHY_PathADDAOn(struct adapter *pAdapter, u32 *ADDAReg, bool isPathAOn, bool is2T); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/26] staging: rtl8188eu: Rework function pathb_fill_iqk()
Rename CamelCase local variables. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 46 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 88b6256..d04ac50 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -578,40 +578,38 @@ static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], } } -static void pathb_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], u8 final_candidate, bool txonly) +static void pathb_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], + u8 final_candidate, bool txonly) { - u32 Oldval_1, X, TX1_A, reg; - s32 Y, TX1_C; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("Path B IQ Calibration %s !\n", -(iqkok) ? "Success" : "Failed")); + u32 oldval_1, x, tx1_a, reg; + s32 y, tx1_c; if (final_candidate == 0xFF) { return; } else if (iqkok) { - Oldval_1 = (phy_query_bb_reg(adapt, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF; + oldval_1 = (phy_query_bb_reg(adapt, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF; - X = result[final_candidate][4]; - if ((X & 0x0200) != 0) - X = X | 0xFC00; - TX1_A = (X * Oldval_1) >> 8; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("X = 0x%x, TX1_A = 0x%x\n", X, TX1_A)); - phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x3FF, TX1_A); + x = result[final_candidate][4]; + if ((x & 0x0200) != 0) + x = x | 0xFC00; + tx1_a = (x * oldval_1) >> 8; + phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x3FF, tx1_a); - phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(27), ((X * Oldval_1>>7) & 0x1)); + phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(27), + ((x * oldval_1>>7) & 0x1)); - Y = result[final_candidate][5]; - if ((Y & 0x0200) != 0) - Y = Y | 0xFC00; + y = result[final_candidate][5]; + if ((y & 0x0200) != 0) + y = y | 0xFC00; - TX1_C = (Y * Oldval_1) >> 8; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Y = 0x%x, TX1_C = 0x%x\n", Y, TX1_C)); - phy_set_bb_reg(adapt, rOFDM0_XDTxAFE, 0xF000, ((TX1_C&0x3C0)>>6)); - phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x003F, (TX1_C&0x3F)); + tx1_c = (y * oldval_1) >> 8; - phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(25), ((Y * Oldval_1>>7) & 0x1)); + phy_set_bb_reg(adapt, rOFDM0_XDTxAFE, 0xF000, + ((tx1_c&0x3C0)>>6)); + phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x003F, + (tx1_c&0x3F)); + phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(25), + ((y * oldval_1>>7) & 0x1)); if (txonly) return; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/26] staging: rtl8188eu: Rework function _PHY_SaveMACRegisters()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 732014d..1eabfde 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -635,20 +635,15 @@ static void save_adda_registers(struct adapter *adapt, u32 *addareg, } } -static void _PHY_SaveMACRegisters( - struct adapter *adapt, - u32 *MACReg, - u32 *MACBackup - ) +static void save_mac_registers(struct adapter *adapt, u32 *mac_reg, + u32 *backup) { u32 i; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save MAC parameters.\n")); + for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) { - MACBackup[i] = usb_read8(adapt, MACReg[i]); + backup[i] = usb_read8(adapt, mac_reg[i]); } - MACBackup[i] = usb_read32(adapt, MACReg[i]); + backup[i] = usb_read32(adapt, mac_reg[i]); } static void reload_adda_reg(struct adapter *adapt, u32 *ADDAReg, u32 *ADDABackup, u32 RegiesterNum) @@ -897,7 +892,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, /* Save ADDA parameters, turn Path A ADDA on */ save_adda_registers(adapt, ADDA_REG, dm_odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); - _PHY_SaveMACRegisters(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); + save_mac_registers(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); save_adda_registers(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); } ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2t ? "2T2R" : "1T1R"), t)); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/26] staging: rtl8188eu: Rework function patha_fill_iqk()
Rename CamelCase local variables. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 53 ++-- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index d59b4ce..88b6256 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -532,47 +532,40 @@ static u8 phy_path_b_iqk(struct adapter *adapt) return result; } -static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], u8 final_candidate, bool txonly) +static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], + u8 final_candidate, bool txonly) { - u32 Oldval_0, X, TX0_A, reg; - s32 Y, TX0_C; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("Path A IQ Calibration %s !\n", -(iqkok) ? "Success" : "Failed")); + u32 oldval_0, x, tx0_a, reg; + s32 y, tx0_c; if (final_candidate == 0xFF) { return; } else if (iqkok) { - Oldval_0 = (phy_query_bb_reg(adapt, rOFDM0_XATxIQImbalance, bMaskDWord) >> 22) & 0x3FF; - - X = result[final_candidate][0]; - if ((X & 0x0200) != 0) - X = X | 0xFC00; - TX0_A = (X * Oldval_0) >> 8; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("X = 0x%x, TX0_A = 0x%x, Oldval_0 0x%x\n", -X, TX0_A, Oldval_0)); - phy_set_bb_reg(adapt, rOFDM0_XATxIQImbalance, 0x3FF, TX0_A); + oldval_0 = (phy_query_bb_reg(adapt, rOFDM0_XATxIQImbalance, bMaskDWord) >> 22) & 0x3FF; - phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(31), ((X * Oldval_0>>7) & 0x1)); + x = result[final_candidate][0]; + if ((x & 0x0200) != 0) + x = x | 0xFC00; - Y = result[final_candidate][1]; - if ((Y & 0x0200) != 0) - Y = Y | 0xFC00; + tx0_a = (x * oldval_0) >> 8; + phy_set_bb_reg(adapt, rOFDM0_XATxIQImbalance, 0x3FF, tx0_a); + phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(31), + ((x * oldval_0>>7) & 0x1)); - TX0_C = (Y * Oldval_0) >> 8; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Y = 0x%x, TX = 0x%x\n", Y, TX0_C)); - phy_set_bb_reg(adapt, rOFDM0_XCTxAFE, 0xF000, ((TX0_C&0x3C0)>>6)); - phy_set_bb_reg(adapt, rOFDM0_XATxIQImbalance, 0x003F, (TX0_C&0x3F)); + y = result[final_candidate][1]; + if ((y & 0x0200) != 0) + y = y | 0xFC00; - phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(29), ((Y * Oldval_0>>7) & 0x1)); + tx0_c = (y * oldval_0) >> 8; + phy_set_bb_reg(adapt, rOFDM0_XCTxAFE, 0xF000, + ((tx0_c&0x3C0)>>6)); + phy_set_bb_reg(adapt, rOFDM0_XATxIQImbalance, 0x003F, + (tx0_c&0x3F)); + phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(29), + ((y * oldval_0>>7) & 0x1)); - if (txonly) { - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("patha_fill_iqk only Tx OK\n")); + if (txonly) return; - } reg = result[final_candidate][2]; phy_set_bb_reg(adapt, rOFDM0_XARxIQImbalance, 0x3FF, reg); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/26] staging: rtl8188eu: Rework function _PHY_PathADDAOn()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Declare it as a static function. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 28 +++- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |3 --- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 63e4010..24278f9 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -666,30 +666,22 @@ static void reload_mac_registers(struct adapter *adapt, usb_write32(adapt, mac_reg[i], backup[i]); } -void -_PHY_PathADDAOn( - struct adapter *adapt, - u32 *ADDAReg, - bool isPathAOn, - bool is2t - ) +static void path_adda_on(struct adapter *adapt, u32 *adda_reg, +bool is_path_a_on, bool is2t) { - u32 pathOn; + u32 path_on; u32 i; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("ADDA ON.\n")); - pathOn = isPathAOn ? 0x04db25a4 : 0x0b1b25a4; + path_on = is_path_a_on ? 0x04db25a4 : 0x0b1b25a4; if (!is2t) { - pathOn = 0x0bdb25a0; - phy_set_bb_reg(adapt, ADDAReg[0], bMaskDWord, 0x0b1b25a0); + path_on = 0x0bdb25a0; + phy_set_bb_reg(adapt, adda_reg[0], bMaskDWord, 0x0b1b25a0); } else { - phy_set_bb_reg(adapt, ADDAReg[0], bMaskDWord, pathOn); + phy_set_bb_reg(adapt, adda_reg[0], bMaskDWord, path_on); } for (i = 1; i < IQK_ADDA_REG_NUM; i++) - phy_set_bb_reg(adapt, ADDAReg[i], bMaskDWord, pathOn); + phy_set_bb_reg(adapt, adda_reg[i], bMaskDWord, path_on); } void @@ -888,7 +880,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, } ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2t ? "2T2R" : "1T1R"), t)); - _PHY_PathADDAOn(adapt, ADDA_REG, true, is2t); + path_adda_on(adapt, ADDA_REG, true, is2t); if (t == 0) dm_odm->RFCalibrateInfo.bRfPiEnable = (u8)phy_query_bb_reg(adapt, rFPGA0_XA_HSSIParameter1, BIT(8)); @@ -959,7 +951,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, _PHY_PathAStandBy(adapt); /* Turn Path B ADDA on */ - _PHY_PathADDAOn(adapt, ADDA_REG, false, is2t); + path_adda_on(adapt, ADDA_REG, false, is2t); for (i = 0; i < retryCount; i++) { PathBOK = phy_path_b_iqk(adapt); diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h index 67b3471..efd1fea 100644 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h @@ -46,9 +46,6 @@ void PHY_LCCalibrate_8188E(struct adapter *pAdapter); /* AP calibrate */ void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter); -void _PHY_PathADDAOn(struct adapter *pAdapter, u32 *ADDAReg, -bool isPathAOn, bool is2T); - void _PHY_MACSettingCalibration(struct adapter *pAdapter, u32 *MACReg, u32 *MACBackup); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/26] staging: rtl8188eu: Rework function reload_adda_reg()
Rename CamelCase local variables. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 1eabfde..6f81bbd 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -646,15 +646,13 @@ static void save_mac_registers(struct adapter *adapt, u32 *mac_reg, backup[i] = usb_read32(adapt, mac_reg[i]); } -static void reload_adda_reg(struct adapter *adapt, u32 *ADDAReg, u32 *ADDABackup, u32 RegiesterNum) +static void reload_adda_reg(struct adapter *adapt, u32 *adda_reg, + u32 *backup, u32 regiester_num) { u32 i; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Reload ADDA power saving parameters !\n")); - for (i = 0; i < RegiesterNum; i++) - phy_set_bb_reg(adapt, ADDAReg[i], bMaskDWord, ADDABackup[i]); + for (i = 0; i < regiester_num; i++) + phy_set_bb_reg(adapt, adda_reg[i], bMaskDWord, backup[i]); } static void -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/26] staging: rtl8188eu: Rework function _PHY_PathAStandBy()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Declare it as a static function. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 11 ++- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index dd7445f..c08042a 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -696,15 +696,8 @@ static void mac_setting_calibration(struct adapter *adapt, u32 *mac_reg, u32 *ba usb_write8(adapt, mac_reg[i], (u8)(backup[i]&(~BIT5))); } -void -_PHY_PathAStandBy( - struct adapter *adapt - ) +static void path_a_standby(struct adapter *adapt) { - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A standby mode!\n")); phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x0); phy_set_bb_reg(adapt, 0x840, bMaskDWord, 0x0001); @@ -939,7 +932,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, } if (is2t) { - _PHY_PathAStandBy(adapt); + path_a_standby(adapt); /* Turn Path B ADDA on */ path_adda_on(adapt, ADDA_REG, false, is2t); diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h index 6252371..b9de658 100644 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h @@ -46,6 +46,4 @@ void PHY_LCCalibrate_8188E(struct adapter *pAdapter); /* AP calibrate */ void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter); -void _PHY_PathAStandBy(struct adapter *pAdapter); - #endif /* #ifndef __HAL_PHY_RF_8188E_H__ */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/26] staging: rtl8188eu: Rework function _PHY_PIModeSwitch()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index c08042a..7ae715c 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -704,18 +704,11 @@ static void path_a_standby(struct adapter *adapt) phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x8080); } -static void _PHY_PIModeSwitch( - struct adapter *adapt, - bool PIMode - ) +static void pi_mode_switch(struct adapter *adapt, bool pi_mode) { u32 mode; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BB Switch to %s mode!\n", (PIMode ? "PI" : "SI"))); - mode = PIMode ? 0x01000100 : 0x0100; + mode = pi_mode ? 0x01000100 : 0x0100; phy_set_bb_reg(adapt, rFPGA0_XA_HSSIParameter1, bMaskDWord, mode); phy_set_bb_reg(adapt, rFPGA0_XB_HSSIParameter1, bMaskDWord, mode); } @@ -870,7 +863,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, if (!dm_odm->RFCalibrateInfo.bRfPiEnable) { /* Switch BB to PI mode to do IQ Calibration. */ - _PHY_PIModeSwitch(adapt, true); + pi_mode_switch(adapt, true); } /* BB setting */ @@ -965,7 +958,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, if (t != 0) { if (!dm_odm->RFCalibrateInfo.bRfPiEnable) { /* Switch back BB to SI mode after finish IQ Calibration. */ - _PHY_PIModeSwitch(adapt, false); + pi_mode_switch(adapt, false); } /* Reload ADDA power saving parameters */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/26] staging: rtl8188eu: Rework function phy_IQCalibrate_8188E()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 173 +--- 1 file changed, 95 insertions(+), 78 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index f918488..a30cc37 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -801,54 +801,55 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], } } -static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, bool is2t) +static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], +u8 t, bool is2t) { - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; u32 i; - u8 PathAOK, PathBOK; - u32 ADDA_REG[IQK_ADDA_REG_NUM] = { - rFPGA0_XCD_SwitchControl, rBlue_Tooth, - rRx_Wait_CCA, rTx_CCK_RFON, - rTx_CCK_BBON, rTx_OFDM_RFON, - rTx_OFDM_BBON, rTx_To_Rx, - rTx_To_Tx, rRx_CCK, - rRx_OFDM, rRx_Wait_RIFS, - rRx_TO_Rx, rStandby, - rSleep, rPMPD_ANAEN }; - u32 IQK_MAC_REG[IQK_MAC_REG_NUM] = { - REG_TXPAUSE,REG_BCN_CTRL, - REG_BCN_CTRL_1, REG_GPIO_MUXCFG}; + u8 path_a_ok, path_b_ok; + u32 adda_reg[IQK_ADDA_REG_NUM] = { + rFPGA0_XCD_SwitchControl, rBlue_Tooth, + rRx_Wait_CCA, rTx_CCK_RFON, + rTx_CCK_BBON, rTx_OFDM_RFON, + rTx_OFDM_BBON, rTx_To_Rx, + rTx_To_Tx, rRx_CCK, + rRx_OFDM, rRx_Wait_RIFS, + rRx_TO_Rx, rStandby, + rSleep, rPMPD_ANAEN}; + + u32 iqk_mac_reg[IQK_MAC_REG_NUM] = { + REG_TXPAUSE, REG_BCN_CTRL, + REG_BCN_CTRL_1, REG_GPIO_MUXCFG}; /* since 92C & 92D have the different define in IQK_BB_REG */ - u32 IQK_BB_REG_92C[IQK_BB_REG_NUM] = { - rOFDM0_TRxPathEnable, rOFDM0_TRMuxPar, - rFPGA0_XCD_RFInterfaceSW, rConfig_AntA, rConfig_AntB, - rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE, - rFPGA0_XB_RFInterfaceOE, rFPGA0_RFMOD - }; + u32 iqk_bb_reg_92c[IQK_BB_REG_NUM] = { + rOFDM0_TRxPathEnable, rOFDM0_TRMuxPar, + rFPGA0_XCD_RFInterfaceSW, rConfig_AntA, rConfig_AntB, + rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE, + rFPGA0_XB_RFInterfaceOE, rFPGA0_RFMOD}; - u32 retryCount = 9; + u32 retry_count = 9; if (*(dm_odm->mp_mode) == 1) - retryCount = 9; + retry_count = 9; else - retryCount = 2; - /* Note: IQ calibration must be performed after loading */ - /* PHY_REG.txt , and radio_a, radio_b.txt */ + retry_count = 2; if (t == 0) { - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2t ? "2T2R" : "1T1R"), t)); /* Save ADDA parameters, turn Path A ADDA on */ - save_adda_registers(adapt, ADDA_REG, dm_odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); - save_mac_registers(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); - save_adda_registers(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); + save_adda_registers(adapt, adda_reg, dm_odm->RFCalibrateInfo.ADDA_backup, + IQK_ADDA_
[PATCH 15/26] staging: rtl8188eu: Rework function _PHY_MACSettingCalibration()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages and local variables. Declare it as a static function. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 19 +-- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |3 --- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 24278f9..dd7445f 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -684,25 +684,16 @@ static void path_adda_on(struct adapter *adapt, u32 *adda_reg, phy_set_bb_reg(adapt, adda_reg[i], bMaskDWord, path_on); } -void -_PHY_MACSettingCalibration( - struct adapter *adapt, - u32 *MACReg, - u32 *MACBackup - ) +static void mac_setting_calibration(struct adapter *adapt, u32 *mac_reg, u32 *backup) { u32 i = 0; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("MAC settings for Calibration.\n")); - usb_write8(adapt, MACReg[i], 0x3F); + usb_write8(adapt, mac_reg[i], 0x3F); for (i = 1; i < (IQK_MAC_REG_NUM - 1); i++) { - usb_write8(adapt, MACReg[i], (u8)(MACBackup[i]&(~BIT3))); + usb_write8(adapt, mac_reg[i], (u8)(backup[i]&(~BIT3))); } - usb_write8(adapt, MACReg[i], (u8)(MACBackup[i]&(~BIT5))); + usb_write8(adapt, mac_reg[i], (u8)(backup[i]&(~BIT5))); } void @@ -906,7 +897,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, } /* MAC settings */ - _PHY_MACSettingCalibration(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); + mac_setting_calibration(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup); /* Page B init */ /* AP or IQK */ diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h index efd1fea..6252371 100644 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h @@ -46,9 +46,6 @@ void PHY_LCCalibrate_8188E(struct adapter *pAdapter); /* AP calibrate */ void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter); -void _PHY_MACSettingCalibration(struct adapter *pAdapter, u32 *MACReg, - u32 *MACBackup); - void _PHY_PathAStandBy(struct adapter *pAdapter); #endif /* #ifndef __HAL_PHY_RF_8188E_H__ */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/26] staging: rtl8188eu: Rework function phy_SimularityCompare_8188E()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 29 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 7ae715c..f918488 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -713,22 +713,19 @@ static void pi_mode_switch(struct adapter *adapt, bool pi_mode) phy_set_bb_reg(adapt, rFPGA0_XB_HSSIParameter1, bMaskDWord, mode); } -static bool phy_SimularityCompare_8188E( - struct adapter *adapt, - s32 resulta[][8], - u8 c1, - u8 c2 - ) +static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], + u8 c1, u8 c2) { u32 i, j, diff, sim_bitmap, bound = 0; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; u8 final_candidate[2] = {0xFF, 0xFF}; /* for path A and path B */ bool result = true; bool is2t; s32 tmp1 = 0, tmp2 = 0; - if ((dm_odm->RFType == ODM_2T2R) || (dm_odm->RFType == ODM_2T3R) || (dm_odm->RFType == ODM_2T4R)) + if ((dm_odm->RFType == ODM_2T2R) || (dm_odm->RFType == ODM_2T3R) || + (dm_odm->RFType == ODM_2T4R)) is2t = true; else is2t = false; @@ -738,8 +735,6 @@ static bool phy_SimularityCompare_8188E( else bound = 4; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("===> IQK:phy_SimularityCompare_8188E c1 %d c2 %d!!!\n", c1, c2)); - sim_bitmap = 0; for (i = 0; i < bound; i++) { @@ -761,10 +756,6 @@ static bool phy_SimularityCompare_8188E( diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1); if (diff > MAX_TOLERANCE) { - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("IQK:phy_SimularityCompare_8188E differnece overflow index %d compare1 0x%x compare2 0x%x!!!\n", -i, resulta[c1][i], resulta[c2][i])); - if ((i == 2 || i == 6) && !sim_bitmap) { if (resulta[c1][i] + resulta[c1][i+1] == 0) final_candidate[(i/4)] = c2; @@ -778,8 +769,6 @@ static bool phy_SimularityCompare_8188E( } } - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:phy_SimularityCompare_8188E sim_bitmap %d !!!\n", sim_bitmap)); - if (sim_bitmap == 0) { for (i = 0; i < (bound/4); i++) { if (final_candidate[i] != 0xFF) { @@ -1090,7 +1079,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) phy_IQCalibrate_8188E(adapt, result, i, is2t); if (i == 1) { - is12simular = phy_SimularityCompare_8188E(adapt, result, 0, 1); + is12simular = simularity_compare(adapt, result, 0, 1); if (is12simular) { final_candidate = 0; ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is12simular final_candidate is %x\n", final_candidate)); @@ -1099,14 +1088,14 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) } if (i == 2) { - is13simular = phy_SimularityCompare_8188E(adapt, result, 0, 2); + is13simular = simularity_compare(adapt, result, 0, 2); if (is13simular) { final_candidate = 0; ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is13simular final_candidate is %x\n", final_candidate)); break; } - is23simular = phy_SimularityCompare_8188E(adapt, result, 1, 2); + is23simular = simularity_compare(adapt, result, 1, 2); if (is23simular) { final_candidate = 1; ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is23simular final_candidate is %x\n", final_candidate)); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/26] staging: rtl8188eu: Rework function PHY_LCCalibrate_8188E()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 14 +- drivers/staging/rtl8188eu/hal/usb_halinit.c|4 ++-- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |4 +--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 93cda39..e2c9b54 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -234,7 +234,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt) /* Delta temperature is equal to or larger than 20 centigrade.*/ if ((delta_lck >= 8)) { dm_odm->RFCalibrateInfo.ThermalValue_LCK = thermal_val; - PHY_LCCalibrate_8188E(adapt); + rtl88eu_phy_lc_calibrate(adapt); } if (delta > 0 && dm_odm->RFCalibrateInfo.TxPowerTrackControl) { @@ -1179,16 +1179,15 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery) dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); } -void PHY_LCCalibrate_8188E(struct adapter *adapt) +void rtl88eu_phy_lc_calibrate(struct adapter *adapt) { bool singletone = false, carrier_sup = false; u32 timeout = 2000, timecount = 0; - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION)) return; - /* 20120213 Turn on when continuous Tx to pass lab testing. (required by Edlu) */ if (singletone || carrier_sup) return; @@ -1202,14 +1201,11 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt) if (dm_odm->RFType == ODM_2T2R) { phy_lc_calibrate(adapt, true); } else { - /* For 88C 1T1R */ + /* For 88C 1T1R */ phy_lc_calibrate(adapt, false); } dm_odm->RFCalibrateInfo.bLCKInProgress = false; - - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, -("LCK:Finish!!!interface %d\n", dm_odm->InterfaceIndex)); } static void phy_setrfpathswitch_8188e(struct adapter *adapt, bool main, bool is2t) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 45655b1..c4c0087 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -701,7 +701,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter) } ODM_TXPowerTrackingCheck(&haldata->odmpriv); - PHY_LCCalibrate_8188E(Adapter); + rtl88eu_phy_lc_calibrate(Adapter); goto exit; } @@ -893,7 +893,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_PW_TRACK); ODM_TXPowerTrackingCheck(&haldata->odmpriv); HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK); - PHY_LCCalibrate_8188E(Adapter); + rtl88eu_phy_lc_calibrate(Adapter); } /* HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PABIAS); */ diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h index 9fbfe77..6f5a66d 100644 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h @@ -36,9 +36,7 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt); void rtl88eu_phy_iq_calibrate(struct adapter *adapter, bool recovery); - -/* LC calibrate */ -void PHY_LCCalibrate_8188E(struct adapter *pAdapter); +void rtl88eu_phy_lc_calibrate(struct adapter *adapter); /* AP calibrate */ void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/26] staging: rtl8188eu: HalPhyRf_8188e.c: Remove unused functions
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 35 1 file changed, 35 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index e2c9b54..cec0ee7 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -1207,38 +1207,3 @@ void rtl88eu_phy_lc_calibrate(struct adapter *adapt) dm_odm->RFCalibrateInfo.bLCKInProgress = false; } - -static void phy_setrfpathswitch_8188e(struct adapter *adapt, bool main, bool is2t) -{ - if (!adapt->hw_init_completed) { - u8 u1btmp; - u1btmp = usb_read8(adapt, REG_LEDCFG2) | BIT7; - usb_write8(adapt, REG_LEDCFG2, u1btmp); - phy_set_bb_reg(adapt, rFPGA0_XAB_RFParameter, BIT13, 0x01); - } - - if (is2t) { /* 92C */ - if (main) - phy_set_bb_reg(adapt, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x1); /* 92C_Path_A */ - else - phy_set_bb_reg(adapt, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x2); /* BT */ - } else {/* 88C */ - if (main) - phy_set_bb_reg(adapt, rFPGA0_XA_RFInterfaceOE, BIT8|BIT9, 0x2); /* Main */ - else - phy_set_bb_reg(adapt, rFPGA0_XA_RFInterfaceOE, BIT8|BIT9, 0x1); /* Aux */ - } -} - -void PHY_SetRFPathSwitch_8188E(struct adapter *adapt, bool main) -{ - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - - if (dm_odm->RFType == ODM_2T2R) { - phy_setrfpathswitch_8188e(adapt, main, true); - } else { - /* For 88C 1T1R */ - phy_setrfpathswitch_8188e(adapt, main, false); - } -} -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/26] staging: rtl8188eu: HalPhyRf_8188e.h :Remove unused function declaration
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h index 6f5a66d..3c3b898 100644 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h @@ -38,7 +38,4 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt); void rtl88eu_phy_iq_calibrate(struct adapter *adapter, bool recovery); void rtl88eu_phy_lc_calibrate(struct adapter *adapter); -/* AP calibrate */ -void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter); - #endif /* #ifndef __HAL_PHY_RF_8188E_H__ */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/26] staging: rtl8188eu: Rework function phy_LCCalibrate_8188E()
Rename CamelCase local variables and function name. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 42 ++-- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index a30cc37..30ee00b 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -987,42 +987,47 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], } } -static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) +static void phy_lc_calibrate(struct adapter *adapt, bool is2t) { u8 tmpreg; - u32 RF_Amode = 0, RF_Bmode = 0, LC_Cal; + u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal; /* Check continuous TX and Packet TX */ tmpreg = usb_read8(adapt, 0xd03); - if ((tmpreg&0x70) != 0) /* Deal with contisuous TX case */ - usb_write8(adapt, 0xd03, tmpreg&0x8F); /* disable all continuous TX */ - else/* Deal with Packet TX case */ - usb_write8(adapt, REG_TXPAUSE, 0xFF); /* block all queues */ + if ((tmpreg&0x70) != 0) + usb_write8(adapt, 0xd03, tmpreg&0x8F); + else + usb_write8(adapt, REG_TXPAUSE, 0xFF); if ((tmpreg&0x70) != 0) { /* 1. Read original RF mode */ /* Path-A */ - RF_Amode = phy_query_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits); + rf_a_mode = phy_query_rf_reg(adapt, RF_PATH_A, RF_AC, +bMask12Bits); /* Path-B */ if (is2t) - RF_Bmode = phy_query_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits); + rf_b_mode = phy_query_rf_reg(adapt, RF_PATH_B, RF_AC, +bMask12Bits); /* 2. Set RF mode = standby mode */ /* Path-A */ - phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits, (RF_Amode&0x8)|0x1); + phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits, + (rf_a_mode&0x8)|0x1); /* Path-B */ if (is2t) - phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits, (RF_Bmode&0x8)|0x1); + phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits, + (rf_b_mode&0x8)|0x1); } /* 3. Read RF reg18 */ - LC_Cal = phy_query_rf_reg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits); + lc_cal = phy_query_rf_reg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits); - /* 4. Set LC calibration begin bit15 */ - phy_set_rf_reg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits, LC_Cal|0x08000); + /* 4. Set LC calibration begin bit15 */ + phy_set_rf_reg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits, + lc_cal|0x08000); msleep(100); @@ -1031,13 +1036,14 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) /* Deal with continuous TX case */ /* Path-A */ usb_write8(adapt, 0xd03, tmpreg); - phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode); + phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits, rf_a_mode); /* Path-B */ if (is2t) - phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode); + phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits, + rf_b_mode); } else { - /* Deal with Packet TX case */ + /* Deal with Packet TX case */ usb_write8(adapt, REG_TXPAUSE, 0x00); } } @@ -1207,10 +1213,10 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt) dm_odm->RFCalibrateInfo.bLCKInProgress = true; if (dm_odm->RFType == ODM_2T2R) { - phy_LCCalibrate_8188E(adapt, true); + phy_lc_calibrate(adapt, true); } else { /* For 88C 1T1R */ - phy_LCCalibrate_8188E(adapt, false); + phy_lc_calibrate(adapt, false); } dm_odm->RFCalibrateInfo.bLCKInProgress = false; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/26] staging: rtl8188eu: Rework function PHY_LCCalibrate_8188E()
Rename CamelCase local variables and function name. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 127 +--- drivers/staging/rtl8188eu/hal/usb_halinit.c|8 +- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h |5 +- 3 files changed, 62 insertions(+), 78 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c index 30ee00b..93cda39 100644 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c @@ -347,7 +347,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt) /* Delta temperature is equal to or larger than 20 centigrade.*/ if (delta_iqk >= 8) { dm_odm->RFCalibrateInfo.ThermalValue_IQK = thermal_val; - PHY_IQCalibrate_8188E(adapt, false); + rtl88eu_phy_iq_calibrate(adapt, false); } /* update thermal meter value */ if (dm_odm->RFCalibrateInfo.TxPowerTrackControl) @@ -1048,17 +1048,18 @@ static void phy_lc_calibrate(struct adapter *adapt, bool is2t) } } -void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) +void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery) { - struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt); - struct odm_dm_struct *dm_odm = &pHalData->odmpriv; - s32 result[4][8]; /* last is final result */ - u8 i, final_candidate, Indexforchannel; + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); + struct odm_dm_struct *dm_odm = &hal_data->odmpriv; + s32 result[4][8]; + u8 i, final, chn_index; bool pathaok, pathbok; - s32 RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC; + s32 reg_e94, reg_e9c, reg_ea4, reg_eac, reg_eb4, reg_ebc, reg_ec4, + reg_ecc; bool is12simular, is13simular, is23simular; bool singletone = false, carrier_sup = false; - u32 IQK_BB_REG_92C[IQK_BB_REG_NUM] = { + u32 iqk_bb_reg_92c[IQK_BB_REG_NUM] = { rOFDM0_XARxIQImbalance, rOFDM0_XBRxIQImbalance, rOFDM0_ECCAThreshold, rOFDM0_AGCRSSITable, rOFDM0_XATxIQImbalance, rOFDM0_XBTxIQImbalance, @@ -1071,16 +1072,16 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION)) return; - /* 20120213 Turn on when continuous Tx to pass lab testing. (required by Edlu) */ if (singletone || carrier_sup) return; if (recovery) { - ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("PHY_IQCalibrate_8188E: Return due to recovery!\n")); - reload_adda_reg(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); + ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, +("phy_iq_calibrate: Return due to recovery!\n")); + reload_adda_reg(adapt, iqk_bb_reg_92c, + dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); return; } - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Start!!!\n")); for (i = 0; i < 8; i++) { result[0][i] = 0; @@ -1091,7 +1092,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) else result[3][i] = 0; } - final_candidate = 0xff; + final = 0xff; pathaok = false; pathbok = false; is12simular = false; @@ -1104,8 +1105,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) if (i == 1) { is12simular = simularity_compare(adapt, result, 0, 1); if (is12simular) { - final_candidate = 0; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is12simular final_candidate is %x\n", final_candidate)); + final = 0; break; } } @@ -1113,83 +1113,70 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) if (i == 2) { is13simular = simularity_compare(adapt, result, 0, 2); if (is13simular) { - final_candidate = 0; - ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is13simular final_candidate is %x\n", final_candidate)); - + final = 0; break;
[PATCH 25/26] staging: rtl8188eu: Remove HalPhyRf_8188e.h
Move macros and function declarations from HalPhyRf_8188e.h to phy.h . Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h | 41 drivers/staging/rtl8188eu/include/odm_precomp.h|1 - drivers/staging/rtl8188eu/include/phy.h| 14 +++ 3 files changed, 14 insertions(+), 42 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h diff --git a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h b/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h deleted file mode 100644 index 3c3b898..000 --- a/drivers/staging/rtl8188eu/include/HalPhyRf_8188e.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ - -#ifndef __HAL_PHY_RF_8188E_H__ -#define __HAL_PHY_RF_8188E_H__ - -/*--Define Parameters---*/ -#defineIQK_DELAY_TIME_88E 10 /* ms */ -#defineindex_mapping_NUM_88E 15 -#define AVG_THERMAL_NUM_88E4 -#define ODM_TARGET_CHNL_NUM_2G_5G 59 - -void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, -u8 type, /* 0 = OFDM, 1 = CCK */ -u8 *dir, /* 1 = +(incr), 2 = -(decr) */ -u32 *out_write); /* Tx tracking CCK/OFDM BB - * swing index adjust - */ - -void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt); -void rtl88eu_phy_iq_calibrate(struct adapter *adapter, bool recovery); -void rtl88eu_phy_lc_calibrate(struct adapter *adapter); - -#endif /* #ifndef __HAL_PHY_RF_8188E_H__ */ diff --git a/drivers/staging/rtl8188eu/include/odm_precomp.h b/drivers/staging/rtl8188eu/include/odm_precomp.h index 436d6ff..a8537bf 100644 --- a/drivers/staging/rtl8188eu/include/odm_precomp.h +++ b/drivers/staging/rtl8188eu/include/odm_precomp.h @@ -40,7 +40,6 @@ #include "odm_RegDefine11AC.h" #include "odm_RegDefine11N.h" -#include "HalPhyRf_8188e.h"/* for IQK,LCK,Power-tracking */ #include "Hal8188ERateAdaptive.h"/* for RA,Power training */ #include "rtl8188e_hal.h" diff --git a/drivers/staging/rtl8188eu/include/phy.h b/drivers/staging/rtl8188eu/include/phy.h index defed4a..9a9ab82 100644 --- a/drivers/staging/rtl8188eu/include/phy.h +++ b/drivers/staging/rtl8188eu/include/phy.h @@ -1,3 +1,10 @@ +#include + +#define IQK_DELAY_TIME_88E 10 +#define index_mapping_NUM_88E 15 +#define AVG_THERMAL_NUM_88E4 +#define ODM_TARGET_CHNL_NUM_2G_5G 59 + bool rtl88eu_phy_mac_config(struct adapter *adapt); bool rtl88eu_phy_rf_config(struct adapter *adapt); bool rtl88eu_phy_bb_config(struct adapter *adapt); @@ -14,3 +21,10 @@ void phy_set_tx_power_level(struct adapter *adapt, u8 channel); void phy_set_bw_mode(struct adapter *adapt, enum ht_channel_width bandwidth, unsigned char offset); void phy_sw_chnl(struct adapter *adapt, u8 channel); + +void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, +u8 type, u8 *dir, u32 *out_write); + +void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt); +void rtl88eu_phy_iq_calibrate(struct adapter *adapter, bool recovery); +void rtl88eu_phy_lc_calibrate(struct adapter *adapter); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/26] staging: rtl8188eu: Remove HalPhyRf_8188e.c
Move functions from HalPhyRf_8188e.c to phy.c . Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/Makefile |1 - drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 1209 drivers/staging/rtl8188eu/hal/phy.c| 1187 +++ 3 files changed, 1187 insertions(+), 1210 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c diff --git a/drivers/staging/rtl8188eu/Makefile b/drivers/staging/rtl8188eu/Makefile index 8723794..33cd34d 100644 --- a/drivers/staging/rtl8188eu/Makefile +++ b/drivers/staging/rtl8188eu/Makefile @@ -21,7 +21,6 @@ r8188eu-y := \ hal/mac_cfg.o \ hal/bb_cfg.o \ hal/rf_cfg.o \ - hal/HalPhyRf_8188e.o\ hal/pwrseqcmd.o \ hal/pwrseq.o \ hal/Hal8188ERateAdaptive.o\ diff --git a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c deleted file mode 100644 index cec0ee7..000 --- a/drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +++ /dev/null @@ -1,1209 +0,0 @@ -/* - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#include "odm_precomp.h" -#include "phy.h" - -/* 2010/04/25 MH Define the max tx power tracking tx agc power. */ -#defineODM_TXPWRTRACK_MAX_IDX_88E 6 - - -static u8 get_right_chnl_for_iqk(u8 chnl) -{ - u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, - 124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153, - 155, 157, 159, 161, 163, 165 - }; - u8 place = chnl; - - if (chnl > 14) { - for (place = 14; place < sizeof(channel_all); place++) { - if (channel_all[place] == chnl) - return place-13; - } - } - return 0; -} - -void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type, -u8 *direction, u32 *out_write_val) -{ - u8 pwr_value = 0; - /* Tx power tracking BB swing table. */ - if (type == 0) { /* For OFDM adjust */ - ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, -("BbSwingIdxOfdm = %d BbSwingFlagOfdm=%d\n", -dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm)); - - if (dm_odm->BbSwingIdxOfdm <= dm_odm->BbSwingIdxOfdmBase) { - *direction = 1; - pwr_value = (dm_odm->BbSwingIdxOfdmBase - -dm_odm->BbSwingIdxOfdm); - } else { - *direction = 2; - pwr_value = (dm_odm->BbSwingIdxOfdm - -dm_odm->BbSwingIdxOfdmBase); - } - - } else if (type == 1) { /* For CCK adjust. */ - ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, -("dm_odm->BbSwingIdxCck = %d dm_odm->BbSwingIdxCckBase = %d\n", -dm_odm->BbSwingIdxCck, dm_odm->BbSwingIdxCckBase)); - - if (dm_odm->BbSwingIdxCck <= dm_odm->BbSwingIdxCckBase) { - *direction = 1; - pwr_value = (dm_odm->BbSwingIdxCckBase - -dm_odm->BbSwingIdxCck); - } else { - *direction = 2; - pwr_value = (dm_odm->BbSwingIdxCck - -dm_odm->BbSwingIdxCckBase); - } - - } - - if (pwr_value >= ODM_TXPWRTRACK_MAX_IDX_88E && *direction == 1) - pwr_value = ODM_TXPWRTRACK_MAX_IDX_88E; - - *out_write_val = pwr_value | (pwr_value<<8) | (pwr_value<<16) | -(pwr_value<<24); -} - -static void dm_txpwr_track_setpw
[PATCH 01/13] staging: rtl8188eu: Remove odm_debug.c
Move a function and global variable from odm_debug.c to odm.c Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/Makefile|1 - drivers/staging/rtl8188eu/hal/odm.c |8 drivers/staging/rtl8188eu/hal/odm_debug.c | 32 - 3 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/hal/odm_debug.c diff --git a/drivers/staging/rtl8188eu/Makefile b/drivers/staging/rtl8188eu/Makefile index 33cd34d..31ac159 100644 --- a/drivers/staging/rtl8188eu/Makefile +++ b/drivers/staging/rtl8188eu/Makefile @@ -27,7 +27,6 @@ r8188eu-y := \ hal/hal_intf.o \ hal/hal_com.o \ hal/odm.o \ - hal/odm_debug.o \ hal/odm_HWConfig.o \ hal/odm_RTL8188E.o \ hal/rtl8188e_cmd.o \ diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c index 3a929bf..ae98379 100644 --- a/drivers/staging/rtl8188eu/hal/odm.c +++ b/drivers/staging/rtl8188eu/hal/odm.c @@ -23,6 +23,7 @@ #include "odm_precomp.h" #include "phy.h" +u32 GlobalDebugLevel; static const u16 dB_Invert_Table[8][12] = { {1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4}, {4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16}, @@ -172,6 +173,13 @@ u8 CCKSwingTable_Ch14[CCK_TABLE_SIZE][8] = { #defineRxDefaultAnt1 0x65a9 #defineRxDefaultAnt2 0x569a +void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm) +{ + pDM_Odm->DebugLevel = ODM_DBG_TRACE; + + pDM_Odm->DebugComponents = 0; +} + /* 3 Export Interface */ /* 2011/09/21 MH Add to describe different team necessary resource allocate?? */ diff --git a/drivers/staging/rtl8188eu/hal/odm_debug.c b/drivers/staging/rtl8188eu/hal/odm_debug.c deleted file mode 100644 index 84caadd..000 --- a/drivers/staging/rtl8188eu/hal/odm_debug.c +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ - -/* include files */ - -#include "odm_precomp.h" - -void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm) -{ - pDM_Odm->DebugLevel = ODM_DBG_TRACE; - - pDM_Odm->DebugComponents = 0; -} - -u32 GlobalDebugLevel; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/13] staging: rtl8188eu: Rework function odm_RX_HWAntDivInit()
Rename CamelCase function name. Remove unnecessary comments. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 31 +- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 095078d..4b8bafe 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -21,34 +21,35 @@ #include "odm_precomp.h" #include "phy.h" -static void odm_RX_HWAntDivInit(struct odm_dm_struct *dm_odm) +static void dm_rx_hw_antena_div_init(struct odm_dm_struct *dm_odm) { struct adapter *adapter = dm_odm->Adapter; - u32 value32; + u32 value32; if (*(dm_odm->mp_mode) == 1) { dm_odm->AntDivType = CGCS_RX_SW_ANTDIV; - phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 0); /* disable HW AntDiv */ - phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT31, 1); /* 1:CG, 0:CS */ + phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 0); + phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT31, 1); return; } - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_RX_HWAntDivInit()\n")); /* MAC Setting */ value32 = phy_query_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord); - phy_set_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32|(BIT23|BIT25)); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */ + phy_set_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, + value32|(BIT23|BIT25)); /* Pin Settings */ - phy_set_bb_reg(adapter, ODM_REG_PIN_CTRL_11N, BIT9|BIT8, 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */ - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT10, 0); /* Reg864[10]=1'b0 antsel2 by HW */ - phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT22, 1); /* Regb2c[22]=1'b0 disable CS/CG switch */ - phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT31, 1); /* Regb2c[31]=1'b1 output at CG only */ + phy_set_bb_reg(adapter, ODM_REG_PIN_CTRL_11N, BIT9|BIT8, 0); + phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT10, 0); + phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT22, 1); + phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT31, 1); /* OFDM Settings */ - phy_set_bb_reg(adapter, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, 0x00a0); + phy_set_bb_reg(adapter, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, + 0x00a0); /* CCK Settings */ - phy_set_bb_reg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT7, 1); /* Fix CCK PHY status report issue */ - phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 1); /* CCK complete HW AntDiv within 64 samples */ + phy_set_bb_reg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT7, 1); + phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 1); ODM_UpdateRxIdleAnt_88E(dm_odm, MAIN_ANT); - phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, 0x, 0x0201); /* antenna mapping table */ + phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, 0x, 0x0201); } static void odm_TRX_HWAntDivInit(struct odm_dm_struct *dm_odm) @@ -177,7 +178,7 @@ void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *dm_odm) ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_odm->bIsMPChip=%s\n", (dm_odm->bIsMPChip ? "true" : "false"))); if (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV) - odm_RX_HWAntDivInit(dm_odm); + dm_rx_hw_antena_div_init(dm_odm); else if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) odm_TRX_HWAntDivInit(dm_odm); else if (dm_odm->AntDivType == CG_TRX_SMART_ANTDIV) -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/13] staging: rtl8188eu: Rework function odm_TRX_HWAntDivInit()
Rename CamelCase function name. Remove unnecessary comments. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 39 +++--- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 4b8bafe..8cbd578 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -52,42 +52,47 @@ static void dm_rx_hw_antena_div_init(struct odm_dm_struct *dm_odm) phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, 0x, 0x0201); } -static void odm_TRX_HWAntDivInit(struct odm_dm_struct *dm_odm) +static void dm_trx_hw_antenna_div_init(struct odm_dm_struct *dm_odm) { struct adapter *adapter = dm_odm->Adapter; u32 value32; if (*(dm_odm->mp_mode) == 1) { dm_odm->AntDivType = CGCS_RX_SW_ANTDIV; - phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 0); /* disable HW AntDiv */ - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT5|BIT4|BIT3, 0); /* Default RX (0/1) */ + phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 0); + phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, + BIT5|BIT4|BIT3, 0); return; } - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_TRX_HWAntDivInit()\n")); /* MAC Setting */ value32 = phy_query_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord); - phy_set_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32|(BIT23|BIT25)); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */ + phy_set_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, + value32|(BIT23|BIT25)); /* Pin Settings */ - phy_set_bb_reg(adapter, ODM_REG_PIN_CTRL_11N, BIT9|BIT8, 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */ - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT10, 0); /* Reg864[10]=1'b0 antsel2 by HW */ - phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT22, 0); /* Regb2c[22]=1'b0 disable CS/CG switch */ - phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT31, 1); /* Regb2c[31]=1'b1 output at CG only */ + phy_set_bb_reg(adapter, ODM_REG_PIN_CTRL_11N, BIT9|BIT8, 0); + phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT10, 0); + phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT22, 0); + phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT31, 1); /* OFDM Settings */ - phy_set_bb_reg(adapter, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, 0x00a0); + phy_set_bb_reg(adapter, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, + 0x00a0); /* CCK Settings */ - phy_set_bb_reg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT7, 1); /* Fix CCK PHY status report issue */ - phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 1); /* CCK complete HW AntDiv within 64 samples */ + phy_set_bb_reg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT7, 1); + phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 1); /* Tx Settings */ - phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT21, 0); /* Reg80c[21]=1'b0 from TX Reg */ + phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT21, 0); ODM_UpdateRxIdleAnt_88E(dm_odm, MAIN_ANT); /* antenna mapping table */ if (!dm_odm->bIsMPChip) { /* testchip */ - phy_set_bb_reg(adapter, ODM_REG_RX_DEFUALT_A_11N, BIT10|BIT9|BIT8, 1); /* Reg858[10:8]=3'b001 */ - phy_set_bb_reg(adapter, ODM_REG_RX_DEFUALT_A_11N, BIT13|BIT12|BIT11, 2);/* Reg858[13:11]=3'b010 */ + phy_set_bb_reg(adapter, ODM_REG_RX_DEFUALT_A_11N, + BIT10|BIT9|BIT8, 1); + phy_set_bb_reg(adapter, ODM_REG_RX_DEFUALT_A_11N, + BIT13|BIT12|BIT11, 2); } else { /* MPchip */ - phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, bMaskDWord, 0x0201); /* Reg914=3'b010, Reg915=3'b001 */ + phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, bMaskDWord, + 0x0201); } } @@ -180,7 +185,7 @@ void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *dm_odm) if (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV) dm_rx_hw_antena_div_init(dm_odm); else if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) - odm_TRX_HWAntDivInit(dm_odm); + dm_trx_hw_antenna_div_init(dm_odm); else if (dm_odm->AntDivType == CG_TRX_SMART_ANTDIV) odm_FastAntTrainingInit(dm_odm); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/13] staging: rtl8188eu: Remove unused header file odm_RegDefine11AC.h
Signed-off-by: navin patidar --- .../staging/rtl8188eu/include/odm_RegDefine11AC.h | 54 drivers/staging/rtl8188eu/include/odm_precomp.h|1 - 2 files changed, 55 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/odm_RegDefine11AC.h diff --git a/drivers/staging/rtl8188eu/include/odm_RegDefine11AC.h b/drivers/staging/rtl8188eu/include/odm_RegDefine11AC.h deleted file mode 100644 index f08775c..000 --- a/drivers/staging/rtl8188eu/include/odm_RegDefine11AC.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ - -#ifndef__ODM_REGDEFINE11AC_H__ -#define __ODM_REGDEFINE11AC_H__ - -/* 2 RF REG LIST */ - - - -/* 2 BB REG LIST */ -/* PAGE 8 */ -/* PAGE 9 */ -#defineODM_REG_OFDM_FA_RST_11AC0x9A4 -/* PAGE A */ -#defineODM_REG_CCK_CCA_11AC0xA0A -#defineODM_REG_CCK_FA_RST_11AC 0xA2C -#defineODM_REG_CCK_FA_11AC 0xA5C -/* PAGE C */ -#defineODM_REG_IGI_A_11AC 0xC50 -/* PAGE E */ -#defineODM_REG_IGI_B_11AC 0xE50 -/* PAGE F */ -#defineODM_REG_OFDM_FA_11AC0xF48 - - -/* 2 MAC REG LIST */ - - - - -/* DIG Related */ -#defineODM_BIT_IGI_11AC0x - - - -#endif diff --git a/drivers/staging/rtl8188eu/include/odm_precomp.h b/drivers/staging/rtl8188eu/include/odm_precomp.h index a8537bf..0f236da 100644 --- a/drivers/staging/rtl8188eu/include/odm_precomp.h +++ b/drivers/staging/rtl8188eu/include/odm_precomp.h @@ -37,7 +37,6 @@ #include "odm.h" #include "odm_HWConfig.h" #include "odm_debug.h" -#include "odm_RegDefine11AC.h" #include "odm_RegDefine11N.h" #include "Hal8188ERateAdaptive.h"/* for RA,Power training */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/13] staging: rtl8188eu: Rework function odm_FastAntTrainingInit()
Rename CamelCase function name. Remove unnecessary comments and debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 53 -- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 8cbd578..68d0235 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -96,17 +96,14 @@ static void dm_trx_hw_antenna_div_init(struct odm_dm_struct *dm_odm) } } -static void odm_FastAntTrainingInit(struct odm_dm_struct *dm_odm) +static void dm_fast_training_init(struct odm_dm_struct *dm_odm) { struct adapter *adapter = dm_odm->Adapter; - u32 value32, i; + u32 value32, i; struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; - u32 AntCombination = 2; - - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_FastAntTrainingInit()\n")); + u32 AntCombination = 2; if (*(dm_odm->mp_mode) == 1) { - ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("dm_odm->AntDivType: %d\n", dm_odm->AntDivType)); return; } @@ -121,40 +118,40 @@ static void odm_FastAntTrainingInit(struct odm_dm_struct *dm_odm) /* MAC Setting */ value32 = phy_query_bb_reg(adapter, 0x4c, bMaskDWord); - phy_set_bb_reg(adapter, 0x4c, bMaskDWord, value32|(BIT23|BIT25)); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */ + phy_set_bb_reg(adapter, 0x4c, bMaskDWord, value32|(BIT23|BIT25)); value32 = phy_query_bb_reg(adapter, 0x7B4, bMaskDWord); - phy_set_bb_reg(adapter, 0x7b4, bMaskDWord, value32|(BIT16|BIT17)); /* Reg7B4[16]=1 enable antenna training, Reg7B4[17]=1 enable A2 match */ + phy_set_bb_reg(adapter, 0x7b4, bMaskDWord, value32|(BIT16|BIT17)); /* Match MAC ADDR */ phy_set_bb_reg(adapter, 0x7b4, 0x, 0); phy_set_bb_reg(adapter, 0x7b0, bMaskDWord, 0); - phy_set_bb_reg(adapter, 0x870, BIT9|BIT8, 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */ - phy_set_bb_reg(adapter, 0x864, BIT10, 0); /* Reg864[10]=1'b0 antsel2 by HW */ - phy_set_bb_reg(adapter, 0xb2c, BIT22, 0); /* Regb2c[22]=1'b0 disable CS/CG switch */ - phy_set_bb_reg(adapter, 0xb2c, BIT31, 1); /* Regb2c[31]=1'b1 output at CG only */ + phy_set_bb_reg(adapter, 0x870, BIT9|BIT8, 0); + phy_set_bb_reg(adapter, 0x864, BIT10, 0); + phy_set_bb_reg(adapter, 0xb2c, BIT22, 0); + phy_set_bb_reg(adapter, 0xb2c, BIT31, 1); phy_set_bb_reg(adapter, 0xca4, bMaskDWord, 0x00a0); /* antenna mapping table */ if (AntCombination == 2) { if (!dm_odm->bIsMPChip) { /* testchip */ - phy_set_bb_reg(adapter, 0x858, BIT10|BIT9|BIT8, 1); /* Reg858[10:8]=3'b001 */ - phy_set_bb_reg(adapter, 0x858, BIT13|BIT12|BIT11, 2); /* Reg858[13:11]=3'b010 */ + phy_set_bb_reg(adapter, 0x858, BIT10|BIT9|BIT8, 1); + phy_set_bb_reg(adapter, 0x858, BIT13|BIT12|BIT11, 2); } else { /* MPchip */ phy_set_bb_reg(adapter, 0x914, bMaskByte0, 1); phy_set_bb_reg(adapter, 0x914, bMaskByte1, 2); } } else if (AntCombination == 7) { if (!dm_odm->bIsMPChip) { /* testchip */ - phy_set_bb_reg(adapter, 0x858, BIT10|BIT9|BIT8, 0); /* Reg858[10:8]=3'b000 */ - phy_set_bb_reg(adapter, 0x858, BIT13|BIT12|BIT11, 1); /* Reg858[13:11]=3'b001 */ + phy_set_bb_reg(adapter, 0x858, BIT10|BIT9|BIT8, 0); + phy_set_bb_reg(adapter, 0x858, BIT13|BIT12|BIT11, 1); phy_set_bb_reg(adapter, 0x878, BIT16, 0); - phy_set_bb_reg(adapter, 0x858, BIT15|BIT14, 2); /* Reg878[0],Reg858[14:15])=3'b010 */ - phy_set_bb_reg(adapter, 0x878, BIT19|BIT18|BIT17, 3);/* Reg878[3:1]=3b'011 */ - phy_set_bb_reg(adapter, 0x878, BIT22|BIT21|BIT20, 4);/* Reg878[6:4]=3b'100 */ - phy_set_bb_reg(adapter, 0x878, BIT25|BIT24|BIT23, 5);/* Reg878[9:7]=3b'101 */ - phy_set_bb_reg(adapter, 0x878, BIT28|BIT27|BIT26, 6);/* Reg878[12:10]=3b'110 */ - phy_set_bb_reg(adapter, 0x878, BIT31|BIT30|BIT29, 7);/* Reg878[15:13]=3b'111 */ + phy_set_bb_reg(adapter, 0x858, BIT15|BIT14, 2); + phy_set_bb_reg(adapter, 0x878, BIT19|BIT18|BIT17, 3); + phy_set_bb_reg(adapter, 0x878, BIT22|BIT21|BIT20, 4); + phy_set_b
[PATCH 06/13] staging: rtl8188eu: Rework function ODM_AntennaDiversityInit_88E()
Rename CamelCase function name. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm.c |2 +- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c |5 + drivers/staging/rtl8188eu/include/odm_RTL8188E.h |2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c index ae98379..bc891e9 100644 --- a/drivers/staging/rtl8188eu/hal/odm.c +++ b/drivers/staging/rtl8188eu/hal/odm.c @@ -1265,7 +1265,7 @@ void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm) return; } - ODM_AntennaDiversityInit_88E(pDM_Odm); + rtl88eu_dm_antenna_div_init(pDM_Odm); } void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 68d0235..74105b5 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -174,11 +174,8 @@ static void dm_fast_training_init(struct odm_dm_struct *dm_odm) phy_set_bb_reg(adapter, 0xc50, BIT7, 1); } -void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *dm_odm) +void rtl88eu_dm_antenna_div_init(struct odm_dm_struct *dm_odm) { - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_odm->AntDivType=%d\n", dm_odm->AntDivType)); - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_odm->bIsMPChip=%s\n", (dm_odm->bIsMPChip ? "true" : "false"))); - if (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV) dm_rx_hw_antena_div_init(dm_odm); else if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) diff --git a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h index 02ac78d..7ef8c36 100644 --- a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h @@ -29,7 +29,7 @@ void ODM_DIG_LowerBound_88E(struct odm_dm_struct *pDM_Odm); -void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *pDM_Odm); +void rtl88eu_dm_antenna_div_init(struct odm_dm_struct *dm_odm); void ODM_AntennaDiversity_88E(struct odm_dm_struct *pDM_Odm); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/13] staging: rtl8188eu: Rework function odm_UpdateTxAnt_88E()
Rename CamelCase function name and local variables. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 8b886c6..f3a4e28 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -222,25 +222,18 @@ void rtl88eu_dm_update_rx_idle_ant(struct odm_dm_struct *dm_odm, u8 ant) dm_fat_tbl->RxIdleAnt = ant; } -static void odm_UpdateTxAnt_88E(struct odm_dm_struct *dm_odm, u8 Ant, u32 MacId) +static void update_tx_ant_88eu(struct odm_dm_struct *dm_odm, u8 ant, u32 mac_id) { struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; - u8 TargetAnt; + u8 target_ant; - if (Ant == MAIN_ANT) - TargetAnt = MAIN_ANT_CG_TRX; + if (ant == MAIN_ANT) + target_ant = MAIN_ANT_CG_TRX; else - TargetAnt = AUX_ANT_CG_TRX; - dm_fat_tbl->antsel_a[MacId] = TargetAnt&BIT0; - dm_fat_tbl->antsel_b[MacId] = (TargetAnt&BIT1)>>1; - dm_fat_tbl->antsel_c[MacId] = (TargetAnt&BIT2)>>2; - - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, -("Tx from TxInfo, TargetAnt=%s\n", -(Ant == MAIN_ANT) ? "MAIN_ANT" : "AUX_ANT")); - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, -("antsel_tr_mux=3'b%d%d%d\n", -dm_fat_tbl->antsel_c[MacId], dm_fat_tbl->antsel_b[MacId], dm_fat_tbl->antsel_a[MacId])); + target_ant = AUX_ANT_CG_TRX; + dm_fat_tbl->antsel_a[mac_id] = target_ant&BIT0; + dm_fat_tbl->antsel_b[mac_id] = (target_ant&BIT1)>>1; + dm_fat_tbl->antsel_c[mac_id] = (target_ant&BIT2)>>2; } void ODM_SetTxAntByTxInfo_88E(struct odm_dm_struct *dm_odm, u8 *pDesc, u8 macId) @@ -322,7 +315,7 @@ static void odm_HWAntDiv(struct odm_dm_struct *dm_odm) } /* 2 Select TRX Antenna */ if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) - odm_UpdateTxAnt_88E(dm_odm, TargetAnt, i); + update_tx_ant_88eu(dm_odm, TargetAnt, i); } dm_fat_tbl->MainAnt_Sum[i] = 0; dm_fat_tbl->AuxAnt_Sum[i] = 0; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/13] staging: rtl8188eu: Rework function ODM_UpdateRxIdleAnt_88E()
Rename CamelCase function name and local variables. Remove unnecessary debugging messages and comments. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 51 -- drivers/staging/rtl8188eu/hal/usb_halinit.c |2 +- drivers/staging/rtl8188eu/include/odm_RTL8188E.h |2 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 74105b5..8b886c6 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -48,7 +48,7 @@ static void dm_rx_hw_antena_div_init(struct odm_dm_struct *dm_odm) /* CCK Settings */ phy_set_bb_reg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT7, 1); phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 1); - ODM_UpdateRxIdleAnt_88E(dm_odm, MAIN_ANT); + rtl88eu_dm_update_rx_idle_ant(dm_odm, MAIN_ANT); phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, 0x, 0x0201); } @@ -82,7 +82,7 @@ static void dm_trx_hw_antenna_div_init(struct odm_dm_struct *dm_odm) phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 1); /* Tx Settings */ phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT21, 0); - ODM_UpdateRxIdleAnt_88E(dm_odm, MAIN_ANT); + rtl88eu_dm_update_rx_idle_ant(dm_odm, MAIN_ANT); /* antenna mapping table */ if (!dm_odm->bIsMPChip) { /* testchip */ @@ -184,35 +184,42 @@ void rtl88eu_dm_antenna_div_init(struct odm_dm_struct *dm_odm) dm_fast_training_init(dm_odm); } -void ODM_UpdateRxIdleAnt_88E(struct odm_dm_struct *dm_odm, u8 Ant) +void rtl88eu_dm_update_rx_idle_ant(struct odm_dm_struct *dm_odm, u8 ant) { struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; struct adapter *adapter = dm_odm->Adapter; - u32 DefaultAnt, OptionalAnt; - - if (dm_fat_tbl->RxIdleAnt != Ant) { - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Need to Update Rx Idle Ant\n")); - if (Ant == MAIN_ANT) { - DefaultAnt = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? MAIN_ANT_CG_TRX : MAIN_ANT_CGCS_RX; - OptionalAnt = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? AUX_ANT_CG_TRX : AUX_ANT_CGCS_RX; + u32 default_ant, optional_ant; + + if (dm_fat_tbl->RxIdleAnt != ant) { + if (ant == MAIN_ANT) { + default_ant = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? + MAIN_ANT_CG_TRX : MAIN_ANT_CGCS_RX; + optional_ant = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? + AUX_ANT_CG_TRX : AUX_ANT_CGCS_RX; } else { - DefaultAnt = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? AUX_ANT_CG_TRX : AUX_ANT_CGCS_RX; - OptionalAnt = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? MAIN_ANT_CG_TRX : MAIN_ANT_CGCS_RX; + default_ant = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? + AUX_ANT_CG_TRX : AUX_ANT_CGCS_RX; + optional_ant = (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) ? + MAIN_ANT_CG_TRX : MAIN_ANT_CGCS_RX; } if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) { - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT5|BIT4|BIT3, DefaultAnt); /* Default RX */ - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT8|BIT7|BIT6, OptionalAnt); /* Optional RX */ - phy_set_bb_reg(adapter, ODM_REG_ANTSEL_CTRL_11N, BIT14|BIT13|BIT12, DefaultAnt);/* Default TX */ - phy_set_bb_reg(adapter, ODM_REG_RESP_TX_11N, BIT6|BIT7, DefaultAnt);/* Resp Tx */ + phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, + BIT5|BIT4|BIT3, default_ant); + phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, + BIT8|BIT7|BIT6, optional_ant); + phy_set_bb_reg(adapter, ODM_REG_ANTSEL_CTRL_11N, + BIT14|BIT13|BIT12, default_ant); + phy_set_bb_reg(adapter, ODM_REG_RESP_TX_11N, + BIT6|BIT7, default_ant); } else if (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV) { - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT5|BIT4|BIT3, DefaultAnt); /* Default RX */ - phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT8|BIT7|BIT6, OptionalAnt); /* Optional RX */ + phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N, +
[PATCH 09/13] staging: rtl8188eu: Rework function ODM_SetTxAntByTxInfo_88E()
Rename CamelCase function name and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 12 +++- drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c |3 ++- drivers/staging/rtl8188eu/include/odm_RTL8188E.h |4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index f3a4e28..5a51405 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -236,14 +236,16 @@ static void update_tx_ant_88eu(struct odm_dm_struct *dm_odm, u8 ant, u32 mac_id) dm_fat_tbl->antsel_c[mac_id] = (target_ant&BIT2)>>2; } -void ODM_SetTxAntByTxInfo_88E(struct odm_dm_struct *dm_odm, u8 *pDesc, u8 macId) +void rtl88eu_dm_set_tx_ant_by_tx_info(struct odm_dm_struct *dm_odm, + u8 *desc, u8 mac_id) { struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; - if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CG_TRX_SMART_ANTDIV)) { - SET_TX_DESC_ANTSEL_A_88E(pDesc, dm_fat_tbl->antsel_a[macId]); - SET_TX_DESC_ANTSEL_B_88E(pDesc, dm_fat_tbl->antsel_b[macId]); - SET_TX_DESC_ANTSEL_C_88E(pDesc, dm_fat_tbl->antsel_c[macId]); + if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || + (dm_odm->AntDivType == CG_TRX_SMART_ANTDIV)) { + SET_TX_DESC_ANTSEL_A_88E(desc, dm_fat_tbl->antsel_a[mac_id]); + SET_TX_DESC_ANTSEL_B_88E(desc, dm_fat_tbl->antsel_b[mac_id]); + SET_TX_DESC_ANTSEL_C_88E(desc, dm_fat_tbl->antsel_c[mac_id]); } } diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c index 3494ac6..be9eede 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c @@ -336,7 +336,8 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag ptxdesc->txdw4 |= cpu_to_le32(HW_SSN); /* Hw set sequence number */ } - ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id); + rtl88eu_dm_set_tx_ant_by_tx_info(&haldata->odmpriv, pmem, +pattrib->mac_id); rtl8188eu_cal_txdesc_chksum(ptxdesc); _dbg_dump_tx_info(adapt, pxmitframe->frame_tag, ptxdesc); diff --git a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h index 7dc2698..7a10101 100644 --- a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h @@ -33,8 +33,8 @@ void rtl88eu_dm_antenna_div_init(struct odm_dm_struct *dm_odm); void ODM_AntennaDiversity_88E(struct odm_dm_struct *pDM_Odm); -void ODM_SetTxAntByTxInfo_88E(struct odm_dm_struct *pDM_Odm, u8 *pDesc, - u8 macId); +void rtl88eu_dm_set_tx_ant_by_tx_info(struct odm_dm_struct *dm_odm, u8 *desc, + u8 mac_id); void rtl88eu_dm_update_rx_idle_ant(struct odm_dm_struct *dm_odm, u8 ant); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/13] staging: rtl8188eu: Rework function odm_HWAntDiv()
Rename CamelCase function name and local variables. Remove unnecessary debugging messages. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 78 +- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 95bcc0a..4e390d9 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -272,53 +272,51 @@ void rtl88eu_dm_ant_sel_statistics(struct odm_dm_struct *dm_odm, } } -static void odm_HWAntDiv(struct odm_dm_struct *dm_odm) +static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm) { - u32 i, MinRSSI = 0xFF, AntDivMaxRSSI = 0, MaxRSSI = 0, LocalMinRSSI, LocalMaxRSSI; - u32 Main_RSSI, Aux_RSSI; - u8 RxIdleAnt = 0, TargetAnt = 7; struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; - struct rtw_dig *pDM_DigTable = &dm_odm->DM_DigTable; - struct sta_info *pEntry; + struct rtw_dig *dig_table = &dm_odm->DM_DigTable; + struct sta_info *entry; + u32 i, min_rssi = 0xFF, ant_div_max_rssi = 0, max_rssi = 0; + u32 local_min_rssi,local_max_rssi; + u32 main_rssi, aux_rssi; + u8 RxIdleAnt = 0, target_ant = 7; for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { - pEntry = dm_odm->pODM_StaInfo[i]; - if (IS_STA_VALID(pEntry)) { + entry = dm_odm->pODM_StaInfo[i]; + if (IS_STA_VALID(entry)) { /* 2 Caculate RSSI per Antenna */ - Main_RSSI = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ? (dm_fat_tbl->MainAnt_Sum[i]/dm_fat_tbl->MainAnt_Cnt[i]) : 0; - Aux_RSSI = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ? (dm_fat_tbl->AuxAnt_Sum[i]/dm_fat_tbl->AuxAnt_Cnt[i]) : 0; - TargetAnt = (Main_RSSI >= Aux_RSSI) ? MAIN_ANT : AUX_ANT; - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, -("MacID=%d, MainAnt_Sum=%d, MainAnt_Cnt=%d\n", -i, dm_fat_tbl->MainAnt_Sum[i], -dm_fat_tbl->MainAnt_Cnt[i])); - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, -("MacID=%d, AuxAnt_Sum=%d, AuxAnt_Cnt=%d\n", -i, dm_fat_tbl->AuxAnt_Sum[i], dm_fat_tbl->AuxAnt_Cnt[i])); - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, -("MacID=%d, Main_RSSI= %d, Aux_RSSI= %d\n", -i, Main_RSSI, Aux_RSSI)); - /* 2 Select MaxRSSI for DIG */ - LocalMaxRSSI = (Main_RSSI > Aux_RSSI) ? Main_RSSI : Aux_RSSI; - if ((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40)) - AntDivMaxRSSI = LocalMaxRSSI; - if (LocalMaxRSSI > MaxRSSI) - MaxRSSI = LocalMaxRSSI; + main_rssi = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ? + (dm_fat_tbl->MainAnt_Sum[i]/dm_fat_tbl->MainAnt_Cnt[i]) : 0; + aux_rssi = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ? + (dm_fat_tbl->AuxAnt_Sum[i]/dm_fat_tbl->AuxAnt_Cnt[i]) : 0; + target_ant = (main_rssi >= aux_rssi) ? MAIN_ANT : AUX_ANT; + /* 2 Select max_rssi for DIG */ + local_max_rssi = (main_rssi > aux_rssi) ? + main_rssi : aux_rssi; + if ((local_max_rssi > ant_div_max_rssi) && + (local_max_rssi < 40)) + ant_div_max_rssi = local_max_rssi; + if (local_max_rssi > max_rssi) + max_rssi = local_max_rssi; /* 2 Select RX Idle Antenna */ - if ((dm_fat_tbl->RxIdleAnt == MAIN_ANT) && (Main_RSSI == 0)) - Main_RSSI = Aux_RSSI; - else if ((dm_fat_tbl->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0)) - Aux_RSSI = Main_RSSI; - - LocalMinRSSI = (Main_RSSI > Aux_RSSI) ? Aux_RSSI : Main_RSSI; - if (LocalMinRSSI < MinRSSI) { - MinRSSI = LocalMinRSSI; - RxIdleAnt = TargetAnt; + if ((dm_fat_tbl->RxIdleAnt == MAIN_ANT) && + (main_rssi == 0)) +
[PATCH 10/13] staging: rtl8188eu: Rework function ODM_AntselStatistics_88E()
Rename CamelCase function name and local variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_HWConfig.c |2 +- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 19 ++- drivers/staging/rtl8188eu/include/odm_RTL8188E.h |4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c index dbc1368..4e4e219 100644 --- a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c @@ -315,7 +315,7 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm, if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) { antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) | (pDM_FatTable->antsel_rx_keep_1<<1) | pDM_FatTable->antsel_rx_keep_0; - ODM_AntselStatistics_88E(dm_odm, antsel_tr_mux, pPktinfo->StationID, pPhyInfo->RxPWDBAll); + rtl88eu_dm_ant_sel_statistics(dm_odm, antsel_tr_mux, pPktinfo->StationID, pPhyInfo->RxPWDBAll); } } /* Smart Antenna Debug Message-- */ diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 5a51405..95bcc0a 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -249,24 +249,25 @@ void rtl88eu_dm_set_tx_ant_by_tx_info(struct odm_dm_struct *dm_odm, } } -void ODM_AntselStatistics_88E(struct odm_dm_struct *dm_odm, u8 antsel_tr_mux, u32 MacId, u8 RxPWDBAll) +void rtl88eu_dm_ant_sel_statistics(struct odm_dm_struct *dm_odm, + u8 antsel_tr_mux, u32 mac_id, u8 rx_pwdb_all) { struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) { if (antsel_tr_mux == MAIN_ANT_CG_TRX) { - dm_fat_tbl->MainAnt_Sum[MacId] += RxPWDBAll; - dm_fat_tbl->MainAnt_Cnt[MacId]++; + dm_fat_tbl->MainAnt_Sum[mac_id] += rx_pwdb_all; + dm_fat_tbl->MainAnt_Cnt[mac_id]++; } else { - dm_fat_tbl->AuxAnt_Sum[MacId] += RxPWDBAll; - dm_fat_tbl->AuxAnt_Cnt[MacId]++; + dm_fat_tbl->AuxAnt_Sum[mac_id] += rx_pwdb_all; + dm_fat_tbl->AuxAnt_Cnt[mac_id]++; } } else if (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV) { if (antsel_tr_mux == MAIN_ANT_CGCS_RX) { - dm_fat_tbl->MainAnt_Sum[MacId] += RxPWDBAll; - dm_fat_tbl->MainAnt_Cnt[MacId]++; + dm_fat_tbl->MainAnt_Sum[mac_id] += rx_pwdb_all; + dm_fat_tbl->MainAnt_Cnt[mac_id]++; } else { - dm_fat_tbl->AuxAnt_Sum[MacId] += RxPWDBAll; - dm_fat_tbl->AuxAnt_Cnt[MacId]++; + dm_fat_tbl->AuxAnt_Sum[mac_id] += rx_pwdb_all; + dm_fat_tbl->AuxAnt_Cnt[mac_id]++; } } } diff --git a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h index 7a10101..684947f 100644 --- a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h @@ -38,8 +38,8 @@ void rtl88eu_dm_set_tx_ant_by_tx_info(struct odm_dm_struct *dm_odm, u8 *desc, void rtl88eu_dm_update_rx_idle_ant(struct odm_dm_struct *dm_odm, u8 ant); -void ODM_AntselStatistics_88E(struct odm_dm_struct *pDM_Odm, u8 antsel_tr_mux, - u32 MacId, u8 RxPWDBAll); +void rtl88eu_dm_ant_sel_statistics(struct odm_dm_struct *dm_odm, u8 antsel_tr_mux, + u32 mac_id, u8 rx_pwdb_all); void odm_FastAntTraining(struct odm_dm_struct *pDM_Odm); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/13] staging: rtl8188eu: Rework function ODM_AntennaDiversity_88E()
Rename CamelCase function name. Remove unnecessary comments. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm.c |2 +- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 31 +- drivers/staging/rtl8188eu/include/odm_RTL8188E.h |2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c index bc891e9..7da7fd7 100644 --- a/drivers/staging/rtl8188eu/hal/odm.c +++ b/drivers/staging/rtl8188eu/hal/odm.c @@ -1275,7 +1275,7 @@ void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm) return; } - ODM_AntennaDiversity_88E(pDM_Odm); + rtl88eu_dm_antenna_diversity(pDM_Odm); } /* EDCA Turbo */ diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 4e390d9..495d9ec 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -331,7 +331,7 @@ static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm) dig_table->RSSI_max = max_rssi; } -void ODM_AntennaDiversity_88E(struct odm_dm_struct *dm_odm) +void rtl88eu_dm_antenna_diversity(struct odm_dm_struct *dm_odm) { struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable; struct adapter *adapter = dm_odm->Adapter; @@ -339,28 +339,35 @@ void ODM_AntennaDiversity_88E(struct odm_dm_struct *dm_odm) if (!(dm_odm->SupportAbility & ODM_BB_ANT_DIV)) return; if (!dm_odm->bLinked) { - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_AntennaDiversity_88E(): No Link.\n")); + ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, +("ODM_AntennaDiversity_88E(): No Link.\n")); if (dm_fat_tbl->bBecomeLinked) { - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Need to Turn off HW AntDiv\n")); - phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 0); /* RegC50[7]=1'b1 enable HW AntDiv */ - phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT15, 0); /* Enable CCK AntDiv */ + ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, +("Need to Turn off HW AntDiv\n")); + phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 0); + phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA1_11N, + BIT15, 0); if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) - phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT21, 0); /* Reg80c[21]=1'b0 from TX Reg */ + phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, + BIT21, 0); dm_fat_tbl->bBecomeLinked = dm_odm->bLinked; } return; } else { if (!dm_fat_tbl->bBecomeLinked) { - ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Need to Turn on HW AntDiv\n")); - /* Because HW AntDiv is disabled before Link, we enable HW AntDiv after link */ - phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 1); /* RegC50[7]=1'b1 enable HW AntDiv */ - phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT15, 1); /* Enable CCK AntDiv */ + ODM_RT_TRACE(dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, +("Need to Turn on HW AntDiv\n")); + phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT7, 1); + phy_set_bb_reg(adapter, ODM_REG_CCK_ANTDIV_PARA1_11N, + BIT15, 1); if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) - phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT21, 1); /* Reg80c[21]=1'b1 from TX Info */ + phy_set_bb_reg(adapter, ODM_REG_TX_ANT_CTRL_11N, + BIT21, 1); dm_fat_tbl->bBecomeLinked = dm_odm->bLinked; } } - if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) + if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || + (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) rtl88eu_dm_hw_ant_div(dm_odm); } diff --git a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h index 684947f..eabef39 100644 --- a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h +
[PATCH 13/13] staging: rtl8188eu: odm.h: Remove unused struct dyn_primary_cca
struct odm_dm_struct has a member of struct dyn_primary_cca, which is initialized once and then never used by driver, so we can remove struct dyn_promary_cca and code which initialize it. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm.c |1 - drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 15 --- drivers/staging/rtl8188eu/include/odm.h |9 - drivers/staging/rtl8188eu/include/odm_RTL8188E.h |2 -- 4 files changed, 27 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c index 7da7fd7..e4df837 100644 --- a/drivers/staging/rtl8188eu/hal/odm.c +++ b/drivers/staging/rtl8188eu/hal/odm.c @@ -191,7 +191,6 @@ void ODM_DMInit(struct odm_dm_struct *pDM_Odm) odm_DIGInit(pDM_Odm); odm_RateAdaptiveMaskInit(pDM_Odm); - odm_PrimaryCCA_Init(pDM_Odm);/* Gary */ odm_DynamicTxPowerInit(pDM_Odm); odm_TXPowerTrackingInit(pDM_Odm); ODM_EdcaTurboInit(pDM_Odm); diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index 495d9ec..5342af7 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -370,18 +370,3 @@ void rtl88eu_dm_antenna_diversity(struct odm_dm_struct *dm_odm) (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) rtl88eu_dm_hw_ant_div(dm_odm); } - -/* 3 */ -/* 3 Dynamic Primary CCA */ -/* 3 */ - -void odm_PrimaryCCA_Init(struct odm_dm_struct *dm_odm) -{ - struct dyn_primary_cca *PrimaryCCA = &(dm_odm->DM_PriCCA); - - PrimaryCCA->DupRTS_flag = 0; - PrimaryCCA->intf_flag = 0; - PrimaryCCA->intf_type = 0; - PrimaryCCA->Monitor_flag = 0; - PrimaryCCA->PriCCA_flag = 0; -} diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h index e83812f..525eb10 100644 --- a/drivers/staging/rtl8188eu/include/odm.h +++ b/drivers/staging/rtl8188eu/include/odm.h @@ -164,14 +164,6 @@ struct false_alarm_stats { u32 Cnt_BW_LSC; /* Gary */ }; -struct dyn_primary_cca { - u8 PriCCA_flag; - u8 intf_flag; - u8 intf_type; - u8 DupRTS_flag; - u8 Monitor_flag; -}; - struct rx_hpc { u8 RXHP_flag; u8 PSD_func_trigger; @@ -867,7 +859,6 @@ struct odm_dm_struct { struct fast_ant_train DM_FatTable; struct rtw_dig DM_DigTable; struct rtl_ps DM_PSTable; - struct dyn_primary_cca DM_PriCCA; struct rx_hpc DM_RXHP_Table; struct false_alarm_stats FalseAlmCnt; struct false_alarm_stats FlaseAlmCntBuddyAdapter; diff --git a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h index eabef39..14dce6c 100644 --- a/drivers/staging/rtl8188eu/include/odm_RTL8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RTL8188E.h @@ -47,8 +47,6 @@ void odm_FastAntTrainingCallback(struct odm_dm_struct *pDM_Odm); void odm_FastAntTrainingWorkItemCallback(struct odm_dm_struct *pDM_Odm); -void odm_PrimaryCCA_Init(struct odm_dm_struct *pDM_Odm); - bool ODM_DynamicPrimaryCCA_DupRTS(struct odm_dm_struct *pDM_Odm); #endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: rtl8188eu: remove header file ip.h
"ip.h" is included in four files but not being used, so remove "include/ip.h" header file and inclusion of this header file. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c |1 - drivers/staging/rtl8188eu/core/rtw_xmit.c |1 - drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/ip.h | 126 drivers/staging/rtl8188eu/os_dep/xmit_linux.c |1 - 5 files changed, 130 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/ip.h diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 92fb12e..b49a246 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index aa77270..ca7a25a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 6e84f08..540c5ad 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/drivers/staging/rtl8188eu/include/ip.h b/drivers/staging/rtl8188eu/include/ip.h deleted file mode 100644 index 9fdac6d..000 --- a/drivers/staging/rtl8188eu/include/ip.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -#ifndef _LINUX_IP_H -#define _LINUX_IP_H - -/* SOL_IP socket options */ - -#define IPTOS_TOS_MASK 0x1E -#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK) -#defineIPTOS_LOWDELAY 0x10 -#defineIPTOS_THROUGHPUT0x08 -#defineIPTOS_RELIABILITY 0x04 -#defineIPTOS_MINCOST 0x02 - -#define IPTOS_PREC_MASK0xE0 -#define IPTOS_PREC(tos)((tos)&IPTOS_PREC_MASK) -#define IPTOS_PREC_NETCONTROL 0xe0 -#define IPTOS_PREC_INTERNETCONTROL 0xc0 -#define IPTOS_PREC_CRITIC_ECP 0xa0 -#define IPTOS_PREC_FLASHOVERRIDE0x80 -#define IPTOS_PREC_FLASH0x60 -#define IPTOS_PREC_IMMEDIATE0x40 -#define IPTOS_PREC_PRIORITY 0x20 -#define IPTOS_PREC_ROUTINE 0x00 - - -/* IP options */ -#define IPOPT_COPY 0x80 -#define IPOPT_CLASS_MASK 0x60 -#define IPOPT_NUMBER_MASK 0x1f - -#defineIPOPT_COPIED(o) ((o)&IPOPT_COPY) -#defineIPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK) -#defineIPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK) - -#defineIPOPT_CONTROL 0x00 -#defineIPOPT_RESERVED1 0x20 -#defineIPOPT_MEASUREMENT 0x40 -#defineIPOPT_RESERVED2 0x60 - -#define IPOPT_END (0 | IPOPT_CONTROL) -#define IPOPT_NOOP (1 | IPOPT_CONTROL) -#define IPOPT_SEC (2 | IPOPT_CONTROL | IPOPT_COPY) -#define IPOPT_LSRR (3 | IPOPT_CONTROL | IPOPT_COPY) -#define IPOPT_TIMESTAMP(4 | IPOPT_MEASUREMENT) -#define IPOPT_RR (7 | IPOPT_CONTROL) -#define IPOPT_SID (8 | IPOPT_CONTROL | IPOPT_COPY) -#define IPOPT_SSRR (9 | IPOPT_CONTROL | IPOPT_COPY) -#define IPOPT_RA (20 | IPOPT_CONTROL | IPOPT_COPY) - -#define IPVERSION 4 -#define MAXTTL 255 -#define IPDEFTTL 64 -#define IPOPT_OPTVAL 0 -#define IPOPT_OLEN 1 -#define IPOPT_OFFSET 2 -#define IPOPT_MINOFF 4 -#define MAX_IPOPTLEN 40 -#define IPOPT_NOP IPOPT_NOOP -#define IPOPT_EOL IPOPT_END -#define IPOPT_TS IPOPT_TIMESTAMP - -#defineIPOPT_TS_TSONLY 0 /* timestamps only */ -#defineIPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ -#defineIPOPT_TS_PRESPEC3
[PATCH 1/3] staging: rtl8188eu: remove header file if_ether.h
"if_ether.h" is included in three files but not being used, so remove "include/if_ether.h" header file and inclusion of this header file. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c |1 - drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/if_ether.h | 111 drivers/staging/rtl8188eu/os_dep/xmit_linux.c |1 - 4 files changed, 114 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/if_ether.h diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 8490d51..92fb12e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 17c94f4..6e84f08 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/drivers/staging/rtl8188eu/include/if_ether.h b/drivers/staging/rtl8188eu/include/if_ether.h deleted file mode 100644 index db15771..000 --- a/drivers/staging/rtl8188eu/include/if_ether.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ - -#ifndef _LINUX_IF_ETHER_H -#define _LINUX_IF_ETHER_H - -/* - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble - * and FCS/CRC (frame check sequence). - */ - -#define ETH_ALEN 6 /* Octets in one ethernet addr */ -#define ETH_HLEN 14 /* Total octets in header. */ -#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ -#define ETH_DATA_LEN 1500/* Max. octets in payload*/ -#define ETH_FRAME_LEN 1514/* Max. octets in frame sans FCS */ - -/* - * These are the defined Ethernet Protocol ID's. - */ - -#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */ -#define ETH_P_PUP 0x0200 /* Xerox PUP packet */ -#define ETH_P_PUPAT0x0201 /* Xerox PUP Addr Trans packet */ -#define ETH_P_IP 0x0800 /* Internet Protocol packet */ -#define ETH_P_X25 0x0805 /* CCITT X.25 */ -#define ETH_P_ARP 0x0806 /* Address Resolution packet*/ -#defineETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet */ -#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ -#define ETH_P_IEEEPUPAT0x0a01 /* Xerox IEEE802.3 PUP */ -#define ETH_P_DEC 0x6000 /* DEC Assigned proto */ -#define ETH_P_DNA_DL0x6001 /* DEC DNA Dump/Load*/ -#define ETH_P_DNA_RC0x6002 /* DEC DNA Remote Console */ -#define ETH_P_DNA_RT0x6003 /* DEC DNA Routing */ -#define ETH_P_LAT 0x6004 /* DEC LAT */ -#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ -#define ETH_P_CUST 0x6006 /* DEC Customer use */ -#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ -#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ -#define ETH_P_ATALK0x809B /* Appletalk DDP*/ -#define ETH_P_AARP 0x80F3 /* Appletalk AARP */ -#define ETH_P_8021Q0x8100 /* 802.1Q VLAN Extended Header */ -#define ETH_P_IPX 0x8137 /* IPX over DIX */ -#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ -#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ -#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ -#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ -#define ETH_P_ATMFATE 0x888
[PATCH 3/3] staging: rtl8188eu: remove header file ethernet.h
"ethernet.h" is included in three files but only "rtw_recv.c" using two macros defined in "ethernet.h", so move used macros in "rtw_recv.c" and remove "include/ethernet.h" header file and inclusion of this header file. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c |4 ++- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/ethernet.h | 42 drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 4 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/ethernet.h diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index b49a246..b9d86cd 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -23,10 +23,12 @@ #include #include #include -#include #include #include +#define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ +#define LLC_HEADER_SIZE6 /* LLC Header Length */ + static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37}; static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3}; diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 540c5ad..b1b1584 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/drivers/staging/rtl8188eu/include/ethernet.h b/drivers/staging/rtl8188eu/include/ethernet.h deleted file mode 100644 index a59f912..000 --- a/drivers/staging/rtl8188eu/include/ethernet.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -/*! \file */ -#ifndef __INC_ETHERNET_H -#define __INC_ETHERNET_H - -#define ETHERNET_ADDRESS_LENGTH6 /* Ethernet Address Length */ -#define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ -#define LLC_HEADER_SIZE6 /* LLC Header Length */ -#define TYPE_LENGTH_FIELD_SIZE 2 /* Type/Length Size */ -#define MINIMUM_ETHERNET_PACKET_SIZE 60 /* Min Ethernet Packet Size */ -#define MAXIMUM_ETHERNET_PACKET_SIZE 1514/* Max Ethernet Packet Size */ - -/* Is Multicast Address? */ -#define RT_ETH_IS_MULTICAST(_addr) u8 *)(_addr))[0]&0x01) != 0) -#define RT_ETH_IS_BROADCAST(_addr) ( \ - ((u8 *)(_addr))[0] == 0xff && \ - ((u8 *)(_addr))[1] == 0xff && \ - ((u8 *)(_addr))[2] == 0xff && \ - ((u8 *)(_addr))[3] == 0xff && \ - ((u8 *)(_addr))[4] == 0xff && \ - ((u8 *)(_addr))[5] == 0xff) /* Is Broadcast Address? */ - - -#endif /* #ifndef __INC_ETHERNET_H */ diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 2a18b32..b4f44f2 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -26,7 +26,6 @@ #include #include -#include #include /* init os related resource in struct recv_priv */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: rtl8188eu: remove header file ethernet.h
"ethernet.h" is included in three files but only "rtw_recv.c" using two macros defined in "ethernet.h", so move used macros in "rtw_recv.c" and remove "include/ethernet.h" header file and inclusion of this header file. v2: First version of this patch failed to apply. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c |4 ++- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/ethernet.h | 42 drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 4 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/ethernet.h diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index c8491f6..4de98b6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -23,11 +23,13 @@ #include #include #include -#include #include #include #include +#define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ +#define LLC_HEADER_SIZE6 /* LLC Header Length */ + static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37}; static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3}; diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 540c5ad..b1b1584 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/drivers/staging/rtl8188eu/include/ethernet.h b/drivers/staging/rtl8188eu/include/ethernet.h deleted file mode 100644 index a59f912..000 --- a/drivers/staging/rtl8188eu/include/ethernet.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -/*! \file */ -#ifndef __INC_ETHERNET_H -#define __INC_ETHERNET_H - -#define ETHERNET_ADDRESS_LENGTH6 /* Ethernet Address Length */ -#define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ -#define LLC_HEADER_SIZE6 /* LLC Header Length */ -#define TYPE_LENGTH_FIELD_SIZE 2 /* Type/Length Size */ -#define MINIMUM_ETHERNET_PACKET_SIZE 60 /* Min Ethernet Packet Size */ -#define MAXIMUM_ETHERNET_PACKET_SIZE 1514/* Max Ethernet Packet Size */ - -/* Is Multicast Address? */ -#define RT_ETH_IS_MULTICAST(_addr) u8 *)(_addr))[0]&0x01) != 0) -#define RT_ETH_IS_BROADCAST(_addr) ( \ - ((u8 *)(_addr))[0] == 0xff && \ - ((u8 *)(_addr))[1] == 0xff && \ - ((u8 *)(_addr))[2] == 0xff && \ - ((u8 *)(_addr))[3] == 0xff && \ - ((u8 *)(_addr))[4] == 0xff && \ - ((u8 *)(_addr))[5] == 0xff) /* Is Broadcast Address? */ - - -#endif /* #ifndef __INC_ETHERNET_H */ diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index fd8ca60..3eff225 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -26,7 +26,6 @@ #include #include -#include #include /* init os related resource in struct recv_priv */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: rtl8188eu: remove header file ethernet.h
I've submitted second version of this patch. regards, --navin-patidar On Wed, Feb 12, 2014 at 2:03 AM, Greg KH wrote: > On Sun, Feb 09, 2014 at 02:10:46PM +0530, navin patidar wrote: >> "ethernet.h" is included in three files but only "rtw_recv.c" using two >> macros >> defined in "ethernet.h", so move used macros in "rtw_recv.c" and >> remove "include/ethernet.h" header file and inclusion of this header file. >> >> Signed-off-by: navin patidar >> --- >> drivers/staging/rtl8188eu/core/rtw_recv.c |4 ++- >> drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - >> drivers/staging/rtl8188eu/include/ethernet.h | 42 >> >> drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - >> 4 files changed, 3 insertions(+), 45 deletions(-) >> delete mode 100644 drivers/staging/rtl8188eu/include/ethernet.h > > This patch fails to apply (2/3 had fuzz, but I fixed that up), can you > redo this against linux-next and resend it? > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: remove unused header files
Remove h2clbk.h and nic_spec.h header files. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/h2clbk.h | 35 drivers/staging/rtl8188eu/include/nic_spec.h | 44 -- 2 files changed, 79 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/h2clbk.h delete mode 100644 drivers/staging/rtl8188eu/include/nic_spec.h diff --git a/drivers/staging/rtl8188eu/include/h2clbk.h b/drivers/staging/rtl8188eu/include/h2clbk.h deleted file mode 100644 index e595030..000 --- a/drivers/staging/rtl8188eu/include/h2clbk.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ - - -#define _H2CLBK_H_ - - -#include -#include - - -void _lbk_cmd(struct adapter *adapter); - -void _lbk_rsp(struct adapter *adapter); - -void _lbk_evt(IN struct adapter *adapter); - -void h2c_event_callback(unsigned char *dev, unsigned char *pbuf); diff --git a/drivers/staging/rtl8188eu/include/nic_spec.h b/drivers/staging/rtl8188eu/include/nic_spec.h deleted file mode 100644 index d422447..000 --- a/drivers/staging/rtl8188eu/include/nic_spec.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ - - -#ifndef __NIC_SPEC_H__ -#define __NIC_SPEC_H__ - -#define RTL8711_MCTRL_ (0x2) -#define RTL8711_UART_ (0x3) -#define RTL8711_TIMER_ (0x4) -#define RTL8711_FINT_ (0x5) -#define RTL8711_HINT_ (0x5) -#define RTL8711_GPIO_ (0x6) -#define RTL8711_WLANCTRL_ (0x20) -#define RTL8711_WLANFF_(0xe0) -#define RTL8711_HCICTRL_ (0x60) -#define RTL8711_SYSCFG_(0x62) -#define RTL8711_SYSCTRL_ (0x62) -#define RTL8711_MCCTRL_(0x02) - - -#include - -#include - - -#endif /* __RTL8711_SPEC_H__ */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/10] staging: rtl8188eu: Refactor and cleanup led related code.
From: navin patidar This patch series refactors and performs various cleanups on the driver's code responsible for led functionality. navin patidar (10): staging: rtl8188eu: Remove empty header file staging: rtl8188eu: Remove rtw_led_blink_cmd() function. staging: rtl8188eu: Remove _ReadLEDSetting() function. staging: rtl8188eu: Remove _InitHWLed() function. staging: rtl8188eu: Simplify led blinking strategy code. staging: rtl8188eu: Remove enum LED_STRATEGY_871x . staging: rtl8188eu: refactor led related structures. staging: rtl8188eu: Remove unused macros. staging: rtl8188eu: Remove unused enum LED_STATE_871x members. staging: rtl8188eu: Remove unused enum LED_CTL_MODE members. drivers/staging/rtl8188eu/core/rtw_cmd.c | 35 - drivers/staging/rtl8188eu/core/rtw_led.c | 1415 ++-- drivers/staging/rtl8188eu/hal/rtl8188eu_led.c | 43 +- drivers/staging/rtl8188eu/hal/usb_halinit.c| 26 - drivers/staging/rtl8188eu/include/drv_types.h |1 - .../staging/rtl8188eu/include/drv_types_linux.h| 24 - drivers/staging/rtl8188eu/include/rtw_cmd.h|1 - drivers/staging/rtl8188eu/include/rtw_led.h| 119 +- 8 files changed, 137 insertions(+), 1527 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/drv_types_linux.h -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/10] staging: rtl8188eu: Remove empty header file
drv_types_linux.h is empty, so remove the header file and its reference. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/drv_types.h |1 - .../staging/rtl8188eu/include/drv_types_linux.h| 24 2 files changed, 25 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/drv_types_linux.h diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index 936c196..10cc1a1 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/drivers/staging/rtl8188eu/include/drv_types_linux.h b/drivers/staging/rtl8188eu/include/drv_types_linux.h deleted file mode 100644 index 812b744..000 --- a/drivers/staging/rtl8188eu/include/drv_types_linux.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -#ifndef __DRV_TYPES_LINUX_H__ -#define __DRV_TYPES_LINUX_H__ - - -#endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/10] staging: rtl8188eu: Remove rtw_led_blink_cmd() function.
rtw_led_blink_cmd() isn't being used by driver. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 35 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 36 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index c2fb050..1e0b8b4 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1431,41 +1431,6 @@ exit: return res; } -u8 rtw_led_blink_cmd(struct adapter *padapter, struct LED_871x *pLed) -{ - struct cmd_obj *pcmdobj; - struct LedBlink_param *ledBlink_param; - struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - - u8 res = _SUCCESS; - - - RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_led_blink_cmd\n")); - - pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmdobj == NULL) { - res = _FAIL; - goto exit; - } - - ledBlink_param = (structLedBlink_param *)rtw_zmalloc(sizeof(struct LedBlink_param)); - if (ledBlink_param == NULL) { - kfree(pcmdobj); - res = _FAIL; - goto exit; - } - - ledBlink_param->pLed = pLed; - - init_h2fwcmd_w_parm_no_rsp(pcmdobj, ledBlink_param, GEN_CMD_CODE(_LedBlink)); - res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); - -exit: - - - return res; -} - u8 rtw_set_csa_cmd(struct adapter *padapter, u8 new_ch_no) { struct cmd_obj *pcmdobj; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 3d34702..66467f7 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -807,7 +807,6 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); u8 rtw_set_ch_cmd(struct adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue); u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue); -u8 rtw_led_blink_cmd(struct adapter *padapter, struct LED_871x *pLed); u8 rtw_set_csa_cmd(struct adapter *padapter, u8 new_ch_no); u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/10] staging: rtl8188eu: Simplify led blinking strategy code.
driver has code to blink the led in 7 different ways. struct led_priv contains an enum LED_STRATEGY_871x variable which is initialized to SW_LED_MODE1 inside rtl8188eu_InitSwLeds() function. it means driver is hard coded to use only SW_LED_MODE1 blinking strategy. so we can remove the code related to other blinking strategies e.g. SW_LED_MODE[0|2|3|4|5|6]. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_led.c | 1412 +++--- 1 file changed, 101 insertions(+), 1311 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c index 42b41ab..c42e176 100644 --- a/drivers/staging/rtl8188eu/core/rtw_led.c +++ b/drivers/staging/rtl8188eu/core/rtw_led.c @@ -40,7 +40,6 @@ void BlinkTimerCallback(void *data) /* */ /* Description: */ /* Callback function of LED BlinkWorkItem. */ -/* We dispatch acture LED blink action according to LedStrategy. */ /* */ void BlinkWorkItemCallback(struct work_struct *work) { @@ -101,87 +100,6 @@ void DeInitLed871x(struct LED_871x *pLed) /* It toggle off LED and schedule corresponding timer if necessary. */ /* */ -static void SwLedBlink(struct LED_871x *pLed) -{ - struct adapter *padapter = pLed->padapter; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - u8 bStopBlinking = false; - - /* Change LED according to BlinkingLedState specified. */ - if (pLed->BlinkingLedState == RTW_LED_ON) { - SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); - } else { - SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); - } - - /* Determine if we shall change LED state again. */ - pLed->BlinkTimes--; - switch (pLed->CurrLedState) { - case LED_BLINK_NORMAL: - if (pLed->BlinkTimes == 0) - bStopBlinking = true; - break; - case LED_BLINK_StartToBlink: - if (check_fwstate(pmlmepriv, _FW_LINKED) && check_fwstate(pmlmepriv, WIFI_STATION_STATE)) - bStopBlinking = true; - if (check_fwstate(pmlmepriv, _FW_LINKED) && - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || - check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) - bStopBlinking = true; - else if (pLed->BlinkTimes == 0) - bStopBlinking = true; - break; - case LED_BLINK_WPS: - if (pLed->BlinkTimes == 0) - bStopBlinking = true; - break; - default: - bStopBlinking = true; - break; - } - - if (bStopBlinking) { - /* if (padapter->pwrctrlpriv.cpwm >= PS_STATE_S2) */ - if (0) { - SwLedOff(padapter, pLed); - } else if ((check_fwstate(pmlmepriv, _FW_LINKED)) && (!pLed->bLedOn)) { - SwLedOn(padapter, pLed); - } else if ((check_fwstate(pmlmepriv, _FW_LINKED)) && pLed->bLedOn) { - SwLedOff(padapter, pLed); - } - pLed->BlinkTimes = 0; - pLed->bLedBlinkInProgress = false; - } else { - /* Assign LED state to toggle. */ - if (pLed->BlinkingLedState == RTW_LED_ON) - pLed->BlinkingLedState = RTW_LED_OFF; - else - pLed->BlinkingLedState = RTW_LED_ON; - - /* Schedule a timer to toggle LED state. */ - switch (pLed->CurrLedState) { - case LED_BLINK_NORMAL: - _set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL); - break; - case LED_BLINK_SLOWLY: - case LED_BLINK_StartToBlink: - _set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL); - break; - case LED_BLINK_WPS: - if (pLed->BlinkingLedState == RTW_LED_ON) - _set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL); - else - _set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL); - break; - default: - _set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL); - break; - } - } -} - static void SwLedBlink1(struct LED_871x *pLed) { struct adapter *padapter = pLed->padapter; @@ -277,1051 +1
[PATCH 03/10] staging: rtl8188eu: Remove _ReadLEDSetting() function.
_ReadLEDSetting() doesn't read led settings this function actually initialize member variables of struct led_priv, we should do that inside rtl8188eu_InitSwLeds(). Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_led.c |4 drivers/staging/rtl8188eu/hal/usb_halinit.c | 12 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c index 08dfd94..01eeb70 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c @@ -92,8 +92,12 @@ exit: void rtl8188eu_InitSwLeds(struct adapter *padapter) { struct led_priv *pledpriv = &(padapter->ledpriv); + struct hal_data_8188e *haldata = GET_HAL_DATA(padapter); + pledpriv->bRegUseLed = true; + pledpriv->LedStrategy = SW_LED_MODE1; pledpriv->LedControlHandler = LedControl8188eu; + haldata->bLedOpenDrain = true; InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0); diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index c92067f..0dfd62b 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -1129,16 +1129,6 @@ static unsigned int rtl8188eu_inirp_deinit(struct adapter *Adapter) /* EEPROM/EFUSE Content Parsing */ /* */ /* */ -static void _ReadLEDSetting(struct adapter *Adapter, u8 *PROMContent, bool AutoloadFail) -{ - struct led_priv *pledpriv = &(Adapter->ledpriv); - struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter); - - pledpriv->bRegUseLed = true; - pledpriv->LedStrategy = SW_LED_MODE1; - haldata->bLedOpenDrain = true;/* Support Open-drain arrangement for controlling the LED. */ -} - static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail) { struct hal_data_8188e *haldata = GET_HAL_DATA(adapt); @@ -1215,8 +1205,6 @@ readAdapterInfo_8188EU( /* */ Hal_InitChannelPlan(adapt); Hal_CustomizeByCustomerID_8188EU(adapt); - - _ReadLEDSetting(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag); } static void _ReadPROMContent( -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/10] staging: rtl8188eu: Remove _InitHWLed() function.
_InitHWLed() function does nothing. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 0dfd62b..617e4c6 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -424,18 +424,6 @@ static void _InitBeaconMaxError(struct adapter *Adapter, bool InfraMode) { } -static void _InitHWLed(struct adapter *Adapter) -{ - struct led_priv *pledpriv = &(Adapter->ledpriv); - - if (pledpriv->LedStrategy != HW_LED) - return; - -/* HW led control */ -/* to do */ -/* must consider cases of antenna diversity/ commbo card/solo card/mini card */ -} - static void _InitRDGSetting(struct adapter *Adapter) { rtw_write8(Adapter, REG_RD_CTRL, 0xFF); @@ -870,8 +858,6 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter) rtw_write16(Adapter, REG_PKT_VO_VI_LIFE_TIME, 0x0400); /* unit: 256us. 256ms */ rtw_write16(Adapter, REG_PKT_BE_BK_LIFE_TIME, 0x0400); /* unit: 256us. 256ms */ - _InitHWLed(Adapter); - /* Keep RfRegChnlVal for later use. */ haldata->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (enum rf_radio_path)0, RF_CHNLBW, bRFRegOffsetMask); haldata->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (enum rf_radio_path)1, RF_CHNLBW, bRFRegOffsetMask); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/10] staging: rtl8188eu: Remove enum LED_STRATEGY_871x .
Now driver has only one type of led blinking strategy, so we don't need enum LED_STRATEGY_871x variable to store led blinking strategy type. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_led.c |1 - drivers/staging/rtl8188eu/include/rtw_led.h | 18 -- 2 files changed, 19 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c index 01eeb70..e3c86f7 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c @@ -95,7 +95,6 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter) struct hal_data_8188e *haldata = GET_HAL_DATA(padapter); pledpriv->bRegUseLed = true; - pledpriv->LedStrategy = SW_LED_MODE1; pledpriv->LedControlHandler = LedControl8188eu; haldata->bLedOpenDrain = true; diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h index 0da4e27..690c82a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_led.h +++ b/drivers/staging/rtl8188eu/include/rtw_led.h @@ -143,30 +143,12 @@ struct LED_871x { (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress || \ ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress) -/* LED customization. */ - -enum LED_STRATEGY_871x { - SW_LED_MODE0 = 0, /* SW control 1 LED via GPIO0. It is default option.*/ - SW_LED_MODE1 = 1, /* 2 LEDs, through LED0 and LED1. For ALPHA. */ - SW_LED_MODE2 = 2, /* SW control 1 LED via GPIO0, customized for AzWave - * 8187 minicard. */ - SW_LED_MODE3 = 3, /* SW control 1 LED via GPIO0, customized for Sercomm - * Printer Server case. */ - SW_LED_MODE4 = 4, /* for Edimax / Belkin */ - SW_LED_MODE5 = 5, /* for Sercomm / Belkin */ - SW_LED_MODE6 = 6, /* for 88CU minicard, porting from ce SW_LED_MODE7 */ - HW_LED = 50, /* HW control 2 LEDs, LED0 and LED1 (there are 4 - * different control modes, see MAC.CONFIG1 for details.)*/ - LED_ST_NONE = 99, -}; - void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction); struct led_priv{ /* add for led control */ struct LED_871x SwLed0; struct LED_871x SwLed1; - enum LED_STRATEGY_871x LedStrategy; u8 bRegUseLed; void (*LedControlHandler)(struct adapter *padapter, enum LED_CTL_MODE LedAction); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/10] staging: rtl8188eu: refactor led related structures.
struct led_priv contains two variables SwLed0 and SwLed1 but only SwLed0 is being used by SwLedControlModel1() function. SwLedControlModel1() function performs led operations. This patch removes SwLed1 and code which uses SwLed1. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_led.c |3 +- drivers/staging/rtl8188eu/hal/rtl8188eu_led.c | 40 ++--- drivers/staging/rtl8188eu/include/rtw_led.h | 14 + 3 files changed, 11 insertions(+), 46 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c index c42e176..87d6f06 100644 --- a/drivers/staging/rtl8188eu/core/rtw_led.c +++ b/drivers/staging/rtl8188eu/core/rtw_led.c @@ -70,10 +70,9 @@ void ResetLedStatus(struct LED_871x *pLed) /*Description: */ /* Initialize an LED_871x object. */ -void InitLed871x(struct adapter *padapter, struct LED_871x *pLed, enum LED_PIN_871x LedPin) +void InitLed871x(struct adapter *padapter, struct LED_871x *pLed) { pLed->padapter = padapter; - pLed->LedPin = LedPin; ResetLedStatus(pLed); diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c index e3c86f7..77dce58 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c @@ -35,16 +35,7 @@ void SwLedOn(struct adapter *padapter, struct LED_871x *pLed) if (padapter->bSurpriseRemoved || padapter->bDriverStopped) return; LedCfg = rtw_read8(padapter, REG_LEDCFG2); - switch (pLed->LedPin) { - case LED_PIN_LED0: - rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); /* SW control led0 on. */ - break; - case LED_PIN_LED1: - rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x0f)|BIT5); /* SW control led1 on. */ - break; - default: - break; - } + rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); /* SW control led0 on. */ pLed->bLedOn = true; } @@ -60,25 +51,15 @@ void SwLedOff(struct adapter *padapter, struct LED_871x *pLed) LedCfg = rtw_read8(padapter, REG_LEDCFG2);/* 0x4E */ - switch (pLed->LedPin) { - case LED_PIN_LED0: - if (pHalData->bLedOpenDrain) { + if (pHalData->bLedOpenDrain) { /* Open-drain arrangement for controlling the LED) */ - LedCfg &= 0x90; /* Set to software control. */ - rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3)); - LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG); - LedCfg &= 0xFE; - rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg); - } else { - rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6)); - } - break; - case LED_PIN_LED1: - LedCfg &= 0x0f; /* Set to software control. */ + LedCfg &= 0x90; /* Set to software control. */ rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3)); - break; - default: - break; + LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG); + LedCfg &= 0xFE; + rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg); + } else { + rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6)); } exit: pLed->bLedOn = false; @@ -98,9 +79,7 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter) pledpriv->LedControlHandler = LedControl8188eu; haldata->bLedOpenDrain = true; - InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0); - - InitLed871x(padapter, &(pledpriv->SwLed1), LED_PIN_LED1); + InitLed871x(padapter, &(pledpriv->SwLed0)); } /* Description: */ @@ -110,5 +89,4 @@ void rtl8188eu_DeInitSwLeds(struct adapter *padapter) struct led_priv *ledpriv = &(padapter->ledpriv); DeInitLed871x(&(ledpriv->SwLed0)); - DeInitLed871x(&(ledpriv->SwLed1)); } diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h index 690c82a..ed1c687 100644 --- a/drivers/staging/rtl8188eu/include/rtw_led.h +++ b/drivers/staging/rtl8188eu/include/rtw_led.h @@ -96,19 +96,9 @@ enum LED_STATE_871x { LED_BLINK_ALWAYS_ON = 16, }; -enum LED_PIN_871x { - LED_PIN_NULL = 0, - LED_PIN_LED0 = 1, - LED_PIN_LED1 = 2, - LED_PIN_LED2 = 3, - LED_PIN_GPIO0 = 4, -}; - struct LED_871x { struct adapter *padapter; - enum LED_PIN_871x LedPin; /* Identify how to implement this -* SW led. */ enum LED_STATE_871x CurrLed
[PATCH 09/10] staging: rtl8188eu: Remove unused enum LED_STATE_871x members.
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/rtw_led.h | 30 +-- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h index 2f81fab..2ad7e4a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_led.h +++ b/drivers/staging/rtl8188eu/include/rtw_led.h @@ -47,26 +47,16 @@ enum LED_CTL_MODE { }; enum LED_STATE_871x { - LED_UNKNOWN = 0, - RTW_LED_ON = 1, - RTW_LED_OFF = 2, - LED_BLINK_NORMAL = 3, - LED_BLINK_SLOWLY = 4, - LED_BLINK_POWER_ON = 5, - LED_BLINK_SCAN = 6, /* LED is blinking during scanning period, -* the # of times to blink is depend on time -* for scanning. */ - LED_BLINK_NO_LINK = 7, /* LED is blinking during no link state. */ - LED_BLINK_StartToBlink = 8,/* Customzied for Sercomm Printer - * Server case */ - LED_BLINK_TXRX = 9, - LED_BLINK_WPS = 10, /* LED is blinkg during WPS communication */ - LED_BLINK_WPS_STOP = 11,/* for ALPHA */ - LED_BLINK_WPS_STOP_OVERLAP = 12,/* for BELKIN */ - LED_BLINK_RUNTOP = 13, /* Customized for RunTop */ - LED_BLINK_CAMEO = 14, - LED_BLINK_XAVI = 15, - LED_BLINK_ALWAYS_ON = 16, + LED_UNKNOWN, + RTW_LED_ON, + RTW_LED_OFF, + LED_BLINK_NORMAL, + LED_BLINK_SLOWLY, + LED_BLINK_POWER_ON, + LED_BLINK_SCAN, + LED_BLINK_TXRX, + LED_BLINK_WPS, + LED_BLINK_WPS_STOP }; struct LED_871x { -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/10] staging: rtl8188eu: Remove unused macros.
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/rtw_led.h | 31 --- 1 file changed, 31 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h index ed1c687..2f81fab 100644 --- a/drivers/staging/rtl8188eu/include/rtw_led.h +++ b/drivers/staging/rtl8188eu/include/rtw_led.h @@ -23,39 +23,12 @@ #include #include -#define MSECS(t)(HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) - -#define LED_BLINK_NORMAL_INTERVAL 100 -#define LED_BLINK_SLOWLY_INTERVAL 200 -#define LED_BLINK_LONG_INTERVAL400 - #define LED_BLINK_NO_LINK_INTERVAL_ALPHA 1000 #define LED_BLINK_LINK_INTERVAL_ALPHA 500 /* 500 */ #define LED_BLINK_SCAN_INTERVAL_ALPHA 180 /* 150 */ #define LED_BLINK_FASTER_INTERVAL_ALPHA50 #define LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA5000 -#define LED_BLINK_NORMAL_INTERVAL_NETTRONIX100 -#define LED_BLINK_SLOWLY_INTERVAL_NETTRONIX2000 - -#define LED_BLINK_SLOWLY_INTERVAL_PORNET 1000 -#define LED_BLINK_NORMAL_INTERVAL_PORNET 100 - -#define LED_BLINK_FAST_INTERVAL_BITLAND30 - -/* 060403, rcnjko: Customized for AzWave. */ -#define LED_CM2_BLINK_ON_INTERVAL 250 -#define LED_CM2_BLINK_OFF_INTERVAL 4750 - -#define LED_CM8_BLINK_INTERVAL 500 /* for QMI */ -#define LED_CM8_BLINK_OFF_INTERVAL 3750/* for QMI */ - -/* 080124, lanhsin: Customized for RunTop */ -#define LED_RunTop_BLINK_INTERVAL 300 - -/* 060421, rcnjko: Customized for Sercomm Printer Server case. */ -#define LED_CM3_BLINK_INTERVAL 1500 - enum LED_CTL_MODE { LED_CTL_POWER_ON = 1, LED_CTL_LINK = 2, @@ -129,10 +102,6 @@ struct LED_871x { ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP || \ ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress) -#define IS_LED_BLINKING(_LED_871x) \ - (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress || \ - ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress) - void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction); struct led_priv{ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/10] staging: rtl8188eu: Remove unused enum LED_CTL_MODE members.
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/rtw_led.h | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h index 2ad7e4a..c5194b6 100644 --- a/drivers/staging/rtl8188eu/include/rtw_led.h +++ b/drivers/staging/rtl8188eu/include/rtw_led.h @@ -30,20 +30,18 @@ #define LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA5000 enum LED_CTL_MODE { - LED_CTL_POWER_ON = 1, - LED_CTL_LINK = 2, - LED_CTL_NO_LINK = 3, - LED_CTL_TX = 4, - LED_CTL_RX = 5, - LED_CTL_SITE_SURVEY = 6, - LED_CTL_POWER_OFF = 7, - LED_CTL_START_TO_LINK = 8, - LED_CTL_START_WPS = 9, - LED_CTL_STOP_WPS = 10, - LED_CTL_START_WPS_BOTTON = 11, /* added for runtop */ - LED_CTL_STOP_WPS_FAIL = 12, /* added for ALPHA */ - LED_CTL_STOP_WPS_FAIL_OVERLAP = 13, /* added for BELKIN */ - LED_CTL_CONNECTION_NO_TRANSFER = 14, + LED_CTL_POWER_ON, + LED_CTL_LINK, + LED_CTL_NO_LINK, + LED_CTL_TX, + LED_CTL_RX , + LED_CTL_SITE_SURVEY, + LED_CTL_POWER_OFF, + LED_CTL_START_TO_LINK, + LED_CTL_START_WPS, + LED_CTL_STOP_WPS, + LED_CTL_START_WPS_BOTTON, + LED_CTL_STOP_WPS_FAIL }; enum LED_STATE_871x { -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/10] staging: rtl8188eu: Remove _ReadLEDSetting() function.
Hi dan it's just a cleanup patch and i also tested all patches of this patch series on the hardware (TP-LINK TL-WN723N). my mistake i should have added "Tested-by" tag for all patches. Tested-by: navin patidar regards, --navin-patidar On Tue, Apr 22, 2014 at 3:41 PM, Dan Carpenter wrote: > On Sun, Apr 20, 2014 at 02:17:11PM +0530, navin patidar wrote: >> _ReadLEDSetting() doesn't read led settings this function actually >> initialize member variables of struct led_priv, we should do that >> inside rtl8188eu_InitSwLeds(). >> > > This seems like a bugfix or is it just a cleanup? It's not clear to me > from the patch description. Have you tested this patch? > > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/10] staging: rtl8188eu: Remove unused enum LED_STATE_871x members.
dan, It is ok to rearrange and remove members of enum LED_STATE_871x and enum LED_CTL_MODE. these enum are not related to firmware . regards, --navin-patidar On Tue, Apr 22, 2014 at 4:05 PM, Dan Carpenter wrote: > It's ok to renumber all of these? It's not something the firmware will > care about? Have you tested this? Same for patch 10/10. > > (These questions are just questions. I don't ask rhetorical questions > on email. I don't know the answers). > > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/10] staging: rtl8188eu: Remove _ReadLEDSetting() function.
On Tue, Apr 22, 2014 at 7:58 PM, Larry Finger wrote: > > To me, the opposite case is true. If you have not tested, then you need to > explicitly state "compile tested only" in the commit message. Without saying > that, your signed-off-by is implying that you have tested, as well as > declaring that you own the copyright to the material. I didn't know that signed-off-by implies both tested and authored. thanks for clearing that up. regards, --navin-patidar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: Use USB subsystem functions to check endpoint type
Use inline functions provided by USB subsystem to check endpoint type, instead of macros implemented by driver to do the same. Unnecessary debugging messages are also removed. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 92 --- 1 file changed, 14 insertions(+), 78 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c index 49a4ce4..2960602 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c @@ -80,46 +80,6 @@ static struct rtw_usb_drv rtl8188e_usb_drv = { static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv; -static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN; -} - -static inline int RT_usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT; -} - -static inline int RT_usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT; -} - -static inline int RT_usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK; -} - -static inline int RT_usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) -{ - return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_in(epd); -} - -static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd) -{ - return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_out(epd); -} - -static inline int usb_endpoint_is_int(const struct usb_endpoint_descriptor *epd) -{ - return RT_usb_endpoint_xfer_int(epd) && RT_usb_endpoint_dir_in(epd); -} - -static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor *epd) -{ - return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; -} - static u8 rtw_init_intf_priv(struct dvobj_priv *dvobj) { u8 rst = _SUCCESS; @@ -183,60 +143,36 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf) pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints; for (i = 0; i < pdvobjpriv->nr_endpoint; i++) { + + int ep_num; phost_endp = phost_iface->endpoint + i; + if (phost_endp) { pendp_desc = &phost_endp->desc; + ep_num = usb_endpoint_num(pendp_desc); - DBG_88E("\nusb_endpoint_descriptor(%d):\n", i); - DBG_88E("bLength=%x\n", pendp_desc->bLength); - DBG_88E("bDescriptorType=%x\n", - pendp_desc->bDescriptorType); - DBG_88E("bEndpointAddress=%x\n", - pendp_desc->bEndpointAddress); - DBG_88E("wMaxPacketSize=%d\n", - le16_to_cpu(pendp_desc->wMaxPacketSize)); - DBG_88E("bInterval=%x\n", pendp_desc->bInterval); - - if (RT_usb_endpoint_is_bulk_in(pendp_desc)) { - DBG_88E("RT_usb_endpoint_is_bulk_in = %x\n", - RT_usb_endpoint_num(pendp_desc)); - pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = RT_usb_endpoint_num(pendp_desc); + if (usb_endpoint_is_bulk_in(pendp_desc)) { + pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num; pdvobjpriv->RtNumInPipes++; - } else if (usb_endpoint_is_int(pendp_desc)) { - DBG_88E("usb_endpoint_is_int = %x, Interval = %x\n", - RT_usb_endpoint_num(pendp_desc), - pendp_desc->bInterval); - pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = RT_usb_endpoint_num(pendp_desc); + } else if (usb_endpoint_is_int_in(pendp_desc)) { + pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num; pdvobjpriv->RtNumInPipes++; - } else if (RT_usb_endpoint_is_bulk_out(pendp_desc)) { - DBG_88E("RT_usb_endpoint_is_bulk_out = %x\n", - RT_usb_endpoint_num(pendp_desc)); - pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = RT_usb_endpoint_num(pendp_de
[PATCH] staging: rtl8187se: Remove pt_regs * irq handler parameter
struct pt_regs pointer is no longer passed as a irq handler argument. Signed-off-by: navin patidar --- drivers/staging/rtl8187se/r8180_core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index ca69155..d722bed 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -197,7 +197,7 @@ inline void force_pci_posting(struct net_device *dev) mb(); } -irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs); +static irqreturn_t rtl8180_interrupt(int irq, void *netdev); void set_nic_rxring(struct net_device *dev); void set_nic_txring(struct net_device *dev); static struct net_device_stats *rtl8180_stats(struct net_device *dev); @@ -3537,7 +3537,7 @@ void rtl8180_tx_isr(struct net_device *dev, int pri, short error) spin_unlock_irqrestore(&priv->tx_lock, flag); } -irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs) +irqreturn_t rtl8180_interrupt(int irq, void *netdev) { struct net_device *dev = (struct net_device *) netdev; struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8187se: Remove pt_regs * irq handler parameter
On August 23, 2013 at 5:18 PM Dan Carpenter wrote: > On Fri, Aug 23, 2013 at 05:00:06PM +0530, navin patidar wrote: > > struct pt_regs pointer is no longer passed as a irq handler > > argument. > > > > Good eye. > > Could you also remove the cast to (void *) so the compiler can catch > this in the future? > > - if (request_irq(dev->irq, (void *)rtl8180_interrupt, IRQF_SHARED, > dev->name, dev)) { > + if (request_irq(dev->irq, rtl8180_interrupt, IRQF_SHARED, dev->name, dev)) { > i will resend patch with this. regards, --navin-patidar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: rtl8187se: Remove pt_regs * irq handler parameter
struct pt_regs pointer is no longer passed as a irq handler argument. v2: remove rtl8180_interrupt cast to (void *) . Signed-off-by: navin patidar --- drivers/staging/rtl8187se/r8180_core.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index ca69155..eee4fd3 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -197,7 +197,7 @@ inline void force_pci_posting(struct net_device *dev) mb(); } -irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs); +static irqreturn_t rtl8180_interrupt(int irq, void *netdev); void set_nic_rxring(struct net_device *dev); void set_nic_txring(struct net_device *dev); static struct net_device_stats *rtl8180_stats(struct net_device *dev); @@ -2666,7 +2666,7 @@ short rtl8180_init(struct net_device *dev) TX_BEACON_RING_ADDR)) return -ENOMEM; - if (request_irq(dev->irq, (void *)rtl8180_interrupt, IRQF_SHARED, dev->name, dev)) { + if (request_irq(dev->irq, rtl8180_interrupt, IRQF_SHARED, dev->name, dev)) { DMESGE("Error allocating IRQ %d", dev->irq); return -1; } else { @@ -3537,7 +3537,7 @@ void rtl8180_tx_isr(struct net_device *dev, int pri, short error) spin_unlock_irqrestore(&priv->tx_lock, flag); } -irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs) +irqreturn_t rtl8180_interrupt(int irq, void *netdev) { struct net_device *dev = (struct net_device *) netdev; struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192e: Remove pt_regs * irq handler parameter
struct pt_regs pointer is no longer passed as a irq handler argument. and also remove unnecessary macros. Signed-off-by: navin patidar --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c |5 +++-- drivers/staging/rtl8192e/rtl8192e/rtl_core.h |6 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 2b6c61c..d952a34 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -94,6 +94,7 @@ MODULE_DEVICE_TABLE(pci, rtl8192_pci_id_tbl); static int rtl8192_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id); static void rtl8192_pci_disconnect(struct pci_dev *pdev); +static irqreturn_t rtl8192_interrupt(int irq, void *netdev); static struct pci_driver rtl8192_pci_driver = { .name = DRV_NAME, /* Driver name */ @@ -1324,7 +1325,7 @@ static short rtl8192_init(struct net_device *dev) (unsigned long)dev); rtl8192_irq_disable(dev); - if (request_irq(dev->irq, (void *)rtl8192_interrupt_rsl, IRQF_SHARED, + if (request_irq(dev->irq, rtl8192_interrupt, IRQF_SHARED, dev->name, dev)) { printk(KERN_ERR "Error allocating IRQ %d", dev->irq); return -1; @@ -2704,7 +2705,7 @@ out: } -irqreturn_type rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs) +irqreturn_t rtl8192_interrupt(int irq, void *netdev) { struct net_device *dev = (struct net_device *) netdev; struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 87d4d34..9d7cb0e 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -88,10 +88,6 @@ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID , \ .driver_data = (kernel_ulong_t)&(cfg) -#define irqreturn_type irqreturn_t - -#define rtl8192_interrupt(x, y, z) rtl8192_interrupt_rsl(x, y) - #define RTL_MAX_SCAN_SIZE 128 #define RTL_RATE_MAX 30 @@ -1044,8 +1040,6 @@ void rtl8192_set_chan(struct net_device *dev, short ch); void check_rfctrl_gpio_timer(unsigned long data); void rtl8192_hw_wakeup_wq(void *data); -irqreturn_type rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs); - short rtl8192_pci_initdescring(struct net_device *dev); void rtl8192_cancel_deferred_work(struct r8192_priv *priv); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: bcm: remove Version.h file.
many of the macros defined in Version.h are not being used, so we can remove the file. Signed-off-by: navin patidar --- drivers/staging/bcm/Bcmchar.c |4 ++-- drivers/staging/bcm/Version.h | 29 - drivers/staging/bcm/headers.h |3 +-- 3 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 drivers/staging/bcm/Version.h diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index f67a225..f91bc1f 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -1004,9 +1004,9 @@ cntrlEnd: if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer))) return -EFAULT; - len = min_t(ulong, IoBuffer.OutputLength, strlen(VER_FILEVERSION_STR) + 1); + len = min_t(ulong, IoBuffer.OutputLength, strlen(DRV_VERSION) + 1); - if (copy_to_user(IoBuffer.OutputBuffer, VER_FILEVERSION_STR, len)) + if (copy_to_user(IoBuffer.OutputBuffer, DRV_VERSION, len)) return -EFAULT; Status = STATUS_SUCCESS; break; diff --git a/drivers/staging/bcm/Version.h b/drivers/staging/bcm/Version.h deleted file mode 100644 index f1cb9de..000 --- a/drivers/staging/bcm/Version.h +++ /dev/null @@ -1,29 +0,0 @@ -/*Copyright (c) 2005 Beceem Communications Inc. - -Module Name: - - Version.h - -Abstract: - - ---*/ - -#ifndef VERSION_H -#define VERSION_H - - -#define VER_FILETYPEVFT_DRV -#define VER_FILESUBTYPE VFT2_DRV_NETWORK - -#define VER_FILEVERSION 5.2.45 -#define VER_FILEVERSION_STR "5.2.45" - -#undef VER_PRODUCTVERSION -#define VER_PRODUCTVERSION VER_FILEVERSION - -#undef VER_PRODUCTVERSION_STR -#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR - - -#endif /* VERSION_H */ diff --git a/drivers/staging/bcm/headers.h b/drivers/staging/bcm/headers.h index da47db8..7fd21c6 100644 --- a/drivers/staging/bcm/headers.h +++ b/drivers/staging/bcm/headers.h @@ -38,7 +38,6 @@ #include #include "Typedefs.h" -#include "Version.h" #include "Macros.h" #include "HostMIBSInterface.h" #include "cntrl_SignalingInterface.h" @@ -71,7 +70,7 @@ #define DEV_NAME "tarang" #define DRV_DESCRIPTION "Beceem Communications Inc. WiMAX driver" #define DRV_COPYRIGHT "Copyright 2010. Beceem Communications Inc" -#define DRV_VERSIONVER_FILEVERSION_STR +#define DRV_VERSION"5.2.45" #define PFXDRV_NAME " " extern struct class *bcm_class; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: usbip: stub_main: correctly handle return value
ret == 0 means success, anything else is failure. Signed-off-by: navin patidar --- drivers/staging/usbip/stub_main.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c index 33027cc..baf857f 100644 --- a/drivers/staging/usbip/stub_main.c +++ b/drivers/staging/usbip/stub_main.c @@ -255,14 +255,14 @@ static int __init usbip_host_init(void) } ret = usb_register(&stub_driver); - if (ret < 0) { + if (ret) { pr_err("usb_register failed %d\n", ret); goto err_usb_register; } ret = driver_create_file(&stub_driver.drvwrap.driver, &driver_attr_match_busid); - if (ret < 0) { + if (ret) { pr_err("driver_create_file failed\n"); goto err_create_file; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: usbip: vhci_hcd: remove check for dma
vhci_hcd is a virtual usb host controller, so no need to check for dma. Signed-off-by: navin patidar --- drivers/staging/usbip/vhci_hcd.c |6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index b3c9217..e810ad5 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -999,12 +999,6 @@ static int vhci_hcd_probe(struct platform_device *pdev) usbip_dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id); - /* will be removed */ - if (pdev->dev.dma_mask) { - dev_info(&pdev->dev, "vhci_hcd DMA not supported\n"); - return -EINVAL; - } - /* * Allocate and initialize hcd. * Our private data is also allocated automatically. -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: usbip: vhci_hcd: correctly handle return value
ret == 0 means success, anything else is failure. Signed-off-by: navin patidar --- drivers/staging/usbip/vhci_hcd.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index d7974cb..b3c9217 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -1146,11 +1146,11 @@ static int __init vhci_hcd_init(void) return -ENODEV; ret = platform_driver_register(&vhci_driver); - if (ret < 0) + if (ret) goto err_driver_register; ret = platform_device_register(&the_pdev); - if (ret < 0) + if (ret) goto err_platform_device_register; pr_info(DRIVER_DESC " v" USBIP_VERSION "\n"); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: usbip: Fix build on Debian ppc
On September 19, 2013 at 3:40 PM Dominik Paulus wrote: > On Thu, Sep 19, 2013 at 12:12:44PM +0300, Dan Carpenter wrote: > > On Thu, Sep 19, 2013 at 10:55:18AM +0200, Tobias Polzer wrote: > > > When testing usbip under powerpc, it (unexpectedly) worked, but only after > > > removing the following lines from vhch_hcd.c: > > > > > > 1004 /* will be removed */ > > > 1005 if (pdev->dev.dma_mask) { > > > 1006 dev_info(&pdev->dev, "vhci_hcd DMA not supported\n"); > > > 1007 return -EINVAL; > > > 1008 } > > > > > > We encountered no problems without those lines. Is it safe to remove this > > > check? > > > > Hehe. No. > > > > Also which vhch_hcd.c are you talking about? "find -name vhch_hcd.c" > > doesn't show anything. > > Sorry for the typo, we meant vhci_hcd.c in > drivers/staging/usbip/vhci_hcd.c. > > > What the error message? > > When modprobing vhci_hcd.ko, vhci_hcd_probe() fails and returns -EINVAL, > resulting in this error message: > > [ 592.623292] vhci_hcd vhci_hcd: vhci_hcd DMA not supported > [ 592.624031] vhci_hcd: probe of vhci_hcd failed with error -22 > > This leads to the virtual host controller device (vhci) not being > created, so usbip cannot work. > It works after removing the codeblock mentioned above. > > We did some research and discovered that dma_mask is only set on PowerPC > at the moment (in arch/powerpc/kernel/setup-common.c, > arch_setup_pdev_archdata()). > > All of our testing was done in QEMU emulating Debian on POWER7. > I have already submitted a patch to remove mentioned code block. patch link : https://lkml.org/lkml/2013/9/10/26 regards, --navin-patidar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/16] staging: rtl8188eu: Remove unused function rtw_use_tkipkey_handler()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_security.c| 25 -- drivers/staging/rtl8188eu/include/rtw_security.h |1 - 2 files changed, 26 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c index d78def5..f9096a5 100644 --- a/drivers/staging/rtl8188eu/core/rtw_security.c +++ b/drivers/staging/rtl8188eu/core/rtw_security.c @@ -1679,28 +1679,3 @@ do { \ d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \ d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]; \ } while (0); - -/** - * omac1_aes_128 - One-Key CBC MAC (OMAC1) hash with AES-128 (aka AES-CMAC) - * @key: 128-bit key for the hash operation - * @data: Data buffer for which a MAC is determined - * @data_len: Length of data buffer in bytes - * @mac: Buffer for MAC (128 bits, i.e., 16 bytes) - * Returns: 0 on success, -1 on failure - * - * This is a mode for using block cipher (AES in this case) for authentication. - * OMAC1 was standardized with the name CMAC by NIST in a Special Publication - * (SP) 800-38B. - */ -void rtw_use_tkipkey_handler(void *FunctionContext) -{ - struct adapter *padapter = (struct adapter *)FunctionContext; - - - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler ^^^\n")); - - padapter->securitypriv.busetkipkey = true; - - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler padapter->securitypriv.busetkipkey=%d^^^\n", padapter->securitypriv.busetkipkey)); - -} diff --git a/drivers/staging/rtl8188eu/include/rtw_security.h b/drivers/staging/rtl8188eu/include/rtw_security.h index 937cad8..66d60aa 100644 --- a/drivers/staging/rtl8188eu/include/rtw_security.h +++ b/drivers/staging/rtl8188eu/include/rtw_security.h @@ -378,6 +378,5 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe); u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe); u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe); void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe); -void rtw_use_tkipkey_handler(void *FunctionContext); #endif /* __RTL871X_SECURITY_H_ */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/16] staging: rtl8188eu: Remove unused function rtw_set_802_11_remove_wep()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c| 25 - drivers/staging/rtl8188eu/include/rtw_ioctl_set.h |1 - 2 files changed, 26 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index f4116d1..fc280ce5 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -566,31 +566,6 @@ exit: return ret; } -u8 rtw_set_802_11_remove_wep(struct adapter *padapter, u32 keyindex) -{ - u8 ret = _SUCCESS; - - if (keyindex >= 0x8000 || padapter == NULL) { - ret = false; - goto exit; - } else { - int res; - struct security_priv *psecuritypriv = &(padapter->securitypriv); - if (keyindex < 4) { - memset(&psecuritypriv->dot11DefKey[keyindex], 0, 16); - res = rtw_set_key(padapter, psecuritypriv, keyindex, 0); - psecuritypriv->dot11DefKeylen[keyindex] = 0; - if (res == _FAIL) - ret = _FAIL; - } else { - ret = _FAIL; - } - } -exit: - - return ret; -} - /* * rtw_get_cur_max_rate - * @adapter: pointer to struct adapter structure diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h index a325326..fa9d655 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h +++ b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h @@ -35,7 +35,6 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *adapter, int ssid_max_num); u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter, enum ndis_802_11_network_infra type); -u8 rtw_set_802_11_remove_wep(struct adapter *adapter, u32 keyindex); u8 rtw_set_802_11_ssid(struct adapter *adapt, struct ndis_802_11_ssid *ssid); u16 rtw_get_cur_max_rate(struct adapter *adapter); int rtw_set_country(struct adapter *adapter, const char *country_code); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/16] staging: rtl8188eu: Remove unused function rtw_validate_ssid()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c| 26 - drivers/staging/rtl8188eu/include/rtw_ioctl_set.h |1 - 2 files changed, 27 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 09d5bf4..95c6539 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -34,32 +34,6 @@ extern void indicate_wx_scan_complete_event(struct adapter *padapter); (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ ) -u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid) -{ - u8 i; - u8 ret = true; - - - if (ssid->SsidLength > 32) { - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid length >32\n")); - ret = false; - goto exit; - } - - for (i = 0; i < ssid->SsidLength; i++) { - /* wifi, printable ascii code must be supported */ - if (!((ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e))) { - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid has nonprintabl ascii\n")); - ret = false; - break; - } - } - -exit: - - return ret; -} - u8 rtw_do_join(struct adapter *padapter) { struct list_head *plist, *phead; diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h index 525abbd..11791cb 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h +++ b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h @@ -40,7 +40,6 @@ u8 rtw_set_802_11_remove_wep(struct adapter *adapter, u32 keyindex); u8 rtw_set_802_11_ssid(struct adapter *adapt, struct ndis_802_11_ssid *ssid); u8 rtw_set_802_11_remove_key(struct adapter *adapt, struct ndis_802_11_remove_key *key); -u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid); u16 rtw_get_cur_max_rate(struct adapter *adapter); int rtw_set_country(struct adapter *adapter, const char *country_code); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/16] staging: rtl8188eu: Remove unused function rtw_set_802_11_remove_key()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c| 38 - drivers/staging/rtl8188eu/include/rtw_ioctl_set.h |2 -- 2 files changed, 40 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 8c107f8..f4116d1 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -591,44 +591,6 @@ exit: return ret; } -u8 rtw_set_802_11_remove_key(struct adapter *padapter, struct ndis_802_11_remove_key *key) -{ - u8 *pbssid; - struct sta_info *stainfo; - u8 bgroup = (key->KeyIndex & 0x400) > 0 ? false : true; - u8 keyIndex = (u8)key->KeyIndex & 0x03; - u8 ret = _SUCCESS; - - - if ((key->KeyIndex & 0xbffc) > 0) { - ret = _FAIL; - goto exit; - } - - if (bgroup) { - /* clear group key by index */ - - memset(&padapter->securitypriv.dot118021XGrpKey[keyIndex], 0, 16); - - /* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */ - } else { - pbssid = get_bssid(&padapter->mlmepriv); - stainfo = rtw_get_stainfo(&padapter->stapriv, pbssid); - if (stainfo) { - /* clear key by BSSID */ - memset(&stainfo->dot118021x_UncstKey, 0, 16); - - /* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */ - } else { - ret = _FAIL; - goto exit; - } - } -exit: - - return ret; -} - /* * rtw_get_cur_max_rate - * @adapter: pointer to struct adapter structure diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h index 9ec6456..a325326 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h +++ b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h @@ -37,8 +37,6 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter, enum ndis_802_11_network_infra type); u8 rtw_set_802_11_remove_wep(struct adapter *adapter, u32 keyindex); u8 rtw_set_802_11_ssid(struct adapter *adapt, struct ndis_802_11_ssid *ssid); -u8 rtw_set_802_11_remove_key(struct adapter *adapt, -struct ndis_802_11_remove_key *key); u16 rtw_get_cur_max_rate(struct adapter *adapter); int rtw_set_country(struct adapter *adapter, const char *country_code); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/16] staging: rtl8188eu: Remove unused function rtw_set_scan_mode()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c| 17 - drivers/staging/rtl8188eu/include/rtw_ioctl_set.h |1 - 2 files changed, 18 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 5eb21cd..09d5bf4 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -1075,23 +1075,6 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter) } /* -* rtw_set_scan_mode - -* @adapter: pointer to struct adapter structure -* @scan_mode: -* -* Return _SUCCESS or _FAIL -*/ -int rtw_set_scan_mode(struct adapter *adapter, enum rt_scan_type scan_mode) -{ - if (scan_mode != SCAN_ACTIVE && scan_mode != SCAN_PASSIVE) - return _FAIL; - - adapter->mlmepriv.scan_mode = scan_mode; - - return _SUCCESS; -} - -/* * rtw_set_country - * @adapter: pointer to struct adapter structure * @country_code: string of country code diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h index 7335147..525abbd 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h +++ b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h @@ -42,7 +42,6 @@ u8 rtw_set_802_11_remove_key(struct adapter *adapt, struct ndis_802_11_remove_key *key); u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid); u16 rtw_get_cur_max_rate(struct adapter *adapter); -int rtw_set_scan_mode(struct adapter *adapter, enum rt_scan_type scan_mode); int rtw_set_country(struct adapter *adapter, const char *country_code); #endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/16] staging: rtl8188eu: Remove unused function rtw_set_802_11_add_key()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c| 352 - drivers/staging/rtl8188eu/include/rtw_ioctl_set.h |1 - 2 files changed, 353 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 95c6539..8c107f8 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -591,358 +591,6 @@ exit: return ret; } -u8 rtw_set_802_11_add_key(struct adapter *padapter, struct ndis_802_11_key *key) -{ - uintencryptionalgo; - u8 *pbssid; - struct sta_info *stainfo; - u8 bgroup = false; - u8 bgrouptkey = false;/* can be removed later */ - u8 ret = _SUCCESS; - - - if (((key->KeyIndex & 0x8000) == 0) && ((key->KeyIndex & 0x4000) > 0)) { - /* It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination, */ - /* it must fail the request and return NDIS_STATUS_INVALID_DATA. */ - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, -("rtw_set_802_11_add_key: ((key->KeyIndex & 0x8000)==0)[=%d]", -(int)(key->KeyIndex & 0x8000) == 0)); - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, -("rtw_set_802_11_add_key:((key->KeyIndex & 0x4000)>0)[=%d]", -(int)(key->KeyIndex & 0x4000) > 0)); - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, -("rtw_set_802_11_add_key: key->KeyIndex=%d\n", -(int)key->KeyIndex)); - ret = _FAIL; - goto exit; - } - - if (key->KeyIndex & 0x4000) { - /* Pairwise key */ - - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: + Pairwise key +\n")); - - pbssid = get_bssid(&padapter->mlmepriv); - stainfo = rtw_get_stainfo(&padapter->stapriv, pbssid); - - if ((stainfo != NULL) && (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)) { - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("OID_802_11_ADD_KEY:(stainfo!=NULL)&&(Adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)\n")); - encryptionalgo = stainfo->dot118021XPrivacy; - } else { - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: stainfo == NULL)||(Adapter->securitypriv.dot11AuthAlgrthm!= dot11AuthAlgrthm_8021X)\n")); - encryptionalgo = padapter->securitypriv.dot11PrivacyAlgrthm; - } - - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, -("rtw_set_802_11_add_key: (encryptionalgo==%d)!\n", -encryptionalgo)); - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, -("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11PrivacyAlgrthm==%d)!\n", -padapter->securitypriv.dot11PrivacyAlgrthm)); - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, -("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11AuthAlgrthm==%d)!\n", -padapter->securitypriv.dot11AuthAlgrthm)); - - if ((stainfo != NULL)) - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, -("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy==%d)!\n", -stainfo->dot118021XPrivacy)); - - if (key->KeyIndex & 0x00FF) { - /* The key index is specified in the lower 8 bits by values of zero to 255. */ - /* The key index should be set to zero for a Pairwise key, and the driver should fail with */ - /* NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero */ - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, (" key->KeyIndex & 0x00FF.\n")); - ret = _FAIL; - goto exit; - } - - /* check BSSID */ - if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true) { - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("MacAddr_isBcst(key->BSSID)\n")); - ret = false; - goto exit; - } - - /* Check key length for
[PATCH 02/16] staging: rtl8188eu: Remove function rtw_set_channel_plan()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c| 15 +-- drivers/staging/rtl8188eu/include/rtw_ioctl_set.h |1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 39932cb..5eb21cd 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -1092,19 +1092,6 @@ int rtw_set_scan_mode(struct adapter *adapter, enum rt_scan_type scan_mode) } /* -* rtw_set_channel_plan - -* @adapter: pointer to struct adapter structure -* @channel_plan: -* -* Return _SUCCESS or _FAIL -*/ -int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan) -{ - /* handle by cmd_thread to sync with scan operation */ - return rtw_set_chplan_cmd(adapter, channel_plan, 1); -} - -/* * rtw_set_country - * @adapter: pointer to struct adapter structure * @country_code: string of country code @@ -1130,5 +1117,5 @@ int rtw_set_country(struct adapter *adapter, const char *country_code) else DBG_88E("%s unknown country_code:%s\n", __func__, country_code); - return rtw_set_channel_plan(adapter, channel_plan); + return rtw_set_chplan_cmd(adapter, channel_plan, 1); } diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h index 005ec17..7335147 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h +++ b/drivers/staging/rtl8188eu/include/rtw_ioctl_set.h @@ -43,7 +43,6 @@ u8 rtw_set_802_11_remove_key(struct adapter *adapt, u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid); u16 rtw_get_cur_max_rate(struct adapter *adapter); int rtw_set_scan_mode(struct adapter *adapter, enum rt_scan_type scan_mode); -int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan); int rtw_set_country(struct adapter *adapter, const char *country_code); #endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/16] staging: rtl8188eu: Remove unused function rtw_get_timestampe_from_ie()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c|5 - drivers/staging/rtl8188eu/include/rtw_mlme.h |1 - 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 1eef47d..3314708 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -331,11 +331,6 @@ u16 rtw_get_capability(struct wlan_bssid_ex *bss) return le16_to_cpu(val); } -u8 *rtw_get_timestampe_from_ie(u8 *ie) -{ - return ie + 0; -} - u8 *rtw_get_beacon_interval_from_ie(u8 *ie) { return ie + 8; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 45c22ef..75f8cf5 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -590,7 +590,6 @@ int rtw_if_up(struct adapter *padapter); u8 *rtw_get_capability_from_ie(u8 *ie); -u8 *rtw_get_timestampe_from_ie(u8 *ie); u8 *rtw_get_beacon_interval_from_ie(u8 *ie); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/16] staging: rtl8188eu: Rename _rtw_find_network() to rtw_find_network()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c| 14 +- drivers/staging/rtl8188eu/include/rtw_mlme.h |5 - 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index b1e406e..fcd3f5a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -239,7 +239,7 @@ void _rtw_free_network_nolock(structmlme_priv *pmlmepriv, struct wlan_network * Shall be calle under atomic context... to avoid possible racing condition... */ -struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr) +struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr) { struct list_head *phead, *plist; struct wlan_network *pnetwork = NULL; @@ -360,18 +360,6 @@ static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, _rtw_free_network_nolock(pmlmepriv, pnetwork); } -/* - return the wlan_network with the matching addr - - Shall be calle under atomic context... to avoid possible racing condition... -*/ -struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr) -{ - struct wlan_network *pnetwork = _rtw_find_network(scanned_queue, addr); - - return pnetwork; -} - int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork) { int ret = true; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 56ef600..04d3b3d 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -581,16 +581,11 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork); - -struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr); - int rtw_if_up(struct adapter *padapter); - u8 *rtw_get_capability_from_ie(u8 *ie); u8 *rtw_get_beacon_interval_from_ie(u8 *ie); - void rtw_joinbss_reset(struct adapter *padapter); unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/16] staging: rtl8188eu: Remove unused function _rtw_IOL_append_WW_cmd()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_iol.c| 14 -- drivers/staging/rtl8188eu/include/rtw_iol.h |2 -- 2 files changed, 16 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c b/drivers/staging/rtl8188eu/core/rtw_iol.c index e6fdd32..7796287 100644 --- a/drivers/staging/rtl8188eu/core/rtw_iol.c +++ b/drivers/staging/rtl8188eu/core/rtw_iol.c @@ -113,20 +113,6 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 return rtw_IOL_append_cmds(xmit_frame, (u8 *)&cmd, cmd.length); } -int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask) -{ - struct ioreg_cfg cmd = {8, IOREG_CMD_WW_REG, 0x0, 0x0, 0x0}; - - cmd.address = cpu_to_le16(addr); - cmd.data = cpu_to_le32(value); - - if (mask != 0x) { - cmd.length = 12; - cmd.mask = cpu_to_le32(mask); - } - return rtw_IOL_append_cmds(xmit_frame, (u8 *)&cmd, cmd.length); -} - int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask) { struct ioreg_cfg cmd = {8, IOREG_CMD_WD_REG, 0x0, 0x0, 0x0}; diff --git a/drivers/staging/rtl8188eu/include/rtw_iol.h b/drivers/staging/rtl8188eu/include/rtw_iol.h index ec0c6cb..80bfd06 100644 --- a/drivers/staging/rtl8188eu/include/rtw_iol.h +++ b/drivers/staging/rtl8188eu/include/rtw_iol.h @@ -63,8 +63,6 @@ void read_efuse_from_txpktbuf(struct adapter *adapter, int bcnhead, int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 mask); -int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, - u16 value, u16 mask); int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask); int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/16] staging: rtl8188eu: Make _rtw_free_network() static
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c|2 +- drivers/staging/rtl8188eu/include/rtw_mlme.h |3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index fcd3f5a..6cfb729 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -194,7 +194,7 @@ exit: return pnetwork; } -void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwork, u8 isfreeall) +static void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwork, u8 isfreeall) { u32 curr_time, delta_time; u32 lifetime = SCANQUEUE_LIFETIME; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 04d3b3d..e727cf0 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -575,9 +575,6 @@ struct wlan_network *_rtw_dequeue_network(struct __queue *queue); struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); - -void _rtw_free_network(struct mlme_priv *pmlmepriv, - struct wlan_network *pnetwork, u8 isfreeall); void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/16] staging: rtl8188eu: Remove unused function _rtw_dequeue_network()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c| 19 --- drivers/staging/rtl8188eu/include/rtw_mlme.h |2 -- 2 files changed, 21 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 6cfb729..5ab6752 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -142,25 +142,6 @@ exit: return _SUCCESS; } -struct wlan_network *_rtw_dequeue_network(struct __queue *queue) -{ - struct wlan_network *pnetwork; - - spin_lock_bh(&queue->lock); - - if (list_empty(&queue->queue)) { - pnetwork = NULL; - } else { - pnetwork = container_of((&queue->queue)->next, struct wlan_network, list); - - list_del_init(&(pnetwork->list)); - } - - spin_unlock_bh(&queue->lock); - - return pnetwork; -} - struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */ { struct wlan_network*pnetwork; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index e727cf0..a234e8d 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -571,8 +571,6 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv); int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork); -struct wlan_network *_rtw_dequeue_network(struct __queue *queue); - struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/16] staging: rtl8188eu: Rename _rtw_free_network_queue() to rtw_free_network_queue()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c|8 +--- drivers/staging/rtl8188eu/include/rtw_mlme.h |2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 3314708..b1e406e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -265,7 +265,7 @@ exit: } -void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) +void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) { struct list_head *phead, *plist; struct wlan_network *pnetwork; @@ -360,12 +360,6 @@ static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, _rtw_free_network_nolock(pmlmepriv, pnetwork); } - -void rtw_free_network_queue(struct adapter *dev, u8 isfreeall) -{ - _rtw_free_network_queue(dev, isfreeall); -} - /* return the wlan_network with the matching addr diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 75f8cf5..56ef600 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -584,8 +584,6 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr); -void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall); - int rtw_if_up(struct adapter *padapter); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/16] staging: rtl8188eu: Remove unused function _rtw_enqueue_network()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c| 15 --- drivers/staging/rtl8188eu/include/rtw_mlme.h |2 -- 2 files changed, 17 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 5ab6752..2aafac3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -127,21 +127,6 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) } } -int_rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork) -{ - if (pnetwork == NULL) - goto exit; - - spin_lock_bh(&queue->lock); - - list_add_tail(&pnetwork->list, &queue->queue); - - spin_unlock_bh(&queue->lock); - -exit: - return _SUCCESS; -} - struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */ { struct wlan_network*pnetwork; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index a234e8d..13f8702 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -569,8 +569,6 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv); void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv); -int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork); - struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/16] staging: rtl8188eu: Rename _rtw_init_mlme_priv() to rtw_init_mlme_priv()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c|9 + drivers/staging/rtl8188eu/include/rtw_mlme.h |3 --- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 7293589..c15fab2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -35,7 +35,7 @@ extern unsigned char MCS_rate_2R[16]; extern unsigned char MCS_rate_1R[16]; -int _rtw_init_mlme_priv(struct adapter *padapter) +int rtw_init_mlme_priv(struct adapter *padapter) { int i; u8 *pbuf; @@ -302,13 +302,6 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie) return ie + 8; } -int rtw_init_mlme_priv(struct adapter *padapter) -{ - int res; - res = _rtw_init_mlme_priv(padapter);/* (pmlmepriv); */ - return res; -} - static struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv) { return _rtw_alloc_network(pmlmepriv); diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 2a828ec..5b1fcd2 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -562,9 +562,6 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter); #define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0) #define rtw_set_scan_deny(adapter, ms) do {} while (0) - -int _rtw_init_mlme_priv(struct adapter *padapter); - void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv); struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/16] staging: rtl8188eu: Rename _rtw_free_mlme_priv() to rtw_free_mlme_priv()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c|8 +--- drivers/staging/rtl8188eu/include/rtw_mlme.h |2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 2aafac3..7293589 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -117,7 +117,7 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv) } #endif -void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) +void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) { rtw_free_mlme_priv_ie_data(pmlmepriv); @@ -309,12 +309,6 @@ int rtw_init_mlme_priv(struct adapter *padapter) return res; } -void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) -{ - RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_mlme_priv\n")); - _rtw_free_mlme_priv(pmlmepriv); -} - static struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv) { return _rtw_alloc_network(pmlmepriv); diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 13f8702..2a828ec 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -567,8 +567,6 @@ int _rtw_init_mlme_priv(struct adapter *padapter); void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv); -void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv); - struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/9] staging: rtl8188eu: Remove unused member MultiFunc from struct hal_data_8188e
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c |1 - drivers/staging/rtl8188eu/include/rtl8188e_hal.h |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c index 161138f..fbf70f6 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c @@ -517,7 +517,6 @@ static struct HAL_VERSION ReadChipVersion8188E(struct adapter *padapter) pHalData->RegulatorMode = ((value32 & TRP_BT_EN) ? RT_LDO_REGULATOR : RT_SWITCHING_REGULATOR); ChipVersion.ROMVer = 0; /* ROM code version. */ - pHalData->MultiFunc = RT_MULTI_FUNC_NONE; dump_chip_info(ChipVersion); diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h index 4b7b069..fb20653 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h @@ -240,7 +240,6 @@ enum rt_regulator_mode { struct hal_data_8188e { struct HAL_VERSION VersionID; - enum rt_multi_func MultiFunc; /* For multi-function consideration. */ enum rt_regulator_mode RegulatorMode; /* switching regulator or LDO */ u16 CustomerID; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/9] staging: rtl8188eu: Remove wrapper function rtw_join_timeout_handler()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c |3 ++- drivers/staging/rtl8188eu/include/rtw_mlme.h |3 +-- drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 10 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index c15fab2..f63f1c2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1362,8 +1362,9 @@ void rtw_cpwm_event_callback(struct adapter *padapter, u8 *pbuf) * _rtw_join_timeout_handler - Timeout/faliure handler for CMD JoinBss * @adapter: pointer to struct adapter structure */ -void _rtw_join_timeout_handler (struct adapter *adapter) +void _rtw_join_timeout_handler (void *function_context) { + struct adapter *adapter = (struct adapter *)function_context; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; int do_join_r; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 5b1fcd2..40b0c4b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -436,7 +436,6 @@ void indicate_wx_scan_complete_event(struct adapter *padapter); void rtw_indicate_wx_assoc_event(struct adapter *padapter); void rtw_indicate_wx_disassoc_event(struct adapter *padapter); int event_thread(void *context); -void rtw_join_timeout_handler(void *FunctionContext); void _rtw_scan_timeout_handler(void *FunctionContext); void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall); int rtw_init_mlme_priv(struct adapter *adapter); @@ -553,7 +552,7 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter); void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter); -void _rtw_join_timeout_handler(struct adapter *adapter); +void _rtw_join_timeout_handler(void *function_context); void rtw_scan_timeout_handler(struct adapter *adapter); void rtw_dynamic_check_timer_handlder(struct adapter *adapter); diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 737677c..41d2459 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -25,14 +25,6 @@ #include #include -void rtw_join_timeout_handler (void *FunctionContext) -{ - struct adapter *adapter = (struct adapter *)FunctionContext; - - _rtw_join_timeout_handler(adapter); -} - - void _rtw_scan_timeout_handler (void *FunctionContext) { struct adapter *adapter = (struct adapter *)FunctionContext; @@ -54,7 +46,7 @@ void rtw_init_mlme_timer(struct adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - _init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, rtw_join_timeout_handler, padapter); + _init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, _rtw_join_timeout_handler, padapter); _init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter); _init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/9] staging: rtl81888eu: Remove unused function rtw_os_read_port()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/recv_osdep.h |2 -- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 12 2 files changed, 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/recv_osdep.h b/drivers/staging/rtl8188eu/include/recv_osdep.h index a52a696..5aabd39 100644 --- a/drivers/staging/rtl8188eu/include/recv_osdep.h +++ b/drivers/staging/rtl8188eu/include/recv_osdep.h @@ -43,8 +43,6 @@ int rtw_os_recv_resource_alloc(struct adapter *adapt, int rtw_os_recvbuf_resource_alloc(struct adapter *adapt, struct recv_buf *buf); -void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf); - void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl); int _netdev_open(struct net_device *pnetdev); int netdev_open(struct net_device *pnetdev); diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index f8ac996..f7d53dd 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -191,18 +191,6 @@ _recv_indicatepkt_drop: return _FAIL; } -void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf) -{ - struct recv_priv *precvpriv = &padapter->recvpriv; - - /* free skb in recv_buf */ - dev_kfree_skb_any(precvbuf->pskb); - precvbuf->pskb = NULL; - precvbuf->reuse = false; - usb_read_port(padapter, precvpriv->ff_hwaddr, 0, - (unsigned char *)precvbuf); -} - static void _rtw_reordering_ctrl_timeout_handler(void *func_context) { struct recv_reorder_ctrl *preorder_ctrl; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 9/9] staging:rtl8188eu:Remove wrapper function _rtw_reordering_ctrl_timeout_handler()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index f7d53dd..05427c4 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -191,17 +191,9 @@ _recv_indicatepkt_drop: return _FAIL; } -static void _rtw_reordering_ctrl_timeout_handler(void *func_context) -{ - struct recv_reorder_ctrl *preorder_ctrl; - - preorder_ctrl = (struct recv_reorder_ctrl *)func_context; - rtw_reordering_ctrl_timeout_handler(preorder_ctrl); -} - void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) { struct adapter *padapter = preorder_ctrl->padapter; - _init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl); + _init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, rtw_reordering_ctrl_timeout_handler, preorder_ctrl); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/9] staging: rtl8188eu: Remove wrapper function _survey_timer_hdl()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|3 ++- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |2 +- drivers/staging/rtl8188eu/os_dep/mlme_linux.c|9 + 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 41cfd30..b113f0b 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -4833,8 +4833,9 @@ void linked_status_chk(struct adapter *padapter) } } -void survey_timer_hdl(struct adapter *padapter) +void survey_timer_hdl(void *function_context) { + struct adapter *padapter = (struct adapter *)function_context; struct cmd_obj *ph2c; struct sitesurvey_parm *psurveyPara; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 654bd36..a948d45 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -646,7 +646,7 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, void linked_status_chk(struct adapter *padapter); -void survey_timer_hdl (struct adapter *padapter); +void survey_timer_hdl (void *function_context); void link_timer_hdl (struct adapter *padapter); void addba_timer_hdl(struct sta_info *psta); diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 82b71fa..f59e130 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -129,13 +129,6 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) } } -static void _survey_timer_hdl(void *FunctionContext) -{ - struct adapter *padapter = (struct adapter *)FunctionContext; - - survey_timer_hdl(padapter); -} - static void _link_timer_hdl(void *FunctionContext) { struct adapter *padapter = (struct adapter *)FunctionContext; @@ -157,7 +150,7 @@ void init_mlme_ext_timer(struct adapter *padapter) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - _init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter); + _init_timer(&pmlmeext->survey_timer, padapter->pnetdev, survey_timer_hdl, padapter); _init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/9] staging: rtl8188eu: Remove wrapper function _link_timer_hdl()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|3 ++- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |2 +- drivers/staging/rtl8188eu/os_dep/mlme_linux.c|8 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index b113f0b..f18bb78 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -4873,8 +4873,9 @@ exit_survey_timer_hdl: return; } -void link_timer_hdl(struct adapter *padapter) +void link_timer_hdl(void *function_context) { + struct adapter *padapter = (struct adapter *)function_context; struct mlme_ext_priv*pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info*pmlmeinfo = &(pmlmeext->mlmext_info); diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index a948d45..05a010f 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -647,7 +647,7 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, void linked_status_chk(struct adapter *padapter); void survey_timer_hdl (void *function_context); -void link_timer_hdl (struct adapter *padapter); +void link_timer_hdl (void *funtion_context); void addba_timer_hdl(struct sta_info *psta); #define set_survey_timer(mlmeext, ms) \ diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index f59e130..4f5fa08 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -129,12 +129,6 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) } } -static void _link_timer_hdl(void *FunctionContext) -{ - struct adapter *padapter = (struct adapter *)FunctionContext; - link_timer_hdl(padapter); -} - static void _addba_timer_hdl(void *FunctionContext) { struct sta_info *psta = (struct sta_info *)FunctionContext; @@ -151,7 +145,7 @@ void init_mlme_ext_timer(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; _init_timer(&pmlmeext->survey_timer, padapter->pnetdev, survey_timer_hdl, padapter); - _init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter); + _init_timer(&pmlmeext->link_timer, padapter->pnetdev, link_timer_hdl, padapter); } #ifdef CONFIG_88EU_AP_MODE -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/9] staging: rtl8188eu: Remove wrapper function _rtw_scan_timeout_handler()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c |3 ++- drivers/staging/rtl8188eu/include/rtw_mlme.h |3 +-- drivers/staging/rtl8188eu/os_dep/mlme_linux.c |9 + 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index f63f1c2..d5b2f51 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1404,8 +1404,9 @@ void _rtw_join_timeout_handler (void *function_context) * rtw_scan_timeout_handler - Timeout/Faliure handler for CMD SiteSurvey * @adapter: pointer to struct adapter structure */ -void rtw_scan_timeout_handler (struct adapter *adapter) +void rtw_scan_timeout_handler (void *function_context) { + struct adapter *adapter = (struct adapter *)function_context; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv)); diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 40b0c4b..8f5457b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -436,7 +436,6 @@ void indicate_wx_scan_complete_event(struct adapter *padapter); void rtw_indicate_wx_assoc_event(struct adapter *padapter); void rtw_indicate_wx_disassoc_event(struct adapter *padapter); int event_thread(void *context); -void _rtw_scan_timeout_handler(void *FunctionContext); void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall); int rtw_init_mlme_priv(struct adapter *adapter); void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv); @@ -553,7 +552,7 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter); void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter); void _rtw_join_timeout_handler(void *function_context); -void rtw_scan_timeout_handler(struct adapter *adapter); +void rtw_scan_timeout_handler(void *function_context); void rtw_dynamic_check_timer_handlder(struct adapter *adapter); #define rtw_is_scan_deny(adapter) false diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 41d2459..0bfaa78 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -25,13 +25,6 @@ #include #include -void _rtw_scan_timeout_handler (void *FunctionContext) -{ - struct adapter *adapter = (struct adapter *)FunctionContext; - - rtw_scan_timeout_handler(adapter); -} - static void _dynamic_check_timer_handlder(void *FunctionContext) { struct adapter *adapter = (struct adapter *)FunctionContext; @@ -47,7 +40,7 @@ void rtw_init_mlme_timer(struct adapter *padapter) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; _init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, _rtw_join_timeout_handler, padapter); - _init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter); + _init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, rtw_scan_timeout_handler, padapter); _init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/9] staging: rtl8188eu: Remove wrapper function _addba_timer_hdl()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|3 ++- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |2 +- drivers/staging/rtl8188eu/os_dep/mlme_linux.c|8 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index f18bb78..5ba5099 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -4910,8 +4910,9 @@ void link_timer_hdl(void *function_context) return; } -void addba_timer_hdl(struct sta_info *psta) +void addba_timer_hdl(void *function_context) { + struct sta_info *psta = (struct sta_info *)function_context; struct ht_priv *phtpriv; if (!psta) diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 05a010f..d699ca1 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -648,7 +648,7 @@ void linked_status_chk(struct adapter *padapter); void survey_timer_hdl (void *function_context); void link_timer_hdl (void *funtion_context); -void addba_timer_hdl(struct sta_info *psta); +void addba_timer_hdl(void *function_context); #define set_survey_timer(mlmeext, ms) \ do { \ diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 4f5fa08..1b892c4 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -129,15 +129,9 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) } } -static void _addba_timer_hdl(void *FunctionContext) -{ - struct sta_info *psta = (struct sta_info *)FunctionContext; - addba_timer_hdl(psta); -} - void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta) { - _init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta); + _init_timer(&psta->addba_retry_timer, padapter->pnetdev, addba_timer_hdl, psta); } void init_mlme_ext_timer(struct adapter *padapter) -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/9] staging: rtl8188eu: Remove wrapper function _dynamic_check_timer_handlder()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 13 - drivers/staging/rtl8188eu/include/rtw_mlme.h |2 +- drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 12 +--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index d5b2f51..149c271 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1431,24 +1431,27 @@ static void rtw_auto_scan_handler(struct adapter *padapter) } } -void rtw_dynamic_check_timer_handlder(struct adapter *adapter) +void rtw_dynamic_check_timer_handlder(void *function_context) { + struct adapter *adapter = (struct adapter *)function_context; struct registry_priv *pregistrypriv = &adapter->registrypriv; if (!adapter) - return; + goto exit; if (!adapter->hw_init_completed) - return; + goto exit; if ((adapter->bDriverStopped) || (adapter->bSurpriseRemoved)) - return; + goto exit; if (adapter->net_closed) - return; + goto exit; rtw_dynamic_chk_wk_cmd(adapter); if (pregistrypriv->wifi_spec == 1) { /* auto site survey */ rtw_auto_scan_handler(adapter); } +exit: + _set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000); } #define RTW_SCAN_RESULT_EXPIRE 2000 diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 8f5457b..8d83f7c 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -554,7 +554,7 @@ void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter); void _rtw_join_timeout_handler(void *function_context); void rtw_scan_timeout_handler(void *function_context); -void rtw_dynamic_check_timer_handlder(struct adapter *adapter); +void rtw_dynamic_check_timer_handlder(void *function_context); #define rtw_is_scan_deny(adapter) false #define rtw_clear_scan_deny(adapter) do {} while (0) #define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0) diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 0bfaa78..82b71fa 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -25,23 +25,13 @@ #include #include -static void _dynamic_check_timer_handlder(void *FunctionContext) -{ - struct adapter *adapter = (struct adapter *)FunctionContext; - - if (adapter->registrypriv.mp_mode == 1) - return; - rtw_dynamic_check_timer_handlder(adapter); - _set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000); -} - void rtw_init_mlme_timer(struct adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; _init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, _rtw_join_timeout_handler, padapter); _init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, rtw_scan_timeout_handler, padapter); - _init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter); + _init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, rtw_dynamic_check_timer_handlder, padapter); } void rtw_os_indicate_connect(struct adapter *adapter) -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/22] staging: rtl8188eu: Cleanup firmware initialization code
Using rtl8188ee's (drivers/net/wireless/rtlwifi/rtl8188ee/fw.c) neat and clean firmware initialization code to replace rtl8188eu's messy firmware initialization code. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/Makefile|1 + drivers/staging/rtl8188eu/hal/fw.c| 236 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 298 - drivers/staging/rtl8188eu/hal/usb_halinit.c |6 +- drivers/staging/rtl8188eu/include/drv_types.h |7 - drivers/staging/rtl8188eu/include/fw.h| 59 drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 47 +--- drivers/staging/rtl8188eu/os_dep/os_intfs.c |7 +- 8 files changed, 309 insertions(+), 352 deletions(-) create mode 100644 drivers/staging/rtl8188eu/hal/fw.c create mode 100644 drivers/staging/rtl8188eu/include/fw.h diff --git a/drivers/staging/rtl8188eu/Makefile b/drivers/staging/rtl8188eu/Makefile index aeebf93..32d64a7 100644 --- a/drivers/staging/rtl8188eu/Makefile +++ b/drivers/staging/rtl8188eu/Makefile @@ -17,6 +17,7 @@ r8188eu-y := \ core/rtw_sta_mgt.o \ core/rtw_wlan_util.o\ core/rtw_xmit.o \ + hal/fw.o\ hal/HalHWImg8188E_MAC.o \ hal/HalHWImg8188E_BB.o \ hal/HalHWImg8188E_RF.o \ diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c new file mode 100644 index 000..09324ae --- /dev/null +++ b/drivers/staging/rtl8188eu/hal/fw.c @@ -0,0 +1,236 @@ +/** + * + * Copyright(c) 2009-2013 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * The full GNU General Public License is included in this distribution in the + * file called LICENSE. + * + * Contact Information: + * wlanfae + * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, + * Hsinchu 300, Taiwan. + * + * Larry Finger + * + */ + +#include "fw.h" +#include "drv_types.h" +#include "usb_ops_linux.h" +#include "rtl8188e_spec.h" +#include "rtl8188e_hal.h" + +#include +#include + +static void _rtl88e_enable_fw_download(struct adapter *adapt, bool enable) +{ + u8 tmp; + + if (enable) { + tmp = usb_read8(adapt, REG_MCUFWDL); + usb_write8(adapt, REG_MCUFWDL, tmp | 0x01); + + tmp = usb_read8(adapt, REG_MCUFWDL + 2); + usb_write8(adapt, REG_MCUFWDL + 2, tmp & 0xf7); + } else { + tmp = usb_read8(adapt, REG_MCUFWDL); + usb_write8(adapt, REG_MCUFWDL, tmp & 0xfe); + + usb_write8(adapt, REG_MCUFWDL + 1, 0x00); + } +} + +static void _rtl88e_fw_block_write(struct adapter *adapt, + const u8 *buffer, u32 size) +{ + u32 blk_sz = sizeof(u32); + u8 *buf_ptr = (u8 *)buffer; + u32 *pu4BytePtr = (u32 *)buffer; + u32 i, offset, blk_cnt, remain; + + blk_cnt = size / blk_sz; + remain = size % blk_sz; + + for (i = 0; i < blk_cnt; i++) { + offset = i * blk_sz; + usb_write32(adapt, (FW_8192C_START_ADDRESS + offset), + *(pu4BytePtr + i)); + } + + if (remain) { + offset = blk_cnt * blk_sz; + buf_ptr += offset; + for (i = 0; i < remain; i++) { + usb_write8(adapt, (FW_8192C_START_ADDRESS + +offset + i), *(buf_ptr + i)); + } + } +} + +static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen) +{ + u32 fwlen = *pfwlen; + u8 remain = (u8) (fwlen % 4); + + remain = (remain == 0) ? 0 : (4 - remain); + + while (remain > 0) { + pfwbuf[fwlen] = 0; + fwlen++; + remain--; + } + + *pfwlen = fwlen; +} + +static void _rtl88e_fw_page_write(struct adapter *adapt, + u32 page, const u8 *buffer, u32 size) +{ + u8 value8; + u8 u8page = (u8) (page &a
[PATCH 05/22] staging: rtl8188eu: Remove unused function odm_ConfigRFReg_8188E()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c | 25 .../staging/rtl8188eu/include/odm_RegConfig8188E.h |3 --- 2 files changed, 28 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c b/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c index 41caff9..9c6ad5b 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c @@ -20,31 +20,6 @@ #include "odm_precomp.h" -void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, - u32 Data, enum rf_radio_path RF_PATH, - u32 RegAddr) -{ - struct adapter *adapter = pDM_Odm->Adapter; - - if (Addr == 0xffe) { - msleep(50); - } else if (Addr == 0xfd) { - mdelay(5); - } else if (Addr == 0xfc) { - mdelay(1); - } else if (Addr == 0xfb) { - udelay(50); - } else if (Addr == 0xfa) { - udelay(5); - } else if (Addr == 0xf9) { - udelay(1); - } else { - PHY_SetRFReg(adapter, RF_PATH, RegAddr, bRFRegOffsetMask, Data); - /* Add 1us delay between BB/RF register setting. */ - udelay(1); - } -} - void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data) { struct adapter *adapt = pDM_Odm->Adapter; diff --git a/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h b/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h index c33c45b..b0d94e1 100644 --- a/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h @@ -20,9 +20,6 @@ #ifndef __INC_ODM_REGCONFIG_H_8188E #define __INC_ODM_REGCONFIG_H_8188E -void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data, - enum rf_radio_path RF_PATH, u32 RegAddr); - void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data); void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/22] staging: rtl8188eu: Remove unused functions odm_ConfigRF_Radio[A, B]_8188E()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c | 19 --- .../staging/rtl8188eu/include/odm_RegConfig8188E.h |6 -- 2 files changed, 25 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c b/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c index 4d4978b..41caff9 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c @@ -45,25 +45,6 @@ void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, } } -void odm_ConfigRF_RadioA_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data) -{ - u32 content = 0x1000; /* RF_Content: radioa_txt */ - u32 maskforPhySet = (u32)(content&0xE000); - - odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, RF_PATH_A, Addr|maskforPhySet); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data)); -} - -void odm_ConfigRF_RadioB_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data) -{ - u32 content = 0x1001; /* RF_Content: radiob_txt */ - u32 maskforPhySet = (u32)(content&0xE000); - - odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, RF_PATH_B, Addr|maskforPhySet); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data)); -} - void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data) { struct adapter *adapt = pDM_Odm->Adapter; diff --git a/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h b/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h index f2bf7a0..c33c45b 100644 --- a/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h @@ -23,12 +23,6 @@ void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data, enum rf_radio_path RF_PATH, u32 RegAddr); -void odm_ConfigRF_RadioA_8188E(struct odm_dm_struct *pDM_Odm, - u32 Addr, u32 Data); - -void odm_ConfigRF_RadioB_8188E(struct odm_dm_struct *pDM_Odm, - u32 Addr, u32 Data); - void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data); void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/22] staging: rtl8188eu: Remove unused function odm_ConfigMAC_8188E()
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c |8 drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h |2 -- 2 files changed, 10 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c b/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c index 9c6ad5b..634d111 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RegConfig8188E.c @@ -20,14 +20,6 @@ #include "odm_precomp.h" -void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data) -{ - struct adapter *adapt = pDM_Odm->Adapter; - - usb_write8(adapt, Addr, Data); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data)); -} - void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data) { struct adapter *adapter = pDM_Odm->Adapter; diff --git a/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h b/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h index b0d94e1..dd49a86 100644 --- a/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h +++ b/drivers/staging/rtl8188eu/include/odm_RegConfig8188E.h @@ -20,8 +20,6 @@ #ifndef __INC_ODM_REGCONFIG_H_8188E #define __INC_ODM_REGCONFIG_H_8188E -void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data); - void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/22] staging: rtl8188eu: Cleanup and simplify Baseband configuration code
Cleanup and consolidate Baseband configuration related code in HalHWImg8188E_BB.c file. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c | 474 ++-- drivers/staging/rtl8188eu/hal/odm_HWConfig.c | 15 - drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c| 187 drivers/staging/rtl8188eu/hal/usb_halinit.c| 10 +- .../staging/rtl8188eu/include/HalHWImg8188E_BB.h | 44 -- drivers/staging/rtl8188eu/include/odm_precomp.h|2 - drivers/staging/rtl8188eu/include/phy.h|1 + 7 files changed, 236 insertions(+), 497 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/HalHWImg8188E_BB.h diff --git a/drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c b/drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c index 787e8f1..00f9cd7 100644 --- a/drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c +++ b/drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c @@ -20,7 +20,7 @@ #include "odm_precomp.h" -#include +#include #define read_next_pair(array, v1, v2, i) \ do { \ @@ -29,36 +29,8 @@ v2 = array[i+1]; \ } while (0) -static bool CheckCondition(const u32 condition, const u32 hex) -{ - u32 _board = (hex & 0x00FF); - u32 _interface = (hex & 0xFF00) >> 8; - u32 _platform = (hex & 0x00FF) >> 16; - u32 cond = condition; - - if (condition == 0xCDCDCDCD) - return true; - - cond = condition & 0x00FF; - if ((_board == cond) && cond != 0x00) - return false; - - cond = condition & 0xFF00; - cond = cond >> 8; - if ((_interface & cond) == 0 && cond != 0x07) - return false; - - cond = condition & 0x00FF; - cond = cond >> 16; - if ((_platform & cond) == 0 && cond != 0x0F) - return false; - return true; -} - -/** -* AGC_TAB_1T.TXT -**/ +/* AGC_TAB_1T.TXT */ static u32 array_agc_tab_1t_8188e[] = { 0xC78, 0xFB01, @@ -191,91 +163,25 @@ static u32 array_agc_tab_1t_8188e[] = { 0xC78, 0x407F0001, }; -enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm) +static bool set_baseband_agc_config(struct adapter *adapt) { - u32 hex = 0; - u32 i = 0; - u8 platform= dm_odm->SupportPlatform; - u8 interfaceValue = dm_odm->SupportInterface; - u8 board = dm_odm->BoardType; - u32 arraylen= sizeof(array_agc_tab_1t_8188e)/sizeof(u32); - u32*array = array_agc_tab_1t_8188e; - boolbiol = false; - struct adapter *adapter = dm_odm->Adapter; - struct xmit_frame *pxmit_frame = NULL; - u8 bndy_cnt = 1; - enum HAL_STATUS rst = HAL_STATUS_SUCCESS; - - hex += board; - hex += interfaceValue << 8; - hex += platform << 16; - hex += 0xFF00; - biol = rtw_IOL_applied(adapter); - - if (biol) { - pxmit_frame = rtw_IOL_accquire_xmit_frame(adapter); - if (pxmit_frame == NULL) { - pr_info("rtw_IOL_accquire_xmit_frame failed\n"); - return HAL_STATUS_FAILURE; - } - } + u32 i; + u32 arraylen = sizeof(array_agc_tab_1t_8188e)/sizeof(u32); + u32 *array = array_agc_tab_1t_8188e; for (i = 0; i < arraylen; i += 2) { u32 v1 = array[i]; u32 v2 = array[i+1]; - /* This (offset, data) pair meets the condition. */ - if (v1 < 0xCDCDCDCD) { - if (biol) { - if (rtw_IOL_cmd_boundary_handle(pxmit_frame)) - bndy_cnt++; - rtw_IOL_append_WD_cmd(pxmit_frame, (u16)v1, v2, bMaskDWord); - } else { - odm_ConfigBB_AGC_8188E(dm_odm, v1, bMaskDWord, v2); - } - continue; - } else { - /* This line is the start line of branch. */ - if (!CheckCondition(array[i], hex)) { - /* Discard the following (offset, data) pairs. */ - read_next_pair(array, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i &
[PATCH 03/22] staging: rtl8188eu: Cleanup and simplify RF configuration code
Cleanup and consolidate RF configuration related code in HalHWImg8188E_RF.c file. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c | 269 drivers/staging/rtl8188eu/hal/odm_HWConfig.c | 14 - drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c|9 - drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c| 96 --- drivers/staging/rtl8188eu/hal/usb_halinit.c| 10 +- .../staging/rtl8188eu/include/HalHWImg8188E_RF.h | 30 --- drivers/staging/rtl8188eu/include/odm_HWConfig.h |4 - drivers/staging/rtl8188eu/include/odm_precomp.h|1 - drivers/staging/rtl8188eu/include/phy.h|1 + drivers/staging/rtl8188eu/include/rtl8188e_rf.h|1 - 10 files changed, 161 insertions(+), 274 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/HalHWImg8188E_RF.h diff --git a/drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c b/drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c index 17c6411..2648840 100644 --- a/drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c +++ b/drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c @@ -20,38 +20,36 @@ #include "odm_precomp.h" -#include +#include -static bool CheckCondition(const u32 Condition, const u32 Hex) +static bool check_condition(struct adapter *adapt, const u32 condition) { - u32 _board = (Hex & 0x00FF); - u32 _interface = (Hex & 0xFF00) >> 8; - u32 _platform = (Hex & 0x00FF) >> 16; - u32 cond = Condition; + struct odm_dm_struct *odm = &GET_HAL_DATA(adapt)->odmpriv; + u32 _board = odm->BoardType; + u32 _platform = odm->SupportPlatform; + u32 _interface = odm->SupportInterface; + u32 cond = condition; - if (Condition == 0xCDCDCDCD) + if (condition == 0xCDCDCDCD) return true; - cond = Condition & 0x00FF; + cond = condition & 0x00FF; if ((_board == cond) && cond != 0x00) return false; - cond = Condition & 0xFF00; + cond = condition & 0xFF00; cond = cond >> 8; if ((_interface & cond) == 0 && cond != 0x07) return false; - cond = Condition & 0x00FF; + cond = condition & 0x00FF; cond = cond >> 16; if ((_platform & cond) == 0 && cond != 0x0F) return false; return true; } - -/** -* RadioA_1T.TXT -**/ +/* RadioA_1T.TXT */ static u32 Array_RadioA_1T_8188E[] = { 0x000, 0x0003, @@ -155,115 +153,166 @@ static u32 Array_RadioA_1T_8188E[] = { 0x000, 0x00033E60, }; -enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm) +#define READ_NEXT_PAIR(v1, v2, i) \ +do { \ + i += 2; v1 = array[i]; \ + v2 = array[i+1];\ +} while (0) + +#define RFREG_OFFSET_MASK 0xf +#define B3WIREADDREAALENGTH 0x400 +#define B3WIREDATALENGTH 0x800 +#define BRFSI_RFENV 0x10 + +static void rtl_rfreg_delay(struct adapter *adapt, enum rf_radio_path rfpath,u32 addr, u32 mask, u32 data) { - #define READ_NEXT_PAIR(v1, v2, i) do\ -{ i += 2; v1 = Array[i]; \ -v2 = Array[i+1]; } while (0) - - u32 hex = 0; - u32 i = 0; - u8 platform= pDM_Odm->SupportPlatform; - u8 interfaceValue = pDM_Odm->SupportInterface; - u8 board = pDM_Odm->BoardType; - u32 ArrayLen= sizeof(Array_RadioA_1T_8188E)/sizeof(u32); - u32*Array = Array_RadioA_1T_8188E; - boolbiol = false; - struct adapter *Adapter = pDM_Odm->Adapter; - struct xmit_frame *pxmit_frame = NULL; - u8 bndy_cnt = 1; - enum HAL_STATUS rst = HAL_STATUS_SUCCESS; - - hex += board; - hex += interfaceValue << 8; - hex += platform << 16; - hex += 0xFF00; - biol = rtw_IOL_applied(Adapter); - - if (biol) { - pxmit_frame = rtw_IOL_accquire_xmit_frame(Adapter); - if (pxmit_frame == NULL) { - pr_info("rtw_IOL_accquire_xmit_frame failed\n"); - return HAL_STATUS_FAILURE; - } + if (addr == 0xfe) { + mdelay(50); + } else if (addr == 0xfd) { + mdelay(5); + } else if (addr == 0xfc) { + mdelay(1); + } else if (addr == 0xfb) { + udelay(50); + } else if (addr == 0xfa) { + udelay(