Commit ae0122b6 authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo

rtlwifi: rtl_pci: Fix formatting problems in pci.c

Checkpatch.pl reports a number of formatting problems in this source
file. None of the changes cause any functional changes in the driver.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 6bc05d5d
...@@ -54,8 +54,7 @@ static const u8 ac_to_hwq[] = { ...@@ -54,8 +54,7 @@ static const u8 ac_to_hwq[] = {
BK_QUEUE BK_QUEUE
}; };
static u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw, static u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw, struct sk_buff *skb)
struct sk_buff *skb)
{ {
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
__le16 fc = rtl_get_fc(skb); __le16 fc = rtl_get_fc(skb);
...@@ -104,20 +103,18 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) ...@@ -104,20 +103,18 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
break; break;
case 3: case 3:
/* /* Always enable ASPM and Clock Req
* Always enable ASPM and Clock Req
* from initialization to halt. * from initialization to halt.
* */ */
ppsc->reg_rfps_level &= ~(RT_RF_LPS_LEVEL_ASPM); ppsc->reg_rfps_level &= ~(RT_RF_LPS_LEVEL_ASPM);
ppsc->reg_rfps_level |= (RT_RF_PS_LEVEL_ALWAYS_ASPM | ppsc->reg_rfps_level |= (RT_RF_PS_LEVEL_ALWAYS_ASPM |
RT_RF_OFF_LEVL_CLK_REQ); RT_RF_OFF_LEVL_CLK_REQ);
break; break;
case 4: case 4:
/* /* Always enable ASPM without Clock Req
* Always enable ASPM without Clock Req
* from initialization to halt. * from initialization to halt.
* */ */
ppsc->reg_rfps_level &= ~(RT_RF_LPS_LEVEL_ASPM | ppsc->reg_rfps_level &= ~(RT_RF_LPS_LEVEL_ASPM |
RT_RF_OFF_LEVL_CLK_REQ); RT_RF_OFF_LEVL_CLK_REQ);
ppsc->reg_rfps_level |= RT_RF_PS_LEVEL_ALWAYS_ASPM; ppsc->reg_rfps_level |= RT_RF_PS_LEVEL_ALWAYS_ASPM;
...@@ -180,7 +177,8 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) ...@@ -180,7 +177,8 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
} }
/* toshiba aspm issue, toshiba will set aspm selfly /* toshiba aspm issue, toshiba will set aspm selfly
* so we should not set aspm in driver */ * so we should not set aspm in driver
*/
pci_read_config_byte(rtlpci->pdev, 0x80, &init_aspm); pci_read_config_byte(rtlpci->pdev, 0x80, &init_aspm);
if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8192SE && if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8192SE &&
init_aspm == 0x43) init_aspm == 0x43)
...@@ -263,8 +261,7 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) ...@@ -263,8 +261,7 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw)
udelay(50); udelay(50);
} }
/* /*Enable RTL8192SE ASPM & Enable Pci Bridge ASPM for
*Enable RTL8192SE ASPM & Enable Pci Bridge ASPM for
*power saving We should follow the sequence to enable *power saving We should follow the sequence to enable
*RTL8192SE first then enable Pci Bridge ASPM *RTL8192SE first then enable Pci Bridge ASPM
*or the system will show bluescreen. *or the system will show bluescreen.
...@@ -334,7 +331,7 @@ static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw) ...@@ -334,7 +331,7 @@ static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw)
bool status = false; bool status = false;
u8 offset_e0; u8 offset_e0;
unsigned offset_e4; unsigned int offset_e4;
pci_write_config_byte(rtlpci->pdev, 0xe0, 0xa0); pci_write_config_byte(rtlpci->pdev, 0xe0, 0xa0);
...@@ -369,12 +366,12 @@ static bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw, ...@@ -369,12 +366,12 @@ static bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw,
"tpcipriv->ndis_adapter.funcnumber %x\n", "tpcipriv->ndis_adapter.funcnumber %x\n",
tpcipriv->ndis_adapter.funcnumber); tpcipriv->ndis_adapter.funcnumber);
if ((pcipriv->ndis_adapter.busnumber == if (pcipriv->ndis_adapter.busnumber ==
tpcipriv->ndis_adapter.busnumber) && tpcipriv->ndis_adapter.busnumber &&
(pcipriv->ndis_adapter.devnumber == pcipriv->ndis_adapter.devnumber ==
tpcipriv->ndis_adapter.devnumber) && tpcipriv->ndis_adapter.devnumber &&
(pcipriv->ndis_adapter.funcnumber != pcipriv->ndis_adapter.funcnumber !=
tpcipriv->ndis_adapter.funcnumber)) { tpcipriv->ndis_adapter.funcnumber) {
find_buddy_priv = true; find_buddy_priv = true;
break; break;
} }
...@@ -441,7 +438,6 @@ static void rtl_pci_init_aspm(struct ieee80211_hw *hw) ...@@ -441,7 +438,6 @@ static void rtl_pci_init_aspm(struct ieee80211_hw *hw)
rtl_pci_enable_aspm(hw); rtl_pci_enable_aspm(hw);
RT_SET_PS_LEVEL(ppsc, RT_RF_PS_LEVEL_ALWAYS_ASPM); RT_SET_PS_LEVEL(ppsc, RT_RF_PS_LEVEL_ALWAYS_ASPM);
} }
} }
static void _rtl_pci_io_handler_init(struct device *dev, static void _rtl_pci_io_handler_init(struct device *dev,
...@@ -458,11 +454,11 @@ static void _rtl_pci_io_handler_init(struct device *dev, ...@@ -458,11 +454,11 @@ static void _rtl_pci_io_handler_init(struct device *dev,
rtlpriv->io.read8_sync = pci_read8_sync; rtlpriv->io.read8_sync = pci_read8_sync;
rtlpriv->io.read16_sync = pci_read16_sync; rtlpriv->io.read16_sync = pci_read16_sync;
rtlpriv->io.read32_sync = pci_read32_sync; rtlpriv->io.read32_sync = pci_read32_sync;
} }
static bool _rtl_update_earlymode_info(struct ieee80211_hw *hw, static bool _rtl_update_earlymode_info(struct ieee80211_hw *hw,
struct sk_buff *skb, struct rtl_tcb_desc *tcb_desc, u8 tid) struct sk_buff *skb,
struct rtl_tcb_desc *tcb_desc, u8 tid)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
...@@ -520,13 +516,15 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) ...@@ -520,13 +516,15 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
(rtlpriv->buddy_priv && (rtlpriv->buddy_priv &&
rtlpriv->buddy_priv->easy_concurrent_ctl.switch_in_process))) rtlpriv->buddy_priv->easy_concurrent_ctl.switch_in_process)))
return; return;
/* we juse use em for BE/BK/VI/VO */ /* we just use em for BE/BK/VI/VO */
for (tid = 7; tid >= 0; tid--) { for (tid = 7; tid >= 0; tid--) {
u8 hw_queue = ac_to_hwq[rtl_tid_to_ac(tid)]; u8 hw_queue = ac_to_hwq[rtl_tid_to_ac(tid)];
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue]; struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
while (!mac->act_scanning && while (!mac->act_scanning &&
rtlpriv->psc.rfpwr_state == ERFON) { rtlpriv->psc.rfpwr_state == ERFON) {
struct rtl_tcb_desc tcb_desc; struct rtl_tcb_desc tcb_desc;
memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc));
spin_lock_bh(&rtlpriv->locks.waitq_lock); spin_lock_bh(&rtlpriv->locks.waitq_lock);
...@@ -541,7 +539,8 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) ...@@ -541,7 +539,8 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
spin_unlock_bh(&rtlpriv->locks.waitq_lock); spin_unlock_bh(&rtlpriv->locks.waitq_lock);
/* Some macaddr can't do early mode. like /* Some macaddr can't do early mode. like
* multicast/broadcast/no_qos data */ * multicast/broadcast/no_qos data
*/
info = IEEE80211_SKB_CB(skb); info = IEEE80211_SKB_CB(skb);
if (info->flags & IEEE80211_TX_CTL_AMPDU) if (info->flags & IEEE80211_TX_CTL_AMPDU)
_rtl_update_earlymode_info(hw, skb, _rtl_update_earlymode_info(hw, skb,
...@@ -552,7 +551,6 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) ...@@ -552,7 +551,6 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
} }
} }
static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
...@@ -603,7 +601,6 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) ...@@ -603,7 +601,6 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
if (prio == TXCMD_QUEUE) { if (prio == TXCMD_QUEUE) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
goto tx_status_ok; goto tx_status_ok;
} }
/* for sw LPS, just after NULL skb send out, we can /* for sw LPS, just after NULL skb send out, we can
...@@ -643,15 +640,12 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) ...@@ -643,15 +640,12 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
ieee80211_tx_status_irqsafe(hw, skb); ieee80211_tx_status_irqsafe(hw, skb);
if ((ring->entries - skb_queue_len(&ring->queue)) <= 4) { if ((ring->entries - skb_queue_len(&ring->queue)) <= 4) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG, RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
"more desc left, wake skb_queue@%d, ring->idx = %d, skb_queue_len = 0x%x\n", "more desc left, wake skb_queue@%d, ring->idx = %d, skb_queue_len = 0x%x\n",
prio, ring->idx, prio, ring->idx,
skb_queue_len(&ring->queue)); skb_queue_len(&ring->queue));
ieee80211_wake_queue(hw, ieee80211_wake_queue(hw, skb_get_queue_mapping(skb));
skb_get_queue_mapping
(skb));
} }
tx_status_ok: tx_status_ok:
skb = NULL; skb = NULL;
...@@ -659,7 +653,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) ...@@ -659,7 +653,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
if (((rtlpriv->link_info.num_rx_inperiod + if (((rtlpriv->link_info.num_rx_inperiod +
rtlpriv->link_info.num_tx_inperiod) > 8) || rtlpriv->link_info.num_tx_inperiod) > 8) ||
(rtlpriv->link_info.num_rx_inperiod > 2)) rtlpriv->link_info.num_rx_inperiod > 2)
rtl_lps_leave(hw); rtl_lps_leave(hw);
} }
...@@ -817,7 +811,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -817,7 +811,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
new_skb = dev_alloc_skb(rtlpci->rxbuffersize); new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (unlikely(!new_skb)) if (unlikely(!new_skb))
goto no_new; goto no_new;
memset(&rx_status , 0 , sizeof(rx_status)); memset(&rx_status, 0, sizeof(rx_status));
rtlpriv->cfg->ops->query_rx_desc(hw, &stats, rtlpriv->cfg->ops->query_rx_desc(hw, &stats,
&rx_status, (u8 *)pdesc, skb); &rx_status, (u8 *)pdesc, skb);
...@@ -851,8 +845,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -851,8 +845,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
goto new_trx_end; goto new_trx_end;
} }
/* /* NOTICE This can not be use for mac80211,
* NOTICE This can not be use for mac80211,
* this is done in mac80211 code, * this is done in mac80211 code,
* if done here sec DHCP will fail * if done here sec DHCP will fail
* skb_trim(skb, skb->len - 4); * skb_trim(skb, skb->len - 4);
...@@ -889,9 +882,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -889,9 +882,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
/* for sw lps */ /* for sw lps */
rtl_swlps_beacon(hw, (void *)skb->data, skb->len); rtl_swlps_beacon(hw, (void *)skb->data, skb->len);
rtl_recognize_peer(hw, (void *)skb->data, skb->len); rtl_recognize_peer(hw, (void *)skb->data, skb->len);
if ((rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP) && if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP &&
(rtlpriv->rtlhal.current_bandtype == rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G &&
BAND_ON_2_4G) &&
(ieee80211_is_beacon(fc) || (ieee80211_is_beacon(fc) ||
ieee80211_is_probe_resp(fc))) { ieee80211_is_probe_resp(fc))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
...@@ -913,7 +905,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -913,7 +905,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
} }
if (((rtlpriv->link_info.num_rx_inperiod + if (((rtlpriv->link_info.num_rx_inperiod +
rtlpriv->link_info.num_tx_inperiod) > 8) || rtlpriv->link_info.num_tx_inperiod) > 8) ||
(rtlpriv->link_info.num_rx_inperiod > 2)) rtlpriv->link_info.num_rx_inperiod > 2)
rtl_lps_leave(hw); rtl_lps_leave(hw);
skb = new_skb; skb = new_skb;
no_new: no_new:
...@@ -952,30 +944,27 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -952,30 +944,27 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
if (rtlpci->irq_enabled == 0) if (rtlpci->irq_enabled == 0)
return ret; return ret;
spin_lock_irqsave(&rtlpriv->locks.irq_th_lock , flags); spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
rtlpriv->cfg->ops->disable_interrupt(hw); rtlpriv->cfg->ops->disable_interrupt(hw);
/*read ISR: 4/8bytes */ /*read ISR: 4/8bytes */
rtlpriv->cfg->ops->interrupt_recognized(hw, &inta, &intb); rtlpriv->cfg->ops->interrupt_recognized(hw, &inta, &intb);
/*Shared IRQ or HW disappared */ /*Shared IRQ or HW disappeared */
if (!inta || inta == 0xffff) if (!inta || inta == 0xffff)
goto done; goto done;
/*<1> beacon related */ /*<1> beacon related */
if (inta & rtlpriv->cfg->maps[RTL_IMR_TBDOK]) { if (inta & rtlpriv->cfg->maps[RTL_IMR_TBDOK])
RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
"beacon ok interrupt!\n"); "beacon ok interrupt!\n");
}
if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TBDER])) { if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TBDER]))
RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
"beacon err interrupt!\n"); "beacon err interrupt!\n");
}
if (inta & rtlpriv->cfg->maps[RTL_IMR_BDOK]) { if (inta & rtlpriv->cfg->maps[RTL_IMR_BDOK])
RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, "beacon interrupt!\n"); RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, "beacon interrupt!\n");
}
if (inta & rtlpriv->cfg->maps[RTL_IMR_BCNINT]) { if (inta & rtlpriv->cfg->maps[RTL_IMR_BCNINT]) {
RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
...@@ -1130,7 +1119,7 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) ...@@ -1130,7 +1119,7 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
/*NB: the beacon data buffer must be 32-bit aligned. */ /*NB: the beacon data buffer must be 32-bit aligned. */
pskb = ieee80211_beacon_get(hw, mac->vif); pskb = ieee80211_beacon_get(hw, mac->vif);
if (pskb == NULL) if (!pskb)
return; return;
hdr = rtl_get_hdr(pskb); hdr = rtl_get_hdr(pskb);
info = IEEE80211_SKB_CB(pskb); info = IEEE80211_SKB_CB(pskb);
...@@ -1152,7 +1141,6 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) ...@@ -1152,7 +1141,6 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc, true, HW_DESC_OWN, rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc, true, HW_DESC_OWN,
&temp_one); &temp_one);
} }
return;
} }
static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw)
...@@ -1171,8 +1159,7 @@ static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) ...@@ -1171,8 +1159,7 @@ static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw)
for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++)
rtlpci->txringcount[i] = desc_num; rtlpci->txringcount[i] = desc_num;
/* /*we just alloc 2 desc for beacon queue,
*we just alloc 2 desc for beacon queue,
*because we just need first desc in hw beacon. *because we just need first desc in hw beacon.
*/ */
rtlpci->txringcount[BEACON_QUEUE] = 2; rtlpci->txringcount[BEACON_QUEUE] = 2;
...@@ -1378,8 +1365,7 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw, ...@@ -1378,8 +1365,7 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw,
entry = (u8 *)(&ring->desc[ring->idx]); entry = (u8 *)(&ring->desc[ring->idx]);
pci_unmap_single(rtlpci->pdev, pci_unmap_single(rtlpci->pdev,
rtlpriv->cfg-> rtlpriv->cfg->ops->get_desc(hw, (u8 *)entry,
ops->get_desc(hw, (u8 *)entry,
true, true,
HW_DESC_TXBUFF_ADDR), HW_DESC_TXBUFF_ADDR),
skb->len, PCI_DMA_TODEVICE); skb->len, PCI_DMA_TODEVICE);
...@@ -1451,8 +1437,7 @@ static int _rtl_pci_init_trx_ring(struct ieee80211_hw *hw) ...@@ -1451,8 +1437,7 @@ static int _rtl_pci_init_trx_ring(struct ieee80211_hw *hw)
} }
for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) { for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) {
ret = _rtl_pci_init_tx_ring(hw, i, ret = _rtl_pci_init_tx_ring(hw, i, rtlpci->txringcount[i]);
rtlpci->txringcount[i]);
if (ret) if (ret)
goto err_free_rings; goto err_free_rings;
} }
...@@ -1510,8 +1495,8 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1510,8 +1495,8 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
entry = &rtlpci->rx_ring[rxring_idx].desc[i]; entry = &rtlpci->rx_ring[rxring_idx].desc[i];
bufferaddress = bufferaddress =
rtlpriv->cfg->ops->get_desc(hw, (u8 *)entry, rtlpriv->cfg->ops->get_desc(hw, (u8 *)entry,
false , HW_DESC_RXBUFF_ADDR); false, HW_DESC_RXBUFF_ADDR);
memset((u8 *)entry , 0 , memset((u8 *)entry, 0,
sizeof(*rtlpci->rx_ring sizeof(*rtlpci->rx_ring
[rxring_idx].desc));/*clear one entry*/ [rxring_idx].desc));/*clear one entry*/
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
...@@ -1540,8 +1525,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1540,8 +1525,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
rtlpci->rx_ring[rxring_idx].idx = 0; rtlpci->rx_ring[rxring_idx].idx = 0;
} }
/* /*after reset, release previous pending packet,
*after reset, release previous pending packet,
*and force the tx idx to the first one *and force the tx idx to the first one
*/ */
spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
...@@ -1674,7 +1658,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, ...@@ -1674,7 +1658,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw,
own = (u8)rtlpriv->cfg->ops->get_desc(hw, (u8 *)pdesc, own = (u8)rtlpriv->cfg->ops->get_desc(hw, (u8 *)pdesc,
true, HW_DESC_OWN); true, HW_DESC_OWN);
if ((own == 1) && (hw_queue != BEACON_QUEUE)) { if (own == 1 && hw_queue != BEACON_QUEUE) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"No more TX desc@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%x\n", "No more TX desc@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%x\n",
hw_queue, ring->idx, idx, hw_queue, ring->idx, idx,
...@@ -1690,8 +1674,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, ...@@ -1690,8 +1674,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw,
rtlpriv->cfg->ops->get_available_desc(hw, hw_queue) == 0) { rtlpriv->cfg->ops->get_available_desc(hw, hw_queue) == 0) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"get_available_desc fail\n"); "get_available_desc fail\n");
spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
flags);
return skb->len; return skb->len;
} }
...@@ -1779,7 +1762,6 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw) ...@@ -1779,7 +1762,6 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)
flush_workqueue(rtlpriv->works.rtl_wq); flush_workqueue(rtlpriv->works.rtl_wq);
destroy_workqueue(rtlpriv->works.rtl_wq); destroy_workqueue(rtlpriv->works.rtl_wq);
} }
static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
...@@ -1837,7 +1819,7 @@ static int rtl_pci_start(struct ieee80211_hw *hw) ...@@ -1837,7 +1819,7 @@ static int rtl_pci_start(struct ieee80211_hw *hw)
rtlpci->up_first_time = false; rtlpci->up_first_time = false;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "rtl_pci_start OK\n"); RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "%s OK\n", __func__);
return 0; return 0;
} }
...@@ -1848,13 +1830,12 @@ static void rtl_pci_stop(struct ieee80211_hw *hw) ...@@ -1848,13 +1830,12 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
unsigned long flags; unsigned long flags;
u8 RFInProgressTimeOut = 0; u8 rf_timeout = 0;
if (rtlpriv->cfg->ops->get_btc_status()) if (rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_halt_notify(); rtlpriv->btcoexist.btc_ops->btc_halt_notify();
/* /*should be before disable interrupt&adapter
*should be before disable interrupt&adapter
*and will do it immediately. *and will do it immediately.
*/ */
set_hal_stop(rtlhal); set_hal_stop(rtlhal);
...@@ -1866,12 +1847,12 @@ static void rtl_pci_stop(struct ieee80211_hw *hw) ...@@ -1866,12 +1847,12 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flags); spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flags);
while (ppsc->rfchange_inprogress) { while (ppsc->rfchange_inprogress) {
spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags); spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags);
if (RFInProgressTimeOut > 100) { if (rf_timeout > 100) {
spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flags); spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flags);
break; break;
} }
mdelay(1); mdelay(1);
RFInProgressTimeOut++; rf_timeout++;
spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flags); spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flags);
} }
ppsc->rfchange_inprogress = true; ppsc->rfchange_inprogress = true;
...@@ -1946,13 +1927,12 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, ...@@ -1946,13 +1927,12 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
venderid, deviceid); venderid, deviceid);
rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE;
break; break;
} }
} else if (deviceid == RTL_PCI_8723AE_DID) { } else if (deviceid == RTL_PCI_8723AE_DID) {
rtlhal->hw_type = HARDWARE_TYPE_RTL8723AE; rtlhal->hw_type = HARDWARE_TYPE_RTL8723AE;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"8723AE PCI-E is found - " "8723AE PCI-E is found - vid/did=%x/%x\n",
"vid/did=%x/%x\n", venderid, deviceid); venderid, deviceid);
} else if (deviceid == RTL_PCI_8192CET_DID || } else if (deviceid == RTL_PCI_8192CET_DID ||
deviceid == RTL_PCI_8192CE_DID || deviceid == RTL_PCI_8192CE_DID ||
deviceid == RTL_PCI_8191CE_DID || deviceid == RTL_PCI_8191CE_DID ||
...@@ -1973,19 +1953,19 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, ...@@ -1973,19 +1953,19 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
"Find adapter, Hardware type is 8188EE\n"); "Find adapter, Hardware type is 8188EE\n");
} else if (deviceid == RTL_PCI_8723BE_DID) { } else if (deviceid == RTL_PCI_8723BE_DID) {
rtlhal->hw_type = HARDWARE_TYPE_RTL8723BE; rtlhal->hw_type = HARDWARE_TYPE_RTL8723BE;
RT_TRACE(rtlpriv, COMP_INIT , DBG_LOUD, RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"Find adapter, Hardware type is 8723BE\n"); "Find adapter, Hardware type is 8723BE\n");
} else if (deviceid == RTL_PCI_8192EE_DID) { } else if (deviceid == RTL_PCI_8192EE_DID) {
rtlhal->hw_type = HARDWARE_TYPE_RTL8192EE; rtlhal->hw_type = HARDWARE_TYPE_RTL8192EE;
RT_TRACE(rtlpriv, COMP_INIT , DBG_LOUD, RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"Find adapter, Hardware type is 8192EE\n"); "Find adapter, Hardware type is 8192EE\n");
} else if (deviceid == RTL_PCI_8821AE_DID) { } else if (deviceid == RTL_PCI_8821AE_DID) {
rtlhal->hw_type = HARDWARE_TYPE_RTL8821AE; rtlhal->hw_type = HARDWARE_TYPE_RTL8821AE;
RT_TRACE(rtlpriv, COMP_INIT , DBG_LOUD, RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"Find adapter, Hardware type is 8821AE\n"); "Find adapter, Hardware type is 8821AE\n");
} else if (deviceid == RTL_PCI_8812AE_DID) { } else if (deviceid == RTL_PCI_8812AE_DID) {
rtlhal->hw_type = HARDWARE_TYPE_RTL8812AE; rtlhal->hw_type = HARDWARE_TYPE_RTL8812AE;
RT_TRACE(rtlpriv, COMP_INIT , DBG_LOUD, RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"Find adapter, Hardware type is 8812AE\n"); "Find adapter, Hardware type is 8812AE\n");
} else { } else {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
...@@ -2109,7 +2089,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw) ...@@ -2109,7 +2089,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw)
rtlpci->using_msi = true; rtlpci->using_msi = true;
RT_TRACE(rtlpriv, COMP_INIT|COMP_INTR, DBG_DMESG, RT_TRACE(rtlpriv, COMP_INIT | COMP_INTR, DBG_DMESG,
"MSI Interrupt Mode!\n"); "MSI Interrupt Mode!\n");
return 0; return 0;
} }
...@@ -2127,7 +2107,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw) ...@@ -2127,7 +2107,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw)
return ret; return ret;
rtlpci->using_msi = false; rtlpci->using_msi = false;
RT_TRACE(rtlpriv, COMP_INIT|COMP_INTR, DBG_DMESG, RT_TRACE(rtlpriv, COMP_INIT | COMP_INTR, DBG_DMESG,
"Pin-based Interrupt Mode!\n"); "Pin-based Interrupt Mode!\n");
return 0; return 0;
} }
...@@ -2343,7 +2323,6 @@ int rtl_pci_probe(struct pci_dev *pdev, ...@@ -2343,7 +2323,6 @@ int rtl_pci_probe(struct pci_dev *pdev,
pci_disable_device(pdev); pci_disable_device(pdev);
return err; return err;
} }
EXPORT_SYMBOL(rtl_pci_probe); EXPORT_SYMBOL(rtl_pci_probe);
...@@ -2402,20 +2381,20 @@ EXPORT_SYMBOL(rtl_pci_disconnect); ...@@ -2402,20 +2381,20 @@ EXPORT_SYMBOL(rtl_pci_disconnect);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
/*************************************** /***************************************
kernel pci power state define: * kernel pci power state define:
PCI_D0 ((pci_power_t __force) 0) * PCI_D0 ((pci_power_t __force) 0)
PCI_D1 ((pci_power_t __force) 1) * PCI_D1 ((pci_power_t __force) 1)
PCI_D2 ((pci_power_t __force) 2) * PCI_D2 ((pci_power_t __force) 2)
PCI_D3hot ((pci_power_t __force) 3) * PCI_D3hot ((pci_power_t __force) 3)
PCI_D3cold ((pci_power_t __force) 4) * PCI_D3cold ((pci_power_t __force) 4)
PCI_UNKNOWN ((pci_power_t __force) 5) * PCI_UNKNOWN ((pci_power_t __force) 5)
This function is called when system * This function is called when system
goes into suspend state mac80211 will * goes into suspend state mac80211 will
call rtl_mac_stop() from the mac80211 * call rtl_mac_stop() from the mac80211
suspend function first, So there is * suspend function first, So there is
no need to call hw_disable here. * no need to call hw_disable here.
****************************************/ ****************************************/
int rtl_pci_suspend(struct device *dev) int rtl_pci_suspend(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
......
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