rtl8188eu: Remove dead code for FREEBSD

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-15 16:58:13 -06:00
parent a68c6cc26e
commit dd606233f2
22 changed files with 6 additions and 2326 deletions

View file

@ -68,50 +68,6 @@
#endif
#ifdef PLATFORM_FREEBSD
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
typedef unsigned int uint;
typedef signed int sint;
typedef long atomic_t;
typedef signed long long s64;
typedef unsigned long long u64;
#define IN
#define OUT
#define VOID void
#define NDIS_OID uint
#define NDIS_STATUS uint
#ifndef PVOID
typedef void * PVOID;
//#define PVOID (void *)
#endif
typedef u32 dma_addr_t;
#define UCHAR u8
#define USHORT u16
#define UINT u32
#define ULONG u32
typedef void (*proc_t)(void*);
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef __kernel_size_t SIZE_T;
typedef __kernel_ssize_t SSIZE_T;
#define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
#endif
#define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T))
#define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1)

View file

@ -165,15 +165,11 @@
extern __u32 ntohl(__u32);
extern __u32 htonl(__u32);
#else //defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
#ifndef PLATFORM_FREEBSD
extern unsigned long int ntohl(unsigned long int);
extern unsigned long int htonl(unsigned long int);
#endif
#endif
#ifndef PLATFORM_FREEBSD
extern unsigned short int ntohs(unsigned short int);
extern unsigned short int htons(unsigned short int);
#endif
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL)

View file

@ -108,19 +108,12 @@ __inline static __u64 __arch__swab64(__u64 x)
#define __swab64(x) __fswab64(x)
#endif // __swab16
#ifdef PLATFORM_FREEBSD
__inline static __u16 __fswab16(__u16 x)
#else
__inline static const __u16 __fswab16(__u16 x)
#endif //PLATFORM_FREEBSD
{
return __arch__swab16(x);
}
#ifdef PLATFORM_FREEBSD
__inline static __u32 __fswab32(__u32 x)
#else
__inline static const __u32 __fswab32(__u32 x)
#endif //PLATFORM_FREEBSD
{
return __arch__swab32(x);
}

View file

@ -328,11 +328,7 @@ struct dvobj_priv
struct usb_device *pusbdev;
#endif//PLATFORM_LINUX
#ifdef PLATFORM_FREEBSD
struct usb_interface *pusbintf;
struct usb_device *pusbdev;
#endif//PLATFORM_FREEBSD
#endif//CONFIG_USB_HCI
/*-------- below is for PCIE INTERFACE --------*/
@ -560,11 +556,6 @@ struct _ADAPTER{
#endif //end of PLATFORM_LINUX
#ifdef PLATFORM_FREEBSD
_nic_hdl pifp;
int bup;
_lock glock;
#endif //PLATFORM_FREEBSD
int net_closed;
u8 bFWReady;

View file

@ -315,8 +315,6 @@ struct ieee_ibss_seq {
_list list;
};
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)||defined(PLATFORM_FREEBSD)
struct rtw_ieee80211_hdr {
u16 frame_ctl;
u16 duration_id;
@ -366,8 +364,6 @@ struct eapol {
u16 length;
} __attribute__ ((packed));
#endif
enum eap_type {
EAP_PACKET = 0,
EAPOL_START,
@ -476,8 +472,6 @@ enum eap_type {
#define P80211_OUI_LEN 3
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) || defined(PLATFORM_FREEBSD)
struct ieee80211_snap_hdr {
u8 dsap; /* always 0xAA */
@ -487,8 +481,6 @@ struct ieee80211_snap_hdr {
} __attribute__ ((packed));
#endif
#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
#define WLAN_FC_GET_TYPE(fc) ((fc) & RTW_IEEE80211_FCTL_FTYPE)
@ -693,7 +685,6 @@ struct ieee80211_frag_entry {
u8 dst_addr[ETH_ALEN];
};
#ifndef PLATFORM_FREEBSD //Baron BSD has already defined
struct ieee80211_stats {
uint tx_unicast_frames;
uint tx_multicast_frames;
@ -717,7 +708,7 @@ struct ieee80211_stats {
uint rx_message_in_msg_fragments;
uint rx_message_in_bad_msg_fragments;
};
#endif //PLATFORM_FREEBSD
struct ieee80211_softmac_stats{
uint rx_ass_ok;
uint rx_ass_err;
@ -989,8 +980,6 @@ join_res:
> 0: TID
*/
#ifndef PLATFORM_FREEBSD //Baron BSD has already defined
enum ieee80211_state {
/* the card is not linked at all */
@ -1029,7 +1018,6 @@ enum ieee80211_state {
IEEE80211_LINKED_SCANNING,
};
#endif //PLATFORM_FREEBSD
#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
#define DEFAULT_FTS 2346
@ -1038,12 +1026,6 @@ enum ieee80211_state {
#define IP_FMT "%d.%d.%d.%d"
#define IP_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3]
#ifdef PLATFORM_FREEBSD //Baron change func to macro
#define is_multicast_mac_addr(Addr) ((((Addr[0]) & 0x01) == 0x01) && ((Addr[0]) != 0xff))
#define is_broadcast_mac_addr(Addr) ((((Addr[0]) & 0xff) == 0xff) && (((Addr[1]) & 0xff) == 0xff) && \
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
extern __inline int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
@ -1060,7 +1042,6 @@ extern __inline int is_zero_mac_addr(const u8 *addr)
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
}
#endif //PLATFORM_FREEBSD
#define CFG_IEEE80211_RESERVE_FCS (1<<0)
#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
@ -1194,9 +1175,7 @@ enum rtw_ieee80211_back_parties {
#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
* 00:50:F2 */
#ifndef PLATFORM_FREEBSD //Baron BSD has defined
#define WME_OUI_TYPE 2
#endif //PLATFORM_FREEBSD
#define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0
#define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1
#define WME_OUI_SUBTYPE_TSPEC_ELEMENT 2

View file

@ -123,11 +123,6 @@ static void rtw_proc_remove_one(struct net_device *dev){}
#endif //!CONFIG_PROC_DEBUG
#endif //PLATFORM_LINUX
#ifdef PLATFORM_FREEBSD
extern int rtw_ioctl(struct ifnet * ifp, u_long cmd, caddr_t data);
#endif
void rtw_ips_dev_unload(_adapter *padapter);
#ifdef CONFIG_RF_GAIN_OFFSET

View file

@ -36,713 +36,6 @@
#define _FALSE 0
#ifdef PLATFORM_FREEBSD
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/param.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/endian.h>
#include <sys/kdb.h>
#include <sys/kthread.h>
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/rman.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/ethernet.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/route.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/if_ether.h>
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_regdomain.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_ratectl.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include "usbdevs.h"
#define USB_DEBUG_VAR rum_debug
#include <dev/usb/usb_debug.h>
#if 1 //Baron porting from linux, it's all temp solution, needs to check again
#include <sys/sema.h>
#include <sys/pcpu.h> /* XXX for PCPU_GET */
// typedef struct semaphore _sema;
typedef struct sema _sema;
// typedef spinlock_t _lock;
typedef struct mtx _lock;
typedef struct mtx _mutex;
typedef struct timer_list _timer;
struct list_head {
struct list_head *next, *prev;
};
struct __queue {
struct list_head queue;
_lock lock;
};
//typedef struct sk_buff _pkt;
typedef struct mbuf _pkt;
typedef struct mbuf _buffer;
typedef struct __queue _queue;
typedef struct list_head _list;
typedef int _OS_STATUS;
//typedef u32 _irqL;
typedef unsigned long _irqL;
typedef struct ifnet * _nic_hdl;
typedef pid_t _thread_hdl_;
// typedef struct thread _thread_hdl_;
typedef void thread_return;
typedef void* thread_context;
//#define thread_exit() complete_and_exit(NULL, 0)
typedef void timer_hdl_return;
typedef void* timer_hdl_context;
typedef struct work_struct _workitem;
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
/* emulate a modern version */
#define LINUX_VERSION_CODE KERNEL_VERSION(2, 6, 35)
#define WIRELESS_EXT -1
#define HZ hz
#define spin_lock_irqsave mtx_lock_irqsave
#define spin_lock_bh mtx_lock_irqsave
#define mtx_lock_irqsave(lock, x) mtx_lock(lock)//{local_irq_save((x)); mtx_lock_spin((lock));}
//#define IFT_RTW 0xf9 //ifnet allocate type for RTW
#define free_netdev if_free
#define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member)))
#define container_of(p,t,n) (t*)((p)-&(((t*)0)->n))
/*
* Linux timers are emulated using FreeBSD callout functions
* (and taskqueue functionality).
*
* Currently no timer stats functionality.
*
* See (linux_compat) processes.c
*
*/
struct timer_list {
/* 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);
/* Values for the state of an item of work (work_struct) */
typedef enum work_state {
WORK_STATE_UNSET = 0,
WORK_STATE_CALLOUT_PENDING = 1,
WORK_STATE_TASK_PENDING = 2,
WORK_STATE_WORK_CANCELLED = 3
} work_state_t;
struct work_struct {
struct task task; /* FreeBSD task */
work_state_t state; /* the pending or otherwise state of work. */
work_func_t func;
};
#define spin_unlock_irqrestore mtx_unlock_irqrestore
#define spin_unlock_bh mtx_unlock_irqrestore
#define mtx_unlock_irqrestore(lock,x) mtx_unlock(lock);
extern void _rtw_spinlock_init(_lock *plock);
//modify private structure to match freebsd
#define BITS_PER_LONG 32
union ktime {
s64 tv64;
#if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR)
struct {
#ifdef __BIG_ENDIAN
s32 sec, nsec;
#else
s32 nsec, sec;
#endif
} tv;
#endif
};
#define kmemcheck_bitfield_begin(name)
#define kmemcheck_bitfield_end(name)
#define CHECKSUM_NONE 0
typedef unsigned char *sk_buff_data_t;
typedef union ktime ktime_t; /* Kill this */
void rtw_mtx_lock(_lock *plock);
void rtw_mtx_unlock(_lock *plock);
/**
* struct sk_buff - socket buffer
* @next: Next buffer in list
* @prev: Previous buffer in list
* @sk: Socket we are owned by
* @tstamp: Time we arrived
* @dev: Device we arrived on/are leaving by
* @transport_header: Transport layer header
* @network_header: Network layer header
* @mac_header: Link layer header
* @_skb_refdst: destination entry (with norefcount bit)
* @sp: the security path, used for xfrm
* @cb: Control buffer. Free for use by every layer. Put private vars here
* @len: Length of actual data
* @data_len: Data length
* @mac_len: Length of link layer header
* @hdr_len: writable header length of cloned skb
* @csum: Checksum (must include start/offset pair)
* @csum_start: Offset from skb->head where checksumming should start
* @csum_offset: Offset from csum_start where checksum should be stored
* @local_df: allow local fragmentation
* @cloned: Head may be cloned (check refcnt to be sure)
* @nohdr: Payload reference only, must not modify header
* @pkt_type: Packet class
* @fclone: skbuff clone status
* @ip_summed: Driver fed us an IP checksum
* @priority: Packet queueing priority
* @users: User count - see {datagram,tcp}.c
* @protocol: Packet protocol from driver
* @truesize: Buffer size
* @head: Head of buffer
* @data: Data head pointer
* @tail: Tail pointer
* @end: End pointer
* @destructor: Destruct function
* @mark: Generic packet mark
* @nfct: Associated connection, if any
* @ipvs_property: skbuff is owned by ipvs
* @peeked: this packet has been seen already, so stats have been
* done for it, don't do them again
* @nf_trace: netfilter packet trace flag
* @nfctinfo: Relationship of this skb to the connection
* @nfct_reasm: netfilter conntrack re-assembly pointer
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
* @skb_iif: ifindex of device we arrived on
* @rxhash: the packet hash computed on receive
* @queue_mapping: Queue mapping for multiqueue devices
* @tc_index: Traffic control index
* @tc_verd: traffic control verdict
* @ndisc_nodetype: router type (from link layer)
* @dma_cookie: a cookie to one of several possible DMA operations
* done by skb DMA functions
* @secmark: security marking
* @vlan_tci: vlan tag control information
*/
struct sk_buff {
/* These two members must be first. */
struct sk_buff *next;
struct sk_buff *prev;
ktime_t tstamp;
struct sock *sk;
//struct net_device *dev;
struct ifnet *dev;
/*
* This is the control buffer. It is free to use for every
* layer. Please put your private variables there. If you
* want to keep them across layers you have to do a skb_clone()
* first. This is owned by whoever has the skb queued ATM.
*/
char cb[48] __aligned(8);
unsigned long _skb_refdst;
#ifdef CONFIG_XFRM
struct sec_path *sp;
#endif
unsigned int len,
data_len;
u16 mac_len,
hdr_len;
union {
u32 csum;
struct {
u16 csum_start;
u16 csum_offset;
}smbol2;
}smbol1;
u32 priority;
kmemcheck_bitfield_begin(flags1);
u8 local_df:1,
cloned:1,
ip_summed:2,
nohdr:1,
nfctinfo:3;
u8 pkt_type:3,
fclone:2,
ipvs_property:1,
peeked:1,
nf_trace:1;
kmemcheck_bitfield_end(flags1);
u16 protocol;
void (*destructor)(struct sk_buff *skb);
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
struct nf_conntrack *nfct;
struct sk_buff *nfct_reasm;
#endif
#ifdef CONFIG_BRIDGE_NETFILTER
struct nf_bridge_info *nf_bridge;
#endif
int skb_iif;
#ifdef CONFIG_NET_SCHED
u16 tc_index; /* traffic control index */
#ifdef CONFIG_NET_CLS_ACT
u16 tc_verd; /* traffic control verdict */
#endif
#endif
u32 rxhash;
kmemcheck_bitfield_begin(flags2);
u16 queue_mapping:16;
#ifdef CONFIG_IPV6_NDISC_NODETYPE
u8 ndisc_nodetype:2,
deliver_no_wcard:1;
#else
u8 deliver_no_wcard:1;
#endif
kmemcheck_bitfield_end(flags2);
/* 0/14 bit hole */
#ifdef CONFIG_NET_DMA
dma_cookie_t dma_cookie;
#endif
#ifdef CONFIG_NETWORK_SECMARK
u32 secmark;
#endif
union {
u32 mark;
u32 dropcount;
}symbol3;
u16 vlan_tci;
sk_buff_data_t transport_header;
sk_buff_data_t network_header;
sk_buff_data_t mac_header;
/* These elements must be at the end, see alloc_skb() for details. */
sk_buff_data_t tail;
sk_buff_data_t end;
unsigned char *head,
*data;
unsigned int truesize;
atomic_t users;
};
struct sk_buff_head {
/* These two members must be first. */
struct sk_buff *next;
struct sk_buff *prev;
u32 qlen;
_lock lock;
};
#define skb_tail_pointer(skb) skb->tail
static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
unsigned char *tmp = skb_tail_pointer(skb);
//SKB_LINEAR_ASSERT(skb);
skb->tail += len;
skb->len += len;
return tmp;
}
static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
{
skb->len -= len;
if(skb->len < skb->data_len)
printf("%s(),%d,error!\n",__FUNCTION__,__LINE__);
return skb->data += len;
}
static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)
{
#ifdef PLATFORM_FREEBSD
return __skb_pull(skb, len);
#else
return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len);
#endif //PLATFORM_FREEBSD
}
static inline u32 skb_queue_len(const struct sk_buff_head *list_)
{
return list_->qlen;
}
static inline void __skb_insert(struct sk_buff *newsk,
struct sk_buff *prev, struct sk_buff *next,
struct sk_buff_head *list)
{
newsk->next = next;
newsk->prev = prev;
next->prev = prev->next = newsk;
list->qlen++;
}
static inline void __skb_queue_before(struct sk_buff_head *list,
struct sk_buff *next,
struct sk_buff *newsk)
{
__skb_insert(newsk, next->prev, next, list);
}
static inline void skb_queue_tail(struct sk_buff_head *list,
struct sk_buff *newsk)
{
mtx_lock(&list->lock);
__skb_queue_before(list, (struct sk_buff *)list, newsk);
mtx_unlock(&list->lock);
}
static inline struct sk_buff *skb_peek(struct sk_buff_head *list_)
{
struct sk_buff *list = ((struct sk_buff *)list_)->next;
if (list == (struct sk_buff *)list_)
list = NULL;
return list;
}
static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list)
{
struct sk_buff *next, *prev;
list->qlen--;
next = skb->next;
prev = skb->prev;
skb->next = skb->prev = NULL;
next->prev = prev;
prev->next = next;
}
static inline struct sk_buff *skb_dequeue(struct sk_buff_head *list)
{
mtx_lock(&list->lock);
struct sk_buff *skb = skb_peek(list);
if (skb)
__skb_unlink(skb, list);
mtx_unlock(&list->lock);
return skb;
}
static inline void skb_reserve(struct sk_buff *skb, int len)
{
skb->data += len;
skb->tail += len;
}
static inline void __skb_queue_head_init(struct sk_buff_head *list)
{
list->prev = list->next = (struct sk_buff *)list;
list->qlen = 0;
}
/*
* This function creates a split out lock class for each invocation;
* this is needed for now since a whole lot of users of the skb-queue
* infrastructure in drivers have different locking usage (in hardirq)
* than the networking core (in softirq only). In the long run either the
* network layer or drivers should need annotation to consolidate the
* main types of usage into 3 classes.
*/
static inline void skb_queue_head_init(struct sk_buff_head *list)
{
_rtw_spinlock_init(&list->lock);
__skb_queue_head_init(list);
}
unsigned long copy_from_user(void *to, const void *from, unsigned long n);
unsigned long copy_to_user(void *to, const void *from, unsigned long n);
struct sk_buff * dev_alloc_skb(unsigned int size);
struct sk_buff *skb_clone(const struct sk_buff *skb);
void dev_kfree_skb_any(struct sk_buff *skb);
#endif //Baron porting from linux, it's all temp solution, needs to check again
#if 1 // kenny add Linux compatibility code for Linux USB driver
#include <dev/usb/usb_compat_linux.h>
#define __init // __attribute ((constructor))
#define __exit // __attribute ((destructor))
/*
* Definitions for module_init and module_exit macros.
*
* These macros will use the SYSINIT framework to call a specified
* function (with no arguments) on module loading or unloading.
*
*/
void module_init_exit_wrapper(void *arg);
#define module_init(initfn) \
SYSINIT(mod_init_ ## initfn, \
SI_SUB_KLD, SI_ORDER_FIRST, \
module_init_exit_wrapper, initfn)
#define module_exit(exitfn) \
SYSUNINIT(mod_exit_ ## exitfn, \
SI_SUB_KLD, SI_ORDER_ANY, \
module_init_exit_wrapper, exitfn)
/*
* The usb_register and usb_deregister functions are used to register
* usb drivers with the usb subsystem.
*/
int usb_register(struct usb_driver *driver);
int usb_deregister(struct usb_driver *driver);
/*
* usb_get_dev and usb_put_dev - increment/decrement the reference count
* of the usb device structure.
*
* Original body of usb_get_dev:
*
* if (dev)
* get_device(&dev->dev);
* return dev;
*
* Reference counts are not currently used in this compatibility
* layer. So these functions will do nothing.
*/
static inline struct usb_device *
usb_get_dev(struct usb_device *dev)
{
return dev;
}
static inline void
usb_put_dev(struct usb_device *dev)
{
return;
}
// rtw_usb_compat_linux
int rtw_usb_submit_urb(struct urb *urb, uint16_t mem_flags);
int rtw_usb_unlink_urb(struct urb *urb);
int rtw_usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe);
int rtw_usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
uint8_t request, uint8_t requesttype,
uint16_t value, uint16_t index, void *data,
uint16_t size, usb_timeout_t timeout);
int rtw_usb_set_interface(struct usb_device *dev, uint8_t iface_no, uint8_t alt_index);
int rtw_usb_setup_endpoint(struct usb_device *dev,
struct usb_host_endpoint *uhe, usb_size_t bufsize);
struct urb *rtw_usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags);
struct usb_host_endpoint *rtw_usb_find_host_endpoint(struct usb_device *dev, uint8_t type, uint8_t ep);
struct usb_host_interface *rtw_usb_altnum_to_altsetting(const struct usb_interface *intf, uint8_t alt_index);
struct usb_interface *rtw_usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no);
void *rtw_usb_buffer_alloc(struct usb_device *dev, usb_size_t size, uint8_t *dma_addr);
void *rtw_usbd_get_intfdata(struct usb_interface *intf);
void rtw_usb_linux_register(void *arg);
void rtw_usb_linux_deregister(void *arg);
void rtw_usb_linux_free_device(struct usb_device *dev);
void rtw_usb_buffer_free(struct usb_device *dev, usb_size_t size,
void *addr, uint8_t dma_addr);
void rtw_usb_free_urb(struct urb *urb);
void rtw_usb_init_urb(struct urb *urb);
void rtw_usb_kill_urb(struct urb *urb);
void rtw_usb_set_intfdata(struct usb_interface *intf, void *data);
void rtw_usb_fill_bulk_urb(struct urb *urb, struct usb_device *udev,
struct usb_host_endpoint *uhe, void *buf,
int length, usb_complete_t callback, void *arg);
int rtw_usb_bulk_msg(struct usb_device *udev, struct usb_host_endpoint *uhe,
void *data, int len, uint16_t *pactlen, usb_timeout_t timeout);
void *usb_get_intfdata(struct usb_interface *intf);
int usb_linux_init_endpoints(struct usb_device *udev);
typedef struct urb * PURB;
typedef unsigned gfp_t;
#define __GFP_WAIT ((gfp_t)0x10u) /* Can wait and reschedule? */
#define __GFP_HIGH ((gfp_t)0x20u) /* Should access emergency pools? */
#define __GFP_IO ((gfp_t)0x40u) /* Can start physical IO? */
#define __GFP_FS ((gfp_t)0x80u) /* Can call down to low-level FS? */
#define __GFP_COLD ((gfp_t)0x100u) /* Cache-cold page required */
#define __GFP_NOWARN ((gfp_t)0x200u) /* Suppress page allocation failure warning */
#define __GFP_REPEAT ((gfp_t)0x400u) /* Retry the allocation. Might fail */
#define __GFP_NOFAIL ((gfp_t)0x800u) /* Retry for ever. Cannot fail */
#define __GFP_NORETRY ((gfp_t)0x1000u)/* Do not retry. Might fail */
#define __GFP_NO_GROW ((gfp_t)0x2000u)/* Slab internal usage */
#define __GFP_COMP ((gfp_t)0x4000u)/* Add compound page metadata */
#define __GFP_ZERO ((gfp_t)0x8000u)/* Return zeroed page on success */
#define __GFP_NOMEMALLOC ((gfp_t)0x10000u) /* Don't use emergency reserves */
#define __GFP_HARDWALL ((gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
/* This equals 0, but use constants in case they ever change */
#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */
#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
__GFP_HIGHMEM)
#endif // kenny add Linux compatibility code for Linux USB
__inline static _list *get_next(_list *list)
{
return list->next;
}
__inline static _list *get_list_head(_queue *queue)
{
return (&(queue->queue));
}
#define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member)))
__inline static void _enter_critical(_lock *plock, _irqL *pirqL)
{
spin_lock_irqsave(plock, *pirqL);
}
__inline static void _exit_critical(_lock *plock, _irqL *pirqL)
{
spin_unlock_irqrestore(plock, *pirqL);
}
__inline static void _enter_critical_ex(_lock *plock, _irqL *pirqL)
{
spin_lock_irqsave(plock, *pirqL);
}
__inline static void _exit_critical_ex(_lock *plock, _irqL *pirqL)
{
spin_unlock_irqrestore(plock, *pirqL);
}
__inline static void _enter_critical_bh(_lock *plock, _irqL *pirqL)
{
spin_lock_bh(plock, *pirqL);
}
__inline static void _exit_critical_bh(_lock *plock, _irqL *pirqL)
{
spin_unlock_bh(plock, *pirqL);
}
__inline static void _enter_critical_mutex(_mutex *pmutex, _irqL *pirqL)
{
mtx_lock(pmutex);
}
__inline static void _exit_critical_mutex(_mutex *pmutex, _irqL *pirqL)
{
mtx_unlock(pmutex);
}
static inline void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
static inline void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
}
__inline static void rtw_list_delete(_list *plist)
{
__list_del(plist->prev, plist->next);
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);
}
__inline static void _set_timer(_timer *ptimer,u32 delay_time)
{
// mod_timer(ptimer , (jiffies+(delay_time*HZ/1000)));
if(ptimer->function && ptimer->arg){
rtw_mtx_lock(NULL);
callout_reset(&ptimer->callout, delay_time,ptimer->function, ptimer->arg);
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);
}
__inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx)
{
printf("%s Not implement yet! \n",__FUNCTION__);
}
__inline static void _set_workitem(_workitem *pwork)
{
printf("%s Not implement yet! \n",__FUNCTION__);
// schedule_work(pwork);
}
//
// Global Mutex: can only be used at PASSIVE level.
//
#define ACQUIRE_GLOBAL_MUTEX(_MutexCounter) \
{ \
}
#define RELEASE_GLOBAL_MUTEX(_MutexCounter) \
{ \
}
#define ATOMIC_INIT(i) { (i) }
#endif //PLATFORM_FREEBSD
#ifdef PLATFORM_LINUX
#include <linux/version.h>
#include <linux/spinlock.h>
@ -1439,9 +732,7 @@ extern void _rtw_init_listhead(_list *list);
extern u32 rtw_is_list_empty(_list *phead);
extern void rtw_list_insert_head(_list *plist, _list *phead);
extern void rtw_list_insert_tail(_list *plist, _list *phead);
#ifndef PLATFORM_FREEBSD
extern void rtw_list_delete(_list *plist);
#endif //PLATFORM_FREEBSD
extern void _rtw_init_sema(_sema *sema, int init_val);
extern void _rtw_free_sema(_sema *sema);
@ -1449,9 +740,7 @@ extern void _rtw_up_sema(_sema *sema);
extern u32 _rtw_down_sema(_sema *sema);
extern void _rtw_mutex_init(_mutex *pmutex);
extern void _rtw_mutex_free(_mutex *pmutex);
#ifndef PLATFORM_FREEBSD
extern void _rtw_spinlock_init(_lock *plock);
#endif //PLATFORM_FREEBSD
extern void _rtw_spinlock_free(_lock *plock);
extern void _rtw_spinlock(_lock *plock);
extern void _rtw_spinunlock(_lock *plock);
@ -1493,15 +782,8 @@ __inline static unsigned char _cancel_timer_ex(_timer *ptimer)
#ifdef PLATFORM_LINUX
return del_timer_sync(ptimer);
#endif
#ifdef PLATFORM_FREEBSD
_cancel_timer(ptimer,0);
return 0;
#endif
}
#ifdef PLATFORM_FREEBSD
static __inline void thread_enter(char *name);
#endif //PLATFORM_FREEBSD
static __inline void thread_enter(char *name)
{
#ifdef PLATFORM_LINUX
@ -1510,14 +792,8 @@ static __inline void thread_enter(char *name)
#endif
allow_signal(SIGTERM);
#endif
#ifdef PLATFORM_FREEBSD
printf("%s", "RTKTHREAD_enter");
#endif
}
#ifdef PLATFORM_FREEBSD
#define thread_exit() do{printf("%s", "RTKTHREAD_exit");}while(0)
#endif //PLATFORM_FREEBSD
__inline static void flush_signals_thread(void)
{
#ifdef PLATFORM_LINUX
@ -1530,11 +806,7 @@ __inline static void flush_signals_thread(void)
__inline static _OS_STATUS res_to_status(sint res)
{
#if defined (PLATFORM_LINUX) || defined (PLATFORM_MPIXEL) || defined (PLATFORM_FREEBSD)
return res;
#endif
}
__inline static void rtw_dump_stack(void)
@ -1655,11 +927,7 @@ extern void rtw_lock_ext_suspend_timeout(u32 timeout_ms);
//Atomic integer operations
#ifdef PLATFORM_LINUX
#define ATOMIC_T atomic_t
#elif defined(PLATFORM_FREEBSD)
typedef uint32_t ATOMIC_T ;
#endif
extern void ATOMIC_SET(ATOMIC_T *v, int i);
extern int ATOMIC_READ(ATOMIC_T *v);
@ -1678,7 +946,6 @@ extern int rtw_retrive_from_file(char *path, u8* buf, u32 sz);
extern int rtw_store_to_file(char *path, u8* buf, u32 sz);
#if 1 //#ifdef MEM_ALLOC_REFINE_ADAPTOR
struct rtw_netdev_priv_indicator {
void *priv;
u32 sizeof_priv;
@ -1686,30 +953,9 @@ struct rtw_netdev_priv_indicator {
struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv);
extern struct net_device * rtw_alloc_etherdev(int sizeof_priv);
#ifndef PLATFORM_FREEBSD
#define rtw_netdev_priv(netdev) ( ((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv )
#else //PLATFORM_FREEBSD
#define rtw_netdev_priv(netdev) (((struct ifnet *)netdev)->if_softc)
#endif //PLATFORM_FREEBSD
#ifndef PLATFORM_FREEBSD
extern void rtw_free_netdev(struct net_device * netdev);
#else //PLATFORM_FREEBSD
#define rtw_free_netdev(netdev) if_free((netdev))
#endif //PLATFORM_FREEBSD
#else //MEM_ALLOC_REFINE_ADAPTOR
#define rtw_alloc_etherdev(sizeof_priv) alloc_etherdev((sizeof_priv))
#ifndef PLATFORM_FREEBSD
#define rtw_netdev_priv(netdev) netdev_priv((netdev))
#define rtw_free_netdev(netdev) free_netdev((netdev))
#else //PLATFORM_FREEBSD
#define rtw_netdev_priv(netdev) (((struct ifnet *)netdev)->if_softc)
#define rtw_free_netdev(netdev) if_free((netdev))
#endif //PLATFORM_FREEBSD
#endif
#ifdef PLATFORM_LINUX
#define NDEV_FMT "%s"

View file

@ -128,7 +128,7 @@ typedef struct _LED_871x{
u8 bLedStartToLinkBlinkInProgress;
u8 bLedScanBlinkInProgress;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)|| defined PLATFORM_FREEBSD
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
_workitem BlinkWorkItem; // Workitem used by BlinkTimer to manipulate H/W to blink LED.
#endif
#endif //defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)

View file

@ -630,11 +630,9 @@ extern void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf);
extern void rtw_atimdone_event_callback(_adapter *adapter, u8 *pbuf);
extern void rtw_cpwm_event_callback(_adapter *adapter, u8 *pbuf);
#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
extern int event_thread(void *context);
extern void rtw_join_timeout_handler(void* FunctionContext);
extern void _rtw_scan_timeout_handler(void* FunctionContext);
#endif
extern void rtw_free_network_queue(_adapter *adapter,u8 isfreeall);
extern int rtw_init_mlme_priv(_adapter *adapter);// (struct mlme_priv *pmlmepriv);

View file

@ -298,14 +298,8 @@ struct recv_priv
#endif //CONFIG_USB_INTERRUPT_IN_PIPE
#endif
#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
#ifdef PLATFORM_FREEBSD
struct task irq_prepare_beacon_tasklet;
struct task recv_tasklet;
#else //PLATFORM_FREEBSD
struct tasklet_struct irq_prepare_beacon_tasklet;
struct tasklet_struct recv_tasklet;
#endif //PLATFORM_FREEBSD
struct sk_buff_head free_recv_skb_queue;
struct sk_buff_head rx_skb_queue;
#ifdef CONFIG_RX_INDICATE_QUEUE
@ -316,7 +310,6 @@ struct recv_priv
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
_queue recv_buf_pending_queue;
#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX
#endif //defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
u8 *pallocated_recv_buf;
u8 *precv_buf; // 4 alignment
@ -401,19 +394,9 @@ struct recv_buf
#ifdef CONFIG_USB_HCI
#if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX)||defined(PLATFORM_FREEBSD)
PURB purb;
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
u32 alloc_sz;
#endif
#ifdef PLATFORM_OS_XP
PIRP pirp;
#endif
#ifdef PLATFORM_OS_CE
USB_TRANSFER usb_transfer_read_port;
#endif
u8 irp_pending;
int transfer_len;
@ -424,10 +407,6 @@ struct recv_buf
_pkt *pskb;
u8 reuse;
#endif
#ifdef PLATFORM_FREEBSD //skb solution
struct sk_buff *pskb;
u8 reuse;
#endif //PLATFORM_FREEBSD //skb solution
};

View file

@ -444,10 +444,6 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
void rtw_use_tkipkey_handler(void* FunctionContext);
#endif
#ifdef PLATFORM_FREEBSD
void rtw_use_tkipkey_handler(void* FunctionContext);
#endif //PLATFORM_FREEBSD
void rtw_sec_restore_wep_key(_adapter *adapter);
u8 rtw_handle_tkip_countermeasure(_adapter* adapter, const char *caller);

View file

@ -23,9 +23,6 @@
#include <drv_conf.h>
#include <osdep_service.h>
#include <drv_types.h>
#ifdef PLATFORM_FREEBSD
#include <if_ether.h>
#endif //PLATFORM_FREEBSD
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
//#define MAX_XMITBUF_SZ (30720)// (2048)
@ -308,22 +305,6 @@ struct pkt_attrib
};
#endif
#ifdef PLATFORM_FREEBSD
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_P_IP 0x0800 /* Internet Protocol packet */
/*struct rtw_ieee80211_hdr {
uint16_t frame_control;
uint16_t duration_id;
u8 addr1[6];
u8 addr2[6];
u8 addr3[6];
uint16_t seq_ctrl;
u8 addr4[6];
} ;*/
#endif //PLATFORM_FREEBSD
#define WLANHDR_OFFSET 64
#define NULL_FRAMETAG (0x0)
@ -394,19 +375,8 @@ struct xmit_buf
//u32 sz[8];
u32 ff_hwaddr;
#if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
PURB pxmit_urb[8];
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
#endif
#ifdef PLATFORM_OS_XP
PIRP pxmit_irp[8];
#endif
#ifdef PLATFORM_OS_CE
USB_TRANSFER usb_transfer_write_port;
#endif
u8 bpending[8];
sint last[8];
@ -590,9 +560,6 @@ struct xmit_priv {
#endif
#ifdef PLATFORM_LINUX
struct tasklet_struct xmit_tasklet;
#endif
#ifdef PLATFORM_FREEBSD
struct task xmit_tasklet;
#endif
//per AC pending irp
int beq_cnt;

View file

@ -84,14 +84,7 @@ void rtl8192du_set_hw_type(_adapter *padapter);
#define hal_set_hw_type rtl8192du_set_hw_type
void rtl8192du_set_intf_ops(struct _io_ops *pops);
#define usb_set_intf_ops rtl8192du_set_intf_ops
#ifndef PLATFORM_FREEBSD
void rtl8192du_recv_tasklet(void *priv);
#else // PLATFORM_FREEBSD
void rtl8192du_recv_tasklet(void *priv, int npending);
#ifdef CONFIG_RX_INDICATE_QUEUE
void rtw_rx_indicate_tasklet(void *priv, int npending);
#endif // CONFIG_RX_INDICATE_QUEUE
#endif // PLATFORM_FREEBSD
void rtl8192du_xmit_tasklet(void *priv);
#endif

View file

@ -678,11 +678,6 @@ struct rtw_ieee80211_bar {
#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8712FW) || defined(PLATFORM_FREEBSD)
/**
* struct rtw_ieee80211_ht_cap - HT capabilities
*
@ -760,8 +755,6 @@ struct ADDBA_request
__le16 BA_starting_seqctrl;
} __attribute__ ((packed));
#endif
typedef enum _HT_CAP_AMPDU_FACTOR {
MAX_AMPDU_FACTOR_8K = 0,
MAX_AMPDU_FACTOR_16K = 1,

View file

@ -296,275 +296,6 @@ typedef struct _NDIS_802_11_TEST
#endif //end of #ifdef PLATFORM_LINUX
#ifdef PLATFORM_FREEBSD
#define NDIS_802_11_LENGTH_SSID 32
#define NDIS_802_11_LENGTH_RATES 8
#define NDIS_802_11_LENGTH_RATES_EX 16
typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
typedef long NDIS_802_11_RSSI; // in dBm
typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates
typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates
typedef ULONG NDIS_802_11_KEY_INDEX;
typedef unsigned long long NDIS_802_11_KEY_RSC;
typedef struct _NDIS_802_11_SSID
{
ULONG SsidLength;
UCHAR Ssid[32];
} NDIS_802_11_SSID, *PNDIS_802_11_SSID;
typedef enum _NDIS_802_11_NETWORK_TYPE
{
Ndis802_11FH,
Ndis802_11DS,
Ndis802_11OFDM5,
Ndis802_11OFDM24,
Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound
} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
typedef struct _NDIS_802_11_CONFIGURATION_FH
{
ULONG Length; // Length of structure
ULONG HopPattern; // As defined by 802.11, MSB set
ULONG HopSet; // to one if non-802.11
ULONG DwellTime; // units are Kusec
} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
/*
FW will only save the channel number in DSConfig.
ODI Handler will convert the channel number to freq. number.
*/
typedef struct _NDIS_802_11_CONFIGURATION
{
ULONG Length; // Length of structure
ULONG BeaconPeriod; // units are Kusec
ULONG ATIMWindow; // units are Kusec
ULONG DSConfig; // Frequency, units are kHz
NDIS_802_11_CONFIGURATION_FH FHConfig;
} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
{
Ndis802_11IBSS,
Ndis802_11Infrastructure,
Ndis802_11AutoUnknown,
Ndis802_11InfrastructureMax, // Not a real value, defined as upper bound
Ndis802_11APMode
} NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
typedef struct _NDIS_802_11_FIXED_IEs
{
UCHAR Timestamp[8];
USHORT BeaconInterval;
USHORT Capabilities;
} NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
typedef struct _NDIS_802_11_VARIABLE_IEs
{
UCHAR ElementID;
UCHAR Length;
UCHAR data[1];
} NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
/*
Length is the 4 bytes multiples of the sume of
sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG)
+ sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION)
+ sizeof (NDIS_802_11_RATES_EX) + IELength
Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the
partial sum.
*/
#if 0
typedef struct _NDIS_WLAN_BSSID_EX
{
ULONG Length;
NDIS_802_11_MAC_ADDRESS MacAddress;
UCHAR Reserved[2];//[0]: IS beacon frame, [1]:optimum_antenna=>For antenna diversity;
NDIS_802_11_SSID Ssid;
ULONG Privacy;
NDIS_802_11_RSSI Rssi;
NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
NDIS_802_11_CONFIGURATION Configuration;
NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
NDIS_802_11_RATES_EX SupportedRates;
ULONG IELength;
UCHAR IEs[MAX_IE_SZ]; //(timestamp, beacon interval, and capability information)
} NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
typedef struct _NDIS_802_11_BSSID_LIST_EX
{
ULONG NumberOfItems;
NDIS_WLAN_BSSID_EX Bssid[1];
} NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
#endif
typedef enum _NDIS_802_11_AUTHENTICATION_MODE
{
Ndis802_11AuthModeOpen,
Ndis802_11AuthModeShared,
Ndis802_11AuthModeAutoSwitch,
Ndis802_11AuthModeWPA,
Ndis802_11AuthModeWPAPSK,
Ndis802_11AuthModeWPANone,
Ndis802_11AuthModeMax // Not a real mode, defined as upper bound
} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
typedef enum _NDIS_802_11_WEP_STATUS
{
Ndis802_11WEPEnabled,
Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
Ndis802_11WEPDisabled,
Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
Ndis802_11WEPKeyAbsent,
Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
Ndis802_11WEPNotSupported,
Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
Ndis802_11Encryption2Enabled,
Ndis802_11Encryption2KeyAbsent,
Ndis802_11Encryption3Enabled,
Ndis802_11Encryption3KeyAbsent
} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
#define NDIS_802_11_AI_REQFI_CAPABILITIES 1
#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
#define NDIS_802_11_AI_RESFI_CAPABILITIES 1
#define NDIS_802_11_AI_RESFI_STATUSCODE 2
#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
typedef struct _NDIS_802_11_AI_REQFI
{
USHORT Capabilities;
USHORT ListenInterval;
NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
typedef struct _NDIS_802_11_AI_RESFI
{
USHORT Capabilities;
USHORT StatusCode;
USHORT AssociationId;
} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
{
ULONG Length;
USHORT AvailableRequestFixedIEs;
NDIS_802_11_AI_REQFI RequestFixedIEs;
ULONG RequestIELength;
ULONG OffsetRequestIEs;
USHORT AvailableResponseFixedIEs;
NDIS_802_11_AI_RESFI ResponseFixedIEs;
ULONG ResponseIELength;
ULONG OffsetResponseIEs;
} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
typedef enum _NDIS_802_11_RELOAD_DEFAULTS
{
Ndis802_11ReloadWEPKeys
} NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
// Key mapping keys require a BSSID
typedef struct _NDIS_802_11_KEY
{
ULONG Length; // Length of this structure
ULONG KeyIndex;
ULONG KeyLength; // length of key in bytes
NDIS_802_11_MAC_ADDRESS BSSID;
NDIS_802_11_KEY_RSC KeyRSC;
UCHAR KeyMaterial[32]; // variable length depending on above field
} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
typedef struct _NDIS_802_11_REMOVE_KEY
{
ULONG Length; // Length of this structure
ULONG KeyIndex;
NDIS_802_11_MAC_ADDRESS BSSID;
} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
typedef struct _NDIS_802_11_WEP
{
ULONG Length; // Length of this structure
ULONG KeyIndex; // 0 is the per-client key, 1-N are the global keys
ULONG KeyLength; // length of key in bytes
UCHAR KeyMaterial[16];// variable length depending on above field
} NDIS_802_11_WEP, *PNDIS_802_11_WEP;
typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST
{
ULONG Length; // Length of structure
NDIS_802_11_MAC_ADDRESS Bssid;
ULONG Flags;
} NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
typedef enum _NDIS_802_11_STATUS_TYPE
{
Ndis802_11StatusType_Authentication,
Ndis802_11StatusType_MediaStreamMode,
Ndis802_11StatusType_PMKID_CandidateList,
Ndis802_11StatusTypeMax // not a real type, defined as an upper bound
} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
typedef struct _NDIS_802_11_STATUS_INDICATION
{
NDIS_802_11_STATUS_TYPE StatusType;
} NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
// mask for authentication/integrity fields
#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
// MIC check time, 60 seconds.
#define MIC_CHECK_TIME 60000000
typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
{
NDIS_802_11_STATUS_INDICATION Status;
NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
} NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
typedef struct _NDIS_802_11_TEST
{
ULONG Length;
ULONG Type;
union
{
NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
NDIS_802_11_RSSI RssiTrigger;
}tt;
} NDIS_802_11_TEST, *PNDIS_802_11_TEST;
#endif //PLATFORM_FREEBSD
#ifndef Ndis802_11APMode
#define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
#endif

View file

@ -33,12 +33,6 @@ struct pkt_file {
SIZE_T buf_len;
};
#ifdef PLATFORM_FREEBSD
#define NR_XMITFRAME 256
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
extern void rtw_xmit_entry_wrap (struct ifnet * pifp);
#endif //PLATFORM_FREEBSD
#ifdef PLATFORM_LINUX
#define NR_XMITFRAME 256