提交 de1c4400 编写于 作者: K Kristina Martšenko 提交者: Greg Kroah-Hartman

staging: wlags49_h2(5): remove driver

Remove the driver as it hasn't been cleaned up and it doesn't look like
anyone is going to work on it anymore.
Signed-off-by: NKristina Martšenko <kristina.martsenko@gmail.com>
Cc: Henk de Groot <pe1dnn@amsat.org>
Cc: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c047b443
......@@ -8496,12 +8496,6 @@ L: devel@driverdev.osuosl.org
S: Supported
F: drivers/staging/
STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS
M: Henk de Groot <pe1dnn@amsat.org>
S: Odd Fixes
F: drivers/staging/wlags49_h2/
F: drivers/staging/wlags49_h25/
STAGING - ASUS OLED
M: Jakub Schmidtke <sjakub@gmail.com>
S: Odd Fixes
......
......@@ -74,10 +74,6 @@ source "drivers/staging/sep/Kconfig"
source "drivers/staging/iio/Kconfig"
source "drivers/staging/wlags49_h2/Kconfig"
source "drivers/staging/wlags49_h25/Kconfig"
source "drivers/staging/cxt1e1/Kconfig"
source "drivers/staging/xgifb/Kconfig"
......
......@@ -31,8 +31,6 @@ obj-$(CONFIG_VT6656) += vt6656/
obj-$(CONFIG_VME_BUS) += vme/
obj-$(CONFIG_DX_SEP) += sep/
obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/
obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/
obj-$(CONFIG_CXT1E1) += cxt1e1/
obj-$(CONFIG_FB_XGI) += xgifb/
obj-$(CONFIG_TIDSPBRIDGE) += tidspbridge/
......
config WLAGS49_H2
tristate "Agere Systems HERMES II Wireless PC Card Model 0110"
depends on WLAN && PCMCIA
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
---help---
Driver for wireless cards using Agere's HERMES II chipset
which are identified with Manufacture ID: 0156,0003
The software is a modified version of wl_lkm_722_abg.tar.gz
from the Agere Systems website, addapted for Ubuntu 9.04.
#
# Makefile for wlags49_h2_cs.ko and wlags49_h25_cs.ko
#
# Default build for Hermes-II base cards (possibly identified with
# "manfid: 0x0156, 0x0003" in "pccardctl ident" output), comment
# -DHERMES25 below
#
# If you want to build for Hermes-II.5 base cards (possibly identified with
# "manfid: 0x0156, 0x0004" in "pccardctl ident" output), uncomment
# -DHERMES25 below
#
# If you want to build AP support (untested), comment out -DSTA_ONLY
ccflags-y := -I$(KERNELDIR)/include
ccflags-y += -I$(src) \
-DBUS_PCMCIA \
-DUSE_WEXT \
-DSTA_ONLY \
-DWVLAN_49 \
# -DHERMES25 \
# -DDBG \
# -DDBG_LVL=5 \
# -DUSE_UIL \
# -DUSE_PROFILE \
ifeq ($(findstring HERMES25,$(ccflags-y)),)
WLNAME := wlags49_h2_cs
$(WLNAME)-y := sta_h2.o
ifeq ($(findstring STA_ONLY,$(ccflags-y)),)
$(WLNAME)-y += ap_h2.o
endif
else
WLNAME=wlags49_h25_cs
$(WLNAME)-y := sta_h25.o
ifeq ($(findstring STA_ONLY,$(ccflags-y)),)
$(WLNAME)-y += ap_h25.o
endif
endif
obj-m += $(WLNAME).o
$(WLNAME)-y += wl_profile.o \
wl_wext.o \
wl_priv.o \
wl_main.o \
wl_enc.o \
wl_util.o \
wl_netdev.o \
wl_cs.o \
mmd.o \
hcf.o \
dhf.o
=======================================================================
WLAN driver for cards using the HERMES II and HERMES II.5 chipset
HERMES II Card
PCMCIA Info: "Agere Systems" "Wireless PC Card Model 0110"
Manufacture ID: 0156,0003
HERMES II.5 Card
PCMCIA Info: "Linksys" "WCF54G_Wireless-G_CompactFlash_Card"
Manufacture ID: 0156,0004
Based on Agere Systems Linux LKM Wireless Driver Source Code,
Version 7.22; complies with Open Source BSD License.
=======================================================================
DESCRIPTION
The software is a modified version of wl_lkm_722_abg.tar.gz from the
Agere Systems website, addapted for Ubuntu 9.04.
Modified for kernel 2.6 by Henk de Groot <pe1dnn@amsat.org>
Based on 7.18 version by Andrey Borzenkov <arvidjaar@mail.ru> $Revision: 39 $
INSTALLATION
Unpack in a new directory.
Open a terminal screen.
Change directory to the source directory
Type command
make
and wait until it is finshed. Now you have build the module
wlags49_h2_cs; this module is meant for a HERMES II card.
The driver is tested with a Thomson SpeedTouch 110 Wireless PC Card.
For the test Station mode was used with WEP. The driver is supposed
to support WAP and as accesspoint that is NOT tested.
If you have a card using the HERMES II.5 chip you have to make
changes to the Makefile and uncomment -DHERMES25. This will build
driver wlags49_h25_cs.
Note: You can determine the type with command "pccardctrl info"
MANIFID: 0156,0002 = HERMES - not supported by this driver
MANIFID: 0156,0003 = HERMES II (Wireless B)
MANIFID: 0156,0004 = HERMES II.5 (Wireless B/G)
After successful compile type command
sudo make install
to install the module.
Now the card should be recognized. It should be able to configure
and use the card with NetworkManager. Wpa_supplicant also works, as does
manual configuration using the iwconfig/iwlist programs.
Note: I only tested Station mode with WEP but if I didn't break anything
WPA and AP mode should also work; note however that WPA was experimental
in the original Agere driver!
Note: to compile as AP change the makefile and remove the line
-DSTA_ONLY \
(or comment it, but in that case make sure to move it after all the
flags you want to use)
CHANGES
The HCF functions to control the card are virtually unchanged, the only
changes are meant to fix compiler warnings. The only real change is in
HCF_WAIT_WHILE which now has a udelay(2) added to give a small delay.
The linux driver files (wl_xxxx.c) are changed in the following ways:
- Addaptations of Andrey Borzenkov applied to 7.22 source
- Alterations to avoid most HCF_ASSERTs
-- Switching interrupts off and on in the HCF
-- Bugfixes, things that were apparently wrong like reporting link status
change which checked a variable that was not changed in HCF anymore.
-- Used on WEP but setting keys via SIOCSIWENCODEEXT was not supported
-- Recovery actions added
The major problem was the order in which calls can be made. The original
looks like a traditional UNIX driver. To call an "ioctl" function you
have to "open" the device first to get a handle and after "close" no
"ioctl" function can be called anymore. With the 2.6 driver this all
changed; the former ioctl functions are now called before "open" and
after "close", which was not expected. One of the problems was enable/
disable of interrupts in the HCF. Interrupt handling starts at "open"
so if a former "ioctl" routine is called before "open" or after "close"
then nothing should be done with interrupt switching in the HCF. Once
this was solved most HCF_ASSERTS went away.
The last point, recovery actions added, needs some clarification.
Starting the card works most of the time, but unfortunately not always.
At a few times recovery code was added; when the card starts to
misbehave or the communication between the HCF and the card is
out of sync and the HCF enters DEFUNCT mode everything is reset and
reinitialized. Note, hcf.c contains a lot of documentation. It takes
some time but slowly some things become clear. Also some unresolved
issues are mentioned in hcf.c, so there are still unknown bugs.
The card problems are almost in all cases when starting up and before
the first association with an AP, once the card is in operation it
seems to stay that way; when debugging no HCF_ASSERTS appear anymore.
Note: some HCF_ASSERTS still appear, in a number of cases it is a real
error, for example at card removal the missing card is detected.
LICENSE
The Agere Systems license applies. This is why I include the original
README.wlags49. The instructions in that file are bogus now. I also
include the man page. Even though setting parameters on the module
does not work anymore but it provides some information about all the
settings.
I have no personal contact with Agere, but others have. Agere
agreed to make their software available under the BSD license.
This driver is based on the 7.22 version.
The following was mailed by Agere to Andrey Borzenkov about this:
--- Begin Message ---
* From: TJ <tj@xxxxxxxxxxx>
* Date: Mon, 05 Feb 2007 19:28:59 +0000
Hi Andrey,
I've got some good news for you/us/the world of Hermes :)
I got a reply from the legal representative at Agere confirming that
their source-code is BSD licensed, and I've included the contents of the
email here.
I hope this re-assures you so that your excellent work on the drivers
can be made widely available for other hackers to work with.
Regards,
TJ.
---------
On Mon, 2007-02-05 at 13:54 -0500, Pathare, Viren M (Viren) wrote:
"I would like to confirm that the two drivers; Linux LKM Wireless Driver
Source Code, Version 7.18 and Linux LKM Wireless Driver Source Code,
Version 7.22 comply with Open Source BSD License. Therefore the source
code can be distributed in unmodified or modified form consistent with
the terms of the license.
The Linux driver architecture was based on two modules, the MSF (Module
specific functions) and the HCF (Hardware Control Functions). Included
in the HCF is run-time firmware (binary format) which is downloaded into
the RAM of the Hermes 1/2/2.5 WMAC.
This hex coded firmware is not based on any open source software and
hence it is not subject to any Open Source License. The firmware was
developed by Agere and runs on the DISC processor embedded within the
Hermes 1/2/2.5 Wireless MAC devices.
Hope this helps.
Sincerely,
Viren Pathare
Intellectual Property Licensing Manager
Agere"
--- End Message ---
此差异已折叠。
First of all, the best thing would be that this driver becomes obsolete by
adding support for Hermes II and Hermes II.5 cards to the existing orinoco
driver. The orinoco driver currently only supports Hermes I based cards.
Since this will not happen by magic and has not happened until now this
driver provides a stop-gap solution for these type of cards.
Having said that, the following wishlist comes to mind to make the driver
suitable as fully supported kernel driver. Feel free to expand/enhance the
list.
TODO:
- verify against a Hermes II.5 card
- verify with WPA encryption (both with H2 and H2.5 cards)
- sometimes the card does not initialize correctly, retry mechanisms
are built in to catch most cases but not all
- once the driver runs it is very stable, but I have the impression
that some of the critical sections take some time.
- the driver is split into a Hermes II and a Hermes II.5 part, it
would be nice to handle both with one module instead of two
- review by the wireless developer community
- verify the code against the coding standards for a proper linux
driver
- resolve license issues (?)
DONE:
- verified against a Hermes II card (Thomson Speedtouch 110 PCMCIA
card)
- verified with WEP encryption
Please send any patches or complaints about this driver to Greg
Kroah-Hartman <greg@kroah.com> and Cc: Henk de Groot <pe1dnn@amsat.org>
Don't bother the upstream wireless kernel developers about it, they
want nothing to do with it.
These sources are shared with the wlags49_h25 driver. Some files are even
exclusively used by that driver. Do not delete them here without looking
at that other driver.
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* This file contains definitions and macros for debugging.
*
*------------------------------------------------------------------------------
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* Copyright (c) 2003 Agere Systems Inc.
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
******************************************************************************/
#ifndef _DEBUG_H
#define _DEBUG_H
/* Turn on debugging here if not done with a preprocessor define */
#ifndef DBG
#define DBG 0
#else
#undef DBG
#define DBG 1
#endif /* DBG */
#if DBG
/****************************************************************************/
/* Set the level of debugging if not done with a preprocessor define. See
wl_main.c, init_module() for how the debug level translates into the
the types of messages displayed */
#ifndef DBG_LVL
#define DBG_LVL 5 /* yields nothing via init_module,
original value of 5 yields
DBG_TRACE_ON and DBG_VERBOSE_ON */
#endif /* DBG_LVL*/
#define DBG_ERROR_ON 0x00000001L
#define DBG_WARNING_ON 0x00000002L
#define DBG_NOTICE_ON 0x00000004L
#define DBG_TRACE_ON 0x00000008L
#define DBG_VERBOSE_ON 0x00000010L
#define DBG_PARAM_ON 0x00000020L
#define DBG_BREAK_ON 0x00000040L
#define DBG_RX_ON 0x00000100L
#define DBG_TX_ON 0x00000200L
#define DBG_DS_ON 0x00000400L
#define DBG_DEFAULTS (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON)
#define DBG_FLAGS(A) ((A)->DebugFlag)
#define DBG_NAME(A) ((A)->dbgName)
#define DBG_LEVEL(A) ((A)->dbgLevel)
#ifndef DBG_PRINT
# define DBG_PRINT(S...) printk(KERN_DEBUG S)
#endif /* DBG_PRINT */
#ifndef DBG_PRINTC
# define DBG_PRINTC(S...) printk(S)
#endif /* DBG_PRINTC */
#define DBG_PARAM(A, N, F, S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \
DBG_PRINT(" %s -- "F"\n", N, S); }
#define DBG_ERROR(A, S...) do { \
if (DBG_FLAGS(A) & DBG_ERROR_ON) { \
DBG_PRINT("%s:ERROR:%s ", DBG_NAME(A), __func__); \
DBG_PRINTC(S); \
} } while (0)
#define DBG_WARNING(A, S...) do { \
if (DBG_FLAGS(A) & DBG_WARNING_ON) { \
DBG_PRINT("%s:WARNING:%s ", DBG_NAME(A), __func__); \
DBG_PRINTC(S); \
} } while (0)
#define DBG_NOTICE(A, S...) do { \
if (DBG_FLAGS(A) & DBG_NOTICE_ON) { \
DBG_PRINT("%s:NOTICE:%s ", DBG_NAME(A), __func__); \
DBG_PRINTC(S); \
} } while (0)
#define DBG_TRACE(A, S...) do { \
if (DBG_FLAGS(A) & DBG_TRACE_ON) { \
DBG_PRINT("%s:%s ", DBG_NAME(A), __func__); \
DBG_PRINTC(S); \
} } while (0)
#define DBG_RX(A, S...) {if (DBG_FLAGS(A) & DBG_RX_ON) {\
DBG_PRINT(S); } }
#define DBG_TX(A, S...) {if (DBG_FLAGS(A) & DBG_TX_ON) {\
DBG_PRINT(S); } }
#define DBG_DS(A, S...) {if (DBG_FLAGS(A) & DBG_DS_ON) {\
DBG_PRINT(S); } }
#define DBG_ASSERT(C) do { \
if (!(C)) { \
DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
#C, __FILE__, __LINE__, __func__); \
} } while (0)
struct dbg_info {
char *dbgName;
int dbgLevel;
unsigned long DebugFlag;
};
extern struct dbg_info *DbgInfo;
/****************************************************************************/
#else /* DBG */
/****************************************************************************/
#define DBG_PRINT(S...)
#define DBG_PARAM(A, N, F, S...)
#define DBG_ERROR(A, S...)
#define DBG_WARNING(A, S...)
#define DBG_NOTICE(A, S...)
#define DBG_TRACE(A, S...)
#define DBG_RX(A, S...)
#define DBG_TX(A, S...)
#define DBG_DS(A, S...)
#define DBG_ASSERT(C)
#endif /* DBG */
/****************************************************************************/
#endif /* _DEBUG_H */
/**************************************************************************************************************
*
* FILE : DHF.C
*
* DATE : $Date: 2004/07/19 08:16:14 $ $Revision: 1.2 $
* Original : 2004/05/28 14:05:34 Revision: 1.36 Tag: hcf7_t20040602_01
* Original : 2004/05/11 06:22:57 Revision: 1.32 Tag: hcf7_t7_20040513_01
* Original : 2004/04/15 09:24:42 Revision: 1.28 Tag: hcf7_t7_20040415_01
* Original : 2004/04/08 15:18:16 Revision: 1.27 Tag: t7_20040413_01
* Original : 2004/04/01 15:32:55 Revision: 1.25 Tag: t7_20040401_01
* Original : 2004/03/10 15:39:28 Revision: 1.21 Tag: t20040310_01
* Original : 2004/03/04 11:03:37 Revision: 1.19 Tag: t20040304_01
* Original : 2004/03/02 09:27:11 Revision: 1.17 Tag: t20040302_03
* Original : 2004/02/24 13:00:28 Revision: 1.15 Tag: t20040224_01
* Original : 2004/02/19 10:57:28 Revision: 1.14 Tag: t20040219_01
* Original : 2003/11/27 09:00:09 Revision: 1.3 Tag: t20021216_01
*
* AUTHOR : John Meertens
* Nico Valster
*
* SPECIFICATION: ........
*
* DESC : generic functions to handle the download of NIC firmware
* Local Support Routines for above procedures
*
* Customizable via HCFCFG.H, which is included by HCF.H
*
*
* DHF is (intended to be) platform-independent.
* DHF is a module that provides a number of routines to download firmware
* images (the names primary, station, access point, secondary and tertiary
* are used or have been used) to volatile or nonvolatile memory
* in WaveLAN/IEEE NICs. To achieve this DHF makes use of the WaveLAN/IEEE
* WCI as implemented by the HCF-module.
*
* Download to non-volatile memory is used to update a WaveLAN/IEEE NIC to new
* firmware. Normally this will be an upgrade to newer firmware, although
* downgrading to older firmware is possible too.
*
* Note: relative to Asserts, the following can be observed:
* Since the IFB is not known inside the routine, the macro HCFASSERT is replaced with MMDASSERT.
* Also the line number reported in the assert is raised by FILE_NAME_OFFSET (10000) to discriminate the
* DHF Asserts from HCF and MMD asserts.
*
***************************************************************************************************************
*
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* COPYRIGHT (C) 1999 - 2000 by Lucent Technologies. All Rights Reserved
* COPYRIGHT (C) 2001 - 2004 by Agere Systems Inc. All Rights Reserved
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*
**************************************************************************************************************/
#include "hcf.h"
#include "hcfdef.h"
#include "dhf.h"
#include "mmd.h"
/* to distinguish MMD from HCF asserts by means of line number */
#undef FILE_NAME_OFFSET
#define FILE_NAME_OFFSET MMD_FILE_NAME_OFFSET
/*-----------------------------------------------------------------------------
*
* Defines, data structures, and global variables
*
*---------------------------------------------------------------------------*/
/* 12345678901234 */
static char signature[14] = "FUPU7D37dhfwci";
/*-----------------------------------------------------------------------------
*
* LTV-records retrieved from the NIC to:
* - determine compatibility between NIC and image
* - ((setup the buffer size dynamically for non-volatile download (see note below) ))
* - supply plugging information contained in the PDA (H-I only)
*
*---------------------------------------------------------------------------*/
/* for USB/H1 we needed a smaller value than the CFG_DL_BUF_STRCT reported 8192
for the time being it seems simpler to always use 2000 for USB/H1 as well as all other cases rather than
using the "fixed anyway" CFG_DL_BUF_STRCT. */
#define DL_SIZE 2000
/* CFG_IDENTITY_STRCT pri_identity = { LOF(CFG_IDENTITY_STRCT), CFG_PRI_IDENTITY }; */
static CFG_SUP_RANGE_STRCT mfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_MFI_SUP_RANGE };
static CFG_SUP_RANGE_STRCT cfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_CFI_SUP_RANGE };
/* Note: could be used rather than the above explained and defined DL_SIZE if need arises
* CFG_DL_BUF_STRCT dl_buf = { LOF(CFG_DL_BUF_STRCT), CFG_DL_BUF };
*/
/*-----------------------------------------------------------------------------
* Array ltv_info stores NIC information (in the form of LTV-records)
* needed for download. A NULL record indicates the end of the array.
*---------------------------------------------------------------------------*/
/* The LTV_INFO_STRUCT is needed to save the sizes of the structs, because after a GET_INFO()
* the len field is changed to the real len of the RID by the called routine.
* This is only relevant if the DHF used without reloading the driver/utility.
*/
static LTV_INFO_STRUCT ltv_info[] = {
{ (LTVP)&mfi_sup, LOF(CFG_SUP_RANGE_STRCT) } ,
{ (LTVP)&cfi_sup, LOF(CFG_SUP_RANGE_STRCT) } ,
{ (LTVP) NULL, 0 }
};
/***********************************************************************************************************/
/*************************************** PROTOTYPES ******************************************************/
/***********************************************************************************************************/
static int check_comp_fw(memimage *fw);
/************************************************************************************************************
*.SUBMODULE int check_comp_fw( memimage *fw )
*.PURPOSE Checks compatibility of CFI and MFI, NIC as supplier, station/AP firmware image as supplier.
*
*.ARGUMENTS
* fw F/W image to be downloaded
*
*.RETURNS
* HFC_SUCCESS - firmware OK
* DHF_ERR_INCOMP_FW
*
*.DESCRIPTION
* This function uses compatibility and identity information that has been
* retrieved from the card which is currently inserted to check whether the
* station firmware image to be downloaded is compatible.
*.ENDDOC END DOCUMENTATION
*************************************************************************************************************/
static int
check_comp_fw(memimage *fw)
{
CFG_RANGE20_STRCT *p;
int rc = HCF_SUCCESS;
CFG_RANGE_SPEC_STRCT *i;
switch (fw->identity->typ) {
case CFG_FW_IDENTITY: /* Station F/W */
case COMP_ID_FW_AP_FAKE: /* ;?is this useful (used to be: CFG_AP_IDENTITY) */
break;
default:
MMDASSERT(DO_ASSERT, fw->identity->typ) /* unknown/unsupported firmware_type: */
rc = DHF_ERR_INCOMP_FW;
return rc; /* ;? how useful is this anyway,
* till that is sorted out might as well violate my own single exit principle
*/
}
p = fw->compat;
i = NULL;
while (p->len && i == NULL) { /* check the MFI ranges */
if (p->typ == CFG_MFI_ACT_RANGES_STA) {
i = mmd_check_comp((void *)p, &mfi_sup);
}
p++;
}
MMDASSERT(i, 0) /* MFI: NIC Supplier not compatible with F/W image Actor */
if (i) {
p = fw->compat;
i = NULL;
while (p->len && i == NULL) { /* check the CFI ranges */
if (p->typ == CFG_CFI_ACT_RANGES_STA) {
i = mmd_check_comp((void *)p, &cfi_sup);
}
p++;
}
MMDASSERT(i, 0) /* CFI: NIC Supplier not compatible with F/W image Actor */
}
if (i == NULL) {
rc = DHF_ERR_INCOMP_FW;
}
return rc;
} /* check_comp_fw */
/*-----------------------------------------------------------------------------
*
* Exported functions
*
*---------------------------------------------------------------------------*/
/*************************************************************************************************************
*
*.MODULE int dhf_download_binary( void *ifbp, memimage *fw )
*.PURPOSE Downloads a complete (primary, station, or access point) firmware image to the NIC.
*
*.ARGUMENTS
* ifbp address of the Interface Block
* fw F/W image to be downloaded
*
*.RETURNS
* HCF_SUCCESS - download completed successfully.
* DHF_ERR_INCOMP_FW - firmware not compatible
*
*.DESCRIPTION
* Initialize global variables
* Connect to the DHF
* Check the compatibility of the image (For primary firmware images it is checked first
* whether download is necessary).
* If everything's download the firmware.
* Disconnect from the DHF.
*
*
*.DIAGRAM
*
*.NOTICE:
MMDASSERT is unacceptable because some drivers call dhf_download_binary before hcf_connect
* The old comment was:
*.ENDDOC END DOCUMENTATION
*************************************************************************************************************/
int
dhf_download_binary(memimage *fw)
{
int rc = HCF_SUCCESS;
CFG_PROG_STRCT *p;
int i;
/* validate the image */
for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++)
; /* NOP */
if (i != sizeof(signature) ||
fw->signature[i] != 0x01 ||
/* test for Little/Big Endian Binary flag */
fw->signature[i+1] != (/* HCF_BIG_ENDIAN ? 'B' : */ 'L'))
rc = DHF_ERR_INCOMP_FW;
else { /* Little Endian Binary format */
fw->codep = (CFG_PROG_STRCT FAR*)((char *)fw->codep + (hcf_32)fw);
fw->identity = (CFG_IDENTITY_STRCT FAR*)((char *)fw->identity + (hcf_32)fw);
fw->compat = (CFG_RANGE20_STRCT FAR*)((char *)fw->compat + (hcf_32)fw);
for (i = 0; fw->p[i]; i++)
fw->p[i] = ((char *)fw->p[i] + (hcf_32)fw);
p = fw->codep;
while (p->len) {
p->host_addr = (char *)p->host_addr + (hcf_32)fw;
p++;
}
}
return rc;
} /* dhf_download_binary */
/*************************************************************************************************************
*
*.MODULE int dhf_download_fw( void *ifbp, memimage *fw )
*.PURPOSE Downloads a complete (primary or tertiary) firmware image to the NIC.
*
*.ARGUMENTS
* ifbp address of the Interface Block
* fw F/W image to be downloaded
*
*.RETURNS
* HCF_SUCCESS - download completed successfully.
* HCF_ERR_NO_NIC - no NIC present
* DHF_ERR_INCOMP_FW - firmware not compatible
*
*.DESCRIPTION
* - check the signature of the image
* - get the compatibility information from the components on the NIC
* - Primary Firmware Identity
* - Modem - Firmware I/F
* - Controller - Firmware I/F
*!! - if necessary ( i.e. H-I) get the PDA contents from the NIC
* - check the compatibility of the MFI and CFI of the NIC with the F/W image
* Note: the Primary F/W compatibility is only relevant for the "running" HCF and is already verified in
* hcf_connect
*!! - if necessary ( i.e. H-I)
*!! - verify the sumcheck of the PDA
*!! - plug the image (based on the PDA and the default plug records)
* - loop over all the download LTVs in the image which consists of a sequence of
* - CFG_PROG_VOLATILE/CFG_PROG_NON_VOLATILE
* - 1 or more sequences of CFG_PROG_ADDR, CFG_PROG_DATA,....,CFG_PROG_DATA
* - CFG_PROG_STOP
*
*.DIAGRAM
*
*.NOTICE
* The old comment was:
* // Download primary firmware if necessary and allowed. This is done silently (without telling
* // the user) and only if the firmware in the download image is newer than the firmware in the
* // card. In Major version 4 of the primary firmware functions of Hermes and Shark were
* // combined. Prior to that two separate versions existed. We only have to download primary
* // firmware if major version of primary firmware in the NIC < 4.
* // download = pri_identity.version_major < 4;
* // if ( download ) {
* // rc = check_comp_primary( fw );
* // }
* It is my understanding that Pri Variant 1 must be updated by Pri Variant 2. The test on
* major version < 4 should amount to the same result but be "principally" less correct
* In deliberation with the Architecture team, it was decided that this upgrade for old H-I
* NICs, is an aspect which belongs on the WSU level not on the DHF level
*
*.ENDDOC END DOCUMENTATION
*************************************************************************************************************/
int
dhf_download_fw(void *ifbp, memimage *fw)
{
int rc = HCF_SUCCESS;
LTV_INFO_STRUCT_PTR pp = ltv_info;
CFG_PROG_STRCT *p = fw->codep;
LTVP ltvp;
int i;
MMDASSERT(fw != NULL, 0)
/* validate the image */
for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++)
; /* NOP */
if (i != sizeof(signature) ||
fw->signature[i] != 0x01 ||
/* check for binary image */
(fw->signature[i+1] != 'C' && fw->signature[i+1] != (/*HCF_BIG_ENDIAN ? 'B' : */ 'L')))
rc = DHF_ERR_INCOMP_FW;
/* Retrieve all information needed for download from the NIC */
while ((rc == HCF_SUCCESS) && ((ltvp = pp->ltvp) != NULL)) {
ltvp->len = pp++->len; /* Set len to original len. This len is changed to real len by GET_INFO() */
rc = GET_INFO(ltvp);
MMDASSERT(rc == HCF_SUCCESS, rc)
MMDASSERT(rc == HCF_SUCCESS, ltvp->typ)
MMDASSERT(rc == HCF_SUCCESS, ltvp->len)
}
if (rc == HCF_SUCCESS)
rc = check_comp_fw(fw);
if (rc == HCF_SUCCESS) {
while (rc == HCF_SUCCESS && p->len) {
rc = PUT_INFO(p);
p++;
}
}
MMDASSERT(rc == HCF_SUCCESS, rc)
return rc;
} /* dhf_download_fw */
#ifndef DHF_H
#define DHF_H
/**************************************************************************************************************
*
* FILE : DHF.H
*
* DATE : $Date: 2004/07/19 08:16:14 $ $Revision: 1.2 $
* Original : 2004/05/17 07:33:13 Revision: 1.25 Tag: hcf7_t20040602_01
* Original : 2004/05/11 06:03:14 Revision: 1.24 Tag: hcf7_t7_20040513_01
* Original : 2004/04/15 09:24:42 Revision: 1.22 Tag: hcf7_t7_20040415_01
* Original : 2004/04/09 14:35:52 Revision: 1.21 Tag: t7_20040413_01
* Original : 2004/04/01 15:32:55 Revision: 1.18 Tag: t7_20040401_01
* Original : 2004/03/10 15:39:28 Revision: 1.15 Tag: t20040310_01
* Original : 2004/03/04 11:03:38 Revision: 1.13 Tag: t20040304_01
* Original : 2004/02/25 14:14:37 Revision: 1.11 Tag: t20040302_03
* Original : 2004/02/24 13:00:28 Revision: 1.10 Tag: t20040224_01
* Original : 2004/02/19 10:57:28 Revision: 1.8 Tag: t20040219_01
*
* AUTHOR : John Meertens
* Nico Valster
*
* SPECIFICATION: .........
*
* DESC : structure definitions and function prototypes for unit DHF.
*
* Customizable via HCFCFG.H, which is included indirectly via HCF.H
*
***************************************************************************************************************
*
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* COPYRIGHT (C) 1994 - 1995 by AT&T. All Rights Reserved
* COPYRIGHT (C) 1999 - 2000 by Lucent Technologies. All Rights Reserved
* COPYRIGHT (C) 2001 - 2004 by Agere Systems Inc. All Rights Reserved
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*
**************************************************************************************************************/
#ifdef _WIN32_WCE
#include <windef.h>
#endif
#include "hcf.h" /* includes HCFCFG.H too */
#ifdef DHF_UIL
#define GET_INFO(pp) uil_get_info((LTVP)pp)
#define PUT_INFO(pp) uil_put_info((LTVP)pp)
#else
#define GET_INFO(pp) hcf_get_info(ifbp, (LTVP)pp)
#define PUT_INFO(pp) hcf_put_info(ifbp, (LTVP)pp)
#endif
/*---- Defines --------------------------------------------------------------*/
#define CODEMASK 0x0000FFFFL /* Codemask for plug records */
/*---- Error numbers --------------------------------------------------------*/
#define DHF_ERR_INCOMP_FW 0x40 /* Image not compatible with NIC */
/*---- Type definitions -----------------------------------------------------*/
/* needed by dhf_wrap.c */
typedef struct {
LTVP ltvp;
hcf_16 len;
} LTV_INFO_STRUCT , *LTV_INFO_STRUCT_PTR;
/*
* Type: plugrecord
*
* Abstract: This structure represents a Plug Data Record.
*
* Description:
* This structure is used to overlay the plug records in the firmware memory image.
*/
typedef struct {
hcf_32 code; /* Code to plug */
hcf_32 addr; /* Address within the memory image to plug it in */
hcf_32 len; /* The # of bytes which are available to store it */
} plugrecord;
/*
* Type: stringrecord
*
* Abstract: This structure represents a Firmware debug/assert string
*
* Description:
* This structure is used to get assert and debug outputs in the driver and/or utility to be
* able to get more visability of the FW.
*/
#define MAX_DEBUGSTRINGS 1024
#define MAX_DEBUGSTRING_LEN 82
typedef struct {
hcf_32 id;
char str[MAX_DEBUGSTRING_LEN];
} stringrecord;
/*
* Type: exportrecord
*
* Abstract: This structure represents a Firmware export of a variable
*
* Description:
* This structure is used to get the address and name of a FW variable.
*/
#define MAX_DEBUGEXPORTS 2048
#define MAX_DEBUGEXPORT_LEN 12
typedef struct {
hcf_32 id;
char str[MAX_DEBUGEXPORT_LEN];
} exportrecord;
/* Offsets in memimage array p[] */
#define FWSTRINGS_FUNCTION 0
#define FWEXPORTS_FUNCTION 1
/*
* Type: memimage
*
* Abstract: The "root" description of a complete memory image
*
* Description:
* This type represents an entire memory image. The image is built up of several
* segments. These segments need not be contiguous areas in memory, in other words
* the image may contain 'holes'.
*
* The 'codep' field points to an array of segment_descriptor structures.
* The end of the array is indicated by a segment_descriptor of which all fields are zero.
* The 'execution' field is a 32-bit address representing the execution address
* of the firmware within the memory image. This address is zero in case of non-volatile
* memory download.
* The 'compat' field points to an array of TODO
* The end of the array is indicated by a plug record of which all fields are zero.
* The 'identity' field points to an array of TODO
* The end of the array is indicated by a plug record of which all fields are zero.
* The Hermes-I specific 'pdaplug' field points to an array of Production Data Plug record structures.
* The end of the array is indicated by a plug record of which all fields are zero.
* The Hermes-I specific 'priplug' field points to an array of Primary Information Plug record structures.
* The end of the array is indicated by a plug record of which all fields are zero.
*/
typedef struct {
char signature[14+1+1]; /* signature (see DHF.C) + C/LE-Bin/BE-Bin-flag + format version */
CFG_PROG_STRCT FAR *codep; /* */
hcf_32 execution; /* Execution address of the firmware */
void FAR *place_holder_1;
void FAR *place_holder_2;
CFG_RANGE20_STRCT FAR *compat; /* Pointer to the compatibility info records */
CFG_IDENTITY_STRCT FAR *identity; /* Pointer to the identity info records */
void FAR *p[2]; /* (Up to 9) pointers for (future) expansion
* currently in use:
* - F/W printf information
*/
} memimage;
/*-----------------------------------------------------------------------------
*
* DHF function prototypes
*
*---------------------------------------------------------------------------*/
EXTERN_C int dhf_download_fw(void *ifbp, memimage *fw); /* ifbp, ignored when using the UIL */
EXTERN_C int dhf_download_binary(memimage *fw);
/*-----------------------------------------------------------------------------
*
* Functions to be provided by the user of the DHF module.
*
*---------------------------------------------------------------------------*/
/* defined in DHF.C; see there for comments */
EXTERN_C hcf_16 *find_record_in_pda(hcf_16 *pdap, hcf_16 code);
#endif /* DHF_H */
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* This file contains DHF configuration info.
*
*------------------------------------------------------------------------------
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* Copyright (c) 2003 Agere Systems Inc.
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
******************************************************************************/
#ifndef DHFCFG_H
#define DHFCFG_H
/*-----------------------------------------------------------------------------
* File DHFCFG.H
*
* Contents: #defines for the DHF module
*
* Comments:
* Some combinations of the #defines in this file are illegal (as noted below).
* If an illegal combinations of #defines is specified a compile error is
* generated. See document DHFUG.DOC for more information.
*
* Author: John Meertens
* Date: 11-01-2000
*
* Change history:
*---------------------------------------------------------------------------*/
/* Define DHF_WCI if you want to use the WCI to access the ORiNOCO card.
Define DHF_UIL if you want to use the UIL to access the ORiNOCO card.
You must define either DHF_WCI or DHF_UIL. If neither of the two is defined
or both a compile error is generated. */
#define DHF_WCI
/* !!!#define DHF_UIL */
/* Define DHF_BIG_ENDIAN if you are working on a big endian platform.
Define DHF_LITTLE_ENDIAN if you are working on a little endian platform.
You must define either DHF_BIG_ENDIAN or DHF_LITTLE_ENDIAN. If neither of
the two is defined or both a compile error is generated. */
#ifdef USE_BIG_ENDIAN
#define DHF_BIG_ENDIAN
#else
#define DHF_LITTLE_ENDIAN
#endif /* USE_BIG_ENDIAN */
/* Define DHF_WIN if you are working on Windows platform.
Define DHF_DOS if you are working on DOS.
You must define either DHF_WIN or DHF_DOS. If neither of
the two is defined or both a compile error is generated.
!!!#define DHF_WIN
!!!#define DHF_DOS */
/* Define if you want the DHF to users. Not defining DHF_GET_RES_MSG
leads to a decrease in code size as message strings are not included.
!!!#define DHF_GET_RES_MSG */
/* Linux driver specific
Prevent inclusion of stdlib.h and string.h */
#define _INC_STDLIB
#define _INC_STRING
/*-----------------------------------------------------------------------------
Define one or more of the following DSF #defines if you want to implement
the related DSF-function. Function dsf_callback must allways be implemented.
See file DHF.H for prototypes of the functions. */
/* Define DSF_ALLOC if you want to manage memory allocation and de-allocation
for the DHF. If DSF_ALLOC is defined you must implement dsf_alloc and dsf_free.
!!!#define DSF_ALLOC */
/* Define DSF_CONFIRM if you want the DHF to ask the user for confirmation in a
number of situations. If DSF_CONFIRM is defined you must implement dsf_confirm.
Not defining DSF_CONFIRM leads to a decrease in code size as confirmation
strings are not included.
!!!#define DSF_CONFIRM */
/* Define DSF_DEBUG_MESSAGE if you want debug messages added to your output.
If you define DSF_DEBUG_MESSAGE then you must implement function
dsf_debug_message.
#define DSF_DEBUG_MESSAGE */
/* Define DSF_ASSERT if you want asserts to be activated.
If you define DSF_ASSERT then you must implement function dsf_assert.
#define DBG 1
#define DSF_ASSERT */
/* Define DSF_DBWIN if you want asserts and debug messages to be send to a debug
window like SOFTICE or DebugView from SysInternals.
!!!#define DSF_DBWIN
!!! Not implemented yet! */
/* Define DSF_VOLATILE_ONLY if you only wants to use valatile functions
This is a typical setting for a AP and a driver. */
#define DSF_VOLATILE_ONLY
/* Define DSF_HERMESII if you want to use the DHF for the Hermes-II */
#ifdef HERMES2
#define DSF_HERMESII
#else
#undef DSF_HERMESII
#endif /* HERMES2 */
/* Define DSF_BINARY_FILE if you want to use the DHF in combination with
reading the Firmware from a separate binary file.
!!!#define DSF_BINARY_FILE */
#endif /* DHFCFG_H */
此差异已折叠。
#ifndef HCF_H
#define HCF_H 1
/************************************************************************************************************
*
* FILE : hcf.h
*
* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.7 $
* Original: 2004/05/19 07:26:01 Revision: 1.56 Tag: hcf7_t20040602_01
* Original: 2004/05/12 08:47:23 Revision: 1.53 Tag: hcf7_t7_20040513_01
* Original: 2004/04/15 09:24:42 Revision: 1.46 Tag: hcf7_t7_20040415_01
* Original: 2004/04/08 15:18:16 Revision: 1.45 Tag: t7_20040413_01
* Original: 2004/04/01 15:32:55 Revision: 1.43 Tag: t7_20040401_01
* Original: 2004/03/10 15:39:28 Revision: 1.39 Tag: t20040310_01
* Original: 2004/03/04 11:03:38 Revision: 1.37 Tag: t20040304_01
* Original: 2004/03/02 14:51:21 Revision: 1.35 Tag: t20040302_03
* Original: 2004/02/24 13:00:28 Revision: 1.28 Tag: t20040224_01
* Original: 2004/02/09 14:50:14 Revision: 1.26 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* SPECIFICATION: ..........
*
* DESC : Definitions and Prototypes for MSF as well as HCF sources
*
* Customizable via HCFCFG.H
*
*
**************************************************************************************************************
**************************************************************************************************************
*
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*
*************************************************************************************************************/
#include "hcfcfg.h" // System Constants to be defined by the MSF-programmer to tailor the HCF
#include "mdd.h" // Include file common for HCF, MSF
/************************************************************************************************/
/************************************** MACROS ************************************************/
/************************************************************************************************/
#define LOF(x) (sizeof(x)/sizeof(hcf_16)-1)
/* Endianness
* Little Endian (a.k.a. Intel), least significant byte first
* Big Endian (a.k.a. Motorola), most significant byte first
*
* The following macros are supplied
* o CNV_LITTLE_TO_SHORT(w) interprets the 16-bits input value as Little Endian, returns an hcf_16
* o CNV_BIG_TO_SHORT(w) interprets the 16-bits input value as Big Endian, returns an hcf_16
*
*/
/* To increase portability, use unsigned char and unsigned char * when accessing parts of larger
* types to convert their Endianness
*/
#define CNV_END_SHORT(w) (hcf_16)( ((hcf_16)(w) & 0x00FF) << 8 | ((hcf_16)(w) & 0xFF00) >> 8 )
#define CNV_END_LONG(dw) (hcf_32)( (dw >> 24) | ((dw >> 8) & 0xff00) | ((dw << 8) & 0xff0000) | (dw << 24) )
#if HCF_BIG_ENDIAN
//******************************************** B I G E N D I A N *******************************************
#define CNV_LITTLE_TO_SHORT(w) CNV_END_SHORT(w) // endianness conversion needed
#define CNV_BIG_TO_SHORT(w) (w) // no endianness conversion needed
#define CNV_LITTLE_TO_LONG(dw) CNV_END_LONG(dw)
#define CNV_LONG_TO_LITTLE(dw) CNV_END_LONG(dw)
#else
//****************************************** L I T T L E E N D I A N ****************************************
#define CNV_LITTLE_TO_SHORT(w) (w) // no endianness conversion needed
#define CNV_BIG_TO_SHORT(w) CNV_END_SHORT(w) // endianness conversion needed
#define CNV_LITTLE_TO_LONG(dw) (dw)
#define CNV_LONG_TO_LITTLE(dw) (dw)
#if defined HCF_ALIGN && HCF_ALIGN > 1
#define CNV_SHORTP_TO_LITTLE(pw) ((hcf_16)(*(hcf_8 *)pw)) | ((hcf_16)(*((hcf_8 *)pw+1)) << 8)
#define CNV_LONGP_TO_LITTLE(pdw) ((hcf_32)(*(hcf_8 *)pdw)) | ((hcf_32)(*((hcf_8 *)pdw+1)) << 8) | \
((hcf_32)(*((hcf_8 *)pdw+2)) << 16) | ((hcf_32)(*((hcf_8 *)pdw+3)) << 24)
#else
#define CNV_LONGP_TO_LITTLE(pdw) (*(hcf_32 *)pdw)
#define CNV_SHORTP_TO_LITTLE(pw) (*(hcf_16 *)pw)
#endif
#endif // HCF_BIG_ENDIAN
// conversion macros which can be expressed in other macros
#define CNV_SHORT_TO_LITTLE(w) CNV_LITTLE_TO_SHORT(w)
#define CNV_SHORT_TO_BIG(w) CNV_BIG_TO_SHORT(w)
/************************************************************************************************/
/************************************** END OF MACROS *****************************************/
/************************************************************************************************/
/***********************************************************************************************************/
/***************** ****************************************/
/***********************************************************************************************************/
// offsets Transmit/Receive Frame Structure
#define HFS_STAT 0x0000
#define HFS_SWSUP 0x0006 //SW Support
#define HFS_Q_INFO 0x0006 //Signal/Silence level
#define HFS_RATE 0x0008 //RxFlow/Rate
#define HFS_STAT_ERR RX_STAT_ERR //link "natural" HCF name to "natural" MSF name
#define HFS_TX_CNTL 0x0036
// H-I H-II
#define HFS_DAT_LEN (HFS_ADDR_DEST - 2) // 0x002C 0x0038
#define HFS_ADDR_DEST 0x003A // 0x002E 0x003A
#define HFS_ADDR_SRC (HFS_ADDR_DEST + 6) // 0x0034 0x0040
#define HFS_LEN (HFS_ADDR_SRC + 6) // 0x003A 0x0046
#define HFS_DAT (HFS_LEN + 2) // 0x003C 0x0048
#define HFS_TYPE (HFS_DAT + 6) // 0x0042 0x004E
//============================= D E S C R I P T O R S T R U C T U R E ==============================
//;?MDD.H stuff ;?
#if HCF_BIG_ENDIAN
#define DESC_STRCT_CNT 0
#define DESC_STRCT_SIZE 1
#else
#define DESC_STRCT_CNT 1
#define DESC_STRCT_SIZE 0
#endif // HCF_BIG_ENDIAN
#define BUF_CNT buf_dim[DESC_STRCT_CNT]
#define BUF_SIZE buf_dim[DESC_STRCT_SIZE]
typedef struct DESC_STRCT {
hcf_16 buf_dim[2];
hcf_32 buf_phys_addr;
hcf_32 next_desc_phys_addr; // physical address of next descriptor
hcf_32 desc_phys_addr; // physical address of this descriptor
struct DESC_STRCT *next_desc_addr;
hcf_8 FAR *buf_addr;
#if (HCF_EXT) & HCF_EXT_DESC_STRCT
void FAR *DESC_MSFSup; // pointer for arbitrary use by the MSF
#endif // HCF_DESC_STRCT_EXT
} DESC_STRCT;
#define HCF_DASA_SIZE 12 //size in bytes for DA/SA
#define DESC_CNT_MASK 0x0FFF
#define GET_BUF_SIZE(descp) ((descp)->BUF_SIZE)
#define GET_BUF_CNT(descp) ((descp)->BUF_CNT)
#define SET_BUF_SIZE(descp, size) (descp)->BUF_SIZE = size;
#define SET_BUF_CNT(descp, count) (descp)->BUF_CNT = count;
//========================================= T A L L I E S ===================================================
typedef struct { //Hermes Tallies (IFB substructure)
hcf_32 TxUnicastFrames;
hcf_32 TxMulticastFrames;
hcf_32 TxFragments;
hcf_32 TxUnicastOctets;
hcf_32 TxMulticastOctets;
hcf_32 TxDeferredTransmissions;
hcf_32 TxSingleRetryFrames;
hcf_32 TxMultipleRetryFrames;
hcf_32 TxRetryLimitExceeded;
hcf_32 TxDiscards;
hcf_32 RxUnicastFrames;
hcf_32 RxMulticastFrames;
hcf_32 RxFragments;
hcf_32 RxUnicastOctets;
hcf_32 RxMulticastOctets;
hcf_32 RxFCSErrors;
hcf_32 RxDiscardsNoBuffer;
hcf_32 TxDiscardsWrongSA;
hcf_32 RxWEPUndecryptable;
hcf_32 RxMsgInMsgFragments;
hcf_32 RxMsgInBadMsgFragments;
hcf_32 RxDiscardsWEPICVError;
hcf_32 RxDiscardsWEPExcluded;
#if (HCF_EXT) & HCF_EXT_TALLIES_FW
hcf_32 TalliesExtra[32];
#endif // HCF_EXT_TALLIES_FW
} CFG_HERMES_TALLIES_STRCT;
typedef struct { //HCF Tallies (IFB substructure)
hcf_32 NoBufInfo; //No buffer available for unsolicited Notify frame
hcf_32 NoBufMB; //No space available in MailBox
hcf_32 MiscErr; /* Command errors
* - time out on completion synchronous part Hermes Command
* - completed Hermes Command doesn't match original command
* - status of completed Hermes Command contains error bits
*/
#if (HCF_EXT) & HCF_EXT_TALLIES_FW
hcf_32 EngCnt[8];
#endif // HCF_EXT_TALLIES_FW
} CFG_HCF_TALLIES_STRCT;
//Note this way to define ..._TAL_CNT implies that all tallies must keep the same (hcf_32) size
#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
#if (HCF_TALLIES) & HCF_TALLIES_NIC //Hermes tally support
#define HCF_NIC_TAL_CNT (sizeof(CFG_HERMES_TALLIES_STRCT)/ sizeof(hcf_32))
#else
#define HCF_NIC_TAL_CNT 0
#endif // HCF_TALLIES
#if (HCF_TALLIES) & HCF_TALLIES_HCF //HCF tally support
#define HCF_HCF_TAL_CNT (sizeof(CFG_HCF_TALLIES_STRCT) / sizeof(hcf_32))
#else
#define HCF_HCF_TAL_CNT 0
#endif // HCF_TALLIES
#define HCF_TOT_TAL_CNT ( HCF_NIC_TAL_CNT + HCF_NIC_TAL_CNT )
#endif // HCF_TALLIES_NIC / HCF_TALLIES_HCF
/***********************************************************************************************************/
/********************************** I N T E R F A C E B L O C K ******************************************/
/***********************************************************************************************************/
#define IFB_VERSION 0x0E // initially 0, to be incremented by every IFB layout change
typedef struct {
hcf_io IFB_IOBase; // I/O address of Hermes chip as passed by MSF at hcf_connect call
hcf_16 IFB_IORange; // I/O Range used by Hermes chip
hcf_16 IFB_DLMode; // Download Mode state
hcf_16 IFB_Cmd; // cmd in progress flag, to be ack-ed before next cmd can be issued
hcf_16 IFB_RxFID; // FID of "current" RxFS (non-DMA mode)
//;?#if tx_delay option
hcf_16 IFB_TxFID; // fid storage during "delayed" send
//;?#endif tx_delay option
hcf_16 IFB_RxLen; //
hcf_16 IFB_DefunctStat; // BAP initialization or Cmd Completion failed
hcf_16 IFB_ErrCmd; // contents Status reg when error bits and/or mismatch in cmd_wait
hcf_16 IFB_ErrQualifier; // contents Resp0 reg when error bits and/or mismatch in cmd_wait
hcf_16 IFB_lal; // LookAhead Length
wci_bufp IFB_lap; // LookAhead Buffer pointer
hcf_16 IFB_LinkStat; // Link Status
hcf_16 IFB_DSLinkStat; // Link Status, new strategy introduced for DeepSleep
hcf_16 IFB_CarryIn; // carry and carry-flag to move 1 byte from one get_frag to the next
hcf_16 IFB_CarryOut; // carry and carry-flag to move 1 byte from one put_frag to the next
hcf_16 IFB_Version; // IFB_VERSION, incremented by every SIGNIFICANT IFB layout change
hcf_16 IFB_CardStat; // NIC error / F/W incompatibility status
hcf_16 IFB_RscInd; // non-DMA: TxFID available, DMA: always 1
hcf_16 IFB_CntlOpt; // flags: 32 bits I/O, DMA available, DMA enabled
hcf_16 IFB_BusType; // BusType, derived via CFG_NIC_BUS_TYPE
CFG_FW_IDENTITY_STRCT IFB_FWIdentity; /* keep FWIdentity/Sup and PRIIdentity/Sup in sequence
* because of the (dumb) copy in init() */
#if defined MSF_COMPONENT_ID
CFG_SUP_RANGE_STRCT IFB_FWSup;
CFG_PRI_IDENTITY_STRCT IFB_PRIIdentity;
CFG_SUP_RANGE_STRCT IFB_PRISup;
CFG_SUP_RANGE_STRCT IFB_HSISup;
#endif // MSF_COMPONENT_ID
#if (HCF_EXT) & HCF_EXT_INFO_LOG
RID_LOGP IFB_RIDLogp; // pointer to RID_LOG structure
#endif // HCF_EXT_INFO_LOG
#if HCF_PROT_TIME
hcf_32 IFB_TickIni; // initialization of S/W counter based protection loop
#endif // HCF_PROT_TIME
#if (HCF_EXT) & HCF_EXT_INT_TICK
int IFB_TickCnt; // Hermes Timer Tick Counter
#endif // HCF_EXT_INT_TICK
hcf_16 *IFB_MBp; // pointer to the MailBox
hcf_16 IFB_MBSize; // size of the MailBox
hcf_16 IFB_MBWp; // zero-based write index into the MailBox
hcf_16 IFB_MBRp; // zero-based read index into the MailBox
hcf_16 IFB_MBInfoLen; // contents of L-field of the oldest available MailBoxInfoBlock
#if (HCF_TYPE) & HCF_TYPE_WPA
hcf_16 IFB_MICTxCntl; // MIC bit and Key index in TxControl field of TxFS
hcf_32 IFB_MICTxKey[2]; // calculating key
hcf_32 IFB_MICTx[2]; // Tx MIC calculation Engine state
hcf_16 IFB_MICTxCarry; // temp length, carries over from one Tx fragment to another
hcf_16 IFB_MICRxCarry; // temp length, carries over from one Rx fragment to another
hcf_32 IFB_MICRxKey[4*2]; // 4 checking keys
hcf_32 IFB_MICRx[2]; // Rx MIC calculation Engine state
#endif // HCF_TYPE_WPA
#if HCF_ASSERT
#if (HCF_ASSERT) & HCF_ASSERT_MB
CFG_MB_INFO_RANGE1_STRCT IFB_AssertStrct; // Add some complication to the HCF as prize for the new MSF I/F
#endif // HCF_ASSERT_MB
// target of above IFB_AssertStrct
hcf_16 IFB_AssertLine; // - line number ( + encoded module name )
hcf_16 IFB_AssertTrace; // - bit based trace of all hcf_.... invocations
hcf_32 IFB_AssertQualifier; // - qualifier
hcf_16 IFB_AssertLvl; // Assert Filtering, Not yet implemented
hcf_16 IFB_AssertWhere; // Where parameter of the Assert macro
#if (HCF_ASSERT) & ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN )
MSF_ASSERT_RTNP IFB_AssertRtn; // MSF Assert Call back routine (inspired by GEF, DrDobbs Nov 1998 )
#endif // HCF_ASSERT_LNK_MSF_RTN
#if (HCF_ASSERT) & HCF_ASSERT_PRINTF // engineering facilty intended as F/W debugging aid
hcf_16 IFB_DbgPrintF_Cnt;
CFG_FW_PRINTF_BUFFER_LOCATION_STRCT IFB_FwPfBuff;
#endif // HCF_ASSERT_PRINTF
#endif // HCF_ASSERT
hcf_16 volatile IFB_IntOffCnt; // 0xFFFF based HCF_ACT_INT_OFF nesting counter, DeepSleep flag
#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF ) //Hermes and/or HCF tally support
hcf_32 IFB_Silly_you_should_align; //;?
hcf_16 IFB_TallyLen; // Tally length (to build an LTV)
hcf_16 IFB_TallyTyp; // Tally Type (to build an LTV)
#endif // HCF_TALLIES_NIC / HCF_TALLIES_HCF
#if (HCF_TALLIES) & HCF_TALLIES_NIC //Hermes tally support
CFG_HERMES_TALLIES_STRCT IFB_NIC_Tallies;
#endif // HCF_TALLIES_NIC
#if (HCF_TALLIES) & HCF_TALLIES_HCF //HCF tally support
CFG_HCF_TALLIES_STRCT IFB_HCF_Tallies;
#endif // HCF_TALLIES_HCF
#if HCF_DMA
//used for a pool of destination_address descriptor/buffers, used during tx encapsulation points to the
//first/last descriptor in the descriptor chain, so we can easily remove and append a packet.
DESC_STRCT *IFB_FirstDesc[2];
DESC_STRCT *IFB_LastDesc[2];
DESC_STRCT *IFB_ConfinedDesc[2]; // pointers to descriptor used for host reclaim purposes.
hcf_16 IFB_DmaPackets; // HREG_EV_[TX/RX]DMA_DONE flags, reports DMA Frame availability to MSF
#endif // HCF_DMA
#if (HCF_EXT) & HCF_EXT_INT_TX_EX
hcf_16 IFB_TxFsStat; // Tx message monitoring
hcf_16 IFB_TxFsGap[2]; //;?make this robust
hcf_16 IFB_TxFsSwSup;
#endif // HCF_EXT_INT_TX_EX
hcf_16 IFB_Magic; /* "Magic" signature, to help the debugger interpret a memory dump
* also the last field cleared at hcf_connect
*/
#if (HCF_EXT) & HCF_EXT_IFB_STRCT // for usage by the MSF
void FAR *IFB_MSFSup; // pointer for arbitrary use by the MSF
#endif // HCF_EXT_IFB_STRCT_EXT
} IFB_STRCT;
typedef IFB_STRCT* IFBP;
/***********************************************************************************************************/
/********************** W C I F U N C T I O N S P R O T O T Y P E S ******************************/
/***********************************************************************************************************/
EXTERN_C int hcf_action(IFBP ifbp, hcf_16 cmd);
EXTERN_C int hcf_connect(IFBP ifbp, hcf_io io_base);
EXTERN_C int hcf_get_info(IFBP ifbp, LTVP ltvp);
EXTERN_C int hcf_service_nic(IFBP ifbp, wci_bufp bufp, unsigned int len);
EXTERN_C int hcf_cntl(IFBP ifbp, hcf_16 cmd);
EXTERN_C int hcf_put_info(IFBP ifbp, LTVP ltvp);
EXTERN_C int hcf_rcv_msg(IFBP ifbp, DESC_STRCT *descp, unsigned int offset);
EXTERN_C int hcf_send_msg(IFBP ifbp, DESC_STRCT *dp, hcf_16 tx_cntl);
#if HCF_DMA
EXTERN_C void hcf_dma_tx_put(IFBP ifbp, DESC_STRCT *d, hcf_16 tx_cntl);
EXTERN_C DESC_STRCT* hcf_dma_tx_get (IFBP ifbp );
EXTERN_C DESC_STRCT* hcf_dma_rx_get (IFBP ifbp );
EXTERN_C void hcf_dma_rx_put(IFBP ifbp, DESC_STRCT *d);
#endif // HCF_DMA
#if (HCF_ASSERT) & HCF_ASSERT_LNK_MSF_RTN
EXTERN_C void msf_assert(unsigned int line_number, hcf_16 trace, hcf_32 qual);
#endif // HCF_ASSERT_LNK_MSF_RTN
#endif // HCF_H
此差异已折叠。
此差异已折叠。
.\" vim:tw=78:
.\" Copyright (c) 1999-2003 Agere Systems Inc. -- http://www.agere.com
.\" wlags49.4 7.20-abg 04/28/2004 13:30:00
.\"
.TH WLAGS49 4 "04/28/2004 13:30:00" "pcmcia-cs"
.SH NAME
wlags49 \- Agere Systems Wireless PC Card / PCI device drivers
wlags49_h2_cs.o \- Hermes-II Card Services (PCMCIA/CF) driver
.br
wlags49_h2.o \- Hermes-II MiniPCI driver
.br
wlags49_h25.o \- Hermes-II.5 PCI/CardBus driver
.br
wlags49_h25_cs.o\- Hermes-II.5 Card Services (PCMCIA/CF) driver
.SH SYNOPSIS
.nh
.fi
.B insmod wlags49_[h1,h2]_[cs].o
.br
.RB [ Authentication=n ]
.RB [ AuthKeyMngmtSuite=???? ]
.RB [ BRSC2GHz=b ]\p
.RB [ BRSC5GHz=b ]
.RB [ Coexistence=n ]
.RB [ Configured=???? ]\p
.RB [ ConnectionControl=???? ]
.RB [ CreateIBSS=s ]
.RB [ DebugFlag=n ]\p
.RB [ DesiredSSID=s ]
.RB [ DownloadFirmware=n ]
.RB [ DriverEnable=???? ]\p
.RB [ EnableEncryption=s ]
.RB [ Encryption=???? ]
.RB [ ExcludeUnencrypted=s ]\p
.RB [ IntraBSSRelay=s ]
.RB [ IrqList=i,j,... ]
.RB [ IrqMask=n ]\p
.RB [ Key1=s ]
.RB [ Key2=s ]
.RB [ Key3=s ]
.RB [ Key4=s ]\p
.RB [ LoadBalancing=s ]
.RB [ MaxSleepDuration=n ]
.RB [ MediumDistribution=s ]\p
.RB [ MicroWaveRobustness=s ]
.RB [ MulticastPMBuffering=s ]
.RB [ MulticastRate=n ]\p
.RB [ MulticastReceive=s ]
.RB [ NetworkAddress=n,n,n,n,n,n ]
.RB [ NetworkType=???? ]\p
.RB [ OwnATIMWindow=n ]
.RB [ OwnBeaconInterval=n ]
.RB [ OwnChannel=n ]\p
.RB [ OwnDTIMPeriod=n ]
.RB [ OwnName=s ]
.RB [ OwnSSID=s ]\p
.RB [ pc_debug=n ]
.RB [ PMEnabled=b ]
.RB [ PMHoldoverDuration=n ]\p
.RB [ PortType=n ]
.RB [ PowerMode=???? ]
.RB [ PromiscuousMode=s ]\p
.RB [ RejectANY=s ]
.RB [ RTSThreshold=n ]\p
.RB [ RTSThreshold1=n ]
.RB [ RTSThreshold2=n ]
.RB [ RTSThreshold3=n ]\p
.RB [ RTSThreshold4=n ]
.RB [ RTSThreshold5=n ]
.RB [ RTSThreshold6=n ]\p
.RB [ SRSC2GHz=b ]
.RB [ SRSC5GHz=b ]
.RB [ SystemScale=n ]\p
.RB [ TxKey=n ]
.RB [ TxRateControl=n ]\p
.RB [ TxRateControl1=n ]
.RB [ TxRateControl2=n ]
.RB [ TxRateControl3=n ]\p
.RB [ TxRateControl4=n ]
.RB [ TxRateControl5=n ]
.RB [ TxRateControl6=n ]\p
.RB [ WDSAddress=n,n,n,n,n,n ]\p
.RB [ WDSAddress1=n,n,n,n,n,n ]
.RB [ WDSAddress2=n,n,n,n,n,n ]\p
.RB [ WDSAddress3=n,n,n,n,n,n ]
.RB [ WDSAddress4=n,n,n,n,n,n ]\p
.RB [ WDSAddress5=n,n,n,n,n,n ]
.RB [ WDSAddress6=n,n,n,n,n,n ]\p
.fi
.SH DESCRIPTION
.I wlags49
is the low-level Card Services / PCI driver for the
.B Wireless PC Card, Wireless Integrated Card, Wireless Embedded Card
and other wireless adapters based on the Agere Systems Hermes-II, and Hermes-II.5 wireless MAC. When this driver is attached to a card, it
allocates the next available ethernet device (eth0..eth#). This
device name will be passed on to
.IR cardmgr (8),
or the PCI subsystem, for the card configuration, and reported in the kernel log file
with the I/O base address and MAC address used by the card.
.SH FEATURES
\- Hot plug/unplug
\- Access Point and peer-to-peer communication
\- Card power management
\- Support for Hermes-II & Hermes-II.5 based PCMCIA, Mini PCI, and CardBus cards
\- Wired Equivalent Privacy (WEP)
\- WPA-PSK support
\- Driver utility interface (UIL)
\- Wireless Extensions
\- Software AP mode
.SH PARAMETERS
.TP
.B Authentication=n
Algorithm used for Authentication.
.BR
1 \- Open System
.BR
2 \- Shared Key
.BR
Default: 1
.TP
.B Auth_key_mgmt_suite
???????????????
.TP
.B BRSC2GHz=b
Sets the card\'s Basic Rate Set in the 2.4GHz band. See SRSC2GHz
for the value\'s format.
.BR
Default: 15 (or 0x000F, only 11b rates to accept legacy 11b stations)
.TP
.B BRSC5GHz-b
Sets the card\'s Basic Rate Set in the 5.0GHz band. See SRSC2GHz for the
value\'s format
.BR
Default: 4080 (or 0x0FF0, all 11a rates)
.TP
.B Coexistence=n
Used to make the 802.11a/b/g coexistence behavior more strict.
.BR
Default \- 0 (Use standard behavior)
.TP
.B ConnectionControl=n
Configures the card\'s connection control process in dealing with multiple
bands (802.11b/g vs. 802.11a).
.BR
0 \- Single Band operation in 2GHz
.BR
1 \- Single Band operation in 5GHz
.BR
2 \- Multiple Band operation starting with 2GHz
.BR
3 \- Multiple Band operation starting with 5GHz
.BR
Default \- 2
.TP
.B Configured
???????????????
.TP
.B ConnectionControl
???????????????
.TP
.B CreateIBSS=s
Enable or disable IBSS Creation.
For correct operation, specification of a OwnSSID is required.
This mode requires firmware 6.04 or higher.
.BR
N \- Disable
.BR
Y \- Enable
.BR
Default: N
.TP
.B DebugFlag=n
Selects the driver debugging level. This parameter is only available
if the module is compiled with debugging enabled. Refer to the
file
.B debug.h
in the source directory for information on the flag values.
.BR
0x00000001L \- DBG_ERROR_ON
.BR
0x00000002L \- DBG_WARNING_ON
.BR
0x00000004L \- DBG_NOTICE_ON
.BR
0x00000008L \- DBG_TRACE_ON
.BR
0x00000010L \- DBG_VERBOSE_ON
.BR
0x00000020L \- DBG_PARAM_ON
.BR
0x00000040L \- DBG_BREAK_ON
.BR
0x00000100L \- DBG_RX_ON
.BR
0x00000200L \- DBG_TX_ON
.BR
0x00000400L \- DBG_DS_ON
.BR
If the module is compiled with debugging enabled, DebugFlag
defaults to DBG_ERROR_ON, DBG_WARNING_ON and DBG_BREAK_ON.
DebugFlag overrules pc_debug.
.TP
.B DesiredSSID=s
Same as OwnSSID.
.TP
.B DownloadFirmware=n
This release of the driver introduces the ability to perform downloads of the STA/AP
firmware. In fact, this is required for Hermes-II based cards. This parameter tells
the driver which version of the firmware to download to the card.
.BR
0 \- No download performed (Hermes-I only)
.BR
1 \- Download STA firmware
.BR
2 \- Download AP firmware
.BR
Default: 1, when STA mode functionality is
included in the build
2, when code is built exclusively for
AP mode
.TP
.B DriverEnable
???????????????
.TP
.B EnableEncryption=n
Set the method of Data encryption.
.BR
0 \- Disable
.BR
1 \- Enable WEP Encryption
.BR
2 \- Enable WPA with TKIP encryption
.BR
Default: 0
.TP
.B Encryption
???????????????
.TP
.B ExcludeUnencrypted=s
Controls how the stations must communicate with the AP.
.BR
Y \- Stations must enable encryption and provide
the proper encryption key to communicate
with the AP.
.BR
N \- Stations do not need to enable encryption
to communicate with the AP.
.BR
Default: N
.TP
.B IntraBSSRelay=s
Controls the automatic relay of received messages that are destined for other
stations in the BSS.
.BR
Y \- Messages are relayed to the appropriate
station(s).
.BR
N \- Messages are passed up to the host.
.BR
Default: Y
.TP
.B IrqList=i,j,...
Specifies the set of interrupts (up to 4) that may be allocated by
this driver. This overrides the values set in the
.B IrqMask
parameter. NOTE: This parameter is for PCMCIA only.
.TP
.B IrqMask=n
Specifies a mask of valid interrupts that may be allocated by this driver.
If
.B IrqList
is also specified, the values in
.B IrqList
are used instead. NOTE: This parameter is for PCMCIA only.
.BR
Default: 0xdeb8 (IRQ 3,4,5,7,9,10,11,12,14,15)
.TP
.B Key1=s
Specifies one of 4 possible keys for the Data encryption.
One of these keys, identified by TxKey,
is used for the enciphering of Data that is transmitted by this station.
All keys specified can be used for the deciphering of Data that is received.
.BR
The key value can be an ASCII character string or a hexadecimal value.
The length of the key value can be 5 characters or 10 hexadecimal digits for
the standard encryption (Silver or Gold card), or 13 characters or 26
hexadecimal digits for the encryption with extended keys (Gold card only).
The keys defined in the station must match the keys defined in the access
points; both on value and number (1 through 4).
.BR
In 2.0 series Linux kernel modules, values that begin with a number are
considered integers. In this case a hexadecimal value string or a character
string starting with a number, will need to be surrounded by escaped
double quotes (ie. Key1=\\"0x1122334455\\" Key2=\\"12xyz\\").
.BR
5 or 13, printable character string, or
.BR
10 or 26 hex digits if preceded by "0x".
.BR
If this parameter is omitted, the default of the MAC is used ( = 0-length).
.TP
.B Key2=s
Same as Key1.
.TP
.B Key3=s
Same as Key1.
.TP
.B Key4=s
Same as Key1.
.TP
.B LoadBalancing=s
Control for the Load Balancing algorithm for both STAs and APs. The AP
includes a load balancing element in the Probe Response and Beacon frames.
The STA uses this info to select an AP, not only based on comms quality, but
also on the load of that AP.
.BR
Default: Y
.TP
.B MaxDataLength
???????????????
.TP
.B MaxSleepDuration=n
Set the maximum Power Management sleep duration in milliseconds.
Valid values are 0 to 65535 milliseconds.
.BR
Default: 100
.TP
.B MediumDistribution=s
Control for the distribution of medium parameters, like communication
thresholds, microwave robustness, RTS/CTS thresholds, by APs. The associated
stations replace their own values with the received values.
.BR
Default=Y
.TP
.B MicroWaveRobustness=s
Enable or disable Microwave Oven Robustness.
.BR
N \- Disable
.BR
Y \- Enable
.BR
Default: N
.TP
.B MulticastPMBuffering=s
Controls buffering of multicast MAC frames for transmission after DTIM. If no,
multicast MAC frames are directly placed in the output queue.
.BR
Default: Y
.TP
.B MulticastRate=n
Sets the data rate for multicast message transmission.
.BR
1 \- Fixed 1Mb/s
2 \- Fixed 2Mb/s
3 \- Fixed 5.5Mb/s
4 \- Fixed 11Mb/s
.BR
Default: 2
For Hermes-II.5, an INTEGER CONVERTED bit mask representing the
rate to multicast, where the rates supported are as follows:
Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
.br
------------------------------------------------------
.br
Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
Default: 4 (Translates to 0x0004 = 5.5 Mb/sec)
.TP
.B MulticastReceive=s
Enable or disable receiving of all multicast packets when Card Power Management
is enabled. When enabled, the station will wake up frequently
to receive the multicast frames. This causes less optimal power savings.
.BR
N \- Disable
.BR
Y \- Enable
.BR
Default: Y
.TP
.B NetworkAddress=n,n,n,n,n,n
Sets the adapter hardware ethernet address (MAC address) to the value
specified. Note that this is to be used to specify a Local MAC address. Do
not specify this parameter if the card\'s universal address is to be used.
Valid values are six hexadecimal digit-pairs (prefixed with 0x).
.BR
Default: <factory assigned address>
.TP
.B NetworkType
???????????????
.TP
.B OwnATIMWindow=n
ATIM window time used for creating an IBSS.
.BR
Range: 0..100
.BR
Default: 0
.TP
.B OwnBeaconInterval=b
Beacon Interval in TU
.BR
Range 20..200
.BR
Default \- 100
.TP
.B channel=n
Same as OwnChannel.
.TP
.B OwnChannel=n
Sets the channel the Ad-Hoc or IBSS mode will use.
The default channel for Ad-Hoc mode is determined by the Wireless PC Card.
The default channel for IBSS is set to 10 by the driver.
This value has no effect when the adapter is used with an Access Point
(BSS network) since the Access Point automatically determines the channel.
Valid values are 0 to 14. However the channels allowed in
your region are subject to local regulations and are limited at
manufacturing time of the Wireless PC Card. When the provided value is
not allowed, the value remains unchanged.
.BR
0 \- Use default channel
.BR
Default: 0
.TP
.B OwnDTIMPeriod=n
The number of beacon intervals between successive Delivery Traffic Identification
Maps (DTIMs).
.BR
Range: 1..65535
.BR
Default: 1
.TP
.B OwnName=s
Sets the station name to the specified string value. This parameter
is used for diagnostic purposes, as a user\-friendly identification
of this system. This parameter accepts a maximum of 32 characters.
.BR
Default: Linux
.TP
.B OwnSSID=s
Sets the card network name to the specified string value. This parameter
accepts a maximum of 32 characters. Whitespace in the network name
will need to be escaped with a backslash (ie. OwnSSID=My\\ Network).
.BR
Default: ANY
.TP
.B pc_debug=n
Selects the PCMCIA debugging level. This parameter is only available
if the module is compiled with debugging enabled. A non\-zero value
enables debugging. Higher values yield more information, i.e. for any value all
lower values are implied.
.BR
8 \- DBG_DS_ON
.BR
7 \- DBG_RX_ON | DBG_TX_ON
.BR
6 \- DBG_PARAM_ON
.BR
5 \- DBG_TRACE_ON
.BR
4 \- DBG_VERBOSE_ON
.BR
If the module is compiled with debugging enabled, pc_debug defaults to 5.
DebugFlag overrules pc_debug.
.BR
The name pc_debug rather than PcDebug, since pc_debug is used by many PCMCIA driver.
.TP
.B PMEnabled=b
Sets the card\'s Power Management state.
.BR
0 \- Disable
.BR
1 \- Enable Enhanced Mode
.BR
2 \- Enabled Standard Mode
.BR
0x8000 \- Enhanced?????? Mode (to be combined with 0x0001 or 0x0002)
Default: 0 (Disabled)
.TP
.B PMHoldoverDuration=n
Time that the station remains in an awake state after a MAC frame transfer if
Enhanced Power Save is active.
.BR
Range: 1..1000
.BR
Default: 100
.TP
.B PowerMode
???????????????
.TP
.B PortType=n
Selects the type of network operation.
.BR
1 \- Normal Operation (BSS or IBSS)
.BR
3 \- Ad-Hoc Demo Mode
.BR
Default: 1
.TP
.B PromiscuousMode=s
Switch for promiscuous mode reception.
.BR
Default: N
.TP
.B RejectANY=s
Controls how stations associate to the device.
.BR
Y \- Stations must provide the correct SSID to
associate to the AP.
.BR
N \- Stations are not required to provide the
correct SSID to associate to the AP.
Known as an \'open\' network.
.BR
Default - N
.TP
.B RTSThreshold=n
Controls the RTS/CTS handshake threshold for transmissions in Station mode.
Valid values are 0 to 2347.
.BR
500 \- Hidden Stations
.BR
2347 \- No RTS/CTS
.BR
Default: 2347
.TP
.B RTSThreshold1=n
Same as RTSThreshold, only for port 1 of in AccessPoint mode.
.TP
.B RTSThreshold2=n
Same as RTSThreshold1, only for port 2.
.TP
.B RTSThreshold3=n
Same as RTSThreshold1, only for port 3.
.TP
.B RTSThreshold4=n
Same as RTSThreshold1, only for port 4.
.TP
.B RTSThreshold5=n
Same as RTSThreshold1, only for port 5.
.TP
.B RTSThreshold6=n
Same as RTSThreshold1, only for port 6.
.TP
.B SRSC2GHz=b
Sets the card\'s Supported Rate Set in the 2.4GHz band. The value
is an INTEGER CONVERTED bit mask representing the rates to support,
where the rates supported are as follows:
Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
.br
------------------------------------------------------
.br
Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
.BR
Default: 4095 (or 0x0FFF, all 11b and 11g rates)
.TP
.B SRSC5GHz=b
Sets the card\'s Supported Rate Set in the 5.0GHz band. See SRSC2GHz
for the value\'s format.
.BR
Default: 4080 (or 0x0FF0, all 11a rates)
.TP
.B SystemScale=n
Sets the distance between Access Points in the network. This value
influences the Modem Thresholds (EnergyDetectThreshold,
CarrierDetectThreshold and DeferThreshold) and
the Roaming Thresholds (CellSearchThreshold and OutOfRangeThreshold).
.BR
1 \- Large
.BR
2 \- Medium
.BR
3 \- Small
.BR
Default: 1
.TP
.B TxRateControl=n
Sets the data rate to be used by the transmitter. For Hermes-II:
.BR
1 \- Fixed Low (1 Mb/sec)
.BR
2 \- Fixed Standard (2 Mb/sec)
.BR
3 \- Auto Rate Select High (11, 5.5, 2, 1 Mb/sec)
.BR
4 \- Fixed Medium (5.5 Mb/sec)
.BR
5 \- Fixed High (11 Mb/sec)
.BR
6 \- Auto Rate Select Standard (2, 1 Mb/sec)
.BR
7 \- Auto Rate Select Medium (5.5, 2, 1 Mb/sec)
.BR
Default: 3
For Hermes-II.5, an INTEGER CONVERTED bit mask representing all of the
rates to support, where the rates supported are as follows:
Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
.br
------------------------------------------------------
.br
Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
.BR
Default: 4095 (Translates to 0xFFF, which is all rates)
.TP
.B RTSThreshold=n
Sets the number of octets in a message or fragment above which a
RTS/CTS handshake is performed.
Valid values are 0 to 2347.
.BR
500 \- Hidden Stations
.BR
2347 \- No RTS/CTS
.BR
Default: 2347
.TP
.B TxKey=n
Designates which of the keys is to be used for the enciphering of data that is
transmitted by this station.
.BR
Integer in the range 1..4.
.BR
Default: 1
.TP
.B TxPowLevel
???????????????
.TP
.B TxRateControl=n
Sets the data rate to be used by the transmitter in Station mode.
.BR
1 \- Fixed Low
.BR
2 \- Fixed Standard
.BR
3 \- Auto Rate Select (High)
.BR
4 \- Fixed Medium
.BR
5 \- Fixed High
.BR
6 \- Auto Rate Select (Standard)
.BR
7 \- Auto Rate Select (Medium)
.BR
Default: 3
For Hermes-II.5, an INTEGER CONVERTED bit mask representing all of the
rates to support, where the rates supported are as follows:
Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
.br
------------------------------------------------------
.br
Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
.BR
Default: 4095 (Translates to 0xFFF, which is all rates)
.TP
.B TxRateControl1=n
Same as TxRateControl, only for port 1 in AccessPoint mode.
.TP
.B TxRateControl2=n
Same as TxRateControl1, only for port 2.
.TP
.B TxRateControl3=n
Same as TxRateControl1, only for port 3.
.TP
.B TxRateControl4=n
Same as TxRateControl1, only for port 4.
.TP
.B TxRateControl5=n
Same as TxRateControl1, only for port 5.
.TP
.B TxRateControl6=n
Same as TxRateControl1, only for port 6.
.TP
.B VendorDescription
???????????????
.TP
.B WDSAddress=n,n,n,n,n,n
MAC address that identifies the corresponding node of the WDS port in Station mode.
Note that for WDS to work properly, a bridge interface must be setup between the device and
the wds network devices created by the driver. For more information on bridge
interfaces, please refer to the man page for \'brctl\'.
.BR
Default: 00:00:00:00:00:00
.TP
.B WDSAddress1=n,n,n,n,n,n
Same as WDSAddress, only for port 1 in AccessPoint mode.
.TP
.B WDSAddress2=n,n,n,n,n,n
Same as WDSAddress1, only for port 2.
.TP
.B WDSAddress3=n,n,n,n,n,n
Same as WDSAddress1, only for port 3.
.TP
.B WDSAddress4=n,n,n,n,n,n
Same as WDSAddress1, only for port 4.
.TP
.B WDSAddress5=n,n,n,n,n,n
Same as WDSAddress1, only for port 5.
.TP
.B WDSAddress6=n,n,n,n,n,n
Same as WDSAddress1, only for port 6.
.SH SECURITY
On a multi-user system only the system administrator needs access to the WEP
encryption keys. In this case, consider removing the read permission for
normal users of the PCMCIA config.opts file, the system log file, and any
Agere proprietary iwconfig-eth<n> scripts.
.SH CONTACT
If you encounter problems when installing or using this product, or would like
information about our other "Wireless" products, please contact your local
Authorized "Wireless" Reseller or Agere Systems sales office.
Addresses and telephone numbers of the Agere Systems sales offices are
listed on our Agere Systems web site.
.TP
.B WWW
http://www.agere.com
.SH SEE ALSO
.BR cardmgr (8),
.BR pcmcia (5),
.BR ifconfig (8),
.BR insmod (8),
.BR brctl (8).
此差异已折叠。
/************************************************************************************************************
*
* FILE : mmd.c
*
* DATE : $Date: 2004/07/23 11:57:45 $ $Revision: 1.4 $
* Original: 2004/05/28 14:05:35 Revision: 1.32 Tag: hcf7_t20040602_01
* Original: 2004/05/13 15:31:45 Revision: 1.30 Tag: hcf7_t7_20040513_01
* Original: 2004/04/15 09:24:42 Revision: 1.25 Tag: hcf7_t7_20040415_01
* Original: 2004/04/08 15:18:17 Revision: 1.24 Tag: t7_20040413_01
* Original: 2004/04/01 15:32:55 Revision: 1.22 Tag: t7_20040401_01
* Original: 2004/03/10 15:39:28 Revision: 1.18 Tag: t20040310_01
* Original: 2004/03/03 14:10:12 Revision: 1.16 Tag: t20040304_01
* Original: 2004/03/02 09:27:12 Revision: 1.14 Tag: t20040302_03
* Original: 2004/02/24 13:00:29 Revision: 1.12 Tag: t20040224_01
* Original: 2004/01/30 09:59:33 Revision: 1.11 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* DESC : Common routines for HCF, MSF, UIL as well as USF sources
*
* Note: relative to Asserts, the following can be observed:
* Since the IFB is not known inside the routine, the macro HCFASSERT is replaced with MDDASSERT.
* Also the line number reported in the assert is raised by FILE_NAME_OFFSET (20000) to discriminate the
* MMD Asserts from HCF and DHF asserts.
*
***************************************************************************************************************
*
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*
**************************************************************************************************************/
#include "hcf.h" // Needed as long as we do not really sort out the mess
#include "hcfdef.h" // get CNV_LITTLE_TO_SHORT
#include "mmd.h" // MoreModularDriver common include file
//to distinguish DHF from HCF asserts by means of line number
#undef FILE_NAME_OFFSET
#define FILE_NAME_OFFSET DHF_FILE_NAME_OFFSET
/*************************************************************************************************************
*
*.MODULE CFG_RANGE_SPEC_STRCT* mmd_check_comp( CFG_RANGES_STRCT *actp, CFG_SUP_RANGE_STRCT *supp )
*.PURPOSE Checks compatibility between an actor and a supplier.
*
*.ARGUMENTS
* actp
* supp
*
*.RETURNS
* NULL incompatible
* <>NULL pointer to matching CFG_RANGE_SPEC_STRCT substructure in actor-structure matching the supplier
*
*.NARRATIVE
*
* Parameters:
* actp address of the actor specification
* supp address of the supplier specification
*
* Description: mmd_check_comp is a support routine to check the compatibility between an actor and a
* supplier. mmd_check_comp is independent of the endianness of the actp and supp structures. This is
* achieved by checking the "bottom" or "role" fields of these structures. Since these fields are restricted
* to a limited range, comparing the contents to a value with a known endian-ess gives a clue to their actual
* endianness.
*
*.DIAGRAM
*1a: The role-field of the actor structure has a known non-zero, not "byte symmetric" value (namely
* COMP_ROLE_ACT or 0x0001), so if and only the contents of this field matches COMP_ROLE_ACT (in Native
* Endian format), the actor structure is Native Endian.
*2a: Since the role-field of the supplier structure is 0x0000, the test as used for the actor does not work
* for a supplier. A supplier has always exactly 1 variant,top,bottom record with (officially, but see the
* note below) each of these 3 values in the range 1 through 99, so one byte of the word value of variant,
* top and bottom words is 0x00 and the other byte is non-zero. Whether the lowest address byte or the
* highest address byte is non-zero depends on the Endianness of the LTV. If and only if the word value of
* bottom is less than 0x0100, the supplier is Native Endian.
* NOTE: the variant field of the supplier structure can not be used for the Endian Detection Algorithm,
* because a a zero-valued variant has been used as Controlled Deployment indication in the past.
* Note: An actor may have multiple sets of variant,top,bottom records, including dummy sets with variant,
* top and bottom fields with a zero-value. As a consequence the endianness of the actor can not be determined
* based on its variant,top,bottom values.
*
* Note: the L and T field of the structures are always in Native Endian format, so you can not draw
* conclusions concerning the Endianness of the structure based on these two fields.
*
*1b/2b
* The only purpose of the CFG_RANGE_SPEC_BYTE_STRCT is to give easy access to the non-zero byte of the word
* value of variant, top and bottom. The variables sup_endian and act_endian are used for the supplier and
* actor structure respectively. These variables must be 0 when the structure has LE format and 1 if the
* structure has BE format. This can be phrased as:
* the variable is false (i.e 0x0000) if either
* (the platform is LE and the LTV is the same as the platform)
* or
* (the platform is BE and the LTV differs from the platform).
* the variable is true (i.e 0x0001) if either
* (the platform is BE and the LTV is the same as the platform)
* or
* (the platform is LE and the LTV differs from the platform).
*
* Alternatively this can be phrased as:
* if the platform is LE
* if the LTV is LE (i.e the same as the platform), then the variable = 0
* else (the LTV is BE (i.e. different from the platform) ), then the variable = 1
* if the platform is BE
* if the LTV is BE (i.e the same as the platform), then the variable = 1
* else (the LTV is LE (i.e. different from the platform) ), then the variable = 0
*
* This is implemented as:
* #if HCF_BIG_ENDIAN == 0 //platform is LE
* sup/act_endian becomes reverse of structure-endianness as determined in 1a/1b
* #endif
*6: Each of the actor variant-bottom-top records is checked against the (single) supplier variant-bottom-top
* range till either an acceptable match is found or all actor records are tried. As explained above, due to
* the limited ranges of these values, checking a byte is acceptable and suitable.
*8: depending on whether a match was found or not (as reflected by the value of the control variable of the
* for loop), the NULL pointer or a pointer to the matching Number/Bottom/Top record of the Actor structure
* is returned.
* As an additional safety, checking the supplier length protects against invalid Supplier structures, which
* may be caused by failing hcf_get_info (in which case the len-field is zero). Note that the contraption
* "supp->len != sizeof(CFG_SUP_RANGE_STRCT)/sizeof(hcf_16) - 1"
* did turn out not to work for a compiler which padded the structure definition.
*
* Note: when consulting references like DesignNotes and Architecture specifications there is a confusing use
* of the notions number and variant. This resulted in an inconsistent use in the HCF nomenclature as well.
* This makes the logic hard to follow and one has to be very much aware of the context when walking through
* the code.
* NOTE: The Endian Detection Algorithm places limitations on future extensions of the fields, i.e. they should
* stay within the currently defined boundaries of 1 through 99 (although 1 through 255) would work as well
* and there should never be used a zero value for the bottom of a valid supplier.
* Note: relative to Asserts, the following can be observed:
* 1: Supplier variant 0x0000 has been used for Controlled Deployment
* 2: An actor may have one or more variant record specifications with a top of zero and a non-zero bottom
* to override the HCF default support of a particular variant by the MSF programmer via hcfcfg.h
* 3: An actor range can be specified as all zeros, e.g. as padding in the automatically generated firmware
* image files.
*.ENDDOC END DOCUMENTATION
*************************************************************************************************************/
CFG_RANGE_SPEC_STRCT*
mmd_check_comp( CFG_RANGES_STRCT *actp, CFG_SUP_RANGE_STRCT *supp )
{
CFG_RANGE_SPEC_BYTE_STRCT *actq = (CFG_RANGE_SPEC_BYTE_STRCT*)actp->var_rec;
CFG_RANGE_SPEC_BYTE_STRCT *supq = (CFG_RANGE_SPEC_BYTE_STRCT*)&(supp->variant);
hcf_16 i;
int act_endian; //actor endian flag
int sup_endian; //supplier endian flag
act_endian = actp->role == COMP_ROLE_ACT; //true if native endian /* 1a */
sup_endian = supp->bottom < 0x0100; //true if native endian /* 2a */
#if HCF_ASSERT
MMDASSERT( supp->len == 6, supp->len )
MMDASSERT( actp->len >= 6 && actp->len%3 == 0, actp->len )
if ( act_endian ) { //native endian
MMDASSERT( actp->role == COMP_ROLE_ACT, actp->role )
MMDASSERT( 1 <= actp->id && actp->id <= 99, actp->id )
} else { //non-native endian
MMDASSERT( actp->role == CNV_END_SHORT(COMP_ROLE_ACT), actp->role )
MMDASSERT( 1 <= CNV_END_SHORT(actp->id) && CNV_END_SHORT(actp->id) <= 99, actp->id )
}
if ( sup_endian ) { //native endian
MMDASSERT( supp->role == COMP_ROLE_SUPL, supp->role )
MMDASSERT( 1 <= supp->id && supp->id <= 99, supp->id )
MMDASSERT( 1 <= supp->variant && supp->variant <= 99, supp->variant )
MMDASSERT( 1 <= supp->bottom && supp->bottom <= 99, supp->bottom )
MMDASSERT( 1 <= supp->top && supp->top <= 99, supp->top )
MMDASSERT( supp->bottom <= supp->top, supp->bottom << 8 | supp->top )
} else { //non-native endian
MMDASSERT( supp->role == CNV_END_SHORT(COMP_ROLE_SUPL), supp->role )
MMDASSERT( 1 <= CNV_END_SHORT(supp->id) && CNV_END_SHORT(supp->id) <= 99, supp->id )
MMDASSERT( 1 <= CNV_END_SHORT(supp->variant) && CNV_END_SHORT(supp->variant) <= 99, supp->variant )
MMDASSERT( 1 <= CNV_END_SHORT(supp->bottom) && CNV_END_SHORT(supp->bottom) <=99, supp->bottom )
MMDASSERT( 1 <= CNV_END_SHORT(supp->top) && CNV_END_SHORT(supp->top) <=99, supp->top )
MMDASSERT( CNV_END_SHORT(supp->bottom) <= CNV_END_SHORT(supp->top), supp->bottom << 8 | supp->top )
}
#endif // HCF_ASSERT
#if HCF_BIG_ENDIAN == 0
act_endian = !act_endian; /* 1b*/
sup_endian = !sup_endian; /* 2b*/
#endif // HCF_BIG_ENDIAN
for ( i = actp->len ; i > 3; actq++, i -= 3 ) { /* 6 */
MMDASSERT( actq->variant[act_endian] <= 99, i<<8 | actq->variant[act_endian] )
MMDASSERT( actq->bottom[act_endian] <= 99 , i<<8 | actq->bottom[act_endian] )
MMDASSERT( actq->top[act_endian] <= 99 , i<<8 | actq->top[act_endian] )
MMDASSERT( actq->bottom[act_endian] <= actq->top[act_endian], i<<8 | actq->bottom[act_endian] )
if ( actq->variant[act_endian] == supq->variant[sup_endian] &&
actq->bottom[act_endian] <= supq->top[sup_endian] &&
actq->top[act_endian] >= supq->bottom[sup_endian]
) break;
}
if ( i <= 3 || supp->len != 6 /*sizeof(CFG_SUP_RANGE_STRCT)/sizeof(hcf_16) - 1 */ ) {
actq = NULL; /* 8 */
}
#if HCF_ASSERT
if ( actq == NULL ) {
for ( i = 0; i <= supp->len; i += 2 ) {
MMDASSERT( DO_ASSERT, MERGE_2( ((hcf_16*)supp)[i], ((hcf_16*)supp)[i+1] ) );
}
for ( i = 0; i <= actp->len; i += 2 ) {
MMDASSERT( DO_ASSERT, MERGE_2( ((hcf_16*)actp)[i], ((hcf_16*)actp)[i+1] ) );
}
}
#endif // HCF_ASSERT
return (CFG_RANGE_SPEC_STRCT*)actq;
} // mmd_check_comp
#ifndef MMD_H
#define MMD_H 1
/*************************************************************************************************************
*
* FILE : mmd.h
*
* DATE : $Date: 2004/07/19 08:16:14 $ $Revision: 1.2 $
* Original: 2004/05/17 07:33:14 Revision: 1.18 Tag: hcf7_t20040602_01
* Original: 2004/05/11 06:22:59 Revision: 1.17 Tag: hcf7_t7_20040513_01
* Original: 2004/04/15 09:24:42 Revision: 1.13 Tag: hcf7_t7_20040415_01
* Original: 2004/04/08 15:18:17 Revision: 1.12 Tag: t7_20040413_01
* Original: 2004/04/01 15:32:55 Revision: 1.10 Tag: t7_20040401_01
* Original: 2004/03/04 16:47:50 Revision: 1.7 Tag: t20040310_01
* Original: 2004/03/03 12:47:05 Revision: 1.6 Tag: t20040304_01
* Original: 2004/02/25 14:14:39 Revision: 1.5 Tag: t20040302_03
* Original: 2004/02/24 13:00:29 Revision: 1.4 Tag: t20040224_01
* Original: 2004/01/30 09:59:33 Revision: 1.3 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* DESC : Definitions and Prototypes for HCF, MSF, UIL as well as USF sources
*
***************************************************************************************************************
*
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*
**************************************************************************************************************/
#ifndef HCF_H
#include "hcf.h" //just to get going with swig
#endif
EXTERN_C CFG_RANGE_SPEC_STRCT* mmd_check_comp( CFG_RANGES_STRCT *actp, CFG_SUP_RANGE_STRCT *supp );
#endif // MMD_H
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* Header describing information required for the driver to support PCMCIA.
*
*------------------------------------------------------------------------------
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* Copyright © 2003 Agere Systems Inc.
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
******************************************************************************/
#ifndef __WL_CS_H__
#define __WL_CS_H__
/*******************************************************************************
* function prototypes
******************************************************************************/
int wl_adapter_insert(struct pcmcia_device *link);
void wl_adapter_release(struct pcmcia_device *link);
int wl_adapter_init_module( void );
void wl_adapter_cleanup_module( void );
int wl_adapter_open(struct net_device *dev);
int wl_adapter_close(struct net_device *dev);
int wl_adapter_is_open(struct net_device *dev);
const char *DbgEvent( int mask );
#endif /* __WL_CS_H__ */
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/ap_h25.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/debug.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhf.c"
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册