rtw8852ae.c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
  2. /* Copyright(c) 2020-2021 Realtek Corporation
  3. */
  4. #include <linux/module.h>
  5. #include <linux/pci.h>
  6. #include "pci.h"
  7. #include "reg.h"
  8. #include "rtw8852a.h"
  9. static const struct rtw89_pci_info rtw8852a_pci_info = {
  10. .txbd_trunc_mode = MAC_AX_BD_TRUNC,
  11. .rxbd_trunc_mode = MAC_AX_BD_TRUNC,
  12. .rxbd_mode = MAC_AX_RXBD_PKT,
  13. .tag_mode = MAC_AX_TAG_MULTI,
  14. .tx_burst = MAC_AX_TX_BURST_2048B,
  15. .rx_burst = MAC_AX_RX_BURST_128B,
  16. .wd_dma_idle_intvl = MAC_AX_WD_DMA_INTVL_256NS,
  17. .wd_dma_act_intvl = MAC_AX_WD_DMA_INTVL_256NS,
  18. .multi_tag_num = MAC_AX_TAG_NUM_8,
  19. .lbc_en = MAC_AX_PCIE_ENABLE,
  20. .lbc_tmr = MAC_AX_LBC_TMR_2MS,
  21. .autok_en = MAC_AX_PCIE_DISABLE,
  22. .io_rcy_en = MAC_AX_PCIE_DISABLE,
  23. .io_rcy_tmr = MAC_AX_IO_RCY_ANA_TMR_6MS,
  24. .init_cfg_reg = R_AX_PCIE_INIT_CFG1,
  25. .txhci_en_bit = B_AX_TXHCI_EN,
  26. .rxhci_en_bit = B_AX_RXHCI_EN,
  27. .rxbd_mode_bit = B_AX_RXBD_MODE,
  28. .exp_ctrl_reg = R_AX_PCIE_EXP_CTRL,
  29. .max_tag_num_mask = B_AX_MAX_TAG_NUM,
  30. .rxbd_rwptr_clr_reg = R_AX_RXBD_RWPTR_CLR,
  31. .txbd_rwptr_clr2_reg = R_AX_TXBD_RWPTR_CLR2,
  32. .dma_stop1 = {R_AX_PCIE_DMA_STOP1, B_AX_TX_STOP1_MASK},
  33. .dma_stop2 = {R_AX_PCIE_DMA_STOP2, B_AX_TX_STOP2_ALL},
  34. .dma_busy1 = {R_AX_PCIE_DMA_BUSY1, DMA_BUSY1_CHECK},
  35. .dma_busy2_reg = R_AX_PCIE_DMA_BUSY2,
  36. .dma_busy3_reg = R_AX_PCIE_DMA_BUSY1,
  37. .rpwm_addr = R_AX_PCIE_HRPWM,
  38. .cpwm_addr = R_AX_CPWM,
  39. .tx_dma_ch_mask = 0,
  40. .bd_idx_addr_low_power = NULL,
  41. .dma_addr_set = &rtw89_pci_ch_dma_addr_set,
  42. .bd_ram_table = &rtw89_bd_ram_table_dual,
  43. .ltr_set = rtw89_pci_ltr_set,
  44. .fill_txaddr_info = rtw89_pci_fill_txaddr_info,
  45. .config_intr_mask = rtw89_pci_config_intr_mask,
  46. .enable_intr = rtw89_pci_enable_intr,
  47. .disable_intr = rtw89_pci_disable_intr,
  48. .recognize_intrs = rtw89_pci_recognize_intrs,
  49. };
  50. static const struct rtw89_driver_info rtw89_8852ae_info = {
  51. .chip = &rtw8852a_chip_info,
  52. .bus = {
  53. .pci = &rtw8852a_pci_info,
  54. },
  55. };
  56. static const struct pci_device_id rtw89_8852ae_id_table[] = {
  57. {
  58. PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8852),
  59. .driver_data = (kernel_ulong_t)&rtw89_8852ae_info,
  60. },
  61. {
  62. PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xa85a),
  63. .driver_data = (kernel_ulong_t)&rtw89_8852ae_info,
  64. },
  65. {},
  66. };
  67. MODULE_DEVICE_TABLE(pci, rtw89_8852ae_id_table);
  68. static struct pci_driver rtw89_8852ae_driver = {
  69. .name = "rtw89_8852ae",
  70. .id_table = rtw89_8852ae_id_table,
  71. .probe = rtw89_pci_probe,
  72. .remove = rtw89_pci_remove,
  73. .driver.pm = &rtw89_pm_ops,
  74. };
  75. module_pci_driver(rtw89_8852ae_driver);
  76. MODULE_AUTHOR("Realtek Corporation");
  77. MODULE_DESCRIPTION("Realtek 802.11ax wireless 8852AE driver");
  78. MODULE_LICENSE("Dual BSD/GPL");