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 __XMIT_OSDEP_H_ 21 #define __XMIT_OSDEP_H_ 22 23 24 struct pkt_file { 25 _pkt *pkt; 26 SIZE_T pkt_len; /* the remainder length of the open_file */ 27 _buffer *cur_buffer; 28 u8 *buf_start; 29 u8 *cur_addr; 30 SIZE_T buf_len; 31 }; 32 33 #ifdef PLATFORM_WINDOWS 34 35 #ifdef PLATFORM_OS_XP 36 #ifdef CONFIG_USB_HCI 37 #include <usb.h> 38 #include <usbdlib.h> 39 #include <usbioctl.h> 40 #endif 41 #endif 42 43 #ifdef CONFIG_GSPI_HCI 44 #define NR_XMITFRAME 64 45 #else 46 #define NR_XMITFRAME 128 47 #endif 48 49 #define ETH_ALEN 6 50 51 extern NDIS_STATUS rtw_xmit_entry( 52 IN _nic_hdl cnxt, 53 IN NDIS_PACKET *pkt, 54 IN UINT flags 55 ); 56 57 #endif 58 59 #ifdef PLATFORM_FREEBSD 60 #define NR_XMITFRAME 256 61 extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 62 extern void rtw_xmit_entry_wrap(struct ifnet *pifp); 63 #endif /* PLATFORM_FREEBSD */ 64 65 #ifdef PLATFORM_LINUX 66 67 #define NR_XMITFRAME 256 68 69 struct xmit_priv; 70 struct pkt_attrib; 71 struct sta_xmit_priv; 72 struct xmit_frame; 73 struct xmit_buf; 74 75 extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 76 extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 77 78 #endif 79 80 void rtw_os_xmit_schedule(_adapter *padapter); 81 82 int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag); 83 void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag); 84 85 extern void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib); 86 87 extern uint rtw_remainder_len(struct pkt_file *pfile); 88 extern void _rtw_open_pktfile(_pkt *pkt, struct pkt_file *pfile); 89 extern uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen); 90 extern sint rtw_endofpktfile(struct pkt_file *pfile); 91 92 extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt); 93 extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe); 94 95 void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed); 96 97 void dump_os_queue(void *sel, _adapter *padapter); 98 99 #endif /* __XMIT_OSDEP_H_ */ 100