Lines Matching refs:rtlpci
65 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_update_default_setting() local
73 ppsc->const_amdpci_aspm = rtlpci->const_amdpci_aspm; in _rtl_pci_update_default_setting()
74 switch (rtlpci->const_pci_aspm) { in _rtl_pci_update_default_setting()
112 switch (rtlpci->const_hwsw_rfoff_d3) { in _rtl_pci_update_default_setting()
130 switch (rtlpci->const_support_pciaspm) { in _rtl_pci_update_default_setting()
147 rtlpci->const_support_pciaspm); in _rtl_pci_update_default_setting()
154 pci_read_config_byte(rtlpci->pdev, 0x80, &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 pci_read_config_byte(rtlpci->pdev, 0x80, &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()
438 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_tx_chk_waitq() local
455 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue]; in _rtl_pci_tx_chk_waitq()
490 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_tx_isr() local
492 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio]; in _rtl_pci_tx_isr()
511 dma_unmap_single(&rtlpci->pdev->dev, in _rtl_pci_tx_isr()
593 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_one_rxdesc() local
602 skb = dev_alloc_skb(rtlpci->rxbuffersize); in _rtl_pci_init_one_rxdesc()
609 dma_map_single(&rtlpci->pdev->dev, skb_tail_pointer(skb), in _rtl_pci_init_one_rxdesc()
610 rtlpci->rxbuffersize, DMA_FROM_DEVICE); in _rtl_pci_init_one_rxdesc()
612 if (dma_mapping_error(&rtlpci->pdev->dev, bufferaddress)) in _rtl_pci_init_one_rxdesc()
614 rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; in _rtl_pci_init_one_rxdesc()
626 (u8 *)&rtlpci->rxbuffersize); in _rtl_pci_init_one_rxdesc()
673 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_hs_interrupt() local
677 rtlpci->sys_irq_mask); in _rtl_pci_hs_interrupt()
683 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_rx_interrupt() local
686 unsigned int count = rtlpci->rxringcount; in _rtl_pci_rx_interrupt()
707 struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[ in _rtl_pci_rx_interrupt()
708 rtlpci->rx_ring[rxring_idx].idx]; in _rtl_pci_rx_interrupt()
718 buffer_desc = &rtlpci->rx_ring[rxring_idx].buffer_desc[ in _rtl_pci_rx_interrupt()
719 rtlpci->rx_ring[rxring_idx].idx]; in _rtl_pci_rx_interrupt()
722 pdesc = &rtlpci->rx_ring[rxring_idx].desc[ in _rtl_pci_rx_interrupt()
723 rtlpci->rx_ring[rxring_idx].idx]; in _rtl_pci_rx_interrupt()
736 dma_unmap_single(&rtlpci->pdev->dev, *((dma_addr_t *)skb->cb), in _rtl_pci_rx_interrupt()
737 rtlpci->rxbuffersize, DMA_FROM_DEVICE); in _rtl_pci_rx_interrupt()
740 new_skb = dev_alloc_skb(rtlpci->rxbuffersize); in _rtl_pci_rx_interrupt()
827 rtlpci->rx_ring[hw_queue].next_rx_rp += 1; in _rtl_pci_rx_interrupt()
828 rtlpci->rx_ring[hw_queue].next_rx_rp %= in _rtl_pci_rx_interrupt()
833 rtlpci->rx_ring[hw_queue].next_rx_rp); in _rtl_pci_rx_interrupt()
844 rtlpci->rx_ring[rxring_idx].idx); in _rtl_pci_rx_interrupt()
848 rtlpci->rx_ring[rxring_idx].idx); in _rtl_pci_rx_interrupt()
849 if (rtlpci->rx_ring[rxring_idx].idx == in _rtl_pci_rx_interrupt()
850 rtlpci->rxringcount - 1) in _rtl_pci_rx_interrupt()
856 rtlpci->rx_ring[rxring_idx].idx = in _rtl_pci_rx_interrupt()
857 (rtlpci->rx_ring[rxring_idx].idx + 1) % in _rtl_pci_rx_interrupt()
858 rtlpci->rxringcount; in _rtl_pci_rx_interrupt()
865 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_interrupt() local
873 if (rtlpci->irq_enabled == 0) in _rtl_pci_interrupt()
1036 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_prepare_bcn_tasklet() local
1050 ring = &rtlpci->tx_ring[BEACON_QUEUE]; in _rtl_pci_prepare_bcn_tasklet()
1057 dma_unmap_single(&rtlpci->pdev->dev, in _rtl_pci_prepare_bcn_tasklet()
1092 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_trx_var() local
1106 rtlpci->txringcount[i] = desc_num; in _rtl_pci_init_trx_var()
1111 rtlpci->txringcount[BEACON_QUEUE] = 2; in _rtl_pci_init_trx_var()
1118 rtlpci->txringcount[BE_QUEUE] = RT_TXDESC_NUM_BE_QUEUE; in _rtl_pci_init_trx_var()
1120 rtlpci->rxbuffersize = 9100; /*2048/1024; */ in _rtl_pci_init_trx_var()
1121 rtlpci->rxringcount = RTL_PCI_MAX_RX_COUNT; /*64; */ in _rtl_pci_init_trx_var()
1129 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_struct() local
1132 rtlpci->up_first_time = true; in _rtl_pci_init_struct()
1133 rtlpci->being_init_adapter = false; in _rtl_pci_init_struct()
1136 rtlpci->pdev = pdev; in _rtl_pci_init_struct()
1156 rtlpci->acm_method = EACMWAY2_SW; in _rtl_pci_init_struct()
1169 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_tx_ring() local
1180 dma_alloc_coherent(&rtlpci->pdev->dev, in _rtl_pci_init_tx_ring()
1190 rtlpci->tx_ring[prio].buffer_desc = buffer_desc; in _rtl_pci_init_tx_ring()
1191 rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma; in _rtl_pci_init_tx_ring()
1193 rtlpci->tx_ring[prio].cur_tx_rp = 0; in _rtl_pci_init_tx_ring()
1194 rtlpci->tx_ring[prio].cur_tx_wp = 0; in _rtl_pci_init_tx_ring()
1198 desc = dma_alloc_coherent(&rtlpci->pdev->dev, sizeof(*desc) * entries, in _rtl_pci_init_tx_ring()
1206 rtlpci->tx_ring[prio].desc = desc; in _rtl_pci_init_tx_ring()
1207 rtlpci->tx_ring[prio].dma = desc_dma; in _rtl_pci_init_tx_ring()
1209 rtlpci->tx_ring[prio].idx = 0; in _rtl_pci_init_tx_ring()
1210 rtlpci->tx_ring[prio].entries = entries; in _rtl_pci_init_tx_ring()
1211 skb_queue_head_init(&rtlpci->tx_ring[prio].queue); in _rtl_pci_init_tx_ring()
1234 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_rx_ring() local
1241 rtlpci->rx_ring[rxring_idx].buffer_desc = in _rtl_pci_init_rx_ring()
1242 dma_alloc_coherent(&rtlpci->pdev->dev, in _rtl_pci_init_rx_ring()
1243 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) * in _rtl_pci_init_rx_ring()
1244 rtlpci->rxringcount, in _rtl_pci_init_rx_ring()
1245 &rtlpci->rx_ring[rxring_idx].dma, GFP_KERNEL); in _rtl_pci_init_rx_ring()
1246 if (!rtlpci->rx_ring[rxring_idx].buffer_desc || in _rtl_pci_init_rx_ring()
1247 (ulong)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) { in _rtl_pci_init_rx_ring()
1253 rtlpci->rx_ring[rxring_idx].idx = 0; in _rtl_pci_init_rx_ring()
1254 for (i = 0; i < rtlpci->rxringcount; i++) { in _rtl_pci_init_rx_ring()
1255 entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i]; in _rtl_pci_init_rx_ring()
1264 rtlpci->rx_ring[rxring_idx].desc = in _rtl_pci_init_rx_ring()
1265 dma_alloc_coherent(&rtlpci->pdev->dev, in _rtl_pci_init_rx_ring()
1266 sizeof(*rtlpci->rx_ring[rxring_idx].desc) * in _rtl_pci_init_rx_ring()
1267 rtlpci->rxringcount, in _rtl_pci_init_rx_ring()
1268 &rtlpci->rx_ring[rxring_idx].dma, GFP_KERNEL); in _rtl_pci_init_rx_ring()
1269 if (!rtlpci->rx_ring[rxring_idx].desc || in _rtl_pci_init_rx_ring()
1270 (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) { in _rtl_pci_init_rx_ring()
1276 rtlpci->rx_ring[rxring_idx].idx = 0; in _rtl_pci_init_rx_ring()
1278 for (i = 0; i < rtlpci->rxringcount; i++) { in _rtl_pci_init_rx_ring()
1279 entry = &rtlpci->rx_ring[rxring_idx].desc[i]; in _rtl_pci_init_rx_ring()
1295 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_free_tx_ring() local
1296 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio]; in _rtl_pci_free_tx_ring()
1308 dma_unmap_single(&rtlpci->pdev->dev, in _rtl_pci_free_tx_ring()
1317 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_tx_ring()
1322 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_tx_ring()
1332 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_free_rx_ring() local
1336 for (i = 0; i < rtlpci->rxringcount; i++) { in _rtl_pci_free_rx_ring()
1337 struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[i]; in _rtl_pci_free_rx_ring()
1341 dma_unmap_single(&rtlpci->pdev->dev, *((dma_addr_t *)skb->cb), in _rtl_pci_free_rx_ring()
1342 rtlpci->rxbuffersize, DMA_FROM_DEVICE); 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].buffer_desc) * in _rtl_pci_free_rx_ring()
1350 rtlpci->rxringcount, in _rtl_pci_free_rx_ring()
1351 rtlpci->rx_ring[rxring_idx].buffer_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].buffer_desc = NULL; in _rtl_pci_free_rx_ring()
1355 dma_free_coherent(&rtlpci->pdev->dev, in _rtl_pci_free_rx_ring()
1356 sizeof(*rtlpci->rx_ring[rxring_idx].desc) * in _rtl_pci_free_rx_ring()
1357 rtlpci->rxringcount, in _rtl_pci_free_rx_ring()
1358 rtlpci->rx_ring[rxring_idx].desc, in _rtl_pci_free_rx_ring()
1359 rtlpci->rx_ring[rxring_idx].dma); in _rtl_pci_free_rx_ring()
1360 rtlpci->rx_ring[rxring_idx].desc = NULL; in _rtl_pci_free_rx_ring()
1366 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in _rtl_pci_init_trx_ring() local
1380 ret = _rtl_pci_init_tx_ring(hw, i, rtlpci->txringcount[i]); in _rtl_pci_init_trx_ring()
1392 if (rtlpci->tx_ring[i].desc || in _rtl_pci_init_trx_ring()
1393 rtlpci->tx_ring[i].buffer_desc) in _rtl_pci_init_trx_ring()
1417 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_reset_trx_ring() local
1430 rtlpci->rx_ring[rxring_idx].desc) { in rtl_pci_reset_trx_ring()
1433 rtlpci->rx_ring[rxring_idx].idx = 0; in rtl_pci_reset_trx_ring()
1434 for (i = 0; i < rtlpci->rxringcount; i++) { in rtl_pci_reset_trx_ring()
1435 entry = &rtlpci->rx_ring[rxring_idx].desc[i]; in rtl_pci_reset_trx_ring()
1440 sizeof(*rtlpci->rx_ring in rtl_pci_reset_trx_ring()
1455 (u8 *)&rtlpci->rxbuffersize); in rtl_pci_reset_trx_ring()
1465 rtlpci->rx_ring[rxring_idx].idx = 0; in rtl_pci_reset_trx_ring()
1473 if (rtlpci->tx_ring[i].desc || in rtl_pci_reset_trx_ring()
1474 rtlpci->tx_ring[i].buffer_desc) { in rtl_pci_reset_trx_ring()
1475 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i]; in rtl_pci_reset_trx_ring()
1487 dma_unmap_single(&rtlpci->pdev->dev, in rtl_pci_reset_trx_ring()
1496 rtlpci->tx_ring[i].cur_tx_rp = 0; in rtl_pci_reset_trx_ring()
1497 rtlpci->tx_ring[i].cur_tx_wp = 0; in rtl_pci_reset_trx_ring()
1501 ring->entries = rtlpci->txringcount[i]; in rtl_pci_reset_trx_ring()
1564 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_tx() local
1587 ring = &rtlpci->tx_ring[hw_queue]; in rtl_pci_tx()
1699 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_deinit() local
1703 synchronize_irq(rtlpci->pdev->irq); in rtl_pci_deinit()
1730 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_start() local
1739 rtlpci->driver_is_goingto_unload = false; in rtl_pci_start()
1770 rtlpci->up_first_time = false; in rtl_pci_start()
1779 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); in rtl_pci_stop() local
1796 rtlpci->driver_is_goingto_unload = true; in rtl_pci_stop()
2032 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_intr_mode_msi() local
2035 ret = pci_enable_msi(rtlpci->pdev); in rtl_pci_intr_mode_msi()
2039 ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt, in rtl_pci_intr_mode_msi()
2042 pci_disable_msi(rtlpci->pdev); in rtl_pci_intr_mode_msi()
2046 rtlpci->using_msi = true; in rtl_pci_intr_mode_msi()
2057 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_intr_mode_legacy() local
2060 ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt, in rtl_pci_intr_mode_legacy()
2065 rtlpci->using_msi = false; in rtl_pci_intr_mode_legacy()
2074 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_intr_mode_decide() local
2077 if (rtlpci->msi_support) { in rtl_pci_intr_mode_decide()
2109 struct rtl_pci *rtlpci; in rtl_pci_probe() local
2256 rtlpci = rtl_pcidev(pcipriv); in rtl_pci_probe()
2264 rtlpci->irq_alloc = 1; in rtl_pci_probe()
2294 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); in rtl_pci_disconnect() local
2321 if (rtlpci->irq_alloc) { in rtl_pci_disconnect()
2322 free_irq(rtlpci->pdev->irq, hw); in rtl_pci_disconnect()
2323 rtlpci->irq_alloc = 0; in rtl_pci_disconnect()
2326 if (rtlpci->using_msi) in rtl_pci_disconnect()
2327 pci_disable_msi(rtlpci->pdev); in rtl_pci_disconnect()