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: Kristina Martšenko <kristina.martsenko@gmail.com>
Cc: Henk de Groot <pe1dnn@amsat.org>
Cc: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Kristina Martšenko 2014-06-30 22:16:55 +03:00 committed by Greg Kroah-Hartman
parent c047b443ac
commit de1c4400bf
80 changed files with 0 additions and 44844 deletions

View file

@ -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

View file

@ -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"

View file

@ -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/

View file

@ -1,11 +0,0 @@
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.

View file

@ -1,53 +0,0 @@
#
# 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

View file

@ -1,180 +0,0 @@
=======================================================================
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 ---

View file

@ -1,641 +0,0 @@
==============================================================================
Agere Systems Inc. July 2004
Readme for Linux Driver Source for Wavelan Version: 7.22-abg
==============================================================================
This text file includes update information, installation instructions,
limitations to the current version of the product, and suggestions to solve
known issues or problems.
TABLE OF CONTENTS.
1. DESCRIPTION
2. SYSTEM REQUIREMENTS
3. NEW IN THIS RELEASE
4. INSTALLATION NOTES
5. TECHNICAL CONSTRAINTS
6. KNOWN ISSUES
7. TECHNICAL SUPPORT
------------------------------------------------------------------------------
1. DESCRIPTION
With this package, you can build and install a Wireless driver for a
specific Linux kernel.
The driver in this package supports the network interface cards based on:
- WL60010, a.k.a. Hermes-II
- WL60040, a.k.a. Hermes-II.5
Although derived from the Hermes-I/II Linux driver, this release ONLY
Supports Hermes-II/II.5 chipsets. Hermes-I is no longer supported.
The software is distributed in a compressed source file archive:
- wl_lkm_7_22_abg.tar.gz
Because this release supports more than one Hermes CPU and bus
architecture, a naming convention is used for the resulting binaries that
can be built from this source code. Driver binaries are named as follows:
wlags49_<hermes_type>_<bus_arch>.o
where 'wlags49' denotes an Agere WaveLan Linux build,
<hermes_type> is: 'h2' for Hermes-II, 'h25' for Hermes-II.5
<bus_arch> is: 'cs' for Card Services (PCMCIA, Compact Flash), PCI for
PCI or MiniPCI.
For example, a driver built for Hermes-II Card Services (PCMCIA/Compact
Flash) is named wlags49_h2_cs.o, whereas a driver built for Hermes-II
MiniPCI is named wlags49_h2_pci.o.
The following software is included with this distribution:
General information:
* README.wlags49 This file
* LICENSE.wlags49 License
* wlags49.mk Top level Makefile
* Build Script to build driver
* Install Script to install driver
Driver source:
* wireless/ MSF source
* hcf/ HCF and F/W source
* wireless/wlags49_cs.mk Driver Makefile, PC Card
* wireless/wlags49_pci.mk Driver Makefile, PCI
* include/hcf/debug.h Driver debug support
* include/hcf/hcfcfg.h Header to configure HCF
* include/wireless/*.h Driver source headers
Driver online manual page:
* man/wlags49.4 Driver manual page
PCMCIA configuration update:
* etc/wlags49.conf Add-on config file
* etc/wlags49.mk config update Makefile
* etc/wlags49.patch config update patch file
The driver is build up of 2 modules:
- a higher module called Module Specific Functions (MSF), which contains
the functions of the driver that are network driver interface and
Operating System specific.
- a lower module called Hardware Control Functions (HCF), which contains
the functions to interface to the Network Interface Card (NIC). The HCF
provides for all WaveLAN NIC types one standard interface to the MSF.
This I/F is called the Wireless Connection Interface (WCI) and is the
subject of a separate document (025726).
The HCF directory contains firmware images to allow the card to operate in
either station (STA) or Access Point (AP) mode. In the build process, the
files fw_h2.c and fw_h25.c are used for Hermes-II and Hermes-II.5
respectively. The firmware images in this release are identified as:
- HII Station F/W: fw_h2.c.sta
- HII.5 Station F/W: fw_h25.c.sta
- HII AccesPoint F/W: fw_h2.c.ap
- HII.5 AccesPoint F/W: fw_h25.c.ap
To build a STA or AP mode driver, the suffix .sta or .ap must be removed.
The files as distributed by this release build STA drivers by default.
------------------------------------------------------------------------------
2. SYSTEM REQUIREMENTS
2.1 Operating System
This software can be compiled and installed with Linux kernel versions
2.4.x. Although this driver should compile for other CPUs as well, as of
the date of this release, no CPU architectures other than x86 have been
verified.
wl_lkm_7_22_abg is tested with the following Linux Distributions:
* Red Hat version 9.0
* Suse version 9.0
If you're building for PC Card or Compact Flash, you need the Card Services
from David Hinds.
wl_lkm_7_22_abg is tested with:
* pcmcia-cs-3.2.7.tar.gz
2.2 Free Disk Space
To compile the software you need to have the full set of Linux kernel
source files installed, as well as a sane build environment which includes
all tools necessary for compiling and linking code. Depending on the exact
version of the kernel, you need approximately 150 MB of free disk space.
Once compiled, the driver uses about 150-200 KB. Please note, this size is
approximate and can vary depending on which version of the driver is built.
In addition, adding debug tracing support increases this size.
------------------------------------------------------------------------------
3. NEW IN THIS RELEASE
Version 7.22 abg - July 28, 2004
------------------------------------------------------------------------------
4. INSTALLATION NOTES
The driver files for the Linux driver are not "ready" for direct
installation onto any Linux computer. To build and install the driver you
need some expertise on the Linux operating system in general and the type
and version installed of the kernel installed on your computer. With this
knowledge you can use the driver source files provided to build your own
Linux driver for your specific computer and kernel.
4.1 Before you start
1) Determine the type and version of the Linux kernel of your computer and
check whether it meets the system requirements listed in section 2 of this
README.
2) If you're building for PC Card or Compact Flash, read the Linux
PCMCIA-HOWTO by David Hinds. This document is probably provided on the
CD-ROM of your Linux distribution. You can download the latest version
from:
http://pcmcia-cs.sourceforge.net
Please read the section titled "Prerequisites and kernel setup" of the
PCMCIA-HOWTO.
4.2 Build the driver for PC Card / Compact Flash
1) Obtain a copy of the Linux PCMCIA package from a CD-ROM of your Linux
distribution or download the latest version.
For your convenience, the Agere Systems Wireless CD-ROM contains a copy of
the PCMCIA package in sub-directory: Xtras/Linux/PCMCIA
2) To unpack the Linux PCMCIA package, copy it to the current working
directory and type:
% tar xzvf pcmcia-cs-x.y.z.tar.gz
% mv pcmcia-cs-x.y.z pcmcia-cs
Note: If you use the archive supplied on the CDROM, use archive name
"pc3_2_1.tgz" instead of "pcmcia-cs-3.2.7.tar.gz".
Note: even though PCMCIA code exists in the kernel source tree, the PCMCIA
Card Services package needs to be unpacked locally to build drivers based
on it.
3) Extract the wlags49 distribution archive on top of the Linux PCMCIA
package.
% cd pcmcia-cs
% tar xzvf ../wl_lkm_7_22_abg.tar.gz
4) To build and install the driver, follow the procedure below:
% ./Configure
Answer the presented questions. Usually the default answers are OK and
pressing "Enter" is enough.
On newer RedHat systems, however, you should specify "/usr/src/linux-2.4"
as the Linux source directory instead of the default "/usr/src/linux".
For more detailed information on configuration, building and installing,
see the PCMCIA-HOWTO.
To build the default drivers, which support Hermes-II in station mode, run
the Build script:
% ./Build
This script determines whether your system uses in-kernel PCMCIA and either
builds the full PCMCIA package or just the driver.
Before installing the driver with the Install script, you must become
'root':
% su
..
% ./Install
This script determines whether your system uses in-kernel PCMCIA and either
installs the full PCMCIA package or just the driver.
5) If it becomes necessary to clean the build, issue the following
commands:
% make clean
% make -C lib clean
4.3 Build the driver for PCI
1) Extract the wlags49 to the current working directory.
% tar xzvf wl_lkm_7_22.tar.gz
Note: there is no need to unpack the driver source into a PCMCIA build
directory.
2) To build the PCI driver:
% make -f wlags49.mk wlags49_h2_pci
or
% make -f wlags49.mk wlags49_h25_pci
3) Install the driver.
% insmod ./wireless/wlags49_h25.o
4) If it becomes necessary to clean the build.
% make -f wlags49.mk pci_clean
4.4 Configure your Wireless PC Card
There are 3 ways to configure the driver
- module parameters (/etc/pcmcia/config.opts)
- wireless extension (/etc/pcmcia/wireless.opts)
- Agere configuration file (/etc/agere/iwconfig-eth#)
4.4.1 Configure through /etc/pcmcia/config.opts
To use this method, make sure that /etc/pcmcia/wireless.opts file is either
absent or contains blank parameter values as shown below.
*,*,*,00:60:1D:*|*,*,*,00:02:2D:*)
INFO=""
ESSID=""
MODE=""
KEY=""
;;
1) To configure the Wireless PC Card, please refer to:
* The online manual page (wlags49.4)
% man wlags49
* The network adapter sections of the PCMCIA documentation.
% more PCMCIA-HOWTO
2) Use an editor to configure the module parameters:
# vi /etc/pcmcia/config.opts
a) To connect your computer to a wireless infrastructure that includes
access points such as the AP-1000 or AP-500, you need to identify the
network name of the wireless infrastructure.
For example if your infrastructure uses the network name "My Network",
edit the config.opts file to include the following:
module "<driver_name>" opts "network_name=My\ Network"
Notice that the space character needs to be escaped with a backslash.
b) To connect your computer to a Residential Gateway RG-1000, you need
to know the RG ID (=network_name) and the encryption key. You can find
the RG ID on a small label on the rear of the unit.
For example if your RG-1000 has ID 225ccf and you did not change the
encryption key yet, edit the config.opts file to include the following:
module "<driver_name>" opts "network_name=\"225ccf\" key_1=\"25ccf\"
enable_encryption=Y"
If you changed your encryption key, you should specify this key as key_1
on the parameter line.
c) To connect your computer to a peer-to-peer network, in an environment
without access points, the IBSS mode is recommended.
For example to connect to a peer-to-peer network called "My Network",
enter the following in the config.opts file:
module "<driver_name>" opts "create_ibss=Y network_name=My\ Network"
d) Optionally you can also include a "Station Name" value that can be
used to indentify your computer on the wireless network.
For example if you wish to name your computer "Wave1" when connecting it
to a wireless infrastructure, edit the config.opts file to include the
following:
module "<driver_name>" opts "network_name=Ocean station_name=Wave1"
e) To connect your computer to an Ad-Hoc workgroup of wireless
computers, enter the following in the config.opts file:
module "<driver_name>" opts "port_type=3"
Note that the "Ad-Hoc Demo Mode" is not the recommended mode for a
peer-to-peer network. The configuration of this non-interoperable mode
is only explained here for special applications (e.g. research, or
compatibility with other / previous WaveLAN/IEEE products).
The IBSS mode described in c) is the preferred and interoperable mode
for creating a peer-to-peer network.
3) Use an editor to modify the network options for your adapter.
# vi /etc/pcmcia/network.opts
The parameters need to be correct for the connected network. Check with
your system administrator for the correct network information. Refer to
the PCMCIA-HOWTO for more configuration information.
For example:
*,*,*,*)
IF_PORT=""
BOOTP="n"
IPADDR="10.0.0.5"
NETMASK="255.255.255.0"
NETWORK="10.0.0.0"
BROADCAST="10.0.0.255"
GATEWAY="10.0.0.1"
DOMAIN="domain.org"
DNS_1="dns1.domain.org"
;;
RedHat and Suse do not use the network.opts to configure the driver.
Instead RedHat uses a GUI-based tool called 'neat' ('net.cfg' in older
versions) and SuSE Linux uses 'YaST'. These tools creates scripts, like
ifcfg-eth0, in the directory /etc/sysconfig/network-scripts. Using the
default GNOME menu, you can start netcfg from: Programs->System->Network
Configuration.
4) Restart the PCMCIA services.
# /etc/rc.d/rc.pcmcia restart
or
# /etc/rc.d/init.d/pcmcia restart
For a more detailed description about the various configuration options and
definitions, please consult the Wireless documentation.
4.4.2 Configure through /etc/pcmcia/wireless.opts
This driver has support for the "Wireless Extensions". This interface
allows the "Wireless Tools" to get statistics from the driver and allows to
change the configuration of the driver on the fly.
The latest versions of the PCMCIA package contain scripts that use the
wireless extension to configure the driver as an alternative to the
configuration through module parameters as described in section 4.4.1.
Read the /etc/pcmcia/wireless.opts file for the theory of operation. When
the driver is configured, go to section 4.4.1 step 3 to configure the
network parameters.
For more information, refer to the following WEB pages:
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.Extensions.html
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
4.4.3 Configure through /etc/agere/iwconfig-eth#
In addition to using either the module options or the wireless extensions
methods to configure a wireless device, this version of the software also
supports an Agere specific implementation. This was done because:
* Module options configures multiple devices the same.
* Wireless extensions parameters do not cover all of the available options
in the driver.
For each wireless ethernet device (identified by eth<n>, where n is a
positive integer), a file /etc/agere/iwconfig-eth<n> can be created which
contains configuration information for a wireless device. For example, the
file /etc/agere/iwconfig-eth1 is the config file for eth1. This file should
contain Key/Value pairs in the format:
<Key>=<Value>
where <Key> is the parameter to configure and <Value> is the value to
assign it. For example, if the config file /etc/agere/iwconfig-eth1
described above contains the following:
DesiredSSID=some_network
EnableEncryption=Y
Key1=net01
TxKey=1
this configures eth1 to associate to the ESSID 'some_network' with
encryption on, where the the first encryption key is 'net01' and the key to
use for encryption is Key 1.
Note that this only works on Agere hardware which uses this driver. For
other wireless drivers, or non-wireless devices, this file can be present,
but has no effect.
Please refer to the man page for more information on this configuration
file and the parameters that can be set.
4.5 Configuring your Wireless PCI card
Note that the above method of configuring the card using
/etc/pcmcia/config.opts is only valid for PCMCIA/CF cards. For [mini]PCI
and CardBus cards, refer to your system's documentation on modules.conf to
load the driver with the proper options for a given wireless ethernet
interface. In addition, network configuration tools like 'netcfg', 'neat',
or 'YaST' (see Section 4.4.1, Step 3) can be used to configure the miniPCI
card. Lastly, the Agere configuration file described in Section 4.4.3 may
also be used for [mini]PCI and CardBus devices.
4.6 Troubleshooting
When the Wireless PC Card is inserted, the card manager emit beeps in
different tones to indicate success or failure of particular configuration
steps.
a) Two high beeps
- The card was identified and configured successfully.
b) One high beep followed by a low beep
- The card was identified, but could not be configured.
- Examine the system log (dmesg) for PCMCIA error or warning messages.
c) One low beep
- The card could not be identified.
- Execute "cardctl ident" to display the adapter PnP information.
Verify the PnP information matches an entry in the PCMCIA
configuration file (/etc/pcmcia/config).
- Examine the system log (dmesg) for PCMCIA error or warning messages.
The Wireless PC Card has two LEDs that indicate the state of the adapter
and network.
* Power LED (toward the middle of the adapter)
- This LED indicates power has been applied, and the card is
functional. In normal operation mode with Card Power Management
disabled, it is steady-on. With Card Power Management enabled, it
blinks rapidly (several times per second).
* Transmit/Receive LED (closer to the edge of the adapter)
- This LED flashes when it detects transmit or receive packets.
* Both LEDs blink at the same time every 10 seconds.
- The adapter was unable to make contact with the named wireless
network. Verify the network_name, in the config.opts file matches the
network name of the access point.
* LEDs indicate normal operation with the Power LED
steady-on or blinking rapidly and Transmit/Receive LED flashing, but no
traffic.
- If the network is operating in normal mode (ie. port_type = 0 or not
specified), and a network_name has been specified, verify the
workstation network parameters (ifconfig, route, etc.) are correct
for the wireless network.
- If the network is operating in Ad-Hoc (peer-to-peer) mode (ie.
port_type = 3), the adapter needs another workstation/adapter to
communicate with. Verify the network parameters on both of the
workstations (ifconfig, route, etc.) are correct.
Refer to the online manual page for additional configuration, feature and
support information.
% man wlags49
or
% man 4 wlags49
or
% nroff -man wlags49.4 | more
4.7 Identifying the software
This section explains how to identify the version of this software once it
is unpacked or installed.
The Linux Driver Source/Library distribution consist of two main
components, the driver source and the HCF module.
* To quickly identify the version of the source, type:
% grep DRV.*VERSION include/wireless/wl_version.h
#define DRV_MAJOR_VERSION 7
#define DRV_MINOR_VERSION 22
* To identify the revision of the HCF library contained in the driver,
type:
% grep HCF.Revision hcf/hcf.c
#define HCF_VERSION TEXT( "HCF$Revision: 1.8 $" )
To identify a compiled wlags49 driver, go to the directory where the driver
is located. Card Services drivers (wlags49_h2_cs.o and wlags49_h25_cs.o)
are located in:
/lib/modules/<kernel-version>/pcmcia
PCI drivers (wlags49_h2.o) are located in:
/lib/modules/<kernel-version>/kernel/drivers/net
* To retrieve the version of the source used to compile the driver, type:
% strings <driver_name>.o | grep Agere
<driver_name> v7.22-abg-Beta for PCMCIA
<driver_name> v7.22-abg-Beta for PCI
* Likewise, to retrieve the revision of the HCF used to compile the driver,
type:
% strings <driver_name>.o | grep Revision
HCF$Revision: 5.15
At startup the wlags49 driver reports its version in the system log file
(/var/log/messages).
------------------------------------------------------------------------------
5. TECHNICAL CONSTRAINTS
At the time of release of this software, the following constraints are
identified:
5.1 Using the ISA adapter
Description: To allow operation in desktop computers Agere also provides an
optional ISA bus to PC Card adapter (also referred to as "swapbox").
This ISA Adapter can be configured for two different I/O Address values:
* 3E2 (factory-set default)
* 3E0
Impact: By default the i82365 module of the Linux pcmcia package only
probes at 3E0.
Actions:
1) Read the manual page on the probing of the i82365 module, by typing the
command:
man i82365
2) Apply one of the two following options:
a) Change the I/O address strapping of the ISA adapter by replacing the
jumper on the ISA adapter. The correct jumper setting is pictured in
the electronic "Wireless ISA Adapter, Getting Started Guide" provided
on the Wireless Software CD-ROM. This guide is provided in Adobe's
Acrobat PDF format.
b) Alternatively, you can load the i82365 module with the
"extra_sockets" parameter set to 1.
On a RedHat 5.x thru 7.x, system, put this in the file
"/etc/sysconfig/pcmcia":
PCMCIA=yes
PCIC=i82365
PCIC_OPTS="extra_sockets=1"
CORE_OPTS=
CARDMGR_OPTS=
For other Linux distributions, you are advised to consult the
"PCMCIA-HOWTO" notes for information about changing the I/O Address
probing.
5.2 Using the PCI Adapter
Description: To allow operation in desktop computers Agere also provides an
optional PCI bus to PC Card adapter (also referred to as "swapbox").
For correct interrupt assignment, the system should support PCIBIOS 2.2.
It is recommended to use PCMCIA package version 3.2.7 or higher.
The default configuration of the interrupt routing method of the PCI
Adapter's TI CardBus Controller is incorrect.
Actions:
1) Read the manual page on the "Options specific for TI CardBus
Controllers" of the i82365 module, by typing the command:
man i82365
2) Load the i82365 module with the "irq_mode" parameter set to 0.
On a RedHat 5.x thru 7.x system, put this in the file
"/etc/sysconfig/pcmcia":
PCMCIA=yes
PCIC=i82365
PCIC_OPTS="irq_mode=0"
CORE_OPTS=
CARDMGR_OPTS=
For the location of the PCMCIA scripts on other Linux distributions, you
are advised to consult the "PCMCIA-HOWTO", "Notes about specific Linux
distributions".
------------------------------------------------------------------------------
6. KNOWN ISSUES
This is the current list of known issues for this release, and will be
addressed in the near future:
1. This driver release contains a version of Hermes-II.5 firmware which
REQUIRES calibrated cards. If there is no calibration data present in the
PDA of the hardware, the firmware does not operate.
2. WDS is not yet supported.
3. DMA is not yet supported.
4. WPA is not yet supported.
5. 32-bits I/O is not yet supported.
6. The current Build script also builds the PCI drivers.
7. The current Install script also copies the PCI drivers to the lib
directory.
8. If F/W files are required from outside this release, the entry points
inside these F/W files have to be renamed from "ap" and "station" to
"fw_image" and they have to be renamed to fw_h2.c and fw_h25.c for
Hermes-II and Hermes-II.5.
------------------------------------------------------------------------------
7. TECHNICAL SUPPORT
7.1 Finding Information
On the Agere Systems Web Site you can find the most recent device drivers,
software updates and user documentation.
World Wide Web: http://www.agere.com
7.2 Contact Technical Support
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.
When contacting Technical Support, please use the Problem Report Form and
send it to us by Fax or E-Mail. The Problem Report Form 'REPORT.TXT'
(Plain text format) is included on the disk. Alternatively, you can
download the Problem Report Form from the Agere Systems web site.
Include Product Name, Serial Number and software version number with each
request to help the Support Group helping you.
==============================================================================
END OF FILE

View file

@ -1,33 +0,0 @@
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.

View file

@ -1,3 +0,0 @@
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.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,199 +0,0 @@
/*******************************************************************************
* 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 */

View file

@ -1,380 +0,0 @@
/**************************************************************************************************************
*
* 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 */

View file

@ -1,225 +0,0 @@
#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 */

View file

@ -1,158 +0,0 @@
/*******************************************************************************
* 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 */

File diff suppressed because it is too large Load diff

View file

@ -1,394 +0,0 @@
#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

View file

@ -1,785 +0,0 @@
#ifndef HCFCFG_H
#define HCFCFG_H 1
/*************************************************************************************************************
*
* FILE : hcfcfg.tpl // hcfcfg.h
*
* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.6 $
* Original: 2004/04/08 15:18:16 Revision: 1.40 Tag: t20040408_01
* Original: 2004/04/01 15:32:55 Revision: 1.38 Tag: t7_20040401_01
* Original: 2004/03/10 15:39:28 Revision: 1.34 Tag: t20040310_01
* Original: 2004/03/03 14:10:12 Revision: 1.32 Tag: t20040304_01
* Original: 2004/03/02 09:27:12 Revision: 1.30 Tag: t20040302_03
* Original: 2004/02/24 13:00:28 Revision: 1.25 Tag: t20040224_01
* Original: 2004/02/18 17:13:57 Revision: 1.23 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* DESC : HCF Customization Macros
* hcfcfg.tpl list all #defines which must be specified to:
* adjust the HCF functions defined in HCF.C to the characteristics of a specific environment
* o maximum sizes for messages
* o Endianness
* Compiler specific macros
* o port I/O macros
* o type definitions
*
* By copying HCFCFG.TPL to HCFCFG.H and -if needed- modifying the #defines the WCI functionality can be
* tailored
*
* Supported environments:
* WVLAN_41 Miniport NDIS 3.1
* WVLAN_42 Packet Microsoft Visual C 1.5
* WVLAN_43 16 bits DOS ODI Microsoft Visual C 1.5
* WVLAN_44 32 bits ODI (__NETWARE_386__) WATCOM
* WVLAN_45 MAC_OS MPW?, Symantec?
* WVLAN_46 Windows CE (_WIN32_WCE) Microsoft ?
* WVLAN_47 LINUX (__LINUX__) GCC, discarded, based on GPL'ed HCF-light
* WVLAN_48 Miniport NDIS 5
* WVLAN_49 LINUX (__LINUX__) GCC, originally based on pre-compiled HCF_library
* migrated to use the HCF sources when Lucent Technologies
* brought the HCF module under GPL
* WVLAN_51 Miniport USB NDIS 5
* WVLAN_52 Miniport NDIS 4
* WVLAN_53 VxWorks END Station driver
* WVLAN_54 VxWorks END Access Point driver
* WVLAN_81 WavePoint BORLAND C
* WCITST Inhouse test tool Microsoft Visual C 1.5
* WSU WaveLAN Station Update Microsoft Visual C ??
* SCO UNIX not yet actually used ? ?
* __ppc OEM supplied ?
* _AM29K OEM supplied ?
* ? OEM supplied Microtec Research 80X86 Compiler
*
**************************************************************************************************************
*
*
* 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.
*
*
*************************************************************************************************************/
/* Alignment
* Some platforms can access words on odd boundaries (with possibly an performance impact), at other
* platforms such an access may result in a memory access violation.
* It is assumed that everywhere where the HCF casts a char pointer into a word pointer, the alignment
* criteria are met. This put some restrictions on the MSF, which are assumed to be "automatically" fulfilled
* at the applicable platforms
* To assert this assumption, the macro HCF_ALIGN can be defined. The default value is 1, meaning byte
* alignment (or no alignment), a value of 2 means word alignment, a value of 4 means double word alignment
*/
/***************************** IN_PORT_STRING_8_16 S a m p l e s *****************************************
// C implementation which let the processor handle the word-at-byte-boundary problem
#define IN_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
{ *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); ((hcf_8 FAR*)addr)+=2; }
// C implementation which handles the word-at-byte-boundary problem
#define IN_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
{ hcf_16 i = IN_PORT_WORD(port); *((hcf_8 FAR*)addr)++ = (hcf_8)i; *((hcf_8 FAR*)addr)++ = (hcf_8)(i>>8);}
// Assembler implementation
#define IN_PORT_STRING_8_16( port, addr, len) __asm \
{ \
__asm push di \
__asm push es \
__asm mov cx,len \
__asm les di,addr \
__asm mov dx,port \
__asm rep insw \
__asm pop es \
__asm pop di \
}
***************************** OUT_PORT_STRING_8_16 S a m p l e s ******************************************
// C implementation which let the processor handle the word-at-byte-boundary problem
#define OUT_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
{ OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; ((hcf_8 FAR*)addr)+=2; }
// C implementation which handles the word-at-byte-boundary problem
#define OUT_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
{ OUT_PORT_WORD( port, *((hcf_8 FAR*)addr) | *(((hcf_8 FAR*)addr)+1)<<8 ); (hcf_8 FAR*)addr+=2; }
// Assembler implementation
#define OUT_PORT_STRING_8_16( port, addr, len) __asm \
{ \
__asm push si \
__asm push ds \
__asm mov cx,len \
__asm lds si,addr \
__asm mov dx,port \
__asm rep outsw \
__asm pop ds \
__asm pop si \
}
*************************************************************************************************************/
/************************************************************************************************/
/****************** C O M P I L E R S P E C I F I C M A C R O S ***************************/
/************************************************************************************************/
/*************************************************************************************************
*
* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
* !!!! Do not call these macros with parameters which introduce side effects !!!!
* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
*
*
* By selecting the appropriate Macro definitions by means of modifying the "#ifdef 0/1" lines, the HCF can be
* adjusted for the I/O characteristics of a specific compiler
*
* If needed the macros can be modified or replaced with definitions appropriate for your personal platform.
* If you need to make such changes it is appreciated if you inform Agere Systems
* That way the changes can become part of the next release of the WCI
*
* For convenience of the MSF-programmer, all macros are allowed to modify their parameters (although some
* might argue that this would constitute bad coding practice). This has its implications on the HCF, e.g. as a
* consequence these macros should not be called with parameters which have side effects, e.g auto-increment.
*
* in the Microsoft implementation of inline assembly it is O.K. to corrupt all flags except the direction flag
* and to corrupt all registers except the segment registers and EDI, ESI, ESP and EBP (or their 16 bits
* equivalents). Other environments may have other constraints
*
* in the Intel environment it is O.K to have a word (as a 16 bits quantity) at a byte boundary, hence
* IN_/OUT_PORT_STRING_8_16 can move words between PC-memory and NIC-memory with as only constraint that the
* words are on a word boundary in NIC-memory. This does not hold true for all conceivable environments, e.g.
* an Motorola 68xxx does not allow this. Probably/hopefully the boundary conditions imposed by these type of
* platforms prevent this case from materializing. If this is not the case, OUT_PORT_STRING_8_16 must be coded
* by combining two Host memory hcf_8 values at a time to a single hcf_16 value to be passed to the NIC and
* IN_PORT_STRING_8_16 the single hcf_16 retrieved from the NIC must be split in two hcf_8 values to be stored
* in Host memory (see the sample code above)
*
* The prototypes and functional description of the macros are:
*
* hcf_16 IN_PORT_WORD( hcf_16 port )
* Reads a word (16 bits) from the specified port
*
* void OUT_PORT_WORD( hcf_16 port, hcf_16 value)
* Writes a word (16 bits) to the specified port
*
* hcf_16 IN_PORT_DWORD( hcf_16 port )
* Reads a dword (32 bits) from the specified port
*
* void OUT_PORT_DWORD( hcf_16 port, hcf_32 value)
* Writes a dword (32 bits) to the specified port
*
* void IN_PORT_STRING_8_16( port, addr, len)
* Reads len number of words (16 bits) from NIC memory via the specified port to the (FAR)
* byte-pointer addr in PC-RAM
* Note that len specifies the number of words, NOT the number of bytes
* !!!NOTE, although len specifies the number of words, addr MUST be a char pointer NOTE!!!
* See also the common notes for IN_PORT_STRING_8_16 and OUT_PORT_STRING_8_16
*
* void OUT_PORT_STRING_8_16( port, addr, len)
* Writes len number of words (16 bits) from the (FAR) byte-pointer addr in PC-RAM via the specified
* port to NIC memory
* Note that len specifies the number of words, NOT the number of bytes.
* !!!NOTE, although len specifies the number of words, addr MUST be a char pointer NOTE!!!
*
* The peculiar combination of word-length and char pointers for IN_PORT_STRING_8_16 as well as
* OUT_PORT_STRING_8_16 is justified by the assumption that it offers a more optimal algorithm
*
* void IN_PORT_STRING_32( port, addr, len)
* Reads len number of double-words (32 bits) from NIC memory via the specified port to the (FAR)
* double-word address addr in PC-RAM
*
* void OUT_PORT_STRING_32( port, addr, len)
* Writes len number of double-words (32 bits) from the (FAR) double-word address addr in PC-RAM via
* the specified port to NIC memory
*
* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
* !!!! Do not call these macros with parameters which introduce side effects !!!!
* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
*
*************************************************************************************************/
/**************************** define INT Types ******************************/
typedef unsigned char hcf_8;
typedef unsigned short hcf_16;
typedef unsigned long hcf_32;
/**************************** define I/O Types ******************************/
#define HCF_IO_MEM 0x0001 // memory mapped I/O ( 0: Port I/O )
#define HCF_IO_32BITS 0x0002 // 32Bits support ( 0: only 16 Bits I/O)
/****************************** #define HCF_TYPE ********************************/
#define HCF_TYPE_NONE 0x0000 // No type
#define HCF_TYPE_WPA 0x0001 // WPA support
#define HCF_TYPE_USB 0x0002 // reserved (USB Dongle driver support)
//#define HCF_TYPE_HII 0x0004 // Hermes-II, to discriminate H-I and H-II CFG_HCF_OPT_STRCT
#define HCF_TYPE_WARP 0x0008 // WARP F/W
#define HCF_TYPE_PRELOADED 0x0040 // pre-loaded F/W
#define HCF_TYPE_HII5 0x0080 // Hermes-2.5 H/W
#define HCF_TYPE_CCX 0x0100 // CKIP
#define HCF_TYPE_BEAGLE_HII5 0x0200 // Beagle Hermes-2.5 H/W
#define HCF_TYPE_TX_DELAY 0x4000 // Delayed transmission ( non-DMA only)
/****************************** #define HCF_ASSERT ******************************/
#define HCF_ASSERT_NONE 0x0000 // No assert support
#define HCF_ASSERT_PRINTF 0x0001 // Hermes generated debug info
#define HCF_ASSERT_SW_SUP 0x0002 // logging via Hermes support register
#define HCF_ASSERT_MB 0x0004 // logging via Mailbox
#define HCF_ASSERT_RT_MSF_RTN 0x4000 // dynamically binding of msf_assert routine
#define HCF_ASSERT_LNK_MSF_RTN 0x8000 // statically binding of msf_assert routine
/****************************** #define HCF_ENCAP *******************************/
#define HCF_ENC_NONE 0x0000 // No encapsulation support
#define HCF_ENC 0x0001 // HCF handles En-/Decapsulation
#define HCF_ENC_SUP 0x0002 // HCF supports MSF to handle En-/Decapsulation
/****************************** #define HCF_EXT *********************************/
#define HCF_EXT_NONE 0x0000 // No expanded features
#define HCF_EXT_INFO_LOG 0x0001 // logging of Hermes Info frames
//#define HCF_EXT_INT_TX_OK 0x0002 // RESERVED!!! monitoring successful Tx message
#define HCF_EXT_INT_TX_EX 0x0004 // monitoring unsuccessful Tx message
//#define HCF_EXT_MON_MODE 0x0008 // LEGACY
#define HCF_EXT_TALLIES_FW 0x0010 // support for up to 32 Hermes Engineering tallies
#define HCF_EXT_TALLIES_HCF 0x0020 // support for up to 8 HCF Engineering tallies
#define HCF_EXT_NIC_ACCESS 0x0040 // direct access via Aux-ports and to Hermes registers and commands
#define HCF_EXT_MB 0x0080 // MailBox code expanded
#define HCF_EXT_IFB_STRCT 0x0100 // MSF custom pointer in IFB
#define HCF_EXT_DESC_STRCT 0x0200 // MSF custom pointer in Descriptor
#define HCF_EXT_TX_CONT 0x4000 // Continuous transmit test
#define HCF_EXT_INT_TICK 0x8000 // enables TimerTick interrupt generation
/****************************** #define HCF_SLEEP *******************************/
#define HCF_DDS 0x0001 // Disconnected Deep Sleep
#define HCF_CDS 0x0002 // Connected Deep Sleep
/****************************** #define HCF_TALLIES ******************************/
#define HCF_TALLIES_NONE 0x0000 // No tally support
#define HCF_TALLIES_NIC 0x0001 // Hermes Tallies accumulated in IFB
#define HCF_TALLIES_HCF 0x0002 // HCF Tallies accumulated in IFB
#define HCF_TALLIES_RESET 0x8000 // Tallies in IFB are reset when reported via hcf_get_info
/************************************************************************************************/
/****************************************** L I N U X *****************************************/
/************************************************************************************************/
#ifdef WVLAN_49
#include <asm/io.h>
//#include <linux/module.h>
#include <wl_version.h>
/* The following macro ensures that no symbols are exported, minimizing the chance of a symbol
collision in the kernel */
//EXPORT_NO_SYMBOLS; //;?this place seems not appropriately to me
//#define HCF_SLEEP (HCF_CDS | HCF_DDS )
#define HCF_SLEEP (HCF_CDS)
/* Note: Non-WARP firmware all support WPA. However the original Agere
* linux driver does not enable WPA. Enabling WPA here causes whatever
* preliminary WPA logic to be included, some of which may be specific
* to HERMESI.
*
* Various comment are clear that WARP and WPA are not compatible
* (which may just mean WARP does WPA in a different fashion).
*/
/* #define HCF_TYPE (HCF_TYPE_HII5|HCF_TYPE_STA|HCF_TYPE_AP) */
#ifdef HERMES25
#ifdef WARP
#define HCF_TYPE ( HCF_TYPE_WARP | HCF_TYPE_HII5 )
#else
#define HCF_TYPE (HCF_TYPE_HII5 | HCF_TYPE_WPA)
#endif /* WARP */
#else
#define HCF_TYPE HCF_TYPE_WPA
#endif /* HERMES25 */
#ifdef ENABLE_DMA
#define HCF_DMA 1
#endif // ENABLE_DMA
/* We now need a switch to include support for the Mailbox and other necessary extensions */
#define HCF_EXT ( HCF_EXT_MB | HCF_EXT_INFO_LOG | HCF_EXT_INT_TICK )//get deepsleep exercise going
/* ;? The Linux MSF still uses these definitions; define it here until it's removed */
#ifndef HCF_TYPE_HII
#define HCF_TYPE_HII 0x0004
#endif
#ifndef HCF_TYPE_AP
#define HCF_TYPE_AP 0x0010
#endif
#ifndef HCF_TYPE_STA
#define HCF_TYPE_STA 0x0020
#endif // HCF_TYPE_STA
/* Guarantees word alignment */
#define HCF_ALIGN 2
/* Endian macros CNV_INT_TO_LITTLE() and CNV_LITTLE_TO_INT() were renamed to
CNV_SHORT_TO_LITTLE() and CNV_LITTLE_TO_SHORT() */
#ifndef CNV_INT_TO_LITTLE
#define CNV_INT_TO_LITTLE CNV_SHORT_TO_LITTLE
#endif
#ifndef CNV_LITTLE_TO_INT
#define CNV_LITTLE_TO_INT CNV_LITTLE_TO_SHORT
#endif
#define HCF_ERR_BUSY 0x06
/* UIL defines were removed from the HCF */
#define UIL_SUCCESS HCF_SUCCESS
#define UIL_ERR_TIME_OUT HCF_ERR_TIME_OUT
#define UIL_ERR_NO_NIC HCF_ERR_NO_NIC
#define UIL_ERR_LEN HCF_ERR_LEN
#define UIL_ERR_MIN HCF_ERR_MAX /*end of HCF errors which are passed through to UIL
*** ** *** ****** ***** *** ****** ******* ** *** */
#define UIL_ERR_IN_USE 0x44
#define UIL_ERR_WRONG_IFB 0x46
#define UIL_ERR_MAX 0x7F /*upper boundary of UIL errors without HCF-pendant
***** ******** ** *** ****** ******* *** ******* */
#define UIL_ERR_BUSY HCF_ERR_BUSY
#define UIL_ERR_DIAG_1 HCF_ERR_DIAG_1
#define UIL_FAILURE 0xFF /* 20010705 nv this relick should be eridicated */
#define UIL_ERR_PIF_CONFLICT 0x40 //obsolete
#define UIL_ERR_INCOMP_DRV 0x41 //obsolete
#define UIL_ERR_DOS_CALL 0x43 //obsolete
#define UIL_ERR_NO_DRV 0x42 //obsolete
#define UIL_ERR_NSTL 0x45 //obsolete
#if 0 //;? #ifdef get this going LATER HERMES25
#define HCF_IO HCF_IO_32BITS
#define HCF_DMA 1
#define HCF_DESC_STRCT_EXT 4
/* Switch for BusMaster DMA support. Note that the above define includes the DMA-specific HCF
code in the build. This define sets the MSF to use DMA; if ENABLE_DMA is not defined, then
port I/O will be used in the build */
#ifndef BUS_PCMCIA
#define ENABLE_DMA
#endif // USE_PCMCIA
#endif // HERMES25
/* Overrule standard WaveLAN Packet Size when in DMA mode */
#ifdef ENABLE_DMA
#define HCF_MAX_PACKET_SIZE 2304
#else
#define HCF_MAX_PACKET_SIZE 1514
#endif // ENABLE_DMA
/* The following sets the component ID, as well as the versioning. See also wl_version.h */
#define MSF_COMPONENT_ID COMP_ID_LINUX
#define MSF_COMPONENT_VAR DRV_VARIANT
#define MSF_COMPONENT_MAJOR_VER DRV_MAJOR_VERSION
#define MSF_COMPONENT_MINOR_VER DRV_MINOR_VERSION
/* Define the following to turn on assertions in the HCF */
//#define HCF_ASSERT 0x8000
#define HCF_ASSERT HCF_ASSERT_LNK_MSF_RTN // statically binding of msf_assert routine
#ifdef USE_BIG_ENDIAN
#define HCF_BIG_ENDIAN 1
#else
#define HCF_BIG_ENDIAN 0
#endif /* USE_BIG_ENDIAN */
/* Define the following if your system uses memory-mapped IO */
//#define HCF_MEM_IO
/* The following defines the standard macros required by the HCF to move data to/from the card */
#define IN_PORT_BYTE(port) ((hcf_8)inb( (hcf_io)(port) ))
#define IN_PORT_WORD(port) ((hcf_16)inw( (hcf_io)(port) ))
#define OUT_PORT_BYTE(port, value) (outb( (hcf_8) (value), (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) (outw((hcf_16) (value), (hcf_io)(port) ))
#define IN_PORT_STRING_16(port, dst, n) insw((hcf_io)(port), dst, n)
#define OUT_PORT_STRING_16(port, src, n) outsw((hcf_io)(port), src, n)
//#define IN_PORT_STRINGL(port, dst, n) insl((port), (dst), (n))
//#define OUT_PORT_STRINGL(port, src, n) outsl((port), (src), (n))
#define IN_PORT_STRING_32(port, dst, n) insl((port), (dst), (n))
#define OUT_PORT_STRING_32(port, src, n) outsl((port), (src), (n))
#define IN_PORT_HCF32(port) inl( (hcf_io)(port) )
#define OUT_PORT_HCF32(port, value) outl((hcf_32)(value), (hcf_io)(port) )
#define IN_PORT_DWORD(port) IN_PORT_HCF32(port)
#define OUT_PORT_DWORD(port, value) OUT_PORT_HCF32(port, value)
#define IN_PORT_STRING_8_16(port, addr, len) IN_PORT_STRING_16(port, addr, len)
#define OUT_PORT_STRING_8_16(port, addr, len) OUT_PORT_STRING_16(port, addr, len)
#ifndef CFG_SCAN_CHANNELS_2GHZ
#define CFG_SCAN_CHANNELS_2GHZ 0xFCC2
#endif /* CFG_SCAN_CHANNELS_2GHZ */
#define HCF_MAX_MSG 1600 //get going ;?
#endif // WVLAN_49
/************************************************************************************************************/
/*********************************** **************************************/
/************************************************************************************************************/
#if ! defined HCF_ALIGN
#define HCF_ALIGN 1 //default to no alignment
#endif // HCF_ALIGN
#if ! defined HCF_ASSERT
#define HCF_ASSERT 0
#endif // HCF_ASSERT
#if ! defined HCF_BIG_ENDIAN
#define HCF_BIG_ENDIAN 0
#endif // HCF_BIG_ENDIAN
#if ! defined HCF_DMA
#define HCF_DMA 0
#endif // HCF_DMA
#if ! defined HCF_ENCAP
#define HCF_ENCAP HCF_ENC
#endif // HCF_ENCAP
#if ! defined HCF_EXT
#define HCF_EXT 0
#endif // HCF_EXT
#if ! defined HCF_INT_ON
#define HCF_INT_ON 1
#endif // HCF_INT_ON
#if ! defined HCF_IO
#define HCF_IO 0 //default 16 bits support only, port I/O
#endif // HCF_IO
#if ! defined HCF_LEGACY
#define HCF_LEGACY 0
#endif // HCF_LEGACY
#if ! defined HCF_MAX_LTV
#define HCF_MAX_LTV 1200 // sufficient for all known purposes
#endif // HCF_MAX_LTV
#if ! defined HCF_PROT_TIME
#define HCF_PROT_TIME 100 // number of 10K microsec protection timer against H/W malfunction
#endif // HCF_PROT_TIME
#if ! defined HCF_SLEEP
#define HCF_SLEEP 0
#endif // HCF_SLEEP
#if ! defined HCF_TALLIES
#define HCF_TALLIES ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
#endif // HCF_TALLIES
#if ! defined HCF_TYPE
#define HCF_TYPE 0
#endif // HCF_TYPE
#if HCF_BIG_ENDIAN
#undef HCF_BIG_ENDIAN
#define HCF_BIG_ENDIAN 1 //just for convenience of generating cfg_hcf_opt
#endif // HCF_BIG_ENDIAN
#if HCF_DMA
#undef HCF_DMA
#define HCF_DMA 1 //just for convenience of generating cfg_hcf_opt
#endif // HCF_DMA
#if HCF_INT_ON
#undef HCF_INT_ON
#define HCF_INT_ON 1 //just for convenience of generating cfg_hcf_opt
#endif // HCF_INT_ON
#if ! defined IN_PORT_STRING_8_16
#define IN_PORT_STRING_8_16(port, addr, len) IN_PORT_STRING_16(port, addr, len)
#define OUT_PORT_STRING_8_16(port, addr, len) OUT_PORT_STRING_16(port, addr, len)
#endif // IN_PORT_STRING_8_16
/************************************************************************************************/
/********** *************/
/************************************************************************************************/
#if ! defined FAR
#define FAR // default to flat 32-bits code
#endif // FAR
typedef hcf_8 FAR *wci_bufp; // segmented 16-bits or flat 32-bits pointer to 8 bits unit
typedef hcf_16 FAR *wci_recordp; // segmented 16-bits or flat 32-bits pointer to 16 bits unit
/* I/O Address size
* Platforms which use port mapped I/O will (in general) have a 64k I/O space, conveniently expressed in a
* 16-bits quantity
* Platforms which use memory mapped I/O will (in general) have an I/O space much larger than 64k, and need a
* 32-bits quantity to express the I/O base
*/
#if HCF_IO & HCF_IO_MEM
typedef hcf_32 hcf_io;
#else
typedef hcf_16 hcf_io;
#endif //HCF_IO
#if HCF_PROT_TIME > 128
#define HCF_PROT_TIME_SHFT 3
#define HCF_PROT_TIME_DIV 8
#elif HCF_PROT_TIME > 64
#define HCF_PROT_TIME_SHFT 2
#define HCF_PROT_TIME_DIV 4
#elif HCF_PROT_TIME > 32
#define HCF_PROT_TIME_SHFT 1
#define HCF_PROT_TIME_DIV 2
#else //HCF_PROT_TIME >= 19
#define HCF_PROT_TIME_SHFT 0
#define HCF_PROT_TIME_DIV 1
#endif
#define HCF_PROT_TIME_CNT (HCF_PROT_TIME / HCF_PROT_TIME_DIV)
/************************************************************************************************************/
/******************************************* . . . . . . . . . *********************************************/
/************************************************************************************************************/
/* MSF_COMPONENT_ID is used to define the CFG_IDENTITY_STRCT in HCF.C
* CFG_IDENTITY_STRCT is defined in HCF.C purely based on convenience arguments.
* The HCF can not have the knowledge to determine the ComponentId field of the Identity record (aka as
* Version Record), therefore the MSF part of the Drivers must supply this value via the System Constant
* MSF_COMPONENT_ID.
* There is a set of values predefined in MDD.H (format COMP_ID_.....)
*
* Note that taking MSF_COMPONENT_ID as a default value for DUI_COMPAT_VAR is purely an implementation
* convenience, the numerical values of these two quantities have none functional relationship whatsoever.
*/
#if defined MSF_COMPONENT_ID
#if ! defined DUI_COMPAT_VAR
#define DUI_COMPAT_VAR MSF_COMPONENT_ID
#endif // DUI_COMPAT_VAR
#if ! defined DUI_COMPAT_BOT //;?this way utilities can lower as well raise the bottom
#define DUI_COMPAT_BOT 8
#endif // DUI_COMPAT_BOT
#if ! defined DUI_COMPAT_TOP //;?this way utilities can lower as well raise the top
#define DUI_COMPAT_TOP 8
#endif // DUI_COMPAT_TOP
#endif // MSF_COMPONENT_ID
#if (HCF_TYPE) & HCF_TYPE_HII5
#if ! defined HCF_HSI_VAR_5
#define HCF_HSI_VAR_5
#endif // HCF_HSI_VAR_5
#if ! defined HCF_APF_VAR_4
#define HCF_APF_VAR_4
#endif // HCF_APF_VAR_4
#if (HCF_TYPE) & HCF_TYPE_WARP
#if ! defined HCF_STA_VAR_4
#define HCF_STA_VAR_4
#endif // HCF_STA_VAR_4
#else
#if ! defined HCF_STA_VAR_2
#define HCF_STA_VAR_2
#endif // HCF_STA_VAR_2
#endif
#if defined HCF_HSI_VAR_4
err: HSI variants 4 correspond with HII;
#endif // HCF_HSI_VAR_4
#else
#if ! defined HCF_HSI_VAR_4
#define HCF_HSI_VAR_4 //Hermes-II all types (for the time being!)
#endif // HCF_HSI_VAR_4
#if ! defined HCF_APF_VAR_2
#define HCF_APF_VAR_2
#endif // HCF_APF_VAR_2
#if ! defined HCF_STA_VAR_2
#define HCF_STA_VAR_2
#endif // HCF_STA_VAR_2
#endif // HCF_TYPE_HII5
#if ! defined HCF_PRI_VAR_3
#define HCF_PRI_VAR_3
#endif // HCF_PRI_VAR_3
#if defined HCF_HSI_VAR_1 || defined HCF_HSI_VAR_2 || defined HCF_HSI_VAR_3
err: HSI variants 1, 2 and 3 correspond with H-I only;
#endif // HCF_HSI_VAR_1, HCF_HSI_VAR_2, HCF_HSI_VAR_3
#if defined HCF_PRI_VAR_1 || defined HCF_PRI_VAR_2
err: primary variants 1 and 2 correspond with H-I only;
#endif // HCF_PRI_VAR_1 / HCF_PRI_VAR_2
/************************************************************************************************************/
/******************************************* . . . . . . . . . *********************************************/
/************************************************************************************************************/
/* The BASED customization macro is used to resolves the SS!=DS conflict for the Interrupt Service logic in
* DOS Drivers. Due to the cumbersomeness of mixing C and assembler local BASED variables still end up in the
* wrong segment. The workaround is that the HCF uses only global BASED variables or IFB-based variables.
* The "BASED" construction (supposedly) only amounts to something in the small memory model.
*
* Note that the whole BASED rigmarole is needlessly complicated because both the Microsoft Compiler and
* Linker are unnecessary restrictive in what far pointer manipulation they allow
*/
#if ! defined BASED
#define BASED
#endif // BASED
#if ! defined EXTERN_C
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C
#endif // __cplusplus
#endif // EXTERN_C
#if ! defined NULL
#define NULL ((void *) 0)
#endif // NULL
#if ! defined TEXT
#define TEXT(x) x
#endif // TEXT
/************************************************************************************************************/
/*********************** C O N F L I C T D E T E C T I O N & R E S O L U T I O N ************************/
/************************************************************************************************************/
#if HCF_ALIGN != 1 && HCF_ALIGN != 2 && HCF_ALIGN != 4 && HCF_ALIGN != 8
err: invalid value for HCF_ALIGN;
#endif // HCF_ALIGN
#if (HCF_ASSERT) & ~( HCF_ASSERT_PRINTF | HCF_ASSERT_SW_SUP | HCF_ASSERT_MB | HCF_ASSERT_RT_MSF_RTN | \
HCF_ASSERT_LNK_MSF_RTN )
err: invalid value for HCF_ASSERT;
#endif // HCF_ASSERT
#if (HCF_ASSERT) & HCF_ASSERT_MB && ! ( (HCF_EXT) & HCF_EXT_MB ) //detect potential conflict
err: these macros are not used consistently;
#endif // HCF_ASSERT_MB / HCF_EXT_MB
#if HCF_BIG_ENDIAN != 0 && HCF_BIG_ENDIAN != 1
err: invalid value for HCF_BIG_ENDIAN;
#endif // HCF_BIG_ENDIAN
#if HCF_DMA != 0 && HCF_DMA != 1
err: invalid value for HCF_DMA;
#endif // HCF_DMA
#if (HCF_ENCAP) & ~( HCF_ENC | HCF_ENC_SUP )
err: invalid value for HCF_ENCAP;
#endif // HCF_ENCAP
#if (HCF_EXT) & ~( HCF_EXT_INFO_LOG | HCF_EXT_INT_TX_EX | HCF_EXT_TALLIES_FW | HCF_EXT_TALLIES_HCF | \
HCF_EXT_NIC_ACCESS | HCF_EXT_MB | HCF_EXT_INT_TICK | \
HCF_EXT_IFB_STRCT | HCF_EXT_DESC_STRCT | HCF_EXT_TX_CONT )
err: invalid value for HCF_EXT;
#endif // HCF_EXT
#if HCF_INT_ON != 0 && HCF_INT_ON != 1
err: invalid value for HCF_INT_ON;
#endif // HCF_INT_ON
#if (HCF_IO) & ~( HCF_IO_MEM | HCF_IO_32BITS )
err: invalid value for HCF_IO;
#endif // HCF_IO
#if HCF_LEGACY != 0 && HCF_LEGACY != 1
err: invalid value for HCF_LEGACY;
#endif // HCF_LEGACY
#if HCF_MAX_LTV < 16 || HCF_MAX_LTV > 2304
err: invalid value for HCF_MAX_LTV;
#endif // HCF_MAX_LTV
#if HCF_PROT_TIME != 0 && ( HCF_PROT_TIME < 19 || 256 < HCF_PROT_TIME )
err: below minimum .08 second required by Hermes or possibly above hcf_32 capacity;
#endif // HCF_PROT_TIME
#if (HCF_SLEEP) & ~( HCF_CDS | HCF_DDS )
err: invalid value for HCF_SLEEP;
#endif // HCF_SLEEP
#if (HCF_SLEEP) && ! (HCF_INT_ON)
err: these macros are not used consistently;
#endif // HCF_SLEEP / HCF_INT_ON
#if (HCF_SLEEP) && ! ( (HCF_EXT) & HCF_EXT_INT_TICK )
//;? err: these macros are not used consistently;
#endif // HCF_SLEEP / HCF_EXT_INT_TICK
#if (HCF_TALLIES) & ~( HCF_TALLIES_HCF | HCF_TALLIES_NIC | HCF_TALLIES_RESET ) || \
(HCF_TALLIES) == HCF_TALLIES_RESET
err: invalid value for HCF_TALLIES;
#endif // HCF_TALLIES
#if (HCF_TYPE) & ~(HCF_TYPE_WPA | HCF_TYPE_USB | HCF_TYPE_PRELOADED | HCF_TYPE_HII5 | HCF_TYPE_WARP | \
HCF_TYPE_CCX /* | HCF_TYPE_TX_DELAY */ )
err: invalid value for HCF_TYPE;
#endif //HCF_TYPE
#if (HCF_TYPE) & HCF_TYPE_WARP && (HCF_TYPE) & HCF_TYPE_WPA
err: at most 1 of these macros should be defined;
#endif //HCF_TYPE_WARP / HCF_TYPE_WPA
#endif //HCFCFG_H

View file

@ -1,752 +0,0 @@
#ifndef HCFDEFC_H
#define HCFDEFC_H 1
/*************************************************************************************************
*
* FILE : HCFDEF.H
*
* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.8 $
* Original: 2004/05/28 14:05:35 Revision: 1.59 Tag: hcf7_t20040602_01
* Original: 2004/05/13 15:31:45 Revision: 1.53 Tag: hcf7_t7_20040513_01
* Original: 2004/04/15 09:24:42 Revision: 1.44 Tag: hcf7_t7_20040415_01
* Original: 2004/04/13 14:22:45 Revision: 1.43 Tag: t7_20040413_01
* Original: 2004/04/01 15:32:55 Revision: 1.40 Tag: t7_20040401_01
* Original: 2004/03/10 15:39:28 Revision: 1.36 Tag: t20040310_01
* Original: 2004/03/03 14:10:12 Revision: 1.34 Tag: t20040304_01
* Original: 2004/03/02 09:27:12 Revision: 1.32 Tag: t20040302_03
* Original: 2004/02/24 13:00:29 Revision: 1.29 Tag: t20040224_01
* Original: 2004/02/18 17:13:57 Revision: 1.26 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* SPECIFICATION: ...........
*
* DESC : Definitions and Prototypes for HCF only
*
**************************************************************************************************
*
*
* 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.
*
*
*************************************************************************************************/
/************************************************************************************************/
/********************************* P R E F I X E S ********************************************/
/************************************************************************************************/
//IFB_ Interface Block
//HCMD_ Hermes Command
//HFS_ Hermes (Transmit/Receive) Frame Structure
//HREG_ Hermes Register
/*************************************************************************************************/
/************************************************************************************************/
/********************************* GENERAL EQUATES **********************************************/
/************************************************************************************************/
#define HCF_MAGIC 0x7D37 // "}7" Handle validation
#define PLUG_DATA_OFFSET 0x00000800 //needed by some test tool on top of H-II NDIS driver
#define INI_TICK_INI 0x00040000L
#define IO_IN 0 //hcfio_in_string
#define IO_OUT 1 //hcfio_out_string
//DO_ASSERT, create an artificial FALSE to force an ASSERT without the nasty compiler warning
#define DO_ASSERT ( assert_ifbp->IFB_Magic != HCF_MAGIC && assert_ifbp->IFB_Magic == HCF_MAGIC )
#define NT_ASSERT 0x0000 //, NEVER_TESTED
#define NEVER_TESTED MERGE_2( 0xEFFE, 0xFEEF )
#define SE_ASSERT 0x5EFF /* Side Effect, HCFASSERT invokation which are only called for the
* side effect and which should never trigger */
#define DHF_FILE_NAME_OFFSET 10000 //to distinguish DHF from HCF asserts by means of line number
#define MMD_FILE_NAME_OFFSET 20000 //to distinguish MMD from HCF asserts by means of line number
// trace codes used to
// 1: profile execution times via HCF_TRACE and HCF_TRACE_VALUE
// 2: hierarchical flow information via HCFLOGENTRY / HCFLOGEXIT
//#define HCF_TRACE_CONNECT useless
//#define HCF_TRACE_DISCONNECT useless
#define HCF_TRACE_ACTION 0x0000 // 0x0001
#define HCF_TRACE_CNTL 0x0001 // 0x0002
#define HCF_TRACE_DMA_RX_GET 0x0002 // 0x0004
#define HCF_TRACE_DMA_RX_PUT 0x0003 // 0x0008
#define HCF_TRACE_DMA_TX_GET 0x0004 // 0x0010
#define HCF_TRACE_DMA_TX_PUT 0x0005 // 0x0020
#define HCF_TRACE_GET_INFO 0x0006 // 0x0040
#define HCF_TRACE_PUT_INFO 0x0007 // 0x0080
#define HCF_TRACE_RCV_MSG 0x0008 // 0x0100
#define HCF_TRACE_SEND_MSG 0x0009 // 0x0200
#define HCF_TRACE_SERVICE_NIC 0x000A // 0x0400
// #define HCF_TRACE_ 0x000C // 0x1000
// #define HCF_TRACE_ 0x000D // 0x2000
// #define HCF_TRACE_ 0x000E // 0x4000
// #define HCF_TRACE_ 0x000F // 0x8000
// ============================================ HCF_TRACE_... codes below 0x0010 are asserted on re-entry
#define HCF_TRACE_ACTION_KLUDGE 0x0010 /* once you start introducing kludges there is no end to it
* this is an escape to do not assert on re-entrancy problem caused
* by HCF_ACT_INT_FORCE_ON used to get Microsofts NDIS drivers going
*/
#define HCF_TRACE_STRIO 0x0020
#define HCF_TRACE_ALLOC 0X0021
#define HCF_TRACE_DL 0X0023
#define HCF_TRACE_ISR_INFO 0X0024
#define HCF_TRACE_CALIBRATE 0x0026
#define HCF_TRACE_CMD_CPL 0x0040
#define HCF_TRACE_CMD_EXE 0x0041
#define HCF_TRACE_GET_FID 0x0042
#define HCF_TRACE_GET_FRAG 0x0043
#define HCF_TRACE_INIT 0x0044
#define HCF_TRACE_PUT_FRAG 0x0045
#define HCF_TRACE_SETUP_BAP 0x0046
#define HCF_TRACE_EXIT 0x8000 // Keil C warns "long constant truncated to int"
//#define BAP_0 HREG_DATA_0 //Used by DMA controller to access NIC RAM
#define BAP_1 HREG_DATA_1 //Used by HCF to access NIC RAM
//************************* Hermes Receive/Transmit Frame Structures
//HFS_STAT
//see MMD.H for HFS_STAT_ERR
#define HFS_STAT_MSG_TYPE 0xE000 //Hermes reported Message Type
#define HFS_STAT_MIC_KEY_ID 0x1800 //MIC key used (if any)
#define HFS_STAT_1042 0x2000 //RFC1042 Encoded
#define HFS_STAT_TUNNEL 0x4000 //Bridge-Tunnel Encoded
#define HFS_STAT_WMP_MSG 0x6000 //WaveLAN-II Management Protocol Frame
#if (HCF_TYPE) & HCF_TYPE_WPA
#define HFS_STAT_MIC 0x0010 //Frame contains MIC //;? re-instate when F/W ready
#endif
//************************* Hermes Register Offsets and Command bits
#define HREG_IO_RANGE 0x80 //I/O Range used by Hermes
//************************* Command/Status
#define HREG_CMD 0x00 //
#define HCMD_CMD_CODE 0x3F
#define HREG_PARAM_0 0x02 //
#define HREG_PARAM_1 0x04 //
#define HREG_PARAM_2 0x06 //
#define HREG_STAT 0x08 //
#define HREG_STAT_CMD_CODE 0x003F //
#define HREG_STAT_DIAG_ERR 0x0100
#define HREG_STAT_INQUIRE_ERR 0x0500
#define HREG_STAT_CMD_RESULT 0x7F00 //
#define HREG_RESP_0 0x0A //
#define HREG_RESP_1 0x0C //
#define HREG_RESP_2 0x0E //
//************************* FID Management
#define HREG_INFO_FID 0x10 //
#define HREG_RX_FID 0x20 //
#define HREG_ALLOC_FID 0x22 //
#define HREG_TX_COMPL_FID 0x24 //
//************************* BAP
//20031030 HWi Inserted this again because the dongle code uses this (GPIF.C)
//#define HREG_SELECT_0 0x18 //
//#define HREG_OFFSET_0 0x1C //
//#define HREG_DATA_0 0x36 //
//#define HREG_OFFSET_BUSY 0x8000 // use HCMD_BUSY
#define HREG_OFFSET_ERR 0x4000 //
//rsrvd #define HREG_OFFSET_DATA_OFFSET 0x0FFF //
#define HREG_SELECT_1 0x1A //
#define HREG_OFFSET_1 0x1E //
#define HREG_DATA_1 0x38 //
//************************* Event
#define HREG_EV_STAT 0x30 //
#define HREG_INT_EN 0x32 //
#define HREG_EV_ACK 0x34 //
#define HREG_EV_TICK 0x8000 //Auxiliary Timer Tick
//#define HREG_EV_RES 0x4000 //H-I only: H/W error (Wait Time-out)
#define HREG_EV_INFO_DROP 0x2000 //WMAC did not have sufficient RAM to build Unsollicited Frame
#if (HCF_TYPE) & HCF_TYPE_HII5
#define HREG_EV_ACK_REG_READY 0x0000
#else
#define HREG_EV_ACK_REG_READY 0x1000 //Workaround Kludge bit for H-II (not H-II.5)
#endif // HCF_TYPE_HII5
#if (HCF_SLEEP) & ( HCF_CDS | HCF_DDS )
#define HREG_EV_SLEEP_REQ 0x0800
#else
#define HREG_EV_SLEEP_REQ 0x0000
#endif // HCF_CDS / HCF_DDS
#if HCF_DMA
//#define HREG_EV_LPESC 0x0400 // firmware sets this bit and clears it, not for host usage.
#define HREG_EV_RDMAD 0x0200 // rx frame in host memory
#define HREG_EV_TDMAD 0x0100 // tx frame in host memory processed
//#define HREG_EV_RXDMA 0x0040 // firmware kicks off DMA engine (bit is not for host usage)
//#define HREG_EV_TXDMA 0x0020 // firmware kicks off DMA engine (bit is not for host usage)
#define HREG_EV_FW_DMA 0x0460 // firmware / DMA engine I/F (bits are not for host usage)
#else
#define HREG_EV_FW_DMA 0x0000
#endif // HCF_DMA
#define HREG_EV_INFO 0x0080 // Asynchronous Information Frame
#define HREG_EV_CMD 0x0010 // Command completed, Status and Response available
#define HREG_EV_ALLOC 0x0008 // Asynchronous part of Allocation/Reclaim completed
#define HREG_EV_TX_EXC 0x0004 // Asynchronous Transmission unsuccessful completed
#define HREG_EV_TX 0x0002 // Asynchronous Transmission successful completed
#define HREG_EV_RX 0x0001 // Asynchronous Receive Frame
#define HREG_EV_TX_EXT ( (HCF_EXT) & (HCF_EXT_INT_TX_EX | HCF_EXT_INT_TICK ) )
/* HREG_EV_TX_EXT := 0x0000 or HREG_EV_TX_EXC and/or HREG_EV_TICK
* could be extended with HREG_EV_TX */
#if HCF_EXT_INT_TX_EX != HREG_EV_TX_EXC
err: these values should match;
#endif // HCF_EXT_INT_TX_EX / HREG_EV_TX_EXC
#if HCF_EXT_INT_TICK != HREG_EV_TICK
err: these values should match;
#endif // HCF_EXT_INT_TICK / HREG_EV_TICK
//************************* Host Software
#define HREG_SW_0 0x28 //
#define HREG_SW_1 0x2A //
#define HREG_SW_2 0x2C //
//rsrvd #define HREG_SW_3 0x2E //
//************************* Control and Auxiliary Port
#define HREG_IO 0x12
#define HREG_IO_SRESET 0x0001
#define HREG_IO_WAKEUP_ASYNC 0x0002
#define HREG_IO_WOKEN_UP 0x0004
#define HREG_CNTL 0x14 //
//#define HREG_CNTL_WAKEUP_SYNC 0x0001
#define HREG_CNTL_AUX_ENA_STAT 0xC000
#define HREG_CNTL_AUX_DIS_STAT 0x0000
#define HREG_CNTL_AUX_ENA_CNTL 0x8000
#define HREG_CNTL_AUX_DIS_CNTL 0x4000
#define HREG_CNTL_AUX_DSD 0x2000
#define HREG_CNTL_AUX_ENA (HREG_CNTL_AUX_ENA_CNTL | HREG_CNTL_AUX_DIS_CNTL )
#define HREG_SPARE 0x16 //
#define HREG_AUX_PAGE 0x3A //
#define HREG_AUX_OFFSET 0x3C //
#define HREG_AUX_DATA 0x3E //
#if HCF_DMA
//************************* DMA (bus mastering)
// Be careful to use these registers only at a genuine 32 bits NIC
// On 16 bits NICs, these addresses are mapped into the range 0x00 through 0x3F with all consequences
// thereof, e.g. HREG_DMA_CTRL register maps to HREG_CMD.
#define HREG_DMA_CTRL 0x0040
#define HREG_TXDMA_PTR32 0x0044
#define HREG_TXDMA_PRIO_PTR32 0x0048
#define HREG_TXDMA_HIPRIO_PTR32 0x004C
#define HREG_RXDMA_PTR32 0x0050
#define HREG_CARDDETECT_1 0x007C // contains 7D37
#define HREG_CARDDETECT_2 0x007E // contains 7DE7
#define HREG_FREETIMER 0x0058
#define HREG_DMA_RX_CNT 0x0026
/******************************************************************************
* Defines for the bits in the DmaControl register (@40h)
******************************************************************************/
#define HREG_DMA_CTRL_RXHWEN 0x80000000 // high word enable bit
#define HREG_DMA_CTRL_RXRESET 0x40000000 // tx dma init bit
#define HREG_DMA_CTRL_RXBAP1 BIT29
#define HREG_DMA_CTRL_RX_STALLED BIT28
#define HREG_DMA_CTRL_RXAUTOACK_DMADONE BIT27 // no host involvement req. for TDMADONE event
#define HREG_DMA_CTRL_RXAUTOACK_INFO BIT26 // no host involvement req. for alloc event
#define HREG_DMA_CTRL_RXAUTOACK_DMAEN 0x02000000 // no host involvement req. for TxDMAen event
#define HREG_DMA_CTRL_RXAUTOACK_RX 0x01000000 // no host involvement req. for tx event
#define HREG_DMA_CTRL_RX_BUSY BIT23 // read only bit
//#define HREG_DMA_CTRL_RX_RBUFCONT_PLAIN 0 // bits 21..20
//#define HREG_DMA_CTRL_RX_MODE_PLAIN_DMA 0 // mode 0
#define HREG_DMA_CTRL_RX_MODE_SINGLE_PACKET 0x00010000 // mode 1
#define HREG_DMA_CTRL_RX_MODE_MULTI_PACKET 0x00020000 // mode 2
//#define HREG_DMA_CTRL_RX_MODE_DISABLE (0x00020000|0x00010000) // disable tx dma engine
#define HREG_DMA_CTRL_TXHWEN 0x8000 // low word enable bit
#define HREG_DMA_CTRL_TXRESET 0x4000 // rx dma init bit
#define HREG_DMA_CTRL_TXBAP1 BIT13
#define HREG_DMA_CTRL_TXAUTOACK_DMADONE BIT11 // no host involvement req. for RxDMADONE event
#define HREG_DMA_CTRL_TXAUTOACK_DMAEN 0x00000400 // no host involvement req. for RxDMAen event
#define HREG_DMA_CTRL_TXAUTOACK_DMAALLOC 0x00000200 // no host involvement req. for info event
#define HREG_DMA_CTRL_TXAUTOACK_TX 0x00000100 // no host involvement req. for rx event
#define HREG_DMA_CTRL_TX_BUSY BIT7 // read only bit
//#define HREG_DMA_CTRL_TX_TBUFCONT_PLAIN 0 // bits 6..5
//#define HREG_DMA_CTRL_TX_MODE_PLAIN_DMA 0 // mode 0
#define HREG_DMA_CTRL_TX_MODE_SINGLE_PACKET BIT0 // mode 1
#define HREG_DMA_CTRL_TX_MODE_MULTI_PACKET 0x00000002 // mode 2
//#define HREG_DMA_CTRL_TX_MODE_DISABLE (0x00000001|0x00000002) // disable tx dma engine
//configuration DWORD to configure DMA for mode2 operation, using BAP0 as the DMA BAP.
#define DMA_CTRLSTAT_GO (HREG_DMA_CTRL_RXHWEN | HREG_DMA_CTRL_RX_MODE_MULTI_PACKET | \
HREG_DMA_CTRL_RXAUTOACK_DMAEN | HREG_DMA_CTRL_RXAUTOACK_RX | \
HREG_DMA_CTRL_TXHWEN | /*;?HREG_DMA_CTRL_TX_TBUFCONT_PLAIN |*/ \
HREG_DMA_CTRL_TX_MODE_MULTI_PACKET | HREG_DMA_CTRL_TXAUTOACK_DMAEN | \
HREG_DMA_CTRL_TXAUTOACK_DMAALLOC)
//configuration DWORD to reset both the Tx and Rx DMA engines
#define DMA_CTRLSTAT_RESET (HREG_DMA_CTRL_RXHWEN | HREG_DMA_CTRL_RXRESET | HREG_DMA_CTRL_TXHWEN | HREG_DMA_CTRL_TXRESET)
//#define DESC_DMA_OWNED 0x80000000 // BIT31
#define DESC_DMA_OWNED 0x8000 // BIT31
#define DESC_SOP 0x8000 // BIT15
#define DESC_EOP 0x4000 // BIT14
#define DMA_RX 0
#define DMA_TX 1
// #define IFB_RxFirstDesc IFB_FirstDesc[DMA_RX]
// #define IFB_TxFirstDesc IFB_FirstDesc[DMA_TX]
// #define IFB_RxLastDesc IFB_LastDesc[DMA_RX]
// #define IFB_TxLastDesc IFB_LastDesc[DMA_TX]
#endif // HCF_DMA
//
/************************************************************************************************/
/********************************** EQUATES ***************************************************/
/************************************************************************************************/
// Hermes Command Codes and Qualifier bits
#define HCMD_BUSY 0x8000 // Busy bit, applicable for all commands
#define HCMD_INI 0x0000 //
#define HCMD_ENABLE HCF_CNTL_ENABLE // 0x0001
#define HCMD_DISABLE HCF_CNTL_DISABLE // 0x0002
#define HCMD_CONNECT HCF_CNTL_CONNECT // 0x0003
#define HCMD_EXECUTE 0x0004 //
#define HCMD_DISCONNECT HCF_CNTL_DISCONNECT // 0x0005
#define HCMD_SLEEP 0x0006 //
#define HCMD_CONTINUE HCF_CNTL_CONTINUE // 0x0007
#define HCMD_RETRY 0x0100 // Retry bit
#define HCMD_ALLOC 0x000A //
#define HCMD_TX 0x000B //
#define HCMD_RECL 0x0100 // Reclaim bit, applicable for Tx and Inquire
#define HCMD_INQUIRE 0x0011 //
#define HCMD_ACCESS 0x0021 //
#define HCMD_ACCESS_WRITE 0x0100 // Write bit
#define HCMD_PROGRAM 0x0022 //
#define HCMD_READ_MIF 0x0030
#define HCMD_WRITE_MIF 0x0031
#define HCMD_THESEUS 0x0038
#define HCMD_STARTPREAMBLE 0x0E00 // Start continuous preamble Tx
#define HCMD_STOP 0x0F00 // Stop Theseus test mode
//Configuration Management
//
#define CFG_DRV_ACT_RANGES_PRI_3_BOTTOM 1 // Default Bottom Compatibility for Primary Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_PRI_3_TOP 1 // Default Top Compatibility for Primary Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_HSI_4_BOTTOM 1 // Default Bottom Compatibility for H/W - driver I/F
#define CFG_DRV_ACT_RANGES_HSI_4_TOP 1 // Default Top Compatibility for H/W - driver I/F
#define CFG_DRV_ACT_RANGES_HSI_5_BOTTOM 1 // Default Bottom Compatibility for H/W - driver I/F
#define CFG_DRV_ACT_RANGES_HSI_5_TOP 1 // Default Top Compatibility for H/W - driver I/F
#if (HCF_TYPE) & HCF_TYPE_WPA
#define CFG_DRV_ACT_RANGES_APF_1_BOTTOM 16 // Default Bottom Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_1_TOP 16 // Default Top Compatibility for AP Firmware - driver I/F
#else //;? is this REALLY O.K.
#define CFG_DRV_ACT_RANGES_APF_1_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_1_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
#endif // HCF_TYPE_WPA
#define CFG_DRV_ACT_RANGES_APF_2_BOTTOM 2 // Default Bottom Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_2_TOP 2 // Default Top Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_3_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_3_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_4_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_APF_4_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
#if (HCF_TYPE) & HCF_TYPE_HII5
#define CFG_DRV_ACT_RANGES_STA_2_BOTTOM 6 // Default Bottom Compatibility for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA_2_TOP 6 // Default Top Compatibility for Station Firmware - driver I/F
#else // (HCF_TYPE) & HCF_TYPE_HII5
#define CFG_DRV_ACT_RANGES_STA_2_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA_2_TOP 2 // Default Top Compatibility for Station Firmware - driver I/F
#endif // (HCF_TYPE) & HCF_TYPE_HII5
#define CFG_DRV_ACT_RANGES_STA_3_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA_3_TOP 1 // Default Top Compatibility for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA_4_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA_4_TOP 1 // Default Top Compatibility for Station Firmware - driver I/F
//---------------------------------------------------------------------------------------------------------------------
#if defined HCF_CFG_PRI_1_TOP || defined HCF_CFG_PRI_1_BOTTOM
err: PRI_1 not supported for H-I; // Compatibility for Primary Firmware - driver I/F
#endif // HCF_CFG_PRI_1_TOP / HCF_CFG_PRI_1_BOTTOM
#if defined HCF_CFG_PRI_2_TOP || defined HCF_CFG_PRI_2_BOTTOM
err: PRI_2 not supported for H-I; // Compatibility for Primary Firmware - driver I/F
#endif // HCF_CFG_PRI_2_TOP / HCF_CFG_PRI_2_BOTTOM
#ifdef HCF_CFG_PRI_3_TOP // Top Compatibility for Primary Firmware - driver I/F
#if HCF_CFG_PRI_3_TOP == 0 || \
CFG_DRV_ACT_RANGES_PRI_3_BOTTOM <= HCF_CFG_PRI_3_TOP && HCF_CFG_PRI_3_TOP <= CFG_DRV_ACT_RANGES_PRI_3_TOP
#undef CFG_DRV_ACT_RANGES_PRI_3_TOP
#define CFG_DRV_ACT_RANGES_PRI_3_TOP HCF_CFG_PRI_3_TOP
#else
err: ;
#endif
#endif // HCF_CFG_PRI_3_TOP
#ifdef HCF_CFG_PRI_3_BOTTOM // Bottom Compatibility for Primary Firmware - driver I/F
#if CFG_DRV_ACT_RANGES_PRI_3_BOTTOM <= HCF_CFG_PRI_3_BOTTOM && HCF_CFG_PRI_3_BOTTOM <= CFG_DRV_ACT_RANGES_PRI_3_TOP
#undef CFG_DRV_ACT_RANGES_PRI_3_BOTTOM
#define CFG_DRV_ACT_RANGES_PRI_3_BOTTOM HCF_CFG_PRI_3_BOTTOM
#else
err: ;
#endif
#endif // HCF_CFG_PRI_3_BOTTOM
//---------------------------------------------------------------------------------------------------------------------
#if defined HCF_CFG_HSI_0_TOP || defined HCF_CFG_HSI_0_BOTTOM
err: HSI_0 not supported for H-I; // Compatibility for HSI I/F
#endif // HCF_CFG_HSI_0_TOP / HCF_CFG_HSI_0_BOTTOM
#if defined HCF_CFG_HSI_1_TOP || defined HCF_CFG_HSI_1_BOTTOM
err: HSI_1 not supported for H-I; // Compatibility for HSI I/F
#endif // HCF_CFG_HSI_1_TOP / HCF_CFG_HSI_1_BOTTOM
#if defined HCF_CFG_HSI_2_TOP || defined HCF_CFG_HSI_2_BOTTOM
err: HSI_2 not supported for H-I; // Compatibility for HSI I/F
#endif // HCF_CFG_HSI_2_TOP / HCF_CFG_HSI_2_BOTTOM
#if defined HCF_CFG_HSI_3_TOP || defined HCF_CFG_HSI_3_BOTTOM
err: HSI_3 not supported for H-I; // Compatibility for HSI I/F
#endif // HCF_CFG_HSI_3_TOP / HCF_CFG_HSI_3_BOTTOM
#ifdef HCF_CFG_HSI_4_TOP // Top Compatibility for HSI I/F
#if HCF_CFG_HSI_4_TOP == 0 || \
CFG_DRV_ACT_RANGES_HSI_4_BOTTOM <= CF_CFG_HSI_4_TOP && HCF_CFG_HSI_4_TOP <= CFG_DRV_ACT_RANGES_HSI_4_TOP
#undef CFG_DRV_ACT_RANGES_HSI_4_TOP
#define CFG_DRV_ACT_RANGES_HSI_4_TOP HCF_CFG_HSI_4_TOP
#else
err: ;
#endif
#endif // HCF_CFG_HSI_4_TOP
#ifdef HCF_CFG_HSI_4_BOTTOM // Bottom Compatibility for HSI I/F
#if CFG_DRV_ACT_RANGES_HSI_4_BOTTOM <= HCF_CFG_HSI_4_BOTTOM && HCF_CFG_HSI_4_BOTTOM <= CFG_DRV_ACT_RANGES_HSI_4_TOP
#undef CFG_DRV_ACT_RANGES_HSI_4_BOTTOM
#define CFG_DRV_ACT_RANGES_HSI_4_BOTTOM HCF_CFG_HSI_4_BOTTOM
#else
err: ;
#endif
#endif // HCF_CFG_HSI_4_BOTTOM
#ifdef HCF_CFG_HSI_5_TOP // Top Compatibility for HSI I/F
#if HCF_CFG_HSI_5_TOP == 0 || \
CFG_DRV_ACT_RANGES_HSI_5_BOTTOM <= CF_CFG_HSI_5_TOP && HCF_CFG_HSI_5_TOP <= CFG_DRV_ACT_RANGES_HSI_5_TOP
#undef CFG_DRV_ACT_RANGES_HSI_5_TOP
#define CFG_DRV_ACT_RANGES_HSI_5_TOP HCF_CFG_HSI_5_TOP
#else
err: ;
#endif
#endif // HCF_CFG_HSI_5_TOP
#ifdef HCF_CFG_HSI_5_BOTTOM // Bottom Compatibility for HSI I/F
#if CFG_DRV_ACT_RANGES_HSI_5_BOTTOM <= HCF_CFG_HSI_5_BOTTOM && HCF_CFG_HSI_5_BOTTOM <= CFG_DRV_ACT_RANGES_HSI_5_TOP
#undef CFG_DRV_ACT_RANGES_HSI_5_BOTTOM
#define CFG_DRV_ACT_RANGES_HSI_5_BOTTOM HCF_CFG_HSI_5_BOTTOM
#else
err: ;
#endif
#endif // HCF_CFG_HSI_5_BOTTOM
//---------------------------------------------------------------------------------------------------------------------
#if defined HCF_CFG_APF_1_TOP || defined HCF_CFG_APF_1_BOTTOM
err: APF_1 not supported for H-I; // Compatibility for AP Firmware - driver I/F
#endif // HCF_CFG_APF_1_TOP / HCF_CFG_APF_1_BOTTOM
#ifdef HCF_CFG_APF_2_TOP // Top Compatibility for AP Firmware - driver I/F
#if HCF_CFG_APF_2_TOP == 0 || \
CFG_DRV_ACT_RANGES_APF_2_BOTTOM <= HCF_CFG_APF_2_TOP && HCF_CFG_APF_2_TOP <= CFG_DRV_ACT_RANGES_APF_2_TOP
#undef CFG_DRV_ACT_RANGES_APF_2_TOP
#define CFG_DRV_ACT_RANGES_APF_2_TOP HCF_CFG_APF_2_TOP
#else
err: ;
#endif
#endif // HCF_CFG_APF_TOP
#ifdef HCF_CFG_APF_2_BOTTOM // Bottom Compatibility for AP Firmware - driver I/F
#if CFG_DRV_ACT_RANGES_APF_2_BOTTOM <= HCF_CFG_APF_2_BOTTOM && HCF_CFG_APF_2_BOTTOM <= CFG_DRV_ACT_RANGES_APF_2_TOP
#undef CFG_DRV_ACT_RANGES_APF_2_BOTTOM
#define CFG_DRV_ACT_RANGES_APF_2_BOTTOM HCF_CFG_APF_2_BOTTOM
#else
err: ;
#endif
#endif // HCF_CFG_APF_BOTTOM
//---------------------------------------------------------------------------------------------------------------------
#if defined HCF_CFG_STA_1_TOP || defined HCF_CFG_STA_1_BOTTOM
err: STA_1 not supported for H-I; // Compatibility for Station Firmware - driver I/F
#endif // HCF_CFG_STA_1_TOP / HCF_CFG_STA_1_BOTTOM
#ifdef HCF_CFG_STA_2_TOP // Top Compatibility for Station Firmware - driver I/F
#if HCF_CFG_STA_2_TOP == 0 || \
CFG_DRV_ACT_RANGES_STA_2_BOTTOM <= HCF_CFG_STA_2_TOP && HCF_CFG_STA_2_TOP <= CFG_DRV_ACT_RANGES_STA_2_TOP
#undef CFG_DRV_ACT_RANGES_STA_2_TOP
#define CFG_DRV_ACT_RANGES_STA_2_TOP HCF_CFG_STA_2_TOP
#else
err: ;
#endif
#endif // HCF_CFG_STA_TOP
#ifdef HCF_CFG_STA_2_BOTTOM // Bottom Compatibility for Station Firmware - driver I/F
#if CFG_DRV_ACT_RANGES_STA_2_BOTTOM <= HCF_CFG_STA_2_BOTTOM && HCF_CFG_STA_2_BOTTOM <= CFG_DRV_ACT_RANGES_STA_2_TOP
#undef CFG_DRV_ACT_RANGES_STA_2_BOTTOM
#define CFG_DRV_ACT_RANGES_STA_2_BOTTOM HCF_CFG_STA_2_BOTTOM
#else
err: ;
#endif
#endif // HCF_CFG_STA_BOTTOM
/************************************************************************************************/
/************************************** MACROS ************************************************/
/************************************************************************************************/
#ifdef HCF_SLEEP
#define MSF_WAIT(x) do { \
PROT_CNT_INI; \
HCF_WAIT_WHILE((IPW(HREG_IO) & HREG_IO_WOKEN_UP) == 0); \
HCFASSERT( prot_cnt, IPW( HREG_IO ) ); \
} while (0)
#else
#define MSF_WAIT(x) do { } while (0)
#endif // HCF_SLEEP
#define LOF(x) (sizeof(x)/sizeof(hcf_16)-1)
//resolve problems on for some 16 bits compilers to create 32 bit values
#define MERGE_2( hw, lw ) ( ( ((hcf_32)(hw)) << 16 ) | ((hcf_16)(lw)) )
#if ! defined HCF_STATIC
#define HCF_STATIC static
#endif // HCF_STATIC
#if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
#define DAWA_ACK( mask) do { \
OPW( HREG_EV_ACK, mask | HREG_EV_ACK_REG_READY ); \
OPW( HREG_EV_ACK, (mask & ~HREG_EV_ALLOC) | HREG_EV_ACK_REG_READY ); \
} while (0)
#define DAWA_ZERO_FID(reg) OPW( reg, 0 )
#else
#define DAWA_ACK( mask) OPW( HREG_EV_ACK, mask )
#define DAWA_ZERO_FID(reg) do { } while (0)
#endif // HCF_TYPE_HII5
#if (HCF_TYPE) & HCF_TYPE_WPA
#define CALC_RX_MIC( p, len ) calc_mic_rx_frag( ifbp, p, len )
#define CALC_TX_MIC( p, len ) calc_mic_tx_frag( ifbp, p, len )
#else
#define CALC_RX_MIC( p, len )
#define CALC_TX_MIC( p, len )
#define MIC_RX_RTN( mic, dw )
#define MIC_TX_RTN( mic, dw )
#endif // HCF_TYPE_WPA
#if HCF_TALLIES & HCF_TALLIES_HCF //HCF tally support
#define IF_TALLY(x) do { x; } while (0)
#else
#define IF_TALLY(x) do { } while (0)
#endif // HCF_TALLIES_HCF
#if HCF_DMA
#define IF_DMA(x) do { x; } while(0)
#define IF_NOT_DMA(x) do { } while(0)
#define IF_USE_DMA(x) if ( ifbp->IFB_CntlOpt & USE_DMA ) { x; }
#define IF_NOT_USE_DMA(x) if ( !(ifbp->IFB_CntlOpt & USE_DMA) ) { x; }
#else
#define IF_DMA(x) do { } while(0)
#define IF_NOT_DMA(x) do { x; } while(0)
#define IF_USE_DMA(x) do { } while(0)
#define IF_NOT_USE_DMA(x) do { x; } while(0)
#endif // HCF_DMA
#define IPW(x) ((hcf_16)IN_PORT_WORD( ifbp->IFB_IOBase + (x) ) )
#define OPW(x, y) OUT_PORT_WORD( ifbp->IFB_IOBase + (x), y )
/* make sure the implementation of HCF_WAIT_WHILE is such that there may be multiple HCF_WAIT_WHILE calls
* in a row and that when one fails all subsequent fail immediately without reinitialization of prot_cnt
*/
#if HCF_PROT_TIME == 0
#define PROT_CNT_INI do { } while(0)
#define IF_PROT_TIME(x) do { } while(0)
#if defined HCF_YIELD
#define HCF_WAIT_WHILE( x ) do { } while( (x) && (HCF_YIELD) )
#else
#define HCF_WAIT_WHILE( x ) do { } while ( x )
#endif // HCF_YIELD
#else
#define PROT_CNT_INI hcf_32 prot_cnt = ifbp->IFB_TickIni
#define IF_PROT_TIME(x) do { x; } while(0)
#if defined HCF_YIELD
#define HCF_WAIT_WHILE( x ) while ( prot_cnt && (x) && (HCF_YIELD) ) prot_cnt--;
#else
#include <linux/delay.h>
#define HCF_WAIT_WHILE( x ) while ( prot_cnt && (x) ) { udelay(2); prot_cnt--; }
#endif // HCF_YIELD
#endif // HCF_PROT_TIME
#if defined HCF_EX_INT
//#if HCF_EX_INT & ~( HCF_EX_INT_TX_EX | HCF_EX_INT_TX_OK | HCF_EX_INT_TICK )
;? out dated checking
err: you used an invalid bitmask;
// #endif // HCF_EX_INT validation
// #else
// #define HCF_EX_INT 0x000
#endif // HCF_EX_INT
#if 0 //get compiler going
#if HCF_EX_INT_TICK != HREG_EV_TICK
;? out dated checking
err: someone redefined these macros while the implementation assumes they are equal;
#endif
#if HCF_EX_INT_TX_OK != HFS_TX_CNTL_TX_OK || HFS_TX_CNTL_TX_OK != HREG_EV_TX_OK
;? out dated checking
err: someone redefined these macros while the implementation assumes they are equal;
#endif
#if HCF_EX_INT_TX_EX != HFS_TX_CNTL_TX_EX || HFS_TX_CNTL_TX_EX != HREG_EV_TX_EX
;? out dated checking
err: someone redefined these macros while the implementation assumes they are equal;
#endif
#endif // 0 get compiler going
/* The assert in HCFLOGENTRY checks against re-entrancy. Re-entrancy could be caused by MSF logic at
* task-level calling hcf_functions without shielding with HCF_ACT_ON/_OFF. When an interrupt occurs,
* the ISR could (either directly or indirectly) cause re-entering of the interrupted HCF-routine.
*
* The "(ifbp->IFB_AssertWhere = where)" test in HCFLOGENTRY services ALSO as a statement to get around:
* #pragma warning: conditional expression is constant
* on the if-statement
*/
#if HCF_ASSERT
#define HCFASSERT(x,q) do { if (!(x)) {mdd_assert(ifbp, __LINE__, q );} } while(0)
#define MMDASSERT(x,q) {if (!(x)) {mdd_assert( assert_ifbp, __LINE__ + FILE_NAME_OFFSET, q );}}
#define HCFLOGENTRY( where, what ) do { \
if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
HCFASSERT( (ifbp->IFB_AssertTrace & 1<<((where)&0xF)) == 0, ifbp->IFB_AssertTrace ); \
ifbp->IFB_AssertTrace |= 1<<((where)&0xF); \
} \
HCFTRACE(ifbp, where ); \
HCFTRACEVALUE(ifbp, what ); \
} while (0)
#define HCFLOGEXIT( where ) do { \
if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
ifbp->IFB_AssertTrace &= ~(1<<((where)&0xF)); \
} \
HCFTRACE(ifbp, (where)|HCF_TRACE_EXIT ); \
} while (0)
#else // HCF_ASSERT
#define HCFASSERT( x, q ) do { } while(0)
#define MMDASSERT( x, q )
#define HCFLOGENTRY( where, what ) do { } while(0)
#define HCFLOGEXIT( where ) do { } while(0)
#endif // HCF_ASSERT
#if HCF_INT_ON
/* ;? HCFASSERT_INT
* #if (HCF_SLEEP) & HCF_DDS
* #define HCFASSERT_INT HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFF && ifbp->IFB_IntOffCnt != 0xFFFE, \
* ifbp->IFB_IntOffCnt )
* #else
*/
#define HCFASSERT_INT HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFF, ifbp->IFB_IntOffCnt )
// #endif // HCF_DDS
#else
#define HCFASSERT_INT
#endif // HCF_INT_ON
#if defined HCF_TRACE
#define HCFTRACE(ifbp, where ) do {OPW( HREG_SW_1, where );} while(0)
//#define HCFTRACE(ifbp, where ) {HCFASSERT( DO_ASSERT, where );}
#define HCFTRACEVALUE(ifbp, what ) do {OPW( HREG_SW_2, what );} while (0)
//#define HCFTRACEVALUE(ifbp, what ) {HCFASSERT( DO_ASSERT, what );}
#else
#define HCFTRACE(ifbp, where ) do { } while(0)
#define HCFTRACEVALUE(ifbp, what ) do { } while(0)
#endif // HCF_TRACE
#if HCF_BIG_ENDIAN
#define BE_PAR(x) ,x
#else
#define BE_PAR(x)
#endif // HCF_BIG_ENDIAN
/************************************************************************************************/
/************************************** END OF MACROS *****************************************/
/************************************************************************************************/
/************************************************************************************************/
/*************************************** PROTOTYPES *******************************************/
/************************************************************************************************/
#if HCF_ASSERT
extern IFBP BASED assert_ifbp; //to make asserts easily work under MMD and DHF
EXTERN_C void mdd_assert (IFBP ifbp, unsigned int line_number, hcf_32 q );
#endif //HCF_ASSERT
#if ! ( (HCF_IO) & HCF_IO_32BITS ) // defined 16 bits only
#undef OUT_PORT_STRING_32
#undef IN_PORT_STRING_32
#endif // HCF_IO
#endif //HCFDEFC_H

View file

@ -1,734 +0,0 @@
.\" 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 diff suppressed because it is too large Load diff

View file

@ -1,250 +0,0 @@
/************************************************************************************************************
*
* 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

View file

@ -1,77 +0,0 @@
#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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,441 +0,0 @@
/*******************************************************************************
* 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 processing and initialization specific to Card Services
* devices (PCMCIA, CF).
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <wl_version.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/bitops.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
#include <debug.h>
#include <hcf.h>
#include <dhf.h>
#include <hcfdef.h>
#include <wl_if.h>
#include <wl_internal.h>
#include <wl_util.h>
#include <wl_main.h>
#include <wl_netdev.h>
#include <wl_cs.h>
/*******************************************************************************
* wl_adapter_attach()
*******************************************************************************
*
* DESCRIPTION:
*
* Creates an instance of the driver, allocating local data structures for
* one device. The device is registered with Card Services.
*
* PARAMETERS:
*
* none
*
* RETURNS:
*
* pointer to an allocated dev_link_t structure
* NULL on failure
*
******************************************************************************/
static int wl_adapter_attach(struct pcmcia_device *link)
{
struct net_device *dev;
struct wl_private *lp;
int ret;
dev = wl_device_alloc();
if (dev == NULL) {
DBG_ERROR(DbgInfo, "wl_device_alloc returned NULL\n");
return -ENOMEM;
}
link->resource[0]->end = HCF_NUM_IO_PORTS;
link->resource[0]->flags = IO_DATA_PATH_WIDTH_16;
link->config_flags |= CONF_ENABLE_IRQ;
link->config_index = 5;
link->config_regs = PRESENT_OPTION;
link->priv = dev;
lp = wl_priv(dev);
lp->link = link;
ret = wl_adapter_insert(link);
if (ret != 0)
wl_device_dealloc(dev);
return ret;
} /* wl_adapter_attach */
/*============================================================================*/
static void wl_adapter_detach(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
DBG_PARAM(DbgInfo, "link", "0x%p", link);
wl_adapter_release(link);
if (dev) {
unregister_netdev(dev);
wl_device_dealloc(dev);
}
} /* wl_adapter_detach */
/*============================================================================*/
void wl_adapter_release(struct pcmcia_device *link)
{
DBG_PARAM(DbgInfo, "link", "0x%p", link);
/* Stop hardware */
wl_remove(link->priv);
pcmcia_disable_device(link);
} /* wl_adapter_release */
/*============================================================================*/
static int wl_adapter_suspend(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
/* if (link->open) { */
netif_device_detach(dev);
wl_suspend(dev);
/* CHECK! pcmcia_release_configuration(link->handle); */
/* } */
return 0;
} /* wl_adapter_suspend */
static int wl_adapter_resume(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
wl_resume(dev);
netif_device_attach(dev);
return 0;
} /* wl_adapter_resume */
int wl_adapter_insert(struct pcmcia_device *link)
{
struct net_device *dev;
int ret;
DBG_PARAM(DbgInfo, "link", "0x%p", link);
dev = link->priv;
/* Do we need to allocate an interrupt? */
link->config_flags |= CONF_ENABLE_IRQ;
link->io_lines = 6;
ret = pcmcia_request_io(link);
if (ret != 0)
goto failed;
ret = pcmcia_request_irq(link, (void *) wl_isr);
if (ret != 0)
goto failed;
ret = pcmcia_enable_device(link);
if (ret != 0)
goto failed;
dev->irq = link->irq;
dev->base_addr = link->resource[0]->start;
SET_NETDEV_DEV(dev, &link->dev);
ret = register_netdev(dev);
if (ret != 0) {
printk("%s: register_netdev() failed\n", KBUILD_MODNAME);
goto failed;
}
printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, mac_address"
" %pM\n", dev->name, dev->base_addr, dev->irq, dev->dev_addr);
return 0;
failed:
wl_adapter_release(link);
return ret;
} /* wl_adapter_insert */
/*============================================================================*/
/*******************************************************************************
* wl_adapter_open()
*******************************************************************************
*
* DESCRIPTION:
*
* Open the device.
*
* PARAMETERS:
*
* dev - a pointer to a net_device structure representing the network
* device to open.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_adapter_open(struct net_device *dev)
{
struct wl_private *lp = wl_priv(dev);
struct pcmcia_device *link = lp->link;
int result = 0;
int hcf_status = HCF_SUCCESS;
DBG_PRINT("%s\n", VERSION_INFO);
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
if (!pcmcia_dev_present(link))
return -ENODEV;
link->open++;
hcf_status = wl_open(dev);
if (hcf_status != HCF_SUCCESS) {
link->open--;
result = -ENODEV;
}
return result;
} /* wl_adapter_open */
/*============================================================================*/
/*******************************************************************************
* wl_adapter_close()
*******************************************************************************
*
* DESCRIPTION:
*
* Close the device.
*
* PARAMETERS:
*
* dev - a pointer to a net_device structure representing the network
* device to close.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_adapter_close(struct net_device *dev)
{
struct wl_private *lp = wl_priv(dev);
struct pcmcia_device *link = lp->link;
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
if (link == NULL)
return -ENODEV;
DBG_TRACE(DbgInfo, "%s: Shutting down adapter.\n", dev->name);
wl_close(dev);
link->open--;
return 0;
} /* wl_adapter_close */
/*============================================================================*/
static const struct pcmcia_device_id wl_adapter_ids[] = {
#if !((HCF_TYPE) & HCF_TYPE_HII5)
PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0003),
PCMCIA_DEVICE_PROD_ID12("Agere Systems", "Wireless PC Card Model 0110",
0x33103a9b, 0xe175b0dd),
#else
PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0004),
PCMCIA_DEVICE_PROD_ID12("Linksys",
"WCF54G_Wireless-G_CompactFlash_Card", 0x0733cc81,
0x98a599e1),
#endif /* (HCF_TYPE) & HCF_TYPE_HII5 */
PCMCIA_DEVICE_NULL,
};
MODULE_DEVICE_TABLE(pcmcia, wl_adapter_ids);
static struct pcmcia_driver wlags49_driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.probe = wl_adapter_attach,
.remove = wl_adapter_detach,
.id_table = wl_adapter_ids,
.suspend = wl_adapter_suspend,
.resume = wl_adapter_resume,
};
/*******************************************************************************
* wl_adapter_init_module()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by init_module() to perform PCMCIA driver initialization.
*
* PARAMETERS:
*
* N/A
*
* RETURNS:
*
* 0 on success
* -1 on error
*
******************************************************************************/
int wl_adapter_init_module(void)
{
return pcmcia_register_driver(&wlags49_driver);
} /* wl_adapter_init_module */
/*============================================================================*/
/*******************************************************************************
* wl_adapter_cleanup_module()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by cleanup_module() to perform driver uninitialization.
*
* PARAMETERS:
*
* N/A
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_adapter_cleanup_module(void)
{
pcmcia_unregister_driver(&wlags49_driver);
} /* wl_adapter_cleanup_module */
/*============================================================================*/
/*******************************************************************************
* wl_adapter_is_open()
*******************************************************************************
*
* DESCRIPTION:
*
* Check with Card Services to determine if this device is open.
*
* PARAMETERS:
*
* dev - a pointer to the net_device structure whose open status will be
* checked
*
* RETURNS:
*
* nonzero if device is open
* 0 otherwise
*
******************************************************************************/
int wl_adapter_is_open(struct net_device *dev)
{
struct wl_private *lp = wl_priv(dev);
struct pcmcia_device *link = lp->link;
if (!pcmcia_dev_present(link))
return 0;
return link->open;
} /* wl_adapter_is_open */
/*============================================================================*/

View file

@ -1,89 +0,0 @@
/*******************************************************************************
* 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__ */

View file

@ -1,217 +0,0 @@
/*******************************************************************************
* 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 defines functions related to WEP key coding/decoding.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <linux/string.h>
#include <wl_version.h>
#include <debug.h>
#include <hcf.h>
#include <wl_enc.h>
/*******************************************************************************
* wl_wep_code()
*******************************************************************************
*
* DESCRIPTION:
*
* This function encodes a set of wep keys for privacy
*
* PARAMETERS:
*
* szCrypt -
* szDest -
* Data -
* nLen -
*
* RETURNS:
*
* OK
*
******************************************************************************/
int wl_wep_code(char *szCrypt, char *szDest, void *Data, int nLen)
{
int i;
int t;
int k ;
char bits;
char *szData = (char *) Data;
/*------------------------------------------------------------------------*/
for (i = bits = 0; i < MACADDRESS_STR_LEN; i++) {
bits ^= szCrypt[i];
bits += szCrypt[i];
}
for (i = t = *szDest = 0; i < nLen; i++, t++) {
k = szData[i] ^ (bits + i);
switch (i % 3) {
case 0:
szDest[t] = ((k & 0xFC) >> 2) + CH_START ;
szDest[t+1] = ((k & 0x03) << 4) + CH_START ;
szDest[t+2] = '\0';
break;
case 1:
szDest[t] += ((k & 0xF0) >> 4);
szDest[t+1] = ((k & 0x0F) << 2) + CH_START ;
szDest[t+2] = '\0';
break;
case 2:
szDest[t] += ((k & 0xC0) >> 6);
szDest[t+1] = (k & 0x3F) + CH_START ;
szDest[t+2] = '\0';
t++;
break;
}
}
return strlen(szDest);
}
/*============================================================================*/
/*******************************************************************************
* wl_wep_decode()
*******************************************************************************
*
* DESCRIPTION:
*
* This function decodes a set of WEP keys for use by the card.
*
* PARAMETERS:
*
* szCrypt -
* szDest -
* Data -
*
* RETURNS:
*
* OK
*
******************************************************************************/
int wl_wep_decode(char *szCrypt, void *Dest, char *szData)
{
int i;
int t;
int nLen;
char bits;
char *szDest = Dest;
/*------------------------------------------------------------------------*/
for (i = bits = 0; i < 12; i++) {
bits ^= szCrypt[i] ;
bits += szCrypt[i] ;
}
nLen = (strlen(szData) * 3) / 4 ;
for (i = t = 0; i < nLen; i++, t++) {
switch (i % 3) {
case 0:
szDest[i] = (((szData[t] - CH_START) & 0x3f) << 2) +
(((szData[t+1] - CH_START) & 0x30) >> 4);
break;
case 1:
szDest[i] = (((szData[t] - CH_START) & 0x0f) << 4) +
(((szData[t+1] - CH_START) & 0x3c) >> 2);
break;
case 2:
szDest[i] = (((szData[t] - CH_START) & 0x03) << 6) +
((szData[t+1] - CH_START) & 0x3f);
t++;
break;
}
szDest[i] ^= (bits + i);
}
return i;
}
/*============================================================================*/

View file

@ -1,118 +0,0 @@
/*******************************************************************************
* 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 for performing coding/decoding of the WEP keys.
*
*------------------------------------------------------------------------------
*
* 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 __WAVELAN2_ENCRYPTION_H__
#define __WAVELAN2_ENCRYPTION_H__
/*******************************************************************************
* constant definitions
******************************************************************************/
#define CRYPT_CODE "57617665A5D6"
#define ENCRYPTION_LEN 102
#define ENCRYPTION_MAGIC 0x48576877L /* HWhw */
#define DEF_CRYPT_STR "G?TIUEA]d5MAdZV'eUb&&6.)'&:,'VF/(FR2)6^5*'*8*W6;+GB>,7NA-'ZD-X&G.H2J/8>M0(JP0XVS1HbV29.Y3):\\3YF_4IRb56"
#define DEFAULT_CRYPT_MAC "W\x01\x6B\x66\xA5\x5A"
#define CH_START '&'
#define MACADDRESS_STR_LEN 12
#define KEY_LEN 14
#define NUM_KEYS 4
#define KEY_LENGTH_NONE_ASCII 0
#define KEY_LENGTH_64_BIT_ASCII 5
#define KEY_LENGTH_128_BIT_ASCII 13
#define KEY_LENGTH_NONE_HEX ( KEY_LENGTH_NONE_ASCII * sizeof( unsigned short ))
#define KEY_LENGTH_64_BIT_HEX ( KEY_LENGTH_64_BIT_ASCII * sizeof( unsigned short ))
#define KEY_LENGTH_128_BIT_HEX ( KEY_LENGTH_128_BIT_ASCII * sizeof( unsigned short ))
/*******************************************************************************
* type definitions
******************************************************************************/
typedef struct _encstct
{
hcf_32 dwMagic;
hcf_16 wTxKeyID;
hcf_16 wEnabled;
CFG_DEFAULT_KEYS_STRCT EncStr;
}
ENCSTRCT, *PENCSTRCT;
/*******************************************************************************
* function prototypes
******************************************************************************/
int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen );
int wl_wep_decode( char *szCrypt, void *Dest, char *szData );
#endif /* __WAVELAN2_ENCRYPTION_H__ */

View file

@ -1,221 +0,0 @@
/*******************************************************************************
* 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
*
*------------------------------------------------------------------------------
*
* Driver common header for info needed by driver source and user-space
* processes communicating with the driver.
*
*------------------------------------------------------------------------------
*
* 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 __WAVELAN2_IF_H__
#define __WAVELAN2_IF_H__
/*******************************************************************************
* constant definitions
******************************************************************************/
#define MAX_LTV_BUF_SIZE (512 - (sizeof(hcf_16) * 2))
#define HCF_TALLIES_SIZE (sizeof(CFG_HERMES_TALLIES_STRCT) + \
(sizeof(hcf_16) * 2))
#define HCF_MAX_MULTICAST 16
#define HCF_MAX_NAME_LEN 32
#define MAX_LINE_SIZE 256
#define HCF_NUM_IO_PORTS 0x80
#define TX_TIMEOUT ((800 * HZ) / 1000)
/* PE1DNN
* Better data from the real world. Not scientific but empirical data gathered
* from a Thomson Speedtouch 110 which is identified as:
* PCMCIA Info: "Agere Systems" "Wireless PC Card Model 0110"
* Manufacture ID: 0156,0003
* Lowest measurment for noise floor seen is value 54
* Highest signal strength in close proximity to the AP seen is value 118
* Very good must be around 100 (otherwise its never "full scale"
* All other constants are derrived from these. This makes the signal gauge
* work for me...
*/
#define HCF_MIN_SIGNAL_LEVEL 54
#define HCF_MAX_SIGNAL_LEVEL 100
#define HCF_MIN_NOISE_LEVEL HCF_MIN_SIGNAL_LEVEL
#define HCF_MAX_NOISE_LEVEL HCF_MAX_SIGNAL_LEVEL
#define HCF_0DBM_OFFSET (HCF_MAX_SIGNAL_LEVEL + 1)
#define HCF_MIN_COMM_QUALITY 0
#define HCF_MAX_COMM_QUALITY (HCF_MAX_SIGNAL_LEVEL - \
HCF_MIN_NOISE_LEVEL + 1)
/* For encryption (WEP) */
#define MIN_KEY_SIZE 5 /* 40 bits RC4 - WEP */
#define MAX_KEY_SIZE 13 /* 104 bits */
#define MAX_KEYS 4
#define RADIO_CHANNELS 14
#define RADIO_SENSITIVITY_LEVELS 3
#define RADIO_TX_POWER_MWATT 32
#define RADIO_TX_POWER_DBM 15
#define MIN_RTS_BYTES 0
#define MAX_RTS_BYTES 2347
#define MAX_RATES 8
#define MEGABIT (1024 * 1024)
#define HCF_FAILURE 0xFF
#define UIL_FAILURE 0xFF
#define CFG_UIL_CONNECT 0xA123 /* Define differently? */
#define CFG_UIL_CONNECT_ACK_CODE 0x5653435A /* VSCZ */
#define WVLAN2_UIL_CONNECTED (0x01L << 0)
#define WVLAN2_UIL_BUSY (0x01L << 1)
/*******************************************************************************
* driver ioctl interface
******************************************************************************/
#define WVLAN2_IOCTL_UIL SIOCDEVPRIVATE
/* The UIL Interface used in conjunction with the WVLAN2_IOCTL_UIL code above
is defined in mdd.h. A quick reference of the UIL codes is listed below */
/*
UIL_FUN_CONNECT
UIL_FUN_DISCONNECT
UIL_FUN_ACTION
UIL_ACT_BLOCK
UIL_ACT_UNBLOCK
UIL_ACT_SCA
UIL_ACT_DIAG
UIL_ACT_APPLY
UIL_FUN_SEND_DIAG_MSG
UIL_FUN_GET_INFO
UIL_FUN_PUT_INFO
*/
#define SIOCSIWNETNAME (SIOCDEVPRIVATE + 1)
#define SIOCGIWNETNAME (SIOCDEVPRIVATE + 2)
#define SIOCSIWSTANAME (SIOCDEVPRIVATE + 3)
#define SIOCGIWSTANAME (SIOCDEVPRIVATE + 4)
#define SIOCSIWPORTTYPE (SIOCDEVPRIVATE + 5)
#define SIOCGIWPORTTYPE (SIOCDEVPRIVATE + 6)
/* IOCTL code for the RTS interface */
#define WL_IOCTL_RTS (SIOCDEVPRIVATE + 7)
/* IOCTL subcodes for WL_IOCTL_RTS */
#define WL_IOCTL_RTS_READ 1
#define WL_IOCTL_RTS_WRITE 2
#define WL_IOCTL_RTS_BATCH_READ 3
#define WL_IOCTL_RTS_BATCH_WRITE 4
/*******************************************************************************
* STRUCTURE DEFINITIONS
******************************************************************************/
typedef struct {
__u16 length;
__u8 name[HCF_MAX_NAME_LEN];
}
wvName_t;
typedef struct {
hcf_16 len;
hcf_16 typ;
union {
hcf_8 u8[MAX_LTV_BUF_SIZE / sizeof(hcf_8)];
hcf_16 u16[MAX_LTV_BUF_SIZE / sizeof(hcf_16)];
hcf_32 u32[MAX_LTV_BUF_SIZE / sizeof(hcf_32)];
} u;
}
ltv_t;
struct uilreq {
union {
char ifrn_name[IFNAMSIZ];
} ifr_ifrn;
IFBP hcfCtx;
__u8 command;
__u8 result;
/* The data field in this structure is typically an LTV of some type.
The len field is the size of the buffer in bytes, as opposed to words
(like the L-field in the LTV */
__u16 len;
void *data;
};
struct rtsreq {
union {
char ifrn_name[IFNAMSIZ];
}
ifr_ifrn;
__u16 typ;
__u16 reg;
__u16 len;
__u16 *data;
};
#endif /* __WAVELAN2_IF_H__ */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,138 +0,0 @@
/*******************************************************************************
* 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 device specific routines and driver init/un-init.
*
*------------------------------------------------------------------------------
*
* 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_MAIN_H__
#define __WL_MAIN_H__
/*******************************************************************************
* function prototypes
******************************************************************************/
int wl_insert( struct net_device *dev );
void wl_set_wep_keys( struct wl_private *lp );
int wl_put_ltv_init( struct wl_private *lp );
int wl_put_ltv( struct wl_private *lp );
p_u16 wl_get_irq_mask( void );
p_s8 * wl_get_irq_list( void );
int wl_reset( struct net_device *dev );
int wl_go( struct wl_private *lp );
int wl_apply( struct wl_private *lp );
irqreturn_t wl_isr( int irq, void *dev_id, struct pt_regs *regs );
void wl_remove( struct net_device *dev );
void wl_suspend( struct net_device *dev );
void wl_resume( struct net_device *dev );
void wl_release( struct net_device *dev );
int wl_enable( struct wl_private *lp );
int wl_connect( struct wl_private *lp );
int wl_disable( struct wl_private *lp );
int wl_disconnect( struct wl_private *lp );
void wl_enable_wds_ports( struct wl_private * lp );
void wl_disable_wds_ports( struct wl_private * lp );
#ifndef USE_MBOX_SYNC
int wl_mbx( struct wl_private *lp );
void wl_endian_translate_mailbox( ltv_t *ltv );
void wl_process_mailbox( struct wl_private *lp );
#endif /* USE_MBOX_SYNC */
#ifdef USE_WDS
void wl_wds_netdev_register( struct wl_private *lp );
void wl_wds_netdev_deregister( struct wl_private *lp );
#endif /* USE_WDS */
#ifdef USE_WDS
#define WL_WDS_NETDEV_REGISTER( ARG ) wl_wds_netdev_register( ARG )
#define WL_WDS_NETDEV_DEREGISTER( ARG ) wl_wds_netdev_deregister( ARG )
#else
#define WL_WDS_NETDEV_REGISTER( ARG )
#define WL_WDS_NETDEV_DEREGISTER( ARG )
#endif /* USE_WDS */
#endif /* __WL_MAIN_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,154 +0,0 @@
/*******************************************************************************
* 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 by the network layerentry points
* into the driver.
*
*------------------------------------------------------------------------------
*
* 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_NETDEV_H__
#define __WL_NETDEV_H__
/*******************************************************************************
* function prototypes
******************************************************************************/
int wl_init(struct net_device *dev);
int wl_config(struct net_device *dev, struct ifmap *map);
struct net_device *wl_device_alloc(void);
void wl_device_dealloc(struct net_device *dev);
int wl_open(struct net_device *dev);
int wl_close(struct net_device *dev);
int wl_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int wl_tx(struct sk_buff *skb, struct net_device *dev, int port);
int wl_send(struct wl_private *lp);
int wl_rx(struct net_device *dev);
void wl_tx_timeout(struct net_device *dev);
struct net_device_stats *wl_stats(struct net_device *dev);
#ifdef ENABLE_DMA
int wl_send_dma(struct wl_private *lp, struct sk_buff *skb, int port);
int wl_rx_dma(struct net_device *dev);
#endif
#ifdef NEW_MULTICAST
void wl_multicast(struct net_device *dev);
#else
void wl_multicast(struct net_device *dev, int num_addrs, void *addrs);
#endif /* NEW_MULTICAST */
int wl_tx_port0(struct sk_buff *skb, struct net_device *dev);
#ifdef USE_WDS
int wl_tx_port1(struct sk_buff *skb, struct net_device *dev);
int wl_tx_port2(struct sk_buff *skb, struct net_device *dev);
int wl_tx_port3(struct sk_buff *skb, struct net_device *dev);
int wl_tx_port4(struct sk_buff *skb, struct net_device *dev);
int wl_tx_port5(struct sk_buff *skb, struct net_device *dev);
int wl_tx_port6(struct sk_buff *skb, struct net_device *dev);
void wl_wds_device_alloc(struct wl_private *lp);
void wl_wds_device_dealloc(struct wl_private *lp);
void wl_wds_netif_start_queue(struct wl_private *lp);
void wl_wds_netif_stop_queue(struct wl_private *lp);
void wl_wds_netif_wake_queue(struct wl_private *lp);
void wl_wds_netif_carrier_on(struct wl_private *lp);
void wl_wds_netif_carrier_off(struct wl_private *lp);
#endif /* USE_WDS */
#ifdef USE_WDS
#define WL_WDS_DEVICE_ALLOC(ARG) wl_wds_device_alloc(ARG)
#define WL_WDS_DEVICE_DEALLOC(ARG) wl_wds_device_dealloc(ARG)
#define WL_WDS_NETIF_START_QUEUE(ARG) wl_wds_netif_start_queue(ARG)
#define WL_WDS_NETIF_STOP_QUEUE(ARG) wl_wds_netif_stop_queue(ARG)
#define WL_WDS_NETIF_WAKE_QUEUE(ARG) wl_wds_netif_wake_queue(ARG)
#define WL_WDS_NETIF_CARRIER_ON(ARG) wl_wds_netif_carrier_on(ARG)
#define WL_WDS_NETIF_CARRIER_OFF(ARG) wl_wds_netif_carrier_off(ARG)
#else
#define WL_WDS_DEVICE_ALLOC(ARG)
#define WL_WDS_DEVICE_DEALLOC(ARG)
#define WL_WDS_NETIF_START_QUEUE(ARG)
#define WL_WDS_NETIF_STOP_QUEUE(ARG)
#define WL_WDS_NETIF_WAKE_QUEUE(ARG)
#define WL_WDS_NETIF_CARRIER_ON(ARG)
#define WL_WDS_NETIF_CARRIER_OFF(ARG)
#endif /* USE_WDS */
#endif /* __WL_NETDEV_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,127 +0,0 @@
/*******************************************************************************
* 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 private IOCTL handlers.
*
*------------------------------------------------------------------------------
*
* 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_PRIV_H__
#define __WL_PRIV_H__
/*******************************************************************************
* function prototypes
******************************************************************************/
#ifdef WIRELESS_EXT
int wvlan_set_netname(struct net_device *, struct iw_request_info *,
union iwreq_data *, char *extra);
int wvlan_get_netname(struct net_device *, struct iw_request_info *,
union iwreq_data *, char *extra);
int wvlan_set_station_nickname(struct net_device *, struct iw_request_info *,
union iwreq_data *, char *extra);
int wvlan_get_station_nickname(struct net_device *, struct iw_request_info *,
union iwreq_data *, char *extra);
int wvlan_set_porttype(struct net_device *, struct iw_request_info *,
union iwreq_data *, char *extra);
int wvlan_get_porttype(struct net_device *, struct iw_request_info *,
union iwreq_data *, char *extra);
#endif /* WIRELESS_EXT */
#ifdef USE_UIL
int wvlan_uil(struct uilreq *urq, struct wl_private *lp);
/* int wvlan_uil_connect( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_disconnect( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_action( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_block( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_unblock( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp ); */
/* int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp ); */
/* int cfg_driver_info( struct uilreq *urq, struct wl_private *lp ); */
/* int cfg_driver_identity( struct uilreq *urq, struct wl_private *lp ); */
#endif /* USE_UIL */
#ifdef USE_RTS
int wvlan_rts(struct rtsreq *rrq, __u32 io_base);
int wvlan_rts_read(__u16 reg, __u16 *val, __u32 io_base);
int wvlan_rts_write(__u16 reg, __u16 val, __u32 io_base);
int wvlan_rts_batch_read(struct rtsreq *rrq, __u32 io_base);
int wvlan_rts_batch_write(struct rtsreq *rrq, __u32 io_base);
#endif /* USE_RTS */
#endif /* __WL_PRIV_H__ */

View file

@ -1,995 +0,0 @@
/*******************************************************************************
* 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 defines routines required to parse configuration parameters
* listed in a config file, if that config file exists.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/* Only include this file if USE_PROFILE is defined */
#ifdef USE_PROFILE
/*******************************************************************************
* constant definitions
******************************************************************************/
/* Allow support for calling system fcns to parse config file */
#define __KERNEL_SYSCALLS__
/*******************************************************************************
* include files
******************************************************************************/
#include <wl_version.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/unistd.h>
#include <asm/uaccess.h>
#include <limits.h>
#define BIN_DL 1
#include <debug.h>
#include <hcf.h>
/* #include <hcfdef.h> */
#include <wl_if.h>
#include <wl_internal.h>
#include <wl_util.h>
#include <wl_enc.h>
#include <wl_main.h>
#include <wl_profile.h>
/* Definition needed to prevent unresolved external in unistd.h */
static int errno;
#if DBG
extern p_u32 DebugFlag;
#endif
int parse_yes_no(char *value);
int parse_yes_no(char *value)
{
int rc = 0; /* default to NO for invalid parameters */
if (strlen(value) == 1) {
if ((value[0] | ('Y'^'y')) == 'y')
rc = 1;
/* } else { */
/* this should not be debug time info, it is an enduser data entry error ;? */
/* DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS); */
}
return rc;
} /* parse_yes_no */
/*******************************************************************************
* parse_config()
*******************************************************************************
*
* DESCRIPTION:
*
* This function opens the device's config file and parses the options from
* it, so that it can properly configure itself. If no configuration file
* or configuration is present, then continue to use the options already
* parsed from config.opts or wireless.opts.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void parse_config(struct net_device *dev)
{
int file_desc;
#if 0 /* BIN_DL */
int rc;
char *cp = NULL;
#endif /* BIN_DL */
char buffer[MAX_LINE_SIZE];
char filename[MAX_LINE_SIZE];
mm_segment_t fs;
struct wl_private *wvlan_config = NULL;
ENCSTRCT sEncryption;
/* Get the wavelan specific info for this device */
wvlan_config = dev->priv;
if (wvlan_config == NULL) {
DBG_ERROR(DbgInfo, "Wavelan specific info struct not present?\n");
return;
}
/* setup the default encryption string */
strcpy(wvlan_config->szEncryption, DEF_CRYPT_STR);
/* Obtain a user-space process context, storing the original context */
fs = get_fs();
set_fs(get_ds());
/* Determine the filename for this device and attempt to open it */
sprintf(filename, "%s%s", ROOT_CONFIG_FILENAME, dev->name);
file_desc = open(filename, O_RDONLY, 0);
if (file_desc != -1) {
DBG_TRACE(DbgInfo, "Wireless config file found. Parsing options...\n");
/* Read out the options */
while (readline(file_desc, buffer))
translate_option(buffer, wvlan_config);
/* Close the file */
close(file_desc); /* ;?even if file_desc == -1 ??? */
} else {
DBG_TRACE(DbgInfo, "No iwconfig file found for this device; "
"config.opts or wireless.opts will be used\n");
}
/* Return to the original context */
set_fs(fs);
/* convert the WEP keys, if read in as key1, key2, type of data */
if (wvlan_config->EnableEncryption) {
memset(&sEncryption, 0, sizeof(sEncryption));
wl_wep_decode(CRYPT_CODE, &sEncryption,
wvlan_config->szEncryption);
/* the Linux driver likes to use 1-4 for the key IDs, and then
convert to 0-3 when sending to the card. The Windows code
base used 0-3 in the API DLL, which was ported to Linux. For
the sake of the user experience, we decided to keep 0-3 as the
numbers used in the DLL; and will perform the +1 conversion here.
We could have converted the entire Linux driver, but this is
less obtrusive. This may be a "todo" to convert the whole driver */
sEncryption.wEnabled = wvlan_config->EnableEncryption;
sEncryption.wTxKeyID = wvlan_config->TransmitKeyID - 1;
memcpy(&sEncryption.EncStr, &wvlan_config->DefaultKeys,
sizeof(CFG_DEFAULT_KEYS_STRCT));
memset(wvlan_config->szEncryption, 0, sizeof(wvlan_config->szEncryption));
wl_wep_code(CRYPT_CODE, wvlan_config->szEncryption, &sEncryption,
sizeof(sEncryption));
}
/* decode the encryption string for the call to wl_commit() */
wl_wep_decode(CRYPT_CODE, &sEncryption, wvlan_config->szEncryption);
wvlan_config->TransmitKeyID = sEncryption.wTxKeyID + 1;
wvlan_config->EnableEncryption = sEncryption.wEnabled;
memcpy(&wvlan_config->DefaultKeys, &sEncryption.EncStr,
sizeof(CFG_DEFAULT_KEYS_STRCT));
#if 0 /* BIN_DL */
/* Obtain a user-space process context, storing the original context */
fs = get_fs();
set_fs(get_ds());
/* ;?just to fake something */
strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin");
file_desc = open(/*wvlan_config->fw_image_*/filename, 0, 0);
if (file_desc == -1) {
DBG_ERROR(DbgInfo, "No image file found\n");
} else {
DBG_TRACE(DbgInfo, "F/W image file found\n");
#define DHF_ALLOC_SIZE 96000 /* just below 96K, let's hope it suffices for now and for the future */
cp = vmalloc(DHF_ALLOC_SIZE);
if (cp == NULL) {
DBG_ERROR(DbgInfo, "error in vmalloc\n");
} else {
rc = read(file_desc, cp, DHF_ALLOC_SIZE);
if (rc == DHF_ALLOC_SIZE) {
DBG_ERROR(DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE);
} else if (rc > 0) {
DBG_TRACE(DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp);
rc = read(file_desc, &cp[rc], 1);
if (rc == 0)
DBG_TRACE(DbgInfo, "no more to read\n");
}
if (rc != 0) {
DBG_ERROR(DbgInfo, "file not read in one swoop or other error"\
", give up, too complicated, rc = %0X\n", rc);
}
vfree(cp);
}
close(file_desc);
}
set_fs(fs); /* Return to the original context */
#endif /* BIN_DL */
return;
} /* parse_config */
/*******************************************************************************
* readline()
*******************************************************************************
*
* DESCRIPTION:
*
* This function reads in data from a given file one line at a time,
* converting the detected newline character '\n' to a null '\0'. Note that
* the file descriptor must be valid before calling this function.
*
* PARAMETERS:
*
* filedesc - the file descriptor for the open configuration file
* buffer - a buffer pointer, passed in by the caller, to which the
* line will be stored.
*
* RETURNS:
*
* the number of bytes read
* -1 on error
*
******************************************************************************/
int readline(int filedesc, char *buffer)
{
int result = -1;
int bytes_read = 0;
/*------------------------------------------------------------------------*/
/* Make sure the file descriptor is good */
if (filedesc != -1) {
/* Read in from the file byte by byte until a newline is reached */
while ((result = read(filedesc, &buffer[bytes_read], 1)) == 1) {
if (buffer[bytes_read] == '\n') {
buffer[bytes_read] = '\0';
bytes_read++;
break;
}
bytes_read++;
}
}
/* Return the number of bytes read */
if (result == -1)
return result;
else
return bytes_read;
} /* readline */
/*============================================================================*/
/*******************************************************************************
* translate_option()
*******************************************************************************
*
* DESCRIPTION:
*
* This function takes a line read in from the config file and parses out
* the key/value pairs. It then determines which key has been parsed and sets
* the card's configuration based on the value given.
*
* PARAMETERS:
*
* buffer - a buffer containing a line to translate
* config - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void translate_option(char *buffer, struct wl_private *lp)
{
unsigned int value_convert = 0;
int string_length = 0;
char *key = NULL;
char *value = NULL;
u_char mac_value[ETH_ALEN];
/*------------------------------------------------------------------------*/
if (buffer == NULL || lp == NULL) {
DBG_ERROR(DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n");
return;
}
ParseConfigLine(buffer, &key, &value);
if (key == NULL || value == NULL)
return;
/* Determine which key it is and perform the appropriate action */
/* Configuration parameters used in all scenarios */
#if DBG
/* handle DebugFlag as early as possible so it starts its influence as early
* as possible
*/
if (strcmp(key, PARM_NAME_DEBUG_FLAG) == 0) {
if (DebugFlag == ~0) { /* if DebugFlag is not specified on the command line */
if (DbgInfo->DebugFlag == 0) { /* if pc_debug did not set DebugFlag (i.e.pc_debug is
* not specified or specified outside the 4-8 range
*/
DbgInfo->DebugFlag |= DBG_DEFAULTS;
}
} else {
DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); /* ;?DebugFlag; */
}
DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); /* ;?Delete ASAP */
}
#endif /* DBG */
if (strcmp(key, PARM_NAME_AUTH_KEY_MGMT_SUITE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE) || (value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE))
lp->AuthKeyMgmtSuite = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE);
} else if (strcmp(key, PARM_NAME_BRSC_2GHZ) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC))
lp->brsc[0] = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_BRSC_2GHZ);
} else if (strcmp(key, PARM_NAME_BRSC_5GHZ) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC))
lp->brsc[1] = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_BRSC_5GHZ);
} else if ((strcmp(key, PARM_NAME_DESIRED_SSID) == 0) || (strcmp(key, PARM_NAME_OWN_SSID) == 0)) {
DBG_TRACE(DbgInfo, "SSID, value: %s\n", value);
memset(lp->NetworkName, 0, (PARM_MAX_NAME_LEN + 1));
/* Make sure the value isn't too long */
string_length = strlen(value);
if (string_length > PARM_MAX_NAME_LEN) {
DBG_WARNING(DbgInfo, "SSID too long; will be truncated\n");
string_length = PARM_MAX_NAME_LEN;
}
memcpy(lp->NetworkName, value, string_length);
}
#if 0
else if (strcmp(key, PARM_NAME_DOWNLOAD_FIRMWARE) == 0) {
DBG_TRACE(DbgInfo, "DOWNLOAD_FIRMWARE, value: %s\n", value);
memset(lp->fw_image_filename, 0, (MAX_LINE_SIZE + 1));
/* Make sure the value isn't too long */
string_length = strlen(value);
if (string_length > MAX_LINE_SIZE)
DBG_WARNING(DbgInfo, "F/W image file name too long; will be ignored\n");
else
memcpy(lp->fw_image_filename, value, string_length);
}
#endif
else if (strcmp(key, PARM_NAME_ENABLE_ENCRYPTION) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_ENABLE_ENCRYPTION) && (value_convert <= PARM_MAX_ENABLE_ENCRYPTION))
lp->EnableEncryption = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION);
} else if (strcmp(key, PARM_NAME_ENCRYPTION) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value);
memset(lp->szEncryption, 0, sizeof(lp->szEncryption));
/* Make sure the value isn't too long */
string_length = strlen(value);
if (string_length > sizeof(lp->szEncryption)) {
DBG_WARNING(DbgInfo, "%s too long; will be truncated\n", PARM_NAME_ENCRYPTION);
string_length = sizeof(lp->szEncryption);
}
memcpy(lp->szEncryption, value, string_length);
} else if (strcmp(key, PARM_NAME_KEY1) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY1, value);
if (is_valid_key_string(value)) {
memset(lp->DefaultKeys.key[0].key, 0, MAX_KEY_SIZE);
key_string2key(value, &lp->DefaultKeys.key[0]);
} else {
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY1);
}
} else if (strcmp(key, PARM_NAME_KEY2) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY2, value);
if (is_valid_key_string(value)) {
memset(lp->DefaultKeys.key[1].key, 0, MAX_KEY_SIZE);
key_string2key(value, &lp->DefaultKeys.key[1]);
} else {
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY2);
}
} else if (strcmp(key, PARM_NAME_KEY3) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY3, value);
if (is_valid_key_string(value)) {
memset(lp->DefaultKeys.key[2].key, 0, MAX_KEY_SIZE);
key_string2key(value, &lp->DefaultKeys.key[2]);
} else {
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY3);
}
} else if (strcmp(key, PARM_NAME_KEY4) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY4, value);
if (is_valid_key_string(value)) {
memset(lp->DefaultKeys.key[3].key, 0, MAX_KEY_SIZE);
key_string2key(value, &lp->DefaultKeys.key[3]);
} else {
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY4);
}
}
/* New Parameters for WARP */
else if (strcmp(key, PARM_NAME_LOAD_BALANCING) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_LOAD_BALANCING, value);
lp->loadBalancing = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_MEDIUM_DISTRIBUTION) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MEDIUM_DISTRIBUTION, value);
lp->mediumDistribution = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_MICROWAVE_ROBUSTNESS) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MICROWAVE_ROBUSTNESS, value);
lp->MicrowaveRobustness = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_MULTICAST_RATE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RATE, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_MULTICAST_RATE) && (value_convert <= PARM_MAX_MULTICAST_RATE))
lp->MulticastRate[0] = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE);
} else if (strcmp(key, PARM_NAME_OWN_CHANNEL) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value);
value_convert = simple_strtoul(value, NULL, 0);
if (wl_is_a_valid_chan(value_convert)) {
if (value_convert > 14)
value_convert = value_convert | 0x100;
lp->Channel = value_convert;
} else {
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL);
}
} else if (strcmp(key, PARM_NAME_OWN_NAME) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_NAME, value);
memset(lp->StationName, 0, (PARM_MAX_NAME_LEN + 1));
/* Make sure the value isn't too long */
string_length = strlen(value);
if (string_length > PARM_MAX_NAME_LEN) {
DBG_WARNING(DbgInfo, "%s too long; will be truncated\n", PARM_NAME_OWN_NAME);
string_length = PARM_MAX_NAME_LEN;
}
memcpy(lp->StationName, value, string_length);
} else if (strcmp(key, PARM_NAME_RTS_THRESHOLD) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->RTSThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD);
} else if (strcmp(key, PARM_NAME_SRSC_2GHZ) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC))
lp->srsc[0] = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SRSC_2GHZ);
} else if (strcmp(key, PARM_NAME_SRSC_5GHZ) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC))
lp->srsc[1] = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SRSC_5GHZ);
} else if (strcmp(key, PARM_NAME_SYSTEM_SCALE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_SYSTEM_SCALE) && (value_convert <= PARM_MAX_SYSTEM_SCALE))
lp->DistanceBetweenAPs = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE);
} else if (strcmp(key, PARM_NAME_TX_KEY) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_KEY) && (value_convert <= PARM_MAX_TX_KEY))
lp->TransmitKeyID = simple_strtoul(value, NULL, 0);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY);
} else if (strcmp(key, PARM_NAME_TX_RATE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->TxRateControl[0] = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE);
} else if (strcmp(key, PARM_NAME_TX_POW_LEVEL) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_POW_LEVEL) || (value_convert <= PARM_MAX_TX_POW_LEVEL))
lp->txPowLevel = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL);
}
/* Need to add? : Country code, Short/Long retry */
/* Configuration parameters specific to STA mode */
#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_STA */
/* ;?seems reasonable that even an AP-only driver could afford this small additional footprint */
if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_STA) {
/* ;?should we return an error status in AP mode */
if (strcmp(key, PARM_NAME_PORT_TYPE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert == PARM_MIN_PORT_TYPE) || (value_convert == PARM_MAX_PORT_TYPE))
lp->PortType = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE);
} else if (strcmp(key, PARM_NAME_PM_ENABLED) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value);
value_convert = simple_strtoul(value, NULL, 0);
/* ;? how about wl_main.c containing
* VALID_PARAM(PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD ||
* (PARM_PM_ENABLED & 0x7FFF) <= WVLAN_PM_STATE_STANDARD);
*/
if ((value_convert & 0x7FFF) <= PARM_MAX_PM_ENABLED) {
lp->PMEnabled = value_convert;
} else {
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED);
/* ;?this is a data entry error, hence not a DBG_WARNING */
}
} else if (strcmp(key, PARM_NAME_CREATE_IBSS) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value);
lp->CreateIBSS = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_MULTICAST_RX) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RX, value);
lp->MulticastReceive = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_MAX_SLEEP) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= 0) && (value_convert <= 65535))
lp->MaxSleepDuration = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP);
} else if (strcmp(key, PARM_NAME_NETWORK_ADDR) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->MACAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR);
} else if (strcmp(key, PARM_NAME_AUTHENTICATION) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_AUTHENTICATION) && (value_convert <= PARM_MAX_AUTHENTICATION))
lp->authentication = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION);
} else if (strcmp(key, PARM_NAME_OWN_ATIM_WINDOW) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_OWN_ATIM_WINDOW) && (value_convert <= PARM_MAX_OWN_ATIM_WINDOW))
lp->atimWindow = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW);
} else if (strcmp(key, PARM_NAME_PM_HOLDOVER_DURATION) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_PM_HOLDOVER_DURATION) && (value_convert <= PARM_MAX_PM_HOLDOVER_DURATION))
lp->holdoverDuration = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION);
} else if (strcmp(key, PARM_NAME_PROMISCUOUS_MODE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value);
lp->promiscuousMode = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_CONNECTION_CONTROL) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_CONNECTION_CONTROL) && (value_convert <= PARM_MAX_CONNECTION_CONTROL))
lp->connectionControl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL);
}
/* Need to add? : Probe Data Rate */
}
#endif /* (HCF_TYPE) & HCF_TYPE_STA */
/* Configuration parameters specific to AP mode */
#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_AP */
/* ;?should we restore this to allow smaller memory footprint */
if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_AP) {
if (strcmp(key, PARM_NAME_OWN_DTIM_PERIOD) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value);
value_convert = simple_strtoul(value, NULL, 0);
if (value_convert >= PARM_MIN_OWN_DTIM_PERIOD)
lp->DTIMPeriod = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD);
} else if (strcmp(key, PARM_NAME_REJECT_ANY) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value);
lp->RejectAny = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_EXCLUDE_UNENCRYPTED) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_EXCLUDE_UNENCRYPTED, value);
lp->ExcludeUnencrypted = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_MULTICAST_PM_BUFFERING) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_PM_BUFFERING, value);
lp->ExcludeUnencrypted = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_INTRA_BSS_RELAY) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_INTRA_BSS_RELAY, value);
lp->ExcludeUnencrypted = parse_yes_no(value);
} else if (strcmp(key, PARM_NAME_OWN_BEACON_INTERVAL) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value);
value_convert = simple_strtoul(value, NULL, 0);
if (value_convert >= PARM_MIN_OWN_BEACON_INTERVAL)
lp->ownBeaconInterval = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL);
} else if (strcmp(key, PARM_NAME_COEXISTENCE) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value);
value_convert = simple_strtoul(value, NULL, 0);
if (value_convert >= PARM_MIN_COEXISTENCE)
lp->coexistence = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE);
}
#ifdef USE_WDS
else if (strcmp(key, PARM_NAME_RTS_THRESHOLD1) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->wds_port[0].rtsThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1);
} else if (strcmp(key, PARM_NAME_RTS_THRESHOLD2) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->wds_port[1].rtsThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2);
} else if (strcmp(key, PARM_NAME_RTS_THRESHOLD3) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->wds_port[2].rtsThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3);
} else if (strcmp(key, PARM_NAME_RTS_THRESHOLD4) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->wds_port[3].rtsThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4);
} else if (strcmp(key, PARM_NAME_RTS_THRESHOLD5) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->wds_port[4].rtsThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5);
} else if (strcmp(key, PARM_NAME_RTS_THRESHOLD6) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD))
lp->wds_port[5].rtsThreshold = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6);
} else if (strcmp(key, PARM_NAME_TX_RATE1) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->wds_port[0].txRateCntl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1);
} else if (strcmp(key, PARM_NAME_TX_RATE2) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->wds_port[1].txRateCntl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2);
} else if (strcmp(key, PARM_NAME_TX_RATE3) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->wds_port[2].txRateCntl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3);
} else if (strcmp(key, PARM_NAME_TX_RATE4) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->wds_port[3].txRateCntl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4);
} else if (strcmp(key, PARM_NAME_TX_RATE5) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->wds_port[4].txRateCntl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5);
} else if (strcmp(key, PARM_NAME_TX_RATE6) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value);
value_convert = simple_strtoul(value, NULL, 0);
if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE))
lp->wds_port[5].txRateCntl = value_convert;
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6);
} else if (strcmp(key, PARM_NAME_WDS_ADDRESS1) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1);
} else if (strcmp(key, PARM_NAME_WDS_ADDRESS2) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2);
} else if (strcmp(key, PARM_NAME_WDS_ADDRESS3) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3);
} else if (strcmp(key, PARM_NAME_WDS_ADDRESS4) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4);
} else if (strcmp(key, PARM_NAME_WDS_ADDRESS5) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5);
} else if (strcmp(key, PARM_NAME_WDS_ADDRESS6) == 0) {
DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value);
if (parse_mac_address(value, mac_value) == ETH_ALEN)
memcpy(lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN);
else
DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6);
}
#endif /* USE_WDS */
}
#endif /* (HCF_TYPE) & HCF_TYPE_AP */
return;
} /* translate_option */
/*============================================================================*/
/*******************************************************************************
* parse_mac_address()
*******************************************************************************
*
* DESCRIPTION:
*
* This function will parse a mac address string and convert it to a byte
* array.
*
* PARAMETERS:
*
* value - the MAC address, represented as a string
* byte_array - the MAC address, represented as a byte array of length
* ETH_ALEN
*
* RETURNS:
*
* The number of bytes in the final MAC address, should equal to ETH_ALEN.
*
******************************************************************************/
int parse_mac_address(char *value, u_char *byte_array)
{
int value_offset = 0;
int array_offset = 0;
int field_offset = 0;
char byte_field[3];
/*------------------------------------------------------------------------*/
memset(byte_field, '\0', 3);
while (value[value_offset] != '\0') {
/* Skip over the colon chars separating the bytes, if they exist */
if (value[value_offset] == ':') {
value_offset++;
continue;
}
byte_field[field_offset] = value[value_offset];
field_offset++;
value_offset++;
/* Once the byte_field is filled, convert it and store it */
if (field_offset == 2) {
byte_field[field_offset] = '\0';
byte_array[array_offset] = simple_strtoul(byte_field, NULL, 16);
field_offset = 0;
array_offset++;
}
}
/* Use the array_offset as a check; 6 bytes should be written to the
byte_array */
return array_offset;
} /* parse_mac_address */
/*============================================================================*/
/*******************************************************************************
* ParseConfigLine()
*******************************************************************************
*
* DESCRIPTION:
*
* Parses a line from the configuration file into an L-val and an R-val,
* representing a key/value pair.
*
* PARAMETERS:
*
* pszLine - the line from the config file to parse
* ppszLVal - the resulting L-val (Key)
* ppszRVal - the resulting R-val (Value)
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal)
{
int i;
int size;
/* get a snapshot of our string size */
size = strlen(pszLine);
*ppszLVal = NULL;
*ppszRVal = NULL;
if (pszLine[0] != '#' && /* skip the line if it is a comment */
pszLine[0] != '\n' && /* if it's an empty UNIX line, do nothing */
!(pszLine[0] == '\r' && pszLine[1] == '\n') /* if it's an empty MS-DOS line, do nothing */
) {
/* advance past any whitespace, and assign the L-value */
for (i = 0; i < size; i++) {
if (pszLine[i] != ' ') {
*ppszLVal = &pszLine[i];
break;
}
}
/* advance to the end of the l-value*/
for (i++; i < size; i++) {
if (pszLine[i] == ' ' || pszLine[i] == '=') {
pszLine[i] = '\0';
break;
}
}
/* make any whitespace and the equal sign a NULL character, and
advance to the R-Value */
for (i++; i < size; i++) {
if (pszLine[i] == ' ' || pszLine[i] == '=') {
pszLine[i] = '\0';
continue;
}
*ppszRVal = &pszLine[i];
break;
}
/* make the line ending character(s) a NULL */
for (i++; i < size; i++) {
if (pszLine[i] == '\n')
pszLine[i] = '\0';
if ((pszLine[i] == '\r') && (pszLine[i+1] == '\n'))
pszLine[i] = '\0';
}
}
} /* ParseConfigLine */
/*============================================================================*/
#endif /* USE_PROFILE */

View file

@ -1,87 +0,0 @@
/*******************************************************************************
* 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 config parsing routines.
*
*------------------------------------------------------------------------------
*
* 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_PROFILE_H__
#define __WL_PROFILE_H__
/*******************************************************************************
* constant definitions
******************************************************************************/
#define ROOT_CONFIG_FILENAME "/etc/agere/iwconfig-"
/*******************************************************************************
* function prototypes
******************************************************************************/
void parse_config(struct net_device *dev);
int readline(int filedesc, char *buffer);
void translate_option(char *buffer, struct wl_private *lp);
int parse_mac_address(char *value, u_char *byte_array);
void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal);
#endif /* __WL_PROFILE_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,96 +0,0 @@
/*******************************************************************************
* 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 utility functions used
* throughout the driver.
*
*------------------------------------------------------------------------------
*
* 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_UTIL_H__
#define __WL_UTIL_H__
/*******************************************************************************
* function prototypes
******************************************************************************/
int dbm(int value);
int is_valid_key_string(char *s);
void key_string2key(char *ks, KEY_STRCT *key);
void wl_hcf_error(struct net_device *dev, int hcfStatus);
void wl_endian_translate_event(ltv_t *pLtv);
int wl_has_wep(IFBP ifbp);
hcf_8 wl_parse_ds_ie(PROBE_RESP *probe_rsp);
hcf_8 *wl_parse_wpa_ie(PROBE_RESP *probe_rsp, hcf_16 *length);
hcf_8 *wl_print_wpa_ie(hcf_8 *buffer, int length);
int wl_get_tallies(struct wl_private *, CFG_HERMES_TALLIES_STRCT *);
int wl_is_a_valid_chan(int channel);
int wl_is_a_valid_freq(long frequency);
long wl_get_freq_from_chan(int channel);
int wl_get_chan_from_freq(long frequency);
void wl_process_link_status(struct wl_private *lp);
void wl_process_probe_response(struct wl_private *lp);
void wl_process_updated_record(struct wl_private *lp);
void wl_process_assoc_status(struct wl_private *lp);
void wl_process_security_status(struct wl_private *lp);
#endif /* __WL_UTIL_H__ */

View file

@ -1,146 +0,0 @@
/*******************************************************************************
* 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 header file contains version information for the code base, as well as
* special definitions and macros needed by certain versions of the code.
*
*------------------------------------------------------------------------------
*
* 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_VERSION_H__
#define __WL_VERSION_H__
/*******************************************************************************
* include files
******************************************************************************/
//#include <linux/config.h>
#ifndef CONFIG_MODVERSIONS
#define __NO_VERSION__
#endif // CONFIG_MODVERSIONS
/*******************************************************************************
* constant definitions
******************************************************************************/
#define VENDOR_NAME "Agere Systems, http://www.agere.com"
#define DRIVER_NAME "wlags49"
#define DRV_IDENTITY 49
#define DRV_MAJOR_VERSION 7
#define DRV_MINOR_VERSION 22
#define DRV_VERSION_STR "7.22"
#if defined BUS_PCMCIA
#define BUS_TYPE "PCMCIA"
#elif defined BUS_PCI
#define BUS_TYPE "PCI"
#else
err: define bus type;
#endif // BUS_XXX
#if defined HERMES25
#define HW_TYPE "HII.5"
#else
#define HW_TYPE "HII"
#endif // HERMES25
#if defined WARP
#define FW_TYPE "WARP"
#else
#define FW_TYPE "BEAGLE"
#endif // WARP
#if defined HERMES25
#if defined WARP
#define DRV_VARIANT 3
#else
#define DRV_VARIANT 4
#endif // WARP
#else
#define DRV_VARIANT 2
#endif // HERMES25
#define VERSION_INFO KBUILD_MODNAME " v" DRV_VERSION_STR \
" for " BUS_TYPE ", by " VENDOR_NAME
/* The version of wireless extensions we support */
#define WIRELESS_SUPPORT 21
/*******************************************************************************
* bus architecture specific defines, includes, etc.
******************************************************************************/
/*
* There doesn't seem to be a difference for PCMCIA and PCI anymore, at least
* for PCMCIA the same defines are needed now as previously only used for PCI
*/
#define NEW_MULTICAST
#define ALLOC_SKB(len) dev_alloc_skb(len+2)
#define GET_PACKET(dev, skb, count)\
skb_reserve((skb), 2); \
BLOCK_INPUT(skb_put((skb), (count)), (count)); \
(skb)->protocol = eth_type_trans((skb), (dev))
#define GET_PACKET_DMA(dev, skb, count)\
skb_reserve((skb), 2); \
BLOCK_INPUT_DMA(skb_put((skb), (count)), (count)); \
(skb)->protocol = eth_type_trans((skb), (dev))
#endif // __WL_VERSION_H__

File diff suppressed because it is too large Load diff

View file

@ -1,88 +0,0 @@
/*******************************************************************************
* 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 wireless IOCTL handlers.
*
*------------------------------------------------------------------------------
*
* 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_WEXT_H__
#define __WL_WEXT_H__
/*******************************************************************************
* function protoypes
******************************************************************************/
struct iw_statistics *wl_wireless_stats( struct net_device *dev );
struct iw_statistics * wl_get_wireless_stats( struct net_device *dev );
inline void wl_spy_gather (struct net_device *dev, u_char *mac);
void wl_wext_event_freq( struct net_device *dev );
void wl_wext_event_mode( struct net_device *dev );
void wl_wext_event_essid( struct net_device *dev );
void wl_wext_event_encode( struct net_device *dev );
void wl_wext_event_ap( struct net_device *dev );
void wl_wext_event_scan_complete( struct net_device *dev );
void wl_wext_event_new_sta( struct net_device *dev );
void wl_wext_event_expired_sta( struct net_device *dev );
void wl_wext_event_mic_failed( struct net_device *dev );
void wl_wext_event_assoc_ie( struct net_device *dev );
extern const struct iw_handler_def wl_iw_handler_def;
#endif /* __WL_WEXT_H__ */

View file

@ -1,11 +0,0 @@
config WLAGS49_H25
tristate "Linksys HERMES II.5 WCF54G_Wireless-G_CompactFlash_Card"
depends on WLAN && PCMCIA
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
---help---
Driver for wireless cards using Agere's HERMES II.5 chipset
which are identified with Manufacture ID: 0156,0004
The software is a modified version of wl_lkm_722_abg.tar.gz
from the Agere Systems website, adapted for Ubuntu 9.04.

View file

@ -1,52 +0,0 @@
#
# 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

View file

@ -1,30 +0,0 @@
=======================================================================
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
This directory only contains files that refer to the source in wlags49_h2.
Only real sourcefiles are the Makefile which has been configured to build
the driver for the HERMES II.5 chipset and Kconfig to describe the driver.
The wlags49_h2 directory contains the full source, including the files
exclusively used by this driver.
For more information about the driver look at the wlags49_h2 direcory.
=======================================================================

View file

@ -1,33 +0,0 @@
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 build in to catch most cases but not all
- once the driver runs it is very stable, but I have the impression
some the critical sections take to long
- 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.

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/ap_h25.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/debug.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhf.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhf.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhfcfg.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcf.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcf.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcfcfg.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcfdef.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/mdd.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/mmd.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/mmd.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/sta_h25.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_cs.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_cs.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_enc.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_enc.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_if.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_internal.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_main.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_main.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_netdev.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_netdev.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_priv.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_priv.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_profile.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_profile.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_util.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_util.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_version.h"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_wext.c"

View file

@ -1,2 +0,0 @@
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_wext.h"