gdm_lte.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _GDM_LTE_H_
  14. #define _GDM_LTE_H_
  15. #include <linux/netdevice.h>
  16. #include <linux/types.h>
  17. #include "gdm_endian.h"
  18. #define MAX_NIC_TYPE 4
  19. #define MAX_RX_SUBMIT_COUNT 3
  20. #define DRIVER_VERSION "3.7.17.0"
  21. enum TX_ERROR_CODE {
  22. TX_NO_ERROR = 0,
  23. TX_NO_DEV,
  24. TX_NO_SPC,
  25. TX_NO_BUFFER,
  26. };
  27. enum CALLBACK_CONTEXT {
  28. KERNEL_THREAD = 0,
  29. USB_COMPLETE,
  30. };
  31. struct pdn_table {
  32. u8 activate;
  33. u32 dft_eps_id;
  34. u32 nic_type;
  35. } __packed;
  36. struct nic;
  37. struct phy_dev {
  38. void *priv_dev;
  39. struct net_device *dev[MAX_NIC_TYPE];
  40. int (*send_hci_func)(void *priv_dev, void *data, int len,
  41. void (*cb)(void *cb_data), void *cb_data);
  42. int (*send_sdu_func)(void *priv_dev, void *data, int len,
  43. unsigned int dftEpsId, unsigned int epsId,
  44. void (*cb)(void *cb_data), void *cb_data,
  45. int dev_idx, int nic_type);
  46. int (*rcv_func)(void *priv_dev,
  47. int (*cb)(void *cb_data, void *data, int len,
  48. int context),
  49. void *cb_data, int context);
  50. struct gdm_endian * (*get_endian)(void *priv_dev);
  51. };
  52. struct nic {
  53. struct net_device *netdev;
  54. struct phy_dev *phy_dev;
  55. struct net_device_stats stats;
  56. struct pdn_table pdn_table;
  57. u8 dest_mac_addr[ETH_ALEN];
  58. u8 src_mac_addr[ETH_ALEN];
  59. u32 nic_id;
  60. u16 vlan_id;
  61. };
  62. int gdm_lte_event_init(void);
  63. void gdm_lte_event_exit(void);
  64. void start_rx_proc(struct phy_dev *phy_dev);
  65. int register_lte_device(struct phy_dev *phy_dev, struct device *dev,
  66. u8 *mac_address);
  67. void unregister_lte_device(struct phy_dev *phy_dev);
  68. #endif /* _GDM_LTE_H_ */