Lines Matching refs:rtwdev
44 static u8 rtw_pci_read8(struct rtw_dev *rtwdev, u32 addr) in rtw_pci_read8() argument
46 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_read8()
51 static u16 rtw_pci_read16(struct rtw_dev *rtwdev, u32 addr) in rtw_pci_read16() argument
53 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_read16()
58 static u32 rtw_pci_read32(struct rtw_dev *rtwdev, u32 addr) in rtw_pci_read32() argument
60 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_read32()
65 static void rtw_pci_write8(struct rtw_dev *rtwdev, u32 addr, u8 val) in rtw_pci_write8() argument
67 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_write8()
72 static void rtw_pci_write16(struct rtw_dev *rtwdev, u32 addr, u16 val) in rtw_pci_write16() argument
74 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_write16()
79 static void rtw_pci_write32(struct rtw_dev *rtwdev, u32 addr, u32 val) in rtw_pci_write32() argument
81 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_write32()
93 static void rtw_pci_free_tx_ring_skbs(struct rtw_dev *rtwdev, in rtw_pci_free_tx_ring_skbs() argument
96 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_free_tx_ring_skbs()
112 static void rtw_pci_free_tx_ring(struct rtw_dev *rtwdev, in rtw_pci_free_tx_ring() argument
115 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_free_tx_ring()
120 rtw_pci_free_tx_ring_skbs(rtwdev, tx_ring); in rtw_pci_free_tx_ring()
127 static void rtw_pci_free_rx_ring_skbs(struct rtw_dev *rtwdev, in rtw_pci_free_rx_ring_skbs() argument
130 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_free_rx_ring_skbs()
148 static void rtw_pci_free_rx_ring(struct rtw_dev *rtwdev, in rtw_pci_free_rx_ring() argument
151 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_free_rx_ring()
155 rtw_pci_free_rx_ring_skbs(rtwdev, rx_ring); in rtw_pci_free_rx_ring()
160 static void rtw_pci_free_trx_ring(struct rtw_dev *rtwdev) in rtw_pci_free_trx_ring() argument
162 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_free_trx_ring()
169 rtw_pci_free_tx_ring(rtwdev, tx_ring); in rtw_pci_free_trx_ring()
174 rtw_pci_free_rx_ring(rtwdev, rx_ring); in rtw_pci_free_trx_ring()
178 static int rtw_pci_init_tx_ring(struct rtw_dev *rtwdev, in rtw_pci_init_tx_ring() argument
182 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_init_tx_ring()
189 rtw_err(rtwdev, "failed to allocate tx ring\n"); in rtw_pci_init_tx_ring()
204 static int rtw_pci_reset_rx_desc(struct rtw_dev *rtwdev, struct sk_buff *skb, in rtw_pci_reset_rx_desc() argument
208 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_reset_rx_desc()
230 static void rtw_pci_sync_rx_desc_device(struct rtw_dev *rtwdev, dma_addr_t dma, in rtw_pci_sync_rx_desc_device() argument
234 struct device *dev = rtwdev->dev; in rtw_pci_sync_rx_desc_device()
247 static int rtw_pci_init_rx_ring(struct rtw_dev *rtwdev, in rtw_pci_init_rx_ring() argument
251 struct pci_dev *pdev = to_pci_dev(rtwdev->dev); in rtw_pci_init_rx_ring()
262 rtw_err(rtwdev, "failed to allocate rx ring\n"); in rtw_pci_init_rx_ring()
277 ret = rtw_pci_reset_rx_desc(rtwdev, skb, rx_ring, i, desc_size); in rtw_pci_init_rx_ring()
305 rtw_err(rtwdev, "failed to init rx buffer\n"); in rtw_pci_init_rx_ring()
310 static int rtw_pci_init_trx_ring(struct rtw_dev *rtwdev) in rtw_pci_init_trx_ring() argument
312 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_init_trx_ring()
315 struct rtw_chip_info *chip = rtwdev->chip; in rtw_pci_init_trx_ring()
326 ret = rtw_pci_init_tx_ring(rtwdev, tx_ring, tx_desc_size, len); in rtw_pci_init_trx_ring()
335 ret = rtw_pci_init_rx_ring(rtwdev, rx_ring, rx_desc_size, in rtw_pci_init_trx_ring()
347 rtw_pci_free_tx_ring(rtwdev, tx_ring); in rtw_pci_init_trx_ring()
353 rtw_pci_free_rx_ring(rtwdev, rx_ring); in rtw_pci_init_trx_ring()
359 static void rtw_pci_deinit(struct rtw_dev *rtwdev) in rtw_pci_deinit() argument
361 rtw_pci_free_trx_ring(rtwdev); in rtw_pci_deinit()
364 static int rtw_pci_init(struct rtw_dev *rtwdev) in rtw_pci_init() argument
366 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_init()
383 ret = rtw_pci_init_trx_ring(rtwdev); in rtw_pci_init()
388 static void rtw_pci_reset_buf_desc(struct rtw_dev *rtwdev) in rtw_pci_reset_buf_desc() argument
390 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_reset_buf_desc()
395 tmp = rtw_read8(rtwdev, RTK_PCI_CTRL + 3); in rtw_pci_reset_buf_desc()
396 rtw_write8(rtwdev, RTK_PCI_CTRL + 3, tmp | 0xf7); in rtw_pci_reset_buf_desc()
399 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_BCNQ, dma); in rtw_pci_reset_buf_desc()
405 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_H2CQ, len); in rtw_pci_reset_buf_desc()
406 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_H2CQ, dma); in rtw_pci_reset_buf_desc()
412 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_BKQ, len); in rtw_pci_reset_buf_desc()
413 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_BKQ, dma); in rtw_pci_reset_buf_desc()
419 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_BEQ, len); in rtw_pci_reset_buf_desc()
420 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_BEQ, dma); in rtw_pci_reset_buf_desc()
426 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_VOQ, len); in rtw_pci_reset_buf_desc()
427 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_VOQ, dma); in rtw_pci_reset_buf_desc()
433 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_VIQ, len); in rtw_pci_reset_buf_desc()
434 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_VIQ, dma); in rtw_pci_reset_buf_desc()
440 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_MGMTQ, len); in rtw_pci_reset_buf_desc()
441 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_MGMTQ, dma); in rtw_pci_reset_buf_desc()
447 rtw_write16(rtwdev, RTK_PCI_TXBD_NUM_HI0Q, len); in rtw_pci_reset_buf_desc()
448 rtw_write32(rtwdev, RTK_PCI_TXBD_DESA_HI0Q, dma); in rtw_pci_reset_buf_desc()
454 rtw_write16(rtwdev, RTK_PCI_RXBD_NUM_MPDUQ, len & 0xfff); in rtw_pci_reset_buf_desc()
455 rtw_write32(rtwdev, RTK_PCI_RXBD_DESA_MPDUQ, dma); in rtw_pci_reset_buf_desc()
458 rtw_write32(rtwdev, RTK_PCI_TXBD_RWPTR_CLR, 0xffffffff); in rtw_pci_reset_buf_desc()
461 rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, BIT_CLR_H2CQ_HOST_IDX); in rtw_pci_reset_buf_desc()
462 rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, BIT_CLR_H2CQ_HW_IDX); in rtw_pci_reset_buf_desc()
465 static void rtw_pci_reset_trx_ring(struct rtw_dev *rtwdev) in rtw_pci_reset_trx_ring() argument
467 rtw_pci_reset_buf_desc(rtwdev); in rtw_pci_reset_trx_ring()
470 static void rtw_pci_enable_interrupt(struct rtw_dev *rtwdev, in rtw_pci_enable_interrupt() argument
473 rtw_write32(rtwdev, RTK_PCI_HIMR0, rtwpci->irq_mask[0]); in rtw_pci_enable_interrupt()
474 rtw_write32(rtwdev, RTK_PCI_HIMR1, rtwpci->irq_mask[1]); in rtw_pci_enable_interrupt()
475 rtw_write32(rtwdev, RTK_PCI_HIMR3, rtwpci->irq_mask[3]); in rtw_pci_enable_interrupt()
479 static void rtw_pci_disable_interrupt(struct rtw_dev *rtwdev, in rtw_pci_disable_interrupt() argument
482 rtw_write32(rtwdev, RTK_PCI_HIMR0, 0); in rtw_pci_disable_interrupt()
483 rtw_write32(rtwdev, RTK_PCI_HIMR1, 0); in rtw_pci_disable_interrupt()
484 rtw_write32(rtwdev, RTK_PCI_HIMR3, 0); in rtw_pci_disable_interrupt()
488 static int rtw_pci_setup(struct rtw_dev *rtwdev) in rtw_pci_setup() argument
490 rtw_pci_reset_trx_ring(rtwdev); in rtw_pci_setup()
495 static void rtw_pci_dma_reset(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci) in rtw_pci_dma_reset() argument
498 rtw_write32_set(rtwdev, RTK_PCI_CTRL, in rtw_pci_dma_reset()
503 static void rtw_pci_dma_release(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci) in rtw_pci_dma_release() argument
510 rtw_pci_free_tx_ring_skbs(rtwdev, tx_ring); in rtw_pci_dma_release()
514 static int rtw_pci_start(struct rtw_dev *rtwdev) in rtw_pci_start() argument
516 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_start()
519 rtw_pci_dma_reset(rtwdev, rtwpci); in rtw_pci_start()
522 rtw_pci_enable_interrupt(rtwdev, rtwpci); in rtw_pci_start()
528 static void rtw_pci_stop(struct rtw_dev *rtwdev) in rtw_pci_stop() argument
530 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_stop()
534 rtw_pci_disable_interrupt(rtwdev, rtwpci); in rtw_pci_stop()
535 rtw_pci_dma_release(rtwdev, rtwpci); in rtw_pci_stop()
582 static void rtw_pci_dma_check(struct rtw_dev *rtwdev, in rtw_pci_dma_check() argument
586 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_dma_check()
587 struct rtw_chip_info *chip = rtwdev->chip; in rtw_pci_dma_check()
598 rtw_warn(rtwdev, "pci bus timeout, check dma status\n"); in rtw_pci_dma_check()
603 static int rtw_pci_xmit(struct rtw_dev *rtwdev, in rtw_pci_xmit() argument
607 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_xmit()
608 struct rtw_chip_info *chip = rtwdev->chip; in rtw_pci_xmit()
661 rtw_write16(rtwdev, bd_idx, ring->r.wp & 0xfff); in rtw_pci_xmit()
665 reg_bcn_work = rtw_read8(rtwdev, RTK_PCI_TXBD_BCN_WORK); in rtw_pci_xmit()
667 rtw_write8(rtwdev, RTK_PCI_TXBD_BCN_WORK, reg_bcn_work); in rtw_pci_xmit()
673 static int rtw_pci_write_data_rsvd_page(struct rtw_dev *rtwdev, u8 *buf, in rtw_pci_write_data_rsvd_page() argument
681 tx_pkt_desc_sz = rtwdev->chip->tx_pkt_desc_sz; in rtw_pci_write_data_rsvd_page()
693 return rtw_pci_xmit(rtwdev, &pkt_info, skb, RTW_TX_QUEUE_BCN); in rtw_pci_write_data_rsvd_page()
696 static int rtw_pci_write_data_h2c(struct rtw_dev *rtwdev, u8 *buf, u32 size) in rtw_pci_write_data_h2c() argument
703 tx_pkt_desc_sz = rtwdev->chip->tx_pkt_desc_sz; in rtw_pci_write_data_h2c()
714 return rtw_pci_xmit(rtwdev, &pkt_info, skb, RTW_TX_QUEUE_H2C); in rtw_pci_write_data_h2c()
717 static int rtw_pci_tx(struct rtw_dev *rtwdev, in rtw_pci_tx() argument
721 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_tx()
726 ret = rtw_pci_xmit(rtwdev, pkt_info, skb, queue); in rtw_pci_tx()
732 ieee80211_stop_queue(rtwdev->hw, skb_get_queue_mapping(skb)); in rtw_pci_tx()
739 static void rtw_pci_tx_isr(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci, in rtw_pci_tx_isr() argument
742 struct ieee80211_hw *hw = rtwdev->hw; in rtw_pci_tx_isr()
755 bd_idx = rtw_read32(rtwdev, bd_idx_addr); in rtw_pci_tx_isr()
782 skb_pull(skb, rtwdev->chip->tx_pkt_desc_sz); in rtw_pci_tx_isr()
788 rtw_tx_report_enqueue(rtwdev, skb, tx_data->sn); in rtw_pci_tx_isr()
805 static void rtw_pci_rx_isr(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci, in rtw_pci_rx_isr() argument
808 struct rtw_chip_info *chip = rtwdev->chip; in rtw_pci_rx_isr()
824 tmp = rtw_read32(rtwdev, RTK_PCI_RXBD_IDX_MPDUQ); in rtw_pci_rx_isr()
834 rtw_pci_dma_check(rtwdev, ring, cur_rp); in rtw_pci_rx_isr()
837 dma_sync_single_for_cpu(rtwdev->dev, dma, RTK_PCI_RX_BUF_SIZE, in rtw_pci_rx_isr()
840 chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status); in rtw_pci_rx_isr()
858 rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, new); in rtw_pci_rx_isr()
863 rtw_rx_stats(rtwdev, pkt_stat.vif, new); in rtw_pci_rx_isr()
865 ieee80211_rx_irqsafe(rtwdev->hw, new); in rtw_pci_rx_isr()
870 rtw_pci_sync_rx_desc_device(rtwdev, dma, ring, cur_rp, in rtw_pci_rx_isr()
880 rtw_write16(rtwdev, RTK_PCI_RXBD_IDX_MPDUQ, ring->r.rp); in rtw_pci_rx_isr()
883 static void rtw_pci_irq_recognized(struct rtw_dev *rtwdev, in rtw_pci_irq_recognized() argument
886 irq_status[0] = rtw_read32(rtwdev, RTK_PCI_HISR0); in rtw_pci_irq_recognized()
887 irq_status[1] = rtw_read32(rtwdev, RTK_PCI_HISR1); in rtw_pci_irq_recognized()
888 irq_status[3] = rtw_read32(rtwdev, RTK_PCI_HISR3); in rtw_pci_irq_recognized()
892 rtw_write32(rtwdev, RTK_PCI_HISR0, irq_status[0]); in rtw_pci_irq_recognized()
893 rtw_write32(rtwdev, RTK_PCI_HISR1, irq_status[1]); in rtw_pci_irq_recognized()
894 rtw_write32(rtwdev, RTK_PCI_HISR3, irq_status[3]); in rtw_pci_irq_recognized()
899 struct rtw_dev *rtwdev = dev; in rtw_pci_interrupt_handler() local
900 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_interrupt_handler()
914 rtw_pci_disable_interrupt(rtwdev, rtwpci); in rtw_pci_interrupt_handler()
923 struct rtw_dev *rtwdev = dev; in rtw_pci_interrupt_threadfn() local
924 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_interrupt_threadfn()
929 rtw_pci_irq_recognized(rtwdev, rtwpci, irq_status); in rtw_pci_interrupt_threadfn()
932 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_MGMT); in rtw_pci_interrupt_threadfn()
934 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_HI0); in rtw_pci_interrupt_threadfn()
936 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_BE); in rtw_pci_interrupt_threadfn()
938 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_BK); in rtw_pci_interrupt_threadfn()
940 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_VO); in rtw_pci_interrupt_threadfn()
942 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_VI); in rtw_pci_interrupt_threadfn()
944 rtw_pci_tx_isr(rtwdev, rtwpci, RTW_TX_QUEUE_H2C); in rtw_pci_interrupt_threadfn()
946 rtw_pci_rx_isr(rtwdev, rtwpci, RTW_RX_QUEUE_MPDU); in rtw_pci_interrupt_threadfn()
949 rtw_pci_enable_interrupt(rtwdev, rtwpci); in rtw_pci_interrupt_threadfn()
955 static int rtw_pci_io_mapping(struct rtw_dev *rtwdev, in rtw_pci_io_mapping() argument
958 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_io_mapping()
965 rtw_err(rtwdev, "failed to request pci regions\n"); in rtw_pci_io_mapping()
972 rtw_err(rtwdev, "failed to map pci memory\n"); in rtw_pci_io_mapping()
979 static void rtw_pci_io_unmapping(struct rtw_dev *rtwdev, in rtw_pci_io_unmapping() argument
982 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_io_unmapping()
990 static void rtw_dbi_write8(struct rtw_dev *rtwdev, u16 addr, u8 data) in rtw_dbi_write8() argument
998 rtw_write8(rtwdev, REG_DBI_WDATA_V1 + remainder, data); in rtw_dbi_write8()
999 rtw_write16(rtwdev, REG_DBI_FLAG_V1, write_addr); in rtw_dbi_write8()
1000 rtw_write8(rtwdev, REG_DBI_FLAG_V1 + 2, 0x01); in rtw_dbi_write8()
1002 flag = rtw_read8(rtwdev, REG_DBI_FLAG_V1 + 2); in rtw_dbi_write8()
1005 flag = rtw_read8(rtwdev, REG_DBI_FLAG_V1 + 2); in rtw_dbi_write8()
1012 static void rtw_mdio_write(struct rtw_dev *rtwdev, u8 addr, u16 data, bool g1) in rtw_mdio_write() argument
1018 rtw_write16(rtwdev, REG_MDIO_V1, data); in rtw_mdio_write()
1022 rtw_write8(rtwdev, REG_PCIE_MIX_CFG, addr & 0x1f); in rtw_mdio_write()
1023 rtw_write8(rtwdev, REG_PCIE_MIX_CFG + 3, page); in rtw_mdio_write()
1025 rtw_write32_mask(rtwdev, REG_PCIE_MIX_CFG, BIT_MDIO_WFLAG_V1, 1); in rtw_mdio_write()
1026 wflag = rtw_read32_mask(rtwdev, REG_PCIE_MIX_CFG, BIT_MDIO_WFLAG_V1); in rtw_mdio_write()
1031 wflag = rtw_read32_mask(rtwdev, REG_PCIE_MIX_CFG, in rtw_mdio_write()
1039 static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev) in rtw_pci_phy_cfg() argument
1041 struct rtw_chip_info *chip = rtwdev->chip; in rtw_pci_phy_cfg()
1048 cut = BIT(0) << rtwdev->hal.cut_version; in rtw_pci_phy_cfg()
1059 rtw_mdio_write(rtwdev, offset, value, true); in rtw_pci_phy_cfg()
1061 rtw_dbi_write8(rtwdev, offset, value); in rtw_pci_phy_cfg()
1073 rtw_mdio_write(rtwdev, offset, value, false); in rtw_pci_phy_cfg()
1075 rtw_dbi_write8(rtwdev, offset, value); in rtw_pci_phy_cfg()
1079 static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev) in rtw_pci_claim() argument
1085 rtw_err(rtwdev, "failed to enable pci device\n"); in rtw_pci_claim()
1090 pci_set_drvdata(pdev, rtwdev->hw); in rtw_pci_claim()
1091 SET_IEEE80211_DEV(rtwdev->hw, &pdev->dev); in rtw_pci_claim()
1096 static void rtw_pci_declaim(struct rtw_dev *rtwdev, struct pci_dev *pdev) in rtw_pci_declaim() argument
1102 static int rtw_pci_setup_resource(struct rtw_dev *rtwdev, struct pci_dev *pdev) in rtw_pci_setup_resource() argument
1107 rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_setup_resource()
1111 ret = rtw_pci_io_mapping(rtwdev, pdev); in rtw_pci_setup_resource()
1113 rtw_err(rtwdev, "failed to request pci io region\n"); in rtw_pci_setup_resource()
1117 ret = rtw_pci_init(rtwdev); in rtw_pci_setup_resource()
1119 rtw_err(rtwdev, "failed to allocate pci resources\n"); in rtw_pci_setup_resource()
1123 rtw_pci_phy_cfg(rtwdev); in rtw_pci_setup_resource()
1128 rtw_pci_io_unmapping(rtwdev, pdev); in rtw_pci_setup_resource()
1134 static void rtw_pci_destroy(struct rtw_dev *rtwdev, struct pci_dev *pdev) in rtw_pci_destroy() argument
1136 rtw_pci_deinit(rtwdev); in rtw_pci_destroy()
1137 rtw_pci_io_unmapping(rtwdev, pdev); in rtw_pci_destroy()
1156 static int rtw_pci_request_irq(struct rtw_dev *rtwdev, struct pci_dev *pdev) in rtw_pci_request_irq() argument
1166 rtw_err(rtwdev, "failed to alloc PCI irq vectors\n"); in rtw_pci_request_irq()
1170 ret = devm_request_threaded_irq(rtwdev->dev, pdev->irq, in rtw_pci_request_irq()
1173 IRQF_SHARED, KBUILD_MODNAME, rtwdev); in rtw_pci_request_irq()
1175 rtw_err(rtwdev, "failed to request irq %d\n", ret); in rtw_pci_request_irq()
1182 static void rtw_pci_free_irq(struct rtw_dev *rtwdev, struct pci_dev *pdev) in rtw_pci_free_irq() argument
1184 devm_free_irq(rtwdev->dev, pdev->irq, rtwdev); in rtw_pci_free_irq()
1192 struct rtw_dev *rtwdev; in rtw_pci_probe() local
1203 rtwdev = hw->priv; in rtw_pci_probe()
1204 rtwdev->hw = hw; in rtw_pci_probe()
1205 rtwdev->dev = &pdev->dev; in rtw_pci_probe()
1206 rtwdev->chip = (struct rtw_chip_info *)id->driver_data; in rtw_pci_probe()
1207 rtwdev->hci.ops = &rtw_pci_ops; in rtw_pci_probe()
1208 rtwdev->hci.type = RTW_HCI_TYPE_PCIE; in rtw_pci_probe()
1210 ret = rtw_core_init(rtwdev); in rtw_pci_probe()
1214 rtw_dbg(rtwdev, RTW_DBG_PCI, in rtw_pci_probe()
1218 ret = rtw_pci_claim(rtwdev, pdev); in rtw_pci_probe()
1220 rtw_err(rtwdev, "failed to claim pci device\n"); in rtw_pci_probe()
1224 ret = rtw_pci_setup_resource(rtwdev, pdev); in rtw_pci_probe()
1226 rtw_err(rtwdev, "failed to setup pci resources\n"); in rtw_pci_probe()
1230 ret = rtw_chip_info_setup(rtwdev); in rtw_pci_probe()
1232 rtw_err(rtwdev, "failed to setup chip information\n"); in rtw_pci_probe()
1236 ret = rtw_register_hw(rtwdev, hw); in rtw_pci_probe()
1238 rtw_err(rtwdev, "failed to register hw\n"); in rtw_pci_probe()
1242 ret = rtw_pci_request_irq(rtwdev, pdev); in rtw_pci_probe()
1251 rtw_pci_destroy(rtwdev, pdev); in rtw_pci_probe()
1254 rtw_pci_declaim(rtwdev, pdev); in rtw_pci_probe()
1257 rtw_core_deinit(rtwdev); in rtw_pci_probe()
1268 struct rtw_dev *rtwdev; in rtw_pci_remove() local
1274 rtwdev = hw->priv; in rtw_pci_remove()
1275 rtwpci = (struct rtw_pci *)rtwdev->priv; in rtw_pci_remove()
1277 rtw_unregister_hw(rtwdev, hw); in rtw_pci_remove()
1278 rtw_pci_disable_interrupt(rtwdev, rtwpci); in rtw_pci_remove()
1279 rtw_pci_destroy(rtwdev, pdev); in rtw_pci_remove()
1280 rtw_pci_declaim(rtwdev, pdev); in rtw_pci_remove()
1281 rtw_pci_free_irq(rtwdev, pdev); in rtw_pci_remove()
1282 rtw_core_deinit(rtwdev); in rtw_pci_remove()