osdep_intf.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. u8 rtw_init_drv_sw(_adapter *padapter);
  76. u8 rtw_free_drv_sw(_adapter *padapter);
  77. u8 rtw_reset_drv_sw(_adapter *padapter);
  78. u32 rtw_start_drv_threads(_adapter *padapter);
  79. void rtw_stop_drv_threads (_adapter *padapter);
  80. #ifdef CONFIG_WOWLAN
  81. void rtw_cancel_dynamic_chk_timer(_adapter *padapter);
  82. #endif
  83. void rtw_cancel_all_timer(_adapter *padapter);
  84. #ifdef PLATFORM_LINUX
  85. int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  86. int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
  87. struct net_device *rtw_init_netdev(_adapter *padapter);
  88. #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
  89. u16 rtw_recv_select_queue(struct sk_buff *skb);
  90. #endif //LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)
  91. #ifdef CONFIG_PROC_DEBUG
  92. void rtw_proc_init_one(struct net_device *dev);
  93. void rtw_proc_remove_one(struct net_device *dev);
  94. #else //!CONFIG_PROC_DEBUG
  95. static void rtw_proc_init_one(struct net_device *dev){}
  96. static void rtw_proc_remove_one(struct net_device *dev){}
  97. #endif //!CONFIG_PROC_DEBUG
  98. #endif //PLATFORM_LINUX
  99. #ifdef PLATFORM_FREEBSD
  100. extern int rtw_ioctl(struct ifnet * ifp, u_long cmd, caddr_t data);
  101. #endif
  102. void rtw_ips_dev_unload(_adapter *padapter);
  103. #ifdef CONFIG_IPS
  104. int rtw_ips_pwr_up(_adapter *padapter);
  105. void rtw_ips_pwr_down(_adapter *padapter);
  106. #endif
  107. #ifdef CONFIG_CONCURRENT_MODE
  108. struct _io_ops;
  109. _adapter *rtw_drv_if2_init(_adapter *primary_padapter, void (*set_intf_ops)(_adapter *primary_padapter,struct _io_ops *pops));
  110. void rtw_drv_if2_free(_adapter *if2);
  111. void rtw_drv_if2_stop(_adapter *if2);
  112. #ifdef CONFIG_MULTI_VIR_IFACES
  113. struct dvobj_priv;
  114. _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter, void (*set_intf_ops)(_adapter *primary_padapter,struct _io_ops *pops));
  115. void rtw_drv_stop_vir_ifaces(struct dvobj_priv *dvobj);
  116. void rtw_drv_free_vir_ifaces(struct dvobj_priv *dvobj);
  117. #endif //CONFIG_MULTI_VIR_IFACES
  118. #endif
  119. int rtw_drv_register_netdev(_adapter *padapter);
  120. void rtw_ndev_destructor(_nic_hdl ndev);
  121. #endif //_OSDEP_INTF_H_