diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/doc/wireless-extensions/README.wireless-extensions linux-wlan-ng-0.1.10.wireless-extensions/doc/wireless-extensions/README.wireless-extensions --- linux-wlan-ng-0.1.10/doc/wireless-extensions/README.wireless-extensions Thu Jan 1 01:00:00 1970 +++ linux-wlan-ng-0.1.10.wireless-extensions/doc/wireless-extensions/README.wireless-extensions Wed Nov 7 13:54:24 2001 @@ -0,0 +1,126 @@ + _ _ ___ _ _ _____ _ _ ___ __ _ + | | _ | | / _ \ | | | || ____|| |_| | / _ \ | \ | | + | || || || /_\ || | | || ___| | ___ || /_\ || \| | + | || || || ___ | \ | / | |___ | | | || ___ || |\ | +www.\_/ \_/ |_| |_| \_/ |_____||_| |_||_| |_||_| \__|.de + +wireless extensions for linux-wlan-ng +version 0.0.3-2 + +COPYRIGHT +--------- +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. + +Note: +Please have a look at https://www.wavehan.de/www/projekte/prism2/COPYING +or http://www.gnu.org/ for the complete GNU GPL 2.0 License + +ABOUT +----- + NOTE: This is not a part of the linux-wlan-ng project, yet. + + Wireless Tools 10+ compatibility for linux-wlan-ng based on + code of wlancfg and orinoco_cs. It should be possible to have + a full- featured, enhanced replacement of the kernel- wireless + drivers without loosing the compatibility to common interfaces + like /proc/net/wireless and iwconfig. + +INSTALLATION +------------ + + - Please check if you've enabled "CONFIG_NET_WIRELESS" and + "CONFIG_NET_RADIO" in your kernel configuration. + + - Extract linux-wlan-ng: + # tar zxvf linux-wlan-ng-x.x.x.tar.gz + + - Apply the patch: + # patch -p0 < linux-wlan-ng-x.x.x.wireless-ext.x.x.x.diff + + - Compile: + # cd linux-wlan-ng-x.x.x + # make config all install + +STATE +----- + - /proc/net/wireless support works + + Examples: + + A PrismII- card: + --- + Inter-| sta-| Quality | Discarded packets + face | tus | link level noise | nwid crypt misc + wlan0: 0000 64. 111. 0. 0 0 0 + --- + + A PrismII- card in ap- mode: + --- + Inter-| sta-| Quality | Discarded packets + face | tus | link level noise | nwid crypt misc + wlan0: 0001 0. 0. 0. 0 0 0 + --- + + + - wireless extension ioctls support works + + currently supported ioctls: + SIOCGIWNAME /* get name == wireless protocol */ + SIOCSIWFREQ /* set channel */ + SIOCGIWFREQ /* get channel */ + SIOCGIWMODE /* get operation mode */ + SIOCGIWAP /* get access point MAC addresses */ + SIOCGIWESSID /* get ESSID */ + SIOCGIWNICKN /* get node name/nickname */ + SIOCGIWPRIV /* get private ioctls for iwpriv. This is + not necessary and not implemented but + i'll return a useless dummy for + demonstration. */ + + Example: + + A PrismII- card: + --- + # iwconfig wlan0 + wlan0 IEEE 802.11-b ESSID:"non-spec" Nickname:"reyk" + Mode:Managed Channel:3 Access Point: 44:44:44:44:44:44 + Link Quality:0 Signal level:27 Noise level:27 + Rx invalid nwid:0 invalid crypt:0 invalid misc:0 + --- + +TODO +---- + - testing and debuging + - implementation of more wireless extension- ioctls: + - set essid + - set nick + - ... + - ... + - Hermes (Lucent) support? + +CONTACT +------- + Reyk Floeter , https://reyk.synack.de/ + GnuPG key fingerprint: + 5B32 5DF9 0281 0F4D 44A7 567A 0141 6092 729F 899D + + Project Homepage: + https://www.wavehan.de/projekte/prism2/ + + CVS: + [disfunct] + +END ;-) diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/include/wlan/p80211conv.h linux-wlan-ng-0.1.10.wireless-extensions/src/include/wlan/p80211conv.h --- linux-wlan-ng-0.1.10/src/include/wlan/p80211conv.h Sun Mar 11 00:08:06 2001 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/include/wlan/p80211conv.h Wed Nov 7 13:53:59 2001 @@ -53,6 +53,7 @@ */ #ifndef _LINUX_P80211CONV_H +#define _LINUX_P80211CONV_H /*================================================================*/ /* Constants */ diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/include/wlan/p80211netdev.h linux-wlan-ng-0.1.10.wireless-extensions/src/include/wlan/p80211netdev.h --- linux-wlan-ng-0.1.10/src/include/wlan/p80211netdev.h Tue Sep 4 15:17:59 2001 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/include/wlan/p80211netdev.h Wed Nov 7 13:53:59 2001 @@ -51,6 +51,7 @@ */ #ifndef _LINUX_P80211NETDEV_H +#define _LINUX_P80211NETDEV_H /*================================================================*/ /* Constants */ @@ -128,6 +129,19 @@ UINT32 data_unknown; } p80211_frmrx_t; +/* compatibility to wireless extensions */ +#if defined(__LINUX_WLAN__) && defined (__KERNEL__) +#include +#if WIRELESS_EXT > 10 +typedef 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 @@ -174,6 +188,15 @@ /* 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; diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/include/wlan/p80211req.h linux-wlan-ng-0.1.10.wireless-extensions/src/include/wlan/p80211req.h --- linux-wlan-ng-0.1.10/src/include/wlan/p80211req.h Wed Jul 5 06:56:48 2000 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/include/wlan/p80211req.h Wed Nov 7 13:53:59 2001 @@ -46,6 +46,7 @@ */ #ifndef _LINUX_P80211REQ_H +#define _LINUX_P80211REQ_H /*================================================================*/ /* Constants */ diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/p80211/Makefile linux-wlan-ng-0.1.10.wireless-extensions/src/p80211/Makefile --- linux-wlan-ng-0.1.10/src/p80211/Makefile Sun Mar 11 04:21:45 2001 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/p80211/Makefile Wed Nov 7 13:53:59 2001 @@ -80,13 +80,16 @@ P80211_SRC= p80211conv.c \ p80211req.c \ p80211frm.c \ + p80211wext.c \ p80211netdev.c \ - p80211mod.c + p80211mod.c + P80211_OBJ= p80211conv.o \ p80211req.o \ p80211frm.o \ + p80211wext.o \ p80211netdev.o \ - p80211mod.o + p80211mod.o # List of modules to build MODULES= @@ -139,7 +142,7 @@ rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags rm -fr $(OBJ_DIR) rm -fr $(MODULES) - + # # Include a dependency file (if one exists) # diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/p80211/p80211netdev.c linux-wlan-ng-0.1.10.wireless-extensions/src/p80211/p80211netdev.c --- linux-wlan-ng-0.1.10/src/p80211/p80211netdev.c Mon Mar 26 21:03:09 2001 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/p80211/p80211netdev.c Wed Nov 7 13:54:00 2001 @@ -548,7 +548,17 @@ DBFENTER; WLAN_LOG_DEBUG2(2, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); - + +/* compatibility to wireless extensions */ +#if defined(__LINUX_WLAN__) && defined (__KERNEL__) +#if WIRELESS_EXT > 10 + /* to be or not to be a wireless extension- compatible ioctl */ + if((result = p80211wext_support_ioctl(dev, ifr, cmd)) + != (-EOPNOTSUPP)) { + return result; + } +#endif +#endif /* Test the magic, assume ifr is good if it's there */ if ( req->magic != P80211_IOCTL_MAGIC ) { @@ -641,6 +651,14 @@ dev->open = &p80211knetdev_open; dev->stop = &p80211knetdev_stop; + +#if defined(__LINUX_WLAN__) && defined (__KERNEL__) +#if WIRELESS_EXT > 10 + /* called by /proc/net/wireless */ + dev->get_wireless_stats = &p80211wext_get_wireless_stats; +#endif +#endif + #if (LINUX_VERSION_CODE < WLAN_KVERSION(2,3,38) ) dev->tbusy = 1; #endif diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/p80211/p80211wext.c linux-wlan-ng-0.1.10.wireless-extensions/src/p80211/p80211wext.c --- linux-wlan-ng-0.1.10/src/p80211/p80211wext.c Thu Jan 1 01:00:00 1970 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/p80211/p80211wext.c Wed Nov 7 13:54:42 2001 @@ -0,0 +1,178 @@ +/* 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 + * home: https://www.wavehan.de/projekte/prism2/ + * date: 10/04/2001 + * version: 0.0.3 + * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*================================================================*/ +/* Project Includes */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* 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?! + */ + wstats = (*(wlandev->get_wireless_stats))(dev); + + DBFEXIT; + + return &wlandev->wstats; +} + +/* check for a wireless extension- compatible ioctl. + * (this function is currently not used). + */ +int p80211wext_check_ioctl(int cmd) +{ + int err = (-EOPNOTSUPP); + + DBFENTER; + + switch (cmd) { + case SIOCSIWNAME: + case SIOCGIWNAME: + case SIOCSIWNWID: + case SIOCGIWNWID: + case SIOCSIWFREQ: + case SIOCGIWFREQ: + case SIOCSIWMODE: + case SIOCGIWMODE: + case SIOCSIWSENS: + case SIOCGIWSENS: + case SIOCSIWRANGE: + case SIOCGIWRANGE: + case SIOCSIWPRIV: + case SIOCGIWPRIV: + case SIOCSIWSPY: + case SIOCGIWSPY: + case SIOCSIWAP: + case SIOCGIWAP: + case SIOCGIWAPLIST: + case SIOCSIWESSID: + case SIOCGIWESSID: + case SIOCSIWNICKN: + case SIOCGIWNICKN: + case SIOCSIWRATE: + case SIOCGIWRATE: + case SIOCSIWRTS: + case SIOCGIWRTS: + case SIOCSIWFRAG: + case SIOCGIWFRAG: + case SIOCSIWTXPOW: + case SIOCGIWTXPOW: + case SIOCSIWRETRY: + case SIOCGIWRETRY: + case SIOCSIWENCODE: + case SIOCGIWENCODE: + case SIOCSIWPOWER: + case SIOCGIWPOWER: + err = 1; /* return true, if we do have a wireless + extension- compatible ioctl */ + break; + default: + err = (-EOPNOTSUPP); + break; + } + + 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; + + err = (*(wlandev->support_ioctl))(dev, iwr, cmd); + + DBFEXIT; + + return (err); +} + +#endif +#endif /* compatibility to wireless extensions */ + + + + diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/prism2/driver/Makefile linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/driver/Makefile --- linux-wlan-ng-0.1.10/src/prism2/driver/Makefile Sat Sep 1 01:14:15 2001 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/driver/Makefile Wed Nov 7 13:54:00 2001 @@ -88,17 +88,20 @@ PLX_MODULE=prism2_plx.o PCI_MODULE=prism2_pci.o -CS_OBJ= $(CS_OBJ_DIR)/prism2sta.o \ +CS_OBJ= $(CS_OBJ_DIR)/prism2wext.o \ + $(CS_OBJ_DIR)/prism2sta.o \ $(CS_OBJ_DIR)/prism2mgmt.o \ $(CS_OBJ_DIR)/prism2mib.o \ $(CS_OBJ_DIR)/hfa384x.o -PLX_OBJ= $(PLX_OBJ_DIR)/prism2sta.o \ +PLX_OBJ= $(PLX_OBJ_DIR)/prism2wext.o \ + $(PLX_OBJ_DIR)/prism2sta.o \ $(PLX_OBJ_DIR)/prism2mgmt.o \ $(PLX_OBJ_DIR)/prism2mib.o \ $(PLX_OBJ_DIR)/hfa384x.o -PCI_OBJ= $(PCI_OBJ_DIR)/prism2sta.o \ +PCI_OBJ= $(PLX_OBJ_DIR)/prism2wext.o \ + $(PCI_OBJ_DIR)/prism2sta.o \ $(PCI_OBJ_DIR)/prism2mgmt.o \ $(PCI_OBJ_DIR)/prism2mib.o \ $(PCI_OBJ_DIR)/hfa384x.o diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/prism2/driver/prism2sta.c linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/driver/prism2sta.c --- linux-wlan-ng-0.1.10/src/prism2/driver/prism2sta.c Mon Sep 24 21:42:31 2001 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/driver/prism2sta.c Wed Nov 7 13:54:00 2001 @@ -99,7 +99,7 @@ #include #include #include - +#include /*================================================================*/ /* Local Constants */ @@ -3174,6 +3174,13 @@ wlandev->reset = &prism2sta_reset; wlandev->txframe = &prism2sta_txframe; wlandev->mlmerequest = &prism2sta_mlmerequest; + +#if defined(__LINUX_WLAN__) && defined (__KERNEL__) +#if WIRELESS_EXT > 10 + wlandev->get_wireless_stats = &prism2wext_get_wireless_stats; + wlandev->support_ioctl = &prism2wext_support_ioctl; +#endif +#endif /* Set up the remaining entries in the wlan common way */ wlandev->name = ((prism2sta_priv_t*)wlandev->priv)->node.dev_name; diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/prism2/driver/prism2wext.c linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/driver/prism2wext.c --- linux-wlan-ng-0.1.10/src/prism2/driver/prism2wext.c Thu Jan 1 01:00:00 1970 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/driver/prism2wext.c Wed Nov 7 13:55:03 2001 @@ -0,0 +1,276 @@ +/* prism2wext.c -*- linux-c -*- + * _ _ ___ _ _ _____ _ _ ___ __ _ + * | | _ | | / _ \ | | | || ____|| |_| | / _ \ | \ | | + * | || || || /_\ || | | || ___| | ___ || /_\ || \| | + * | || || || ___ | \ | / | |___ | | | || ___ || |\ | + * www.\_/ \_/ |_| |_| \_/ |_____||_| |_||_| |_||_| \__|.de + * + * Wireless Tools 10+ compatibility for linux-wlan-ng based on code + * of wlancfg and orinoco_cs + * + * author: Reyk Floeter + * home: https://www.wavehan.de/projekte/prism2/ + * date: 10/04/2001 + * version: 0.0.3 + * + * 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 WAVEHAN 23 +#define WLAN_DBVAR prism2_debug + +#include + +/* compatibility to wireless extensions */ +#if defined(__LINUX_WLAN__) && defined (__KERNEL__) +#if WIRELESS_EXT > 10 + +/** function declarations =============== */ + +/* called by p80211wstats_get_wireless_stats for /proc/net/wireless */ +iw_stats* prism2wext_get_wireless_stats(struct net_device *dev) +{ + wlandevice_t *wlandev = (wlandevice_t*)dev->priv; + prism2sta_priv_t *priv = (prism2sta_priv_t*)wlandev->priv; + hfa384x_t *hw = priv->hw; + hfa384x_CommTallies32_t tallies = priv->tallies; + iw_stats* wstats; + int result = 0; + UINT8 bytebuf[HFA384x_CMD_ALLOC_LEN_MAX]; + hfa384x_commsquality_t *qual = (hfa384x_commsquality_t*)bytebuf; + + DBFENTER; + + if (wlandev == (wlandevice_t*) NULL) + return (iw_stats*) NULL; + + wstats = &wlandev->wstats; + + memset(&wstats->qual, 0, sizeof(hfa384x_commsquality_t)); + + /* get the qualitity settings from the RID and return them + * into a struct... + */ + result = hfa384x_drvr_getconfig(hw, HFA384x_RID_COMMSQUALITY, qual, HFA384x_RID_COMMSQUALITY_LEN); + + /* set stats for the wireless- stats struct. + * we can't return any link quality, if we are in ap (accesspoint) - + * mode! + */ + wstats->status = priv->ap; + wstats->qual.qual = priv->ap ? 0L : qual->CQ_currBSS; + wstats->qual.level = priv->ap ? 0L : qual->ASL_currBSS; + wstats->qual.noise = priv->ap ? 0L : qual->ANL_currFC; + wstats->qual.updated = 7; + wstats->discard.nwid = tallies.txdiscardswrongsa; /* am i wrong?! */ + wstats->discard.code = tallies.rxdiscardswepundecr; /* am i wrong?! */ + wstats->discard.misc = tallies.txdiscards; /* am i wrong?! */ + + DBFEXIT; + + return &wlandev->wstats; +} + +/* wireless extensions' ioctls */ +int prism2wext_support_ioctl(struct net_device *dev, struct iwreq *iwr, int cmd) +{ + wlandevice_t *wlandev = (wlandevice_t*)dev->priv; + prism2sta_priv_t *priv = (prism2sta_priv_t*)wlandev->priv; + hfa384x_t *hw = priv->hw; + UINT8 bytebuf[HFA384x_BAP_DATALEN_MAX]; + UINT16 *reqbuf = (UINT16*)bytebuf; + int err = 0; + + DBFENTER; + + WLAN_LOG_DEBUG1(1, "received wireless extension- compatible ioctl #%d.\n", cmd); + + switch (cmd) { + case SIOCSIWNAME: /* unused */ + err = (-EOPNOTSUPP); + break; + + case SIOCGIWNAME: /* get name == wireless protocol */ + strcpy(iwr->u.name, "IEEE 802.11-b");/* IEEE + 802.11-DS as + in orinoco.c? + */ + break; + + case SIOCSIWNWID: + case SIOCGIWNWID: + err = (-EOPNOTSUPP); + break; + + case SIOCSIWFREQ: /* set channel */ + /* Where's the difference between cnfOwnChannel and + * CurrentChannel? + */ + err = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNCHANNEL, &(iwr->u.freq.m), HFA384x_RID_CNFOWNCHANNEL_LEN); + + break; + + case SIOCGIWFREQ: /* get channel */ + err = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNCHANNEL, reqbuf, HFA384x_RID_CNFOWNCHANNEL_LEN); + + /* we don't use frequencies, just channels */ + iwr->u.freq.e = 0; + iwr->u.freq.i = 0; + iwr->u.freq.m = *reqbuf; + break; + + case SIOCSIWMODE: /* set operation mode */ + err = (-EOPNOTSUPP); + break; + + case SIOCGIWMODE: /* get operation mode */ + err = priv->ap ? 0 : hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFPORTTYPE, reqbuf, HFA384x_RID_CNFPORTTYPE_LEN); + + /* 1 - ad-hoc + * 2 - managed + * 3 - master (accesspoint) + */ + iwr->u.mode = priv->ap ? 3 : (*reqbuf ? 2 : 1); + + break; + + case SIOCSIWSENS: + case SIOCGIWSENS: + case SIOCSIWRANGE: + case SIOCGIWRANGE: + case SIOCSIWSPY: + case SIOCGIWSPY: + case SIOCSIWAP: /* set access point MAC addresses (BSSID) */ + err = (-EOPNOTSUPP); + break; + + case SIOCGIWAP: /* get access point MAC addresses (BSSID) */ + err = hfa384x_drvr_getconfig(hw, + HFA384x_RID_CURRENTBSSID, + &(iwr->u.ap_addr.sa_data), HFA384x_RID_CURRENTBSSID_LEN); + + iwr->u.ap_addr.sa_data[6] = '\0'; /* fixme :~-O */ + + break; + + case SIOCGIWAPLIST: + case SIOCSIWESSID: /* set ESSID (network name) */ + err = (-EOPNOTSUPP); + break; + + case SIOCGIWESSID: /* get ESSID */ + if (!priv->ap) { + err = prism2wext_getstr(hw, &(iwr->u.essid), HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID_LEN); + } else { + err = prism2wext_getstr(hw, &(iwr->u.essid), HFA384x_RID_CNFOWNSSID, HFA384x_RID_CNFOWNSSID_LEN); + } + + break; + + case SIOCSIWNICKN: /* set node name/nickname */ + err = (-EOPNOTSUPP); + break; + + case SIOCGIWNICKN: /* get node name/nickname */ + err = prism2wext_getstr(hw, &(iwr->u.data), HFA384x_RID_CNFOWNNAME, HFA384x_RID_CNFOWNNAME_LEN); + break; + + case SIOCSIWRATE: /* set default bit rate (bps) */ + case SIOCGIWRATE: /* get default bit rate (bps) */ + case SIOCSIWRTS: + case SIOCGIWRTS: + case SIOCSIWFRAG: + case SIOCGIWFRAG: + case SIOCSIWTXPOW: + case SIOCGIWTXPOW: + case SIOCSIWRETRY: + case SIOCGIWRETRY: + case SIOCSIWENCODE: /* set encoding token & mode */ + case SIOCGIWENCODE: /* get encoding token & mode */ + err = (-EOPNOTSUPP); + break; + + case SIOCSIWPOWER: + case SIOCGIWPOWER: + err = (-EOPNOTSUPP); + break; + + case SIOCGIWPRIV: /* get private ioctls for iwpriv. This is + not necessary and not implemented but + i'll return a useless dummy for + demonstration. */ + WLAN_LOG_DEBUG1(1, "%s: SIOCGIWPRIV\n", dev->name); + if (iwr->u.data.pointer) { + struct iw_priv_args privtab[] = { + { SIOCGIWPRIV, 0, 0, "DUMMY;-)" }, /* no action */ + }; + + err = verify_area(VERIFY_WRITE, iwr->u.data.pointer, sizeof(privtab)); + if (err) + break; + + iwr->u.data.length = sizeof(privtab) / sizeof(privtab[0]); + if (copy_to_user(iwr->u.data.pointer, privtab, sizeof(privtab))) + err = -EFAULT; + } + break; + + default: + err = (-EOPNOTSUPP); + break; + } + + DBFEXIT; + + return (err); +} + +/* return a string value to user space */ +int prism2wext_getstr(hfa384x_t *hw, struct iw_point *erq, UINT16 rid, UINT16 len) { + UINT8 bytebuf[len]; + UINT8 pstrbuf[len]; + hfa384x_bytestr_t *bytestr = (hfa384x_bytestr_t*)bytebuf; + p80211pstrd_t *pstr = (p80211pstrd_t*)pstrbuf; + int err = 0; + + DBFENTER; + + err = hfa384x_drvr_getconfig(hw, rid, bytebuf, len); + if (err) + return (err); + + prism2mgmt_bytestr2pstr(bytestr, pstr); /* convert string to + host format */ + + erq->flags = 1; + erq->length = pstr->len; + + WLAN_LOG_DEBUG1(1, "returning bytestr of %d bytes\n", pstr->len); + + if(erq->pointer) { + if(copy_to_user(erq->pointer, (char*)pstr->data, erq->length)) + return (-EFAULT); + } + + DBFEXIT; + + return (err); +} +#endif +#endif /* compatibility to wireless extensions */ diff --exclude=*~ --exclude=.depend* -Naur linux-wlan-ng-0.1.10/src/prism2/include/prism2/prism2wext.h linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/include/prism2/prism2wext.h --- linux-wlan-ng-0.1.10/src/prism2/include/prism2/prism2wext.h Thu Jan 1 01:00:00 1970 +++ linux-wlan-ng-0.1.10.wireless-extensions/src/prism2/include/prism2/prism2wext.h Wed Nov 7 13:54:00 2001 @@ -0,0 +1,110 @@ +/* prism2wext.h -*- linux-c -*- + * _ _ ___ _ _ _____ _ _ ___ __ _ + * | | _ | | / _ \ | | | || ____|| |_| | / _ \ | \ | | + * | || || || /_\ || | | || ___| | ___ || /_\ || \| | + * | || || || ___ | \ | / | |___ | | | || ___ || |\ | + * www.\_/ \_/ |_| |_| \_/ |_____||_| |_||_| |_||_| \__|.de + * + * Wireless Tools 10+ compatibility for linux-wlan-ng based on code + * of wlancfg and orinoco_cs + * + * author: Reyk Floeter + * home: https://www.wavehan.de/projekte/prism2/ + * date: 10/04/2001 + * version: 0.0.3 + * + * 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 */ + +#ifndef _PRISM2_WEXT_H +#define _PRISM2_WEXT_H + +#define WAVEHAN 23 +#define WLAN_DBVAR prism2_debug + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (WLAN_HOSTIF == WLAN_PCMCIA) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI)) +#include +#endif + +/*================================================================*/ +/* Project Includes */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* compatibility to wireless extensions */ +#if defined(__LINUX_WLAN__) && defined (__KERNEL__) +#include +#if WIRELESS_EXT > 10 + +/** function prototypes =============== */ +/* called by /proc/net/wireless */ +iw_stats* prism2wext_get_wireless_stats(struct net_device *dev); +/* wireless extensions' ioctls */ +int prism2wext_support_ioctl(struct net_device *dev, struct iwreq *iwr, int cmd); +/* used by the ioctls ----------------- */ +/* return a string value to user space */ +int prism2wext_getstr(hfa384x_t *hw, struct iw_point *erq, UINT16 rid, UINT16 len); +/* ... */ +#endif +#endif + +#endif /* _PRISM2_WEXT_H */ + + +