Commit 114efd70 authored by Gokulnath A's avatar Gokulnath A Committed by Greg Kroah-Hartman

staging:rtl8821ae: trailing whitespace cleanup in pci.c

Fixed all the trailing whitespace errors found by checkpatch.pl script
Signed-off-by: default avatarGokulnath A <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79285edd
...@@ -388,13 +388,13 @@ static u8 _rtl_pci_get_pciehdr_offset(struct ieee80211_hw *hw) ...@@ -388,13 +388,13 @@ static u8 _rtl_pci_get_pciehdr_offset(struct ieee80211_hw *hw)
* capability that we are looking for, follow the link to * capability that we are looking for, follow the link to
* the next capability and continue looping. * the next capability and continue looping.
*/ */
rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS , rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS ,
pcicfg_addr_port + pcicfg_addr_port +
(num4bytes << 2)); (num4bytes << 2));
rtl_pci_raw_read_port_ushort(PCI_CONF_DATA, rtl_pci_raw_read_port_ushort(PCI_CONF_DATA,
(u16*)&capability_hdr); (u16*)&capability_hdr);
/* Found the PCI express capability. */ /* Found the PCI express capability. */
if (capability_hdr.capability_id == if (capability_hdr.capability_id ==
PCI_CAPABILITY_ID_PCI_EXPRESS) PCI_CAPABILITY_ID_PCI_EXPRESS)
break; break;
else else
...@@ -418,7 +418,7 @@ bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw, ...@@ -418,7 +418,7 @@ bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw,
list_for_each_entry(temp_priv, &rtlpriv->glb_var->glb_priv_list, list_for_each_entry(temp_priv, &rtlpriv->glb_var->glb_priv_list,
list) { list) {
if (temp_priv) { if (temp_priv) {
temp_pcipriv = temp_pcipriv =
(struct rtl_pci_priv *)temp_priv->priv; (struct rtl_pci_priv *)temp_priv->priv;
RT_TRACE(COMP_INIT, DBG_LOUD, RT_TRACE(COMP_INIT, DBG_LOUD,
(("pcipriv->ndis_adapter.funcnumber %x \n"), (("pcipriv->ndis_adapter.funcnumber %x \n"),
...@@ -526,8 +526,8 @@ static void _rtl_pci_io_handler_init(struct device *dev, ...@@ -526,8 +526,8 @@ static void _rtl_pci_io_handler_init(struct device *dev,
} }
static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw,
struct sk_buff *skb, struct sk_buff *skb,
struct rtl_tcb_desc *tcb_desc, struct rtl_tcb_desc *tcb_desc,
u8 tid) u8 tid)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
...@@ -535,7 +535,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, ...@@ -535,7 +535,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw,
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u8 additionlen = FCS_LEN; u8 additionlen = FCS_LEN;
struct sk_buff *next_skb; struct sk_buff *next_skb;
/* here open is 4, wep/tkip is 8, aes is 12*/ /* here open is 4, wep/tkip is 8, aes is 12*/
if (info->control.hw_key) if (info->control.hw_key)
additionlen += info->control.hw_key->icv_len; additionlen += info->control.hw_key->icv_len;
...@@ -544,7 +544,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, ...@@ -544,7 +544,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw,
tcb_desc->empkt_num = 0; tcb_desc->empkt_num = 0;
spin_lock_bh(&rtlpriv->locks.waitq_lock); spin_lock_bh(&rtlpriv->locks.waitq_lock);
skb_queue_walk(&rtlpriv->mac80211.skb_waitq[tid], next_skb) { skb_queue_walk(&rtlpriv->mac80211.skb_waitq[tid], next_skb) {
struct ieee80211_tx_info *next_info = struct ieee80211_tx_info *next_info =
IEEE80211_SKB_CB(next_skb); IEEE80211_SKB_CB(next_skb);
if (next_info->flags & IEEE80211_TX_CTL_AMPDU) { if (next_info->flags & IEEE80211_TX_CTL_AMPDU) {
tcb_desc->empkt_len[tcb_desc->empkt_num] = tcb_desc->empkt_len[tcb_desc->empkt_num] =
...@@ -554,7 +554,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw, ...@@ -554,7 +554,7 @@ static bool _rtl_pci_update_earlymode_info(struct ieee80211_hw *hw,
break; break;
} }
if (skb_queue_is_last(&rtlpriv->mac80211.skb_waitq[tid], if (skb_queue_is_last(&rtlpriv->mac80211.skb_waitq[tid],
next_skb)) next_skb))
break; break;
...@@ -575,26 +575,26 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) ...@@ -575,26 +575,26 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct ieee80211_tx_info *info = NULL; struct ieee80211_tx_info *info = NULL;
int tid; /* should be int */ int tid; /* should be int */
if (!rtlpriv->rtlhal.b_earlymode_enable) if (!rtlpriv->rtlhal.b_earlymode_enable)
return; return;
if (rtlpriv->dm.supp_phymode_switch && if (rtlpriv->dm.supp_phymode_switch &&
(rtlpriv->easy_concurrent_ctl.bswitch_in_process || (rtlpriv->easy_concurrent_ctl.bswitch_in_process ||
(rtlpriv->buddy_priv && (rtlpriv->buddy_priv &&
rtlpriv->buddy_priv->easy_concurrent_ctl.bswitch_in_process))) rtlpriv->buddy_priv->easy_concurrent_ctl.bswitch_in_process)))
return; return;
/* we juse use em for BE/BK/VI/VO */ /* we juse 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(hw, tid)]; u8 hw_queue = ac_to_hwq[rtl_tid_to_ac(hw, 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);
if (!skb_queue_empty(&mac->skb_waitq[tid]) && if (!skb_queue_empty(&mac->skb_waitq[tid]) &&
(ring->entries - skb_queue_len(&ring->queue) > (ring->entries - skb_queue_len(&ring->queue) >
rtlhal->max_earlymode_num)) { rtlhal->max_earlymode_num)) {
skb = skb_dequeue(&mac->skb_waitq[tid]); skb = skb_dequeue(&mac->skb_waitq[tid]);
} else { } else {
...@@ -607,7 +607,7 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) ...@@ -607,7 +607,7 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
* 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_pci_update_earlymode_info(hw, skb, _rtl_pci_update_earlymode_info(hw, skb,
&tcb_desc, tid); &tcb_desc, tid);
/*<delete in kernel start>*/ /*<delete in kernel start>*/
...@@ -635,7 +635,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) ...@@ -635,7 +635,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
u8 tid; u8 tid;
u8 *entry; u8 *entry;
if (rtlpriv->use_new_trx_flow) if (rtlpriv->use_new_trx_flow)
entry = (u8 *)(&ring->buffer_desc[ring->idx]); entry = (u8 *)(&ring->buffer_desc[ring->idx]);
else else
...@@ -643,11 +643,11 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) ...@@ -643,11 +643,11 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
if (!rtlpriv->cfg->ops->is_tx_desc_closed(hw, prio, ring->idx)) if (!rtlpriv->cfg->ops->is_tx_desc_closed(hw, prio, ring->idx))
return; return;
ring->idx = (ring->idx + 1) % ring->entries; ring->idx = (ring->idx + 1) % ring->entries;
skb = __skb_dequeue(&ring->queue); skb = __skb_dequeue(&ring->queue);
pci_unmap_single(rtlpci->pdev, pci_unmap_single(rtlpci->pdev,
le32_to_cpu(rtlpriv->cfg->ops-> le32_to_cpu(rtlpriv->cfg->ops->
get_desc((u8 *) entry, true, get_desc((u8 *) entry, true,
...@@ -740,7 +740,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, ...@@ -740,7 +740,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
u8 tmp_one = 1; u8 tmp_one = 1;
struct sk_buff *skb; struct sk_buff *skb;
skb = dev_alloc_skb(rtlpci->rxbuffersize); skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (!skb) if (!skb)
return 0; return 0;
rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb;
...@@ -754,21 +754,21 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, ...@@ -754,21 +754,21 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress))
return 0; return 0;
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false,
HW_DESC_RX_PREPARE, HW_DESC_RX_PREPARE,
(u8 *) & bufferaddress); (u8 *) & bufferaddress);
} else { } else {
rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false,
HW_DESC_RXBUFF_ADDR, HW_DESC_RXBUFF_ADDR,
(u8 *) & bufferaddress); (u8 *) & bufferaddress);
rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false,
HW_DESC_RXPKT_LEN, HW_DESC_RXPKT_LEN,
(u8 *) & rtlpci->rxbuffersize); (u8 *) & rtlpci->rxbuffersize);
rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false, rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, false,
HW_DESC_RXOWN, HW_DESC_RXOWN,
(u8 *) & tmp_one); (u8 *) & tmp_one);
} }
return 1; return 1;
} }
...@@ -792,7 +792,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw, ...@@ -792,7 +792,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw,
} else { } else {
struct sk_buff *uskb = NULL; struct sk_buff *uskb = NULL;
u8 *pdata; u8 *pdata;
uskb = dev_alloc_skb(skb->len + 128); uskb = dev_alloc_skb(skb->len + 128);
if (likely(uskb)) { if (likely(uskb)) {
memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status, memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status,
...@@ -804,7 +804,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw, ...@@ -804,7 +804,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw,
ieee80211_rx_irqsafe(hw, uskb); ieee80211_rx_irqsafe(hw, uskb);
} else { } else {
ieee80211_rx_irqsafe(hw, skb); ieee80211_rx_irqsafe(hw, skb);
} }
} }
} }
...@@ -814,11 +814,11 @@ static void _rtl_pci_hs_interrupt(struct ieee80211_hw *hw) ...@@ -814,11 +814,11 @@ static void _rtl_pci_hs_interrupt(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR], rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR],
rtl_read_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR]) | rtl_read_byte(rtlpriv, rtlpriv->cfg->maps[MAC_HSISR]) |
rtlpci->sys_irq_mask); rtlpci->sys_irq_mask);
} }
static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
{ {
...@@ -839,7 +839,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -839,7 +839,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
.noise = -98, .noise = -98,
.rate = 0, .rate = 0,
}; };
/*RX NORMAL PKT */ /*RX NORMAL PKT */
while (count--) { while (count--) {
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
...@@ -852,65 +852,65 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -852,65 +852,65 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
/*rx pkt */ /*rx pkt */
struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[ struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[
rtlpci->rx_ring[rxring_idx].idx]; rtlpci->rx_ring[rxring_idx].idx];
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
rx_remained_cnt = rx_remained_cnt =
rtlpriv->cfg->ops->rx_desc_buff_remained_cnt(hw, rtlpriv->cfg->ops->rx_desc_buff_remained_cnt(hw,
hw_queue); hw_queue);
if (rx_remained_cnt < 1) if (rx_remained_cnt < 1)
return; return;
} else { /* rx descriptor */ } else { /* rx descriptor */
pdesc = &rtlpci->rx_ring[rxring_idx].desc[ pdesc = &rtlpci->rx_ring[rxring_idx].desc[
rtlpci->rx_ring[rxring_idx].idx]; rtlpci->rx_ring[rxring_idx].idx];
own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc,
false, false,
HW_DESC_OWN); HW_DESC_OWN);
if (own) /* wait data to be filled by hardware */ if (own) /* wait data to be filled by hardware */
return; return;
} }
/* Get here means: data is filled already*/ /* Get here means: data is filled already*/
/* AAAAAAttention !!! /* AAAAAAttention !!!
* We can NOT access 'skb' before 'pci_unmap_single' */ * We can NOT access 'skb' before 'pci_unmap_single' */
pci_unmap_single(rtlpci->pdev, *((dma_addr_t *) skb->cb), pci_unmap_single(rtlpci->pdev, *((dma_addr_t *) skb->cb),
rtlpci->rxbuffersize, PCI_DMA_FROMDEVICE); rtlpci->rxbuffersize, PCI_DMA_FROMDEVICE);
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
buffer_desc = &rtlpci->rx_ring[rxring_idx].buffer_desc[ buffer_desc = &rtlpci->rx_ring[rxring_idx].buffer_desc[
rtlpci->rx_ring[rxring_idx].idx]; rtlpci->rx_ring[rxring_idx].idx];
/*means rx wifi info*/ /*means rx wifi info*/
pdesc = (struct rtl_rx_desc *)skb->data; pdesc = (struct rtl_rx_desc *)skb->data;
} }
rtlpriv->cfg->ops->query_rx_desc(hw, &status, rtlpriv->cfg->ops->query_rx_desc(hw, &status,
&rx_status, (u8 *) pdesc, skb); &rx_status, (u8 *) pdesc, skb);
if (rtlpriv->use_new_trx_flow) if (rtlpriv->use_new_trx_flow)
rtlpriv->cfg->ops->rx_check_dma_ok(hw, rtlpriv->cfg->ops->rx_check_dma_ok(hw,
(u8 *)buffer_desc, (u8 *)buffer_desc,
hw_queue); hw_queue);
len = rtlpriv->cfg->ops->get_desc((u8 *)pdesc, false, len = rtlpriv->cfg->ops->get_desc((u8 *)pdesc, false,
HW_DESC_RXPKT_LEN); HW_DESC_RXPKT_LEN);
if (skb->end - skb->tail > len) { if (skb->end - skb->tail > len) {
skb_put(skb, len); skb_put(skb, len);
if (rtlpriv->use_new_trx_flow) if (rtlpriv->use_new_trx_flow)
skb_reserve(skb, status.rx_drvinfo_size + skb_reserve(skb, status.rx_drvinfo_size +
status.rx_bufshift + 24); status.rx_bufshift + 24);
else else
skb_reserve(skb, status.rx_drvinfo_size + skb_reserve(skb, status.rx_drvinfo_size +
status.rx_bufshift); status.rx_bufshift);
} else { } else {
printk("skb->end - skb->tail = %d, len is %d\n", printk("skb->end - skb->tail = %d, len is %d\n",
skb->end - skb->tail, len); skb->end - skb->tail, len);
break; break;
} }
rtlpriv->cfg->ops->rx_command_packet_handler(hw, status, skb); rtlpriv->cfg->ops->rx_command_packet_handler(hw, status, skb);
/* /*
...@@ -922,9 +922,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -922,9 +922,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
hdr = rtl_get_hdr(skb); hdr = rtl_get_hdr(skb);
fc = rtl_get_fc(skb); fc = rtl_get_fc(skb);
if (!status.b_crc && !status.b_hwerror) { if (!status.b_crc && !status.b_hwerror) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
sizeof(rx_status)); sizeof(rx_status));
if (is_broadcast_ether_addr(hdr->addr1)) { if (is_broadcast_ether_addr(hdr->addr1)) {
...@@ -947,13 +947,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -947,13 +947,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
/* static bcn for roaming */ /* static bcn for roaming */
rtl_beacon_statistic(hw, skb); rtl_beacon_statistic(hw, skb);
rtl_p2p_info(hw, (void*)skb->data, skb->len); rtl_p2p_info(hw, (void*)skb->data, skb->len);
/* 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 == BAND_ON_2_4G)&& (rtlpriv->rtlhal.current_bandtype == 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);
} else { } else {
...@@ -964,13 +964,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -964,13 +964,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
} }
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
rtlpci->rx_ring[hw_queue].next_rx_rp += 1; rtlpci->rx_ring[hw_queue].next_rx_rp += 1;
rtlpci->rx_ring[hw_queue].next_rx_rp %= rtlpci->rx_ring[hw_queue].next_rx_rp %=
RTL_PCI_MAX_RX_COUNT; RTL_PCI_MAX_RX_COUNT;
rx_remained_cnt--; rx_remained_cnt--;
if (1/*rx_remained_cnt == 0*/) { if (1/*rx_remained_cnt == 0*/) {
rtl_write_word(rtlpriv, 0x3B4, rtl_write_word(rtlpriv, 0x3B4,
rtlpci->rx_ring[hw_queue].next_rx_rp); rtlpci->rx_ring[hw_queue].next_rx_rp);
} }
} }
...@@ -981,22 +981,22 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -981,22 +981,22 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
} }
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
_rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc, _rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc,
rxring_idx, rxring_idx,
rtlpci->rx_ring[rxring_idx].idx); rtlpci->rx_ring[rxring_idx].idx);
} else { } else {
_rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc, rxring_idx, _rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc, rxring_idx,
rtlpci->rx_ring[rxring_idx].idx); rtlpci->rx_ring[rxring_idx].idx);
if (rtlpci->rx_ring[rxring_idx].idx == if (rtlpci->rx_ring[rxring_idx].idx ==
rtlpci->rxringcount - 1) rtlpci->rxringcount - 1)
rtlpriv->cfg->ops->set_desc(hw, (u8 *) pdesc, rtlpriv->cfg->ops->set_desc(hw, (u8 *) pdesc,
false, false,
HW_DESC_RXERO, HW_DESC_RXERO,
(u8 *) & tmp_one); (u8 *) & tmp_one);
} }
rtlpci->rx_ring[rxring_idx].idx = rtlpci->rx_ring[rxring_idx].idx =
(rtlpci->rx_ring[rxring_idx].idx + 1) % (rtlpci->rx_ring[rxring_idx].idx + 1) %
rtlpci->rxringcount; rtlpci->rxringcount;
} }
} }
...@@ -1011,7 +1011,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1011,7 +1011,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
u32 inta = 0; u32 inta = 0;
u32 intb = 0; u32 intb = 0;
if (rtlpci->irq_enabled == 0) if (rtlpci->irq_enabled == 0)
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -1020,7 +1020,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1020,7 +1020,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMR], 0x0); rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMR], 0x0);
rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMRE], 0x0); rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMRE], 0x0);
...@@ -1127,7 +1127,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1127,7 +1127,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
/*<4> fw related*/ /*<4> fw related*/
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8723AE) { if (rtlhal->hw_type == HARDWARE_TYPE_RTL8723AE) {
if (inta & rtlpriv->cfg->maps[RTL_IMR_C2HCMD]) { if (inta & rtlpriv->cfg->maps[RTL_IMR_C2HCMD]) {
RT_TRACE(COMP_INTR, DBG_TRACE, RT_TRACE(COMP_INTR, DBG_TRACE,
("firmware interrupt!\n")); ("firmware interrupt!\n"));
queue_delayed_work(rtlpriv->works.rtl_wq, queue_delayed_work(rtlpriv->works.rtl_wq,
&rtlpriv->works.fwevt_wq, 0); &rtlpriv->works.fwevt_wq, 0);
...@@ -1142,12 +1142,12 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1142,12 +1142,12 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8188EE || if (rtlhal->hw_type == HARDWARE_TYPE_RTL8188EE ||
rtlhal->hw_type == HARDWARE_TYPE_RTL8723BE) { rtlhal->hw_type == HARDWARE_TYPE_RTL8723BE) {
if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_HSISR_IND])) { if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_HSISR_IND])) {
RT_TRACE(COMP_INTR, DBG_TRACE, RT_TRACE(COMP_INTR, DBG_TRACE,
("hsisr interrupt!\n")); ("hsisr interrupt!\n"));
_rtl_pci_hs_interrupt(hw); _rtl_pci_hs_interrupt(hw);
} }
} }
if(rtlpriv->rtlhal.b_earlymode_enable) if(rtlpriv->rtlhal.b_earlymode_enable)
tasklet_schedule(&rtlpriv->works.irq_tasklet); tasklet_schedule(&rtlpriv->works.irq_tasklet);
...@@ -1157,7 +1157,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1157,7 +1157,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMRE], rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[MAC_HIMRE],
rtlpci->irq_mask[1]); rtlpci->irq_mask[1]);
spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
done: done:
...@@ -1200,16 +1200,16 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) ...@@ -1200,16 +1200,16 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
pdesc = &ring->desc[0]; pdesc = &ring->desc[0];
if (rtlpriv->use_new_trx_flow) if (rtlpriv->use_new_trx_flow)
pbuffer_desc = &ring->buffer_desc[0]; pbuffer_desc = &ring->buffer_desc[0];
/*<delete in kernel start>*/ /*<delete in kernel start>*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
(u8 *)pbuffer_desc, info, pskb, (u8 *)pbuffer_desc, info, pskb,
BEACON_QUEUE, &tcb_desc); BEACON_QUEUE, &tcb_desc);
#else #else
/*<delete in kernel end>*/ /*<delete in kernel end>*/
rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
(u8 *)pbuffer_desc, info, NULL, pskb, (u8 *)pbuffer_desc, info, NULL, pskb,
BEACON_QUEUE, &tcb_desc); BEACON_QUEUE, &tcb_desc);
/*<delete in kernel start>*/ /*<delete in kernel start>*/
#endif #endif
...@@ -1235,7 +1235,7 @@ static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) ...@@ -1235,7 +1235,7 @@ static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw)
desc_num = TX_DESC_NUM_92E; desc_num = TX_DESC_NUM_92E;
else else
desc_num = RT_TXDESC_NUM; desc_num = RT_TXDESC_NUM;
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;
} }
...@@ -1309,12 +1309,12 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, ...@@ -1309,12 +1309,12 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
/* alloc tx buffer desc for new trx flow*/ /* alloc tx buffer desc for new trx flow*/
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
buffer_desc = pci_alloc_consistent(rtlpci->pdev, buffer_desc = pci_alloc_consistent(rtlpci->pdev,
sizeof(*buffer_desc) * entries, sizeof(*buffer_desc) * entries,
&buffer_desc_dma); &buffer_desc_dma);
if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) { if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) {
RT_TRACE(COMP_ERR, DBG_EMERG, RT_TRACE(COMP_ERR, DBG_EMERG,
("Cannot allocate TX ring (prio = %d)\n", ("Cannot allocate TX ring (prio = %d)\n",
prio)); prio));
return -ENOMEM; return -ENOMEM;
} }
...@@ -1322,13 +1322,13 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, ...@@ -1322,13 +1322,13 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
memset(buffer_desc, 0, sizeof(*buffer_desc) * entries); memset(buffer_desc, 0, sizeof(*buffer_desc) * entries);
rtlpci->tx_ring[prio].buffer_desc = buffer_desc; rtlpci->tx_ring[prio].buffer_desc = buffer_desc;
rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma; rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma;
rtlpci->tx_ring[prio].cur_tx_rp = 0; rtlpci->tx_ring[prio].cur_tx_rp = 0;
rtlpci->tx_ring[prio].cur_tx_wp = 0; rtlpci->tx_ring[prio].cur_tx_wp = 0;
rtlpci->tx_ring[prio].avl_desc = entries; rtlpci->tx_ring[prio].avl_desc = entries;
} }
/* alloc dma for this ring */ /* alloc dma for this ring */
desc = pci_alloc_consistent(rtlpci->pdev, desc = pci_alloc_consistent(rtlpci->pdev,
sizeof(*desc) * entries, &desc_dma); sizeof(*desc) * entries, &desc_dma);
...@@ -1342,7 +1342,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, ...@@ -1342,7 +1342,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
memset(desc, 0, sizeof(*desc) * entries); memset(desc, 0, sizeof(*desc) * entries);
rtlpci->tx_ring[prio].desc = desc; rtlpci->tx_ring[prio].desc = desc;
rtlpci->tx_ring[prio].dma = desc_dma; rtlpci->tx_ring[prio].dma = desc_dma;
rtlpci->tx_ring[prio].idx = 0; rtlpci->tx_ring[prio].idx = 0;
rtlpci->tx_ring[prio].entries = entries; rtlpci->tx_ring[prio].entries = entries;
skb_queue_head_init(&rtlpci->tx_ring[prio].queue); skb_queue_head_init(&rtlpci->tx_ring[prio].queue);
...@@ -1357,7 +1357,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, ...@@ -1357,7 +1357,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
sizeof(*desc)); sizeof(*desc));
rtlpriv->cfg->ops->set_desc(hw, (u8 *) & (desc[i]), rtlpriv->cfg->ops->set_desc(hw, (u8 *) & (desc[i]),
true, true,
HW_DESC_TX_NEXTDESC_ADDR, HW_DESC_TX_NEXTDESC_ADDR,
(u8 *) & nextdescaddress); (u8 *) & nextdescaddress);
} }
...@@ -1371,15 +1371,15 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) ...@@ -1371,15 +1371,15 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
int i; int i;
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
struct rtl_rx_buffer_desc *entry = NULL; struct rtl_rx_buffer_desc *entry = NULL;
/* alloc dma for this ring */ /* alloc dma for this ring */
rtlpci->rx_ring[rxring_idx].buffer_desc = rtlpci->rx_ring[rxring_idx].buffer_desc =
pci_alloc_consistent(rtlpci->pdev, pci_alloc_consistent(rtlpci->pdev,
sizeof(*rtlpci->rx_ring[rxring_idx]. sizeof(*rtlpci->rx_ring[rxring_idx].
buffer_desc) * buffer_desc) *
rtlpci->rxringcount, rtlpci->rxringcount,
&rtlpci->rx_ring[rxring_idx].dma); &rtlpci->rx_ring[rxring_idx].dma);
if (!rtlpci->rx_ring[rxring_idx].buffer_desc || if (!rtlpci->rx_ring[rxring_idx].buffer_desc ||
(unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) { (unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) {
...@@ -1393,9 +1393,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) ...@@ -1393,9 +1393,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
/* init every desc in this ring */ /* init every desc in this ring */
rtlpci->rx_ring[rxring_idx].idx = 0; rtlpci->rx_ring[rxring_idx].idx = 0;
for (i = 0; i < rtlpci->rxringcount; i++) { for (i = 0; i < rtlpci->rxringcount; i++) {
entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i]; entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i];
if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry,
rxring_idx, i)) rxring_idx, i))
return -ENOMEM; return -ENOMEM;
} }
...@@ -1403,14 +1403,14 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) ...@@ -1403,14 +1403,14 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
struct rtl_rx_desc *entry = NULL; struct rtl_rx_desc *entry = NULL;
u8 tmp_one = 1; u8 tmp_one = 1;
/* alloc dma for this ring */ /* alloc dma for this ring */
rtlpci->rx_ring[rxring_idx].desc = rtlpci->rx_ring[rxring_idx].desc =
pci_alloc_consistent(rtlpci->pdev, pci_alloc_consistent(rtlpci->pdev,
sizeof(*rtlpci->rx_ring[rxring_idx]. sizeof(*rtlpci->rx_ring[rxring_idx].
desc) * rtlpci->rxringcount, desc) * rtlpci->rxringcount,
&rtlpci->rx_ring[rxring_idx].dma); &rtlpci->rx_ring[rxring_idx].dma);
if (!rtlpci->rx_ring[rxring_idx].desc || if (!rtlpci->rx_ring[rxring_idx].desc ||
(unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) { (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) {
RT_TRACE(COMP_ERR, DBG_EMERG, RT_TRACE(COMP_ERR, DBG_EMERG,
("Cannot allocate RX ring\n")); ("Cannot allocate RX ring\n"));
return -ENOMEM; return -ENOMEM;
} }
...@@ -1421,9 +1421,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) ...@@ -1421,9 +1421,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
/* init every desc in this ring */ /* init every desc in this ring */
rtlpci->rx_ring[rxring_idx].idx = 0; rtlpci->rx_ring[rxring_idx].idx = 0;
for (i = 0; i < rtlpci->rxringcount; i++) { for (i = 0; i < rtlpci->rxringcount; i++) {
entry = &rtlpci->rx_ring[rxring_idx].desc[i]; entry = &rtlpci->rx_ring[rxring_idx].desc[i];
if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry,
rxring_idx, i)) rxring_idx, i))
return -ENOMEM; return -ENOMEM;
} }
...@@ -1467,7 +1467,7 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw, ...@@ -1467,7 +1467,7 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw,
sizeof(*ring->buffer_desc) * ring->entries, sizeof(*ring->buffer_desc) * ring->entries,
ring->buffer_desc, ring->buffer_desc_dma); ring->buffer_desc, ring->buffer_desc_dma);
ring->buffer_desc = NULL; ring->buffer_desc = NULL;
} }
} }
static void _rtl_pci_free_rx_ring(struct ieee80211_hw *hw, int rxring_idx) static void _rtl_pci_free_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
...@@ -1532,7 +1532,7 @@ static int _rtl_pci_init_trx_ring(struct ieee80211_hw *hw) ...@@ -1532,7 +1532,7 @@ static int _rtl_pci_init_trx_ring(struct ieee80211_hw *hw)
_rtl_pci_free_rx_ring(hw, rxring_idx); _rtl_pci_free_rx_ring(hw, rxring_idx);
for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++)
if (rtlpci->tx_ring[i].desc || if (rtlpci->tx_ring[i].desc ||
rtlpci->tx_ring[i].buffer_desc) rtlpci->tx_ring[i].buffer_desc)
_rtl_pci_free_tx_ring(hw, i); _rtl_pci_free_tx_ring(hw, i);
...@@ -1567,16 +1567,16 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1567,16 +1567,16 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
/* force the rx_ring[RX_MPDU_QUEUE/ /* force the rx_ring[RX_MPDU_QUEUE/
* RX_CMD_QUEUE].idx to the first one */ * RX_CMD_QUEUE].idx to the first one */
/*new trx flow, do nothing*/ /*new trx flow, do nothing*/
if ((rtlpriv->use_new_trx_flow == false) && if ((rtlpriv->use_new_trx_flow == false) &&
rtlpci->rx_ring[rxring_idx].desc) { rtlpci->rx_ring[rxring_idx].desc) {
struct rtl_rx_desc *entry = NULL; struct rtl_rx_desc *entry = NULL;
for (i = 0; i < rtlpci->rxringcount; i++) { for (i = 0; i < rtlpci->rxringcount; i++) {
entry = &rtlpci->rx_ring[rxring_idx].desc[i]; entry = &rtlpci->rx_ring[rxring_idx].desc[i];
rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry, rtlpriv->cfg->ops->set_desc(hw, (u8 *) entry,
false, false,
HW_DESC_RXOWN, HW_DESC_RXOWN,
(u8 *) & tmp_one); (u8 *) & tmp_one);
} }
} }
rtlpci->rx_ring[rxring_idx].idx = 0; } rtlpci->rx_ring[rxring_idx].idx = 0; }
...@@ -1585,13 +1585,13 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1585,13 +1585,13 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
* 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);
for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) { for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) {
if (rtlpci->tx_ring[i].desc || if (rtlpci->tx_ring[i].desc ||
rtlpci->tx_ring[i].buffer_desc) { rtlpci->tx_ring[i].buffer_desc) {
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i]; struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i];
while (skb_queue_len(&ring->queue)) { while (skb_queue_len(&ring->queue)) {
u8 *entry; u8 *entry;
struct sk_buff *skb = struct sk_buff *skb =
__skb_dequeue(&ring->queue); __skb_dequeue(&ring->queue);
if (rtlpriv->use_new_trx_flow) if (rtlpriv->use_new_trx_flow)
entry = (u8 *)(&ring->buffer_desc entry = (u8 *)(&ring->buffer_desc
...@@ -1618,7 +1618,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1618,7 +1618,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
/*<delete in kernel start>*/ /*<delete in kernel start>*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw, static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw,
struct sk_buff *skb) struct sk_buff *skb)
#else #else
/*<delete in kernel end>*/ /*<delete in kernel end>*/
...@@ -1741,10 +1741,10 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, ...@@ -1741,10 +1741,10 @@ static int rtl_pci_tx(struct ieee80211_hw *hw,
} }
pdesc = &ring->desc[idx]; pdesc = &ring->desc[idx];
if (rtlpriv->use_new_trx_flow) { if (rtlpriv->use_new_trx_flow) {
ptx_bd_desc = &ring->buffer_desc[idx]; ptx_bd_desc = &ring->buffer_desc[idx];
} else { } else {
own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc,
true, HW_DESC_OWN); true, HW_DESC_OWN);
...@@ -1755,17 +1755,17 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, ...@@ -1755,17 +1755,17 @@ static int rtl_pci_tx(struct ieee80211_hw *hw,
hw_queue, ring->idx, idx, hw_queue, ring->idx, idx,
skb_queue_len(&ring->queue))); skb_queue_len(&ring->queue)));
spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock,
flags); flags);
return skb->len; return skb->len;
} }
} }
if (ieee80211_is_data_qos(fc)) { if (ieee80211_is_data_qos(fc)) {
tid = rtl_get_tid(skb); tid = rtl_get_tid(skb);
if (sta) { if (sta) {
sta_entry = (struct rtl_sta_info *)sta->drv_priv; sta_entry = (struct rtl_sta_info *)sta->drv_priv;
seq_number = (le16_to_cpu(hdr->seq_ctrl) & seq_number = (le16_to_cpu(hdr->seq_ctrl) &
IEEE80211_SCTL_SEQ) >> 4; IEEE80211_SCTL_SEQ) >> 4;
seq_number += 1; seq_number += 1;
...@@ -1779,13 +1779,13 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, ...@@ -1779,13 +1779,13 @@ static int rtl_pci_tx(struct ieee80211_hw *hw,
/*<delete in kernel start>*/ /*<delete in kernel start>*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
(u8 *)ptx_bd_desc, info, skb, (u8 *)ptx_bd_desc, info, skb,
hw_queue, ptcb_desc); hw_queue, ptcb_desc);
#else #else
/*<delete in kernel end>*/ /*<delete in kernel end>*/
rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
(u8 *)ptx_bd_desc, info, sta, skb, (u8 *)ptx_bd_desc, info, sta, skb,
hw_queue, ptcb_desc); hw_queue, ptcb_desc);
/*<delete in kernel start>*/ /*<delete in kernel start>*/
#endif #endif
...@@ -1832,10 +1832,10 @@ static void rtl_pci_flush(struct ieee80211_hw *hw, bool drop) ...@@ -1832,10 +1832,10 @@ static void rtl_pci_flush(struct ieee80211_hw *hw, bool drop)
u16 i = 0; u16 i = 0;
int queue_id; int queue_id;
struct rtl8192_tx_ring *ring; struct rtl8192_tx_ring *ring;
if (mac->skip_scan) if (mac->skip_scan)
return; return;
for (queue_id = RTL_PCI_MAX_TX_QUEUE_COUNT - 1; queue_id >= 0;) { for (queue_id = RTL_PCI_MAX_TX_QUEUE_COUNT - 1; queue_id >= 0;) {
u32 queue_len; u32 queue_len;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
...@@ -2081,13 +2081,13 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, ...@@ -2081,13 +2081,13 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
rtlhal->interfaceindex = 0; rtlhal->interfaceindex = 0;
} }
} }
/* 92ee use new trx flow */ /* 92ee use new trx flow */
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192EE) if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192EE)
rtlpriv->use_new_trx_flow = true; rtlpriv->use_new_trx_flow = true;
else else
rtlpriv->use_new_trx_flow = false; rtlpriv->use_new_trx_flow = false;
/*find bus info */ /*find bus info */
pcipriv->ndis_adapter.busnumber = pdev->bus->number; pcipriv->ndis_adapter.busnumber = pdev->bus->number;
pcipriv->ndis_adapter.devnumber = PCI_SLOT(pdev->devfn); pcipriv->ndis_adapter.devnumber = PCI_SLOT(pdev->devfn);
...@@ -2095,7 +2095,7 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, ...@@ -2095,7 +2095,7 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
/*find bridge info */ /*find bridge info */
pcipriv->ndis_adapter.pcibridge_vendor = PCI_BRIDGE_VENDOR_UNKNOWN; pcipriv->ndis_adapter.pcibridge_vendor = PCI_BRIDGE_VENDOR_UNKNOWN;
/* some ARM have no bridge_pdev and will crash here /* some ARM have no bridge_pdev and will crash here
* so we should check if bridge_pdev is NULL */ * so we should check if bridge_pdev is NULL */
if (bridge_pdev) { if (bridge_pdev) {
pcipriv->ndis_adapter.pcibridge_vendorid = bridge_pdev->vendor; pcipriv->ndis_adapter.pcibridge_vendorid = bridge_pdev->vendor;
...@@ -2187,7 +2187,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw) ...@@ -2187,7 +2187,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw)
} }
rtlpci->using_msi = true; rtlpci->using_msi = true;
RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG, ("MSI Interrupt Mode!\n")); RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG, ("MSI Interrupt Mode!\n"));
return 0; return 0;
} }
...@@ -2198,7 +2198,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw) ...@@ -2198,7 +2198,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw)
struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); struct rtl_pci *rtlpci = rtl_pcidev(pcipriv);
int ret; int ret;
ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt, ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
IRQF_SHARED, KBUILD_MODNAME, hw); IRQF_SHARED, KBUILD_MODNAME, hw);
if (ret < 0) { if (ret < 0) {
...@@ -2206,7 +2206,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw) ...@@ -2206,7 +2206,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw)
} }
rtlpci->using_msi = false; rtlpci->using_msi = false;
RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG, RT_TRACE(COMP_INIT|COMP_INTR, DBG_DMESG,
("Pin-based Interrupt Mode!\n")); ("Pin-based Interrupt Mode!\n"));
return 0; return 0;
} }
...@@ -2377,7 +2377,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, ...@@ -2377,7 +2377,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
} else { } else {
rtlpriv->mac80211.mac80211_registered = 1; rtlpriv->mac80211.mac80211_registered = 1;
} }
/* the wiphy must have been registed to /* the wiphy must have been registed to
* cfg80211 prior to regulatory_hint */ * cfg80211 prior to regulatory_hint */
if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) { if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) {
RT_TRACE(COMP_ERR, DBG_WARNING, ("regulatory_hint fail\n")); RT_TRACE(COMP_ERR, DBG_WARNING, ("regulatory_hint fail\n"));
...@@ -2450,7 +2450,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) ...@@ -2450,7 +2450,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
/* add for prov */ /* add for prov */
rtl_proc_remove_one(hw); rtl_proc_remove_one(hw);
/*ieee80211_unregister_hw will call ops_stop */ /*ieee80211_unregister_hw will call ops_stop */
if (rtlmac->mac80211_registered == 1) { if (rtlmac->mac80211_registered == 1) {
...@@ -2529,7 +2529,7 @@ int rtl_pci_resume(struct device *dev) ...@@ -2529,7 +2529,7 @@ int rtl_pci_resume(struct device *dev)
rtlpriv->cfg->ops->hw_resume(hw); rtlpriv->cfg->ops->hw_resume(hw);
rtl_init_rfkill(hw); rtl_init_rfkill(hw);
return 0; return 0;
} }
//EXPORT_SYMBOL(rtl_pci_resume); //EXPORT_SYMBOL(rtl_pci_resume);
......
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