Lines Matching refs:rtlpci

65 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));  in _rtl_pci_update_default_setting()  local
73 switch (rtlpci->const_pci_aspm) { in _rtl_pci_update_default_setting()
111 switch (rtlpci->const_hwsw_rfoff_d3) { in _rtl_pci_update_default_setting()
129 switch (rtlpci->const_support_pciaspm) { in _rtl_pci_update_default_setting()
146 rtlpci->const_support_pciaspm); in _rtl_pci_update_default_setting()
153 pcie_capability_read_word(rtlpci->pdev, PCI_EXP_LNKCTL, &init_aspm); in _rtl_pci_update_default_setting()
164 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_platform_switch_device_pci_aspm() local
172 pcie_capability_clear_and_set_word(rtlpci->pdev, PCI_EXP_LNKCTL, in _rtl_pci_platform_switch_device_pci_aspm()
182 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_switch_clk_req() local
187 pcie_capability_clear_and_set_word(rtlpci->pdev, PCI_EXP_LNKCTL, in _rtl_pci_switch_clk_req()
201 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_disable_aspm() local
224 pcie_capability_read_word(rtlpci->pdev, PCI_EXP_LNKCTL, &tmp_u1b); in rtl_pci_disable_aspm()
243 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_enable_aspm() local
258 aspmlevel = rtlpci->const_devicepci_aspm_setting; in rtl_pci_enable_aspm()
279 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_get_amd_l1_patch() local
285 pci_write_config_byte(rtlpci->pdev, 0xe0, 0xa0); in rtl_pci_get_amd_l1_patch()
287 pci_read_config_byte(rtlpci->pdev, 0xe0, &offset_e0); in rtl_pci_get_amd_l1_patch()
290 pci_read_config_dword(rtlpci->pdev, 0xe4, &offset_e4); in rtl_pci_get_amd_l1_patch()
436 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_tx_chk_waitq() local
448 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue]; in _rtl_pci_tx_chk_waitq()
483 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_tx_isr() local
485 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio]; in _rtl_pci_tx_isr()
504 dma_unmap_single(&rtlpci->pdev->dev, in _rtl_pci_tx_isr()
586 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_one_rxdesc() local
595 skb = dev_alloc_skb(rtlpci->rxbuffersize); in _rtl_pci_init_one_rxdesc()
602 dma_map_single(&rtlpci->pdev->dev, skb_tail_pointer(skb), in _rtl_pci_init_one_rxdesc()
603 rtlpci->rxbuffersize, DMA_FROM_DEVICE); in _rtl_pci_init_one_rxdesc()
605 if (dma_mapping_error(&rtlpci->pdev->dev, bufferaddress)) in _rtl_pci_init_one_rxdesc()
607 rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; in _rtl_pci_init_one_rxdesc()
619 (u8 *)&rtlpci->rxbuffersize); in _rtl_pci_init_one_rxdesc()
666 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_hs_interrupt() local
670 rtlpci->sys_irq_mask); in _rtl_pci_hs_interrupt()
676 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_rx_interrupt() local
679 unsigned int count = rtlpci->rxringcount; in _rtl_pci_rx_interrupt()
700 struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[ in _rtl_pci_rx_interrupt()
701 rtlpci->rx_ring[rxring_idx].idx]; in _rtl_pci_rx_interrupt()
711 buffer_desc = &rtlpci->rx_ring[rxring_idx].buffer_desc[ in _rtl_pci_rx_interrupt()
712 rtlpci->rx_ring[rxring_idx].idx]; in _rtl_pci_rx_interrupt()
715 pdesc = &rtlpci->rx_ring[rxring_idx].desc[ in _rtl_pci_rx_interrupt()
716 rtlpci->rx_ring[rxring_idx].idx]; in _rtl_pci_rx_interrupt()
729 dma_unmap_single(&rtlpci->pdev->dev, *((dma_addr_t *)skb->cb), in _rtl_pci_rx_interrupt()
730 rtlpci->rxbuffersize, DMA_FROM_DEVICE); in _rtl_pci_rx_interrupt()
733 new_skb = dev_alloc_skb(rtlpci->rxbuffersize); in _rtl_pci_rx_interrupt()
820 rtlpci->rx_ring[hw_queue].next_rx_rp += 1; in _rtl_pci_rx_interrupt()
821 rtlpci->rx_ring[hw_queue].next_rx_rp %= in _rtl_pci_rx_interrupt()
826 rtlpci->rx_ring[hw_queue].next_rx_rp); in _rtl_pci_rx_interrupt()
837 rtlpci->rx_ring[rxring_idx].idx); in _rtl_pci_rx_interrupt()
841 rtlpci->rx_ring[rxring_idx].idx); in _rtl_pci_rx_interrupt()
842 if (rtlpci->rx_ring[rxring_idx].idx == in _rtl_pci_rx_interrupt()
843 rtlpci->rxringcount - 1) in _rtl_pci_rx_interrupt()
849 rtlpci->rx_ring[rxring_idx].idx = in _rtl_pci_rx_interrupt()
850 (rtlpci->rx_ring[rxring_idx].idx + 1) % in _rtl_pci_rx_interrupt()
851 rtlpci->rxringcount; in _rtl_pci_rx_interrupt()
858 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_interrupt() local
866 if (rtlpci->irq_enabled == 0) in _rtl_pci_interrupt()
1029 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_prepare_bcn_tasklet() local
1043 ring = &rtlpci->tx_ring[BEACON_QUEUE]; in _rtl_pci_prepare_bcn_tasklet()
1050 dma_unmap_single(&rtlpci->pdev->dev, in _rtl_pci_prepare_bcn_tasklet()
1085 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_trx_var() local
1099 rtlpci->txringcount[i] = desc_num; in _rtl_pci_init_trx_var()
1104 rtlpci->txringcount[BEACON_QUEUE] = 2; in _rtl_pci_init_trx_var()
1111 rtlpci->txringcount[BE_QUEUE] = RT_TXDESC_NUM_BE_QUEUE; in _rtl_pci_init_trx_var()
1113 rtlpci->rxbuffersize = 9100; /*2048/1024; */ in _rtl_pci_init_trx_var()
1114 rtlpci->rxringcount = RTL_PCI_MAX_RX_COUNT; /*64; */ in _rtl_pci_init_trx_var()
1122 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_struct() local
1125 rtlpci->up_first_time = true; in _rtl_pci_init_struct()
1126 rtlpci->being_init_adapter = false; in _rtl_pci_init_struct()
1129 rtlpci->pdev = pdev; in _rtl_pci_init_struct()
1149 rtlpci->acm_method = EACMWAY2_SW; in _rtl_pci_init_struct()
1162 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_tx_ring() local
1173 dma_alloc_coherent(&rtlpci->pdev->dev, in _rtl_pci_init_tx_ring()
1183 rtlpci->tx_ring[prio].buffer_desc = buffer_desc; in _rtl_pci_init_tx_ring()
1184 rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma; in _rtl_pci_init_tx_ring()
1186 rtlpci->tx_ring[prio].cur_tx_rp = 0; in _rtl_pci_init_tx_ring()
1187 rtlpci->tx_ring[prio].cur_tx_wp = 0; in _rtl_pci_init_tx_ring()
1191 desc = dma_alloc_coherent(&rtlpci->pdev->dev, sizeof(*desc) * entries, in _rtl_pci_init_tx_ring()
1199 rtlpci->tx_ring[prio].desc = desc; in _rtl_pci_init_tx_ring()
1200 rtlpci->tx_ring[prio].dma = desc_dma; in _rtl_pci_init_tx_ring()
1202 rtlpci->tx_ring[prio].idx = 0; in _rtl_pci_init_tx_ring()
1203 rtlpci->tx_ring[prio].entries = entries; in _rtl_pci_init_tx_ring()
1204 skb_queue_head_init(&rtlpci->tx_ring[prio].queue); in _rtl_pci_init_tx_ring()
1227 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_rx_ring() local
1234 rtlpci->rx_ring[rxring_idx].buffer_desc = in _rtl_pci_init_rx_ring()
1235 dma_alloc_coherent(&rtlpci->pdev->dev, in _rtl_pci_init_rx_ring()
1236 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) * in _rtl_pci_init_rx_ring()
1237 rtlpci->rxringcount, in _rtl_pci_init_rx_ring()
1238 &rtlpci->rx_ring[rxring_idx].dma, GFP_KERNEL); in _rtl_pci_init_rx_ring()
1239 if (!rtlpci->rx_ring[rxring_idx].buffer_desc || in _rtl_pci_init_rx_ring()
1240 (ulong)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) { in _rtl_pci_init_rx_ring()
1246 rtlpci->rx_ring[rxring_idx].idx = 0; in _rtl_pci_init_rx_ring()
1247 for (i = 0; i < rtlpci->rxringcount; i++) { in _rtl_pci_init_rx_ring()
1248 entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i]; in _rtl_pci_init_rx_ring()
1257 rtlpci->rx_ring[rxring_idx].desc = in _rtl_pci_init_rx_ring()
1258 dma_alloc_coherent(&rtlpci->pdev->dev, in _rtl_pci_init_rx_ring()
1259 sizeof(*rtlpci->rx_ring[rxring_idx].desc) * in _rtl_pci_init_rx_ring()
1260 rtlpci->rxringcount, in _rtl_pci_init_rx_ring()
1261 &rtlpci->rx_ring[rxring_idx].dma, GFP_KERNEL); in _rtl_pci_init_rx_ring()
1262 if (!rtlpci->rx_ring[rxring_idx].desc || in _rtl_pci_init_rx_ring()
1263 (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) { in _rtl_pci_init_rx_ring()
1269 rtlpci->rx_ring[rxring_idx].idx = 0; in _rtl_pci_init_rx_ring()
1271 for (i = 0; i < rtlpci->rxringcount; i++) { in _rtl_pci_init_rx_ring()
1272 entry = &rtlpci->rx_ring[rxring_idx].desc[i]; in _rtl_pci_init_rx_ring()
1288 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_free_tx_ring() local
1289 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio]; in _rtl_pci_free_tx_ring()
1301 dma_unmap_single(&rtlpci->pdev->dev, in _rtl_pci_free_tx_ring()
1310 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_tx_ring()
1315 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_tx_ring()
1325 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_free_rx_ring() local
1329 for (i = 0; i < rtlpci->rxringcount; i++) { in _rtl_pci_free_rx_ring()
1330 struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[i]; in _rtl_pci_free_rx_ring()
1334 dma_unmap_single(&rtlpci->pdev->dev, *((dma_addr_t *)skb->cb), in _rtl_pci_free_rx_ring()
1335 rtlpci->rxbuffersize, DMA_FROM_DEVICE); in _rtl_pci_free_rx_ring()
1341 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_rx_ring()
1342 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) * in _rtl_pci_free_rx_ring()
1343 rtlpci->rxringcount, in _rtl_pci_free_rx_ring()
1344 rtlpci->rx_ring[rxring_idx].buffer_desc, in _rtl_pci_free_rx_ring()
1345 rtlpci->rx_ring[rxring_idx].dma); in _rtl_pci_free_rx_ring()
1346 rtlpci->rx_ring[rxring_idx].buffer_desc = NULL; in _rtl_pci_free_rx_ring()
1348 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_rx_ring()
1349 sizeof(*rtlpci->rx_ring[rxring_idx].desc) * in _rtl_pci_free_rx_ring()
1350 rtlpci->rxringcount, in _rtl_pci_free_rx_ring()
1351 rtlpci->rx_ring[rxring_idx].desc, in _rtl_pci_free_rx_ring()
1352 rtlpci->rx_ring[rxring_idx].dma); in _rtl_pci_free_rx_ring()
1353 rtlpci->rx_ring[rxring_idx].desc = NULL; in _rtl_pci_free_rx_ring()
1359 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_trx_ring() local
1373 ret = _rtl_pci_init_tx_ring(hw, i, rtlpci->txringcount[i]); in _rtl_pci_init_trx_ring()
1385 if (rtlpci->tx_ring[i].desc || in _rtl_pci_init_trx_ring()
1386 rtlpci->tx_ring[i].buffer_desc) in _rtl_pci_init_trx_ring()
1410 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_reset_trx_ring() local
1423 rtlpci->rx_ring[rxring_idx].desc) { in rtl_pci_reset_trx_ring()
1426 rtlpci->rx_ring[rxring_idx].idx = 0; in rtl_pci_reset_trx_ring()
1427 for (i = 0; i < rtlpci->rxringcount; i++) { in rtl_pci_reset_trx_ring()
1428 entry = &rtlpci->rx_ring[rxring_idx].desc[i]; in rtl_pci_reset_trx_ring()
1433 sizeof(*rtlpci->rx_ring in rtl_pci_reset_trx_ring()
1448 (u8 *)&rtlpci->rxbuffersize); in rtl_pci_reset_trx_ring()
1458 rtlpci->rx_ring[rxring_idx].idx = 0; in rtl_pci_reset_trx_ring()
1466 if (rtlpci->tx_ring[i].desc || in rtl_pci_reset_trx_ring()
1467 rtlpci->tx_ring[i].buffer_desc) { in rtl_pci_reset_trx_ring()
1468 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i]; in rtl_pci_reset_trx_ring()
1480 dma_unmap_single(&rtlpci->pdev->dev, in rtl_pci_reset_trx_ring()
1489 rtlpci->tx_ring[i].cur_tx_rp = 0; in rtl_pci_reset_trx_ring()
1490 rtlpci->tx_ring[i].cur_tx_wp = 0; in rtl_pci_reset_trx_ring()
1494 ring->entries = rtlpci->txringcount[i]; in rtl_pci_reset_trx_ring()
1557 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_tx() local
1580 ring = &rtlpci->tx_ring[hw_queue]; in rtl_pci_tx()
1692 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_deinit() local
1696 synchronize_irq(rtlpci->pdev->irq); in rtl_pci_deinit()
1722 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_start() local
1731 rtlpci->driver_is_goingto_unload = false; in rtl_pci_start()
1762 rtlpci->up_first_time = false; in rtl_pci_start()
1771 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_stop() local
1788 rtlpci->driver_is_goingto_unload = true; in rtl_pci_stop()
2023 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_intr_mode_msi() local
2026 ret = pci_enable_msi(rtlpci->pdev); in rtl_pci_intr_mode_msi()
2030 ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt, in rtl_pci_intr_mode_msi()
2033 pci_disable_msi(rtlpci->pdev); in rtl_pci_intr_mode_msi()
2037 rtlpci->using_msi = true; in rtl_pci_intr_mode_msi()
2048 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_intr_mode_legacy() local
2051 ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt, in rtl_pci_intr_mode_legacy()
2056 rtlpci->using_msi = false; in rtl_pci_intr_mode_legacy()
2065 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_intr_mode_decide() local
2068 if (rtlpci->msi_support) { in rtl_pci_intr_mode_decide()
2100 struct rtl_pci *rtlpci; in rtl_pci_probe() local
2247 rtlpci = rtl_pcidev(pcipriv); in rtl_pci_probe()
2255 rtlpci->irq_alloc = 1; in rtl_pci_probe()
2285 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_disconnect() local
2312 if (rtlpci->irq_alloc) { in rtl_pci_disconnect()
2313 free_irq(rtlpci->pdev->irq, hw); in rtl_pci_disconnect()
2314 rtlpci->irq_alloc = 0; in rtl_pci_disconnect()
2317 if (rtlpci->using_msi) in rtl_pci_disconnect()
2318 pci_disable_msi(rtlpci->pdev); in rtl_pci_disconnect()