osdep_intf.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  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. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __OSDEP_INTF_H_
  21. #define __OSDEP_INTF_H_
  22. struct intf_priv {
  23. u8 *intf_dev;
  24. u32 max_iosz; /* USB2.0: 128, USB1.1: 64, SDIO:64 */
  25. u32 max_xmitsz; /* USB2.0: unlimited, SDIO:512 */
  26. u32 max_recvsz; /* USB2.0: unlimited, SDIO:512 */
  27. volatile u8 *io_rwmem;
  28. volatile u8 *allocated_io_rwmem;
  29. u32 io_wsz; /* unit: 4bytes */
  30. u32 io_rsz;/* unit: 4bytes */
  31. u8 intf_status;
  32. void (*_bus_io)(u8 *priv);
  33. /*
  34. Under Sync. IRP (SDIO/USB)
  35. A protection mechanism is necessary for the io_rwmem(read/write protocol)
  36. Under Async. IRP (SDIO/USB)
  37. The protection mechanism is through the pending queue.
  38. */
  39. _mutex ioctl_mutex;
  40. #ifdef PLATFORM_LINUX
  41. #ifdef CONFIG_USB_HCI
  42. /* when in USB, IO is through interrupt in/out endpoints */
  43. struct usb_device *udev;
  44. PURB piorw_urb;
  45. u8 io_irp_cnt;
  46. u8 bio_irp_pending;
  47. _sema io_retevt;
  48. _timer io_timer;
  49. u8 bio_irp_timeout;
  50. u8 bio_timer_cancel;
  51. #endif
  52. #endif
  53. #ifdef PLATFORM_OS_XP
  54. #ifdef CONFIG_SDIO_HCI
  55. /* below is for io_rwmem... */
  56. PMDL pmdl;
  57. PSDBUS_REQUEST_PACKET sdrp;
  58. PSDBUS_REQUEST_PACKET recv_sdrp;
  59. PSDBUS_REQUEST_PACKET xmit_sdrp;
  60. PIRP piorw_irp;
  61. #endif
  62. #ifdef CONFIG_USB_HCI
  63. PURB piorw_urb;
  64. PIRP piorw_irp;
  65. u8 io_irp_cnt;
  66. u8 bio_irp_pending;
  67. _sema io_retevt;
  68. #endif
  69. #endif
  70. };
  71. #ifdef CONFIG_R871X_TEST
  72. int rtw_start_pseudo_adhoc(_adapter *padapter);
  73. int rtw_stop_pseudo_adhoc(_adapter *padapter);
  74. #endif
  75. struct dvobj_priv *devobj_init(void);
  76. void devobj_deinit(struct dvobj_priv *pdvobj);
  77. u8 rtw_init_drv_sw(_adapter *padapter);
  78. u8 rtw_free_drv_sw(_adapter *padapter);
  79. u8 rtw_reset_drv_sw(_adapter *padapter);
  80. void rtw_dev_unload(PADAPTER padapter);
  81. u32 rtw_start_drv_threads(_adapter *padapter);
  82. void rtw_stop_drv_threads(_adapter *padapter);
  83. #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
  84. void rtw_cancel_dynamic_chk_timer(_adapter *padapter);
  85. #endif
  86. void rtw_cancel_all_timer(_adapter *padapter);
  87. uint loadparam(_adapter *adapter);
  88. #ifdef PLATFORM_LINUX
  89. int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  90. int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
  91. struct net_device *rtw_init_netdev(_adapter *padapter);
  92. void rtw_os_ndev_free(_adapter *adapter);
  93. int rtw_os_ndev_init(_adapter *adapter, const char *name);
  94. void rtw_os_ndev_deinit(_adapter *adapter);
  95. void rtw_os_ndev_unregister(_adapter *adapter);
  96. void rtw_os_ndevs_unregister(struct dvobj_priv *dvobj);
  97. int rtw_os_ndevs_init(struct dvobj_priv *dvobj);
  98. void rtw_os_ndevs_deinit(struct dvobj_priv *dvobj);
  99. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
  100. u16 rtw_recv_select_queue(struct sk_buff *skb);
  101. #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) */
  102. int rtw_ndev_notifier_register(void);
  103. void rtw_ndev_notifier_unregister(void);
  104. #include "../os_dep/linux/rtw_proc.h"
  105. #ifdef CONFIG_IOCTL_CFG80211
  106. #include "../os_dep/linux/ioctl_cfg80211.h"
  107. #endif /* CONFIG_IOCTL_CFG80211 */
  108. u8 rtw_rtnl_lock_needed(struct dvobj_priv *dvobj);
  109. void rtw_set_rtnl_lock_holder(struct dvobj_priv *dvobj, _thread_hdl_ thd_hdl);
  110. #endif /* PLATFORM_LINUX */
  111. #ifdef PLATFORM_FREEBSD
  112. extern int rtw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
  113. #endif
  114. void rtw_ips_dev_unload(_adapter *padapter);
  115. #ifdef CONFIG_IPS
  116. int rtw_ips_pwr_up(_adapter *padapter);
  117. void rtw_ips_pwr_down(_adapter *padapter);
  118. #endif
  119. #ifdef CONFIG_CONCURRENT_MODE
  120. struct _io_ops;
  121. struct dvobj_priv;
  122. _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter, void (*set_intf_ops)(_adapter *primary_padapter, struct _io_ops *pops));
  123. void rtw_drv_stop_vir_ifaces(struct dvobj_priv *dvobj);
  124. void rtw_drv_free_vir_ifaces(struct dvobj_priv *dvobj);
  125. #endif
  126. void rtw_ndev_destructor(_nic_hdl ndev);
  127. #ifdef CONFIG_ARP_KEEP_ALIVE
  128. int rtw_gw_addr_query(_adapter *padapter);
  129. #endif
  130. int rtw_suspend_common(_adapter *padapter);
  131. int rtw_resume_common(_adapter *padapter);
  132. #endif /* _OSDEP_INTF_H_ */