1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2017 Realtek Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 *****************************************************************************/ 16 #ifndef __XMIT_OSDEP_H_ 17 #define __XMIT_OSDEP_H_ 18 19 20 struct pkt_file { 21 _pkt *pkt; 22 SIZE_T pkt_len; /* the remainder length of the open_file */ 23 _buffer *cur_buffer; 24 u8 *buf_start; 25 u8 *cur_addr; 26 SIZE_T buf_len; 27 }; 28 29 #ifdef PLATFORM_WINDOWS 30 31 #ifdef PLATFORM_OS_XP 32 #ifdef CONFIG_USB_HCI 33 #include <usb.h> 34 #include <usbdlib.h> 35 #include <usbioctl.h> 36 #endif 37 #endif 38 39 #ifdef CONFIG_GSPI_HCI 40 #define NR_XMITFRAME 64 41 #else 42 #define NR_XMITFRAME 128 43 #endif 44 45 #define ETH_ALEN 6 46 47 extern NDIS_STATUS rtw_xmit_entry( 48 _nic_hdl cnxt, 49 NDIS_PACKET *pkt, 50 u32 flags 51 ); 52 53 #endif /* PLATFORM_WINDOWS */ 54 55 #ifdef PLATFORM_FREEBSD 56 #define NR_XMITFRAME 256 57 extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 58 extern void rtw_xmit_entry_wrap(struct ifnet *pifp); 59 #endif /* PLATFORM_FREEBSD */ 60 61 #ifdef PLATFORM_LINUX 62 63 #define NR_XMITFRAME 256 64 65 struct xmit_priv; 66 struct pkt_attrib; 67 struct sta_xmit_priv; 68 struct xmit_frame; 69 struct xmit_buf; 70 71 extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 72 extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 73 74 #endif /* PLATFORM_LINUX */ 75 76 void rtw_os_xmit_schedule(_adapter *padapter); 77 78 int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag); 79 void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag); 80 81 extern void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib); 82 83 extern uint rtw_remainder_len(struct pkt_file *pfile); 84 extern void _rtw_open_pktfile(_pkt *pkt, struct pkt_file *pfile); 85 extern uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen); 86 extern sint rtw_endofpktfile(struct pkt_file *pfile); 87 88 extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt); 89 extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe); 90 91 void rtw_os_check_wakup_queue(_adapter *adapter, u16 os_qid); 92 bool rtw_os_check_stop_queue(_adapter *adapter, u16 os_qid); 93 void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed); 94 95 void dump_os_queue(void *sel, _adapter *padapter); 96 97 #endif /* __XMIT_OSDEP_H_ */ 98