Add version v5.6.4

This commit is contained in:
Carlos Garces
2019-11-09 11:12:08 +01:00
parent e7361e951c
commit 1d807f14d8
597 changed files with 314256 additions and 256218 deletions

View File

@@ -1,22 +1,17 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2013 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#ifndef __OSDEP_BSD_SERVICE_H_
#define __OSDEP_BSD_SERVICE_H_
@@ -82,7 +77,7 @@
// typedef spinlock_t _lock;
typedef struct mtx _lock;
typedef struct mtx _mutex;
typedef struct timer_list _timer;
typedef struct rtw_timer_list _timer;
struct list_head {
struct list_head *next, *prev;
};
@@ -91,8 +86,7 @@
_lock lock;
};
//typedef struct sk_buff _pkt;
typedef struct mbuf _pkt;
typedef struct mbuf _pkt;
typedef struct mbuf _buffer;
typedef struct __queue _queue;
@@ -107,10 +101,6 @@
typedef void thread_return;
typedef void* thread_context;
//#define thread_exit() complete_and_exit(NULL, 0)
#define thread_exit() do{printf("%s", "RTKTHREAD_exit");}while(0)
typedef void timer_hdl_return;
typedef void* timer_hdl_context;
typedef struct work_struct _workitem;
@@ -138,17 +128,12 @@
* See (linux_compat) processes.c
*
*/
struct timer_list {
struct rtw_timer_list {
struct callout callout;
void (*function)(void *);
void *arg;
};
/* FreeBSD callout related fields */
struct callout callout;
//timeout function
void (*function)(void*);
//argument
void *arg;
};
struct workqueue_struct;
struct work_struct;
typedef void (*work_func_t)(struct work_struct *work);
@@ -674,30 +659,52 @@ __inline static void rtw_list_delete(_list *plist)
INIT_LIST_HEAD(plist);
}
__inline static void _init_timer(_timer *ptimer,_nic_hdl padapter,void *pfunc,void* cntx)
{
ptimer->function = pfunc;
ptimer->arg = cntx;
callout_init(&ptimer->callout, CALLOUT_MPSAFE);
}
static inline void timer_hdl(void *ctx)
{
_timer *timer = (_timer *)ctx;
rtw_mtx_lock(NULL);
if (callout_pending(&timer->callout)) {
/* callout was reset */
rtw_mtx_unlock(NULL);
return;
}
if (!callout_active(&timer->callout)) {
/* callout was stopped */
rtw_mtx_unlock(NULL);
return;
}
callout_deactivate(&timer->callout);
timer->function(timer->arg);
rtw_mtx_unlock(NULL);
}
static inline void _init_timer(_timer *ptimer, _nic_hdl padapter, void *pfunc, void *cntx)
{
ptimer->function = pfunc;
ptimer->arg = cntx;
callout_init(&ptimer->callout, CALLOUT_MPSAFE);
}
__inline static void _set_timer(_timer *ptimer,u32 delay_time)
{
// mod_timer(ptimer , (jiffies+(delay_time*HZ/1000)));
if(ptimer->function && ptimer->arg){
if (ptimer->function && ptimer->arg) {
rtw_mtx_lock(NULL);
callout_reset(&ptimer->callout, delay_time,ptimer->function, ptimer->arg);
callout_reset(&ptimer->callout, delay_time, timer_hdl, ptimer);
rtw_mtx_unlock(NULL);
}
}
__inline static void _cancel_timer(_timer *ptimer,u8 *bcancelled)
{
// del_timer_sync(ptimer);
// *bcancelled= _TRUE;//TRUE ==1; FALSE==0
rtw_mtx_lock(NULL);
callout_drain(&ptimer->callout);
rtw_mtx_unlock(NULL);
*bcancelled = 1; /* assume an pending timer to be canceled */
}
__inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx)