|
|
|
@ -1,22 +1,38 @@
|
|
|
|
|
/* p80211wext.c -*- linux-c -*-
|
|
|
|
|
*
|
|
|
|
|
* original author: Reyk Floeter <reyk@synack.de>
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
/* src/p80211/p80211wext.c
|
|
|
|
|
*
|
|
|
|
|
* Glue code to make linux-wlan-ng a happy wireless extension camper.
|
|
|
|
|
*
|
|
|
|
|
* original author: Reyk Floeter <reyk@synack.de>
|
|
|
|
|
* Completely re-written by Solomon Peachy <solomon@linux-wlan.com>
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2002 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.
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*================================================================*/
|
|
|
|
|
/* System Includes */
|
|
|
|
@ -47,6 +63,8 @@
|
|
|
|
|
#include <wlan/p80211conv.h>
|
|
|
|
|
#include <wlan/p80211mgmt.h>
|
|
|
|
|
#include <wlan/p80211msg.h>
|
|
|
|
|
#include <wlan/p80211metastruct.h>
|
|
|
|
|
#include <wlan/p80211metadef.h>
|
|
|
|
|
#include <wlan/p80211netdev.h>
|
|
|
|
|
#include <wlan/p80211ioctl.h>
|
|
|
|
|
#include <wlan/p80211req.h>
|
|
|
|
@ -59,8 +77,10 @@
|
|
|
|
|
/* called by /proc/net/wireless */
|
|
|
|
|
struct iw_statistics* p80211wext_get_wireless_stats (netdevice_t *dev)
|
|
|
|
|
{
|
|
|
|
|
p80211msg_lnxreq_commsquality_t quality;
|
|
|
|
|
wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
|
|
|
|
|
struct iw_statistics* wstats = NULL;
|
|
|
|
|
struct iw_statistics* wstats = &wlandev->wstats;
|
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
|
|
DBFENTER;
|
|
|
|
|
|
|
|
|
@ -71,26 +91,31 @@ struct iw_statistics* p80211wext_get_wireless_stats (netdevice_t *dev)
|
|
|
|
|
if ( wlandev->msdstate != WLAN_MSD_RUNNING )
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
/* iface
|
|
|
|
|
status
|
|
|
|
|
link_qual
|
|
|
|
|
link_level
|
|
|
|
|
link_noise
|
|
|
|
|
disc_nwid
|
|
|
|
|
disc_crypt
|
|
|
|
|
disc_frag
|
|
|
|
|
disc_retry
|
|
|
|
|
disc_misc
|
|
|
|
|
missed_beacon
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* 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.
|
|
|
|
|
*/
|
|
|
|
|
if (wlandev->get_wireless_stats)
|
|
|
|
|
wstats = (*(wlandev->get_wireless_stats))(dev);
|
|
|
|
|
/* XXX Only valid in station mode */
|
|
|
|
|
wstats->status = 0;
|
|
|
|
|
|
|
|
|
|
/* build request message */
|
|
|
|
|
quality.msgcode = DIDmsg_lnxreq_commsquality;
|
|
|
|
|
quality.dbm.data = P80211ENUM_truth_false;
|
|
|
|
|
quality.dbm.status = P80211ENUM_msgitem_status_data_ok;
|
|
|
|
|
|
|
|
|
|
/* send message to nsd */
|
|
|
|
|
if ( wlandev->mlmerequest == NULL )
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
retval = (*(wlandev->mlmerequest))(wlandev, (p80211msg_t*) &quality);
|
|
|
|
|
|
|
|
|
|
wstats->qual.qual = quality.link.data; /* overall link quality */
|
|
|
|
|
wstats->qual.level = quality.level.data; /* instant signal level */
|
|
|
|
|
wstats->qual.noise = quality.noise.data; /* instant noise level */
|
|
|
|
|
|
|
|
|
|
wstats->qual.updated = 7; // XXX magic number. don't know.
|
|
|
|
|
wstats->discard.code = wlandev->rx.decrypt_err;
|
|
|
|
|
wstats->discard.nwid = 0;
|
|
|
|
|
wstats->discard.fragment = 0;
|
|
|
|
|
wstats->discard.retries = 0;
|
|
|
|
|
wstats->discard.misc = 0;
|
|
|
|
|
wstats->miss.beacon = 0;
|
|
|
|
|
|
|
|
|
|
DBFEXIT;
|
|
|
|
|
|
|
|
|
|