aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtlwifi/pci.c')
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c85
1 files changed, 8 insertions, 77 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 1758d4463247..a508ea51a1f8 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -690,75 +690,6 @@ done:
690 690
691} 691}
692 692
693void _rtl_pci_tx_interrupt(struct ieee80211_hw *hw)
694{
695 struct rtl_priv *rtlpriv = rtl_priv(hw);
696 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
697 int prio;
698
699 for (prio = 0; prio < RTL_PCI_MAX_TX_QUEUE_COUNT; prio++) {
700 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio];
701
702 while (skb_queue_len(&ring->queue)) {
703 struct rtl_tx_desc *entry = &ring->desc[ring->idx];
704 struct sk_buff *skb;
705 struct ieee80211_tx_info *info;
706 u8 own;
707
708 /*
709 *beacon packet will only use the first
710 *descriptor defautly, and the own may not
711 *be cleared by the hardware, and
712 *beacon will free in prepare beacon
713 */
714 if (prio == BEACON_QUEUE || prio == TXCMD_QUEUE ||
715 prio == HCCA_QUEUE)
716 break;
717
718 own = (u8)rtlpriv->cfg->ops->get_desc((u8 *)entry,
719 true,
720 HW_DESC_OWN);
721
722 if (own)
723 break;
724
725 skb = __skb_dequeue(&ring->queue);
726 pci_unmap_single(rtlpci->pdev,
727 le32_to_cpu(rtlpriv->cfg->ops->
728 get_desc((u8 *) entry,
729 true,
730 HW_DESC_TXBUFF_ADDR)),
731 skb->len, PCI_DMA_TODEVICE);
732
733 ring->idx = (ring->idx + 1) % ring->entries;
734
735 info = IEEE80211_SKB_CB(skb);
736 ieee80211_tx_info_clear_status(info);
737
738 info->flags |= IEEE80211_TX_STAT_ACK;
739 /*info->status.rates[0].count = 1; */
740
741 ieee80211_tx_status_irqsafe(hw, skb);
742
743 if ((ring->entries - skb_queue_len(&ring->queue))
744 == 2 && prio != BEACON_QUEUE) {
745 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
746 ("more desc left, wake "
747 "skb_queue@%d,ring->idx = %d,"
748 "skb_queue_len = 0x%d\n",
749 prio, ring->idx,
750 skb_queue_len(&ring->queue)));
751
752 ieee80211_wake_queue(hw,
753 skb_get_queue_mapping
754 (skb));
755 }
756
757 skb = NULL;
758 }
759 }
760}
761
762static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) 693static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
763{ 694{
764 struct ieee80211_hw *hw = dev_id; 695 struct ieee80211_hw *hw = dev_id;
@@ -1273,7 +1204,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
1273 return 0; 1204 return 0;
1274} 1205}
1275 1206
1276unsigned int _rtl_mac_to_hwqueue(u16 fc, 1207static unsigned int _rtl_mac_to_hwqueue(u16 fc,
1277 unsigned int mac80211_queue_index) 1208 unsigned int mac80211_queue_index)
1278{ 1209{
1279 unsigned int hw_queue_index; 1210 unsigned int hw_queue_index;
@@ -1312,7 +1243,7 @@ out:
1312 return hw_queue_index; 1243 return hw_queue_index;
1313} 1244}
1314 1245
1315int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1246static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1316{ 1247{
1317 struct rtl_priv *rtlpriv = rtl_priv(hw); 1248 struct rtl_priv *rtlpriv = rtl_priv(hw);
1318 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 1249 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -1429,7 +1360,7 @@ int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1429 return 0; 1360 return 0;
1430} 1361}
1431 1362
1432void rtl_pci_deinit(struct ieee80211_hw *hw) 1363static void rtl_pci_deinit(struct ieee80211_hw *hw)
1433{ 1364{
1434 struct rtl_priv *rtlpriv = rtl_priv(hw); 1365 struct rtl_priv *rtlpriv = rtl_priv(hw);
1435 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1366 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -1444,7 +1375,7 @@ void rtl_pci_deinit(struct ieee80211_hw *hw)
1444 1375
1445} 1376}
1446 1377
1447int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) 1378static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
1448{ 1379{
1449 struct rtl_priv *rtlpriv = rtl_priv(hw); 1380 struct rtl_priv *rtlpriv = rtl_priv(hw);
1450 int err; 1381 int err;
@@ -1461,7 +1392,7 @@ int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
1461 return 1; 1392 return 1;
1462} 1393}
1463 1394
1464int rtl_pci_start(struct ieee80211_hw *hw) 1395static int rtl_pci_start(struct ieee80211_hw *hw)
1465{ 1396{
1466 struct rtl_priv *rtlpriv = rtl_priv(hw); 1397 struct rtl_priv *rtlpriv = rtl_priv(hw);
1467 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 1398 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -1496,7 +1427,7 @@ int rtl_pci_start(struct ieee80211_hw *hw)
1496 return 0; 1427 return 0;
1497} 1428}
1498 1429
1499void rtl_pci_stop(struct ieee80211_hw *hw) 1430static void rtl_pci_stop(struct ieee80211_hw *hw)
1500{ 1431{
1501 struct rtl_priv *rtlpriv = rtl_priv(hw); 1432 struct rtl_priv *rtlpriv = rtl_priv(hw);
1502 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1433 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -1838,7 +1769,7 @@ fail3:
1838 ieee80211_free_hw(hw); 1769 ieee80211_free_hw(hw);
1839 1770
1840 if (rtlpriv->io.pci_mem_start != 0) 1771 if (rtlpriv->io.pci_mem_start != 0)
1841 pci_iounmap(pdev, (void *)rtlpriv->io.pci_mem_start); 1772 pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
1842 1773
1843fail2: 1774fail2:
1844 pci_release_regions(pdev); 1775 pci_release_regions(pdev);
@@ -1888,7 +1819,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
1888 } 1819 }
1889 1820
1890 if (rtlpriv->io.pci_mem_start != 0) { 1821 if (rtlpriv->io.pci_mem_start != 0) {
1891 pci_iounmap(pdev, (void *)rtlpriv->io.pci_mem_start); 1822 pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
1892 pci_release_regions(pdev); 1823 pci_release_regions(pdev);
1893 } 1824 }
1894 1825