p80211netdev.h

来自「Linux的无线局域网方案是一个Linux设备驱动程序和子系统 一揽子方案的用」· C头文件 代码 · 共 291 行

H
291
字号
/* src/include/wlan/p80211netdev.h** WLAN net device structure and functions** Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.* --------------------------------------------------------------------** linux-wlan**   The contents of this file are subject to the Mozilla Public*   License Version 1.1 (the "License"); you may not use this file*   except in compliance with the License. You may obtain a copy of*   the License at http://www.mozilla.org/MPL/**   Software distributed under the License is distributed on an "AS*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or*   implied. See the License for the specific language governing*   rights and limitations under the License.**   Alternatively, the contents of this file may be used under the*   terms of the GNU Public License version 2 (the "GPL"), in which*   case the provisions of the GPL are applicable instead of the*   above.  If you wish to allow the use of your version of this file*   only under the terms of the GPL and not to allow others to use*   your version of this file under the MPL, indicate your decision*   by deleting the provisions above and replace them with the notice*   and other provisions required by the GPL.  If you do not delete*   the provisions above, a recipient may use your version of this*   file under either the MPL or the GPL.** --------------------------------------------------------------------** Inquiries regarding the linux-wlan Open Source project can be* made directly to:** AbsoluteValue Systems Inc.* info@linux-wlan.com* http://www.linux-wlan.com** --------------------------------------------------------------------** Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development.** --------------------------------------------------------------------** This file declares the structure type that represents each wlan* interface.  ** --------------------------------------------------------------------*/#ifndef _LINUX_P80211NETDEV_H#define _LINUX_P80211NETDEV_H/*================================================================*//* Constants */#define WLAN_DEVICE_CLOSED	0#define WLAN_DEVICE_OPEN	1#define WLAN_MACMODE_NONE	0#define WLAN_MACMODE_IBSS_STA	1#define WLAN_MACMODE_ESS_STA	2#define WLAN_MACMODE_ESS_AP	3/* MSD States */#define WLAN_MSD_START			-1#define WLAN_MSD_DRIVERLOADED		0#define WLAN_MSD_HWPRESENT_PENDING	1#define WLAN_MSD_HWFAIL			2#define WLAN_MSD_HWPRESENT		3#define WLAN_MSD_FWLOAD_PENDING		4#define WLAN_MSD_FWLOAD			5#define WLAN_MSD_RUNNING_PENDING	6#define WLAN_MSD_RUNNING		7#ifndef ETH_P_ECONET#define ETH_P_ECONET   0x0018    /* needed for 2.2.x kernels */#endif#define ETH_P_80211_RAW        (ETH_P_ECONET + 1)#ifndef ARPHRD_IEEE80211#define ARPHRD_IEEE80211 801     /* kernel 2.4.6 */#endif#ifndef ARPHRD_IEEE80211_PRISM  /* kernel 2.4.18 */#define ARPHRD_IEEE80211_PRISM 802#endif/*================================================================*//* Macros *//*================================================================*//* Types *//* struct device from linux/netdevice.h *//* Not exactly sure when this changed.... */#if (LINUX_VERSION_CODE < WLAN_KVERSION(2,3,38))typedef struct device netdevice_t;#elif (LINUX_VERSION_CODE < WLAN_KVERSION(2,4,4))typedef struct net_device netdevice_t;#else#undef netdevice_ttypedef struct net_device netdevice_t;#endif#ifndef _LINUX_K_COMPAT_H#if (LINUX_VERSION_CODE < WLAN_KVERSION(2,2,18)) || (LINUX_VERSION_CODE == WLAN_KVERSION(2,3,0))#if (LINUX_VERSION_CODE < WLAN_KVERSION(2,0,16))#define init_waitqueue_head(p)  (*(p) = NULL)#else#define init_waitqueue_head(p)  init_waitqueue(p)#endiftypedef struct wait_queue *wait_queue_head_t;#endif#endif/* Received frame statistics */typedef struct p80211_frmrx_t {	UINT32	mgmt;	UINT32	assocreq;	UINT32	assocresp;	UINT32	reassocreq;	UINT32	reassocresp;	UINT32	probereq;	UINT32	proberesp;	UINT32	beacon;	UINT32	atim;	UINT32	disassoc;	UINT32	authen;	UINT32	deauthen;	UINT32	mgmt_unknown;	UINT32	ctl;	UINT32	pspoll;	UINT32	rts;	UINT32	cts;	UINT32	ack;	UINT32	cfend;	UINT32	cfendcfack;	UINT32	ctl_unknown;	UINT32	data;	UINT32	dataonly;	UINT32	data_cfack;	UINT32	data_cfpoll;	UINT32	data__cfack_cfpoll;	UINT32	null;	UINT32	cfack;	UINT32	cfpoll;	UINT32	cfack_cfpoll;	UINT32	data_unknown;} p80211_frmrx_t;/* compatibility to wireless extensions */#if defined(__LINUX_WLAN__) && defined (__KERNEL__)#include <linux/wireless.h>#if WIRELESS_EXT > 10typedef struct iw_statistics iw_stats;/* called by /proc/net/wireless */iw_stats* p80211wext_get_wireless_stats(struct net_device *dev);/* check for a wireless extension- compatible ioctl */ int p80211wext_check_ioctl(int cmd); /* wireless extensions' ioctls */ int p80211wext_support_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);#endif #endif /* wireless extensions *//* WLAN device type */typedef struct wlandevice{	/* Subsystem State */	char		*name;		/* Dev name, from register_wlandev()*/	UINT32		state;		/* Device I/F state (open/closed) */	UINT32		msdstate;	/* state of underlying driver */	UINT32		hwremoved;	/* Has the hw been yanked out? */	/* Hardware config */	UINT		irq;	UINT		iobase;	UINT		membase;	/* Config vars */	UINT		ethconv;	/* device methods (init by MSD, used by p80211 */	int		(*open)(struct wlandevice *wlandev);	int		(*close)(struct wlandevice *wlandev);	void		(*reset)(struct wlandevice *wlandev );	int		(*txframe)(struct wlandevice *wlandev, wlan_pb_t *pb );	int		(*mlmerequest)(struct wlandevice *wlandev, p80211msg_t *msg);	void		(*hwremovedfn)(struct wlandevice *wlandev);	/* 802.11 State */	UINT8		bssid[WLAN_BSSID_LEN];	UINT32		macmode;	/* Request/Confirm i/f state (used by p80211) */	UINT32			request_pending; /* flag, access atomically */	p80211msg_t		*curr_msg;	struct timer_list	reqtimer;	wait_queue_head_t	reqwq;	/* Indication i/f state */		/* netlink socket */		/* queue for indications waiting for cmd completion */	/* Linux netdevice and support */	netdevice_t		*netdev;	/* ptr to linux netdevice */	struct net_device_stats linux_stats;	void			*priv;		/* private data for MSD */	struct wlandevice	*next;		/* link for list of devices */	/* 802.11 device statistics */	struct p80211_frmrx_t	rx;/* compatibility to wireless extensions */#if defined(__LINUX_WLAN__) && defined (__KERNEL__)#if WIRELESS_EXT > 10	iw_stats* (*get_wireless_stats)(struct net_device *dev);	iw_stats wstats; /* Wireless-specific statistics */	int (*support_ioctl)(struct net_device *dev, struct iwreq *iwr, int cmd);#endif#endif} wlandevice_t;/*================================================================*//* Externs *//*================================================================*//* Function Declarations */void	p80211netdev_startup(void);int	wlan_setup(wlandevice_t *wlandev);int	wlan_unsetup(wlandevice_t *wlandev);int	register_wlandev(wlandevice_t *wlandev);int	unregister_wlandev(wlandevice_t *wlandev);void	p80211netdev_rx(wlandevice_t *wlandev, wlan_pb_t *pb);void	p80211netdev_hwremoved(wlandevice_t *wlandev);/*================================================================*//* Function Definitions */static inline voidp80211netdev_stop_queue(wlandevice_t *wlandev){	if ( !wlandev ) return;	if ( !wlandev->netdev ) return;#if (LINUX_VERSION_CODE < WLAN_KVERSION(2,3,38) )	wlandev->netdev->tbusy = 1;	wlandev->netdev->start = 0;#else	netif_stop_queue(wlandev->netdev);#endif}static inline voidp80211netdev_start_queue(wlandevice_t *wlandev){	if ( !wlandev ) return;	if ( !wlandev->netdev ) return;#if (LINUX_VERSION_CODE < WLAN_KVERSION(2,3,38) )	wlandev->netdev->tbusy = 0;	wlandev->netdev->start = 1;#else	netif_start_queue(wlandev->netdev);#endif}static inline voidp80211netdev_wake_queue(wlandevice_t *wlandev){	if ( !wlandev ) return;	if ( !wlandev->netdev ) return;#if (LINUX_VERSION_CODE < WLAN_KVERSION(2,3,38) )	wlandev->netdev->tbusy = 0;	mark_bh(NET_BH);#else	netif_wake_queue(wlandev->netdev);#endif}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?