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 __XMIT_OSDEP_H_ 16 #define __XMIT_OSDEP_H_ 17 18 19 struct pkt_file { 20 _pkt *pkt; 21 SIZE_T pkt_len; /* the remainder length of the open_file */ 22 _buffer *cur_buffer; 23 u8 *buf_start; 24 u8 *cur_addr; 25 SIZE_T buf_len; 26 }; 27 28 #ifdef PLATFORM_WINDOWS 29 30 #ifdef PLATFORM_OS_XP 31 #ifdef CONFIG_USB_HCI 32 #include <usb.h> 33 #include <usbdlib.h> 34 #include <usbioctl.h> 35 #endif 36 #endif 37 38 #ifdef CONFIG_GSPI_HCI 39 #define NR_XMITFRAME 64 40 #else 41 #define NR_XMITFRAME 128 42 #endif 43 44 #define ETH_ALEN 6 45 46 extern NDIS_STATUS rtw_xmit_entry( 47 _nic_hdl cnxt, 48 NDIS_PACKET *pkt, 49 u32 flags 50 ); 51 52 #endif /* PLATFORM_WINDOWS */ 53 54 #ifdef PLATFORM_FREEBSD 55 #define NR_XMITFRAME 256 56 extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 57 extern void rtw_xmit_entry_wrap(struct ifnet *pifp); 58 #endif /* PLATFORM_FREEBSD */ 59 60 #ifdef PLATFORM_LINUX 61 62 #define NR_XMITFRAME 256 63 64 struct xmit_priv; 65 struct pkt_attrib; 66 struct sta_xmit_priv; 67 struct xmit_frame; 68 struct xmit_buf; 69 70 extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 71 72 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)) 73 extern netdev_tx_t rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 74 #else 75 extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 76 #endif 77 78 #endif /* PLATFORM_LINUX */ 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_check_wakup_queue(_adapter *adapter, u16 os_qid); 96 bool rtw_os_check_stop_queue(_adapter *adapter, u16 os_qid); 97 void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed); 98 99 void dump_os_queue(void *sel, _adapter *padapter); 100 101 #endif /* __XMIT_OSDEP_H_ */ 102