diff options
Diffstat (limited to 'drivers/staging/rtl8192u/r8192U_dm.c')
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.c | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index ee6b936..12dd19e 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -36,11 +36,12 @@ static u32 edca_setting_UL[HT_IOT_PEER_MAX] = { /*------------------------Define global variable-----------------------------*/ /* Debug variable ? */ -dig_t dm_digtable; +struct dig dm_digtable; /* Store current software write register content for MAC PHY. */ u8 dm_shadow[16][256] = { {0} }; /* For Dynamic Rx Path Selection by Signal Strength */ -DRxPathSel DM_RxPathSelTable; +struct dynamic_rx_path_sel DM_RxPathSelTable; + /*------------------------Define global variable-----------------------------*/ @@ -502,7 +503,7 @@ static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = { static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - bool bHighpowerstate, viviflag = FALSE; + bool bHighpowerstate, viviflag = false; DCMD_TXCMD_T tx_cmd; u8 powerlevelOFDM24G; int i = 0, j = 0, k = 0; @@ -558,13 +559,13 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) /* check if the report value is right */ for (k = 0; k < 5; k++) { if (tmp_report[k] <= 20) { - viviflag = TRUE; + viviflag = true; break; } } - if (viviflag == TRUE) { + if (viviflag == true) { write_nic_byte(dev, 0x1ba, 0); - viviflag = FALSE; + viviflag = false; RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n"); for (k = 0; k < 5; k++) tmp_report[k] = 0; @@ -587,7 +588,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) delta = TSSI_13dBm - Avg_TSSI_Meas_from_driver; if (delta <= E_FOR_TX_POWER_TRACK) { - priv->ieee80211->bdynamic_txpower_enable = TRUE; + priv->ieee80211->bdynamic_txpower_enable = true; write_nic_byte(dev, 0x1ba, 0); RT_TRACE(COMP_POWER_TRACKING, "tx power track is done\n"); RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex = %d\n", priv->rfa_txpowertrackingindex); @@ -624,10 +625,10 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) if (priv->cck_present_attentuation > -1 && priv->cck_present_attentuation < 23) { if (priv->ieee80211->current_network.channel == 14 && !priv->bcck_in_ch14) { - priv->bcck_in_ch14 = TRUE; + priv->bcck_in_ch14 = true; dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); } else if (priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) { - priv->bcck_in_ch14 = FALSE; + priv->bcck_in_ch14 = false; dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); } else dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); @@ -638,7 +639,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) RT_TRACE(COMP_POWER_TRACKING, "priv->cck_present_attentuation = %d\n", priv->cck_present_attentuation); if (priv->cck_present_attentuation_difference <= -12 || priv->cck_present_attentuation_difference >= 24) { - priv->ieee80211->bdynamic_txpower_enable = TRUE; + priv->ieee80211->bdynamic_txpower_enable = true; write_nic_byte(dev, 0x1ba, 0); RT_TRACE(COMP_POWER_TRACKING, "tx power track--->limited\n"); return; @@ -651,7 +652,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) break; } } - priv->ieee80211->bdynamic_txpower_enable = TRUE; + priv->ieee80211->bdynamic_txpower_enable = true; write_nic_byte(dev, 0x1ba, 0); } @@ -684,7 +685,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) break; } } - priv->btxpower_trackingInit = TRUE; + priv->btxpower_trackingInit = true; /*pHalData->TXPowercount = 0;*/ return; } @@ -717,7 +718,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) if (tmpCCK40Mindex >= CCK_Table_length) tmpCCK40Mindex = CCK_Table_length-1; } else { - tmpval = ((u8)tmpRegA - priv->ThermalMeter[0]); + tmpval = (u8)tmpRegA - priv->ThermalMeter[0]; if (tmpval >= 6) /* higher temperature */ tmpOFDMindex = tmpCCK20Mindex = 0; /* max to +6dB */ @@ -734,10 +735,10 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) tmpCCKindex = tmpCCK20Mindex; if (priv->ieee80211->current_network.channel == 14 && !priv->bcck_in_ch14) { - priv->bcck_in_ch14 = TRUE; + priv->bcck_in_ch14 = true; CCKSwingNeedUpdate = 1; } else if (priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) { - priv->bcck_in_ch14 = FALSE; + priv->bcck_in_ch14 = false; CCKSwingNeedUpdate = 1; } @@ -765,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work) struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq); struct net_device *dev = priv->ieee80211->dev; - if (priv->bDcut == TRUE) + if (priv->bDcut == true) dm_TXPowerTrackingCallback_TSSI(dev); else dm_TXPowerTrackingCallback_ThermalMeter(dev); @@ -1273,9 +1274,9 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev) priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[6] = 0x00; priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[7] = 0x00; - priv->btxpower_tracking = TRUE; + priv->btxpower_tracking = true; priv->txpower_count = 0; - priv->btxpower_trackingInit = FALSE; + priv->btxpower_trackingInit = false; } @@ -1289,18 +1290,18 @@ static void dm_InitializeTXPowerTracking_ThermalMeter(struct net_device *dev) * 3-wire by driver causes RF to go into a wrong state. */ if (priv->ieee80211->FwRWRF) - priv->btxpower_tracking = TRUE; + priv->btxpower_tracking = true; else - priv->btxpower_tracking = FALSE; + priv->btxpower_tracking = false; priv->txpower_count = 0; - priv->btxpower_trackingInit = FALSE; + priv->btxpower_trackingInit = false; } void dm_initialize_txpower_tracking(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - if (priv->bDcut == TRUE) + if (priv->bDcut == true) dm_InitializeTXPowerTracking_TSSI(dev); else dm_InitializeTXPowerTracking_ThermalMeter(dev); @@ -1356,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev) #ifdef RTL8190P dm_CheckTXPowerTracking_TSSI(dev); #else - if (priv->bDcut == TRUE) + if (priv->bDcut == true) dm_CheckTXPowerTracking_TSSI(dev); else dm_CheckTXPowerTracking_ThermalMeter(dev); @@ -1466,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14) { /* dm_CCKTxPowerAdjust */ struct r8192_priv *priv = ieee80211_priv(dev); - if (priv->bDcut == TRUE) + if (priv->bDcut == true) dm_CCKTxPowerAdjust_TSSI(dev, binch14); else dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14); @@ -1628,8 +1629,8 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, dm_digtable.rssi_low_thresh = dm_value; } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { dm_digtable.rssi_high_power_highthresh = dm_value; - } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { - dm_digtable.rssi_high_power_highthresh = dm_value; + } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_LOW) { + dm_digtable.rssi_high_power_lowthresh = dm_value; } else if (dm_type == DIG_TYPE_ENABLE) { dm_digtable.dig_state = DM_STA_DIG_MAX; dm_digtable.dig_enable_flag = true; @@ -2270,10 +2271,10 @@ static void dm_check_edca_turbo( /* For Each time updating EDCA parameter, reset EDCA turbo mode status. */ dm_init_edca_turbo(dev); u1bAIFS = qos_parameters->aifs[0] * ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime; - u4bAcParam = ((((u32)(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)| + u4bAcParam = (((u32)(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)| (((u32)(qos_parameters->cw_max[0])) << AC_PARAM_ECW_MAX_OFFSET)| (((u32)(qos_parameters->cw_min[0])) << AC_PARAM_ECW_MIN_OFFSET)| - ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET)); + ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET); /*write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam);*/ write_nic_dword(dev, EDCAPARA_BE, u4bAcParam); @@ -2314,7 +2315,7 @@ static void dm_init_ctstoself(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); - priv->ieee80211->bCTSToSelfEnable = TRUE; + priv->ieee80211->bCTSToSelfEnable = true; priv->ieee80211->CTSToSelfTH = CTSToSelfTHVal; } @@ -2327,7 +2328,7 @@ static void dm_ctstoself(struct net_device *dev) unsigned long curTxOkCnt = 0; unsigned long curRxOkCnt = 0; - if (priv->ieee80211->bCTSToSelfEnable != TRUE) { + if (priv->ieee80211->bCTSToSelfEnable != true) { pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; return; } @@ -2419,9 +2420,9 @@ void dm_rf_pathcheck_workitemcallback(struct work_struct *work) /* Check Bit 0-3, it means if RF A-D is enabled. */ for (i = 0; i < RF90_PATH_MAX; i++) { if (rfpath & (0x01<<i)) - priv->brfpath_rxenable[i] = 1; + priv->brfpath_rxenable[i] = true; else - priv->brfpath_rxenable[i] = 0; + priv->brfpath_rxenable[i] = false; } if (!DM_RxPathSelTable.Enable) return; @@ -2681,10 +2682,8 @@ static void dm_init_fsync(struct net_device *dev) priv->ieee80211->fsync_seconddiff_ratethreshold = 200; priv->ieee80211->fsync_state = Default_Fsync; priv->framesyncMonitor = 1; /* current default 0xc38 monitor on */ - - init_timer(&priv->fsync_timer); - priv->fsync_timer.data = (unsigned long)dev; - priv->fsync_timer.function = dm_fsync_timer_callback; + setup_timer(&priv->fsync_timer, dm_fsync_timer_callback, + (unsigned long)dev); } static void dm_deInit_fsync(struct net_device *dev) |