t7xx_netdev.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. *
  3. * Copyright (c) 2021, MediaTek Inc.
  4. * Copyright (c) 2021-2022, Intel Corporation.
  5. *
  6. * Authors:
  7. * Haijun Liu <haijun.liu@mediatek.com>
  8. * Moises Veleta <moises.veleta@intel.com>
  9. *
  10. * Contributors:
  11. * Amir Hanania <amir.hanania@intel.com>
  12. * Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
  13. * Ricardo Martinez <ricardo.martinez@linux.intel.com>
  14. */
  15. #ifndef __T7XX_NETDEV_H__
  16. #define __T7XX_NETDEV_H__
  17. #include <linux/bits.h>
  18. #include <linux/netdevice.h>
  19. #include <linux/types.h>
  20. #include "t7xx_hif_dpmaif.h"
  21. #include "t7xx_pci.h"
  22. #include "t7xx_state_monitor.h"
  23. #define RXQ_NUM DPMAIF_RXQ_NUM
  24. #define NIC_DEV_MAX 21
  25. #define NIC_DEV_DEFAULT 2
  26. #define CCMNI_NETDEV_WDT_TO (1 * HZ)
  27. #define CCMNI_MTU_MAX 3000
  28. #define NIC_NAPI_POLL_BUDGET 128
  29. struct t7xx_ccmni {
  30. u8 index;
  31. atomic_t usage;
  32. struct net_device *dev;
  33. struct t7xx_ccmni_ctrl *ctlb;
  34. };
  35. struct t7xx_ccmni_ctrl {
  36. struct t7xx_pci_dev *t7xx_dev;
  37. struct dpmaif_ctrl *hif_ctrl;
  38. struct t7xx_ccmni *ccmni_inst[NIC_DEV_MAX];
  39. struct dpmaif_callbacks callbacks;
  40. unsigned int nic_dev_num;
  41. unsigned int md_sta;
  42. struct t7xx_fsm_notifier md_status_notify;
  43. bool wwan_is_registered;
  44. struct net_device *dummy_dev;
  45. struct napi_struct *napi[RXQ_NUM];
  46. atomic_t napi_usr_refcnt;
  47. bool is_napi_en;
  48. };
  49. int t7xx_ccmni_init(struct t7xx_pci_dev *t7xx_dev);
  50. void t7xx_ccmni_exit(struct t7xx_pci_dev *t7xx_dev);
  51. #endif /* __T7XX_NETDEV_H__ */