p80211wext.c

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

C
144
字号
/* p80211wext.c -*- linux-c -*- *     _     _   ___   _   _  _____  _   _   ___   __   _ *    | | _ | | / _ \ | | | || ____|| |_| | / _ \ |  \ | | *    | || || || /_\ || | | || ___| | ___ || /_\ ||   \| | *    | || || || ___ | \ | / | |___ | | | || ___ || |\   | * www.\_/ \_/ |_| |_|  \_/  |_____||_| |_||_| |_||_| \__|.de  * * Wireless Tools 10+ compatibility for linux-wlan-ng based on code  * of wlancfg and orinoco_cs * * author:  Reyk Floeter <reyk@synack.de> * home:    https://www.wavehan.de/projekte/prism2/ * date:    10/04/2001 * version: 0.0.4 * * This application is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This application 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 * Library General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111 USA.  *//*================================================================*//* System Includes */#define __NO_VERSION__		/* prevent the static definition */#define WAVEHAN 23#include <linux/config.h>#include <linux/version.h>#include <wlan/wlan_compat.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/sched.h>#include <linux/types.h>#include <linux/skbuff.h>#include <linux/slab.h>#include <linux/netdevice.h>#include <linux/rtnetlink.h>#include <linux/etherdevice.h>#include <asm/bitops.h>#include <asm/uaccess.h>#include <asm/byteorder.h>/*================================================================*//* Project Includes */#include <wlan/version.h>#include <wlan/p80211types.h>#include <wlan/p80211hdr.h>#include <wlan/p80211conv.h>#include <wlan/p80211mgmt.h>#include <wlan/p80211msg.h>#include <wlan/p80211netdev.h>#include <wlan/p80211ioctl.h>#include <wlan/p80211req.h>/* compatibility to wireless extensions */#if defined(__LINUX_WLAN__) && defined (__KERNEL__)#if WIRELESS_EXT > 10/** function declarations =============== *//* called by /proc/net/wireless */iw_stats* p80211wext_get_wireless_stats (struct net_device *dev) {	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;	iw_stats* wstats;		DBFENTER;		/* Check */	if (wlandev == (wlandevice_t*) NULL) 		return (iw_stats*) NULL;		/* forward the request to a hardware- dependent function.  	 * FIX: should it be possible to do abstract MIB- requests (ie. for	 * getting the link quality) on the p80211- level?! 	 * ANSWER: [MSM] Yes, it should.  It just isn't done yet.	 */   	wstats = (*(wlandev->get_wireless_stats))(dev);		DBFEXIT;		return &wlandev->wstats;}/* check for a wireless extension- compatible ioctl.  */int p80211wext_check_ioctl(int cmd){	int err = 0;	DBFENTER;	if(cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {		err = 1;  /* return true, if we do have a wireless			     extension- compatible ioctl */	}	DBFEXIT;	return (err);}/* wireless extensions' ioctls */ int p80211wext_support_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd){	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;	struct iwreq *iwr = (struct iwreq*)ifr;	int err = 0;		DBFENTER;	if ( wlandev->msdstate != WLAN_MSD_RUNNING ) {		return -ENODEV;	}	/*	 * MSM: These should be doable up here too....	 */	err = (*(wlandev->support_ioctl))(dev, iwr, cmd); 	DBFEXIT;	return (err);}#endif#endif /* compatibility to wireless extensions */

⌨️ 快捷键说明

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