Commit 285b7c00 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman

staging: rtl8192e: Fix UNNECESSARY_ELSE warning

Fix checkpatch warnings 'else is not generally useful after a break or return'
Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 28eb1f3b
...@@ -2025,6 +2025,7 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev, ...@@ -2025,6 +2025,7 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
struct rx_fwinfo *pDrvInfo = NULL;
stats->bICV = pdesc->ICV; stats->bICV = pdesc->ICV;
stats->bCRC = pdesc->CRC32; stats->bCRC = pdesc->CRC32;
...@@ -2046,8 +2047,7 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev, ...@@ -2046,8 +2047,7 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev,
priv->stats.rxcrcerrmid++; priv->stats.rxcrcerrmid++;
} }
return false; return false;
} else { }
struct rx_fwinfo *pDrvInfo = NULL;
stats->RxDrvInfoSize = pdesc->RxDrvInfoSize; stats->RxDrvInfoSize = pdesc->RxDrvInfoSize;
stats->RxBufShift = ((pdesc->Shift)&0x03); stats->RxBufShift = ((pdesc->Shift)&0x03);
...@@ -2090,7 +2090,6 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev, ...@@ -2090,7 +2090,6 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev,
stats->fragoffset = 0; stats->fragoffset = 0;
stats->ntotalfrag = 1; stats->ntotalfrag = 1;
return true; return true;
}
} }
void rtl8192_halt_adapter(struct net_device *dev, bool reset) void rtl8192_halt_adapter(struct net_device *dev, bool reset)
...@@ -2314,7 +2313,6 @@ bool rtl8192_HalRxCheckStuck(struct net_device *dev) ...@@ -2314,7 +2313,6 @@ bool rtl8192_HalRxCheckStuck(struct net_device *dev)
(priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M)))) { (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M)))) {
if (rx_chk_cnt < 2) if (rx_chk_cnt < 2)
return bStuck; return bStuck;
else
rx_chk_cnt = 0; rx_chk_cnt = 0;
} else if ((((priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) && } else if ((((priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) &&
(priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M)) || (priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M)) ||
...@@ -2323,12 +2321,10 @@ bool rtl8192_HalRxCheckStuck(struct net_device *dev) ...@@ -2323,12 +2321,10 @@ bool rtl8192_HalRxCheckStuck(struct net_device *dev)
priv->undecorated_smoothed_pwdb >= VeryLowRSSI) { priv->undecorated_smoothed_pwdb >= VeryLowRSSI) {
if (rx_chk_cnt < 4) if (rx_chk_cnt < 4)
return bStuck; return bStuck;
else
rx_chk_cnt = 0; rx_chk_cnt = 0;
} else { } else {
if (rx_chk_cnt < 8) if (rx_chk_cnt < 8)
return bStuck; return bStuck;
else
rx_chk_cnt = 0; rx_chk_cnt = 0;
} }
......
...@@ -940,14 +940,12 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, ...@@ -940,14 +940,12 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
} }
if (CurrentCmd && CurrentCmd->CmdID == CmdID_End) { if (CurrentCmd && CurrentCmd->CmdID == CmdID_End) {
if ((*stage) == 2) { if ((*stage) == 2)
return true; return true;
} else {
(*stage)++; (*stage)++;
(*step) = 0; (*step) = 0;
continue; continue;
} }
}
if (!CurrentCmd) if (!CurrentCmd)
continue; continue;
......
...@@ -116,13 +116,12 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, ...@@ -116,13 +116,12 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n", RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
__func__); __func__);
return; return;
} else { }
down(&priv->rtllib->ips_sem); down(&priv->rtllib->ips_sem);
IPSLeave(dev); IPSLeave(dev);
up(&priv->rtllib->ips_sem); up(&priv->rtllib->ips_sem);
} }
} }
}
priv->rtllib->is_set_key = true; priv->rtllib->is_set_key = true;
if (EntryNo >= TOTAL_CAM_ENTRY) if (EntryNo >= TOTAL_CAM_ENTRY)
RT_TRACE(COMP_ERR, "cam entry exceeds in setKey()\n"); RT_TRACE(COMP_ERR, "cam entry exceeds in setKey()\n");
......
...@@ -204,9 +204,9 @@ u8 read_nic_io_byte(struct net_device *dev, int x) ...@@ -204,9 +204,9 @@ u8 read_nic_io_byte(struct net_device *dev, int x)
bool bIsLegalPage = false; bool bIsLegalPage = false;
u8 Data = 0; u8 Data = 0;
if (u4bPage == 0) { if (u4bPage == 0)
return 0xff&inb(dev->base_addr + x); return 0xff&inb(dev->base_addr + x);
} else {
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage, bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask); &u1PageMask);
if (bIsLegalPage) { if (bIsLegalPage) {
...@@ -217,7 +217,6 @@ u8 read_nic_io_byte(struct net_device *dev, int x) ...@@ -217,7 +217,6 @@ u8 read_nic_io_byte(struct net_device *dev, int x)
Data = read_nic_io_byte(dev, (x & 0xff)); Data = read_nic_io_byte(dev, (x & 0xff));
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask)); write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
} }
}
return Data; return Data;
} }
...@@ -229,9 +228,8 @@ u16 read_nic_io_word(struct net_device *dev, int x) ...@@ -229,9 +228,8 @@ u16 read_nic_io_word(struct net_device *dev, int x)
bool bIsLegalPage = false; bool bIsLegalPage = false;
u16 Data = 0; u16 Data = 0;
if (u4bPage == 0) { if (u4bPage == 0)
return inw(dev->base_addr + x); return inw(dev->base_addr + x);
} else {
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage, bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask); &u1PageMask);
if (bIsLegalPage) { if (bIsLegalPage) {
...@@ -241,8 +239,6 @@ u16 read_nic_io_word(struct net_device *dev, int x) ...@@ -241,8 +239,6 @@ u16 read_nic_io_word(struct net_device *dev, int x)
(u8)u4bPage)); (u8)u4bPage));
Data = read_nic_io_word(dev, (x & 0xff)); Data = read_nic_io_word(dev, (x & 0xff));
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask)); write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
} }
return Data; return Data;
...@@ -255,9 +251,8 @@ u32 read_nic_io_dword(struct net_device *dev, int x) ...@@ -255,9 +251,8 @@ u32 read_nic_io_dword(struct net_device *dev, int x)
bool bIsLegalPage = false; bool bIsLegalPage = false;
u32 Data = 0; u32 Data = 0;
if (u4bPage == 0) { if (u4bPage == 0)
return inl(dev->base_addr + x); return inl(dev->base_addr + x);
} else {
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage, bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask); &u1PageMask);
if (bIsLegalPage) { if (bIsLegalPage) {
...@@ -267,8 +262,6 @@ u32 read_nic_io_dword(struct net_device *dev, int x) ...@@ -267,8 +262,6 @@ u32 read_nic_io_dword(struct net_device *dev, int x)
(u8)u4bPage)); (u8)u4bPage));
Data = read_nic_io_dword(dev, (x & 0xff)); Data = read_nic_io_dword(dev, (x & 0xff));
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask)); write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
} }
return Data; return Data;
...@@ -1331,10 +1324,10 @@ static short rtl8192_init(struct net_device *dev) ...@@ -1331,10 +1324,10 @@ static short rtl8192_init(struct net_device *dev)
dev->name, dev)) { dev->name, dev)) {
netdev_err(dev, "Error allocating IRQ %d", dev->irq); netdev_err(dev, "Error allocating IRQ %d", dev->irq);
return -1; return -1;
} else { }
priv->irq = dev->irq; priv->irq = dev->irq;
RT_TRACE(COMP_INIT, "IRQ %d\n", dev->irq); RT_TRACE(COMP_INIT, "IRQ %d\n", dev->irq);
}
if (rtl8192_pci_initdescring(dev) != 0) { if (rtl8192_pci_initdescring(dev) != 0) {
netdev_err(dev, "Endopoints initialization failed"); netdev_err(dev, "Endopoints initialization failed");
...@@ -1932,7 +1925,8 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1932,7 +1925,8 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (queue_index == TXCMD_QUEUE) { if (queue_index == TXCMD_QUEUE) {
rtl8192_tx_cmd(dev, skb); rtl8192_tx_cmd(dev, skb);
return 0; return 0;
} else { }
tcb_desc->RATRIndex = 7; tcb_desc->RATRIndex = 7;
tcb_desc->bTxDisableRateFallBack = 1; tcb_desc->bTxDisableRateFallBack = 1;
tcb_desc->bTxUseDriverAssingedRate = 1; tcb_desc->bTxUseDriverAssingedRate = 1;
...@@ -1941,8 +1935,6 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1941,8 +1935,6 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
ret = rtl8192_tx(dev, skb); ret = rtl8192_tx(dev, skb);
if (ret != 0) if (ret != 0)
kfree_skb(skb); kfree_skb(skb);
}
return ret; return ret;
} }
...@@ -2338,12 +2330,10 @@ static void rtl8192_rx_normal(struct net_device *dev) ...@@ -2338,12 +2330,10 @@ static void rtl8192_rx_normal(struct net_device *dev)
[priv->rx_idx[rx_queue_idx]]; [priv->rx_idx[rx_queue_idx]];
struct sk_buff *skb = priv->rx_buf[rx_queue_idx] struct sk_buff *skb = priv->rx_buf[rx_queue_idx]
[priv->rx_idx[rx_queue_idx]]; [priv->rx_idx[rx_queue_idx]];
if (pdesc->OWN) {
return;
} else {
struct sk_buff *new_skb; struct sk_buff *new_skb;
if (pdesc->OWN)
return;
if (!priv->ops->rx_query_status_descriptor(dev, &stats, if (!priv->ops->rx_query_status_descriptor(dev, &stats,
pdesc, skb)) pdesc, skb))
goto done; goto done;
...@@ -2408,7 +2398,6 @@ static void rtl8192_rx_normal(struct net_device *dev) ...@@ -2408,7 +2398,6 @@ static void rtl8192_rx_normal(struct net_device *dev)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
}
done: done:
pdesc->BufferAddress = *((dma_addr_t *)skb->cb); pdesc->BufferAddress = *((dma_addr_t *)skb->cb);
pdesc->OWN = 1; pdesc->OWN = 1;
......
...@@ -378,9 +378,8 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) ...@@ -378,9 +378,8 @@ static void dm_bandwidth_autoswitch(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||
!priv->rtllib->bandwidth_auto_switch.bautoswitch_enable) { !priv->rtllib->bandwidth_auto_switch.bautoswitch_enable)
return; return;
} else {
if (priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz == false) { if (priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz == false) {
if (priv->undecorated_smoothed_pwdb <= if (priv->undecorated_smoothed_pwdb <=
priv->rtllib->bandwidth_auto_switch.threshold_40Mhzto20Mhz) priv->rtllib->bandwidth_auto_switch.threshold_40Mhzto20Mhz)
...@@ -389,8 +388,6 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) ...@@ -389,8 +388,6 @@ static void dm_bandwidth_autoswitch(struct net_device *dev)
if (priv->undecorated_smoothed_pwdb >= if (priv->undecorated_smoothed_pwdb >=
priv->rtllib->bandwidth_auto_switch.threshold_20Mhzto40Mhz) priv->rtllib->bandwidth_auto_switch.threshold_20Mhzto40Mhz)
priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz = false; priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz = false;
}
} }
} }
...@@ -581,7 +578,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) ...@@ -581,7 +578,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
"priv->CCKPresentAttentuation = %d\n", "priv->CCKPresentAttentuation = %d\n",
priv->CCKPresentAttentuation); priv->CCKPresentAttentuation);
return; return;
} else { }
if (Avg_TSSI_Meas_from_driver < TSSI_13dBm - E_FOR_TX_POWER_TRACK) { if (Avg_TSSI_Meas_from_driver < TSSI_13dBm - E_FOR_TX_POWER_TRACK) {
if (RF_Type == RF_2T4R) { if (RF_Type == RF_2T4R) {
...@@ -722,7 +719,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) ...@@ -722,7 +719,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
RT_TRACE(COMP_POWER_TRACKING, "tx power track--->limited\n"); RT_TRACE(COMP_POWER_TRACKING, "tx power track--->limited\n");
return; return;
} }
}
write_nic_byte(dev, Pw_Track_Flag, 0); write_nic_byte(dev, Pw_Track_Flag, 0);
Avg_TSSI_Meas_from_driver = 0; Avg_TSSI_Meas_from_driver = 0;
for (k = 0; k < 5; k++) for (k = 0; k < 5; k++)
...@@ -1401,14 +1398,13 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev) ...@@ -1401,14 +1398,13 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
TxPowerCheckCnt = 5; TxPowerCheckCnt = 5;
else else
TxPowerCheckCnt = 2; TxPowerCheckCnt = 2;
if (!priv->btxpower_tracking) { if (!priv->btxpower_tracking)
return; return;
} else {
if (priv->txpower_count <= TxPowerCheckCnt) { if (priv->txpower_count <= TxPowerCheckCnt) {
priv->txpower_count++; priv->txpower_count++;
return; return;
} }
}
if (!TM_Trigger) { if (!TM_Trigger) {
{ {
...@@ -1419,15 +1415,12 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev) ...@@ -1419,15 +1415,12 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
} }
TM_Trigger = 1; TM_Trigger = 1;
return; return;
} else { }
netdev_info(dev, netdev_info(dev, "===============>Schedule TxPowerTrackingWorkItem\n");
"===============>Schedule TxPowerTrackingWorkItem\n");
queue_delayed_work_rsl(priv->priv_wq, &priv->txpower_tracking_wq, 0); queue_delayed_work_rsl(priv->priv_wq, &priv->txpower_tracking_wq, 0);
TM_Trigger = 0; TM_Trigger = 0;
}
} }
static void dm_check_txpower_tracking(struct net_device *dev) static void dm_check_txpower_tracking(struct net_device *dev)
{ {
...@@ -1835,7 +1828,6 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( ...@@ -1835,7 +1828,6 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm(
if (dm_digtable.dig_state == DM_STA_DIG_OFF && if (dm_digtable.dig_state == DM_STA_DIG_OFF &&
(priv->reset_count == reset_cnt)) (priv->reset_count == reset_cnt))
return; return;
else
reset_cnt = priv->reset_count; reset_cnt = priv->reset_count;
dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX; dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
...@@ -1865,12 +1857,11 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( ...@@ -1865,12 +1857,11 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm(
(priv->reset_count == reset_cnt)) { (priv->reset_count == reset_cnt)) {
dm_ctrl_initgain_byrssi_highpwr(dev); dm_ctrl_initgain_byrssi_highpwr(dev);
return; return;
} else { }
if (priv->reset_count != reset_cnt) if (priv->reset_count != reset_cnt)
reset_flag = 1; reset_flag = 1;
reset_cnt = priv->reset_count; reset_cnt = priv->reset_count;
}
dm_digtable.dig_state = DM_STA_DIG_ON; dm_digtable.dig_state = DM_STA_DIG_ON;
...@@ -1912,7 +1903,6 @@ static void dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev) ...@@ -1912,7 +1903,6 @@ static void dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON && if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON &&
(priv->reset_count == reset_cnt_highpwr)) (priv->reset_count == reset_cnt_highpwr))
return; return;
else
dm_digtable.dig_highpwr_state = DM_STA_DIG_ON; dm_digtable.dig_highpwr_state = DM_STA_DIG_ON;
if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
...@@ -1923,7 +1913,6 @@ static void dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev) ...@@ -1923,7 +1913,6 @@ static void dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF && if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF &&
(priv->reset_count == reset_cnt_highpwr)) (priv->reset_count == reset_cnt_highpwr))
return; return;
else
dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF; dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF;
if (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_lowthresh && if (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_lowthresh &&
......
...@@ -202,14 +202,13 @@ void rtllib_ips_leave_wq(struct net_device *dev) ...@@ -202,14 +202,13 @@ void rtllib_ips_leave_wq(struct net_device *dev)
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n", RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
__func__); __func__);
return; return;
} else { }
netdev_info(dev, "=========>%s(): IPSLeave\n", netdev_info(dev, "=========>%s(): IPSLeave\n",
__func__); __func__);
queue_work_rsl(priv->rtllib->wq, queue_work_rsl(priv->rtllib->wq,
&priv->rtllib->ips_leave_wq); &priv->rtllib->ips_leave_wq);
} }
} }
}
} }
void rtllib_ips_leave(struct net_device *dev) void rtllib_ips_leave(struct net_device *dev)
......
...@@ -346,9 +346,8 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a, ...@@ -346,9 +346,8 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
__func__); __func__);
up(&priv->wx_sem); up(&priv->wx_sem);
return -1; return -1;
} else { }
netdev_info(dev, netdev_info(dev, "=========>%s(): IPSLeave\n",
"=========>%s(): IPSLeave\n",
__func__); __func__);
down(&priv->rtllib->ips_sem); down(&priv->rtllib->ips_sem);
IPSLeave(dev); IPSLeave(dev);
...@@ -356,7 +355,6 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a, ...@@ -356,7 +355,6 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
} }
} }
} }
}
ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b); ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b);
up(&priv->wx_sem); up(&priv->wx_sem);
...@@ -509,16 +507,14 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a, ...@@ -509,16 +507,14 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
__func__); __func__);
up(&priv->wx_sem); up(&priv->wx_sem);
return -1; return -1;
} else { }
RT_TRACE(COMP_PS, RT_TRACE(COMP_PS, "=========>%s(): IPSLeave\n",
"=========>%s(): IPSLeave\n",
__func__); __func__);
down(&priv->rtllib->ips_sem); down(&priv->rtllib->ips_sem);
IPSLeave(dev); IPSLeave(dev);
up(&priv->rtllib->ips_sem); up(&priv->rtllib->ips_sem);
} }
} }
}
rtllib_stop_scan(priv->rtllib); rtllib_stop_scan(priv->rtllib);
if (priv->rtllib->LedControlHandler) if (priv->rtllib->LedControlHandler)
priv->rtllib->LedControlHandler(dev, priv->rtllib->LedControlHandler(dev,
......
...@@ -135,16 +135,14 @@ u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate) ...@@ -135,16 +135,14 @@ u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate)
u8 is40MHz = 0; u8 is40MHz = 0;
u8 isShortGI = 0; u8 isShortGI = 0;
if (nDataRate < 12) { if (nDataRate < 12)
return CCKOFDMRate[nDataRate]; return CCKOFDMRate[nDataRate];
} else {
if (nDataRate >= 0x10 && nDataRate <= 0x1f) { if (nDataRate >= 0x10 && nDataRate <= 0x1f) {
is40MHz = 0; is40MHz = 0;
isShortGI = 0; isShortGI = 0;
} else if (nDataRate >= 0x20 && nDataRate <= 0x2f) { } else if (nDataRate >= 0x20 && nDataRate <= 0x2f) {
is40MHz = 1; is40MHz = 1;
isShortGI = 0; isShortGI = 0;
} else if (nDataRate >= 0x30 && nDataRate <= 0x3f) { } else if (nDataRate >= 0x30 && nDataRate <= 0x3f) {
is40MHz = 0; is40MHz = 0;
isShortGI = 1; isShortGI = 1;
...@@ -153,7 +151,6 @@ u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate) ...@@ -153,7 +151,6 @@ u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate)
isShortGI = 1; isShortGI = 1;
} }
return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate&0xf]; return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate&0xf];
}
} }
bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
......
...@@ -311,6 +311,11 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, ...@@ -311,6 +311,11 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{ {
u8 UP = 0; u8 UP = 0;
union tspec_body TSpec;
union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo;
struct list_head *pUnusedList;
struct list_head *pAddmitList;
enum direction_value Dir;
if (is_multicast_ether_addr(Addr)) { if (is_multicast_ether_addr(Addr)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, RTLLIB_DEBUG(RTLLIB_DL_ERR,
...@@ -348,30 +353,27 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, ...@@ -348,30 +353,27 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
} }
*ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect); *ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect);
if (*ppTS != NULL) { if (*ppTS != NULL)
return true; return true;
} else {
if (!bAddNewTs) { if (!bAddNewTs) {
RTLLIB_DEBUG(RTLLIB_DL_TS, RTLLIB_DEBUG(RTLLIB_DL_TS,
"add new TS failed(tid:%d)\n", UP); "add new TS failed(tid:%d)\n", UP);
return false; return false;
} else { }
union tspec_body TSpec;
union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo; pUnusedList = (TxRxSelect == TX_DIR) ?
struct list_head *pUnusedList =
(TxRxSelect == TX_DIR) ?
(&ieee->Tx_TS_Unused_List) : (&ieee->Tx_TS_Unused_List) :
(&ieee->Rx_TS_Unused_List); (&ieee->Rx_TS_Unused_List);
struct list_head *pAddmitList = pAddmitList = (TxRxSelect == TX_DIR) ?
(TxRxSelect == TX_DIR) ?
(&ieee->Tx_TS_Admit_List) : (&ieee->Tx_TS_Admit_List) :
(&ieee->Rx_TS_Admit_List); (&ieee->Rx_TS_Admit_List);
enum direction_value Dir = Dir = (ieee->iw_mode == IW_MODE_MASTER) ?
(ieee->iw_mode == IW_MODE_MASTER) ?
((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) : ((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) :
((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN); ((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN);
RTLLIB_DEBUG(RTLLIB_DL_TS, "to add Ts\n"); RTLLIB_DEBUG(RTLLIB_DL_TS, "to add Ts\n");
if (!list_empty(pUnusedList)) { if (!list_empty(pUnusedList)) {
(*ppTS) = list_entry(pUnusedList->next, (*ppTS) = list_entry(pUnusedList->next,
...@@ -409,14 +411,12 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, ...@@ -409,14 +411,12 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
list_add_tail(&((*ppTS)->List), pAddmitList); list_add_tail(&((*ppTS)->List), pAddmitList);
return true; return true;
} else { }
RTLLIB_DEBUG(RTLLIB_DL_ERR, RTLLIB_DEBUG(RTLLIB_DL_ERR,
"ERR!!in function %s() There is not enough dir=%d(0=up down=1) TS record to be used!!", "ERR!!in function %s() There is not enough dir=%d(0=up down=1) TS record to be used!!",
__func__, Dir); __func__, Dir);
return false; return false;
}
}
}
} }
static void RemoveTsEntry(struct rtllib_device *ieee, struct ts_common_info *pTs, static void RemoveTsEntry(struct rtllib_device *ieee, struct ts_common_info *pTs,
......
...@@ -783,7 +783,8 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -783,7 +783,8 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
memcpy(rxb->dst, dst, ETH_ALEN); memcpy(rxb->dst, dst, ETH_ALEN);
rxb->subframes[0]->dev = ieee->dev; rxb->subframes[0]->dev = ieee->dev;
return 1; return 1;
} else { }
rxb->nr_subframes = 0; rxb->nr_subframes = 0;
memcpy(rxb->src, src, ETH_ALEN); memcpy(rxb->src, src, ETH_ALEN);
memcpy(rxb->dst, dst, ETH_ALEN); memcpy(rxb->dst, dst, ETH_ALEN);
...@@ -850,7 +851,6 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -850,7 +851,6 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
} }
return rxb->nr_subframes; return rxb->nr_subframes;
}
} }
......
...@@ -2540,14 +2540,13 @@ static void rtllib_resume_tx(struct rtllib_device *ieee) ...@@ -2540,14 +2540,13 @@ static void rtllib_resume_tx(struct rtllib_device *ieee)
if (ieee->queue_stop) { if (ieee->queue_stop) {
ieee->tx_pending.frag = i; ieee->tx_pending.frag = i;
return; return;
} else { }
ieee->softmac_data_hard_start_xmit( ieee->softmac_data_hard_start_xmit(
ieee->tx_pending.txb->fragments[i], ieee->tx_pending.txb->fragments[i],
ieee->dev, ieee->rate); ieee->dev, ieee->rate);
ieee->stats.tx_packets++; ieee->stats.tx_packets++;
} }
}
rtllib_txb_free(ieee->tx_pending.txb); rtllib_txb_free(ieee->tx_pending.txb);
ieee->tx_pending.txb = NULL; ieee->tx_pending.txb = NULL;
......
...@@ -413,6 +413,8 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, ...@@ -413,6 +413,8 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee,
struct cb_desc *tcb_desc, struct cb_desc *tcb_desc,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct rt_hi_throughput *pHTInfo;
tcb_desc->bRTSSTBC = false; tcb_desc->bRTSSTBC = false;
tcb_desc->bRTSUseShortGI = false; tcb_desc->bRTSUseShortGI = false;
tcb_desc->bCTSEnable = false; tcb_desc->bCTSEnable = false;
...@@ -435,8 +437,9 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, ...@@ -435,8 +437,9 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee,
tcb_desc->rts_rate = MGN_24M; tcb_desc->rts_rate = MGN_24M;
} }
return; return;
} else { }
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
pHTInfo = ieee->pHTInfo;
while (true) { while (true) {
if (pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) { if (pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) {
...@@ -479,7 +482,6 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, ...@@ -479,7 +482,6 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee,
} }
goto NO_PROTECTION; goto NO_PROTECTION;
} }
}
if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
tcb_desc->bUseShortPreamble = true; tcb_desc->bUseShortPreamble = true;
if (ieee->iw_mode == IW_MODE_MASTER) if (ieee->iw_mode == IW_MODE_MASTER)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment