t7xx_netdev.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <[email protected]>
  8. * Moises Veleta <[email protected]>
  9. *
  10. * Contributors:
  11. * Amir Hanania <[email protected]>
  12. * Chiranjeevi Rapolu <[email protected]>
  13. * Ricardo Martinez <[email protected]>
  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. struct t7xx_ccmni {
  29. u8 index;
  30. atomic_t usage;
  31. struct net_device *dev;
  32. struct t7xx_ccmni_ctrl *ctlb;
  33. };
  34. struct t7xx_ccmni_ctrl {
  35. struct t7xx_pci_dev *t7xx_dev;
  36. struct dpmaif_ctrl *hif_ctrl;
  37. struct t7xx_ccmni *ccmni_inst[NIC_DEV_MAX];
  38. struct dpmaif_callbacks callbacks;
  39. unsigned int nic_dev_num;
  40. unsigned int md_sta;
  41. struct t7xx_fsm_notifier md_status_notify;
  42. bool wwan_is_registered;
  43. };
  44. int t7xx_ccmni_init(struct t7xx_pci_dev *t7xx_dev);
  45. void t7xx_ccmni_exit(struct t7xx_pci_dev *t7xx_dev);
  46. #endif /* __T7XX_NETDEV_H__ */