(GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
- ether_addr_equal_unaligned(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, \
- __pTa)
+ ether_addr_equal_unaligned( \
+ GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
#include "rtl_dm.h"
#include "rtl_wx.h"
-static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI, EDCAPARA_VO};
+static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI,
+ EDCAPARA_VO};
void rtl8192e_start_beacon(struct net_device *dev)
{
u8 u1bAIFS;
u32 u4bAcParam;
u8 mode = priv->rtllib->mode;
- struct rtllib_qos_parameters *qos_parameters =
+ struct rtllib_qos_parameters *qop =
&priv->rtllib->current_network.qos_data.parameters;
- u1bAIFS = qos_parameters->aifs[pAcParam] *
+ u1bAIFS = qop->aifs[pAcParam] *
((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime;
dm_init_edca_turbo(dev);
- u4bAcParam = (((le16_to_cpu(
- qos_parameters->tx_op_limit[pAcParam])) <<
- AC_PARAM_TXOP_LIMIT_OFFSET) |
- ((le16_to_cpu(qos_parameters->cw_max[pAcParam])) <<
- AC_PARAM_ECW_MAX_OFFSET) |
- ((le16_to_cpu(qos_parameters->cw_min[pAcParam])) <<
- AC_PARAM_ECW_MIN_OFFSET) |
- (((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET));
+ u4bAcParam = (le16_to_cpu(qop->tx_op_limit[pAcParam]) <<
+ AC_PARAM_TXOP_LIMIT_OFFSET) |
+ ((le16_to_cpu(qop->cw_max[pAcParam])) <<
+ AC_PARAM_ECW_MAX_OFFSET) |
+ ((le16_to_cpu(qop->cw_min[pAcParam])) <<
+ AC_PARAM_ECW_MIN_OFFSET) |
+ (((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET);
RT_TRACE(COMP_DBG, "%s():HW_VAR_AC_PARAM eACI:%x:%x\n",
__func__, eACI, u4bAcParam);
u32 file_length = 0;
u8 *mapped_file = NULL;
- u8 init_step = 0;
+ u8 i = 0;
enum opt_rst_type rst_opt = OPT_SYSTEM_RESET;
enum firmware_init_step starting_state = FW_INIT_STEP0_BOOT;
"PlatformInitFirmware: undefined firmware state\n");
}
- for (init_step = starting_state; init_step <= FW_INIT_STEP2_DATA;
- init_step++) {
+ for (i = starting_state; i <= FW_INIT_STEP2_DATA; i++) {
if (rst_opt == OPT_SYSTEM_RESET) {
- if (pfirmware->firmware_buf_size[init_step] == 0) {
+ if (pfirmware->firmware_buf_size[i] == 0) {
const char *fw_name[3] = {
RTL8192E_BOOT_IMG_FW,
RTL8192E_MAIN_IMG_FW,
int rc;
rc = request_firmware(&fw_entry,
- fw_name[init_step],
+ fw_name[i],
&priv->pdev->dev);
if (rc < 0) {
RT_TRACE(COMP_FIRMWARE,
goto download_firmware_fail;
}
if (fw_entry->size >
- sizeof(pfirmware->firmware_buf[init_step])) {
+ sizeof(pfirmware->firmware_buf[i])) {
RT_TRACE(COMP_FIRMWARE,
"img file size exceed the container struct buffer fail!\n");
goto download_firmware_fail;
}
- if (init_step != FW_INIT_STEP1_MAIN) {
- memcpy(pfirmware->firmware_buf[init_step],
+ if (i != FW_INIT_STEP1_MAIN) {
+ memcpy(pfirmware->firmware_buf[i],
fw_entry->data, fw_entry->size);
- pfirmware->firmware_buf_size[init_step] =
+ pfirmware->firmware_buf_size[i] =
fw_entry->size;
} else {
- memset(pfirmware->firmware_buf[init_step],
+ memset(pfirmware->firmware_buf[i],
0, 128);
- memcpy(&pfirmware->firmware_buf[init_step][128],
+ memcpy(&pfirmware->firmware_buf[i][128],
fw_entry->data, fw_entry->size);
- pfirmware->firmware_buf_size[init_step] =
+ pfirmware->firmware_buf_size[i] =
fw_entry->size + 128;
}
}
}
- mapped_file = pfirmware->firmware_buf[init_step];
- file_length = pfirmware->firmware_buf_size[init_step];
+ mapped_file = pfirmware->firmware_buf[i];
+ file_length = pfirmware->firmware_buf_size[i];
rt_status = fw_download_code(dev, mapped_file, file_length);
if (!rt_status)
goto download_firmware_fail;
- if (!firmware_check_ready(dev, init_step))
+ if (!firmware_check_ready(dev, i))
goto download_firmware_fail;
}
priv->DefaultInitialGain[3] = read_nic_byte(dev, rOFDM0_XDAGCCore1);
RT_TRACE(COMP_INIT,
"Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n",
- priv->DefaultInitialGain[0], priv->DefaultInitialGain[1],
- priv->DefaultInitialGain[2], priv->DefaultInitialGain[3]);
+ priv->DefaultInitialGain[0], priv->DefaultInitialGain[1],
+ priv->DefaultInitialGain[2], priv->DefaultInitialGain[3]);
priv->framesync = read_nic_byte(dev, rOFDM0_RxDetector3);
priv->framesyncC34 = read_nic_dword(dev, rOFDM0_RxDetector2);
int i, rx_queue_idx;
for (rx_queue_idx = 0; rx_queue_idx < MAX_RX_QUEUE; rx_queue_idx++) {
- priv->rx_ring[rx_queue_idx] =
- pci_zalloc_consistent(priv->pdev,
+ priv->rx_ring[rx_queue_idx] = pci_zalloc_consistent(priv->pdev,
sizeof(*priv->rx_ring[rx_queue_idx]) * priv->rxringcount,
&priv->rx_ring_dma[rx_queue_idx]);
if (!priv->rx_ring[rx_queue_idx] ||
if (IS_HARDWARE_TYPE_8192SE(dev))
dm_Init_WA_Broadcom_IOT(dev);
- INIT_DELAYED_WORK_RSL(&priv->gpio_change_rf_wq, (void *)dm_CheckRfCtrlGPIO, dev);
+ INIT_DELAYED_WORK_RSL(&priv->gpio_change_rf_wq,
+ (void *)dm_CheckRfCtrlGPIO, dev);
}
void deinit_hal_dm(struct net_device *dev)
static void dm_check_ac_dc_power(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- static char *ac_dc_check_script_path = "/etc/acpi/wireless-rtl-ac-dc-power.sh";
- char *argv[] = {ac_dc_check_script_path, DRV_NAME, NULL};
+ static char *ac_dc_script = "/etc/acpi/wireless-rtl-ac-dc-power.sh";
+ char *argv[] = {ac_dc_script, DRV_NAME, NULL};
static char *envp[] = {"HOME=/",
"TERM=linux",
"PATH=/usr/bin:/bin",
if (priv->rtllib->state != RTLLIB_LINKED)
return;
- call_usermodehelper(ac_dc_check_script_path, argv, envp, UMH_WAIT_PROC);
+ call_usermodehelper(ac_dc_script, argv, envp, UMH_WAIT_PROC);
return;
};
{
struct r8192_priv *priv = rtllib_priv(dev);
- struct rate_adaptive *pra = (struct rate_adaptive *)&priv->rate_adaptive;
+ struct rate_adaptive *pra = &priv->rate_adaptive;
pra->ratr_state = DM_RATR_STA_MAX;
pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High;
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo;
- struct rate_adaptive *pra = (struct rate_adaptive *)&priv->rate_adaptive;
+ struct rate_adaptive *pra = &priv->rate_adaptive;
u32 currentRATR, targetRATR = 0;
u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0;
bool bshort_gi_enabled = false;
static u8 ping_rssi_state;
if (!priv->up) {
- RT_TRACE(COMP_RATE, "<---- dm_check_rate_adaptive(): driver is going to unload\n");
+ RT_TRACE(COMP_RATE,
+ "<---- dm_check_rate_adaptive(): driver is going to unload\n");
return;
}
if (priv->rtllib->state == RTLLIB_LINKED) {
- bshort_gi_enabled = (pHTInfo->bCurTxBW40MHz && pHTInfo->bCurShortGI40MHz) ||
- (!pHTInfo->bCurTxBW40MHz && pHTInfo->bCurShortGI20MHz);
-
+ bshort_gi_enabled = (pHTInfo->bCurTxBW40MHz &&
+ pHTInfo->bCurShortGI40MHz) ||
+ (!pHTInfo->bCurTxBW40MHz &&
+ pHTInfo->bCurShortGI20MHz);
pra->upper_rssi_threshold_ratr =
- (pra->upper_rssi_threshold_ratr & (~BIT31)) | ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->upper_rssi_threshold_ratr & (~BIT31)) |
+ ((bshort_gi_enabled) ? BIT31 : 0);
pra->middle_rssi_threshold_ratr =
- (pra->middle_rssi_threshold_ratr & (~BIT31)) | ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->middle_rssi_threshold_ratr & (~BIT31)) |
+ ((bshort_gi_enabled) ? BIT31 : 0);
if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) {
pra->low_rssi_threshold_ratr =
- (pra->low_rssi_threshold_ratr_40M & (~BIT31)) | ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->low_rssi_threshold_ratr_40M & (~BIT31)) |
+ ((bshort_gi_enabled) ? BIT31 : 0);
} else {
pra->low_rssi_threshold_ratr =
- (pra->low_rssi_threshold_ratr_20M & (~BIT31)) | ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->low_rssi_threshold_ratr_20M & (~BIT31)) |
+ ((bshort_gi_enabled) ? BIT31 : 0);
}
pra->ping_rssi_ratr =
- (pra->ping_rssi_ratr & (~BIT31)) | ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->ping_rssi_ratr & (~BIT31)) |
+ ((bshort_gi_enabled) ? BIT31 : 0);
if (pra->ratr_state == DM_RATR_STA_HIGH) {
HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra;
(pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M);
}
- if (priv->undecorated_smoothed_pwdb >= (long)HighRSSIThreshForRA) {
+ if (priv->undecorated_smoothed_pwdb >=
+ (long)HighRSSIThreshForRA) {
pra->ratr_state = DM_RATR_STA_HIGH;
targetRATR = pra->upper_rssi_threshold_ratr;
- } else if (priv->undecorated_smoothed_pwdb >= (long)LowRSSIThreshForRA) {
+ } else if (priv->undecorated_smoothed_pwdb >=
+ (long)LowRSSIThreshForRA) {
pra->ratr_state = DM_RATR_STA_MIDDLE;
targetRATR = pra->middle_rssi_threshold_ratr;
} else {
}
if (pra->ping_rssi_enable) {
- if (priv->undecorated_smoothed_pwdb < (long)(pra->ping_rssi_thresh_for_ra+5)) {
- if ((priv->undecorated_smoothed_pwdb < (long)pra->ping_rssi_thresh_for_ra) ||
+ if (priv->undecorated_smoothed_pwdb <
+ (long)(pra->ping_rssi_thresh_for_ra+5)) {
+ if ((priv->undecorated_smoothed_pwdb <
+ (long)pra->ping_rssi_thresh_for_ra) ||
ping_rssi_state) {
pra->ratr_state = DM_RATR_STA_LOW;
targetRATR = pra->ping_rssi_ratr;
if (viviflag) {
write_nic_byte(dev, Pw_Track_Flag, 0);
viviflag = false;
- RT_TRACE(COMP_POWER_TRACKING, "we filted this data\n");
+ RT_TRACE(COMP_POWER_TRACKING,
+ "we filted this data\n");
for (k = 0; k < 5; k++)
tmp_report[k] = 0;
break;
for (k = 0; k < 5; k++)
Avg_TSSI_Meas_from_driver += tmp_report[k];
- Avg_TSSI_Meas_from_driver = Avg_TSSI_Meas_from_driver*100/5;
+ Avg_TSSI_Meas_from_driver *= 100 / 5;
RT_TRACE(COMP_POWER_TRACKING,
"Avg_TSSI_Meas_from_driver = %d\n",
Avg_TSSI_Meas_from_driver);
int i = 0, CCKSwingNeedUpdate = 0;
if (!priv->btxpower_trackingInit) {
- tmpRegA = rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance, bMaskDWord);
+ tmpRegA = rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance,
+ bMaskDWord);
for (i = 0; i < OFDM_Table_Length; i++) {
if (tmpRegA == OFDMSwingTable[i]) {
priv->OFDM_index[0] = (u8)i;
- RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, OFDM_index = 0x%x\n",
- rOFDM0_XATxIQImbalance, tmpRegA, priv->OFDM_index[0]);
+ RT_TRACE(COMP_POWER_TRACKING,
+ "Initial reg0x%x = 0x%x, OFDM_index = 0x%x\n",
+ rOFDM0_XATxIQImbalance, tmpRegA,
+ priv->OFDM_index[0]);
}
}
if (tx_power_track_counter >= 180) {
- queue_delayed_work_rsl(priv->priv_wq, &priv->txpower_tracking_wq, 0);
+ queue_delayed_work_rsl(priv->priv_wq,
+ &priv->txpower_tracking_wq, 0);
tx_power_track_counter = 0;
}
}
}
-static void dm_CCKTxPowerAdjust_ThermalMeter(struct net_device *dev, bool bInCH14)
+static void dm_CCKTxPowerAdjust_ThermalMeter(struct net_device *dev,
+ bool bInCH14)
{
u32 TempVal;
struct r8192_priv *priv = rtllib_priv(dev);
TempVal = 0;
if (!bInCH14) {
- TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][0] +
- (CCKSwingTable_Ch1_Ch13[priv->CCK_index][1]<<8);
+ TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][0] +
+ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][1] << 8);
rtl8192_setBBreg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal);
- RT_TRACE(COMP_POWER_TRACKING, "CCK not chnl 14, reg 0x%x = 0x%x\n",
- rCCK0_TxFilter1, TempVal);
- TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][2] +
- (CCKSwingTable_Ch1_Ch13[priv->CCK_index][3]<<8) +
- (CCKSwingTable_Ch1_Ch13[priv->CCK_index][4]<<16)+
- (CCKSwingTable_Ch1_Ch13[priv->CCK_index][5]<<24);
+ RT_TRACE(COMP_POWER_TRACKING,
+ "CCK not chnl 14, reg 0x%x = 0x%x\n", rCCK0_TxFilter1,
+ TempVal);
+ TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][2] +
+ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][3] << 8) +
+ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][4] << 16)+
+ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][5] << 24);
rtl8192_setBBreg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal);
- RT_TRACE(COMP_POWER_TRACKING, "CCK not chnl 14, reg 0x%x = 0x%x\n",
- rCCK0_TxFilter2, TempVal);
- TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][6] +
- (CCKSwingTable_Ch1_Ch13[priv->CCK_index][7]<<8);
+ RT_TRACE(COMP_POWER_TRACKING,
+ "CCK not chnl 14, reg 0x%x = 0x%x\n", rCCK0_TxFilter2,
+ TempVal);
+ TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][6] +
+ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][7] << 8);
rtl8192_setBBreg(dev, rCCK0_DebugPort, bMaskLWord, TempVal);
- RT_TRACE(COMP_POWER_TRACKING, "CCK not chnl 14, reg 0x%x = 0x%x\n",
- rCCK0_DebugPort, TempVal);
+ RT_TRACE(COMP_POWER_TRACKING,
+ "CCK not chnl 14, reg 0x%x = 0x%x\n", rCCK0_DebugPort,
+ TempVal);
} else {
- TempVal = CCKSwingTable_Ch14[priv->CCK_index][0] +
- (CCKSwingTable_Ch14[priv->CCK_index][1]<<8);
+ TempVal = CCKSwingTable_Ch14[priv->CCK_index][0] +
+ (CCKSwingTable_Ch14[priv->CCK_index][1] << 8);
rtl8192_setBBreg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal);
RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n",
rCCK0_TxFilter1, TempVal);
- TempVal = CCKSwingTable_Ch14[priv->CCK_index][2] +
- (CCKSwingTable_Ch14[priv->CCK_index][3]<<8) +
- (CCKSwingTable_Ch14[priv->CCK_index][4]<<16)+
- (CCKSwingTable_Ch14[priv->CCK_index][5]<<24);
+ TempVal = CCKSwingTable_Ch14[priv->CCK_index][2] +
+ (CCKSwingTable_Ch14[priv->CCK_index][3] << 8) +
+ (CCKSwingTable_Ch14[priv->CCK_index][4] << 16)+
+ (CCKSwingTable_Ch14[priv->CCK_index][5] << 24);
rtl8192_setBBreg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal);
RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n",
rCCK0_TxFilter2, TempVal);
- TempVal = CCKSwingTable_Ch14[priv->CCK_index][6] +
- (CCKSwingTable_Ch14[priv->CCK_index][7]<<8);
+ TempVal = CCKSwingTable_Ch14[priv->CCK_index][6] +
+ (CCKSwingTable_Ch14[priv->CCK_index][7]<<8);
rtl8192_setBBreg(dev, rCCK0_DebugPort, bMaskLWord, TempVal);
RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n",
rCCK0_DebugPort, TempVal);
}
- }
+}
void dm_cck_txpower_adjust(struct net_device *dev, bool binch14)
{
u32 ratr_value;
if (!priv->up) {
- RT_TRACE(COMP_RATE, "<---- dm_restore_dynamic_mechanism_state(): driver is going to unload\n");
+ RT_TRACE(COMP_RATE,
+ "<---- dm_restore_dynamic_mechanism_state(): driver is going to unload\n");
return;
}
dm_digtable.dig_state = DM_STA_DIG_MAX;
dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
- dm_digtable.CurSTAConnectState = dm_digtable.PreSTAConnectState = DIG_STA_DISCONNECT;
- dm_digtable.CurAPConnectState = dm_digtable.PreAPConnectState = DIG_AP_DISCONNECT;
+ dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT;
+ dm_digtable.PreSTAConnectState = DIG_STA_DISCONNECT;
+ dm_digtable.CurAPConnectState = DIG_AP_DISCONNECT;
+ dm_digtable.PreAPConnectState = DIG_AP_DISCONNECT;
dm_digtable.initialgain_lowerbound_state = false;
dm_digtable.rssi_low_thresh = DM_DIG_THRESH_LOW;
struct r8192_priv *priv = rtllib_priv(dev);
static u32 reset_cnt_highpwr;
- if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_high_power_lowthresh) &&
- (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_highthresh))
+ if ((priv->undecorated_smoothed_pwdb >
+ dm_digtable.rssi_high_power_lowthresh) &&
+ (priv->undecorated_smoothed_pwdb <
+ dm_digtable.rssi_high_power_highthresh))
return;
- if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_power_highthresh) {
+ if (priv->undecorated_smoothed_pwdb >=
+ dm_digtable.rssi_high_power_highthresh) {
if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON &&
(priv->reset_count == reset_cnt_highpwr))
return;
return;
dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF;
- if (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_lowthresh &&
- priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) {
+ if ((priv->undecorated_smoothed_pwdb <
+ dm_digtable.rssi_high_power_lowthresh) &&
+ (priv->undecorated_smoothed_pwdb >=
+ dm_digtable.rssi_high_thresh)) {
if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20);
else
if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) {
if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) {
- if ((dm_digtable.rssi_val+10-dm_digtable.backoff_val) > dm_digtable.rx_gain_range_max)
- dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_max;
- else if ((dm_digtable.rssi_val+10-dm_digtable.backoff_val) < dm_digtable.rx_gain_range_min)
- dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_min;
- else
- dm_digtable.cur_ig_value = dm_digtable.rssi_val+10-dm_digtable.backoff_val;
+ long gain_range = dm_digtable.rssi_val + 10 -
+ dm_digtable.backoff_val;
+ gain_range = clamp_t(long, gain_range,
+ dm_digtable.rx_gain_range_min,
+ dm_digtable.rx_gain_range_max);
+ dm_digtable.cur_ig_value = gain_range;
} else {
if (dm_digtable.cur_ig_value == 0)
dm_digtable.cur_ig_value = priv->DefaultInitialGain[0];
if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) {
if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) {
- if (dm_digtable.rssi_val >= dm_digtable.rssi_high_power_highthresh)
- dm_digtable.curpd_thstate = DIG_PD_AT_HIGH_POWER;
- else if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh)
- dm_digtable.curpd_thstate = DIG_PD_AT_LOW_POWER;
- else if ((dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh) &&
- (dm_digtable.rssi_val < dm_digtable.rssi_high_power_lowthresh))
- dm_digtable.curpd_thstate = DIG_PD_AT_NORMAL_POWER;
+ if (dm_digtable.rssi_val >=
+ dm_digtable.rssi_high_power_highthresh)
+ dm_digtable.curpd_thstate =
+ DIG_PD_AT_HIGH_POWER;
+ else if (dm_digtable.rssi_val <=
+ dm_digtable.rssi_low_thresh)
+ dm_digtable.curpd_thstate =
+ DIG_PD_AT_LOW_POWER;
+ else if ((dm_digtable.rssi_val >=
+ dm_digtable.rssi_high_thresh) &&
+ (dm_digtable.rssi_val <
+ dm_digtable.rssi_high_power_lowthresh))
+ dm_digtable.curpd_thstate =
+ DIG_PD_AT_NORMAL_POWER;
else
- dm_digtable.curpd_thstate = dm_digtable.prepd_thstate;
+ dm_digtable.curpd_thstate =
+ dm_digtable.prepd_thstate;
} else {
dm_digtable.curpd_thstate = DIG_PD_AT_LOW_POWER;
}
write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x00);
else
write_nic_byte(dev, rOFDM0_RxDetector1, 0x42);
- } else if (dm_digtable.curpd_thstate == DIG_PD_AT_NORMAL_POWER) {
+ } else if (dm_digtable.curpd_thstate ==
+ DIG_PD_AT_NORMAL_POWER) {
if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20);
else
if (priv->bcurrent_turbo_EDCA) {
u8 tmp = AC0_BE;
- priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)(&tmp));
+ priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM,
+ (u8 *)(&tmp));
priv->bcurrent_turbo_EDCA = false;
}
}
bool bActuallySet = false;
char *argv[3];
static char *RadioPowerPath = "/etc/acpi/events/RadioPower.sh";
- static char *envp[] = {"HOME=/", "TERM=linux", "PATH=/usr/bin:/bin", NULL};
+ static char *envp[] = {"HOME=/", "TERM=linux", "PATH=/usr/bin:/bin",
+ NULL};
bActuallySet = false;
if (bActuallySet) {
mdelay(1000);
priv->bHwRfOffAction = 1;
- MgntActSet_RF_State(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW, true);
+ MgntActSet_RF_State(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW,
+ true);
if (priv->bHwRadioOff)
argv[1] = "RFOFF";
else
if (wrqu->data.length > IW_ESSID_MAX_SIZE)
return -E2BIG;
down(&priv->wx_sem);
- wrqu->data.length = min_t(size_t, wrqu->data.length, sizeof(priv->nick));
+ wrqu->data.length = min_t(size_t, wrqu->data.length,
+ sizeof(priv->nick));
memset(priv->nick, 0, sizeof(priv->nick));
memcpy(priv->nick, extra, wrqu->data.length);
up(&priv->wx_sem);
return false;
}
-static u8 HTIOTActIsDisableEDCATurbo(struct rtllib_device *ieee, u8 *PeerMacAddr)
+static u8 HTIOTActIsDisableEDCATurbo(struct rtllib_device *ieee,
+ u8 *PeerMacAddr)
{
return false;
}
if (index == 0)
pRxTs->RxIndicateSeq = pReorderEntry->SeqNum;
- if (SN_LESS(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) ||
- SN_EQUAL(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq)) {
+ if (SN_LESS(pReorderEntry->SeqNum,
+ pRxTs->RxIndicateSeq) ||
+ SN_EQUAL(pReorderEntry->SeqNum,
+ pRxTs->RxIndicateSeq)) {
list_del_init(&pReorderEntry->List);
if (SN_EQUAL(pReorderEntry->SeqNum,
if (bPktInBuf && (pRxTs->RxTimeoutIndicateSeq == 0xffff)) {
pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq;
mod_timer(&pRxTs->RxPktPendingTimer, jiffies +
- msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime));
+ msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime)
+ );
}
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
}
if (!search_dir[dir])
continue;
list_for_each_entry(pRet, psearch_list, List) {
- if (memcmp(pRet->Addr, Addr, 6) == 0)
- if (pRet->TSpec.f.TSInfo.field.ucTSID == TID)
- if (pRet->TSpec.f.TSInfo.field.ucDirection == dir)
- break;
+ if (memcmp(pRet->Addr, Addr, 6) == 0 &&
+ pRet->TSpec.f.TSInfo.field.ucTSID == TID &&
+ pRet->TSpec.f.TSInfo.field.ucDirection == dir)
+ break;
}
if (&pRet->List != psearch_list)
return false;
}
-static void RemoveTsEntry(struct rtllib_device *ieee, struct ts_common_info *pTs,
- enum tr_select TxRxSelect)
+static void RemoveTsEntry(struct rtllib_device *ieee,
+ struct ts_common_info *pTs, enum tr_select TxRxSelect)
{
del_timer_sync(&pTs->SetupTimer);
del_timer_sync(&pTs->InactTimer);
#include "dot11d.h"
static inline void rtllib_monitor_rx(struct rtllib_device *ieee,
- struct sk_buff *skb, struct rtllib_rx_stats *rx_status,
- size_t hdr_length)
+ struct sk_buff *skb,
+ struct rtllib_rx_stats *rx_status,
+ size_t hdr_length)
{
skb->dev = ieee->dev;
skb_reset_mac_header(skb);
struct rtllib_hdr_4addrqos *hdr_4addrqos;
u8 tid;
- if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) && RTLLIB_QOS_HAS_SEQ(fc)) {
+ if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) &&
+ RTLLIB_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct rtllib_hdr_4addrqos *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & RTLLIB_QCTL_TID;
tid = UP2AC(tid);
2 /* alignment */ +
8 /* WEP */ +
ETH_ALEN /* WDS */ +
- (RTLLIB_QOS_HAS_SEQ(fc) ? 2 : 0) /* QOS Control */);
+ /* QOS Control */
+ (RTLLIB_QOS_HAS_SEQ(fc) ? 2 : 0));
if (skb == NULL)
return NULL;
struct rtllib_hdr_4addrqos *hdr_4addrqos;
u8 tid;
- if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) && RTLLIB_QOS_HAS_SEQ(fc)) {
+ if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) &&
+ RTLLIB_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct rtllib_hdr_4addrqos *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & RTLLIB_QCTL_TID;
tid = UP2AC(tid);
return 0;
if (ieee->hwsec_active) {
- struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+ struct cb_desc *tcb_desc = (struct cb_desc *)
+ (skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->bHwSec = 1;
if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
return 0;
if (ieee->hwsec_active) {
- struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+ struct cb_desc *tcb_desc = (struct cb_desc *)
+ (skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->bHwSec = 1;
struct rtllib_hdr_4addrqos *hdr_4addrqos;
u8 tid;
- if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) && RTLLIB_QOS_HAS_SEQ(fc)) {
+ if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) &&
+ RTLLIB_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct rtllib_hdr_4addrqos *)header;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & RTLLIB_QCTL_TID;
tid = UP2AC(tid);
break;
}
if (p == &ieee->ibss_mac_hash[index]) {
- entry = kmalloc(sizeof(struct ieee_ibss_seq), GFP_ATOMIC);
+ entry = kmalloc(sizeof(struct ieee_ibss_seq),
+ GFP_ATOMIC);
if (!entry)
return 0;
return true;
}
-void rtllib_indicate_packets(struct rtllib_device *ieee, struct rtllib_rxb **prxbIndicateArray, u8 index)
+void rtllib_indicate_packets(struct rtllib_device *ieee,
+ struct rtllib_rxb **prxbIndicateArray, u8 index)
{
struct net_device_stats *stats = &ieee->stats;
u8 i = 0, j = 0;
/* convert hdr + possible LLC headers into Ethernet header */
ethertype = (sub_skb->data[6] << 8) | sub_skb->data[7];
if (sub_skb->len >= 8 &&
- ((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 &&
- ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
- memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
+ ((memcmp(sub_skb->data, rfc1042_header,
+ SNAP_SIZE) == 0 &&
+ ethertype != ETH_P_AARP &&
+ ethertype != ETH_P_IPX) ||
+ memcmp(sub_skb->data, bridge_tunnel_header,
+ SNAP_SIZE) == 0)) {
/* remove RFC1042 or Bridge-Tunnel encapsulation
* and replace EtherType
*/
stats->rx_bytes += sub_skb->len;
memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
- sub_skb->protocol = eth_type_trans(sub_skb, ieee->dev);
+ sub_skb->protocol = eth_type_trans(sub_skb,
+ ieee->dev);
sub_skb->dev = ieee->dev;
sub_skb->dev->stats.rx_packets++;
sub_skb->dev->stats.rx_bytes += sub_skb->len;
- sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */
+ /* 802.11 crc not sufficient */
+ sub_skb->ip_summed = CHECKSUM_NONE;
ieee->last_rx_ps_time = jiffies;
netif_rx(sub_skb);
}
}
}
-void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, struct rx_ts_record *pTS)
+void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee,
+ struct rx_ts_record *pTS)
{
struct rx_reorder_entry *pRxReorderEntry;
u8 RfdCnt = 0;
break;
}
- pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->RxPendingPktList.prev, struct rx_reorder_entry, List);
+ pRxReorderEntry = (struct rx_reorder_entry *)
+ list_entry(pTS->RxPendingPktList.prev,
+ struct rx_reorder_entry, List);
netdev_dbg(ieee->dev, "%s(): Indicate SeqNum %d!\n", __func__,
pRxReorderEntry->SeqNum);
list_del_init(&pRxReorderEntry->List);
ieee->RfdArray[RfdCnt] = pRxReorderEntry->prxb;
RfdCnt = RfdCnt + 1;
- list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List);
+ list_add_tail(&pRxReorderEntry->List,
+ &ieee->RxReorder_Unused_List);
}
rtllib_indicate_packets(ieee, ieee->RfdArray, RfdCnt);
if (SeqNum >= (WinSize - 1))
pTS->RxIndicateSeq = SeqNum + 1 - WinSize;
else
- pTS->RxIndicateSeq = 4095 - (WinSize - (SeqNum + 1)) + 1;
- netdev_dbg(ieee->dev,
- "Window Shift! IndicateSeq: %d, NewSeq: %d\n",
- pTS->RxIndicateSeq, SeqNum);
+ pTS->RxIndicateSeq = 4095 -
+ (WinSize - (SeqNum + 1)) + 1;
+ netdev_dbg(ieee->dev,
+ "Window Shift! IndicateSeq: %d, NewSeq: %d\n",
+ pTS->RxIndicateSeq, SeqNum);
}
/* Indication process.
*/
if (bMatchWinStart) {
/* Current packet is going to be indicated.*/
- netdev_dbg(ieee->dev, "Packets indication! IndicateSeq: %d, NewSeq: %d\n",
+ netdev_dbg(ieee->dev,
+ "Packets indication! IndicateSeq: %d, NewSeq: %d\n",
pTS->RxIndicateSeq, SeqNum);
ieee->prxbIndicateArray[0] = prxb;
index = 1;
struct rx_reorder_entry, List);
list_del_init(&pReorderEntry->List);
- /* Make a reorder entry and insert into a the packet list.*/
+ /* Make a reorder entry and insert
+ * into a the packet list.
+ */
pReorderEntry->SeqNum = SeqNum;
pReorderEntry->prxb = prxb;
if (!AddReorderEntry(pTS, pReorderEntry)) {
+ int i;
+
netdev_dbg(ieee->dev,
"%s(): Duplicate packet is dropped. IndicateSeq: %d, NewSeq: %d\n",
__func__, pTS->RxIndicateSeq,
SeqNum);
list_add_tail(&pReorderEntry->List,
- &ieee->RxReorder_Unused_List); {
- int i;
+ &ieee->RxReorder_Unused_List);
- for (i = 0; i < prxb->nr_subframes; i++)
- dev_kfree_skb(prxb->subframes[i]);
- kfree(prxb);
- prxb = NULL;
- }
+ for (i = 0; i < prxb->nr_subframes; i++)
+ dev_kfree_skb(prxb->subframes[i]);
+ kfree(prxb);
+ prxb = NULL;
} else {
netdev_dbg(ieee->dev,
"Pkt insert into struct buffer. IndicateSeq: %d, NewSeq: %d\n",
netdev_dbg(ieee->dev, "%s(): start RREORDER indicate\n",
__func__);
- pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->RxPendingPktList.prev,
- struct rx_reorder_entry, List);
+ pReorderEntry = (struct rx_reorder_entry *)
+ list_entry(pTS->RxPendingPktList.prev,
+ struct rx_reorder_entry,
+ List);
if (SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) ||
- SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) {
+ SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) {
/* This protect struct buffer from overflow. */
if (index >= REORDER_WIN_SIZE) {
netdev_err(ieee->dev,
list_del_init(&pReorderEntry->List);
if (SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq))
- pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % 4096;
+ pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) %
+ 4096;
ieee->prxbIndicateArray[index] = pReorderEntry->prxb;
netdev_dbg(ieee->dev, "%s(): Indicate SeqNum %d!\n",
!ieee->current_network.qos_data.active ||
!IsDataFrame(skb->data) ||
IsLegacyDataFrame(skb->data)) {
- if (!((type == RTLLIB_FTYPE_MGMT) && (stype == RTLLIB_STYPE_BEACON))) {
+ if (!((type == RTLLIB_FTYPE_MGMT) &&
+ (stype == RTLLIB_STYPE_BEACON))) {
if (is_duplicate_packet(ieee, hdr))
return -1;
}
/* {broad,multi}cast packets to our BSS go through */
if (is_multicast_ether_addr(dst)) {
- if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN))
+ if (memcmp(bssid, ieee->current_network.bssid,
+ ETH_ALEN))
return -1;
}
}
return 0;
}
-static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, u8 nr_subframes)
+static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
+ u8 nr_subframes)
{
if (unicast) {
/*Filter pkt has too small length */
hdrlen = rtllib_rx_get_hdrlen(ieee, skb, rx_stats);
if (skb->len < hdrlen) {
- netdev_info(dev, "%s():ERR!!! skb->len is smaller than hdrlen\n",
+ netdev_info(dev,
+ "%s():ERR!!! skb->len is smaller than hdrlen\n",
__func__);
goto rx_dropped;
}
goto rx_dropped;
/* Send pspoll based on moredata */
- if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->sta_sleep == LPS_IS_SLEEP)
- && (ieee->polling) && (!bToOtherSTA)) {
+ if ((ieee->iw_mode == IW_MODE_INFRA) &&
+ (ieee->sta_sleep == LPS_IS_SLEEP) &&
+ (ieee->polling) && (!bToOtherSTA)) {
if (WLAN_FC_MORE_DATA(fc)) {
- /* more data bit is set, let's request a new frame from the AP */
+ /* more data bit is set, let's request a new frame
+ * from the AP
+ */
rtllib_sta_ps_send_pspoll_frame(ieee);
} else {
ieee->polling = false;
&& (!bToOtherSTA)) {
TID = Frame_QoSTID(skb->data);
SeqNum = WLAN_GET_SEQ_SEQ(sc);
- GetTs(ieee, (struct ts_common_info **) &pTS, hdr->addr2, TID, RX_DIR, true);
+ GetTs(ieee, (struct ts_common_info **) &pTS, hdr->addr2, TID,
+ RX_DIR, true);
if (TID != 0 && TID != 3)
ieee->bis_any_nonbepkts = true;
}
/* to parse amsdu packets */
/* qos data packets & reserved bit is 1 */
if (parse_subframe(ieee, skb, rx_stats, rxb, src, dst) == 0) {
- /* only to free rxb, and not submit the packets to upper layer */
+ /* only to free rxb, and not submit the packets
+ * to upper layer
+ */
for (i = 0; i < rxb->nr_subframes; i++)
dev_kfree_skb(rxb->subframes[i]);
kfree(rxb);
}
/* Indicate packets to upper layer or Rx Reorder */
- if (ieee->pHTInfo->bCurRxReorderEnable == false || pTS == NULL || bToOtherSTA)
+ if (ieee->pHTInfo->bCurRxReorderEnable == false || pTS == NULL ||
+ bToOtherSTA)
rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src);
else
RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum);
/* Parse a QoS parameter element */
static int rtllib_read_qos_param_element(struct rtllib_qos_parameter_info
- *element_param, struct rtllib_info_element
- *info_element)
+ *element_param,
+ struct rtllib_info_element
+ *info_element)
{
int ret = 0;
u16 size = sizeof(struct rtllib_qos_parameter_info) - 2;
}
/* Parse a QoS information element */
-static int rtllib_read_qos_info_element(struct
- rtllib_qos_information_element
- *element_info, struct rtllib_info_element
- *info_element)
+static int rtllib_read_qos_info_element(struct rtllib_qos_information_element
+ *element_info,
+ struct rtllib_info_element
+ *info_element)
{
int ret = 0;
u16 size = sizeof(struct rtllib_qos_information_element) - 2;
if (info_element == NULL)
return -1;
- if ((info_element->id == QOS_ELEMENT_ID) && (info_element->len == size)) {
+ if ((info_element->id == QOS_ELEMENT_ID) &&
+ (info_element->len == size)) {
memcpy(element_info->qui, info_element->data,
info_element->len);
element_info->elementID = info_element->id;
if (ret == 0)
ret = rtllib_verify_qos_info(element_info,
- QOS_OUI_INFO_SUB_TYPE);
+ QOS_OUI_INFO_SUB_TYPE);
return ret;
}
/* Write QoS parameters from the ac parameters. */
static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info *param_elm,
- struct rtllib_qos_data *qos_data)
+ struct rtllib_qos_data *qos_data)
{
struct rtllib_qos_ac_parameter *ac_params;
struct rtllib_qos_parameters *qos_param = &(qos_data->parameters);
/* WMM spec P.11: The minimum value for AIFSN shall be 2 */
qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2 : qos_param->aifs[aci];
- qos_param->cw_min[aci] = cpu_to_le16(ac_params->ecw_min_max & 0x0F);
+ qos_param->cw_min[aci] = cpu_to_le16(ac_params->ecw_min_max &
+ 0x0F);
- qos_param->cw_max[aci] = cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 4);
+ qos_param->cw_max[aci] = cpu_to_le16((ac_params->ecw_min_max &
+ 0xF0) >> 4);
qos_param->flag[aci] =
(ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
{
if (IS_DOT11D_ENABLE(ieee)) {
if (info_element->len != 0) {
- memcpy(network->CountryIeBuf, info_element->data, info_element->len);
+ memcpy(network->CountryIeBuf, info_element->data,
+ info_element->len);
network->CountryIeLen = info_element->len;
if (!IS_COUNTRY_IE_VALID(ieee)) {
- if (rtllib_act_scanning(ieee, false) && ieee->FirstIe_InScan)
+ if (rtllib_act_scanning(ieee, false) &&
+ ieee->FirstIe_InScan)
netdev_info(ieee->dev,
"Received beacon ContryIE, SSID: <%s>\n",
network->ssid);
- Dot11d_UpdateCountryIe(ieee, addr2, info_element->len, info_element->data);
+ Dot11d_UpdateCountryIe(ieee, addr2,
+ info_element->len,
+ info_element->data);
}
}
network->MBssidMask = network->CcxRmState[1] & 0x07;
if (network->MBssidMask != 0) {
network->bMBssidValid = true;
- network->MBssidMask = 0xff << (network->MBssidMask);
+ network->MBssidMask = 0xff <<
+ (network->MBssidMask);
ether_addr_copy(network->MBssid,
network->bssid);
network->MBssid[5] &= network->MBssidMask;
network->ssid_len = min(info_element->len,
(u8) IW_ESSID_MAX_SIZE);
- memcpy(network->ssid, info_element->data, network->ssid_len);
+ memcpy(network->ssid, info_element->data,
+ network->ssid_len);
if (network->ssid_len < IW_ESSID_MAX_SIZE)
memset(network->ssid + network->ssid_len, 0,
IW_ESSID_MAX_SIZE - network->ssid_len);
case MFIE_TYPE_HT_INFO:
netdev_dbg(ieee->dev, "MFIE_TYPE_HT_INFO: %d bytes\n",
info_element->len);
- tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN);
+ tmp_htinfo_len = min_t(u8, info_element->len,
+ MAX_IE_LEN);
if (tmp_htinfo_len) {
network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE;
network->bssht.bdHTInfoLen = tmp_htinfo_len >
ieee->seq_ctrl[0]++;
/* check whether the managed packet queued greater than 5 */
- if (!ieee->check_nic_enough_desc(ieee->dev, tcb_desc->queue_index) ||
- (skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0) ||
- (ieee->queue_stop)) {
+ if (!ieee->check_nic_enough_desc(ieee->dev,
+ tcb_desc->queue_index) ||
+ skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) ||
+ ieee->queue_stop) {
/* insert the skb packet to the management queue
*
* as for the completion function, it does not need
}
}
-static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge, int chlen)
+static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge,
+ int chlen)
{
u8 *c;
struct sk_buff *skb;
/* Join the network for the first time */
ieee->AsocRetryCount = 0;
if ((ieee->current_network.qos_data.supported == 1) &&
- ieee->current_network.bssht.bdSupportHT)
+ ieee->current_network.bssht.bdSupportHT)
HTResetSelfAndSavePeerSetting(ieee,
&(ieee->current_network));
else
&ieee->associate_procedure_wq, 0);
} else {
if (rtllib_is_54g(&ieee->current_network) &&
- (ieee->modulation & RTLLIB_OFDM_MODULATION)) {
+ (ieee->modulation &
+ RTLLIB_OFDM_MODULATION)) {
ieee->rate = 108;
- ieee->SetWirelessMode(ieee->dev, IEEE_G);
- netdev_info(ieee->dev, "Using G rates\n");
+ ieee->SetWirelessMode(ieee->dev,
+ IEEE_G);
+ netdev_info(ieee->dev,
+ "Using G rates\n");
} else {
ieee->rate = 22;
- ieee->SetWirelessMode(ieee->dev, IEEE_B);
- netdev_info(ieee->dev, "Using B rates\n");
+ ieee->SetWirelessMode(ieee->dev,
+ IEEE_B);
+ netdev_info(ieee->dev,
+ "Using B rates\n");
}
memset(ieee->dot11HTOperationalRateSet, 0, 16);
ieee->state = RTLLIB_LINKED;
if (ieee->bAwakePktSent) {
pPSC->LPSAwakeIntvl = 1;
} else {
- u8 MaxPeriod = 1;
+ u8 MaxPeriod = 1;
if (pPSC->LPSAwakeIntvl == 0)
pPSC->LPSAwakeIntvl = 1;
}
EXPORT_SYMBOL(rtllib_ps_tx_ack);
-static void rtllib_process_action(struct rtllib_device *ieee, struct sk_buff *skb)
+static void rtllib_process_action(struct rtllib_device *ieee,
+ struct sk_buff *skb)
{
struct rtllib_hdr_3addr *header = (struct rtllib_hdr_3addr *) skb->data;
u8 *act = rtllib_get_payload((struct rtllib_hdr *)header);
}
-static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, u8 *asSta,
- u8 asRsn)
+static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib,
+ u8 *asSta, u8 asRsn)
{
u8 i;
u8 OpMode;
*
*
* 802.11 frame_control for data frames - 2 bytes
- * ,-----------------------------------------------------------------------------------------.
- * bits | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e |
- * |----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|------|
- * val | 0 | 0 | 0 | 1 | x | 0 | 0 | 0 | 1 | 0 | x | x | x | x | x |
- * |----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|------|
- * desc | ^-ver-^ | ^type-^ | ^-----subtype-----^ | to |from |more |retry| pwr |more |wep |
- * | | | x=0 data,x=1 data+ack | DS | DS |frag | | mgm |data | |
- * '-----------------------------------------------------------------------------------------'
- * /\
- * |
- * 802.11 Data Frame |
- * ,--------- 'ctrl' expands to >-----------'
+ * ,--------------------------------------------------------------------.
+ * bits | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e |
+ * |---|---|---|---|---|---|---|---|---|----|----|-----|-----|-----|----|
+ * val | 0 | 0 | 0 | 1 | x | 0 | 0 | 0 | 1 | 0 | x | x | x | x | x |
+ * |---|---|---|---|---|---|---|---|---|----|----|-----|-----|-----|----|
+ * desc | ver | type | ^-subtype-^ |to |from|more|retry| pwr |more |wep |
+ * | | | x=0 data |DS | DS |frag| | mgm |data | |
+ * | | | x=1 data+ack | | | | | | | |
+ * '--------------------------------------------------------------------'
+ * /\
+ * |
+ * 802.11 Data Frame |
+ * ,--------- 'ctrl' expands to >---'
* |
* ,--'---,-------------------------------------------------------------.
* Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
* `-----------------------------------------'
* Total: 18 non-data bytes
*
- * In the event that fragmentation is required, the incoming payload is split into
- * N parts of size ieee->fts. The first fragment contains the SNAP header and the
- * remaining packets are just data.
+ * In the event that fragmentation is required, the incoming payload is split
+ * into N parts of size ieee->fts. The first fragment contains the SNAP header
+ * and the remaining packets are just data.
*
- * If encryption is enabled, each fragment payload size is reduced by enough space
- * to add the prefix and postfix (IV and ICV totalling 8 bytes in the case of WEP)
- * So if you have 1500 bytes of payload with ieee->fts set to 500 without
- * encryption it will take 3 frames. With WEP it will take 4 frames as the
- * payload of each frame is reduced to 492 bytes.
+ * If encryption is enabled, each fragment payload size is reduced by enough
+ * space to add the prefix and postfix (IV and ICV totalling 8 bytes in
+ * the case of WEP) So if you have 1500 bytes of payload with ieee->fts set to
+ * 500 without encryption it will take 3 frames. With WEP it will take 4 frames
+ * as the payload of each frame is reduced to 492 bytes.
*
* SKB visualization
*