dma.h 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: ISC */
  2. /*
  3. * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
  4. */
  5. #ifndef __MT76_DMA_H
  6. #define __MT76_DMA_H
  7. #define DMA_DUMMY_DATA ((void *)~0)
  8. #define MT_RING_SIZE 0x10
  9. #define MT_DMA_CTL_SD_LEN1 GENMASK(13, 0)
  10. #define MT_DMA_CTL_LAST_SEC1 BIT(14)
  11. #define MT_DMA_CTL_BURST BIT(15)
  12. #define MT_DMA_CTL_SD_LEN0 GENMASK(29, 16)
  13. #define MT_DMA_CTL_LAST_SEC0 BIT(30)
  14. #define MT_DMA_CTL_DMA_DONE BIT(31)
  15. #define MT_DMA_HDR_LEN 4
  16. #define MT_RX_INFO_LEN 4
  17. #define MT_FCE_INFO_LEN 4
  18. #define MT_RX_RXWI_LEN 32
  19. struct mt76_desc {
  20. __le32 buf0;
  21. __le32 ctrl;
  22. __le32 buf1;
  23. __le32 info;
  24. } __packed __aligned(4);
  25. enum mt76_qsel {
  26. MT_QSEL_MGMT,
  27. MT_QSEL_HCCA,
  28. MT_QSEL_EDCA,
  29. MT_QSEL_EDCA_2,
  30. };
  31. enum mt76_mcu_evt_type {
  32. EVT_CMD_DONE,
  33. EVT_CMD_ERROR,
  34. EVT_CMD_RETRY,
  35. EVT_EVENT_PWR_RSP,
  36. EVT_EVENT_WOW_RSP,
  37. EVT_EVENT_CARRIER_DETECT_RSP,
  38. EVT_EVENT_DFS_DETECT_RSP,
  39. };
  40. void mt76_dma_attach(struct mt76_dev *dev);
  41. void mt76_dma_cleanup(struct mt76_dev *dev);
  42. #endif