osdep_intf.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. *****************************************************************************/
  15. #ifndef __OSDEP_INTF_H_
  16. #define __OSDEP_INTF_H_
  17. struct intf_priv {
  18. u8 *intf_dev;
  19. u32 max_iosz; /* USB2.0: 128, USB1.1: 64, SDIO:64 */
  20. u32 max_xmitsz; /* USB2.0: unlimited, SDIO:512 */
  21. u32 max_recvsz; /* USB2.0: unlimited, SDIO:512 */
  22. volatile u8 *io_rwmem;
  23. volatile u8 *allocated_io_rwmem;
  24. u32 io_wsz; /* unit: 4bytes */
  25. u32 io_rsz;/* unit: 4bytes */
  26. u8 intf_status;
  27. void (*_bus_io)(u8 *priv);
  28. /*
  29. Under Sync. IRP (SDIO/USB)
  30. A protection mechanism is necessary for the io_rwmem(read/write protocol)
  31. Under Async. IRP (SDIO/USB)
  32. The protection mechanism is through the pending queue.
  33. */
  34. _mutex ioctl_mutex;
  35. #ifdef PLATFORM_LINUX
  36. #ifdef CONFIG_USB_HCI
  37. /* when in USB, IO is through interrupt in/out endpoints */
  38. struct usb_device *udev;
  39. PURB piorw_urb;
  40. u8 io_irp_cnt;
  41. u8 bio_irp_pending;
  42. _sema io_retevt;
  43. _timer io_timer;
  44. u8 bio_irp_timeout;
  45. u8 bio_timer_cancel;
  46. #endif
  47. #endif
  48. #ifdef PLATFORM_OS_XP
  49. #ifdef CONFIG_SDIO_HCI
  50. /* below is for io_rwmem... */
  51. PMDL pmdl;
  52. PSDBUS_REQUEST_PACKET sdrp;
  53. PSDBUS_REQUEST_PACKET recv_sdrp;
  54. PSDBUS_REQUEST_PACKET xmit_sdrp;
  55. PIRP piorw_irp;
  56. #endif
  57. #ifdef CONFIG_USB_HCI
  58. PURB piorw_urb;
  59. PIRP piorw_irp;
  60. u8 io_irp_cnt;
  61. u8 bio_irp_pending;
  62. _sema io_retevt;
  63. #endif
  64. #endif
  65. };
  66. #ifdef CONFIG_R871X_TEST
  67. int rtw_start_pseudo_adhoc(_adapter *padapter);
  68. int rtw_stop_pseudo_adhoc(_adapter *padapter);
  69. #endif
  70. struct dvobj_priv *devobj_init(void);
  71. void devobj_deinit(struct dvobj_priv *pdvobj);
  72. u8 rtw_init_drv_sw(_adapter *padapter);
  73. u8 rtw_free_drv_sw(_adapter *padapter);
  74. u8 rtw_reset_drv_sw(_adapter *padapter);
  75. void rtw_dev_unload(PADAPTER padapter);
  76. u32 rtw_start_drv_threads(_adapter *padapter);
  77. void rtw_stop_drv_threads(_adapter *padapter);
  78. #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
  79. void rtw_cancel_dynamic_chk_timer(_adapter *padapter);
  80. #endif
  81. void rtw_cancel_all_timer(_adapter *padapter);
  82. uint loadparam(_adapter *adapter);
  83. #ifdef PLATFORM_LINUX
  84. int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  85. int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
  86. struct net_device *rtw_init_netdev(_adapter *padapter);
  87. void rtw_os_ndev_free(_adapter *adapter);
  88. int rtw_os_ndev_init(_adapter *adapter, const char *name);
  89. void rtw_os_ndev_deinit(_adapter *adapter);
  90. void rtw_os_ndev_unregister(_adapter *adapter);
  91. void rtw_os_ndevs_unregister(struct dvobj_priv *dvobj);
  92. int rtw_os_ndevs_init(struct dvobj_priv *dvobj);
  93. void rtw_os_ndevs_deinit(struct dvobj_priv *dvobj);
  94. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
  95. u16 rtw_recv_select_queue(struct sk_buff *skb);
  96. #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) */
  97. int rtw_ndev_notifier_register(void);
  98. void rtw_ndev_notifier_unregister(void);
  99. void rtw_inetaddr_notifier_register(void);
  100. void rtw_inetaddr_notifier_unregister(void);
  101. #include "../os_dep/linux/rtw_proc.h"
  102. #ifdef CONFIG_IOCTL_CFG80211
  103. #include "../os_dep/linux/ioctl_cfg80211.h"
  104. #endif /* CONFIG_IOCTL_CFG80211 */
  105. u8 rtw_rtnl_lock_needed(struct dvobj_priv *dvobj);
  106. void rtw_set_rtnl_lock_holder(struct dvobj_priv *dvobj, _thread_hdl_ thd_hdl);
  107. #endif /* PLATFORM_LINUX */
  108. #ifdef PLATFORM_FREEBSD
  109. extern int rtw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
  110. #endif
  111. void rtw_ips_dev_unload(_adapter *padapter);
  112. #ifdef CONFIG_IPS
  113. int rtw_ips_pwr_up(_adapter *padapter);
  114. void rtw_ips_pwr_down(_adapter *padapter);
  115. #endif
  116. #ifdef CONFIG_CONCURRENT_MODE
  117. struct _io_ops;
  118. struct dvobj_priv;
  119. _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter, void (*set_intf_ops)(_adapter *primary_padapter, struct _io_ops *pops));
  120. void rtw_drv_stop_vir_ifaces(struct dvobj_priv *dvobj);
  121. void rtw_drv_free_vir_ifaces(struct dvobj_priv *dvobj);
  122. #endif
  123. void rtw_ndev_destructor(_nic_hdl ndev);
  124. #ifdef CONFIG_ARP_KEEP_ALIVE
  125. int rtw_gw_addr_query(_adapter *padapter);
  126. #endif
  127. int rtw_suspend_common(_adapter *padapter);
  128. int rtw_resume_common(_adapter *padapter);
  129. #endif /* _OSDEP_INTF_H_ */