Commit 68c0bdff authored by Henk de Groot's avatar Henk de Groot Committed by Greg Kroah-Hartman

Staging: wlags49_h2: add Agere driver for HERMES II and HERMES II.5 chipsets

WLAN driver for cards using the HERMES II and HERMES II.5 chipset

Based on Agere Systems Linux LKM Wireless Driver Source Code,
Version 7.22; complies with Open Source BSD License.

The software is a modified version of wl_lkm_722_abg.tar.gz from the
Agere Systems website, addapted for Ubuntu 9.04 and modified to
fit in the current Linux kernel (2.6.31).

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 $
Signed-off-by: default avatarHenk de Groot <pe1dnn@amsat.org>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 349f535c
...@@ -125,6 +125,10 @@ source "drivers/staging/iio/Kconfig" ...@@ -125,6 +125,10 @@ source "drivers/staging/iio/Kconfig"
source "drivers/staging/ramzswap/Kconfig" source "drivers/staging/ramzswap/Kconfig"
source "drivers/staging/wlags49_h2/Kconfig"
source "drivers/staging/wlags49_h25/Kconfig"
source "drivers/staging/strip/Kconfig" source "drivers/staging/strip/Kconfig"
source "drivers/staging/arlan/Kconfig" source "drivers/staging/arlan/Kconfig"
......
...@@ -44,6 +44,8 @@ obj-$(CONFIG_RAR_REGISTER) += rar/ ...@@ -44,6 +44,8 @@ obj-$(CONFIG_RAR_REGISTER) += rar/
obj-$(CONFIG_DX_SEP) += sep/ obj-$(CONFIG_DX_SEP) += sep/
obj-$(CONFIG_IIO) += iio/ obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_RAMZSWAP) += ramzswap/ obj-$(CONFIG_RAMZSWAP) += ramzswap/
obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/
obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/
obj-$(CONFIG_STRIP) += strip/ obj-$(CONFIG_STRIP) += strip/
obj-$(CONFIG_ARLAN) += arlan/ obj-$(CONFIG_ARLAN) += arlan/
obj-$(CONFIG_WAVELAN) += wavelan/ obj-$(CONFIG_WAVELAN) += wavelan/
......
config WLAGS49_H2
tristate "Agere Systems HERMES II Wireless PC Card Model 0110"
depends on WLAN_80211 && WIRELESS_EXT
---help---
Driver for wireless cards using Agere's HERMES II chipset
which are identified with Manufacture ID: 0156,0003
The software is a modified version of wl_lkm_722_abg.tar.gz
from the Agere Systems website, addapted for Ubuntu 9.04.
#
# Makefile for wlags49_h2_cs.ko and wlags49_h25_cs.ko
#
# Default build for Hermes-II base cards (possibly identified with
# "manfid: 0x0156, 0x0003" in "pccardctl ident" output), comment
# -DHERMES25 below
#
# If you want to build for Hermes-II.5 base cards (possibly identified with
# "manfid: 0x0156, 0x0004" in "pccardctl ident" output), uncomment
# -DHERMES25 below
#
# If you want to build AP support (untested), comment out -DSTA_ONLY
INSTALLDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless
EXTRA_CFLAGS += -I$(KERNELDIR)/include
EXTRA_CFLAGS += -I$(src) \
-DBUS_PCMCIA \
-DUSE_WPA \
-DUSE_WEXT \
-DSTA_ONLY \
-DWVLAN_49 \
# -DHERMES25 \
# -DDBG \
# -DDBG_LVL=5 \
# -DUSE_UIL \
# -DUSE_PROFILE \
ifeq ($(findstring HERMES25,$(EXTRA_CFLAGS)),)
WLNAME := wlags49_h2_cs
$(WLNAME)-y := sta_h2.o
ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
$(WLNAME)-y += ap_h2.o
endif
else
WLNAME=wlags49_h25_cs
$(WLNAME)-y := sta_h25.o
ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
$(WLNAME)-y += ap_h25.o
endif
endif
# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
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
$(WLNAME)-$(CONFIG_SYSFS) += wl_sysfs.o
# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
clean:
rm -fr *.o *.ko *.mod.c *.mod.o .*.*.cmd Module.symvers \
Module.markers modules.order .tmp_versions
install: default
-rmmod $(WLNAME)
install -d $(INSTALLDIR)
install -m 0644 -o root -g root $(WLNAME).ko $(INSTALLDIR)
/sbin/depmod -aq
=======================================================================
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 detemine 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 succesfull 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 aparently 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 traditonal 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" routinge 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. Eventhough setting parameters on the module
does not work anymore but it provides some information about all the
settings.
I have not have personal contact with Agere, but others have. Agere
agreed to make their software available under the BSD licence.
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 ---
==============================================================================
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 seperate 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
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*******************************************************************************
* 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 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/20 09:29:45 $
* $Revision: 1.3 $
* $Source: /usr/local/cvs/wl_lkm/include/hcf/debug.h,v $
*
******************************************************************************/
#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 PRINTK
# define PRINTK(S...) printk(S)
#endif // PRINTK
#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
#ifndef DBG_TRAP
# define DBG_TRAP {}
#endif // DBG_TRAP
#define _ENTER_STR ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
#define _LEAVE_STR "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
#define _DBG_ENTER(A) DBG_PRINT("%s:%.*s:%s\n",DBG_NAME(A),++DBG_LEVEL(A),_ENTER_STR,__FUNC__)
#define _DBG_LEAVE(A) DBG_PRINT("%s:%.*s:%s\n",DBG_NAME(A),DBG_LEVEL(A)--,_LEAVE_STR,__FUNC__)
#define DBG_FUNC(F) static const char *__FUNC__ = F;
#define DBG_ENTER(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_ENTER(A);}
#define DBG_LEAVE(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_LEAVE(A);}
#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...) {if (DBG_FLAGS(A) & DBG_ERROR_ON) \
{DBG_PRINT("%s:ERROR:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);DBG_TRAP;}}
#define DBG_WARNING(A,S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) \
{DBG_PRINT("%s:WARNING:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}}
#define DBG_NOTICE(A,S...) {if (DBG_FLAGS(A) & DBG_NOTICE_ON) \
{DBG_PRINT("%s:NOTICE:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}}
#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) {if (!(C)) \
{DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
#C,__FILE__,__LINE__,__FUNC__); \
DBG_TRAP;}}
typedef struct {
char *dbgName;
int dbgLevel;
unsigned long DebugFlag;
} dbg_info_t;
/****************************************************************************/
#else // DBG
/****************************************************************************/
#define DBG_DEFN
#define DBG_TRAP
#define DBG_FUNC(F)
#define DBG_PRINT(S...)
#define DBG_ENTER(A)
#define DBG_LEAVE(A)
#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
// vim:tw=110:ts=4:
/**************************************************************************************************************
*
* 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 © 1999 - 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 "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
char signature[14] = "FUPU7D37dhfwci";
//The binary download function "relocates" the image using constructions like:
// fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw );
//under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic.
//fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment.
//However the segment is not set at all.
//As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in
//which case we know that a 32-bit quantity is adequate as a pointer.
//Note that other platforms may experience comparable problems when using the binary download feature.
#if defined(_MSC_VER) && _MSC_VER == 800 // Visual C++ 1.5
#define PSEUDO_CHARP hcf_32
#else
#define PSEUDO_CHARP hcf_8*
#endif
/*-----------------------------------------------------------------------------
*
* 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 };
CFG_SUP_RANGE_STRCT mfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_MFI_SUP_RANGE };
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.
*/
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
*************************************************************************************************************/
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 *)((PSEUDO_CHARP)fw->codep + (hcf_32)fw );
fw->identity = (CFG_IDENTITY_STRCT FAR *)((PSEUDO_CHARP)fw->identity + (hcf_32)fw );
fw->compat = (CFG_RANGE20_STRCT FAR *)((PSEUDO_CHARP)fw->compat + (hcf_32)fw );
for ( i = 0; fw->p[i]; i++ ) fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw );
p = fw->codep;
while ( p->len ) {
p->host_addr = (PSEUDO_CHARP)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
// vim:tw=110:ts=4:
#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 © 1994 - 1995 by AT&T. All Rights Reserved
* COPYRIGHT © 1999 - 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.
*
*
**************************************************************************************************************/
#ifdef _WIN32_WCE
#include <windef.h>
#endif
#include "hcf.h" // includes HCFCFG.H too
#ifdef DHF_UIL
#define GET_INFO( pp ) uil_get_info( (LTVP)pp )
#define PUT_INFO( pp ) uil_put_info( (LTVP)pp )
#else
#define GET_INFO( pp ) hcf_get_info( ifbp, (LTVP)pp )
#define PUT_INFO( pp ) hcf_put_info( ifbp, (LTVP)pp )
#endif
/*---- Defines --------------------------------------------------------------*/
#define CODEMASK 0x0000FFFFL // Codemask for plug records
/*---- Error numbers --------------------------------------------------------*/
#define DHF_ERR_INCOMP_FW 0x40 //Image not compatible with NIC
/*---- Type definitions -----------------------------------------------------*/
//* needed by dhf_wrap.c
//
typedef struct {
LTVP ltvp;
hcf_16 len;
} LTV_INFO_STRUCT , *LTV_INFO_STRUCT_PTR;
/*
* Type: plugrecord
*
* Abstract: This structure represents a Plug Data Record.
*
* Description:
* This structure is used to overlay the plug records in the firmware memory image.
*/
typedef struct {
hcf_32 code; // Code to plug
hcf_32 addr; // Address within the memory image to plug it in
hcf_32 len; // The # of bytes which are available to store it
} plugrecord;
/*
* Type: stringrecord
*
* Abstract: This structure represents a Firmware debug/assert string
*
* Description:
* This structure is used to get assert and debug outputs in the driver and/or utility to be
* able to get more visability of the FW.
*/
#define MAX_DEBUGSTRINGS 1024
#define MAX_DEBUGSTRING_LEN 82
typedef struct {
hcf_32 id;
char str[MAX_DEBUGSTRING_LEN];
} stringrecord;
/*
* Type: exportrecord
*
* Abstract: This structure represents a Firmware export of a variable
*
* Description:
* This structure is used to get the address and name of a FW variable.
*/
#define MAX_DEBUGEXPORTS 2048
#define MAX_DEBUGEXPORT_LEN 12
typedef struct {
hcf_32 id;
char str[MAX_DEBUGEXPORT_LEN];
} exportrecord;
// Offsets in memimage array p[]
#define FWSTRINGS_FUNCTION 0
#define FWEXPORTS_FUNCTION 1
/*
* Type: memimage
*
* Abstract: The "root" description of a complete memory image
*
* Description:
* This type represents an entire memory image. The image is built up of several
* segments. These segments need not be contiguous areas in memory, in other words
* the image may contain 'holes'.
*
* The 'codep' field points to an array of segment_descriptor structures.
* The end of the array is indicated by a segment_descriptor of which all fields are zero.
* The 'execution' field is a 32-bit address representing the execution address
* of the firmware within the memory image. This address is zero in case of non-volatile
* memory download.
* The 'compat' field points to an array of TODO
* The end of the array is indicated by a plug record of which all fields are zero.
* The 'identity' field points to an array of TODO
* The end of the array is indicated by a plug record of which all fields are zero.
* The Hermes-I specific 'pdaplug' field points to an array of Production Data Plug record structures.
* The end of the array is indicated by a plug record of which all fields are zero.
* The Hermes-I specific 'priplug' field points to an array of Primary Information Plug record structures.
* The end of the array is indicated by a plug record of which all fields are zero.
*/
typedef struct {
char signature[14+1+1]; // signature (see DHF.C) + C/LE-Bin/BE-Bin-flag + format version
CFG_PROG_STRCT FAR *codep; //
hcf_32 execution; // Execution address of the firmware
void FAR *place_holder_1;
void FAR *place_holder_2;
CFG_RANGE20_STRCT FAR *compat; // Pointer to the compatibility info records
CFG_IDENTITY_STRCT FAR *identity; // Pointer to the identity info records
void FAR *p[2]; /* (Up to 9) pointers for (future) expansion
* currently in use:
* - F/W printf information
*/
} memimage;
/*-----------------------------------------------------------------------------
*
* DHF function prototypes
*
*---------------------------------------------------------------------------*/
EXTERN_C int dhf_download_fw( void *ifbp, memimage *fw ); // ifbp, ignored when using the UIL
EXTERN_C int dhf_download_binary( memimage *fw );
/*-----------------------------------------------------------------------------
*
* Functions to be provided by the user of the DHF module.
*
*---------------------------------------------------------------------------*/
// defined in DHF.C; see there for comments
EXTERN_C hcf_16 *find_record_in_pda( hcf_16 *pdap, hcf_16 code );
#endif // DHF_H
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* This file contains DHF configuration info.
*
*------------------------------------------------------------------------------
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* Copyright © 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 07:08:33 $
* $Revision: 1.1.1.1 $
* $Source: /usr/local/cvs/wl_lkm/include/hcf/dhfcfg.h,v $
*
******************************************************************************/
#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
This source diff could not be displayed because it is too large. You can view the blob instead.
// vim:tw=110:ts=4:
#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)
/* Endianess
* 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 Endianess
*/
#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) // endianess conversion needed
#define CNV_BIG_TO_SHORT(w) (w) // no endianess 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 endianess conversion needed
#define CNV_BIG_TO_SHORT(w) CNV_END_SHORT(w) // endianess 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
#if (HCF_EXT) & HCF_EXT_MB
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
#endif // HCF_EXT_MB
#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
#if ! defined HCF_INT_OFF
hcf_16 volatile IFB_IntOffCnt; // 0xFFFF based HCF_ACT_INT_OFF nesting counter, DeepSleep flag
#endif // HCF_INT_OFF
#if (HCF_TYPE) & HCF_TYPE_CCX
hcf_16 IFB_CKIPStat; // CKIP Status flag
#endif // HCF_TYPE_CCX
#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 );
#if (HCF_ENCAP) & HCF_ENC_SUP
EXTERN_C hcf_8 hcf_encap (wci_bufp type );
#endif // HCF_ENC_SUP
EXTERN_C int hcf_get_info (IFBP ifbp, LTVP ltvp );
EXTERN_C int hcf_service_nic (IFBP ifbp, wci_bufp bufp, unsigned int len );
EXTERN_C int hcf_cntl (IFBP ifbp, hcf_16 cmd );
EXTERN_C int hcf_put_info (IFBP ifbp, LTVP ltvp );
EXTERN_C int hcf_rcv_msg (IFBP ifbp, DESC_STRCT *descp, unsigned int offset );
EXTERN_C int hcf_send_msg (IFBP ifbp, DESC_STRCT *dp, hcf_16 tx_cntl );
#if HCF_DMA
EXTERN_C void hcf_dma_tx_put (IFBP ifbp, DESC_STRCT *d, hcf_16 tx_cntl );
EXTERN_C DESC_STRCT* hcf_dma_tx_get (IFBP ifbp );
EXTERN_C DESC_STRCT* hcf_dma_rx_get (IFBP ifbp );
EXTERN_C void hcf_dma_rx_put (IFBP ifbp, DESC_STRCT *d );
#endif // HCF_DMA
#if (HCF_ASSERT) & HCF_ASSERT_LNK_MSF_RTN
EXTERN_C void msf_assert (unsigned int line_number, hcf_16 trace, hcf_32 qual );
#endif // HCF_ASSERT_LNK_MSF_RTN
#endif // HCF_H
// vim:tw=110:ts=4:
#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 Endianess
* 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
/************************************************************************************************/
/****************************** M I N I P O R T N D I S *************************************/
/************************************************************************************************/
#if defined WVLAN_41 || defined WVLAN_48 || defined WVLAN_52 || defined _WIN32_WCE
#ifndef WVLAN_46
#define HCF_EXT (HCF_EXT_INFO_LOG | HCF_EXT_MB | HCF_EXT_NIC_ACCESS )
#else
#define HCF_EXT ( HCF_EXT_TX_CONT | HCF_EXT_INFO_LOG | HCF_EXT_MB | HCF_EXT_NIC_ACCESS )
#endif
#define HCF_DLV 1 //H-I legacy, superfluous for H-II
#ifdef _WIN32_WCE
#define HCF_IO HCF_IO_MEM
#define HCF_DMA 0 // To enable DMA
#endif
#if _VARIANT == 7
#define HCF_SLEEP HCF_CDS
#endif // _VARIANT == 7
#if _VARIANT == 5 || _VARIANT == 6
#define _WARP
#define _AES
#define HCF_SLEEP HCF_CDS
#if _VARIANT == 6
//! #define _RSN
#endif // _VARIANT == 6
#ifndef _WIN32_WCE
#define HCF_IO HCF_IO_32BITS
#define HCF_DMA 1 // To enable DMA
#endif
#endif // _VARIANT == 5 || _VARIANT == 6
//HWi for migration purposes I defined a define which will be TRUE for ALL drivers
//Meaning that _CCX defined code which we think will get a all driver OK flag can be defined from _CCX to _CCX_OK
#if defined WVLAN_48 // && !defined _WIN32_WCE
#if _VARIANT == 4 || _VARIANT == 6
#define _CCX_OK 1
#endif // _VARIANT == 4 || _VARIANT == 6
#endif // WVLAN_48
//#if !defined WVLAN_46
#if defined WVLAN_48
#if _VARIANT == 4 || _VARIANT == 6
#define _CCX
#define HCF_MAX_MSG_CKIP_PADDING 86 //, use 86 for rx fragmentation. 28 is enuf for MIC+PPK encapsulation
#define HCF_MAX_MSG ( 1514 + HCF_MAX_MSG_CKIP_PADDING ) // need extra padding for CKIP (need to subtract 28 for NDIS)
#endif // _VARIANT == 4 || _VARIANT == 6
#endif // WVLAN_48
//#endif // WVLAN_46
#if !defined WVLAN_46
#define _PEEK
#endif
#ifndef _WIN32_WCE
// ASSERT already used by WinCE...
#ifdef ASSERT
#undef ASSERT
#define ASSERT(x) ASSERTDEBUGMSG((x), (TEXT("SIMULATE ASSERT:")))
#endif
#endif
#if defined WVLAN_41
#define MSF_COMPONENT_ID COMP_ID_MINIPORT_NDIS_31
#endif // WVLAN_41
#if defined WVLAN_48 && !defined _WIN32_WCE
#define MSF_COMPONENT_ID COMP_ID_MINIPORT_NDIS_50
#endif // WVLAN_48 / _WIN32_WCE
#if defined WVLAN_52 && !defined _WIN32_WCE
#define MSF_COMPONENT_ID COMP_ID_MINIPORT_NDIS_40
#endif // WVLAN_52 / _WIN32_WCE
#if defined WVLAN_46
#define MSF_COMPONENT_ID COMP_ID_WIN_CE
#endif // _WIN32_WCE
#define MSF_COMPONENT_VAR _VARIANT
#define T1__HCF_TYPE (HCF_TYPE_NONE)
#define T2__HCF_TYPE (T1__HCF_TYPE)
#ifdef _WARP
#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5 | HCF_TYPE_WARP )
#else
#if _VARIANT == 7
#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5)
#else // _VARIANT == 7
#define T3__HCF_TYPE (T2__HCF_TYPE)
#endif // _VARIANT == 7
#endif // _WARP
#ifdef _CCX_OK
#define T4__HCF_TYPE (T3__HCF_TYPE | HCF_TYPE_CCX)
#else
#define T4__HCF_TYPE (T3__HCF_TYPE)
#endif // _CCX_OK
//not suitable for H-II #define HCF_CFG_STA_1_BOTTOM 16
// Default WPA in ON for all drivers except for WARP driver
#ifdef _WARP
#define T5__HCF_TYPE (T4__HCF_TYPE)
#else // _WARP
#define T5__HCF_TYPE (T4__HCF_TYPE | HCF_TYPE_WPA)
#endif // _WARP
#define HCF_TYPE (T5__HCF_TYPE)
// This is needed to get aux_ctrl() from the HCF for WlFreezeAndDump()
#if (defined DBG && DBG != 0)
#ifndef STATIC
#define STATIC
#endif
#endif
#if !defined SOFTRONICS_CODE && !defined _APIDLL && !defined _WIN32_WCE
#include <ndis.h>
#endif // SOFTRONICS_CODE / _APIDLL / _WIN32_WCE
#if defined _WIN32_WCE
#include <windows.h>
#include <winnt.h>
#endif // _WIN32_WCE
#include "version.h"
#define MSF_COMPONENT_MAJOR_VER TPI_MAJOR_VERSION
#define MSF_COMPONENT_MINOR_VER TPI_MINOR_VERSION
#if !defined _APIDLL && !defined _WIN32_WCE
__inline UCHAR NDIS_IN_BYTE( ULONG port )
{
UCHAR value;
NdisRawReadPortUchar(port , &value);
return (value);
}
__inline ULONG NDIS_IN_LONG( ULONG port )
{
ULONG value;
NdisRawReadPortUlong(port , &value);
return (value);
}
__inline USHORT NDIS_IN_WORD( ULONG port )
{
USHORT value;
NdisRawReadPortUshort(port , &value);
return (value);
}
#define IN_PORT_DWORD(port) NDIS_IN_LONG( (ULONG) (port) )
#define IN_PORT_WORD(port) NDIS_IN_WORD( (ULONG) (port) )
#define OUT_PORT_DWORD(port, value) NdisRawWritePortUlong((ULONG) (port) , value)
#define OUT_PORT_WORD(port, value) NdisRawWritePortUshort((ULONG) (port) , (USHORT) (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)
#define IN_PORT_STRING_32(port, addr, len) { \
NdisRawReadPortBufferUlong(port, addr, (len)); \
}
#define OUT_PORT_STRING_32(port, addr, len) { \
NdisRawWritePortBufferUlong(port, addr, (len)); \
}
#define IN_PORT_STRING_16(port, addr, len) NdisRawReadPortBufferUshort(port, addr, (len));
#define OUT_PORT_STRING_16(port, addr, len) NdisRawWritePortBufferUshort(port, addr, (len));
#endif // _APIDLL / _WIN32_WCE
#if defined _WIN32_WCE
#define HCF_ALIGN 2
#define HCF_MEM_IO 1 // overrule standard Port I/O with Memory mapped I/O
#define HCF_PROT_TIME 49
#define IN_PORT_BYTE CE_IN_PORT_BYTE
#define OUT_PORT_BYTE CE_OUT_PORT_BYTE
#define IN_PORT_WORD CE_IN_PORT_WORD
#define OUT_PORT_WORD CE_OUT_PORT_WORD
#define IN_PORT_STRING_16 CE_IN_PORT_STRING
#define OUT_PORT_STRING_16 CE_OUT_PORT_STRING
extern hcf_8 CE_IN_PORT_BYTE(hcf_32 port);
extern void CE_OUT_PORT_BYTE(hcf_32 port, hcf_8 value);
extern hcf_16 CE_IN_PORT_WORD(hcf_32 port);
extern void CE_OUT_PORT_WORD(hcf_32 port, hcf_16 value);
extern void CE_IN_PORT_STRING(hcf_32 port, void *addr, hcf_16 len);
extern void CE_OUT_PORT_STRING(hcf_32 port, void *addr, hcf_16 len);
#endif
#if defined _DEBUG || (defined DBG && DBG != 0)
#define HCF_ASSERT ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN | HCF_ASSERT_PRINTF ) //0xC001
//#define HCF_ASSERT ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN | HCF_ASSERT_PRINTF | HCF_ASSERT_MB ) //just to test
#endif // _DEBUG || DBG
#if defined DEBUG || defined _DEBUG || (defined DBG && DBG != 0)
#ifdef _WIN32_WCE
#define DBGA2W(DBGSTR) CeConvertAnsiToUnicodeLen((char*)DBGSTR)
#define OUTPUTDEBUGMSG(dprintf_exp) ((void)((! ZONE_DEBUG) ? 0:ce_debug_out dprintf_exp))
#define ASSERTDEBUGMSG(cond, dprintf_exp) ((void)((cond) ? 0:ce_debug_out dprintf_exp))
#define ZONE_ERROR DEBUGZONE(0)
#define ZONE_WARN DEBUGZONE(1)
#define ZONE_FUNCTION DEBUGZONE(2)
#define ZONE_INIT DEBUGZONE(3)
#define ZONE_INTR DEBUGZONE(4)
#define ZONE_RCV DEBUGZONE(5)
#define ZONE_XMIT DEBUGZONE(6)
#define ZONE_ASSERT DEBUGZONE(7)
#define ZONE_DEBUG DEBUGZONE(8)
#define ZONE_OEM DEBUGZONE(9)
#define ZONE_HCF DEBUGZONE(10)
#define ZONE_PORTIO DEBUGZONE(11)
#define ZONE_LOGTOFILE DEBUGZONE(15)
#else // !(_WIN32_WCE)
#define OUTPUTDEBUGMSG(dprintf_exp) ((void) (DbgPrint dprintf_exp))
// the assertdebugmsg macro will print filename, line followed by a caller-defined text, when cond == 0
#define ASSERTDEBUGMSG(cond, print) ((void)((cond) ? 0: (DbgPrint("%s %s:%d - ", print, __FILE__, __LINE__))))
#define ZONE_ERROR 1
#define ZONE_WARN 1
#define ZONE_FUNCTION 1
#define ZONE_INIT 1
#define ZONE_INTR 1
#define ZONE_RCV 1
#define ZONE_XMIT 1
#define ZONE_ASSERT 1
#define ZONE_DEBUG 1
#define ZONE_OEM 1
#define ZONE_HCF 1
#define ZONE_PORTIO 1
#define ZONE_LOGTOFILE 1
#endif // _WIN32_WCE
#ifndef DBGA2W
#define DBGA2W
#endif // DBGA2W
#else // !(defined DEBUG || defined _DEBUG || (defined DBG && DBG != 0) )
#define OUTPUTDEBUGMSG(dprintf_exp)
#define ASSERTDEBUGMSG(cond, dprintf_exp)
#endif // DEBUG / DBG
#if !defined HCF_MAX_MSG_CKIP_PADDING
#define HCF_MAX_MSG_CKIP_PADDING 0
#endif // HCF_MAX_MSG_CKIP_PADDING
#if !defined HCF_MAX_MSG
#define HCF_MAX_MSG 1514
#endif // HCF_MAX_MSG
#define HCF_LEGACY 1 //;?nv je moet wat
#endif //WVLAN_41 / WVLAN_48 / WVLAN_52 / _WIN32_WCE
/************************************************************************************************/
/**************************** P A C K E T D R I V E R ***************************************/
/********************************** D O S O D I *********************************************/
/************************************************************************************************/
#if defined WVLAN_42 || defined WVLAN_43
#pragma warning ( disable: 4001 )
#define FAR __far //segmented 16 bits mode
#define BASED __based(__segname("_CODE")) //force all the "const" structures in the CODE segment
//#define HCF_IO 0 //no DMA, no 32 bits
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define HCF_EXT HCF_EXT_MB
#define HCF_PROT_TIME 49 //49*10240 microseconds H/W failure protection timer
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/******************************** CONFIGURATION MANAGEMENT *****************************************/
#ifdef WVLAN_42
#define MSF_COMPONENT_ID COMP_ID_PACKET
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER 6
#define MSF_COMPONENT_MINOR_VER 12
#endif // WVLAN_42
#ifdef WVLAN_43
#define MSF_COMPONENT_ID COMP_ID_ODI_16
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER 6
#define MSF_COMPONENT_MINOR_VER 10
#endif // WVLAN_43
/************************************** INPUT / OUTPUT **********************************************/
#ifndef H_2_INC
#include <stdio.h>
#include <conio.h>
#if 1 //temorary use functions defined in hcf.c
#ifndef _DEBUG
#pragma intrinsic( _inp, _inpw, _outp, _outpw )
#endif // _DEBUG
#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
#if 1 // 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; }
#define OUT_PORT_STRING_8_16( port, addr, n) while (n--) \
{ OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; ((hcf_8 FAR*)addr)+=2; }
#elif 0 // 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);}
#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; }
#else // Assembler implementation
#define IN_PORT_STRING_8_16( port, addr, n) __asm \
{ \
__asm push di \
__asm push es \
__asm mov cx,n \
__asm les di,addr \
__asm mov dx,port \
__asm rep insw \
__asm pop es \
__asm pop di \
}
#define OUT_PORT_STRING_8_16( port, addr, n) __asm \
{ \
__asm push si \
__asm push ds \
__asm mov cx,n \
__asm lds si,addr \
__asm mov dx,port \
__asm rep outsw \
__asm pop ds \
__asm pop si \
}
#endif // Asm or C implementation
#define IN_PORT_STRING_32( port, addr, n) { int n2 = 2*n; IN_PORT_STRING_8_16(port, addr, n2) }
#define OUT_PORT_STRING_32( port, addr, n) { int n2 = 2*n; OUT_PORT_STRING_8_16(port, addr, n2) }
#endif // 0 //temorary use functions defined in hcf.c
#endif // H_2_INC
#endif // WVLAN_42 / WVLAN_43
/************************************************************************************************/
/**************************** D O S H - I / II L O A D E R **********************************/
/************************************************************************************************/
#if defined H0_LDR || defined H1_LDR || defined H2_LDR || defined H5_LDR
#if defined H0_LDR //implies H-I
#define HCF_DLV 0 //H-I legacy, meaningless under H-II
#define HCF_DLNV 1 //H-I legacy, meaningless under H-II
#endif // H0_LDR
#if defined H1_LDR //implies H-I
#define HCF_DLV 1 //H-I legacy, meaningless under H-II
#define HCF_DLNV 0 //H-I legacy, meaningless under H-II
#endif // H1_LDR / H2_LDR
//#if defined H2_LDR : not needed, H-II defaults are O.K for H2_LDR
#ifdef H5_LDR
#define HCF_TYPE (HCF_TYPE_HII5 | HCF_TYPE_WARP )
//;? why does only this subset of the H_LDRs need HCF_TYPE to be defined here
#endif
#define HCF_ASSERT HCF_ASSERT_LNK_MSF_RTN //support dynamic linking of msf_assert routine
#define HCF_ENCAP 0
#define HCF_INT_ON 0
#define HCF_TALLIES 0
#define MSF_COMPONENT_ID COMP_ID_ODI_16 //;?By lack of any better
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER 0
#define MSF_COMPONENT_MINOR_VER 0
#include <stdio.h>
#include <conio.h>
#if defined NDEBUG
#pragma intrinsic( _inp, _inpw, _outp, _outpw )
#endif // NDEBUG
#if 0 //use 0 to replace I/O Macros with logging facility
#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
#define IN_PORT_STRING_16( port, addr, n) \
while ( n-- ) { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
#define OUT_PORT_STRING_16( port, addr, n) \
while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; (cast)addr += 2; }
#endif //use 0 to replace I/O Macros with logging facility
#endif // H0_LDR / H1_LDR / H2_LDR
/************************************************************************************************/
/**************************** H C F D E M O P R O G R A M ***********************************/
/************************************************************************************************/
#if defined HCF_DEMO
#define HCF_DLV 1 //;?should become the default !defaults to 1 anyway for H-II
//#define HCF_DLNV 0 //defaults to 0 anyway for H-II
#define HCF_ASSERT HCF_ASSERT_LNK_MSF_RTN //support dynamic linking of msf_assert routine
#define HCF_ENCAP 0
#define HCF_INT_ON 0
#define HCF_TALLIES ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
//#define MSF_COMPONENT_ID NO configuration management
#include <stdio.h>
#include <conio.h>
#if defined NDEBUG
#pragma intrinsic( _inp, _inpw, _outp, _outpw )
#endif // NDEBUG
#if 0 //use 0 to replace I/O Macros with logging facility
#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
#define IN_PORT_STRING_16( port, addr, n) \
while ( n-- ) { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
#define OUT_PORT_STRING_16( port, addr, n) \
while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; (cast)addr += 2; }
#endif //use 0 to replace I/O Macros with logging facility
#endif // HCF_DEMO
/************************************************************************************************/
/*********************************** M A C O S **********************************************/
/************************************************************************************************/
#if defined WVLAN_45
#include "Version.h"
#define MSF_COMPONENT_ID COMP_ID_MAC_OS
#define MSF_COMPONENT_VAR VARIANT
#define MSF_COMPONENT_MAJOR_VER VERSION_MAJOR
#define MSF_COMPONENT_MINOR_VER VERSION_MINOR
#define MAC_OS 1
#define HCF_BIG_ENDIAN 1 // selects Big Endian (a.k.a. Motorola), most significant byte first
#if defined DEBUG
#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
#endif // DEBUG
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
extern volatile unsigned char *MacIOaddr;
extern hcf_16 IN_PORT_WORD(hcf_16 port);
extern void OUT_PORT_WORD(hcf_16 port, hcf_16 value);
extern void IN_PORT_STRING_16(hcf_16 port, void *addr, hcf_16 len);
extern void OUT_PORT_STRING_16(hcf_16 port, void *addr, hcf_16 len);
#define SwapBytes(t) (((t) >> 8) + (((t) & 0xff) << 8))
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // WVLAN_45
/************************************************************************************************/
/****************************************** 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)
//#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
#endif // WARP
#else
#define HCF_TYPE HCF_TYPE_NONE
#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 OUTPUTDEBUGMSG
#define OUTPUTDEBUGMSG(dprintf_exp)
#endif
#ifndef ASSERTDEBUGMSG
#define ASSERTDEBUGMSG(cond, dprintf_exp)
#endif
#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
/************************************************************************************************/
/********************************************* Q N X ******************************************/
/************************************************************************************************/
#if defined __QNX__ || defined WVLAN_50
#define MSF_COMPONENT_ID 0 //Although there is no DUI support, we need this to get ...
#define MSF_COMPONENT_VAR 0 //...compatibilty check to function
#define MSF_COMPONENT_MAJOR_VER 0 //...;?this is worth looking into to make this a more
#define MSF_COMPONENT_MINOR_VER 0 //..."defined" I/F so OEMers can figure out what to do
#include <conio.h>
#define IN_PORT_WORD(port) ((hcf_16)inpw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) (outpw( (hcf_io)(port), (hcf_16) (value) ))
/*
#define IN_PORT_STRING_16( port, addr, n) \
while ( n-- ) { *(hcf_16*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
#define OUT_PORT_STRING_16( port, addr, n) \
while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16*)addr ) ; (cast)addr += 2; }
*/
#endif // QNX / WVLAN_50
/************************************************************************************************/
/********************************************* B E O S ****************************************/
/************************************************************************************************/
#if defined __BEOS__
#define MSF_COMPONENT_ID 0 //Although there is no DUI support, we need this to get ...
#define MSF_COMPONENT_VAR 0 //...compatibilty check to function
#define MSF_COMPONENT_MAJOR_VER 0 //...;?this is worth looking into to make this a more
#define MSF_COMPONENT_MINOR_VER 0 //..."defined" I/F so OEMers can figure out what to do
#include <drivers/Drivers.h>
#include <drivers/KernelExport.h>
uint8 read_io_8 (int);
void write_io_8 (int, uint8);
uint16 read_io_16 (int);
void write_io_16 (int, uint16);
#define IN_PORT_WORD(port) ((hcf_16)read_io_16( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) (write_io_16( (hcf_io)(port), (hcf_16) (value) ))
/*
#define IN_PORT_STRING_16( port, addr, n) \
while ( n-- ) { *(hcf_16*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
#define OUT_PORT_STRING_16( port, addr, n) \
while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16*)addr ) ; (cast)addr += 2; }
*/
#endif // __BEOS__
/************************************************************************************************/
/******************************** U S B D O N G L E *****************************************/
/************************************************************************************************/
#if defined USB
#include "gpif.h"
#define MSF_COMPONENT_MAJOR_VER 0
#define MSF_COMPONENT_MINOR_VER 1
#define IN_PORT_WORD(port) (Hermes_IO_Read( (hcf_8)(port)))
#define OUT_PORT_WORD(port, value) (Hermes_IO_Write( (hcf_8)port, /*(hcf_16)*/(value) ) )
/* !!!! NOTE USB supports only 16-bits I/O and no 8-bits I/O
* as a consequence the IN_/OUT_PORT_STRING_16 macros use hcf_16* rather than hcf_8 pointers
* to get more optimal code
* therefore the pointers are incremented by 1 (which means two "bytes") rather than by 2
*/
//#define IN_PORT_STRING_16( port, addr, n) while ( n-- ) { *((hcf_16*)addr)++ = IN_PORT_WORD( port ); }
//#define OUT_PORT_STRING_16( port, addr, n) while ( n-- ) { OUT_PORT_WORD( port, *((hcf_16*)addr)++ ); }
#define IN_PORT_STRING_16( port, dst, n) while ( n-- ) { *dst++ = IN_PORT_WORD( port ); }
#define OUT_PORT_STRING_16( port, src, n) while ( n-- ) { OUT_PORT_WORD( port, *src++ ); }
//#define HCF_TYPE ( HCF_TYPE_AP | HCF_TYPE_WPA )
#define HCF_TYPE HCF_TYPE_WPA
#endif // USB
/************************************************************************************************/
/****************************************** FreeBSD *******************************************/
/************************************************************************************************/
#if defined __FREE_BSD__
#define MSF_COMPONENT_ID COMP_ID_FreeBSD
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER 1
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#include <machine/cpufunc.h>
#define IN_PORT_WORD(port) ((hcf_16)inw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) (outw((hcf_io)(port), (hcf_16)(value)))
/*
#define IN_PORT_STRING_16( port, addr, n) \
while ( n-- ) { *(hcf_16*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
#define OUT_PORT_STRING_16( port, addr, n) \
while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16*)addr ) ; (cast)addr += 2; }
*/
#endif // __FREE_BSD__
/************************************************************************************************/
/********************************* W A V E P O I N T ******************************************/
/************************************************************************************************/
#if defined WVLAN_81 /* BORLANDC */
#define EXTERN_C extern // needed because DHF uses this instead of 'extern'
#define MSF_COMPONENT_ID COMP_ID_AP1
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER 4
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_PROT_TIME 49 //49*10240 microseconds H/W failure protection timer
//#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox /* debug build only */
#if !defined FAR
#define FAR far // segmented 16 bits mode
#endif // FAR
#define IN_PORT_WORD(port) (inport( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) (outport( (hcf_io)(port), value ))
#define IN_PORT_STRING_16(port, addr, len) \
asm { push di; push es; mov cx,len; les di,addr; mov dx,port; rep insw; pop es; pop di }
#define OUT_PORT_STRING_16(port, addr, len) \
asm { push si; push ds; mov cx,len; lds si,addr; mov dx,port; rep outsw; pop ds; pop si }
#endif // WVLAN_81
/************************************************************************************************/
/******************************** W A V E L A U N C H *****************************************/
/************************************************************************************************/
#if defined WVLAUNCH
#include "DriverX.h"
extern HWDEVICE* g_pDevice;
//#define MSF_COMPONENT_ID 0 //;? to get around browser problem
#define IN_PORT_WORD(port) HwInpw( g_pDevice, port )
#define OUT_PORT_WORD(port, value) HwOutpw( g_pDevice, port, value )
// C implementation which let the processor handle the word-at-byte-boundary problem
/*
#define IN_PORT_STRING_16( port, addr, n) \
while ( n-- ) { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
#define OUT_PORT_STRING_16( port, addr, n) \
while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; (cast)addr += 2; }
*/
#endif // WVLAUNCH
/************************************************************************************************/
/************************************* W C I T S T *********************************************/
/************************************************************************************************/
#if defined WCITST
#define MSF_COMPONENT_ID 0 //Although there is no DUI support, we need this to get ...
#define MSF_COMPONENT_VAR 0 //...compatibilty check to function
#define MSF_COMPONENT_MAJOR_VER 0 //...;?this is worth looking into to make this a more
#define MSF_COMPONENT_MINOR_VER 0 //..."defined" I/F so OEMers can figure out what to do
//#define HCF_ENCAP HCF_ENC_NONE //to get going
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define HCF_TYPE (HCF_TYPE_WPA | HCF_TYPE_PRELOADED) // Hermes-I for HCF6, II for HCF7
#define HCF_DMA 1
//#define LLB //!!!!MIC Debug Only
#if defined LLB && !((HCF_TYPE) & HCF_TYPE_WPA)
err: no LLB unless SSN;
#endif // LLB / HCF_TYPE_WPA
//#define HCF_ALIGN 2
#define HCF_DLV 1 //just to change memory layout ????;?
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define HCF_ASSERT HCF_ASSERT_SW_SUP // logging via Hermes support registerr
//#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
#if defined __GNUC__
#include "stdio.h"
//#include "unistd.h" //ioperm libc5
#include "sys/io.h" //ioperm glibc
#define extern //see IO Port Programming mini-HOWTO
//#include "asm/io.h" //
#define IN_PORT_WORD(port) inw( (hcf_io)(port) )
#define IN_PORT_DWORD(port) inl( (hcf_io)(port) )
#define OUT_PORT_WORD(port, value) outw( (hcf_io)(port), (hcf_16)(value) )
#define OUT_PORT_DWORD(port, value) outl( (hcf_io)(port), (hcf_16)(value) )
#else
#pragma warning ( disable: 4001 )
#define FAR __far // segmented 16 bits mode
#include <stdio.h>
#include <conio.h>
#ifndef _DEBUG
#pragma intrinsic( _inp, _inpw, _outp, _outpw )
#endif // _DEBUG
#ifdef LOG
extern FILE* utm_logfile;
hcf_16 ipw( hcf_16 port );
hcf_8 ipb( hcf_16 port );
void opw( hcf_16 port, hcf_16 value );
void opb( hcf_16 port, hcf_8 value );
#define IN_PORT_WORD(port) ipw( (hcf_io)(port) )
#define OUT_PORT_WORD(port, value) opw( (hcf_io)(port), (hcf_16)(value) )
#else // LOG
#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
#endif // LOG
#if 1 //ASM example
#define IN_PORT_STRING_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 \
}
#define OUT_PORT_STRING_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 \
}
#endif // asm example
#endif // __GCC__
#if ! defined IN_PORT_STRING_16
#define IN_PORT_STRING_16( port, addr, n) while (n--) \
{ *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); ((hcf_16 FAR*)addr)++; }
#define OUT_PORT_STRING_16( port, addr, n) while (n--) \
{ OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ); ((hcf_16 FAR*)addr)++; }
#endif // IN_PORT_STRING_16
#endif // WCITST
/************************************************************************************************/
/******************************* Motorola Power PC 800 family *********************************/
/************************************************************************************************/
/* known users: LH@I
*/
#if defined I_MPC8XX
#define MSF_COMPONENT_VAR 0
#define MSF_COMPONENT_ID 0
#define MSF_COMPONENT_MAJOR_VER 1
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_HSI_VAR 1
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#include "o_portbl.h"
#include "ipcmcia.h"
typedef o_uint8_t hcf_8;
typedef o_uint16_t hcf_16;
typedef o_uint32_t hcf_32;
/***************************************************************************/
#ifdef _lint
#else
asm hcf_16 IN_PORT_WORD(int port)
{
% reg port
lhbrx r3,r0,port
eieio
}
#endif // _lint
#ifdef _lint
#else
asm void OUT_PORT_WORD(int port, hcf_16 value)
{
% reg port, value
sthbrx value,r0,port
eieio
}
#endif // _lint
/***************************************************************************/
#define IN_PORT_STRING_16(port, addr, len) \
{ \
unsigned l = (len); \
hcf_16 *d = (volatile hcf_16 *)(addr); \
while (l--) \
{ \
*d++ = *(volatile hcf_16 *)(port); \
EIEIO(); \
} \
}
#define OUT_PORT_STRING_16(port, addr, len) \
{ \
unsigned l = (len); \
hcf_16 *s = (volatile hcf_16 *)(addr); \
while (l--) \
{ \
*(volatile hcf_16 *)(port) = *s++; \
EIEIO(); \
} \
}
#endif // I_MPC8XX
/************************************************************************************************/
/********************************** Diab or High C 29K **************************************/
/************************************************************************************************/
/* known users: GK@C
*/
#if defined _AM29K
#define MSF_COMPONENT_VAR 0
#define MSF_COMPONENT_ID COMP_ID_AP1
#define MSF_COMPONENT_MAJOR_VER 1
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#define SwapBytes(t) /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/
#if defined __ppc
#ifndef __GNUC__
#define __asm__ asm
#endif
#if ! defined _lint
#define EIEIO() __asm__(" eieio")
#else
#define EIEIO()
#endif
static hcf_16 IN_PORT_WORD(int port) {
hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();
value = SwapBytes(value);
return value;
}
#define OUT_PORT_WORD(port, value) \
{ *(volatile hcf_16 *)(port) = SwapBytes(value); EIEIO(); }
#else
#define IN_PORT_WORD(port) (*(volatile hcf_16 *)(port))
#define OUT_PORT_WORD(port, value) (*(volatile hcf_16 *)(port) = (value))
#endif // __ppc
/***************************************************************************/
#define IN_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
hcf_16 t, *d = (volatile hcf_16 *)(addr); \
while (l--) { \
t = IN_PORT_WORD(port); \
*d++ = SwapBytes(t); \
} \
}
#define OUT_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
hcf_16 t, *s = (volatile hcf_16 *)(addr); \
while (l--) { \
t = *s++; \
OUT_PORT_WORD(port, SwapBytes(t)); \
} \
}
#if PRODUCT == 9150
#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
#undef MSF_COMPONENT_ID
#endif // 9150
#endif // _AM29K
/************************************************************************************************/
/***************************************** MPC860 **********************************************/
/************************************************************************************************/
/* known users: RR
*/
#if defined CPU
#if CPU == PPC860
#define MSF_COMPONENT_VAR 0
#define MSF_COMPONENT_ID 0
#define MSF_COMPONENT_MAJOR_VER 1
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#define SwapBytes(t) /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/
#ifndef __GNUC__
#define __asm__ asm
#endif
#if ! defined _lint
#define EIEIO() __asm__(" eieio")
#else
#define EIEIO()
#endif
static hcf_16 IN_PORT_WORD(int port) {
hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();
value = SwapBytes(value);
return value;
#ifdef __GNUC__
/* the following serves to avoid the compiler warnings that
* IN_PORT_WORD() is not used in some files */
(void)IN_PORT_WORD;
#endif
}
#define OUT_PORT_WORD(port, value) \
{ *(volatile hcf_16 *)(port) = SwapBytes(value); EIEIO(); }
/***************************************************************************/
#define IN_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
hcf_16 t; \
volatile hcf_16 *d = (volatile hcf_16 *)(addr); \
while (l--) { \
t = IN_PORT_WORD(port); \
*d++ = SwapBytes(t); \
} \
}
#define OUT_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
hcf_16 t; \
volatile hcf_16 *s = (volatile hcf_16 *)(addr); \
while (l--) { \
t = *s++; \
OUT_PORT_WORD(port, SwapBytes(t)); \
} \
}
#if PRODUCT == 9150
#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
#undef MSF_COMPONENT_ID
#endif
#endif /* PPC860 */
#endif /* CPU */
/************************************************************************************************/
/**************************** Microtec Research 80X86 Compiler *********************************/
/************************************************************************************************/
#if 0
//#undef HCF_TYPE // Hermes-I Station F/W without SSN support
#define MSF_COMPONENT_VAR 0
#define MSF_COMPONENT_ID 0
#define MSF_COMPONENT_MAJOR_VER 1
#define MSF_COMPONENT_MINOR_VER 0
extern int far inp( int );
extern void far outp( int, int );
extern int far inpw( int );
extern void far outpw( int, int );
#define IN_PORT_WORD(port) ((hcf_16)inpw( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) ((void)outpw( (hcf_io)(port), value ))
#define IN_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
hcf_16 *d = (hcf_16 *)(addr); \
while (l--) *d++ = IN_PORT_WORD(port); \
}
#define OUT_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
hcf_16 *s = (hcf_16 *)(addr); \
while (l--) OUT_PORT_WORD(port, *s++); \
}
#endif /* Microtec 80X86 C Compiler */
/************************************************************************************************/
/****************************** W A V E L A N E C ********************************************/
/************************************************************************************************/
/* known users: KM
*/
#ifdef mc68302
#define MSF_COMPONENT_ID COMP_ID_EC
#include <version.h>
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER MAJOR_VERSION
#define MSF_COMPONENT_MINOR_VER MINOR_VERSION
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#define SwapBytes(t) /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/
#define PCMCIA_ADDRESS 0xc80000UL
#define IN_PORT_2BYTES(port) (*(hcf_16 *)(port))
#if 0
static hcf_16 IN_PORT_WORD(hcf_32 port) // should be hcf_io, not hcf_32
{
hcf_16 word = IN_PORT_2BYTES(port);
return SwapBytes(word);
}
#else
static hcf_16 swap_var;
#define IN_PORT_WORD(port) \
(((swap_var = IN_PORT_2BYTES(port)) >> 8) + (((swap_var) & 0xff) << 8))
#endif
#define OUT_PORT_2BYTES(port, value) (*(hcf_16 *)(port) = (hcf_16)(value))
#define OUT_PORT_WORD(port, value) OUT_PORT_2BYTES(port, SwapBytes(value))
/*
#define IN_PORT_STRING_16(port, addr, len) \
while ((len)--) {*(hcf_16 *)(addr) = IN_PORT_2BYTES(port); ((cast)addr) += 2; }
#define OUT_PORT_STRING_16(port, addr, len) \
while ((len)--) {OUT_PORT_2BYTES((port), *(hcf_16 *)(addr)) ; ((cast)addr) += 2; }
*/
#endif /* mc68302 */
/************************************************************************************************/
/********************************* NGAP ***************************************/
/************************************************************************************************/
#if defined __VX_WORKS__ /* VxWorks */
#if defined WLC_STATION
//#undef HCF_TYPE /* Hermes-I Station F/W without SSN support */
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDSTA
#else
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDAP
#endif // WLC_STATION
#define HCF_YIELD (taskDelay(0) == 0)
#define MSF_COMPONENT_VAR 1
#define MSF_COMPONENT_MAJOR_VER 1
#define MSF_COMPONENT_MINOR_VER 0
// #define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
#if defined PC486BSP
#define IN_PORT_WORD(port) (sysInWord ((hcf_io)(port)))
#define OUT_PORT_WORD(port, value) (sysOutWord ((hcf_io)(port), (hcf_16) (value)))
#define IN_PORT_STRING_16(port, addr, n) (sysInWordString ((hcf_io)(port), addr, n))
#define OUT_PORT_STRING_16(port, addr, n) (sysOutWordString ((hcf_io)(port), addr, n))
#elif defined AS2000BSP
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
/* Define PCI stuff here. */
unsigned short sysRead16( unsigned short *port );
void sysWrite16( unsigned short *port, unsigned short value );
#define PCI_IN_BYTE( port ) \
*(unsigned char *)( port )
#define PCI_IN_WORD( port ) \
sysRead16( (unsigned short *)( port ) )
#define PCI_OUT_BYTE( port, value ) \
*(unsigned char *)( port ) = (unsigned char)( value )
#define PCI_OUT_WORD( port, value ) \
sysWrite16( (unsigned short *)( port ), (unsigned short)( value ) )
#define IN_PORT_WORD( port ) \
PCI_IN_WORD( port )
#define OUT_PORT_WORD( port, value ) \
PCI_OUT_WORD( port, value )
#define IN_PORT_STRING_16( port, buf, len ) \
do { \
hcf_16 *p; \
\
for ( p = (hcf_16 *)(buf); p < &( (hcf_16 *)(buf) )[ (int)len ]; p++ ) { \
*p = PCI_IN_WORD( port ); \
} \
} while ( 0 )
#define OUT_PORT_STRING_16( port, buf, len ) \
do { \
const hcf_16 *p; \
\
for ( p = (const hcf_16 *)( buf ); p < &( (const hcf_16 *)(buf) )[ (int)len ]; p++ ) { \
PCI_OUT_WORD( port, *p ); \
} \
} while ( 0 )
#elif defined FADS860BSP /* elif defined AS2000BSP */
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#ifndef __GNUC__
#define __asm__ asm
#endif
#if ! defined _lint
#define EIEIO() __asm__(" eieio")
#else
#define EIEIO()
#endif
static hcf_16 IN_PORT_WORD(int port) {
hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();
value = ((value & 0xff00) >> 8) + ((value & 0x00ff) << 8);
/* value = CNV_LITTLE_TO_SHORT(value); */
return value;
#ifdef __GNUC__
/* the following serves to avoid the compiler warnings that
* IN_PORT_WORD() is not used in some files */
(void)IN_PORT_WORD;
#endif
}
#define OUT_PORT_WORD(port, value) \
{ *(volatile hcf_16 *)(port) = CNV_SHORT_TO_LITTLE(value); EIEIO(); }
/***********************************************************************/
#define IN_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
volatile hcf_16 *d = (volatile hcf_16 *)(addr); \
while (l--) { \
*d++ = *(volatile hcf_16 *)(port); \
EIEIO(); \
} \
}
#define OUT_PORT_STRING_16( port, addr, len) { \
unsigned l = (len); \
volatile hcf_16 *s = (volatile hcf_16 *)(addr); \
while (l--) { \
*(volatile hcf_16 *)(port) = *s++; \
EIEIO(); \
} \
}
#elif defined DAYTONABSP
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#ifndef __GNUC__
#define __asm__ asm
#endif
#define IN_PORT_WORD(port) (sysOrinocoInWord((unsigned long)(port)))
#define OUT_PORT_WORD(port,value) (sysOrinocoOutWord((unsigned long)(port), (unsigned short)(value)))
#define IN_PORT_STRING_16(port,addr,len) (sysOrinocoInString((port), (addr), (len)))
#define OUT_PORT_STRING_16(port,addr,len) (sysOrinocoOutString((port), (addr), (len)))
extern unsigned char sysOrinocoInByte (unsigned long port);
extern unsigned short sysOrinocoInWord (unsigned long port);
extern void sysOrinocoInString (unsigned long port, void *addr, unsigned short len);
extern void sysOrinocoOutByte (unsigned long port, unsigned char value);
extern void sysOrinocoOutWord (unsigned long port, unsigned short value);
extern void sysOrinocoOutString (unsigned long port, void *addr, unsigned short len);
#elif defined ALPHA_BSP
#define HCF_BIG_ENDIAN 1
#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
#ifndef __GNUC__
#define __asm__ asm
#endif
#define IN_PORT_WORD(port) (sysOrinocoInWord((unsigned long)(port)))
#define OUT_PORT_WORD(port,value) (sysOrinocoOutWord((unsigned long)(port), (unsigned short)(value)))
#define IN_PORT_STRING_16(port,addr,len) (sysOrinocoInString((port), (addr), (len)))
#define OUT_PORT_STRING_16(port,addr,len) (sysOrinocoOutString((port), (addr), (len)))
extern unsigned char sysOrinocoInByte (unsigned long port);
extern unsigned short sysOrinocoInWord (unsigned long port);
extern void sysOrinocoInString (unsigned long port, void *addr, unsigned short len);
extern void sysOrinocoOutByte (unsigned long port, unsigned char value);
extern void sysOrinocoOutWord (unsigned long port, unsigned short value);
extern void sysOrinocoOutString (unsigned long port, void *addr, unsigned short len);
#else
err: /* commented here */ /* "BSP is not defined..." */
#endif /* else PC486BSP */
#endif // __VX_WORKS__
/************************************************************************************************/
/****************************** VXWORKS. Motorola Sandpoint PowerPC 824X ***********************/
/************************************************************************************************/
#ifdef __VX_WORKS_SANDPOINT_824X__
#include <vxWorks.h>
#include <sysLib.h>
#include <taskLib.h>
#ifdef WVLAN_53
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDSTA
#endif /* WVLAN_53 */
#ifdef WVLAN_54
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDAP
#endif /* WVLAN_54 */
#ifdef WVLAN_56
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_END
#endif /* WVLAN_56 */
#if !defined MSF_COMPONENT_ID
#error "you must define an MSF component ID: WVLAN_53, WVLAN_54, WVLAN_56"
#endif
#define MSF_COMPONENT_VAR 1
#define HCF_EXT HCF_EXT_INFO_LOG
#define HCF_SLEEP ( HCF_CDS | HCF_DDS )
//#define HCF_SLEEP ( HCF_DDS )
#ifndef HCF_ACT_WAKEUP
#define HCF_ACT_WAKEUP 0x1D
#endif // HCF_ACT_WAKEUP
#if defined FATNIC | defined BEAGLE_H253
#define T1__HCF_TYPE HCF_TYPE_STA
#else
#define T1__HCF_TYPE HCF_TYPE_AP | HCF_TYPE_STA
#endif
#ifdef HERMES_USB
#define T2__HCF_TYPE (T1__HCF_TYPE | HCF_TYPE_USB)
#else // HERMES_USB
#define T2__HCF_TYPE (T1__HCF_TYPE)
#endif // HERMES_USB
#ifdef _WARP
#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5)
#else // _WARP
#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_WPA | HCF_TYPE_HII)
#endif // WARP
#ifdef _CCX
#define T4__HCF_TYPE (T3__HCF_TYPE | HCF_TYPE_CCX)
#else // _WARP
#define T4__HCF_TYPE (T3__HCF_TYPE)
#endif // _CCX
#define T5__HCF_TYPE (T4__HCF_TYPE)
// Default to TYPE_AP + SSN!
#define HCF_TYPE (T5__HCF_TYPE )
#define MSF_COMPONENT_MAJOR_VER 2
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_IO HCF_IO_MEM
#define HCF_DMA 0
#define HCF_MEM_IO 1
#define HCF_BIG_ENDIAN 1
//#define support_32bits 1
#define IN_PORT_WORD(port) (sysInWord( (hcf_io)(port) ))
#define OUT_PORT_WORD(port, value) (sysOutWord( (hcf_io)(port), (hcf_16)(value) ))
#define IN_PORT_DWORD(port) (sysInLong( (hcf_io)(port) ))
#define OUT_PORT_DWORD(port, value) (sysOutLong( (hcf_io)(port), (hcf_16)(value) ))
#define IN_PORT_STRING_16(port, dst, n) (sysInWordString((hcf_io)(port), (hcf_16 *)dst, n))
#define OUT_PORT_STRING_16(port, src, n) (sysOutWordString((hcf_io)(port), (hcf_16 *)src, n))
#ifdef WVLAN_DEBUG
#define DBG 1
#define _DEBUG 1
#endif
/* we'll need to add these prints someday */
#define OUTPUTDEBUGMSG(dprintf_exp)
#define ASSERTDEBUGMSG(cond, dprintf_exp)
#define HCF_INTERFACE_CONNECT(ifbp)
#define HCF_INTERFACE_DISCONNECT(ifbp)
#define HCF_ENTER_INTERFACE_FUNCT(ibfb)
#define HCF_LEAVE_INTERFACE_FUNCT(ifbp)
#define CNV_END_INT(w) ( ((hcf_16)(w) & 0x00FF) << 8 | ((hcf_16)(w) & 0xFF00) >> 8 )
#define CNV_LITTLE_TO_INT(w) CNV_END_INT(w)
#define CNV_INT_TO_LITTLE(w) CNV_LITTLE_TO_INT(w)
#endif /* __VX_WORKS_SANDPOINT_824X__ */
/************************************************************************************************/
/************************************* VXWORKS. ARM T8300 IPPhone *****************************/
/************************************************************************************************/
#if defined( IPT_T8300 ) || defined( IPT_T8307 )
#include <vxWorks.h>
#include <sysLib.h>
#include <taskLib.h>
#define HCF_ALIGN 4 /* default to 4 byte alignment */
#define BEAGLE_H253 /* Hermes 2.5.3 build, better to be in the project file */
#define OOR_DDS /* Hermes 2.5.3 build, better to be in the project file */
#define FATNIC
#ifdef WVLAN_53
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDSTA
#endif /* WVLAN_53 */
#ifdef WVLAN_54
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDAP
#endif /* WVLAN_54 */
#ifdef WVLAN_56
#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_END
#endif /* WVLAN_56 */
#if !defined MSF_COMPONENT_ID
#error "you must define an MSF component ID: WVLAN_53, WVLAN_54, WVLAN_56"
#endif
#define MSF_COMPONENT_VAR 1
#define HCF_EXT HCF_EXT_INFO_LOG
//#define HCF_EXT HCF_EXT_INFO_LOG | HCF_EXT_MB
#define HCF_SLEEP ( HCF_CDS | HCF_DDS )
//#define HCF_SLEEP ( HCF_DDS )
#ifndef HCF_ACT_WAKEUP
#define HCF_ACT_WAKEUP 0x1D
#endif // HCF_ACT_WAKEUP
#if defined FATNIC || defined BEAGLE_H253
#define T1__HCF_TYPE HCF_TYPE_STA
#else
//#define T1__HCF_TYPE HCF_TYPE_AP | HCF_TYPE_STA
#define T1__HCF_TYPE HCF_TYPE_STA /* dz, Station code only */
#endif
#ifdef HERMES_USB
#define T2__HCF_TYPE (T1__HCF_TYPE | HCF_TYPE_USB)
#else // HERMES_USB
#define T2__HCF_TYPE (T1__HCF_TYPE)
#endif // HERMES_USB
#ifdef _WARP
#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5)
#else // _WARP
#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_WPA | HCF_TYPE_HII)
//#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII) /* dz. no WPA support at this time, test code */
#endif // WARP
#ifdef _CCX
#define T4__HCF_TYPE (T3__HCF_TYPE | HCF_TYPE_CCX)
#else // _WARP
#define T4__HCF_TYPE (T3__HCF_TYPE)
#endif // _CCX
#define T5__HCF_TYPE (T4__HCF_TYPE)
// Default to TYPE_AP + SSN!
#define HCF_TYPE (T5__HCF_TYPE )
#define MSF_COMPONENT_MAJOR_VER 2
#define MSF_COMPONENT_MINOR_VER 0
#define HCF_IO HCF_IO_MEM
#define HCF_DMA 0
#define HCF_MEM_IO 1
/* Endian is determined by vxWorks project compile option */
#if (_BYTE_ORDER == _BIG_ENDIAN)
#undef HCF_LITTLE_ENDIAN
#define HCF_BIG_ENDIAN 1
#endif
#define CNV_END(w) ( ((hcf_16)(w) & 0x00FF) << 8 | ((hcf_16)(w) & 0xFF00) >> 8 )
#if defined HCF_BIG_ENDIAN
//******************************************** B I G E N D I A N *******************************************
#define CNV_LITTLE_TO_INT(w) CNV_END(w) // endianess conversion needed
#define CNV_BIG_TO_INT(w) (w) // no endianess conversion needed
#else
//****************************************** L I T T L E E N D I A N ****************************************
#define CNV_LITTLE_TO_INT(w) (w) // no endianess conversion needed
#define CNV_BIG_TO_INT(w) CNV_END(w) // endianess conversion needed
#endif // HCF_BIG_ENDIAN
// conversion macros which can be expressed in other macros
#define CNV_INT_TO_LITTLE(w) CNV_LITTLE_TO_INT(w)
#define CNV_INT_TO_BIG(w) CNV_BIG_TO_INT(w)
#define IN_PORT_WORD( port ) *((volatile hcf_16 *)( port ))
#define OUT_PORT_WORD( port, value ) *((volatile hcf_16 *)( port )) = ((hcf_16)( value ))
//#define IN_PORT_BYTE( port ) *((volatile hcf_8 *)( port ))
#define IN_PORT_STRING( port, addr, len) { \
unsigned l = len; \
hcf_16 *d = (hcf_16 *)(addr); \
hcf_16 t; \
while (l--) { \
t = IN_PORT_WORD(port); \
*d++ = CNV_LITTLE_TO_INT(t); \
} \
} // IN_PORT_STRING
#define OUT_PORT_STRING( port, addr, len) { \
unsigned l = (len); \
hcf_16 *s = (hcf_16 *)(addr); \
hcf_16 t; \
while (l--) { \
t = *s++; \
t = CNV_LITTLE_TO_INT(t); \
OUT_PORT_WORD(port, t); \
} \
} // OUT_PORT_STRING
#define IN_PORT_STRING_16(port, dst, n) { \
unsigned l = (n); \
hcf_16 *d = (hcf_16 *)(dst); \
while (l--) { \
*d++ = IN_PORT_WORD(port); \
} \
} // IN_PORT_STRING_16
#define OUT_PORT_STRING_16(port, src, n) { \
hcf_16 t; \
int l = (n); \
hcf_16 *s = (hcf_16 *)(src); \
while (l--) { \
t = *s++; \
OUT_PORT_WORD(port, t); \
} \
} // OUT_PORT_STRING_16
/* #define HCF_YIELD (taskDelay(0) == 0) */
#ifdef WVLAN_DEBUG
#define DBG 1
#define _DEBUG 1
#endif
/* we'll need to add these prints someday */
#define OUTPUTDEBUGMSG(dprintf_exp)
#define ASSERTDEBUGMSG(cond, dprintf_exp)
#define HCF_INTERFACE_CONNECT(ifbp)
#define HCF_INTERFACE_DISCONNECT(ifbp)
#define HCF_ENTER_INTERFACE_FUNCT(ibfb)
#define HCF_LEAVE_INTERFACE_FUNCT(ifbp)
#define sysInWord(offsetAddr) IN_PORT_WORD(offsetAddr)
#define sysInByte(offsetAddr) IN_PORT_BYTE(offsetAddr)
#define sysOutWord(addr, value) OUT_PORT_WORD(addr, value)
#endif /*IPT_T8300 */
/************************************************************************************************************/
/*********************************** **************************************/
/************************************************************************************************************/
#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_DL_ONLY
#define HCF_DL_ONLY 0
#endif // HCF_DL_ONLY
#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_ENTRY
#define HCF_ENTRY( ifbp )
#endif // HCF_ENTRY
#if ! defined HCF_EXIT
#define HCF_EXIT( ifbp )
#endif // HCF_EXIT
#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_DL_ONLY
#undef HCF_DL_ONLY
#define HCF_DL_ONLY 1 //just for convenience of generating cfg_hcf_opt
#endif // HCF_DL_ONLY
#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
#if !defined _TCHAR_DEFINED
#define TCHAR char
#endif // _TCHAR_DEFINED
/************************************************************************************************************/
/*********************** 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 defined HCF_LITTLE_ENDIAN
err: HCF_LITTLE_ENDIAN is obsolete;
#endif // HCF_LITTLE_ENDIAN
#if defined HCF_INT_OFF
err: HCF_INT_OFF is obsolete;
#endif //HCF_INT_OFF
#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_DL_ONLY != 0 && HCF_DL_ONLY != 1
err: invalid value for HCF_DL_ONLY;
#endif // HCF_DL_ONLY
#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
// vim:tw=110:ts=4:
#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
/*************************************************************************************************/
#if 0 //
#define BIT0 0x0001
#define BIT1 0x0002
#define BIT2 0x0004
#define BIT3 0x0008
#define BIT4 0x0010
#define BIT5 0x0020
#define BIT6 0x0040
#define BIT7 0x0080
#define BIT8 0x0100
#define BIT9 0x0200
#define BIT10 0x0400
#define BIT11 0x0800
#define BIT12 0x1000
#define BIT13 0x2000
#define BIT14 0x4000
#define BIT15 0x8000
#define BIT16 0x00010000
#define BIT17 0x00020000
#define BIT18 0x00040000
#define BIT19 0x00080000
#define BIT20 0x00100000
#define BIT21 0x00200000
#define BIT22 0x00400000
#define BIT23 0x00800000
#define BIT24 0x01000000
#define BIT25 0x02000000
#define BIT26 0x04000000
#define BIT27 0x08000000
#define BIT28 0x10000000
#define BIT29 0x20000000
#define BIT30 0x40000000
#define BIT31 0x80000000
#endif // 0
/************************************************************************************************/
/********************************* 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 carefull 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 ************************************************/
/************************************************************************************************/
/* min and max macros */
#if ! defined max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if ! defined min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifdef HCF_SLEEP
#if defined MSF_WAIT
err: MSF should no longer supply this macro;
#else
#define MSF_WAIT(x) \
{ PROT_CNT_INI \
HCF_WAIT_WHILE( ( IPW( HREG_IO ) & HREG_IO_WOKEN_UP ) == 0 ); \
HCFASSERT( prot_cnt, IPW( HREG_IO ) ) \
}
#endif // MSF_WAIT
#else
#define MSF_WAIT(x) /*NOP*/
#endif // HCF_SLEEP
#define LOF(x) (sizeof(x)/sizeof(hcf_16)-1)
#define MUL_BY_2( x ) ( (x) << 1 ) //used to multiply by 2
#define DIV_BY_2( x ) ( (x) >> 1 ) //used to divide by 2
//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) { \
OPW( HREG_EV_ACK, mask | HREG_EV_ACK_REG_READY ); \
OPW( HREG_EV_ACK, (mask & ~HREG_EV_ALLOC) | HREG_EV_ACK_REG_READY ); }
#define DAWA_ZERO_FID(reg) OPW( reg, 0 );
#else
#define DAWA_ACK( mask) OPW( HREG_EV_ACK, mask );
#define DAWA_ZERO_FID(reg)
#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 )
#define IF_SSN(x) x
#define IF_NOT_SSN(x)
#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 )
#define IF_SSN(x)
#define IF_NOT_SSN(x) x
#endif // HCF_TYPE_WPA
#if HCF_TALLIES & HCF_TALLIES_HCF //HCF tally support
#define IF_TALLY(x) x
#else
#define IF_TALLY(x)
#endif // HCF_TALLIES_HCF
#if HCF_DMA
#define IF_DMA(x) x
#define IF_NOT_DMA(x)
#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)
#define IF_NOT_DMA(x) x
#define IF_USE_DMA(x)
#define IF_NOT_USE_DMA(x) x
#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
#define IF_PROT_TIME(x)
#if defined HCF_YIELD
#define HCF_WAIT_WHILE( x ) while ( (x) && (HCF_YIELD) ) /*NOP*/;
#else
#define HCF_WAIT_WHILE( x ) while ( x ) /*NOP*/;
#endif // HCF_YIELD
#else
#define PROT_CNT_INI hcf_32 prot_cnt = ifbp->IFB_TickIni;
#define IF_PROT_TIME(x) x
#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 implemenation 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 implemenation 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 implemenation 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) {if (!(x)) {mdd_assert( ifbp, __LINE__ , q );}}
#define MMDASSERT(x,q) {if (!(x)) {mdd_assert( assert_ifbp, __LINE__ + FILE_NAME_OFFSET, q );}}
#define HCFLOGENTRY( where, what ) \
{if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
HCF_ENTRY( ifbp ); \
HCFASSERT( (ifbp->IFB_AssertTrace & 1<<((where)&0xF)) == 0, ifbp->IFB_AssertTrace ); \
ifbp->IFB_AssertTrace |= 1<<((where)&0xF); \
} \
HCFTRACE(ifbp, where ) \
HCFTRACEVALUE(ifbp, what ) \
}
#define HCFLOGEXIT( where ) \
{if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
HCF_EXIT( ifbp ); \
ifbp->IFB_AssertTrace &= ~(1<<((where)&0xF)); \
} \
HCFTRACE(ifbp, (where)|HCF_TRACE_EXIT ) \
}
#else // HCF_ASSERT
#define HCFASSERT( x, q )
#define MMDASSERT( x, q )
#define HCFLOGENTRY( where, what ) {HCF_ENTRY( ifbp );}
#define HCFLOGEXIT( where ) {HCF_EXIT( ifbp );}
#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 ) {OPW( HREG_SW_1, where );}
//#define HCFTRACE(ifbp, where ) {HCFASSERT( DO_ASSERT, where );}
#define HCFTRACEVALUE(ifbp, what ) {OPW( HREG_SW_2, what );}
//#define HCFTRACEVALUE(ifbp, what ) {HCFASSERT( DO_ASSERT, what );}
#else
#define HCFTRACE(ifbp, where )
#define HCFTRACEVALUE(ifbp, what )
#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
.\" 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 (EXPERIMENTAL)
\- 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).
// vim:tw=110:ts=4:
#ifndef MDD_H
#define MDD_H 1
/*************************************************************************************************************
*
* FILE : mdd.h
*
* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.6 $
* Original : 2004/05/25 05:59:37 Revision: 1.57 Tag: hcf7_t20040602_01
* Original : 2004/05/13 15:31:45 Revision: 1.54 Tag: hcf7_t7_20040513_01
* Original : 2004/04/15 09:24:41 Revision: 1.47 Tag: hcf7_t7_20040415_01
* Original : 2004/04/13 14:22:45 Revision: 1.46 Tag: t7_20040413_01
* Original : 2004/04/01 15:32:55 Revision: 1.42 Tag: t7_20040401_01
* Original : 2004/03/10 15:39:28 Revision: 1.38 Tag: t20040310_01
* Original : 2004/03/04 11:03:37 Revision: 1.36 Tag: t20040304_01
* Original : 2004/03/02 09:27:11 Revision: 1.34 Tag: t20040302_03
* Original : 2004/02/24 13:00:27 Revision: 1.29 Tag: t20040224_01
* Original : 2004/02/18 17:13:57 Revision: 1.26 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* DESC : Definitions and Prototypes for HCF, DHF, MMD and MSF
*
***************************************************************************************************************
*
*
* 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.
*
*
************************************************************************************************************/
/************************************************************************************************************
*
* The macros Xn(...) and XXn(...) are used to define the LTV's (short for Length Type Value[ ]) ,
* aka RIDs, processed by the Hermes.
* The n in Xn and XXn reflects the number of "Value" fields in these RIDs.
*
* Xn(...) : Macros used for RIDs which use only type hcf_16 for the "V" fields of the LTV.
* Xn takes as parameters a RID name and "n" name(s), one for each of the "V" fields of the LTV.
*
* XXn(...) : Macros used for RIDs which use at least one other type then hcf_16 for a "V" field
* of the LTV.
* XXn(..) takes as parameters a RID name and "n" pair(s) of type and name, one for each "V" field
* of the LTV
****************************************** e x a m p l e s ***********************************************
* X1(RID_NAME, parameters...) : expands to :
* typedef struct RID_NAME_STRCT {
* hcf_16 len;
* hcf_16 typ;
* hcf_16 par1;
* } RID_NAME_STRCT;
* X2(RID_NAME, parameters...) : expands to :
* typedef struct RID_NAME_STRCT {
* hcf_16 len;
* hcf_16 typ;
* hcf_16 par1;
* hcf_16 par2;
* } RID_NAME_STRCT;
* XX1(RID_NAME, par1type, par1name, ...) : expands to :
* typedef struct RID_NAME_STRCT {
* hcf_16 len;
* hcf_16 typ;
* par1type par1name;
* } RID_NAME_STRCT;
************************************************************************************************************/
/******************************* XX Sub-macro definitions **************************************************/
#define XX1( name, type1, par1 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
} name##_STRCT;
#define XX2( name, type1, par1, type2, par2 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
type2 par2; \
} name##_STRCT;
#define XX3( name, type1, par1, type2, par2, type3, par3 ) \
typedef struct name##_STRCT { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
type2 par2; \
type3 par3; \
} name##_STRCT;
#define XX4( name, type1, par1, type2, par2, type3, par3, type4, par4 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
type2 par2; \
type3 par3; \
type4 par4; \
} name##_STRCT;
#define X1( name, par1 ) \
typedef struct name##_STRCT { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
} name##_STRCT;
#define X2( name, par1, par2 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
} name##_STRCT;
#define X3( name, par1, par2, par3 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
} name##_STRCT;
#define X4( name, par1, par2, par3, par4 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
} name##_STRCT;
#define X5( name, par1, par2, par3, par4, par5 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
} name##_STRCT;
#define X6( name, par1, par2, par3, par4, par5, par6 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
hcf_16 par6; \
} name##_STRCT;
#define X8( name, par1, par2, par3, par4, par5, par6, par7, par8 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
hcf_16 par6; \
hcf_16 par7; \
hcf_16 par8; \
} name##_STRCT;
#define X11( name, par1, par2, par3, par4, par5, par6, par7, par8, par9, par10, par11 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
hcf_16 par6; \
hcf_16 par7; \
hcf_16 par8; \
hcf_16 par9; \
hcf_16 par10; \
hcf_16 par11; \
} name##_STRCT;
/******************************* Substructure definitions **************************************************/
//apparently not needed (CFG_CNF_COUNTRY)
typedef struct CHANNEL_SET { //channel set structure used in the CFG_CNF_COUNTRY LTV
hcf_16 first_channel;
hcf_16 number_of_channels;
hcf_16 max_tx_output_level;
} CHANNEL_SET;
typedef struct KEY_STRCT { // key structure used in the CFG_DEFAULT_KEYS LTV
hcf_16 len; //length of key
hcf_8 key[14]; //encryption key
} KEY_STRCT;
typedef struct SCAN_RS_STRCT { // Scan Result structure used in the CFG_SCAN LTV
hcf_16 channel_id;
hcf_16 noise_level;
hcf_16 signal_level;
hcf_8 bssid[6];
hcf_16 beacon_interval_time;
hcf_16 capability;
hcf_16 ssid_len;
hcf_8 ssid_val[32];
} SCAN_RS_STRCT;
typedef struct CFG_RANGE_SPEC_STRCT { // range specification structure used in CFG_RANGES, CFG_RANGE1 etc
hcf_16 variant;
hcf_16 bottom;
hcf_16 top;
} CFG_RANGE_SPEC_STRCT;
typedef struct CFG_RANGE_SPEC_BYTE_STRCT { // byte oriented range specification structure used in CFG_RANGE_B LTV
hcf_8 variant[2];
hcf_8 bottom[2];
hcf_8 top[2];
} CFG_RANGE_SPEC_BYTE_STRCT;
//used to set up "T" functionality for Info frames, i.e. log info frames in MSF supplied buffer and MailBox
XX1( RID_LOG, unsigned short FAR*, bufp )
typedef RID_LOG_STRCT FAR *RID_LOGP;
XX1( CFG_RID_LOG, RID_LOGP, recordp )
X1( LTV, val[1] ) /*minimum LTV proto typ */
X1( LTV_MAX, val[HCF_MAX_LTV] ) /*maximum LTV proto typ */
XX2( CFG_REG_MB, hcf_16* , mb_addr, hcf_16, mb_size )
typedef struct CFG_MB_INFO_FRAG { // specification of buffer fragment
unsigned short FAR* frag_addr;
hcf_16 frag_len;
} CFG_MB_INFO_FRAG;
/* Mail Box Info Block structures,
* the base form: CFG_MB_INFO_STRCT
* and the derived forms: CFG_MB_INFO_RANGE<n>_STRCT with n is 1, 2, 3 or 20
* predefined for a payload of 1, and up to 2, 3 and 20 CFG_MB_INFO_FRAG elements */
XX3( CFG_MB_INFO, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 1] )
XX3( CFG_MB_INFO_RANGE1, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 1] )
XX3( CFG_MB_INFO_RANGE2, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 2] )
XX3( CFG_MB_INFO_RANGE3, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 3] )
XX3( CFG_MB_INFO_RANGE20, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[20] )
XX3( CFG_MB_ASSERT, hcf_16, line, hcf_16, trace, hcf_32, qualifier ) /*MBInfoBlock for asserts */
#if (HCF_ASSERT) & ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN )
typedef void (MSF_ASSERT_RTN)( unsigned int , hcf_16, hcf_32 );
typedef MSF_ASSERT_RTN /*can't link FAR*/ * MSF_ASSERT_RTNP;
/* CFG_REG_ASSERT_RTNP (0x0832) (de-)register MSF Callback routines
* lvl: Assert level filtering (not yet implemented)
* rtnp: address of MSF_ASSERT_RTN (native Endian format) */
XX2( CFG_REG_ASSERT_RTNP, hcf_16, lvl, MSF_ASSERT_RTNP, rtnp )
#endif // HCF_ASSERT_LNK_MSF_RTN / HCF_ASSERT_RT_MSF_RTN
X1( CFG_HCF_OPT, val[20] ) /*(Compile time) options */
X3( CFG_CMD_HCF, cmd, mode, add_info ) /*HCF Engineering command */
typedef struct {
hcf_16 len;
hcf_16 typ;
hcf_16 mode; // PROG_STOP/VOLATILE [FLASH/SEEPROM/SEEPROM_READBACK]
hcf_16 segment_size; // size of the segment in bytes
hcf_32 nic_addr; // destination address (in NIC memory)
hcf_16 flags; // 0x0001 : CRC Yes/No
// hcf_32 flags; // 0x0001 : CRC Yes/No
/* ;? still not the whole story
* flags is extended from 16 to 32 bits to force that compiling FW.C produces the same structures
* in memory as FUPU4 BIN files.
* Note that the problem arises from the violation of the constraint to use packing at byte boundaries
* as was stipulated in the WCI-specification
* The Pack pragma can't resolve this issue, because that impacts all members of the structure with
* disregard of their actual size, so aligning host_addr under MSVC 1.5 at 4 bytes, also aligns
* len, typ etc on 4 bytes
* */
// hcf_16 pad; //!! be careful alignment problems for Bin download versus C download
hcf_8 FAR *host_addr; // source address (in Host memory)
} CFG_PROG_STRCT; // segment_descp;
// a structure used for transporting debug-related information from firmware
// via the HCF, into the MSF
typedef struct {
hcf_16 len;
hcf_16 typ;
hcf_16 msg_id, msg_par, msg_tstamp;
} CFG_FW_PRINTF_STRCT;
// a structure used to define the location and size of a certain debug-related
// buffer in nic-ram.
typedef struct {
hcf_16 len;
hcf_16 typ;
hcf_32 DbMsgCount, // ds (nicram) address of a counter
DbMsgBuffer, // ds (nicram) address of the buffer
DbMsgSize, // number of entries (each 3 word in size) in this buffer
DbMsgIntrvl; // ds (nicram) address of interval for generating InfDrop event
} CFG_FW_PRINTF_BUFFER_LOCATION_STRCT;
XX3( CFG_RANGES, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 1] ) /*Actor/Supplier range (1 variant)*/
XX3( CFG_RANGE1, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 1] ) /*Actor/Supplier range (1 variant)*/
XX3( CFG_RANGE2, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 2] ) /*Actor range ( 2 variants) */
XX3( CFG_RANGE3, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 3] ) /*Actor range ( 3 variants) */
XX3( CFG_RANGE4, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 4] ) /*Actor range ( 4 variants) */
XX3( CFG_RANGE5, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 5] ) /*Actor range ( 5 variants) */
XX3( CFG_RANGE6, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 6] ) /*Actor range ( 6 variants) */
XX3( CFG_RANGE7, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 7] ) /*Actor range ( 7 variants) */
XX3( CFG_RANGE20, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[20] ) /*Actor range (20 variants) */
/*Frames */
X3( CFG_ASSOC_STAT, assoc_stat, station_addr[3], val[46] ) /*Association status, basic */
X2( CFG_ASSOC_STAT3, assoc_stat, station_addr[3] ) /*assoc_stat:3 */
X3( CFG_ASSOC_STAT1, assoc_stat, station_addr[3], frame_body[43] ) /*assoc_stat:1 */
X4( CFG_ASSOC_STAT2, assoc_stat, station_addr[3], old_ap_addr[3], frame_body[43] ) /*assoc_stat:2 */
/*Static Configurations */
X1( CFG_CNF_PORT_TYPE, port_type ) /*[STA] Connection control characteristics */
X1( CFG_MAC_ADDR, mac_addr[3] ) /*general: FC01,FC08,FC11,FC12,FC13,FC14,FC15,FC16 */
X1( CFG_CNF_OWN_MAC_ADDR, mac_addr[3] )
X1( CFG_ID, ssid[17] ) /*0xFC02, 0xFC04, 0xFC0E */
/* X1( CFG_DESIRED_SSID, ssid[17] ) see Dynamic Configurations */
X1( CFG_CNF_OWN_CHANNEL, channel ) /*Communication channel for BSS creation */
X1( CFG_CNF_OWN_SSID, ssid[17] )
X1( CFG_CNF_OWN_ATIM_WINDOW, atim_window )
X1( CFG_CNF_SYSTEM_SCALE, system_scale )
X1( CFG_CNF_MAX_DATA_LEN, max_data_len )
X1( CFG_CNF_WDS_ADDR, mac_addr[3] ) /*[STA] MAC Address of corresponding WDS Link node */
X1( CFG_CNF_PM_ENABLED, pm_enabled ) /*[STA] Switch for ESS Power Management (PM) On/Off */
X1( CFG_CNF_PM_EPS, pm_eps ) /*[STA] Switch for ESS PM EPS/PS Mode */
X1( CFG_CNF_MCAST_RX, mcast_rx ) /*[STA] Switch for ESS PM Multicast reception On/Off */
X1( CFG_CNF_MAX_SLEEP_DURATION, duration ) /*[STA] Maximum sleep time for ESS PM */
X1( CFG_CNF_PM_HOLDOVER_DURATION, duration ) /*[STA] Holdover time for ESS PM */
X1( CFG_CNF_OWN_NAME, ssid[17] ) /*Identification text for diagnostic purposes */
X1( CFG_CNF_OWN_DTIM_PERIOD, period ) /*[AP] Beacon intervals between successive DTIMs */
X1( CFG_CNF_WDS_ADDR1, mac_addr[3] ) /*[AP] Port 1 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR2, mac_addr[3] ) /*[AP] Port 2 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR3, mac_addr[3] ) /*[AP] Port 3 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR4, mac_addr[3] ) /*[AP] Port 4 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR5, mac_addr[3] ) /*[AP] Port 5 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR6, mac_addr[3] ) /*[AP] Port 6 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_MCAST_PM_BUF, mcast_pm_buf ) /*[AP] Switch for PM buffering of Multicast Messages */
X1( CFG_CNF_REJECT_ANY, reject_any ) /*[AP] Switch for PM buffering of Multicast Messages */
//X1( CFG_CNF_ENCRYPTION_ENABLED, encryption ) /*specify encryption type of Tx/Rx messages */
X1( CFG_CNF_ENCRYPTION, encryption ) /*specify encryption type of Tx/Rx messages */
X1( CFG_CNF_AUTHENTICATION, authentication ) /*selects Authentication algorithm */
X1( CFG_CNF_EXCL_UNENCRYPTED, exclude_unencrypted ) /*[AP] Switch for 'clear-text' rx message acceptance */
X1( CFG_CNF_MCAST_RATE, mcast_rate ) /*Transmit Data rate for Multicast frames */
X1( CFG_CNF_INTRA_BSS_RELAY, intra_bss_relay ) /*[AP] Switch for IntraBBS relay */
X1( CFG_CNF_MICRO_WAVE, micro_wave ) /*MicroWave (Robustness) */
X1( CFG_CNF_LOAD_BALANCING, load_balancing ) /*Load Balancing (Boolean, 0=OFF, 1=ON, default=1) */
X1( CFG_CNF_MEDIUM_DISTRIBUTION, medium_distribution ) /*Medium Distribution (Boolean, 0=OFF, 1=ON, default=1) */
X1( CFG_CNF_GROUP_ADDR_FILTER, group_addr_filter ) /*Group Address Filter */
X1( CFG_CNF_TX_POW_LVL, tx_pow_lvl ) /*Tx Power Level */
XX4( CFG_CNF_COUNTRY_INFO, \
hcf_16, n_channel_sets, hcf_16, country_code[2], \
hcf_16, environment, CHANNEL_SET, channel_set[1] ) /*Current Country Info */
XX4( CFG_CNF_COUNTRY_INFO_MAX, \
hcf_16, n_channel_sets, hcf_16, country_code[2], \
hcf_16, environment, CHANNEL_SET, channel_set[14]) /*Current Country Info */
/*Dynamic Configurations */
X1( CFG_DESIRED_SSID, ssid[17] ) /*[STA] Service Set identification for connection */
#define GROUP_ADDR_SIZE (32 * 6) //32 6-byte MAC-addresses
X1( CFG_GROUP_ADDR, mac_addr[GROUP_ADDR_SIZE/2] ) /*[STA] Multicast MAC Addresses for Rx-message */
X1( CFG_CREATE_IBSS, create_ibss ) /*[STA] Switch for IBSS creation On/Off */
X1( CFG_RTS_THRH, rts_thrh ) /*[STA] Frame length used for RTS/CTS handshake */
X1( CFG_TX_RATE_CNTL, tx_rate_cntl ) /*[STA] Data rate control for message transmission */
X1( CFG_PROMISCUOUS_MODE, promiscuous_mode ) /*[STA] Switch for Promiscuous mode reception On/Of */
X1( CFG_WOL, wake_on_lan ) /*[STA] Switch for Wake-On-LAN mode */
X1( CFG_RTS_THRH0, rts_thrh ) /*[AP] Port 0 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH1, rts_thrh ) /*[AP] Port 1 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH2, rts_thrh ) /*[AP] Port 2 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH3, rts_thrh ) /*[AP] Port 3 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH4, rts_thrh ) /*[AP] Port 4 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH5, rts_thrh ) /*[AP] Port 5 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH6, rts_thrh ) /*[AP] Port 6 frame length for RTS/CTS handshake */
X1( CFG_TX_RATE_CNTL0, rate_cntl ) /*[AP] Port 0 data rate control for transmission */
X1( CFG_TX_RATE_CNTL1, rate_cntl ) /*[AP] Port 1 data rate control for transmission */
X1( CFG_TX_RATE_CNTL2, rate_cntl ) /*[AP] Port 2 data rate control for transmission */
X1( CFG_TX_RATE_CNTL3, rate_cntl ) /*[AP] Port 3 data rate control for transmission */
X1( CFG_TX_RATE_CNTL4, rate_cntl ) /*[AP] Port 4 data rate control for transmission */
X1( CFG_TX_RATE_CNTL5, rate_cntl ) /*[AP] Port 5 data rate control for transmission */
X1( CFG_TX_RATE_CNTL6, rate_cntl ) /*[AP] Port 6 data rate control for transmission */
XX1( CFG_DEFAULT_KEYS, KEY_STRCT, key[4] ) /*defines set of encryption keys */
X1( CFG_TX_KEY_ID, tx_key_id ) /*select key for encryption of Tx messages */
X1( CFG_SCAN_SSID, ssid[17] ) /*identification for connection */
X5( CFG_ADD_TKIP_DEFAULT_KEY, \
tkip_key_id_info, tkip_key_iv_info[4], tkip_key[8], \
tx_mic_key[4], rx_mic_key[4] ) /* */
X6( CFG_ADD_TKIP_MAPPED_KEY, bssid[3], tkip_key[8], \
tsc[4], rsc[4], tx_mic_key[4], rx_mic_key[4] ) /* */
X1( CFG_SET_SSN_AUTHENTICATION_SUITE, \
ssn_authentication_suite ) /* */
X1( CFG_REMOVE_TKIP_DEFAULT_KEY,tkip_key_id ) /* */
X1( CFG_TICK_TIME, tick_time ) /*Auxiliary Timer tick interval */
X1( CFG_DDS_TICK_TIME, tick_time ) /*Disconnected DeepSleep Timer tick interval */
/**********************************************************************
* Added for Pattern-matching WakeOnLan. (See firmware design note WMDN281C)
**********************************************************************/
#define WOL_PATTERNS 5 // maximum of 5 patterns in firmware
#define WOL_PATTERN_LEN 124 // maximum 124 bytes pattern length per pattern in firmware
#define WOL_MASK_LEN 30 // maximum 30 bytes mask length per pattern in firmware
#define WOL_BUF_SIZE (WOL_PATTERNS * (WOL_PATTERN_LEN + WOL_MASK_LEN + 6) / 2)
X2( CFG_WOL_PATTERNS, nPatterns, buffer[WOL_BUF_SIZE] ) /*[STA] WakeOnLan pattern match, room for 5 patterns*/
X5( CFG_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Primary Supplier compatibility range */
/* NIC Information */
X4( CFG_IDENTITY, comp_id, variant, version_major, version_minor ) /*identification Prototype */
#define CFG_DRV_IDENTITY_STRCT CFG_IDENTITY_STRCT
#define CFG_PRI_IDENTITY_STRCT CFG_IDENTITY_STRCT
#define CFG_NIC_IDENTITY_STRCT CFG_IDENTITY_STRCT
#define CFG_FW_IDENTITY_STRCT CFG_IDENTITY_STRCT
X1( CFG_RID_INF_MIN, y ) /*lowest value representing an Information RID */
X1( CFG_MAX_LOAD_TIME, max_load_time ) /*[PRI] Max response time of the Download command */
X3( CFG_DL_BUF, buf_page, buf_offset, buf_len ) /*[PRI] Download buffer location and size */
// X5( CFG_PRI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Primary Supplier compatibility range */
X5( CFG_CFI_ACT_RANGES_PRI,role, id, variant, bottom, top ) /*[PRI] Controller Actor compatibility ranges */
// X5( CFG_NIC_HSI_SUP_RANGE, role, id, variant, bottom, top ) /*H/W - S/W I/F supplier range */
X1( CFG_NIC_SERIAL_NUMBER, serial_number[17] ) /*[PRI] Network I/F Card serial number */
X5( CFG_NIC_MFI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Modem I/F Supplier compatibility range */
X5( CFG_NIC_CFI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Controller I/F Supplier compatibility range*/
//H-I X1( CFG_CHANNEL_LIST, channel_list ) /*Allowed communication channels */
//H-I XX2( CFG_REG_DOMAINS, hcf_16, num_domain, hcf_8, reg_domains[10] ) /*List of intended regulatory domains */
X1( CFG_NIC_TEMP_TYPE, temp_type ) /*Hardware temperature range code */
//H-I X1( CFG_CIS, cis[240] ) /*PC Card Standard Card Information Structure */
X5( CFG_NIC_PROFILE, \
profile_code, capability_options, allowed_data_rates, val4, val5 ) /*Card Profile */
// X5( CFG_FW_SUP_RANGE, role, id, variant, bottom, top ) /*[STA] Station I/F Supplier compatibility range */
X5( CFG_MFI_ACT_RANGES, role, id, variant, bottom, top ) /*[STA] Modem I/F Actor compatibility ranges */
X5( CFG_CFI_ACT_RANGES_STA,role, id, variant, bottom, top ) /*[STA] Controller I/F Actor compatibility ranges */
X5( CFG_MFI_ACT_RANGES_STA,role, id, variant, bottom, top ) /*[STA] Controller I/F Actor compatibility ranges */
X1( CFG_NIC_BUS_TYPE, nic_bus_type ) /*NIC bustype derived from BUSSEL host I/F signals */
/* MAC INFORMATION */
X1( CFG_PORT_STAT, port_stat ) /*[STA] Actual MAC Port connection control status */
X1( CFG_CUR_SSID, ssid[17] ) /*[STA] Identification of the actually connected SS */
X1( CFG_CUR_BSSID, mac_addr[3] ) /*[STA] Identification of the actually connected BSS */
X3( CFG_COMMS_QUALITY, coms_qual, signal_lvl, noise_lvl ) /*[STA] Quality of the Basic Service Set connection */
X1( CFG_CUR_TX_RATE, rate ) /*[STA] Actual transmit data rate */
X1( CFG_CUR_BEACON_INTERVAL, interval ) /*Beacon transmit interval time for BSS creation */
#if (HCF_TYPE) & HCF_TYPE_WARP
X11( CFG_CUR_SCALE_THRH, \
carrier_detect_thrh_cck, carrier_detect_thrh_ofdm, defer_thrh, \
energy_detect_thrh, rssi_on_thrh_deviation, \
rssi_off_thrh_deviation, cck_drop_thrh, ofdm_drop_thrh, \
cell_search_thrh, out_of_range_thrh, delta_snr )
#else
X6( CFG_CUR_SCALE_THRH, \
energy_detect_thrh, carrier_detect_thrh, defer_thrh, \
cell_search_thrh, out_of_range_thrh, delta_snr ) /*Actual System Scale thresholds settings */
#endif // HCF_TYPE_WARP
X1( CFG_PROTOCOL_RSP_TIME, time ) /*Max time to await a response to a request message */
X1( CFG_CUR_SHORT_RETRY_LIMIT, limit ) /*Max number of transmit attempts for short frames */
X1( CFG_CUR_LONG_RETRY_LIMIT, limit ) /*Max number of transmit attempts for long frames */
X1( CFG_MAX_TX_LIFETIME, time ) /*Max transmit frame handling duration */
X1( CFG_MAX_RX_LIFETIME, time ) /*Max received frame handling duration */
X1( CFG_CF_POLLABLE, cf_pollable ) /*[STA] Contention Free pollable capability indication */
X2( CFG_AUTHENTICATION_ALGORITHMS,authentication_type, type_enabled ) /*Authentication Algorithm */
X1( CFG_PRIVACY_OPT_IMPLEMENTED,privacy_opt_implemented ) /*WEP Option availability indication */
X1( CFG_CUR_REMOTE_RATES, rates ) /*CurrentRemoteRates */
X1( CFG_CUR_USED_RATES, rates ) /*CurrentUsedRates */
X1( CFG_CUR_SYSTEM_SCALE, current_system_scale ) /*CurrentUsedRates */
X1( CFG_CUR_TX_RATE1, rate ) /*[AP] Actual Port 1 transmit data rate */
X1( CFG_CUR_TX_RATE2, rate ) /*[AP] Actual Port 2 transmit data rate */
X1( CFG_CUR_TX_RATE3, rate ) /*[AP] Actual Port 3 transmit data rate */
X1( CFG_CUR_TX_RATE4, rate ) /*[AP] Actual Port 4 transmit data rate */
X1( CFG_CUR_TX_RATE5, rate ) /*[AP] Actual Port 5 transmit data rate */
X1( CFG_CUR_TX_RATE6, rate ) /*[AP] Actual Port 6 transmit data rate */
X1( CFG_OWN_MAC_ADDR, mac_addr[3] ) /*[AP] Unique local node MAC Address */
X3( CFG_PCF_INFO, medium_occupancy_limit, \
cfp_period, cfp_max_duration ) /*[AP] Point Coordination Function capability info */
X1( CFG_CUR_SSN_INFO_ELEMENT, ssn_info_element[1] ) /* */
X4( CFG_CUR_TKIP_IV_INFO, \
tkip_seq_cnt0[4], tkip_seq_cnt1[4], \
tkip_seq_cnt2[4], tkip_seq_cnt3[4] ) /* */
X2( CFG_CUR_ASSOC_REQ_INFO, frame_type, frame_body[1] ) /* 0xFD8C */
X2( CFG_CUR_ASSOC_RESP_INFO, frame_type, frame_body[1] ) /* 0xFD8D */
/* Modem INFORMATION */
X1( CFG_PHY_TYPE, phy_type ) /*Physical layer type indication */
X1( CFG_CUR_CHANNEL, current_channel ) /*Actual frequency channel used for transmission */
X1( CFG_CUR_POWER_STATE, current_power_state ) /*Actual power consumption status */
X1( CFG_CCAMODE, cca_mode ) /*Clear channel assessment mode indication */
X1( CFG_SUPPORTED_DATA_RATES, rates[5] ) /*Data rates capability information */
/* FRAMES */
XX1( CFG_SCAN, SCAN_RS_STRCT, scan_result[32] ) /*Scan results */
//--------------------------------------------------------------------------------------
// UIL management function to be passed to WaveLAN/IEEE Drivers in DUI_STRCT field fun
//--------------------------------------------------------------------------------------
// HCF and UIL Common
#define MDD_ACT_SCAN 0x06 // Hermes Inquire Scan (F101) command
#define MDD_ACT_PRS_SCAN 0x07 // Hermes Probe Response Scan (F102) command
// UIL Specific
#define UIL_FUN_CONNECT 0x00 // Perform connect command
#define UIL_FUN_DISCONNECT 0x01 // Perform disconnect command
#define UIL_FUN_ACTION 0x02 // Perform UIL Action command.
#define UIL_FUN_SEND_DIAG_MSG 0x03 // Send a diagnostic message.
#define UIL_FUN_GET_INFO 0x04 // Retrieve information from NIC.
#define UIL_FUN_PUT_INFO 0x05 // Put information on NIC.
/* UIL_ACT_TALLIES 0x05 * this should not be exported to the USF
* it is solely intended as a strategic choice for the MSF to either
* - use HCF_ACT_TALLIES and direct IFB access
* - use CFG_TALLIES
*/
#define UIL_ACT_SCAN MDD_ACT_SCAN
#define UIL_ACT_PRS_SCAN MDD_ACT_PRS_SCAN
#define UIL_ACT_BLOCK 0x0B
#define UIL_ACT_UNBLOCK 0x0C
#define UIL_ACT_RESET 0x80
#define UIL_ACT_REBIND 0x81
#define UIL_ACT_APPLY 0x82
#define UIL_ACT_DISCONNECT 0x83 //;?040108 possibly obsolete //Special for WINCE
// HCF Specific
/* Note that UIL_ACT-codes must match HCF_ACT-codes across a run-time bound I/F
* The initial matching is achieved by "#define HCF_ACT_xxx HCF_UIL_ACT_xxx" where appropriate
* In other words, these codes should never, ever change to minimize migration problems between
* combinations of old drivers and new utilities and vice versa
*/
#define HCF_DISCONNECT 0x01 //disconnect request for hcf_connect (invalid as IO Address)
#define HCF_ACT_TALLIES 0x05 // ! UIL_ACT_TALLIES does not exist ! Hermes Inquire Tallies (F100) cmd
#if ( (HCF_TYPE) & HCF_TYPE_WARP ) == 0
#define HCF_ACT_SCAN MDD_ACT_SCAN
#endif // HCF_TYPE_WARP
#define HCF_ACT_PRS_SCAN MDD_ACT_PRS_SCAN
#if HCF_INT_ON
#define HCF_ACT_INT_OFF 0x0D // Disable Interrupt generation
#define HCF_ACT_INT_ON 0x0E // Enable Interrupt generation
#define HCF_ACT_INT_FORCE_ON 0x0F // Enforce Enable Interrupt generation
#endif // HCF_INT_ON
#define HCF_ACT_RX_ACK 0x15 // Receiever ACK (optimization)
#if (HCF_TYPE) & HCF_TYPE_CCX
#define HCF_ACT_CCX_ON 0x1A // enable CKIP
#define HCF_ACT_CCX_OFF 0x1B // disable CKIP
#endif // HCF_TYPE_CCX
#if (HCF_SLEEP) & HCF_DDS
#define HCF_ACT_SLEEP 0x1C // DDS Sleep request
//#define HCF_ACT_WAKEUP 0x1D // DDS Wakeup request
#endif // HCF_DDS
/* HCF_ACT_MAX // xxxx: start value for UIL-range, NOT to be passed to HCF
* Too bad, there was originally no spare room created to use
* HCF_ACT_MAX as an equivalent of HCF_ERR_MAX. Since creating
* this room in retrospect would create a backward incompatibility
* we will just have to live with the haphazard sequence of
* UIL- and HCF specific codes. Theoretically this could be
* corrected when and if there will ever be an overall
* incompatibility introduced for another reason
*/
/*============================================================= HERMES RECORDS ============================*/
#define CFG_RID_FW_MIN 0xFA00 //lowest value representing a Hermes-II based RID
// #define CFG_PDA_BEGIN 0xFA //
// #define CFG_PDA_END 0xFA //
// #define CFG_PDA_NIC_TOP_LVL_ASSEMBLY_NUMBER 0xFA //
// #define CFG_PDA_PCB_TRACER_NUMBER 0xFA //
// #define CFG_PDA_RMM_TRACER_NUMBER 0xFA //
// #define CFG_PDA_RMM_COMP_ID 0xFA //
// #define CFG_PDA_ 0xFA //
/*============================================================= CONFIGURATION RECORDS =====================*/
/*============================================================= mask 0xFCxx =====================*/
#define CFG_RID_CFG_MIN 0xFC00 //lowest value representing a Hermes configuration RID
// NETWORK PARAMETERS, STATIC CONFIGURATION ENTITIES
//FC05, FC0B, FC0C, FC0D: SEE W2DN149
#define CFG_CNF_PORT_TYPE 0xFC00 //[STA] Connection control characteristics
#define CFG_CNF_OWN_MAC_ADDR 0xFC01 //[STA] MAC Address of this node
// 0xFC02 see DYNAMIC CONFIGURATION ENTITIES
#define CFG_CNF_OWN_CHANNEL 0xFC03 //Communication channel for BSS creation
#define CFG_CNF_OWN_SSID 0xFC04 //IBSS creation (STA) or ESS (AP) Service Set Ident
#define CFG_CNF_OWN_ATIM_WINDOW 0xFC05 //[STA] ATIM Window time for IBSS creation
#define CFG_CNF_SYSTEM_SCALE 0xFC06 //System Scale that specifies the AP density
#define CFG_CNF_MAX_DATA_LEN 0xFC07 //Maximum length of MAC Frame Body data
#define CFG_CNF_PM_ENABLED 0xFC09 //[STA] Switch for ESS Power Management (PM)
#define CFG_CNF_MCAST_RX 0xFC0B //[STA] Switch for ESS PM Multicast reception On/Off
#define CFG_CNF_MAX_SLEEP_DURATION 0xFC0C //[STA] Maximum sleep time for ESS PM
#define CFG_CNF_HOLDOVER_DURATION 0xFC0D //[STA] Holdover time for ESS PM
#define CFG_CNF_OWN_NAME 0xFC0E //Identification text for diagnostic purposes
#define CFG_CNF_OWN_DTIM_PERIOD 0xFC10 //[AP] Beacon intervals between successive DTIMs
#define CFG_CNF_WDS_ADDR1 0xFC11 //[AP] Port 1 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR2 0xFC12 //[AP] Port 2 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR3 0xFC13 //[AP] Port 3 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR4 0xFC14 //[AP] Port 4 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR5 0xFC15 //[AP] Port 5 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR6 0xFC16 //[AP] Port 6 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_PM_MCAST_BUF 0xFC17 //[AP] Switch for PM buffereing of Multicast Messages
#define CFG_CNF_MCAST_PM_BUF CFG_CNF_PM_MCAST_BUF //name does not match H-II spec
#define CFG_CNF_REJECT_ANY 0xFC18 //[AP] Switch for PM buffereing of Multicast Messages
#define CFG_CNF_ENCRYPTION 0xFC20 //select en/de-cryption of Tx/Rx messages
#define CFG_CNF_AUTHENTICATION 0xFC21 //[STA] selects Authentication algorithm
#define CFG_CNF_EXCL_UNENCRYPTED 0xFC22 //[AP] Switch for 'clear-text' rx message acceptance
#define CFG_CNF_MCAST_RATE 0xFC23 //Transmit Data rate for Multicast frames
#define CFG_CNF_INTRA_BSS_RELAY 0xFC24 //[AP] Switch for IntraBBS relay
#define CFG_CNF_MICRO_WAVE 0xFC25 //MicroWave (Robustness)
#define CFG_CNF_LOAD_BALANCING 0xFC26 //Load Balancing (Boolean, 0=OFF, 1=ON, default=1)
#define CFG_CNF_MEDIUM_DISTRIBUTION 0xFC27 //Medium Distribution (Boolean, 0=OFF, 1=ON, default=1)
#define CFG_CNF_RX_ALL_GROUP_ADDR 0xFC28 //[STA] Group Address Filter
#define CFG_CNF_COUNTRY_INFO 0xFC29 //Country Info
#if (HCF_TYPE) & HCF_TYPE_WARP
#define CFG_CNF_TX_POW_LVL 0xFC2A //TxPower Level
#define CFG_CNF_CONNECTION_CNTL 0xFC30 //[STA] Connection Control
#define CFG_CNF_OWN_BEACON_INTERVAL 0xFC31 //[AP]
#define CFG_CNF_SHORT_RETRY_LIMIT 0xFC32 //
#define CFG_CNF_LONG_RETRY_LIMIT 0xFC33 //
#define CFG_CNF_TX_EVENT_MODE 0xFC34 //
#define CFG_CNF_WIFI_COMPATIBLE 0xFC35 //[STA] Wifi compatible
#endif // HCF_TYPE_WARP
#if (HCF_TYPE) & HCF_TYPE_BEAGLE_HII5
#define CFG_VOICE_RETRY_LIMIT 0xFC36 /* Voice frame retry limit. Range: 1-15, default: 4 */
#define CFG_VOICE_CONTENTION_WINDOW 0xFC37 /* Contention window for voice frames. */
#endif // BEAGLE_HII5
// NETWORK PARAMETERS, DYNAMIC CONFIGURATION ENTITIES
#define CFG_DESIRED_SSID 0xFC02 //[STA] Service Set identification for connection and scan
#define CFG_GROUP_ADDR 0xFC80 //[STA] Multicast MAC Addresses for Rx-message
#define CFG_CREATE_IBSS 0xFC81 //[STA] Switch for IBSS creation On/Off
#define CFG_RTS_THRH 0xFC83 //Frame length used for RTS/CTS handshake
#define CFG_TX_RATE_CNTL 0xFC84 //[STA] Data rate control for message transmission
#define CFG_PROMISCUOUS_MODE 0xFC85 //[STA] Switch for Promiscuous mode reception On/Off
#define CFG_WOL 0xFC86 //[STA] Switch for Wake-On-LAN mode
#define CFG_WOL_PATTERNS 0xFC87 //[STA] Patterns for Wake-On-LAN
#define CFG_SUPPORTED_RATE_SET_CNTL 0xFC88 //
#define CFG_BASIC_RATE_SET_CNTL 0xFC89 //
#define CFG_SOFTWARE_ACK_MODE 0xFC90 //
#define CFG_RTS_THRH0 0xFC97 //[AP] Port 0 frame length for RTS/CTS handshake
#define CFG_RTS_THRH1 0xFC98 //[AP] Port 1 frame length for RTS/CTS handshake
#define CFG_RTS_THRH2 0xFC99 //[AP] Port 2 frame length for RTS/CTS handshake
#define CFG_RTS_THRH3 0xFC9A //[AP] Port 3 frame length for RTS/CTS handshake
#define CFG_RTS_THRH4 0xFC9B //[AP] Port 4 frame length for RTS/CTS handshake
#define CFG_RTS_THRH5 0xFC9C //[AP] Port 5 frame length for RTS/CTS handshake
#define CFG_RTS_THRH6 0xFC9D //[AP] Port 6 frame length for RTS/CTS handshake
#define CFG_TX_RATE_CNTL0 0xFC9E //[AP] Port 0 data rate control for transmission
#define CFG_TX_RATE_CNTL1 0xFC9F //[AP] Port 1 data rate control for transmission
#define CFG_TX_RATE_CNTL2 0xFCA0 //[AP] Port 2 data rate control for transmission
#define CFG_TX_RATE_CNTL3 0xFCA1 //[AP] Port 3 data rate control for transmission
#define CFG_TX_RATE_CNTL4 0xFCA2 //[AP] Port 4 data rate control for transmission
#define CFG_TX_RATE_CNTL5 0xFCA3 //[AP] Port 5 data rate control for transmission
#define CFG_TX_RATE_CNTL6 0xFCA4 //[AP] Port 6 data rate control for transmission
#define CFG_DEFAULT_KEYS 0xFCB0 //defines set of encryption keys
#define CFG_TX_KEY_ID 0xFCB1 //select key for encryption of Tx messages
#define CFG_SCAN_SSID 0xFCB2 //Scan SSID
#define CFG_ADD_TKIP_DEFAULT_KEY 0xFCB4 //set KeyID and TxKey indication
#define KEY_ID 0x0003 //KeyID mask for tkip_key_id_info field
#define TX_KEY 0x8000 //Default Tx Key flag of tkip_key_id_info field
#define CFG_SET_WPA_AUTH_KEY_MGMT_SUITE 0xFCB5 //Authenticated Key Management Suite
#define CFG_REMOVE_TKIP_DEFAULT_KEY 0xFCB6 //invalidate KeyID and TxKey indication
#define CFG_ADD_TKIP_MAPPED_KEY 0xFCB7 //set MAC address pairwise station
#define CFG_REMOVE_TKIP_MAPPED_KEY 0xFCB8 //invalidate MAC address pairwise station
#define CFG_SET_WPA_CAPABILITIES_INFO 0xFCB9 //WPA Capabilities
#define CFG_CACHED_PMK_ADDR 0xFCBA //set MAC address of pre-authenticated AP
#define CFG_REMOVE_CACHED_PMK_ADDR 0xFCBB //invalidate MAC address of pre-authenticated AP
#define CFG_FCBC 0xFCBC //FW codes ahead of available documentation, so ???????
#define CFG_FCBD 0xFCBD //FW codes ahead of available documentation, so ???????
#define CFG_FCBE 0xFCBE //FW codes ahead of available documentation, so ???????
#define CFG_FCBF 0xFCBF //FW codes ahead of available documentation, so ???????
#define CFG_HANDOVER_ADDR 0xFCC0 //[AP] Station MAC Adrress re-associated with other AP
#define CFG_SCAN_CHANNEL 0xFCC2 //Channel set for host requested scan
//;?#define CFG_SCAN_CHANNEL_MASK 0xFCC2 // contains
#define CFG_DISASSOCIATE_ADDR 0xFCC4 //[AP] Station MAC Adrress to be disassociated
#define CFG_PROBE_DATA_RATE 0xFCC5 //WARP connection control
#define CFG_FRAME_BURST_LIMIT 0xFCC6 //
#define CFG_COEXISTENSE_BEHAVIOUR 0xFCC7 //[AP]
#define CFG_DEAUTHENTICATE_ADDR 0xFCC8 //MAC address of Station to be deauthenticated
// BEHAVIOR PARAMETERS
#define CFG_TICK_TIME 0xFCE0 //Auxiliary Timer tick interval
#define CFG_DDS_TICK_TIME 0xFCE1 //Disconnected DeepSleep Timer tick interval
//#define CFG_CNF_COUNTRY 0xFCFE apparently not needed ;?
#define CFG_RID_CFG_MAX 0xFCFF //highest value representing an Configuration RID
/*============================================================= INFORMATION RECORDS =====================*/
/*============================================================= mask 0xFDxx =====================*/
// NIC INFORMATION
#define CFG_RID_INF_MIN 0xFD00 //lowest value representing an Information RID
#define CFG_MAX_LOAD_TIME 0xFD00 //[INT] Maximum response time of the Download command.
#define CFG_DL_BUF 0xFD01 //[INT] Download buffer location and size.
#define CFG_PRI_IDENTITY 0xFD02 //[PRI] Primary Functions firmware identification.
#define CFG_PRI_SUP_RANGE 0xFD03 //[PRI] Primary Functions I/F Supplier compatibility range.
#define CFG_NIC_HSI_SUP_RANGE 0xFD09 //H/W - S/W I/F supplier range
#define CFG_NIC_SERIAL_NUMBER 0xFD0A //[PRI] Network Interface Card serial number.
#define CFG_NIC_IDENTITY 0xFD0B //[PRI] Network Interface Card identification.
#define CFG_NIC_MFI_SUP_RANGE 0xFD0C //[PRI] Modem I/F Supplier compatibility range.
#define CFG_NIC_CFI_SUP_RANGE 0xFD0D //[PRI] Controller I/F Supplier compatibility range.
#define CFG_CHANNEL_LIST 0xFD10 //Allowed communication channels.
#define CFG_NIC_TEMP_TYPE 0xFD12 //Hardware temperature range code.
#define CFG_CIS 0xFD13 //PC Card Standard Card Information Structure
#define CFG_NIC_PROFILE 0xFD14 //Card Profile
#define CFG_FW_IDENTITY 0xFD20 //firmware identification.
#define CFG_FW_SUP_RANGE 0xFD21 //firmware Supplier compatibility range.
#define CFG_MFI_ACT_RANGES_STA 0xFD22 //[STA] Modem I/F Actor compatibility ranges.
#define CFG_CFI_ACT_RANGES_STA 0xFD23 //[STA] Controller I/F Actor compatibility ranges.
#define CFG_NIC_BUS_TYPE 0xFD24 //Card Bustype
#define CFG_NIC_BUS_TYPE_PCCARD_CF 0x0000 //16 bit PC Card or Compact Flash
#define CFG_NIC_BUS_TYPE_USB 0x0001 //USB
#define CFG_NIC_BUS_TYPE_CARDBUS 0x0002 //CardBus
#define CFG_NIC_BUS_TYPE_PCI 0x0003 //(mini)PCI
#define CFG_DOMAIN_CODE 0xFD25
// MAC INFORMATION
#define CFG_PORT_STAT 0xFD40 //Actual MAC Port connection control status
#define CFG_CUR_SSID 0xFD41 //[STA] Identification of the actually connected SS
#define CFG_CUR_BSSID 0xFD42 //[STA] Identification of the actually connected BSS
#define CFG_COMMS_QUALITY 0xFD43 //[STA] Quality of the Basic Service Set connection
#define CFG_CUR_TX_RATE 0xFD44 //[STA] Actual transmit data rate
#define CFG_CUR_BEACON_INTERVAL 0xFD45 //Beacon transmit interval time for BSS creation
#define CFG_CUR_SCALE_THRH 0xFD46 //Actual System Scale thresholds settings
#define CFG_PROTOCOL_RSP_TIME 0xFD47 //Max time to await a response to a request message
#define CFG_CUR_SHORT_RETRY_LIMIT 0xFD48 //Max number of transmit attempts for short frames
#define CFG_CUR_LONG_RETRY_LIMIT 0xFD49 //Max number of transmit attempts for long frames
#define CFG_MAX_TX_LIFETIME 0xFD4A //Max transmit frame handling duration
#define CFG_MAX_RX_LIFETIME 0xFD4B //Max received frame handling duration
#define CFG_CF_POLLABLE 0xFD4C //[STA] Contention Free pollable capability indication
#define CFG_AUTHENTICATION_ALGORITHMS 0xFD4D //Available Authentication Algorithms indication
#define CFG_PRIVACY_OPT_IMPLEMENTED 0xFD4F //WEP Option availability indication
#define CFG_CUR_REMOTE_RATES 0xFD50 //[STA] CurrentRemoteRates
#define CFG_CUR_USED_RATES 0xFD51 //[STA] CurrentUsedRates
#define CFG_CUR_SYSTEM_SCALE 0xFD52 //[STA] CurrentSystemScale
#define CFG_CUR_TX_RATE1 0xFD80 //[AP] Actual Port 1 transmit data rate
#define CFG_CUR_TX_RATE2 0xFD81 //[AP] Actual Port 2 transmit data rate
#define CFG_CUR_TX_RATE3 0xFD82 //[AP] Actual Port 3 transmit data rate
#define CFG_CUR_TX_RATE4 0xFD83 //[AP] Actual Port 4 transmit data rate
#define CFG_CUR_TX_RATE5 0xFD84 //[AP] Actual Port 5 transmit data rate
#define CFG_CUR_TX_RATE6 0xFD85 //[AP] Actual Port 6 transmit data rate
#define CFG_NIC_MAC_ADDR 0xFD86 //Unique local node MAC Address
#define CFG_PCF_INFO 0xFD87 //[AP] Point Coordination Function capability info
//*RESERVED* #define CFG_HIGHEST_BASIC_RATE 0xFD88 //
#define CFG_CUR_COUNTRY_INFO 0xFD89 //
#define CFG_CUR_SSN_INFO_ELEMENT 0xFD8A //
#define CFG_CUR_TKIP_IV_INFO 0xFD8B //
#define CFG_CUR_ASSOC_REQ_INFO 0xFD8C //
#define CFG_CUR_ASSOC_RESP_INFO 0xFD8D //
#define CFG_CUR_LOAD 0xFD8E //[AP] current load on AP's channel
#define CFG_SECURITY_CAPABILITIES 0xFD90 //Combined capabilities information
// MODEM INFORMATION
#define CFG_PHY_TYPE 0xFDC0 //Physical layer type indication
#define CFG_CUR_CHANNEL 0xFDC1 //Actual frequency channel used for transmission
#define CFG_CUR_POWER_STATE 0xFDC2 //Actual power consumption status
#define CFG_CCA_MODE 0xFDC3 //Clear channel assessment mode indication
#define CFG_SUPPORTED_DATA_RATES 0xFDC6 //Data rates capability information
#define CFG_RID_INF_MAX 0xFDFF //highest value representing an Information RID
// ENGINEERING INFORMATION
#define CFG_RID_ENG_MIN 0xFFE0 //lowest value representing a Hermes engineering RID
/****************************** General define *************************************************************/
//IFB field related
// IFB_CardStat
#define CARD_STAT_INCOMP_PRI 0x2000U // no compatible HSI / primary F/W
#define CARD_STAT_INCOMP_FW 0x1000U // no compatible station / tertiary F/W
#define CARD_STAT_DEFUNCT 0x0100U // HCF is in Defunct mode
// IFB_RxStat
#define RX_STAT_PRIO 0x00E0U //Priority subfield
#define RX_STAT_ERR 0x000FU //Error mask
#define RX_STAT_UNDECR 0x0002U //Non-decryptable encrypted message
#define RX_STAT_FCS_ERR 0x0001U //FCS error
// SNAP header for E-II Encapsulation
#define ENC_NONE 0xFF
#define ENC_1042 0x00
#define ENC_TUNNEL 0xF8
/****************************** Xxxxxxxx *******************************************************************/
#define HCF_SUCCESS 0x00 // OK
#define HCF_ERR_TIME_OUT 0x04 // Expected Hermes event did not occure in expected time
#define HCF_ERR_NO_NIC 0x05 /* card not found (usually yanked away during hcfio_in_string
* Also: card is either absent or disabled while it should be neither */
#define HCF_ERR_LEN 0x08 /* buffer size insufficient
* - IFB_ConfigTable too small
* - hcf_get_info buffer has a size of 0 or 1 or less than needed
* to accomodate all data
* - hcf_put_info: CFG_DLNV_DATA exceeds intermediate
* buffer size */
#define HCF_ERR_INCOMP_PRI 0x09 // primary functions are not compatible
#define HCF_ERR_INCOMP_FW 0x0A // station functions are compatible
#define HCF_ERR_MIC 0x0D // MIC check fails
#define HCF_ERR_SLEEP 0x0E // NIC in sleep mode
#define HCF_ERR_MAX 0x3F /* end of HCF range
*** ** *** ****** *** *************** */
#define HCF_ERR_DEFUNCT 0x80 // BIT, reflecting that the HCF is in defunct mode (bits 0x7F reflect cause)
#define HCF_ERR_DEFUNCT_AUX 0x82 // Timeout on acknowledgement on en/disabling AUX registers
#define HCF_ERR_DEFUNCT_TIMER 0x83 // Timeout on timer calibration during initialization process
#define HCF_ERR_DEFUNCT_TIME_OUT 0x84 // Timeout on Busy bit drop during BAP setup
#define HCF_ERR_DEFUNCT_CMD_SEQ 0x86 // Hermes and HCF are out of sync in issuing/processing commands
#define HCF_INT_PENDING 0x01 // return status of hcf_act( HCF_ACT_INT_OFF )
#define HCF_PORT_0 0x0000 // Station supports only single MAC Port
#define HCF_PORT_1 0x0100 // HCF_PORT_1 through HCF_PORT_6 are only supported by AP F/W
#define HCF_PORT_2 0x0200
#define HCF_PORT_3 0x0300
#define HCF_PORT_4 0x0400
#define HCF_PORT_5 0x0500
#define HCF_PORT_6 0x0600
#define HCF_CNTL_ENABLE 0x01
#define HCF_CNTL_DISABLE 0x02
#define HCF_CNTL_CONNECT 0x03
#define HCF_CNTL_DISCONNECT 0x05
#define HCF_CNTL_CONTINUE 0x07
#define USE_DMA 0x0001
#define USE_16BIT 0x0002
#define DMA_ENABLED 0x8000 //weak name, it really means: F/W enabled and DMA selected
//#define HCF_DMA_FD_CNT (2*29) //size in bytes of one Tx/RxFS minus DA/SA
//;?the MSF ( H2PCI.C uses the next 2 mnemonics )
#define HCF_DMA_RX_BUF1_SIZE (HFS_ADDR_DEST + 8) //extra bytes for LEN/SNAP if decapsulation
#define HCF_DMA_TX_BUF1_SIZE (HFS_ADDR_DEST + 2*6 + 8) //extra bytes for DA/SA/LEN/SNAP if encapsulation
//HFS_TX_CNTL
/* Note that the HCF_.... System Constants influence the HFS_.... values below
* H-I H-I | H-II H-II H-II.5
* WPA | WPA
* HFS_TX_CNTL_TX_OK 0002 0002 | 0002 0002 N/A <<<<<<<<deprecated
* HFS_TX_CNTL_TX_EX 0004 0004 | 0004 0004 N/A
* HFS_TX_CNTL_MIC N/A 0010 | N/A 0010 N/A
* HFS_TX_CNTL_TID N/A N/A | N/A N/A 000F
* HFS_TX_CNTL_SERVICE_CLASS N/A N/A | N/A N/A 00C0
* HFS_TX_CNTL_PORT 0700 0700 | 0700 0700 0700
* HFS_TX_CNTL_MIC_KEY_ID 1800 1800 | 0000 1800 N/A
* HFS_TX_CNTL_CKIP 0000 0000 | 0000 2000 2000
* HFS_TX_CNTL_TX_DELAY 4000 4000 | 4000 4000 N/A
* HFS_TX_CNTL_ACTION N/A N/A | N/A N/A 4000
* ==== ==== | ==== ==== ====
* 5F06 5F16 | 4706 7F06 67CF
*
* HCF_TX_CNTL_MASK specifies the bits allowed on the Host I/F
* note: bit 0x4000 has different meaning for H-II and H-II.5
* note: [] indicate bits which are possibly added by the HCF to TxControl at the Host I/F
* note: () indicate bits which are supposedly never ever used in a WCI environment
* note: ? denote bits which seem not to be documented in the documents I have available
*/
//H-I: HCF_TX_CNTL_MASK 0x47FE //TX_DELAY, MACPort, Priority, (StrucType), TxEx, TxOK
//H-I WPA: HCF_TX_CNTL_MASK 0x5FE6 //TX_DELAY, MICKey, MACPort, Priority, (StrucType), TxEx, TxOK
#if (HCF_TYPE) & HCF_TYPE_WARP
#define HCF_TX_CNTL_MASK 0x27E7 //no TX_DELAY?, CCX, MACPort, Priority, (StrucType), TxEx, TxOK, Spectralink
//#elif (HCF_TYPE) & HCF_TYPE_WPA
//#define HCF_TX_CNTL_MASK 0x7F06 //TX_DELAY, CKIP?, MICKeyID, MACPort, [MIC],TxEx, TxOK (TAR419D7)
#else
#define HCF_TX_CNTL_MASK 0x67E7 //TX_DELAY?, CCX, MACPort, Priority, (StrucType), TxEx, TxOK, Spectralink
#endif // HCF_TYPE_WARP
#define HFS_TX_CNTL_TX_EX 0x0004U
#if (HCF_TYPE) & HCF_TYPE_WPA
#define HFS_TX_CNTL_MIC 0x0010U //802.3 format with TKIP ;?changes to 0x0008 for H-II
#define HFS_TX_CNTL_MIC_KEY_ID 0x1800U //MIC Key ID subfield
#endif // HCF_TYPE_WPA
#define HFS_TX_CNTL_PORT 0x0700U //Port subfield of TxControl field of Transmit Frame Structure
#if (HCF_TYPE) & HCF_TYPE_CCX
#define HFS_TX_CNTL_CKIP 0x2000U //CKIP encrypted flag
#endif // HCF_TYPE_CCX
#if (HCF_TYPE) & HCF_TYPE_TX_DELAY
#define HFS_TX_CNTL_TX_DELAY 0x4000U //decouple "put data" and send
#endif // HCF_TYPE_TX_DELAY
#define HFS_TX_CNTL_TX_CONT 0x4000u //engineering: continuous transmit
/*============================================================= HCF Defined RECORDS =========================*/
#define CFG_PROD_DATA 0x0800 //Plug Data (Engineering Test purposes only)
#define CFG_DL_EEPROM 0x0806 //Up/Download I2PROM for USB
#define CFG_PDA 0x0002 //Download PDA
#define CFG_MEM_I2PROM 0x0004 //Up/Download EEPROM
#define CFG_MEM_READ 0x0000
#define CFG_MEM_WRITE 0x0001
#define CFG_NULL 0x0820 //Empty Mail Box Info Block
#define CFG_MB_INFO 0x0820 //Mail Box Info Block
#define CFG_WMP 0x0822 //WaveLAN Management Protocol
#if defined MSF_COMPONENT_ID
#define CFG_DRV_INFO 0x0825 //Driver Information structure (see CFG_DRV_INFO_STRCT for details)
#define CFG_DRV_IDENTITY 0x0826 //driver identity (see CFG_DRV_IDENTITY_STRCT for details)
#define CFG_DRV_SUP_RANGE 0x0827 //Supplier range of driver - utility I/F
#define CFG_DRV_ACT_RANGES_PRI 0x0828 //(Acceptable) Actor range for Primary Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA 0x0829 //(Acceptable) Actor range for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_HSI 0x082A //(Acceptable) Actor range for H/W - driver I/F
#define CFG_DRV_ACT_RANGES_APF 0x082B //(Acceptable) Actor range for AP Firmware - driver I/F
#define CFG_HCF_OPT 0x082C //HCF (Compile time) options
#endif // MSF_COMPONENT_ID
#define CFG_REG_MB 0x0830 //Register Mail Box
#define CFG_MB_ASSERT 0x0831 //Assert information
#define CFG_REG_ASSERT_RTNP 0x0832 //(de-)register MSF Assert Callback routine
#if (HCF_EXT) & HCF_EXT_INFO_LOG
#define CFG_REG_INFO_LOG 0x0839 //(de-)register Info frames to Log
#endif // HCF_INFO_LOG
#define CFG_CNTL_OPT 0x083A //Control options
#define CFG_PROG 0x0857 //Program NIC memory
#define CFG_PROG_STOP 0x0000
#define CFG_PROG_VOLATILE 0x0100
//#define CFG_PROG_FLASH 0x0300 //restore if H-II non-volatile is introduced
//#define CFG_PROG_SEEPROM 0x1300 //restore if H-II non-volatile is introduced
#define CFG_PROG_SEEPROM_READBACK 0x0400
#define CFG_FW_PRINTF 0x0858 //Related to firmware debug printf functionality
#define CFG_FW_PRINTF_BUFFER_LOCATION 0x0859 //Also related to firmware debug printf functionality
#define CFG_CMD_NIC 0x0860 //Hermes Engineering command
#define CFG_CMD_HCF 0x0863 //HCF Engineering command
#define CFG_CMD_HCF_REG_ACCESS 0x0000 //Direct register access
#define CFG_CMD_HCF_RX_MON 0x0001 //Rx-monitor
/*============================================================= MSF Defined RECORDS ========================*/
#define CFG_ENCRYPT_STRING 0x0900 //transfer encryption info from CPL to MSF
#define CFG_AP_MODE 0x0901 //control mode of STAP driver from CPL
#define CFG_DRIVER_ENABLE 0x0902 //extend&export En-/Disable facility to Utility
#define CFG_PCI_COMMAND 0x0903 //PCI adapter (Ooievaar) structure
#define CFG_WOLAS_ENABLE 0x0904 //extend&export En-/Disable WOLAS facility to Utility
#define CFG_COUNTRY_STRING 0x0905 //transfer CountryInfo info from CPL to MSF
#define CFG_FW_DUMP 0x0906 //transfer nic memory to utility
#define CFG_POWER_MODE 0x0907 //controls the PM mode of the card
#define CFG_CONNECTION_MODE 0x0908 //controls the mode of the FW (ESS/AP/IBSS/ADHOC)
#define CFG_IFB 0x0909 //byte wise copy of IFB
#define CFG_MSF_TALLIES 0x090A //MSF tallies (int's, rx and tx)
#define CFG_CURRENT_LINK_STATUS 0x090B //Latest link status got trough 0xF200 LinkEvent
/*============================================================ INFORMATION FRAMES =========================*/
#define CFG_INFO_FRAME_MIN 0xF000 //lowest value representing an Informatio Frame
#define CFG_TALLIES 0xF100 //Communications Tallies
#define CFG_SCAN 0xF101 //Scan results
#define CFG_PRS_SCAN 0xF102 //Probe Response Scan results
#define CFG_LINK_STAT 0xF200 //Link Status
/* 1 through 5 are F/W defined values, produced by CFG_LINK_STAT frame
* 1 through 5 are shared by CFG_LINK_STAT, IFB_LinkStat and IFB_DSLinkStat
* 1 plays a double role as CFG_LINK_STAT_CONNECTED and as bit reflecting:
* - connected: ON
* - disconnected: OFF
*/
#define CFG_LINK_STAT_CONNECTED 0x0001
#define CFG_LINK_STAT_DISCONNECTED 0x0002
#define CFG_LINK_STAT_AP_CHANGE 0x0003
#define CFG_LINK_STAT_AP_OOR 0x0004
#define CFG_LINK_STAT_AP_IR 0x0005
#define CFG_LINK_STAT_FW 0x000F //mask to isolate F/W defined bits
//#define CFG_LINK_STAT_TIMER 0x0FF0 //mask to isolate OOR timer
//#define CFG_LINK_STAT_DS_OOR 0x2000 //2000 and up are IFB_LinkStat specific
//#define CFG_LINK_STAT_DS_IR 0x4000
#define CFG_LINK_STAT_CHANGE 0x8000
#define CFG_ASSOC_STAT 0xF201 //Association Status
#define CFG_SECURITY_STAT 0xF202 //Security Status
#define CFG_UPDATED_INFO_RECORD 0xF204 //Updated Info Record
/*============================================================ CONFIGURATION RECORDS ======================*/
/***********************************************************************************************************/
/****************************** S T R U C T U R E D E F I N I T I O N S **********************************/
//Quick&Dirty to get download for DOS ODI Hermes-II running typedef LTV_STRCT FAR * LTVP;
typedef LTV_STRCT FAR * LTVP; // i.s.o #define LTVP LTV_STRCT FAR *
#if defined WVLAN_42 || defined WVLAN_43 //;?keepup with legacy a little while longer (4aug2003)
typedef struct DUI_STRCT { /* "legacy", still used by WVLAN42/43, NDIS drivers use WLAPI */
void FAR *ifbp; /* Pointer to IFB
* returned from MSF to USF by uil_connect
* passed from USF to MSF as a "magic cookie" by all other UIL function calls
*/
hcf_16 stat; // status returned from MSF to USF
hcf_16 fun; // command code from USF to MSF
LTV_STRCT ltv; /* LTV structure
*** during uil_put_info:
* the L, T and V-fields carry information from USF to MSF
*** during uil_get_info:
* the L and T fields carry information from USF to MSF
* the L and V-fields carry information from MSF to USF
*/
} DUI_STRCT;
typedef DUI_STRCT FAR * DUIP;
#endif //defined WVLAN_42 || defined WVLAN_43 //;?keepup with legacy a liitle while longer (4aug2003)
typedef struct CFG_CMD_NIC_STRCT { // CFG_CMD_NIC (0x0860) Hermes Engineering command
hcf_16 len; //default length of RID
hcf_16 typ; //RID identification as defined by Hermes
hcf_16 cmd; //Command code (0x003F) and control bits (0xFFC0)
hcf_16 parm0; //parameters for Hermes Param0 register
hcf_16 parm1; //parameters for Hermes Param1 register
hcf_16 parm2; //parameters for Hermes Param2 register
hcf_16 stat; //result code from Hermes Status register
hcf_16 resp0; //responses from Hermes Resp0 register
hcf_16 resp1; //responses from Hermes Resp1 register
hcf_16 resp2; //responses from Hermes Resp2 register
hcf_16 hcf_stat; //result code from cmd_exe routine
hcf_16 ifb_err_cmd; //IFB_ErrCmd
hcf_16 ifb_err_qualifier; //IFB_ErrQualifier
} CFG_CMD_NIC_STRCT;
typedef struct CFG_DRV_INFO_STRCT { //CFG_DRV_INFO (0x0825) driver information
hcf_16 len; //default length of RID
hcf_16 typ; //RID identification as defined by Hermes
hcf_8 driver_name[8]; //Driver name, 8 bytes, right zero padded
hcf_16 driver_version; //BCD 2 digit major and 2 digit minor driver version
hcf_16 HCF_version; //BCD 2 digit major and 2 digit minor HCF version
hcf_16 driver_stat; //
hcf_16 IO_address; //base IO address used by NIC
hcf_16 IO_range; //range of IO addresses used by NIC
hcf_16 IRQ_number; //Interrupt used by NIC
hcf_16 card_stat; /*NIC status
@* 0x8000 Card present
@* 0x4000 Card Enabled
@* 0x2000 Driver incompatible with NIC Primary Functions
@* 0x1000 Driver incompatible with NIC Station Functions */
hcf_16 frame_type; /*Frame type
@* 0x000 802.3
@* 0x008 802.11 */
hcf_32 drv_info; /*driver specific info
* CE: virtual I/O base */
}CFG_DRV_INFO_STRCT;
#define COMP_ID_FW_PRI 21 //Primary Functions Firmware
#define COMP_ID_FW_INTERMEDIATE 22 //Intermediate Functions Firmware
#define COMP_ID_FW_STA 31 //Station Functions Firmware
#define COMP_ID_FW_AP 32 //AP Functions Firmware
#define COMP_ID_FW_AP_FAKE 331 //AP Functions Firmware
#define COMP_ID_MINIPORT_NDIS_31 41 //Windows 9x/NT Miniport NDIS 3.1
#define COMP_ID_PACKET 42 //Packet
#define COMP_ID_ODI_16 43 //DOS ODI
#define COMP_ID_ODI_32 44 //32-bits ODI
#define COMP_ID_MAC_OS 45 //Macintosh OS
#define COMP_ID_WIN_CE 46 //Windows CE Miniport
//#define COMP_ID_LINUX_PD 47 //Linux, HCF-light based, MSF source code in Public Domain
#define COMP_ID_MINIPORT_NDIS_50 48 //Windows 9x/NT Miniport NDIS 5.0
#define COMP_ID_LINUX 49 /*Linux, GPL'ed HCF based, full source code in Public Domain
*thanks to Andreas Neuhaus */
#define COMP_ID_QNX 50 //QNX
#define COMP_ID_MINIPORT_NDIS_50_USB 51 //Windows 9x/NT Miniport NDIS 4.0
#define COMP_ID_MINIPORT_NDIS_40 52 //Windows 9x/NT Miniport NDIS 4.0
#define COMP_ID_VX_WORKS_ENDSTA 53 // VxWorks END Station driver
#define COMP_ID_VX_WORKS_ENDAP 54 // VxWorks END Access Point driver
//;?#define COMP_ID_MAC_OS_???? 55 //;?check with HM
#define COMP_ID_VX_WORKS_END 56 // VxWorks END Station/Access Point driver
// 57 //NucleusOS@ARM Driver.
#define COMP_ID_WSU 63 /* WaveLAN Station Firmware Update utility
* variant 1: Windows
* variant 2: DOS
*/
#define COMP_ID_AP1 81 //WaveLAN/IEEE AP
#define COMP_ID_EC 83 //WaveLAN/IEEE Ethernet Converter
#define COMP_ID_UBL 87 //USB Boot Loader
#define COMP_ROLE_SUPL 0x00 //supplier
#define COMP_ROLE_ACT 0x01 //actor
//Supplier - actor
#define COMP_ID_MFI 0x01 //Modem - Firmware I/F
#define COMP_ID_CFI 0x02 //Controller - Firmware I/F
#define COMP_ID_PRI 0x03 //Primary Firmware - Driver I/F
#define COMP_ID_STA 0x04 //Station Firmware - Driver I/F
#define COMP_ID_DUI 0x05 //Driver - Utility I/F
#define COMP_ID_HSI 0x06 //H/W - Driver I/F
#define COMP_ID_DAI 0x07 //API - Driver I/F
#define COMP_ID_APF 0x08 //H/W - Driver I/F
#define COMP_ID_INT 0x09 //Intermediate FW - Driver I/F
#ifdef HCF_LEGACY
#define HCF_ACT_ACS_SCAN HCF_ACT_PRS_SCAN
#define UIL_ACT_ACS_SCAN UIL_ACT_PRS_SCAN
#define MDD_ACT_ACS_SCAN MDD_ACT_PRS_SCAN
#define CFG_ACS_SCAN CFG_PRS_SCAN
#endif // HCF_LEGACY
#endif // MDD_H
// vim:tw=110:ts=4:
/************************************************************************************************************
*
* 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 endianess 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
* endianess.
*
*.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 Endianess 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 endianess 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 Endianess 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-endianess 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
// vim:tw=110:ts=4:
#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
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*******************************************************************************
* 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 © 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/06 11:25:37 $
* $Revision: 1.5 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_cs.c,v $
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <wl_version.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <linux/slab.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 <asm/io.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <pcmcia/cs_types.h>
#include <pcmcia/cs.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>
#include <wl_sysfs.h>
/*******************************************************************************
* macro definitions
******************************************************************************/
#define CS_CHECK(fn, ret) do { \
last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
} while (0)
/*******************************************************************************
* global definitions
******************************************************************************/
#if DBG
extern dbg_info_t *DbgInfo;
#endif /* DBG */
/*******************************************************************************
* 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;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_attach" );
DBG_ENTER( DbgInfo );
dev = wl_device_alloc();
if(dev == NULL) {
DBG_ERROR( DbgInfo, "wl_device_alloc returned NULL\n");
return -ENOMEM;
}
link->io.NumPorts1 = HCF_NUM_IO_PORTS;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->io.IOAddrLines = 6;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
link->irq.Handler = &wl_isr;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 5;
link->conf.Present = PRESENT_OPTION;
link->priv = link->irq.Instance = dev;
lp = wl_priv(dev);
lp->link = link;
wl_adapter_insert(link);
DBG_LEAVE( DbgInfo );
return 0;
} // wl_adapter_attach
/*============================================================================*/
/*******************************************************************************
* wl_adapter_detach()
*******************************************************************************
*
* DESCRIPTION:
*
* This deletes a driver "instance". The device is de-registered with Card
* Services. If it has been released, then the net device is unregistered, and
* all local data structures are freed. Otherwise, the structures will be
* freed when the device is released.
*
* PARAMETERS:
*
* link - pointer to the dev_link_t structure representing the device to
* detach
*
* RETURNS:
*
* N/A
*
******************************************************************************/
static void wl_adapter_detach(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_detach" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "link", "0x%p", link );
wl_adapter_release(link);
if (dev) {
unregister_wlags_sysfs(dev);
unregister_netdev(dev);
}
wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo );
} // wl_adapter_detach
/*============================================================================*/
/*******************************************************************************
* wl_adapter_release()
*******************************************************************************
*
* DESCRIPTION:
*
* After a card is removed, this routine will release the PCMCIA
* configuration. If the device is still open, this will be postponed until it
* is closed.
*
* PARAMETERS:
*
* arg - a u_long representing a pointer to a dev_link_t structure for the
* device to be released.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_adapter_release( struct pcmcia_device *link )
{
DBG_FUNC( "wl_adapter_release" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "link", "0x%p", link);
/* Stop hardware */
wl_remove(link->priv);
pcmcia_disable_device(link);
DBG_LEAVE( DbgInfo );
} // 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
/*******************************************************************************
* wl_adapter_insert()
*******************************************************************************
*
* DESCRIPTION:
*
* wl_adapter_insert() is scheduled to run after a CARD_INSERTION event is
* received, to configure the PCMCIA socket, and to make the ethernet device
* available to the system.
*
* PARAMETERS:
*
* link - pointer to the dev_link_t structure representing the device to
* insert
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_adapter_insert( struct pcmcia_device *link )
{
struct net_device *dev;
int i;
int last_fn, last_ret;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_insert" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "link", "0x%p", link );
dev = link->priv;
/* Do we need to allocate an interrupt? */
link->conf.Attributes |= CONF_ENABLE_IRQ;
CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
dev->irq = link->irq.AssignedIRQ;
dev->base_addr = link->io.BasePort1;
SET_NETDEV_DEV(dev, &handle_to_dev(link));
if (register_netdev(dev) != 0) {
printk("%s: register_netdev() failed\n", MODULE_NAME);
goto failed;
}
link->dev_node = &( wl_priv(dev) )->node;
strcpy(( wl_priv(dev) )->node.dev_name, dev->name);
register_wlags_sysfs(dev);
printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
dev->name, dev->base_addr, dev->irq);
for( i = 0; i < ETH_ALEN; i++ ) {
printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n'));
}
DBG_LEAVE( DbgInfo );
return;
cs_failed:
cs_error( link, last_fn, last_ret );
failed:
wl_adapter_release( link );
DBG_LEAVE(DbgInfo);
return;
} // 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_FUNC( "wl_adapter_open" );
DBG_ENTER( DbgInfo );
DBG_PRINT( "%s\n", VERSION_INFO );
DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
if(!pcmcia_dev_present(link))
{
DBG_LEAVE( DbgInfo );
return -ENODEV;
}
link->open++;
hcf_status = wl_open( dev );
if( hcf_status != HCF_SUCCESS ) {
link->open--;
result = -ENODEV;
}
DBG_LEAVE( DbgInfo );
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_FUNC( "wl_adapter_close" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
if( link == NULL ) {
DBG_LEAVE( DbgInfo );
return -ENODEV;
}
DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name );
wl_close( dev );
link->open--;
DBG_LEAVE( DbgInfo );
return 0;
} // wl_adapter_close
/*============================================================================*/
static 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,
.drv = {
.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 )
{
int ret;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_init_module" );
DBG_ENTER( DbgInfo );
DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCMCIA\n" );
ret = pcmcia_register_driver(&wlags49_driver);
DBG_LEAVE( DbgInfo );
return ret;
} // 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 )
{
DBG_FUNC( "wl_adapter_cleanup_module" );
DBG_ENTER( DbgInfo );
DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCMCIA\n" );
pcmcia_unregister_driver(&wlags49_driver);
DBG_LEAVE( DbgInfo );
return;
} // 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
/*============================================================================*/
#if DBG
/*******************************************************************************
* DbgEvent()
*******************************************************************************
*
* DESCRIPTION:
*
* Converts the card serivces events to text for debugging.
*
* PARAMETERS:
*
* mask - a integer representing the error(s) being reported by Card
* Services.
*
* RETURNS:
*
* a pointer to a string describing the error(s)
*
******************************************************************************/
const char* DbgEvent( int mask )
{
static char DbgBuffer[256];
char *pBuf;
/*------------------------------------------------------------------------*/
pBuf = DbgBuffer;
*pBuf = '\0';
if( mask & CS_EVENT_WRITE_PROTECT )
strcat( pBuf, "WRITE_PROTECT " );
if(mask & CS_EVENT_CARD_LOCK)
strcat( pBuf, "CARD_LOCK " );
if(mask & CS_EVENT_CARD_INSERTION)
strcat( pBuf, "CARD_INSERTION " );
if(mask & CS_EVENT_CARD_REMOVAL)
strcat( pBuf, "CARD_REMOVAL " );
if(mask & CS_EVENT_BATTERY_DEAD)
strcat( pBuf, "BATTERY_DEAD " );
if(mask & CS_EVENT_BATTERY_LOW)
strcat( pBuf, "BATTERY_LOW " );
if(mask & CS_EVENT_READY_CHANGE)
strcat( pBuf, "READY_CHANGE " );
if(mask & CS_EVENT_CARD_DETECT)
strcat( pBuf, "CARD_DETECT " );
if(mask & CS_EVENT_RESET_REQUEST)
strcat( pBuf, "RESET_REQUEST " );
if(mask & CS_EVENT_RESET_PHYSICAL)
strcat( pBuf, "RESET_PHYSICAL " );
if(mask & CS_EVENT_CARD_RESET)
strcat( pBuf, "CARD_RESET " );
if(mask & CS_EVENT_REGISTRATION_COMPLETE)
strcat( pBuf, "REGISTRATION_COMPLETE " );
// if(mask & CS_EVENT_RESET_COMPLETE)
// strcat( pBuf, "RESET_COMPLETE " );
if(mask & CS_EVENT_PM_SUSPEND)
strcat( pBuf, "PM_SUSPEND " );
if(mask & CS_EVENT_PM_RESUME)
strcat( pBuf, "PM_RESUME " );
if(mask & CS_EVENT_INSERTION_REQUEST)
strcat( pBuf, "INSERTION_REQUEST " );
if(mask & CS_EVENT_EJECTION_REQUEST)
strcat( pBuf, "EJECTION_REQUEST " );
if(mask & CS_EVENT_MTD_REQUEST)
strcat( pBuf, "MTD_REQUEST " );
if(mask & CS_EVENT_ERASE_COMPLETE)
strcat( pBuf, "ERASE_COMPLETE " );
if(mask & CS_EVENT_REQUEST_ATTENTION)
strcat( pBuf, "REQUEST_ATTENTION " );
if(mask & CS_EVENT_CB_DETECT)
strcat( pBuf, "CB_DETECT " );
if(mask & CS_EVENT_3VCARD)
strcat( pBuf, "3VCARD " );
if(mask & CS_EVENT_XVCARD)
strcat( pBuf, "XVCARD " );
if( *pBuf ) {
pBuf[strlen(pBuf) - 1] = '\0';
} else {
if( mask != 0x0 ) {
sprintf( pBuf, "<<0x%08x>>", mask );
}
}
return pBuf;
} // DbgEvent
/*============================================================================*/
#endif /* DBG */
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_cs.h,v $
*
******************************************************************************/
#ifndef __WL_CS_H__
#define __WL_CS_H__
/*******************************************************************************
* function protoypes
******************************************************************************/
void wl_adapter_insert(struct pcmcia_device *link);
void wl_adapter_release(struct pcmcia_device *link);
int wl_adapter_event(event_t event, int priority, event_callback_args_t *args );
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);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
void cs_error(client_handle_t handle, int func, int ret);
#endif
const char *DbgEvent( int mask );
#endif // __WL_CS_H__
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* This file 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_enc.c,v $
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <wl_version.h>
#include <debug.h>
#include <hcf.h>
#include <wl_enc.h>
/*******************************************************************************
* global definitions
******************************************************************************/
#if DBG
extern dbg_info_t *DbgInfo;
#endif /* DBG */
/*******************************************************************************
* 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 ) ;
}
/*============================================================================*/
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_enc.h,v $
*
******************************************************************************/
#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 prrottypes
******************************************************************************/
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__
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_if.h,v $
*
******************************************************************************/
#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)
#define HCF_MIN_COMM_QUALITY 0
#define HCF_MAX_COMM_QUALITY 92
#define HCF_MIN_SIGNAL_LEVEL 47
#define HCF_MAX_SIGNAL_LEVEL 138
#define HCF_MIN_NOISE_LEVEL 47
#define HCF_MAX_NOISE_LEVEL 138
#define HCF_0DBM_OFFSET 149
/* 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__
/*******************************************************************************
* 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 defintions and macros internal to the drvier.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/03 11:39:39 $
* $Revision: 1.8 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_internal.h,v $
*
******************************************************************************/
#ifndef __WAVELAN2_H__
#define __WAVELAN2_H__
/*******************************************************************************
* include files
******************************************************************************/
#include <linux/version.h>
#ifdef BUS_PCMCIA
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#include <pcmcia/version.h>
#endif
#include <pcmcia/cs_types.h>
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
#endif // BUS_PCMCIA
#ifdef HAS_WIRELESS_EXTENSIONS
#include <linux/wireless.h>
#if WIRELESS_EXT > 13
#include <net/iw_handler.h>
#endif // WIRELESS_EXT > 13
#define USE_DBM
#define RETURN_CURRENT_NETWORKNAME
#define USE_FREQUENCY
#endif // HAS_WIRELESS_EXTENSIONS/
#include <linux/list.h>
#include <linux/interrupt.h>
/*******************************************************************************
* constant definitions
******************************************************************************/
#define p_u8 __u8
#define p_s8 __s8
#define p_u16 __u16
#define p_s16 __s16
#define p_u32 __u32
#define p_s32 __s32
#define p_char char
#define MAX_KEY_LEN (2 + (13 * 2)) // 0x plus 13 hex digit pairs
#define MB_SIZE 1024
#define MAX_ENC_LEN 104
#define MAX_SCAN_TIME_SEC 8
#define MAX_NAPS 32
#define CFG_MB_INFO 0x0820 //Mail Box Info Block
#define NUM_WDS_PORTS 6
#define WVLAN_MAX_LOOKAHEAD (HCF_MAX_MSG+46) /* as per s0005MIC_4.doc */
/* Min/Max/Default Parameter Values */
#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
//;? why this difference depending on compile option, seems to me it should depend on runtime if anything
#define PARM_DEFAULT_SSID "LinuxAP"
#else
#define PARM_DEFAULT_SSID "ANY"
#endif // HCF_TYPE_AP
#define PARM_MIN_NAME_LEN 1
#define PARM_MAX_NAME_LEN 32
/* The following definitions pertain to module and profile parameters */
// #define PARM_AP_MODE APMode
// #define PARM_NAME_AP_MODE TEXT("APMode")
// #define PARM_DEFAULT_AP_MODE FALSE
#define PARM_AUTHENTICATION Authentication
#define PARM_NAME_AUTHENTICATION TEXT("Authentication")
#define PARM_MIN_AUTHENTICATION 1
#define PARM_MAX_AUTHENTICATION 2
#define PARM_DEFAULT_AUTHENTICATION 1
#define PARM_AUTH_KEY_MGMT_SUITE AuthKeyMgmtSuite
#define PARM_NAME_AUTH_KEY_MGMT_SUITE TEXT("AuthKeyMgmtSuite")
#define PARM_MIN_AUTH_KEY_MGMT_SUITE 0
#define PARM_MAX_AUTH_KEY_MGMT_SUITE 4
#define PARM_DEFAULT_AUTH_KEY_MGMT_SUITE 0
#define PARM_BRSC_2GHZ BRSC2GHz
#define PARM_NAME_BRSC_2GHZ TEXT("BRSC2GHz")
#define PARM_MIN_BRSC 0x0000
#define PARM_MAX_BRSC 0x0FFF
#define PARM_DEFAULT_BRSC_2GHZ 0x000F
#define PARM_BRSC_5GHZ BRSC5GHz
#define PARM_NAME_BRSC_5GHZ TEXT("BRSC5GHz")
#define PARM_DEFAULT_BRSC_5GHZ 0x0150
#define PARM_COEXISTENCE Coexistence
#define PARM_NAME_COEXISTENCE TEXT("Coexistence")
#define PARM_MIN_COEXISTENCE 0x0000
#define PARM_MAX_COEXISTENCE 0x0007
#define PARM_DEFAULT_COEXISTENCE 0x0000
#define PARM_CONFIGURED Configured
#define PARM_NAME_CONFIGURED TEXT("Configured")
#define PARM_CONNECTION_CONTROL ConnectionControl
#define PARM_NAME_CONNECTION_CONTROL TEXT("ConnectionControl")
#define PARM_MIN_CONNECTION_CONTROL 0
#define PARM_MAX_CONNECTION_CONTROL 3
#define PARM_DEFAULT_CONNECTION_CONTROL 2
#define PARM_CREATE_IBSS CreateIBSS
#define PARM_NAME_CREATE_IBSS TEXT("CreateIBSS")
#define PARM_DEFAULT_CREATE_IBSS FALSE
#define PARM_DEFAULT_CREATE_IBSS_STR "N"
#define PARM_DEBUG_FLAG DebugFlag
#define PARM_NAME_DEBUG_FLAG TEXT("DebugFlag")
#define PARM_MIN_DEBUG_FLAG 0
#define PARM_MAX_DEBUG_FLAG 0xFFFF
#define PARM_DEFAULT_DEBUG_FLAG 0xFFFF
#define PARM_DESIRED_SSID DesiredSSID
#define PARM_NAME_DESIRED_SSID TEXT("DesiredSSID")
#define PARM_DOWNLOAD_FIRMWARE DownloadFirmware
#define PARM_NAME_DOWNLOAD_FIRMWARE TEXT("DownloadFirmware")
#define PARM_DRIVER_ENABLE DriverEnable
#define PARM_NAME_DRIVER_ENABLE TEXT("DriverEnable")
#define PARM_DEFAULT_DRIVER_ENABLE TRUE
#define PARM_ENABLE_ENCRYPTION EnableEncryption
#define PARM_NAME_ENABLE_ENCRYPTION TEXT("EnableEncryption")
#define PARM_MIN_ENABLE_ENCRYPTION 0
#define PARM_MAX_ENABLE_ENCRYPTION 7
#define PARM_DEFAULT_ENABLE_ENCRYPTION 0
#define PARM_ENCRYPTION Encryption
#define PARM_NAME_ENCRYPTION TEXT("Encryption")
#define PARM_EXCLUDE_UNENCRYPTED ExcludeUnencrypted
#define PARM_NAME_EXCLUDE_UNENCRYPTED TEXT("ExcludeUnencrypted")
#define PARM_DEFAULT_EXCLUDE_UNENCRYPTED TRUE
#define PARM_DEFAULT_EXCLUDE_UNENCRYPTED_STR "N"
#define PARM_INTRA_BSS_RELAY IntraBSSRelay
#define PARM_NAME_INTRA_BSS_RELAY TEXT("IntraBSSRelay")
#define PARM_DEFAULT_INTRA_BSS_RELAY TRUE
#define PARM_DEFAULT_INTRA_BSS_RELAY_STR "Y"
#define PARM_KEY1 Key1
#define PARM_NAME_KEY1 TEXT("Key1")
#define PARM_KEY2 Key2
#define PARM_NAME_KEY2 TEXT("Key2")
#define PARM_KEY3 Key3
#define PARM_NAME_KEY3 TEXT("Key3")
#define PARM_KEY4 Key4
#define PARM_NAME_KEY4 TEXT("Key4")
//;? #define PARM_KEY_FORMAT AsciiHex
//;? #define PARM_NAME_KEY_FORMAT TEXT("AsciiHex")
#define PARM_LOAD_BALANCING LoadBalancing
#define PARM_NAME_LOAD_BALANCING TEXT("LoadBalancing")
#define PARM_DEFAULT_LOAD_BALANCING TRUE
#define PARM_DEFAULT_LOAD_BALANCING_STR "Y"
#define PARM_MAX_DATA_LENGTH MaxDataLength
#define PARM_NAME_MAX_DATA_LENGTH TEXT("MaxDataLength")
#define PARM_MAX_SLEEP MaxSleepDuration
#define PARM_NAME_MAX_SLEEP TEXT("MaxSleepDuration")
#define PARM_MIN_MAX_PM_SLEEP 1 //;?names nearly right?
#define PARM_MAX_MAX_PM_SLEEP 65535
#define PARM_DEFAULT_MAX_PM_SLEEP 100
#define PARM_MEDIUM_DISTRIBUTION MediumDistribution
#define PARM_NAME_MEDIUM_DISTRIBUTION TEXT("MediumDistribution")
#define PARM_DEFAULT_MEDIUM_DISTRIBUTION TRUE
#define PARM_DEFAULT_MEDIUM_DISTRIBUTION_STR "Y"
#define PARM_MICROWAVE_ROBUSTNESS MicroWaveRobustness
#define PARM_NAME_MICROWAVE_ROBUSTNESS TEXT("MicroWaveRobustness")
#define PARM_DEFAULT_MICROWAVE_ROBUSTNESS FALSE
#define PARM_DEFAULT_MICROWAVE_ROBUSTNESS_STR "N"
#define PARM_MULTICAST_PM_BUFFERING MulticastPMBuffering
#define PARM_NAME_MULTICAST_PM_BUFFERING TEXT("MulticastPMBuffering")
#define PARM_DEFAULT_MULTICAST_PM_BUFFERING TRUE
#define PARM_DEFAULT_MULTICAST_PM_BUFFERING_STR "Y"
#define PARM_MULTICAST_RATE MulticastRate
#define PARM_NAME_MULTICAST_RATE TEXT("MulticastRate")
#ifdef WARP
#define PARM_MIN_MULTICAST_RATE 0x0001
#define PARM_MAX_MULTICAST_RATE 0x0fff
#define PARM_DEFAULT_MULTICAST_RATE_2GHZ 0x0004
#define PARM_DEFAULT_MULTICAST_RATE_5GHZ 0x0010
#else
#define PARM_MIN_MULTICAST_RATE 0x0001
#define PARM_MAX_MULTICAST_RATE 0x0004
#define PARM_DEFAULT_MULTICAST_RATE_2GHZ 0x0002
#define PARM_DEFAULT_MULTICAST_RATE_5GHZ 0x0000
#endif // WARP
#define PARM_MULTICAST_RX MulticastReceive
#define PARM_NAME_MULTICAST_RX TEXT("MulticastReceive")
#define PARM_DEFAULT_MULTICAST_RX TRUE
#define PARM_DEFAULT_MULTICAST_RX_STR "Y"
#define PARM_NETWORK_ADDR NetworkAddress
#define PARM_NAME_NETWORK_ADDR TEXT("NetworkAddress")
#define PARM_DEFAULT_NETWORK_ADDR { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
#define PARM_NETWORK_TYPE NetworkType
#define PARM_NAME_NETWORK_TYPE TEXT("NetworkType")
#define PARM_DEFAULT_NETWORK_TYPE 0
#define PARM_OWN_ATIM_WINDOW OwnATIMWindow
#define PARM_NAME_OWN_ATIM_WINDOW TEXT("OwnATIMWindow")
#define PARM_MIN_OWN_ATIM_WINDOW 0
#define PARM_MAX_OWN_ATIM_WINDOW 100
#define PARM_DEFAULT_OWN_ATIM_WINDOW 0
#define PARM_OWN_BEACON_INTERVAL OwnBeaconInterval
#define PARM_NAME_OWN_BEACON_INTERVAL TEXT("OwnBeaconInterval")
#define PARM_MIN_OWN_BEACON_INTERVAL 20
#define PARM_MAX_OWN_BEACON_INTERVAL 200
#define PARM_DEFAULT_OWN_BEACON_INTERVAL 100
#define PARM_OWN_CHANNEL OwnChannel
#define PARM_NAME_OWN_CHANNEL TEXT("OwnChannel")
#define PARM_MIN_OWN_CHANNEL 1
#define PARM_MAX_OWN_CHANNEL 161
#define PARM_DEFAULT_OWN_CHANNEL 10
#define PARM_OWN_DTIM_PERIOD OwnDTIMPeriod
#define PARM_NAME_OWN_DTIM_PERIOD TEXT("OwnDTIMPeriod")
#define PARM_MIN_OWN_DTIM_PERIOD 1
#define PARM_MAX_OWN_DTIM_PERIOD 65535
#define PARM_DEFAULT_OWN_DTIM_PERIOD 1
#define PARM_OWN_NAME OwnName
#define PARM_NAME_OWN_NAME TEXT("OwnName")
#define PARM_DEFAULT_OWN_NAME "Linux"
#define PARM_OWN_SSID OwnSSID
#define PARM_NAME_OWN_SSID TEXT("OwnSSID")
#define PARM_PM_ENABLED PMEnabled
#define PARM_NAME_PM_ENABLED TEXT("PMEnabled")
#define PARM_MAX_PM_ENABLED 3
#define PARM_PMEPS PMEPS
#define PARM_NAME_PMEPS TEXT("PMEPS")
#define PARM_PM_HOLDOVER_DURATION PMHoldoverDuration
#define PARM_NAME_PM_HOLDOVER_DURATION TEXT("PMHoldoverDuration")
#define PARM_MIN_PM_HOLDOVER_DURATION 1
#define PARM_MAX_PM_HOLDOVER_DURATION 1000
#define PARM_DEFAULT_PM_HOLDOVER_DURATION 100
#define PARM_PM_MODE PowerMode
#define PARM_NAME_PM_MODE TEXT("PowerMode")
#define PARM_PORT_TYPE PortType
#define PARM_NAME_PORT_TYPE TEXT("PortType")
#define PARM_MIN_PORT_TYPE 1
#define PARM_MAX_PORT_TYPE 3
#define PARM_DEFAULT_PORT_TYPE 1
#define PARM_PROMISCUOUS_MODE PromiscuousMode
#define PARM_NAME_PROMISCUOUS_MODE TEXT("PromiscuousMode")
#define PARM_DEFAULT_PROMISCUOUS_MODE FALSE
#define PARM_DEFAULT_PROMISCUOUS_MODE_STR "N"
#define PARM_REJECT_ANY RejectANY
#define PARM_NAME_REJECT_ANY TEXT("RejectANY")
#define PARM_DEFAULT_REJECT_ANY FALSE
#define PARM_DEFAULT_REJECT_ANY_STR "N"
#define PARM_RTS_THRESHOLD RTSThreshold
#define PARM_NAME_RTS_THRESHOLD TEXT("RTSThreshold")
#define PARM_MIN_RTS_THRESHOLD 0
#define PARM_MAX_RTS_THRESHOLD 2347
#define PARM_DEFAULT_RTS_THRESHOLD 2347
#define PARM_RTS_THRESHOLD1 RTSThreshold1
#define PARM_NAME_RTS_THRESHOLD1 TEXT("RTSThreshold1")
#define PARM_RTS_THRESHOLD2 RTSThreshold2
#define PARM_NAME_RTS_THRESHOLD2 TEXT("RTSThreshold2")
#define PARM_RTS_THRESHOLD3 RTSThreshold3
#define PARM_NAME_RTS_THRESHOLD3 TEXT("RTSThreshold3")
#define PARM_RTS_THRESHOLD4 RTSThreshold4
#define PARM_NAME_RTS_THRESHOLD4 TEXT("RTSThreshold4")
#define PARM_RTS_THRESHOLD5 RTSThreshold5
#define PARM_NAME_RTS_THRESHOLD5 TEXT("RTSThreshold5")
#define PARM_RTS_THRESHOLD6 RTSThreshold6
#define PARM_NAME_RTS_THRESHOLD6 TEXT("RTSThreshold6")
#define PARM_SRSC_2GHZ SRSC2GHz
#define PARM_NAME_SRSC_2GHZ TEXT("SRSC2GHz")
#define PARM_MIN_SRSC 0x0000
#define PARM_MAX_SRSC 0x0FFF
#define PARM_DEFAULT_SRSC_2GHZ 0x0FFF
#define PARM_SRSC_5GHZ SRSC5GHz
#define PARM_NAME_SRSC_5GHZ TEXT("SRSC5GHz")
#define PARM_DEFAULT_SRSC_5GHZ 0x0FF0
#define PARM_SYSTEM_SCALE SystemScale
#define PARM_NAME_SYSTEM_SCALE TEXT("SystemScale")
#define PARM_MIN_SYSTEM_SCALE 1
#define PARM_MAX_SYSTEM_SCALE 5
#define PARM_DEFAULT_SYSTEM_SCALE 1
#define PARM_TX_KEY TxKey
#define PARM_NAME_TX_KEY TEXT("TxKey")
#define PARM_MIN_TX_KEY 1
#define PARM_MAX_TX_KEY 4
#define PARM_DEFAULT_TX_KEY 1
#define PARM_TX_POW_LEVEL TxPowLevel
#define PARM_NAME_TX_POW_LEVEL TEXT("TxPowLevel")
#define PARM_MIN_TX_POW_LEVEL 1 // 20 dBm
#define PARM_MAX_TX_POW_LEVEL 6 // 8 dBm
#define PARM_DEFAULT_TX_POW_LEVEL 3 // 15 dBm
#define PARM_TX_RATE TxRateControl
#define PARM_NAME_TX_RATE TEXT("TxRateControl")
#define PARM_MIN_TX_RATE 0x0001
#ifdef WARP
#define PARM_MAX_TX_RATE 0x0FFF
#define PARM_DEFAULT_TX_RATE_2GHZ 0x0FFF
#define PARM_DEFAULT_TX_RATE_5GHZ 0x0FF0
#else
#define PARM_MAX_TX_RATE 0x0007
#define PARM_DEFAULT_TX_RATE_2GHZ 0x0003
#define PARM_DEFAULT_TX_RATE_5GHZ 0x0000
#endif // WARP
#define PARM_TX_RATE1 TxRateControl1
#define PARM_NAME_TX_RATE1 TEXT("TxRateControl1")
#define PARM_TX_RATE2 TxRateControl2
#define PARM_NAME_TX_RATE2 TEXT("TxRateControl2")
#define PARM_TX_RATE3 TxRateControl3
#define PARM_NAME_TX_RATE3 TEXT("TxRateControl3")
#define PARM_TX_RATE4 TxRateControl4
#define PARM_NAME_TX_RATE4 TEXT("TxRateControl4")
#define PARM_TX_RATE5 TxRateControl5
#define PARM_NAME_TX_RATE5 TEXT("TxRateControl5")
#define PARM_TX_RATE6 TxRateControl6
#define PARM_NAME_TX_RATE6 TEXT("TxRateControl6")
#define PARM_VENDORDESCRIPTION VendorDescription
#define PARM_NAME_VENDORDESCRIPTION TEXT("VendorDescription")
#define PARM_WDS_ADDRESS WDSAddress
#define PARM_NAME_WDS_ADDRESS TEXT("WDSAddress")
#define PARM_WDS_ADDRESS1 WDSAddress1
#define PARM_NAME_WDS_ADDRESS1 TEXT("WDSAddress1")
#define PARM_WDS_ADDRESS2 WDSAddress2
#define PARM_NAME_WDS_ADDRESS2 TEXT("WDSAddress2")
#define PARM_WDS_ADDRESS3 WDSAddress3
#define PARM_NAME_WDS_ADDRESS3 TEXT("WDSAddress3")
#define PARM_WDS_ADDRESS4 WDSAddress4
#define PARM_NAME_WDS_ADDRESS4 TEXT("WDSAddress4")
#define PARM_WDS_ADDRESS5 WDSAddress5
#define PARM_NAME_WDS_ADDRESS5 TEXT("WDSAddress5")
#define PARM_WDS_ADDRESS6 WDSAddress6
#define PARM_NAME_WDS_ADDRESS6 TEXT("WDSAddress6")
/*
#define PARM_LONG_RETRY_LIMIT LongRetryLimit
#define PARM_NAME_LONG_RETRY_LIMIT TEXT("LongRetryLimit")
#define PARM_MIN_LONG_RETRY_LIMIT 1
#define PARM_MAX_LONG_RETRY_LIMIT 15
#define PARM_DEFAULT_LONG_RETRY_LIMIT 3
#define PARM_PROBE_DATA_RATES ProbeDataRates
#define PARM_NAME_PROBE_DATA_RATES TEXT("ProbeDataRates")
#define PARM_MIN_PROBE_DATA_RATES 0x0000
#define PARM_MAX_PROBE_DATA_RATES 0x0FFF
#define PARM_DEFAULT_PROBE_DATA_RATES_2GHZ 0x0002
#define PARM_DEFAULT_PROBE_DATA_RATES_5GHZ 0x0010
#define PARM_SHORT_RETRY_LIMIT ShortRetryLimit
#define PARM_NAME_SHORT_RETRY_LIMIT TEXT("ShortRetryLimit")
#define PARM_MIN_SHORT_RETRY_LIMIT 1
#define PARM_MAX_SHORT_RETRY_LIMIT 15
#define PARM_DEFAULT_SHORT_RETRY_LIMIT 7
*/
/*******************************************************************************
* state definitions
******************************************************************************/
/* The following constants are used to track state the device */
#define WL_FRIMWARE_PRESENT 1 // Download if needed
#define WL_FRIMWARE_NOT_PRESENT 0 // Skip over download, assume its already there
#define WL_HANDLING_INT 1 // Actually call the HCF to switch interrupts on/off
#define WL_NOT_HANDLING_INT 0 // Not yet handling interrupts, do not switch on/off
/*******************************************************************************
* macro definitions
******************************************************************************/
/* The following macro ensures that no symbols are exported, minimizing the
chance of a symbol collision in the kernel */
// EXPORT_NO_SYMBOLS;
#define NELEM(arr) (sizeof(arr) / sizeof(arr[0]))
#define WVLAN_VALID_MAC_ADDRESS( x ) \
((x[0]!=0xFF) && (x[1]!=0xFF) && (x[2]!=0xFF) && (x[3]!=0xFF) && (x[4]!=0xFF) && (x[5]!=0xFF))
/*******************************************************************************
* type definitions
******************************************************************************/
#undef FALSE
#undef TRUE
typedef enum
{
FALSE = 0,
TRUE = 1
}
bool_t;
typedef struct _ScanResult
{
//hcf_16 len;
//hcf_16 typ;
int scan_complete;
int num_aps;
SCAN_RS_STRCT APTable [MAX_NAPS];
}
ScanResult;
typedef struct _LINK_STATUS_STRCT
{
hcf_16 len;
hcf_16 typ;
hcf_16 linkStatus; /* 1..5 */
}
LINK_STATUS_STRCT;
typedef struct _ASSOC_STATUS_STRCT
{
hcf_16 len;
hcf_16 typ;
hcf_16 assocStatus; /* 1..3 */
hcf_8 staAddr[ETH_ALEN];
hcf_8 oldApAddr[ETH_ALEN];
}
ASSOC_STATUS_STRCT;
typedef struct _SECURITY_STATUS_STRCT
{
hcf_16 len;
hcf_16 typ;
hcf_16 securityStatus; /* 1..3 */
hcf_8 staAddr[ETH_ALEN];
hcf_16 reason;
}
SECURITY_STATUS_STRCT;
#define WVLAN_WMP_PDU_TYPE_LT_REQ 0x00
#define WVLAN_WMP_PDU_TYPE_LT_RSP 0x01
#define WVLAN_WMP_PDU_TYPE_APL_REQ 0x02
#define WVLAN_WMP_PDU_TYPE_APL_RSP 0x03
typedef struct wvlan_eth_hdr
{
unsigned char dst[ETH_ALEN]; /* Destination address. */
unsigned char src[ETH_ALEN]; /* Source address. */
unsigned short len; /* Length of the PDU. */
}
WVLAN_ETH_HDR, *PWVLAN_ETH_HDR;
typedef struct wvlan_llc_snap
{
unsigned char dsap; /* DSAP (0xAA) */
unsigned char ssap; /* SSAP (0xAA) */
unsigned char ctrl; /* Control (0x03) */
unsigned char oui[3]; /* Organization Unique ID (00-60-1d). */
unsigned char specid[2]; /* Specific ID code (00-01). */
}
WVLAN_LLC_SNAP, *PWVLAN_LLC_SNAP;
typedef struct wvlan_lt_hdr
{
unsigned char version; /* Version (0x00) */
unsigned char type; /* PDU type: 0-req/1-resp. */
unsigned short id; /* Identifier to associate resp to req. */
}
WVLAN_LT_HDR, *PWVLAN_LT_HDR;
typedef struct wvlan_wmp_hdr
{
unsigned char version; /* Version */
unsigned char type; /* PDU type */
}
WVLAN_WMP_HDR, *PWVLAN_WMP_HDR;
#define FILLER_SIZE 1554
#define TEST_PATTERN_SIZE 54
typedef struct wvlan_lt_req
{
unsigned char Filler[TEST_PATTERN_SIZE]; /* minimal length of 54 bytes */
}
WVLAN_LT_REQ, *PWVLAN_LT_REQ;
typedef struct wvlan_lt_rsp
{
char name[32];
/* Measured Data */
unsigned char signal;
unsigned char noise;
unsigned char rxFlow;
unsigned char dataRate;
unsigned short protocol;
/* Capabilities */
unsigned char station;
unsigned char dataRateCap;
unsigned char powerMgmt[4];
unsigned char robustness[4];
unsigned char scaling;
unsigned char reserved[5];
}
WVLAN_LT_RSP, *PWVLAN_LT_RSP;
typedef struct wvlan_rx_wmp_hdr
{
unsigned short status;
unsigned short reserved1[2];
unsigned char silence;
unsigned char signal;
unsigned char rate;
unsigned char rxFlow;
unsigned short reserved2[2];
unsigned short frameControl;
unsigned short duration;
unsigned short address1[3];
unsigned short address2[3];
unsigned short address3[3];
unsigned short sequenceControl;
unsigned short address4[3];
#ifndef HERMES25 //;?just to be on the safe side of inherited but not comprehended code #ifdef HERMES2
unsigned short seems_to_be_unused_reserved3[5]; //;?
unsigned short seems_to_be_unused_reserved4; //;?
#endif // HERMES25
unsigned short HeaderDataLen;
}
WVLAN_RX_WMP_HDR, *PWVLAN_RX_WMP_HDR;
typedef struct wvlan_linktest_req_pdu
{
WVLAN_ETH_HDR ethHdr;
WVLAN_LLC_SNAP llcSnap;
WVLAN_LT_HDR ltHdr;
WVLAN_LT_REQ ltReq;
}
WVLAN_LINKTEST_REQ_PDU, *PWVLAN_LINKTEST_REQ_PDU;
typedef struct wvlan_linktest_rsp_pdu
{
WVLAN_RX_WMP_HDR wmpRxHdr;
WVLAN_ETH_HDR ethHdr;
WVLAN_LLC_SNAP llcSnap;
WVLAN_LT_HDR ltHdr;
WVLAN_LT_RSP ltRsp;
}
WVLAN_LINKTEST_RSP_PDU, *PWVLAN_LINKTEST_RSP_PDU;
typedef struct _LINKTEST_RSP_STRCT
{
hcf_16 len;
hcf_16 typ;
WVLAN_LINKTEST_RSP_PDU ltRsp;
}
LINKTEST_RSP_STRCT;
typedef struct wvlan_wmp_rsp_pdu
{
WVLAN_RX_WMP_HDR wmpRxHdr;
WVLAN_ETH_HDR ethHdr;
WVLAN_LLC_SNAP llcSnap;
WVLAN_WMP_HDR wmpHdr;
}
WVLAN_WMP_RSP_PDU, *PWVLAN_WMP_RSP_PDU;
typedef struct _WMP_RSP_STRCT
{
hcf_16 len;
hcf_16 typ;
WVLAN_WMP_RSP_PDU wmpRsp;
}
WMP_RSP_STRCT;
typedef struct _PROBE_RESP
{
// first part: 802.11
hcf_16 length;
hcf_16 infoType;
hcf_16 reserved0;
//hcf_8 signal;
hcf_8 silence;
hcf_8 signal; // Moved signal here as signal/noise values were flipped
hcf_8 rxFlow;
hcf_8 rate;
hcf_16 reserved1[2];
// second part:
hcf_16 frameControl;
hcf_16 durID;
hcf_8 address1[6];
hcf_8 address2[6];
hcf_8 BSSID[6]; //! this is correct, right ?
hcf_16 sequence;
hcf_8 address4[6];
#ifndef WARP
hcf_8 reserved2[12];
#endif // WARP
hcf_16 dataLength;
// the information in the next 3 fields (DA/SA/LenType) is actually not filled in.
hcf_8 DA[6];
hcf_8 SA[6];
#ifdef WARP
hcf_8 channel;
hcf_8 band;
#else
hcf_16 lenType;
#endif // WARP
hcf_8 timeStamp[8];
hcf_16 beaconInterval;
hcf_16 capability;
hcf_8 rawData[200]; //! <<< think about this number !
hcf_16 flags;
}
PROBE_RESP, *PPROBE_RESP;
typedef struct _ProbeResult
{
int scan_complete;
int num_aps;
PROBE_RESP ProbeTable[MAX_NAPS];
}
ProbeResult;
/* Definitions used to parse capabilities out of the probe responses */
#define CAPABILITY_ESS 0x0001
#define CAPABILITY_IBSS 0x0002
#define CAPABILITY_PRIVACY 0x0010
/* Definitions used to parse the Information Elements out of probe responses */
#define DS_INFO_ELEM 0x03
#define GENERIC_INFO_ELEM 0xdd
#define WPA_MAX_IE_LEN 40
#define WPA_SELECTOR_LEN 4
#define WPA_OUI_TYPE { 0x00, 0x50, 0xf2, 1 }
#define WPA_VERSION 1
#define WPA_AUTH_KEY_MGMT_UNSPEC_802_1X { 0x00, 0x50, 0xf2, 1 }
#define WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X { 0x00, 0x50, 0xf2, 2 }
#define WPA_CIPHER_SUITE_NONE { 0x00, 0x50, 0xf2, 0 }
#define WPA_CIPHER_SUITE_WEP40 { 0x00, 0x50, 0xf2, 1 }
#define WPA_CIPHER_SUITE_TKIP { 0x00, 0x50, 0xf2, 2 }
#define WPA_CIPHER_SUITE_WRAP { 0x00, 0x50, 0xf2, 3 }
#define WPA_CIPHER_SUITE_CCMP { 0x00, 0x50, 0xf2, 4 }
#define WPA_CIPHER_SUITE_WEP104 { 0x00, 0x50, 0xf2, 5 }
typedef enum wvlan_drv_mode
{
WVLAN_DRV_MODE_NO_DOWNLOAD, /* this is the same as STA for Hermes 1 */
/* it is also only applicable for Hermes 1 */
WVLAN_DRV_MODE_STA,
WVLAN_DRV_MODE_AP,
WVLAN_DRV_MODE_MAX
}
WVLAN_DRV_MODE, *PWVLAN_DRV_MODE;
typedef enum wvlan_port_state
{
WVLAN_PORT_STATE_ENABLED,
WVLAN_PORT_STATE_DISABLED,
WVLAN_PORT_STATE_CONNECTED
}
WVLAN_PORT_STATE, *PWVLAN_PORT_STATE;
/*
typedef enum wvlan_connect_state
{
WVLAN_CONNECT_STATE_CONNECTED,
WVLAN_CONNECT_STATE_DISCONNECTED
}
WVLAN_CONNECT_STATE, *PWVLAN_CONNECT_STATE;
*/
typedef enum wvlan_pm_state
{
WVLAN_PM_STATE_DISABLED,
WVLAN_PM_STATE_ENHANCED,
WVLAN_PM_STATE_STANDARD
}
WVLAN_PM_STATE, *PWVLAN_PM_STATE;
typedef struct wvlan_frame
{
struct sk_buff *skb; /* sk_buff for frame. */
hcf_16 port; /* MAC port for the frame. */
hcf_16 len; /* Length of the frame. */
}
WVLAN_FRAME, *PWVLAN_FRAME;
typedef struct wvlan_lframe
{
struct list_head node; /* Node in the list */
WVLAN_FRAME frame; /* Frame. */
}
WVLAN_LFRAME, *PWVLAN_LFRAME;
#define DEFAULT_NUM_TX_FRAMES 48
#define TX_Q_LOW_WATER_MARK (DEFAULT_NUM_TX_FRAMES/3)
#define WVLAN_MAX_TX_QUEUES 1
#ifdef USE_WDS
typedef struct wvlan_wds_if
{
struct net_device *dev;
int is_registered;
int netif_queue_on;
struct net_device_stats stats;
hcf_16 rtsThreshold;
hcf_16 txRateCntl;
hcf_8 wdsAddress[ETH_ALEN];
} WVLAN_WDS_IF, *PWVLAN_WDS_IF;
#endif // USE_WDS
#define NUM_RX_DESC 5
#define NUM_TX_DESC 5
typedef struct dma_strct
{
DESC_STRCT *tx_packet[NUM_TX_DESC];
DESC_STRCT *rx_packet[NUM_RX_DESC];
DESC_STRCT *rx_reclaim_desc, *tx_reclaim_desc; // Descriptors for host-reclaim purposes (see HCF)
int tx_rsc_ind; // DMA Tx resource indicator is maintained in the MSF, not in the HCF
int rx_rsc_ind; // Also added rx rsource indicator so that cleanup can be performed if alloc fails
int status;
} DMA_STRCT;
/* Macros used in DMA support */
/* get bus address of {rx,tx}dma structure member, in little-endian byte order */
#define WL_DMA_BUS_ADDR_LE(str, i, mem) \
cpu_to_le32(str##_dma_addr[(i)] + ((hcf_8 *)&str[(i)]->mem - (hcf_8 *)str[(i)]))
struct wl_private
{
#ifdef BUS_PCMCIA
dev_node_t node;
struct pcmcia_device *link;
#endif // BUS_PCMCIA
struct net_device *dev;
// struct net_device *dev_next;
spinlock_t slock;
struct tasklet_struct task;
struct net_device_stats stats;
#ifdef WIRELESS_EXT
struct iw_statistics wstats;
// int spy_number;
// u_char spy_address[IW_MAX_SPY][ETH_ALEN];
// struct iw_quality spy_stat[IW_MAX_SPY];
struct iw_spy_data spy_data;
struct iw_public_data wireless_data;
#endif // WIRELESS_EXT
IFB_STRCT hcfCtx;
//;? struct timer_list timer_oor;
//;? hcf_16 timer_oor_cnt;
u_long wlags49_type; //controls output in /proc/wlags49
u_long flags;
hcf_16 DebugFlag;
int is_registered;
int is_handling_int;
int firmware_present;
char sysfsCreated;
CFG_DRV_INFO_STRCT driverInfo;
CFG_IDENTITY_STRCT driverIdentity;
CFG_FW_IDENTITY_STRCT StationIdentity;
CFG_PRI_IDENTITY_STRCT PrimaryIdentity;
CFG_PRI_IDENTITY_STRCT NICIdentity;
ltv_t ltvRecord;
u_long txBytes;
hcf_16 maxPort; /* 0 for STA, 6 for AP */
/* Elements used for async notification from hardware */
RID_LOG_STRCT RidList[10];
ltv_t updatedRecord;
PROBE_RESP ProbeResp;
ASSOC_STATUS_STRCT assoc_stat;
SECURITY_STATUS_STRCT sec_stat;
u_char lookAheadBuf[WVLAN_MAX_LOOKAHEAD];
hcf_8 PortType; // 1 - 3 (1 [Normal] | 3 [AdHoc])
hcf_16 Channel; // 0 - 14 (0)
hcf_16 TxRateControl[2];
hcf_8 DistanceBetweenAPs; // 1 - 3 (1)
hcf_16 RTSThreshold; // 0 - 2347 (2347)
hcf_16 PMEnabled; // 0 - 2, 8001 - 8002 (0)
hcf_8 MicrowaveRobustness;// 0 - 1 (0)
hcf_8 CreateIBSS; // 0 - 1 (0)
hcf_8 MulticastReceive; // 0 - 1 (1)
hcf_16 MaxSleepDuration; // 0 - 65535 (100)
hcf_8 MACAddress[ETH_ALEN];
char NetworkName[HCF_MAX_NAME_LEN+1];
char StationName[HCF_MAX_NAME_LEN+1];
hcf_8 EnableEncryption; // 0 - 1 (0)
char Key1[MAX_KEY_LEN+1];
char Key2[MAX_KEY_LEN+1];
char Key3[MAX_KEY_LEN+1];
char Key4[MAX_KEY_LEN+1];
hcf_8 TransmitKeyID; // 1 - 4 (1)
CFG_DEFAULT_KEYS_STRCT DefaultKeys;
u_char mailbox[MB_SIZE];
char szEncryption[MAX_ENC_LEN];
hcf_16 driverEnable;
hcf_16 wolasEnable;
hcf_16 atimWindow;
hcf_16 holdoverDuration;
hcf_16 MulticastRate[2];
hcf_16 authentication; // is this AP specific?
hcf_16 promiscuousMode;
WVLAN_DRV_MODE DownloadFirmware; // 0 - 2 (0 [None] | 1 [STA] | 2 [AP])
char fw_image_filename[MAX_LINE_SIZE+1];
hcf_16 AuthKeyMgmtSuite;
hcf_16 loadBalancing;
hcf_16 mediumDistribution;
hcf_16 txPowLevel;
//hcf_16 shortRetryLimit;
//hcf_16 longRetryLimit;
hcf_16 srsc[2];
hcf_16 brsc[2];
hcf_16 connectionControl;
//hcf_16 probeDataRates[2];
hcf_16 ownBeaconInterval;
hcf_16 coexistence;
WVLAN_FRAME txF;
WVLAN_LFRAME txList[DEFAULT_NUM_TX_FRAMES];
struct list_head txFree;
struct list_head txQ[WVLAN_MAX_TX_QUEUES];
int netif_queue_on;
int txQ_count;
DESC_STRCT desc_rx;
DESC_STRCT desc_tx;
WVLAN_PORT_STATE portState;
ScanResult scan_results;
ProbeResult probe_results;
int probe_num_aps;
int use_dma;
DMA_STRCT dma;
#ifdef USE_RTS
int useRTS;
#endif // USE_RTS
hcf_8 DTIMPeriod; // 1 - 255 (1)
hcf_16 multicastPMBuffering;
hcf_8 RejectAny; // 0 - 1 (0)
hcf_8 ExcludeUnencrypted; // 0 - 1 (1)
hcf_16 intraBSSRelay;
#ifdef USE_WDS
WVLAN_WDS_IF wds_port[NUM_WDS_PORTS];
#endif // USE_WDS
}; // wl_private
#ifdef HAVE_NETDEV_PRIV
#define wl_priv(dev) ((struct wl_private *) netdev_priv(dev))
#else
extern inline struct wl_private *wl_priv(struct net_device *dev)
{
return dev->priv;
}
#endif
/********************************************************************/
/* Locking and synchronization functions */
/********************************************************************/
/* These functions *must* be inline or they will break horribly on
* SPARC, due to its weird semantics for save/restore flags. extern
* inline should prevent the kernel from linking or module from
* loading if they are not inlined. */
extern inline void wl_lock(struct wl_private *lp,
unsigned long *flags)
{
spin_lock_irqsave(&lp->slock, *flags);
}
extern inline void wl_unlock(struct wl_private *lp,
unsigned long *flags)
{
spin_unlock_irqrestore(&lp->slock, *flags);
}
/********************************************************************/
/* Interrupt enable disable functions */
/********************************************************************/
extern inline void wl_act_int_on(struct wl_private *lp)
{
/*
* Only do something when the driver is handling
* interrupts. Handling starts at wl_open and
* ends at wl_close when not in RTS mode
*/
if(lp->is_handling_int == WL_HANDLING_INT) {
hcf_action( &lp->hcfCtx, HCF_ACT_INT_ON );
}
}
extern inline void wl_act_int_off(struct wl_private *lp)
{
/*
* Only do something when the driver is handling
* interrupts. Handling starts at wl_open and
* ends at wl_close when not in RTS mode
*/
if(lp->is_handling_int == WL_HANDLING_INT) {
hcf_action( &lp->hcfCtx, HCF_ACT_INT_OFF );
}
}
#endif // __WAVELAN2_H__
This source diff could not be displayed because it is too large. You can view the blob instead.
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/23 04:51:21 $
* $Revision: 1.4 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_main.h,v $
*
******************************************************************************/
#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__
/*******************************************************************************
* 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 handler functions registered with the net_device
* structure.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/03 13:33:44 $
* $Revision: 1.8 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_netdev.c,v $
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <wl_version.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
// #include <linux/sched.h>
// #include <linux/ptrace.h>
// #include <linux/slab.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/skbuff.h>
// #include <asm/io.h>
// #include <asm/system.h>
// #include <asm/bitops.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
// #include <linux/skbuff.h>
// #include <linux/if_arp.h>
// #include <linux/ioport.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_priv.h>
#include <wl_main.h>
#include <wl_netdev.h>
#include <wl_wext.h>
#ifdef USE_PROFILE
#include <wl_profile.h>
#endif /* USE_PROFILE */
#ifdef BUS_PCMCIA
#include <wl_cs.h>
#endif /* BUS_PCMCIA */
#ifdef BUS_PCI
#include <wl_pci.h>
#endif /* BUS_PCI */
/*******************************************************************************
* global variables
******************************************************************************/
#if DBG
extern dbg_info_t *DbgInfo;
#endif /* DBG */
#if HCF_ENCAP
#define MTU_MAX (HCF_MAX_MSG - ETH_HLEN - 8)
#else
#define MTU_MAX (HCF_MAX_MSG - ETH_HLEN)
#endif
//static int mtu = MTU_MAX;
//MODULE_PARM(mtu, "i");
//MODULE_PARM_DESC(mtu, "MTU");
/*******************************************************************************
* macros
******************************************************************************/
#define BLOCK_INPUT(buf, len) \
desc->buf_addr = buf; \
desc->BUF_SIZE = len; \
status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
#define BLOCK_INPUT_DMA(buf, len) memcpy( buf, desc_next->buf_addr, pktlen )
/*******************************************************************************
* function prototypes
******************************************************************************/
/*******************************************************************************
* wl_init()
*******************************************************************************
*
* DESCRIPTION:
*
* We never need to do anything when a "Wireless" device is "initialized"
* by the net software, because we only register already-found cards.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_init( struct net_device *dev )
{
// unsigned long flags;
// struct wl_private *lp = wl_priv(dev);
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_init" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
// wl_lock( lp, &flags );
// wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return 0;
} // wl_init
/*============================================================================*/
/*******************************************************************************
* wl_config()
*******************************************************************************
*
* DESCRIPTION:
*
* Implement the SIOCSIFMAP interface.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
* map - a pointer to the device's ifmap structure
*
* RETURNS:
*
* 0 on success
* errno otherwise
*
******************************************************************************/
int wl_config( struct net_device *dev, struct ifmap *map )
{
DBG_FUNC( "wl_config" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
DBG_PARAM( DbgInfo, "map", "0x%p", map );
/* The only thing we care about here is a port change. Since this not needed,
ignore the request. */
DBG_TRACE( DbgInfo, "%s: %s called.\n", dev->name, __FUNC__ );
DBG_LEAVE( DbgInfo );
return 0;
} // wl_config
/*============================================================================*/
/*******************************************************************************
* wl_stats()
*******************************************************************************
*
* DESCRIPTION:
*
* Return the current device statistics.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* a pointer to a net_device_stats structure containing the network
* statistics.
*
******************************************************************************/
struct net_device_stats *wl_stats( struct net_device *dev )
{
#ifdef USE_WDS
int count;
#endif /* USE_WDS */
unsigned long flags;
struct net_device_stats *pStats;
struct wl_private *lp = wl_priv(dev);
/*------------------------------------------------------------------------*/
//DBG_FUNC( "wl_stats" );
//DBG_ENTER( DbgInfo );
//DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
pStats = NULL;
wl_lock( lp, &flags );
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
wl_unlock( lp, &flags );
//DBG_LEAVE( DbgInfo );
return NULL;
}
#endif /* USE_RTS */
/* Return the statistics for the appropriate device */
#ifdef USE_WDS
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( dev == lp->wds_port[count].dev ) {
pStats = &( lp->wds_port[count].stats );
}
}
#endif /* USE_WDS */
/* If pStats is still NULL, then the device is not a WDS port */
if( pStats == NULL ) {
pStats = &( lp->stats );
}
wl_unlock( lp, &flags );
//DBG_LEAVE( DbgInfo );
return pStats;
} // wl_stats
/*============================================================================*/
/*******************************************************************************
* wl_open()
*******************************************************************************
*
* DESCRIPTION:
*
* Open the device.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* 0 on success
* errno otherwise
*
******************************************************************************/
int wl_open(struct net_device *dev)
{
int status = HCF_SUCCESS;
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_open" );
DBG_ENTER( DbgInfo );
wl_lock( lp, &flags );
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_TRACE( DbgInfo, "Skipping device open, in RTS mode\n" );
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return -EIO;
}
#endif /* USE_RTS */
#ifdef USE_PROFILE
parse_config( dev );
#endif
if( lp->portState == WVLAN_PORT_STATE_DISABLED ) {
DBG_TRACE( DbgInfo, "Enabling Port 0\n" );
status = wl_enable( lp );
if( status != HCF_SUCCESS ) {
DBG_TRACE( DbgInfo, "Enable port 0 failed: 0x%x\n", status );
}
}
// Holding the lock too long, make a gap to allow other processes
wl_unlock(lp, &flags);
wl_lock( lp, &flags );
if ( strlen( lp->fw_image_filename ) ) {
DBG_TRACE( DbgInfo, ";???? Kludgy way to force a download\n" );
status = wl_go( lp );
} else {
status = wl_apply( lp );
}
// Holding the lock too long, make a gap to allow other processes
wl_unlock(lp, &flags);
wl_lock( lp, &flags );
if( status != HCF_SUCCESS ) {
// Unsuccesfull, try reset of the card to recover
status = wl_reset( dev );
}
// Holding the lock too long, make a gap to allow other processes
wl_unlock(lp, &flags);
wl_lock( lp, &flags );
if( status == HCF_SUCCESS ) {
netif_carrier_on( dev );
WL_WDS_NETIF_CARRIER_ON( lp );
lp->is_handling_int = WL_HANDLING_INT; // Start handling interrupts
wl_act_int_on( lp );
netif_start_queue( dev );
WL_WDS_NETIF_START_QUEUE( lp );
} else {
wl_hcf_error( dev, status ); /* Report the error */
netif_device_detach( dev ); /* Stop the device and queue */
}
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return status;
} // wl_open
/*============================================================================*/
/*******************************************************************************
* wl_close()
*******************************************************************************
*
* DESCRIPTION:
*
* Close the device.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* 0 on success
* errno otherwise
*
******************************************************************************/
int wl_close( struct net_device *dev )
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
/*------------------------------------------------------------------------*/
DBG_FUNC("wl_close");
DBG_ENTER(DbgInfo);
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
/* Mark the adapter as busy */
netif_stop_queue( dev );
WL_WDS_NETIF_STOP_QUEUE( lp );
netif_carrier_off( dev );
WL_WDS_NETIF_CARRIER_OFF( lp );
/* Shutdown the adapter:
Disable adapter interrupts
Stop Tx/Rx
Update statistics
Set low power mode
*/
wl_lock( lp, &flags );
wl_act_int_off( lp );
lp->is_handling_int = WL_NOT_HANDLING_INT; // Stop handling interrupts
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_TRACE( DbgInfo, "Skipping device close, in RTS mode\n" );
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return -EIO;
}
#endif /* USE_RTS */
/* Disable the ports */
wl_disable( lp );
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return 0;
} // wl_close
/*============================================================================*/
static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1);
strncpy(info->version, DRV_VERSION_STR, sizeof(info->version) - 1);
// strncpy(info.fw_version, priv->fw_name,
// sizeof(info.fw_version) - 1);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20))
if (dev->dev.parent) {
dev_set_name(dev->dev.parent, "%s", info->bus_info);
//strncpy(info->bus_info, dev->dev.parent->bus_id,
// sizeof(info->bus_info) - 1);
#else
if (dev->class_dev.parent) {
sizeof(info->bus_info) - 1);
#endif
} else {
snprintf(info->bus_info, sizeof(info->bus_info) - 1,
"PCMCIA FIXME");
// "PCMCIA 0x%lx", priv->hw.iobase);
}
} // wl_get_drvinfo
static struct ethtool_ops wl_ethtool_ops = {
.get_drvinfo = wl_get_drvinfo,
.get_link = ethtool_op_get_link,
};
/*******************************************************************************
* wl_ioctl()
*******************************************************************************
*
* DESCRIPTION:
*
* The IOCTL handler for the device.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device struct.
* rq - a pointer to the IOCTL request buffer.
* cmd - the IOCTL command code.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_ioctl( struct net_device *dev, struct ifreq *rq, int cmd )
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_ioctl" );
DBG_ENTER(DbgInfo);
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
DBG_PARAM(DbgInfo, "rq", "0x%p", rq);
DBG_PARAM(DbgInfo, "cmd", "0x%04x", cmd);
wl_lock( lp, &flags );
wl_act_int_off( lp );
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
/* Handle any RTS IOCTL here */
if( cmd == WL_IOCTL_RTS ) {
DBG_TRACE( DbgInfo, "IOCTL: WL_IOCTL_RTS\n" );
ret = wvlan_rts( (struct rtsreq *)rq, dev->base_addr );
} else {
DBG_TRACE( DbgInfo, "IOCTL not supported in RTS mode: 0x%X\n", cmd );
ret = -EOPNOTSUPP;
}
goto out_act_int_on_unlock;
}
#endif /* USE_RTS */
/* Only handle UIL IOCTL requests when the UIL has the system blocked. */
if( !(( lp->flags & WVLAN2_UIL_BUSY ) && ( cmd != WVLAN2_IOCTL_UIL ))) {
#ifdef USE_UIL
struct uilreq *urq = (struct uilreq *)rq;
#endif /* USE_UIL */
switch( cmd ) {
// ================== Private IOCTLs (up to 16) ==================
#ifdef USE_UIL
case WVLAN2_IOCTL_UIL:
DBG_TRACE( DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL\n" );
ret = wvlan_uil( urq, lp );
break;
#endif /* USE_UIL */
default:
DBG_TRACE(DbgInfo, "IOCTL CODE NOT SUPPORTED: 0x%X\n", cmd );
ret = -EOPNOTSUPP;
break;
}
} else {
DBG_WARNING( DbgInfo, "DEVICE IS BUSY, CANNOT PROCESS REQUEST\n" );
ret = -EBUSY;
}
#ifdef USE_RTS
out_act_int_on_unlock:
#endif /* USE_RTS */
wl_act_int_on( lp );
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return ret;
} // wl_ioctl
/*============================================================================*/
#ifdef CONFIG_NET_POLL_CONTROLLER
void wl_poll(struct net_device *dev)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
struct pt_regs regs;
wl_lock( lp, &flags );
wl_isr(dev->irq, dev, &regs);
wl_unlock( lp, &flags );
}
#endif
/*******************************************************************************
* wl_tx_timeout()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler called when, for some reason, a Tx request is not completed.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device struct.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_tx_timeout( struct net_device *dev )
{
#ifdef USE_WDS
int count;
#endif /* USE_WDS */
unsigned long flags;
struct wl_private *lp = wl_priv(dev);
struct net_device_stats *pStats = NULL;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_tx_timeout" );
DBG_ENTER( DbgInfo );
DBG_WARNING( DbgInfo, "%s: Transmit timeout.\n", dev->name );
wl_lock( lp, &flags );
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_TRACE( DbgInfo, "Skipping tx_timeout handler, in RTS mode\n" );
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return;
}
#endif /* USE_RTS */
/* Figure out which device (the "root" device or WDS port) this timeout
is for */
#ifdef USE_WDS
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( dev == lp->wds_port[count].dev ) {
pStats = &( lp->wds_port[count].stats );
/* Break the loop so that we can use the counter to access WDS
information in the private structure */
break;
}
}
#endif /* USE_WDS */
/* If pStats is still NULL, then the device is not a WDS port */
if( pStats == NULL ) {
pStats = &( lp->stats );
}
/* Accumulate the timeout error */
pStats->tx_errors++;
wl_unlock( lp, &flags );
DBG_LEAVE( DbgInfo );
return;
} // wl_tx_timeout
/*============================================================================*/
/*******************************************************************************
* wl_send()
*******************************************************************************
*
* DESCRIPTION:
*
* The routine which performs data transmits.
*
* PARAMETERS:
*
* lp - a pointer to the device's wl_private struct.
*
* RETURNS:
*
* 0 on success
* 1 on error
*
******************************************************************************/
int wl_send( struct wl_private *lp )
{
int status;
DESC_STRCT *desc;
WVLAN_LFRAME *txF = NULL;
struct list_head *element;
int len;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_send" );
if( lp == NULL ) {
DBG_ERROR( DbgInfo, "Private adapter struct is NULL\n" );
return FALSE;
}
if( lp->dev == NULL ) {
DBG_ERROR( DbgInfo, "net_device struct in wl_private is NULL\n" );
return FALSE;
}
/* Check for the availability of FIDs; if none are available, don't take any
frames off the txQ */
if( lp->hcfCtx.IFB_RscInd == 0 ) {
return FALSE;
}
/* Reclaim the TxQ Elements and place them back on the free queue */
if( !list_empty( &( lp->txQ[0] ))) {
element = lp->txQ[0].next;
txF = (WVLAN_LFRAME * )list_entry( element, WVLAN_LFRAME, node );
if( txF != NULL ) {
lp->txF.skb = txF->frame.skb;
lp->txF.port = txF->frame.port;
txF->frame.skb = NULL;
txF->frame.port = 0;
list_del( &( txF->node ));
list_add( element, &( lp->txFree ));
lp->txQ_count--;
if( lp->txQ_count < TX_Q_LOW_WATER_MARK ) {
if( lp->netif_queue_on == FALSE ) {
DBG_TX( DbgInfo, "Kickstarting Q: %d\n", lp->txQ_count );
netif_wake_queue( lp->dev );
WL_WDS_NETIF_WAKE_QUEUE( lp );
lp->netif_queue_on = TRUE;
}
}
}
}
if( lp->txF.skb == NULL ) {
return FALSE;
}
/* If the device has resources (FIDs) available, then Tx the packet */
/* Format the TxRequest and send it to the adapter */
len = lp->txF.skb->len < ETH_ZLEN ? ETH_ZLEN : lp->txF.skb->len;
desc = &( lp->desc_tx );
desc->buf_addr = lp->txF.skb->data;
desc->BUF_CNT = len;
desc->next_desc_addr = NULL;
status = hcf_send_msg( &( lp->hcfCtx ), desc, lp->txF.port );
if( status == HCF_SUCCESS ) {
lp->dev->trans_start = jiffies;
DBG_TX( DbgInfo, "Transmit...\n" );
if( lp->txF.port == HCF_PORT_0 ) {
lp->stats.tx_packets++;
lp->stats.tx_bytes += lp->txF.skb->len;
}
#ifdef USE_WDS
else
{
lp->wds_port[(( lp->txF.port >> 8 ) - 1)].stats.tx_packets++;
lp->wds_port[(( lp->txF.port >> 8 ) - 1)].stats.tx_bytes += lp->txF.skb->len;
}
#endif /* USE_WDS */
/* Free the skb and perform queue cleanup, as the buffer was
transmitted successfully */
dev_kfree_skb( lp->txF.skb );
lp->txF.skb = NULL;
lp->txF.port = 0;
}
return TRUE;
} // wl_send
/*============================================================================*/
/*******************************************************************************
* wl_tx()
*******************************************************************************
*
* DESCRIPTION:
*
* The Tx handler function for the network layer.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff structure containing the data to transfer.
* dev - a pointer to the device's net_device structure.
*
* RETURNS:
*
* 0 on success
* 1 on error
*
******************************************************************************/
int wl_tx( struct sk_buff *skb, struct net_device *dev, int port )
{
unsigned long flags;
struct wl_private *lp = wl_priv(dev);
WVLAN_LFRAME *txF = NULL;
struct list_head *element;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_tx" );
/* Grab the spinlock */
wl_lock( lp, &flags );
if( lp->flags & WVLAN2_UIL_BUSY ) {
DBG_WARNING( DbgInfo, "UIL has device blocked\n" );
/* Start dropping packets here??? */
wl_unlock( lp, &flags );
return 1;
}
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_PRINT( "RTS: we're getting a Tx...\n" );
wl_unlock( lp, &flags );
return 1;
}
#endif /* USE_RTS */
if( !lp->use_dma ) {
/* Get an element from the queue */
element = lp->txFree.next;
txF = (WVLAN_LFRAME *)list_entry( element, WVLAN_LFRAME, node );
if( txF == NULL ) {
DBG_ERROR( DbgInfo, "Problem with list_entry\n" );
wl_unlock( lp, &flags );
return 1;
}
/* Fill out the frame */
txF->frame.skb = skb;
txF->frame.port = port;
/* Move the frame to the txQ */
/* NOTE: Here's where we would do priority queueing */
list_del( &( txF->node ));
list_add( &( txF->node ), &( lp->txQ[0] ));
lp->txQ_count++;
if( lp->txQ_count >= DEFAULT_NUM_TX_FRAMES ) {
DBG_TX( DbgInfo, "Q Full: %d\n", lp->txQ_count );
if( lp->netif_queue_on == TRUE ) {
netif_stop_queue( lp->dev );
WL_WDS_NETIF_STOP_QUEUE( lp );
lp->netif_queue_on = FALSE;
}
}
}
wl_act_int_off( lp ); /* Disable Interrupts */
/* Send the data to the hardware using the appropriate method */
#ifdef ENABLE_DMA
if( lp->use_dma ) {
wl_send_dma( lp, skb, port );
}
else
#endif
{
wl_send( lp );
}
/* Re-enable Interrupts, release the spinlock and return */
wl_act_int_on( lp );
wl_unlock( lp, &flags );
return 0;
} // wl_tx
/*============================================================================*/
/*******************************************************************************
* wl_rx()
*******************************************************************************
*
* DESCRIPTION:
*
* The routine which performs data reception.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure.
*
* RETURNS:
*
* 0 on success
* 1 on error
*
******************************************************************************/
int wl_rx(struct net_device *dev)
{
int port;
struct sk_buff *skb;
struct wl_private *lp = wl_priv(dev);
int status;
hcf_16 pktlen;
hcf_16 hfs_stat;
DESC_STRCT *desc;
/*------------------------------------------------------------------------*/
DBG_FUNC("wl_rx")
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
if(!( lp->flags & WVLAN2_UIL_BUSY )) {
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_PRINT( "RTS: We're getting an Rx...\n" );
return -EIO;
}
#endif /* USE_RTS */
/* Read the HFS_STAT register from the lookahead buffer */
hfs_stat = (hcf_16)(( lp->lookAheadBuf[HFS_STAT] ) |
( lp->lookAheadBuf[HFS_STAT + 1] << 8 ));
/* Make sure the frame isn't bad */
if(( hfs_stat & HFS_STAT_ERR ) != HCF_SUCCESS ) {
DBG_WARNING( DbgInfo, "HFS_STAT_ERROR (0x%x) in Rx Packet\n",
lp->lookAheadBuf[HFS_STAT] );
return -EIO;
}
/* Determine what port this packet is for */
port = ( hfs_stat >> 8 ) & 0x0007;
DBG_RX( DbgInfo, "Rx frame for port %d\n", port );
if(( pktlen = lp->hcfCtx.IFB_RxLen ) != 0 ) {
if(( skb = ALLOC_SKB( pktlen )) != NULL ) {
/* Set the netdev based on the port */
switch( port ) {
#ifdef USE_WDS
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
skb->dev = lp->wds_port[port-1].dev;
break;
#endif /* USE_WDS */
case 0:
default:
skb->dev = dev;
break;
}
desc = &( lp->desc_rx );
desc->next_desc_addr = NULL;
/*
#define BLOCK_INPUT(buf, len) \
desc->buf_addr = buf; \
desc->BUF_SIZE = len; \
status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
*/
GET_PACKET( skb->dev, skb, pktlen );
if( status == HCF_SUCCESS ) {
netif_rx( skb );
if( port == 0 ) {
lp->stats.rx_packets++;
lp->stats.rx_bytes += pktlen;
}
#ifdef USE_WDS
else
{
lp->wds_port[port-1].stats.rx_packets++;
lp->wds_port[port-1].stats.rx_bytes += pktlen;
}
#endif /* USE_WDS */
dev->last_rx = jiffies;
#ifdef WIRELESS_EXT
#ifdef WIRELESS_SPY
if( lp->spydata.spy_number > 0 ) {
char *srcaddr = skb->mac.raw + MAC_ADDR_SIZE;
wl_spy_gather( dev, srcaddr );
}
#endif /* WIRELESS_SPY */
#endif /* WIRELESS_EXT */
} else {
DBG_ERROR( DbgInfo, "Rx request to card FAILED\n" );
if( port == 0 ) {
lp->stats.rx_dropped++;
}
#ifdef USE_WDS
else
{
lp->wds_port[port-1].stats.rx_dropped++;
}
#endif /* USE_WDS */
dev_kfree_skb( skb );
}
} else {
DBG_ERROR( DbgInfo, "Could not alloc skb\n" );
if( port == 0 ) {
lp->stats.rx_dropped++;
}
#ifdef USE_WDS
else
{
lp->wds_port[port-1].stats.rx_dropped++;
}
#endif /* USE_WDS */
}
}
}
return 0;
} // wl_rx
/*============================================================================*/
/*******************************************************************************
* wl_multicast()
*******************************************************************************
*
* DESCRIPTION:
*
* Function to handle multicast packets
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
#ifdef NEW_MULTICAST
void wl_multicast( struct net_device *dev )
{
#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA //;?should we return an error status in AP mode
//;?seems reasonable that even an AP-only driver could afford this small additional footprint
int x;
struct dev_mc_list *mclist;
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_multicast" );
DBG_ENTER( DbgInfo );
DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
if( !wl_adapter_is_open( dev )) {
DBG_LEAVE( DbgInfo );
return;
}
#if DBG
if( DBG_FLAGS( DbgInfo ) & DBG_PARAM_ON ) {
DBG_PRINT(" flags: %s%s%s\n",
( dev->flags & IFF_PROMISC ) ? "Promiscous " : "",
( dev->flags & IFF_MULTICAST ) ? "Multicast " : "",
( dev->flags & IFF_ALLMULTI ) ? "All-Multicast" : "" );
DBG_PRINT( " mc_count: %d\n", dev->mc_count );
for( x = 0, mclist = dev->mc_list; mclist && x < dev->mc_count;
x++, mclist = mclist->next ) {
DBG_PRINT( " %s (%d)\n", DbgHwAddr(mclist->dmi_addr),
mclist->dmi_addrlen );
}
}
#endif /* DBG */
if(!( lp->flags & WVLAN2_UIL_BUSY )) {
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_TRACE( DbgInfo, "Skipping multicast, in RTS mode\n" );
DBG_LEAVE( DbgInfo );
return;
}
#endif /* USE_RTS */
wl_lock( lp, &flags );
wl_act_int_off( lp );
if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
if( dev->flags & IFF_PROMISC ) {
/* Enable promiscuous mode */
lp->ltvRecord.len = 2;
lp->ltvRecord.typ = CFG_PROMISCUOUS_MODE;
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 1 );
DBG_PRINT( "Enabling Promiscuous mode (IFF_PROMISC)\n" );
hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
}
else if(( dev->mc_count > HCF_MAX_MULTICAST ) ||
( dev->flags & IFF_ALLMULTI )) {
/* Shutting off this filter will enable all multicast frames to
be sent up from the device; however, this is a static RID, so
a call to wl_apply() is needed */
lp->ltvRecord.len = 2;
lp->ltvRecord.typ = CFG_CNF_RX_ALL_GROUP_ADDR;
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
DBG_PRINT( "Enabling all multicast mode (IFF_ALLMULTI)\n" );
hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
wl_apply( lp );
}
else if( dev->mc_count != 0 ) {
/* Set the multicast addresses */
lp->ltvRecord.len = ( dev->mc_count * 3 ) + 1;
lp->ltvRecord.typ = CFG_GROUP_ADDR;
for( x = 0, mclist = dev->mc_list;
( x < dev->mc_count ) && ( mclist != NULL );
x++, mclist = mclist->next ) {
memcpy( &( lp->ltvRecord.u.u8[x * ETH_ALEN] ),
mclist->dmi_addr, ETH_ALEN );
}
DBG_PRINT( "Setting multicast list\n" );
hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
} else {
/* Disable promiscuous mode */
lp->ltvRecord.len = 2;
lp->ltvRecord.typ = CFG_PROMISCUOUS_MODE;
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
DBG_PRINT( "Disabling Promiscuous mode\n" );
hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
/* Disable multicast mode */
lp->ltvRecord.len = 2;
lp->ltvRecord.typ = CFG_GROUP_ADDR;
DBG_PRINT( "Disabling Multicast mode\n" );
hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
/* Turning on this filter will prevent all multicast frames from
being sent up from the device; however, this is a static RID,
so a call to wl_apply() is needed */
lp->ltvRecord.len = 2;
lp->ltvRecord.typ = CFG_CNF_RX_ALL_GROUP_ADDR;
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 1 );
DBG_PRINT( "Disabling all multicast mode (IFF_ALLMULTI)\n" );
hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
wl_apply( lp );
}
}
wl_act_int_on( lp );
wl_unlock( lp, &flags );
}
DBG_LEAVE( DbgInfo );
#endif /* HCF_STA */
} // wl_multicast
/*============================================================================*/
#else /* NEW_MULTICAST */
void wl_multicast( struct net_device *dev, int num_addrs, void *addrs )
{
DBG_FUNC( "wl_multicast");
DBG_ENTER(DbgInfo);
DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
DBG_PARAM( DbgInfo, "num_addrs", "%d", num_addrs );
DBG_PARAM( DbgInfo, "addrs", "0x%p", addrs );
#error Obsolete set multicast interface!
DBG_LEAVE( DbgInfo );
} // wl_multicast
/*============================================================================*/
#endif /* NEW_MULTICAST */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
static const struct net_device_ops wl_netdev_ops =
{
.ndo_start_xmit = &wl_tx_port0,
.ndo_set_config = &wl_config,
.ndo_get_stats = &wl_stats,
.ndo_set_multicast_list = &wl_multicast,
.ndo_init = &wl_insert,
.ndo_open = &wl_adapter_open,
.ndo_stop = &wl_adapter_close,
.ndo_do_ioctl = &wl_ioctl,
#ifdef HAVE_TX_TIMEOUT
.ndo_tx_timeout = &wl_tx_timeout,
#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = wl_poll,
#endif
};
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
/*******************************************************************************
* wl_device_alloc()
*******************************************************************************
*
* DESCRIPTION:
*
* Create instances of net_device and wl_private for the new adapter
* and register the device's entry points in the net_device structure.
*
* PARAMETERS:
*
* N/A
*
* RETURNS:
*
* a pointer to an allocated and initialized net_device struct for this
* device.
*
******************************************************************************/
struct net_device * wl_device_alloc( void )
{
struct net_device *dev = NULL;
struct wl_private *lp = NULL;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_device_alloc" );
DBG_ENTER( DbgInfo );
/* Alloc a net_device struct */
dev = alloc_etherdev(sizeof(struct wl_private));
if (!dev)
return NULL;
/* Initialize the 'next' pointer in the struct. Currently only used for PCI,
but do it here just in case it's used for other buses in the future */
lp = wl_priv(dev);
/* Check MTU */
if( dev->mtu > MTU_MAX )
{
DBG_WARNING( DbgInfo, "%s: MTU set too high, limiting to %d.\n",
dev->name, MTU_MAX );
dev->mtu = MTU_MAX;
}
/* Setup the function table in the device structure. */
dev->wireless_handlers = (struct iw_handler_def *)&wl_iw_handler_def;
lp->wireless_data.spy_data = &lp->spy_data;
dev->wireless_data = &lp->wireless_data;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
dev->netdev_ops = &wl_netdev_ops;
#else
dev->hard_start_xmit = &wl_tx_port0;
dev->set_config = &wl_config;
dev->get_stats = &wl_stats;
dev->set_multicast_list = &wl_multicast;
dev->init = &wl_insert;
dev->open = &wl_adapter_open;
dev->stop = &wl_adapter_close;
dev->do_ioctl = &wl_ioctl;
#ifdef HAVE_TX_TIMEOUT
dev->tx_timeout = &wl_tx_timeout;
#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = wl_poll;
#endif
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
#ifdef HAVE_TX_TIMEOUT
dev->watchdog_timeo = TX_TIMEOUT;
#endif
dev->ethtool_ops = &wl_ethtool_ops;
netif_stop_queue( dev );
/* Allocate virutal devices for WDS support if needed */
WL_WDS_DEVICE_ALLOC( lp );
DBG_LEAVE( DbgInfo );
return dev;
} // wl_device_alloc
/*============================================================================*/
/*******************************************************************************
* wl_device_dealloc()
*******************************************************************************
*
* DESCRIPTION:
*
* Free instances of net_device and wl_private strcutres for an adapter
* and perform basic cleanup.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_device_dealloc( struct net_device *dev )
{
// struct wl_private *lp = wl_priv(dev);
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_device_dealloc" );
DBG_ENTER( DbgInfo );
/* Dealloc the WDS ports */
WL_WDS_DEVICE_DEALLOC( lp );
free_netdev( dev );
DBG_LEAVE( DbgInfo );
return;
} // wl_device_dealloc
/*============================================================================*/
/*******************************************************************************
* wl_tx_port0()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_0.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_0.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port0( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 0\n" );
return wl_tx( skb, dev, HCF_PORT_0 );
#ifdef ENABLE_DMA
return wl_tx_dma( skb, dev, HCF_PORT_0 );
#endif
} // wl_tx_port0
/*============================================================================*/
#ifdef USE_WDS
/*******************************************************************************
* wl_tx_port1()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_1.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_1.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port1( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 1\n" );
return wl_tx( skb, dev, HCF_PORT_1 );
} // wl_tx_port1
/*============================================================================*/
/*******************************************************************************
* wl_tx_port2()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_2.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_2.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port2( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 2\n" );
return wl_tx( skb, dev, HCF_PORT_2 );
} // wl_tx_port2
/*============================================================================*/
/*******************************************************************************
* wl_tx_port3()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_3.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_3.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port3( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 3\n" );
return wl_tx( skb, dev, HCF_PORT_3 );
} // wl_tx_port3
/*============================================================================*/
/*******************************************************************************
* wl_tx_port4()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_4.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_4.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port4( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 4\n" );
return wl_tx( skb, dev, HCF_PORT_4 );
} // wl_tx_port4
/*============================================================================*/
/*******************************************************************************
* wl_tx_port5()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_5.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_5.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port5( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 5\n" );
return wl_tx( skb, dev, HCF_PORT_5 );
} // wl_tx_port5
/*============================================================================*/
/*******************************************************************************
* wl_tx_port6()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler routine for Tx over HCF_PORT_6.
*
* PARAMETERS:
*
* skb - a pointer to the sk_buff to transmit.
* dev - a pointer to a net_device structure representing HCF_PORT_6.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
int wl_tx_port6( struct sk_buff *skb, struct net_device *dev )
{
DBG_TX( DbgInfo, "Tx on Port 6\n" );
return wl_tx( skb, dev, HCF_PORT_6 );
} // wl_tx_port6
/*============================================================================*/
/*******************************************************************************
* wl_wds_device_alloc()
*******************************************************************************
*
* DESCRIPTION:
*
* Create instances of net_device to represent the WDS ports, and register
* the device's entry points in the net_device structure.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A, but will place pointers to the allocated and initialized net_device
* structs in the private adapter structure.
*
******************************************************************************/
void wl_wds_device_alloc( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_wds_device_alloc" );
DBG_ENTER( DbgInfo );
/* WDS support requires additional net_device structs to be allocated,
so that user space apps can use these virtual devices to specify the
port on which to Tx/Rx */
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
struct net_device *dev_wds = NULL;
dev_wds = kmalloc( sizeof( struct net_device ), GFP_KERNEL );
memset( dev_wds, 0, sizeof( struct net_device ));
ether_setup( dev_wds );
lp->wds_port[count].dev = dev_wds;
/* Re-use wl_init for all the devices, as it currently does nothing, but
is required. Re-use the stats/tx_timeout handler for all as well; the
WDS port which is requesting these operations can be determined by
the net_device pointer. Set the private member of all devices to point
to the same net_device struct; that way, all information gets
funnelled through the one "real" net_device. Name the WDS ports
"wds<n>" */
lp->wds_port[count].dev->init = &wl_init;
lp->wds_port[count].dev->get_stats = &wl_stats;
lp->wds_port[count].dev->tx_timeout = &wl_tx_timeout;
lp->wds_port[count].dev->watchdog_timeo = TX_TIMEOUT;
lp->wds_port[count].dev->priv = lp;
sprintf( lp->wds_port[count].dev->name, "wds%d", count );
}
/* Register the Tx handlers */
lp->wds_port[0].dev->hard_start_xmit = &wl_tx_port1;
lp->wds_port[1].dev->hard_start_xmit = &wl_tx_port2;
lp->wds_port[2].dev->hard_start_xmit = &wl_tx_port3;
lp->wds_port[3].dev->hard_start_xmit = &wl_tx_port4;
lp->wds_port[4].dev->hard_start_xmit = &wl_tx_port5;
lp->wds_port[5].dev->hard_start_xmit = &wl_tx_port6;
WL_WDS_NETIF_STOP_QUEUE( lp );
DBG_LEAVE( DbgInfo );
return;
} // wl_wds_device_alloc
/*============================================================================*/
/*******************************************************************************
* wl_wds_device_dealloc()
*******************************************************************************
*
* DESCRIPTION:
*
* Free instances of net_device structures used to support WDS.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_wds_device_dealloc( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_wds_device_dealloc" );
DBG_ENTER( DbgInfo );
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
struct net_device *dev_wds = NULL;
dev_wds = lp->wds_port[count].dev;
if( dev_wds != NULL ) {
if( dev_wds->flags & IFF_UP ) {
dev_close( dev_wds );
dev_wds->flags &= ~( IFF_UP | IFF_RUNNING );
}
kfree( dev_wds );
lp->wds_port[count].dev = NULL;
}
}
DBG_LEAVE( DbgInfo );
return;
} // wl_wds_device_dealloc
/*============================================================================*/
/*******************************************************************************
* wl_wds_netif_start_queue()
*******************************************************************************
*
* DESCRIPTION:
*
* Used to start the netif queues of all the "virtual" network devices
* which repesent the WDS ports.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_wds_netif_start_queue( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
if( lp != NULL ) {
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( lp->wds_port[count].is_registered &&
lp->wds_port[count].netif_queue_on == FALSE ) {
netif_start_queue( lp->wds_port[count].dev );
lp->wds_port[count].netif_queue_on = TRUE;
}
}
}
return;
} // wl_wds_netif_start_queue
/*============================================================================*/
/*******************************************************************************
* wl_wds_netif_stop_queue()
*******************************************************************************
*
* DESCRIPTION:
*
* Used to stop the netif queues of all the "virtual" network devices
* which repesent the WDS ports.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_wds_netif_stop_queue( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
if( lp != NULL ) {
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( lp->wds_port[count].is_registered &&
lp->wds_port[count].netif_queue_on == TRUE ) {
netif_stop_queue( lp->wds_port[count].dev );
lp->wds_port[count].netif_queue_on = FALSE;
}
}
}
return;
} // wl_wds_netif_stop_queue
/*============================================================================*/
/*******************************************************************************
* wl_wds_netif_wake_queue()
*******************************************************************************
*
* DESCRIPTION:
*
* Used to wake the netif queues of all the "virtual" network devices
* which repesent the WDS ports.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_wds_netif_wake_queue( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
if( lp != NULL ) {
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( lp->wds_port[count].is_registered &&
lp->wds_port[count].netif_queue_on == FALSE ) {
netif_wake_queue( lp->wds_port[count].dev );
lp->wds_port[count].netif_queue_on = TRUE;
}
}
}
return;
} // wl_wds_netif_wake_queue
/*============================================================================*/
/*******************************************************************************
* wl_wds_netif_carrier_on()
*******************************************************************************
*
* DESCRIPTION:
*
* Used to signal the network layer that carrier is present on all of the
* "virtual" network devices which repesent the WDS ports.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_wds_netif_carrier_on( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
if( lp != NULL ) {
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( lp->wds_port[count].is_registered ) {
netif_carrier_on( lp->wds_port[count].dev );
}
}
}
return;
} // wl_wds_netif_carrier_on
/*============================================================================*/
/*******************************************************************************
* wl_wds_netif_carrier_off()
*******************************************************************************
*
* DESCRIPTION:
*
* Used to signal the network layer that carrier is NOT present on all of
* the "virtual" network devices which repesent the WDS ports.
*
* PARAMETERS:
*
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_wds_netif_carrier_off( struct wl_private *lp )
{
int count;
/*------------------------------------------------------------------------*/
if( lp != NULL ) {
for( count = 0; count < NUM_WDS_PORTS; count++ ) {
if( lp->wds_port[count].is_registered ) {
netif_carrier_off( lp->wds_port[count].dev );
}
}
}
return;
} // wl_wds_netif_carrier_off
/*============================================================================*/
#endif /* USE_WDS */
#ifdef ENABLE_DMA
/*******************************************************************************
* wl_send_dma()
*******************************************************************************
*
* DESCRIPTION:
*
* The routine which performs data transmits when using busmaster DMA.
*
* PARAMETERS:
*
* lp - a pointer to the device's wl_private struct.
* skb - a pointer to the network layer's data buffer.
* port - the Hermes port on which to transmit.
*
* RETURNS:
*
* 0 on success
* 1 on error
*
******************************************************************************/
int wl_send_dma( struct wl_private *lp, struct sk_buff *skb, int port )
{
int len;
DESC_STRCT *desc = NULL;
DESC_STRCT *desc_next = NULL;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_send_dma" );
if( lp == NULL )
{
DBG_ERROR( DbgInfo, "Private adapter struct is NULL\n" );
return FALSE;
}
if( lp->dev == NULL )
{
DBG_ERROR( DbgInfo, "net_device struct in wl_private is NULL\n" );
return FALSE;
}
/* AGAIN, ALL THE QUEUEING DONE HERE IN I/O MODE IS NOT PERFORMED */
if( skb == NULL )
{
DBG_WARNING (DbgInfo, "Nothing to send.\n");
return FALSE;
}
len = skb->len;
/* Get a free descriptor */
desc = wl_pci_dma_get_tx_packet( lp );
if( desc == NULL )
{
if( lp->netif_queue_on == TRUE ) {
netif_stop_queue( lp->dev );
WL_WDS_NETIF_STOP_QUEUE( lp );
lp->netif_queue_on = FALSE;
dev_kfree_skb( skb );
return 0;
}
}
SET_BUF_CNT( desc, /*HCF_DMA_FD_CNT*/HFS_ADDR_DEST );
SET_BUF_SIZE( desc, HCF_DMA_TX_BUF1_SIZE );
desc_next = desc->next_desc_addr;
if( desc_next->buf_addr == NULL )
{
DBG_ERROR( DbgInfo, "DMA descriptor buf_addr is NULL\n" );
return FALSE;
}
/* Copy the payload into the DMA packet */
memcpy( desc_next->buf_addr, skb->data, len );
SET_BUF_CNT( desc_next, len );
SET_BUF_SIZE( desc_next, HCF_MAX_PACKET_SIZE );
hcf_dma_tx_put( &( lp->hcfCtx ), desc, 0 );
/* Free the skb and perform queue cleanup, as the buffer was
transmitted successfully */
dev_kfree_skb( skb );
return TRUE;
} // wl_send_dma
/*============================================================================*/
/*******************************************************************************
* wl_rx_dma()
*******************************************************************************
*
* DESCRIPTION:
*
* The routine which performs data reception when using busmaster DMA.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure.
*
* RETURNS:
*
* 0 on success
* 1 on error
*
******************************************************************************/
int wl_rx_dma( struct net_device *dev )
{
int port;
hcf_16 pktlen;
hcf_16 hfs_stat;
struct sk_buff *skb;
struct wl_private *lp = NULL;
DESC_STRCT *desc, *desc_next;
//CFG_MB_INFO_RANGE2_STRCT x;
/*------------------------------------------------------------------------*/
DBG_FUNC("wl_rx")
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
if((( lp = (struct wl_private *)dev->priv ) != NULL ) &&
!( lp->flags & WVLAN2_UIL_BUSY )) {
#ifdef USE_RTS
if( lp->useRTS == 1 ) {
DBG_PRINT( "RTS: We're getting an Rx...\n" );
return -EIO;
}
#endif /* USE_RTS */
//if( lp->dma.status == 0 )
//{
desc = hcf_dma_rx_get( &( lp->hcfCtx ));
if( desc != NULL )
{
/* Check and see if we rcvd. a WMP frame */
/*
if((( *(hcf_8 *)&desc->buf_addr[HFS_STAT] ) &
( HFS_STAT_MSG_TYPE | HFS_STAT_ERR )) == HFS_STAT_WMP_MSG )
{
DBG_TRACE( DbgInfo, "Got a WMP frame\n" );
x.len = sizeof( CFG_MB_INFO_RANGE2_STRCT ) / sizeof( hcf_16 );
x.typ = CFG_MB_INFO;
x.base_typ = CFG_WMP;
x.frag_cnt = 2;
x.frag_buf[0].frag_len = GET_BUF_CNT( descp ) / sizeof( hcf_16 );
x.frag_buf[0].frag_addr = (hcf_8 *) descp->buf_addr ;
x.frag_buf[1].frag_len = ( GET_BUF_CNT( descp->next_desc_addr ) + 1 ) / sizeof( hcf_16 );
x.frag_buf[1].frag_addr = (hcf_8 *) descp->next_desc_addr->buf_addr ;
hcf_put_info( &( lp->hcfCtx ), (LTVP)&x );
}
*/
desc_next = desc->next_desc_addr;
/* Make sure the buffer isn't empty */
if( GET_BUF_CNT( desc ) == 0 ) {
DBG_WARNING( DbgInfo, "Buffer is empty!\n" );
/* Give the descriptor back to the HCF */
hcf_dma_rx_put( &( lp->hcfCtx ), desc );
return -EIO;
}
/* Read the HFS_STAT register from the lookahead buffer */
hfs_stat = (hcf_16)( desc->buf_addr[HFS_STAT/2] );
/* Make sure the frame isn't bad */
if(( hfs_stat & HFS_STAT_ERR ) != HCF_SUCCESS )
{
DBG_WARNING( DbgInfo, "HFS_STAT_ERROR (0x%x) in Rx Packet\n",
desc->buf_addr[HFS_STAT/2] );
/* Give the descriptor back to the HCF */
hcf_dma_rx_put( &( lp->hcfCtx ), desc );
return -EIO;
}
/* Determine what port this packet is for */
port = ( hfs_stat >> 8 ) & 0x0007;
DBG_RX( DbgInfo, "Rx frame for port %d\n", port );
if(( pktlen = GET_BUF_CNT( desc_next )) != 0 ) {
if(( skb = ALLOC_SKB( pktlen )) != NULL ) {
switch( port ) {
#ifdef USE_WDS
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
skb->dev = lp->wds_port[port-1].dev;
break;
#endif /* USE_WDS */
case 0:
default:
skb->dev = dev;
break;
}
GET_PACKET_DMA( skb->dev, skb, pktlen );
/* Give the descriptor back to the HCF */
hcf_dma_rx_put( &( lp->hcfCtx ), desc );
netif_rx( skb );
if( port == 0 ) {
lp->stats.rx_packets++;
lp->stats.rx_bytes += pktlen;
}
#ifdef USE_WDS
else
{
lp->wds_port[port-1].stats.rx_packets++;
lp->wds_port[port-1].stats.rx_bytes += pktlen;
}
#endif /* USE_WDS */
dev->last_rx = jiffies;
} else {
DBG_ERROR( DbgInfo, "Could not alloc skb\n" );
if( port == 0 )
{
lp->stats.rx_dropped++;
}
#ifdef USE_WDS
else
{
lp->wds_port[port-1].stats.rx_dropped++;
}
#endif /* USE_WDS */
}
}
}
//}
}
return 0;
} // wl_rx_dma
/*============================================================================*/
#endif // ENABLE_DMA
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_netdev.h,v $
*
******************************************************************************/
#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__
/*******************************************************************************
* 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 PCI/miniPCI
* devices.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/06 11:25:37 $
* $Revision: 1.7 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_pci.c,v $
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <wireless/wl_version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <linux/slab.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 <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <hcf/debug.h>
#include <hcf.h>
#include <dhf.h>
#include <hcfdef.h>
#include <wireless/wl_if.h>
#include <wireless/wl_internal.h>
#include <wireless/wl_util.h>
#include <wireless/wl_main.h>
#include <wireless/wl_netdev.h>
#include <wireless/wl_pci.h>
/*******************************************************************************
* global variables
******************************************************************************/
#if DBG
extern dbg_info_t *DbgInfo;
#endif // DBG
/* define the PCI device Table Cardname and id tables */
enum hermes_pci_versions {
CH_Agere_Systems_Mini_PCI_V1 = 0,
};
static struct pci_device_id wl_pci_tbl[] __devinitdata = {
{ WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 },
{ WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 },
{ WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(pci, wl_pci_tbl);
/*******************************************************************************
* function prototypes
******************************************************************************/
int __devinit wl_pci_probe( struct pci_dev *pdev,
const struct pci_device_id *ent );
void __devexit wl_pci_remove(struct pci_dev *pdev);
int wl_pci_setup( struct pci_dev *pdev );
void wl_pci_enable_cardbus_interrupts( struct pci_dev *pdev );
#ifdef ENABLE_DMA
int wl_pci_dma_alloc( struct pci_dev *pdev, struct wl_private *lp );
int wl_pci_dma_free( struct pci_dev *pdev, struct wl_private *lp );
int wl_pci_dma_alloc_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_free_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_alloc_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_free_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_alloc_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc, int size );
int wl_pci_dma_free_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_alloc_desc( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_free_desc( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc );
int wl_pci_dma_alloc_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT *desc, int size );
int wl_pci_dma_free_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT *desc );
void wl_pci_dma_hcf_reclaim_rx( struct wl_private *lp );
#endif // ENABLE_DMA
/*******************************************************************************
* PCI module function registration
******************************************************************************/
static struct pci_driver wl_driver =
{
name: MODULE_NAME,
id_table: wl_pci_tbl,
probe: wl_pci_probe,
remove: __devexit_p(wl_pci_remove),
suspend: NULL,
resume: NULL,
};
/*******************************************************************************
* wl_adapter_init_module()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by init_module() to perform PCI-specific driver initialization.
*
* PARAMETERS:
*
* N/A
*
* RETURNS:
*
* 0
*
******************************************************************************/
int wl_adapter_init_module( void )
{
int result;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_init_module()" );
DBG_ENTER( DbgInfo );
DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCI\n" );
result = pci_register_driver( &wl_driver ); //;?replace with pci_module_init, Rubini pg 490
//;? why not do something with the result
DBG_LEAVE( DbgInfo );
return 0;
} // wl_adapter_init_module
/*============================================================================*/
/*******************************************************************************
* wl_adapter_cleanup_module()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by cleanup_module() to perform PCI-specific driver cleanup.
*
* PARAMETERS:
*
* N/A
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_adapter_cleanup_module( void )
{
//;?how comes wl_adapter_cleanup_module is located in a seemingly pci specific module
DBG_FUNC( "wl_adapter_cleanup_module" );
DBG_ENTER( DbgInfo );
//;?DBG_TRACE below feels like nearly redundant in the light of DBG_ENTER above
DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCI\n" );
pci_unregister_driver( &wl_driver );
DBG_LEAVE( DbgInfo );
return;
} // wl_adapter_cleanup_module
/*============================================================================*/
/*******************************************************************************
* wl_adapter_insert()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by wl_pci_probe() to continue the process of device insertion.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* TRUE or FALSE
*
******************************************************************************/
int wl_adapter_insert( struct net_device *dev )
{
int result = FALSE;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_insert" );
DBG_ENTER( DbgInfo );
DBG_TRACE( DbgInfo, "wl_adapter_insert() -- PCI\n" );
if( dev == NULL ) {
DBG_ERROR( DbgInfo, "net_device pointer is NULL!!!\n" );
} else if( dev->priv == NULL ) {
DBG_ERROR( DbgInfo, "wl_private pointer is NULL!!!\n" );
} else if( wl_insert( dev ) ) { /* Perform remaining device initialization */
result = TRUE;
} else {
DBG_TRACE( DbgInfo, "wl_insert() FAILED\n" );
}
DBG_LEAVE( DbgInfo );
return result;
} // wl_adapter_insert
/*============================================================================*/
/*******************************************************************************
* wl_adapter_open()
*******************************************************************************
*
* DESCRIPTION:
*
* Open the device.
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* an HCF status code
*
******************************************************************************/
int wl_adapter_open( struct net_device *dev )
{
int result = 0;
int hcf_status = HCF_SUCCESS;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_open" );
DBG_ENTER( DbgInfo );
DBG_TRACE( DbgInfo, "wl_adapter_open() -- PCI\n" );
hcf_status = wl_open( dev );
if( hcf_status != HCF_SUCCESS ) {
result = -ENODEV;
}
DBG_LEAVE( DbgInfo );
return result;
} // wl_adapter_open
/*============================================================================*/
/*******************************************************************************
* wl_adapter_close()
*******************************************************************************
*
* DESCRIPTION:
*
* Close the device
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* 0
*
******************************************************************************/
int wl_adapter_close( struct net_device *dev )
{
DBG_FUNC( "wl_adapter_close" );
DBG_ENTER( DbgInfo );
DBG_TRACE( DbgInfo, "wl_adapter_close() -- PCI\n" );
DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name );
wl_close( dev );
DBG_LEAVE( DbgInfo );
return 0;
} // wl_adapter_close
/*============================================================================*/
/*******************************************************************************
* wl_adapter_is_open()
*******************************************************************************
*
* DESCRIPTION:
*
* Check whether this device is open. Returns
*
* PARAMETERS:
*
* dev - a pointer to the device's net_device structure
*
* RETURNS:
*
* nonzero if device is open.
*
******************************************************************************/
int wl_adapter_is_open( struct net_device *dev )
{
/* This function is used in PCMCIA to check the status of the 'open' field
in the dev_link_t structure associated with a network device. There
doesn't seem to be an analog to this for PCI, and checking the status
contained in the net_device structure doesn't have the same effect.
For now, return TRUE, but find out if this is necessary for PCI. */
return TRUE;
} // wl_adapter_is_open
/*============================================================================*/
/*******************************************************************************
* wl_pci_probe()
*******************************************************************************
*
* DESCRIPTION:
*
* Registered in the pci_driver structure, this function is called when the
* PCI subsystem finds a new PCI device which matches the infomation contained
* in the pci_device_id table.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* ent - this device's entry in the pci_device_id table
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int __devinit wl_pci_probe( struct pci_dev *pdev,
const struct pci_device_id *ent )
{
int result;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_probe" );
DBG_ENTER( DbgInfo );
DBG_PRINT( "%s\n", VERSION_INFO );
result = wl_pci_setup( pdev );
DBG_LEAVE( DbgInfo );
return result;
} // wl_pci_probe
/*============================================================================*/
/*******************************************************************************
* wl_pci_remove()
*******************************************************************************
*
* DESCRIPTION:
*
* Registered in the pci_driver structure, this function is called when the
* PCI subsystem detects that a PCI device which matches the infomation
* contained in the pci_device_id table has been removed.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void __devexit wl_pci_remove(struct pci_dev *pdev)
{
struct net_device *dev = NULL;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_remove" );
DBG_ENTER( DbgInfo );
/* Make sure the pci_dev pointer passed in is valid */
if( pdev == NULL ) {
DBG_ERROR( DbgInfo, "PCI subsys passed in an invalid pci_dev pointer\n" );
return;
}
dev = (struct net_device *)pci_get_drvdata( pdev );
if( dev == NULL ) {
DBG_ERROR( DbgInfo, "Could not retrieve net_device structure\n" );
return;
}
/* Perform device cleanup */
wl_remove( dev );
free_irq( dev->irq, dev );
#ifdef ENABLE_DMA
wl_pci_dma_free( pdev, (struct wl_private *)dev->priv );
#endif
wl_device_dealloc( dev );
DBG_LEAVE( DbgInfo );
return;
} // wl_pci_remove
/*============================================================================*/
/*******************************************************************************
* wl_pci_setup()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by wl_pci_probe() to begin a device's initialization process.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_setup( struct pci_dev *pdev )
{
int result = 0;
struct net_device *dev = NULL;
struct wl_private *lp = NULL;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_setup" );
DBG_ENTER( DbgInfo );
/* Make sure the pci_dev pointer passed in is valid */
if( pdev == NULL ) {
DBG_ERROR( DbgInfo, "PCI subsys passed in an invalid pci_dev pointer\n" );
return -ENODEV;
}
result = pci_enable_device( pdev );
if( result != 0 ) {
DBG_ERROR( DbgInfo, "pci_enable_device() failed\n" );
DBG_LEAVE( DbgInfo );
return result;
}
/* We found our device! Let's register it with the system */
DBG_TRACE( DbgInfo, "Found our device, now registering\n" );
dev = wl_device_alloc( );
if( dev == NULL ) {
DBG_ERROR( DbgInfo, "Could not register device!!!\n" );
DBG_LEAVE( DbgInfo );
return -ENOMEM;
}
/* Make sure that space was allocated for our private adapter struct */
if( dev->priv == NULL ) {
DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" );
DBG_LEAVE( DbgInfo );
return -ENOMEM;
}
#ifdef ENABLE_DMA
/* Allocate DMA Descriptors */
if( wl_pci_dma_alloc( pdev, (struct wl_private *)dev->priv ) < 0 ) {
DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" );
DBG_LEAVE( DbgInfo );
return -ENOMEM;
}
#endif
/* Register our private adapter structure with PCI */
pci_set_drvdata( pdev, dev );
/* Fill out bus specific information in the net_device struct */
dev->irq = pdev->irq;
SET_MODULE_OWNER( dev );
DBG_TRACE( DbgInfo, "Device Base Address: %#03lx\n", pdev->resource[0].start );
dev->base_addr = pdev->resource[0].start;
/* Initialize our device here */
if( !wl_adapter_insert( dev )) {
DBG_ERROR( DbgInfo, "wl_adapter_insert() FAILED!!!\n" );
wl_device_dealloc( dev );
DBG_LEAVE( DbgInfo );
return -EINVAL;
}
/* Register our ISR */
DBG_TRACE( DbgInfo, "Registering ISR...\n" );
result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev);
if( result ) {
DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" );
DBG_LEAVE( DbgInfo );
return result;
}
/* Make sure interrupts are enabled properly for CardBus */
lp = (struct wl_private *)dev->priv;
if( lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_CARDBUS ||
lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_PCI ) {
DBG_TRACE( DbgInfo, "This is a PCI/CardBus card, enable interrupts\n" );
wl_pci_enable_cardbus_interrupts( pdev );
}
/* Enable bus mastering */
pci_set_master( pdev );
DBG_LEAVE( DbgInfo );
return 0;
} // wl_pci_setup
/*============================================================================*/
/*******************************************************************************
* wl_pci_enable_cardbus_interrupts()
*******************************************************************************
*
* DESCRIPTION:
*
* Called by wl_pci_setup() to enable interrupts on a CardBus device. This
* is done by writing bit 15 to the function event mask register. This
* CardBus-specific register is located in BAR2 (counting from BAR0), in memory
* space at byte offset 1f4 (7f4 for WARP).
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_pci_enable_cardbus_interrupts( struct pci_dev *pdev )
{
u32 bar2_reg;
u32 mem_addr_bus;
u32 func_evt_mask_reg;
void *mem_addr_kern = NULL;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_enable_cardbus_interrupts" );
DBG_ENTER( DbgInfo );
/* Initialize to known bad values */
bar2_reg = 0xdeadbeef;
mem_addr_bus = 0xdeadbeef;
/* Read the BAR2 register; this register contains the base address of the
memory region where the function event mask register lives */
pci_read_config_dword( pdev, PCI_BASE_ADDRESS_2, &bar2_reg );
mem_addr_bus = bar2_reg & PCI_BASE_ADDRESS_MEM_MASK;
/* Once the base address is obtained, remap the memory region to kernel
space so we can retrieve the register */
mem_addr_kern = ioremap( mem_addr_bus, 0x200 );
#ifdef HERMES25
#define REG_OFFSET 0x07F4
#else
#define REG_OFFSET 0x01F4
#endif // HERMES25
#define BIT15 0x8000
/* Retrieve the functional event mask register, enable interrupts by
setting Bit 15, and write back the value */
func_evt_mask_reg = *(u32 *)( mem_addr_kern + REG_OFFSET );
func_evt_mask_reg |= BIT15;
*(u32 *)( mem_addr_kern + REG_OFFSET ) = func_evt_mask_reg;
/* Once complete, unmap the region and exit */
iounmap( mem_addr_kern );
DBG_LEAVE( DbgInfo );
return;
} // wl_pci_enable_cardbus_interrupts
/*============================================================================*/
#ifdef ENABLE_DMA
/*******************************************************************************
* wl_pci_dma_alloc()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates all resources needed for PCI/CardBus DMA operation
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_alloc( struct pci_dev *pdev, struct wl_private *lp )
{
int i;
int status = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_dma_alloc" );
DBG_ENTER( DbgInfo );
// lp->dma.tx_rsc_ind = lp->dma.rx_rsc_ind = 0;
//
// /* Alloc for the Tx chain and its reclaim descriptor */
// for( i = 0; i < NUM_TX_DESC; i++ ) {
// status = wl_pci_dma_alloc_tx_packet( pdev, lp, &lp->dma.tx_packet[i] );
// if( status == 0 ) {
// DBG_PRINT( "lp->dma.tx_packet[%d] : 0x%p\n", i, lp->dma.tx_packet[i] );
// DBG_PRINT( "lp->dma.tx_packet[%d]->next_desc_addr : 0x%p\n", i, lp->dma.tx_packet[i]->next_desc_addr );
// lp->dma.tx_rsc_ind++;
// } else {
// DBG_ERROR( DbgInfo, "Could not alloc DMA Tx Packet\n" );
// break;
// }
// }
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc( pdev, lp, &lp->dma.tx_reclaim_desc );
// DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc );
// }
// /* Alloc for the Rx chain and its reclaim descriptor */
// if( status == 0 ) {
// for( i = 0; i < NUM_RX_DESC; i++ ) {
// status = wl_pci_dma_alloc_rx_packet( pdev, lp, &lp->dma.rx_packet[i] );
// if( status == 0 ) {
// DBG_PRINT( "lp->dma.rx_packet[%d] : 0x%p\n", i, lp->dma.rx_packet[i] );
// DBG_PRINT( "lp->dma.rx_packet[%d]->next_desc_addr : 0x%p\n", i, lp->dma.rx_packet[i]->next_desc_addr );
// lp->dma.rx_rsc_ind++;
// } else {
// DBG_ERROR( DbgInfo, "Could not alloc DMA Rx Packet\n" );
// break;
// }
// }
// }
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc( pdev, lp, &lp->dma.rx_reclaim_desc );
// DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc );
// }
// /* Store status, as host should not call HCF functions if this fails */
// lp->dma.status = status; //;?all useages of dma.status have been commented out
// DBG_LEAVE( DbgInfo );
return status;
} // wl_pci_dma_alloc
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_free()
*******************************************************************************
*
* DESCRIPTION:
*
* Deallocated all resources needed for PCI/CardBus DMA operation
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_free( struct pci_dev *pdev, struct wl_private *lp )
{
int i;
int status = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_dma_free" );
DBG_ENTER( DbgInfo );
/* Reclaim all Rx packets that were handed over to the HCF */
/* Do I need to do this? Before this free is called, I've already disabled
the port which will call wl_pci_dma_hcf_reclaim */
//if( lp->dma.status == 0 )
//{
// wl_pci_dma_hcf_reclaim( lp );
//}
/* Free everything needed for DMA Rx */
for( i = 0; i < NUM_RX_DESC; i++ ) {
if( lp->dma.rx_packet[i] ) {
status = wl_pci_dma_free_rx_packet( pdev, lp, &lp->dma.rx_packet[i] );
if( status != 0 ) {
DBG_WARNING( DbgInfo, "Problem freeing Rx packet\n" );
}
}
}
lp->dma.rx_rsc_ind = 0;
if( lp->dma.rx_reclaim_desc ) {
status = wl_pci_dma_free_desc( pdev, lp, &lp->dma.rx_reclaim_desc );
if( status != 0 ) {
DBG_WARNING( DbgInfo, "Problem freeing Rx reclaim descriptor\n" );
}
}
/* Free everything needed for DMA Tx */
for( i = 0; i < NUM_TX_DESC; i++ ) {
if( lp->dma.tx_packet[i] ) {
status = wl_pci_dma_free_tx_packet( pdev, lp, &lp->dma.tx_packet[i] );
if( status != 0 ) {
DBG_WARNING( DbgInfo, "Problem freeing Tx packet\n" );
}
}
}
lp->dma.tx_rsc_ind = 0;
if( lp->dma.tx_reclaim_desc ) {
status = wl_pci_dma_free_desc( pdev, lp, &lp->dma.tx_reclaim_desc );
if( status != 0 ) {
DBG_WARNING( DbgInfo, "Problem freeing Tx reclaim descriptor\n" );
}
}
DBG_LEAVE( DbgInfo );
return status;
} // wl_pci_dma_free
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_alloc_tx_packet()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates a single Tx packet, consisting of several descriptors and
* buffers. Data to transmit is first copied into the 'payload' buffer
* before being transmitted.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
* desc - a pointer which will reference the descriptor to be alloc'd.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_alloc_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
// int status = 0;
// /*------------------------------------------------------------------------*/
//
// if( desc == NULL ) {
// status = -EFAULT;
// }
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc_and_buf( pdev, lp, desc,
// HCF_DMA_TX_BUF1_SIZE );
//
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc_and_buf( pdev, lp,
// &( (*desc)->next_desc_addr ),
// HCF_MAX_PACKET_SIZE );
// }
// }
// if( status == 0 ) {
// (*desc)->next_desc_phys_addr = (*desc)->next_desc_addr->desc_phys_addr;
// }
// return status;
} // wl_pci_dma_alloc_tx_packet
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_free_tx_packet()
*******************************************************************************
*
* DESCRIPTION:
*
* Frees a single Tx packet, described in the corresponding alloc function.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
* desc - a pointer which will reference the descriptor to be alloc'd.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_free_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
int status = 0;
/*------------------------------------------------------------------------*/
if( *desc == NULL ) {
DBG_PRINT( "Null descriptor\n" );
status = -EFAULT;
}
//;?the "limited" NDIS strategy, assuming a frame consists ALWAYS out of 2
//descriptors, make this robust
if( status == 0 && (*desc)->next_desc_addr ) {
status = wl_pci_dma_free_desc_and_buf( pdev, lp, &(*desc)->next_desc_addr );
}
if( status == 0 ) {
status = wl_pci_dma_free_desc_and_buf( pdev, lp, desc );
}
return status;
} // wl_pci_dma_free_tx_packet
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_alloc_rx_packet()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates a single Rx packet, consisting of two descriptors and one
* contiguous buffer. THe buffer starts with the hermes-specific header.
* One descriptor points at the start, the other at offset 0x3a of the
* buffer.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
* desc - a pointer which will reference the descriptor to be alloc'd.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_alloc_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
int status = 0;
DESC_STRCT *p;
/*------------------------------------------------------------------------*/
// if( desc == NULL ) {
// status = -EFAULT;
// }
// //;?the "limited" NDIS strategy, assuming a frame consists ALWAYS out of 2
// //descriptors, make this robust
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc( pdev, lp, desc );
// }
// if( status == 0 ) {
// status = wl_pci_dma_alloc_buf( pdev, lp, *desc, HCF_MAX_PACKET_SIZE );
// }
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc( pdev, lp, &p );
// }
// if( status == 0 ) {
// /* Size of 1st descriptor becomes 0x3a bytes */
// SET_BUF_SIZE( *desc, HCF_DMA_RX_BUF1_SIZE );
//
// /* Make 2nd descriptor point at offset 0x3a of the buffer */
// SET_BUF_SIZE( p, ( HCF_MAX_PACKET_SIZE - HCF_DMA_RX_BUF1_SIZE ));
// p->buf_addr = (*desc)->buf_addr + HCF_DMA_RX_BUF1_SIZE;
// p->buf_phys_addr = (*desc)->buf_phys_addr + HCF_DMA_RX_BUF1_SIZE;
// p->next_desc_addr = NULL;
//
// /* Chain 2nd descriptor to 1st descriptor */
// (*desc)->next_desc_addr = p;
// (*desc)->next_desc_phys_addr = p->desc_phys_addr;
// }
return status;
} // wl_pci_dma_alloc_rx_packet
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_free_rx_packet()
*******************************************************************************
*
* DESCRIPTION:
*
* Frees a single Rx packet, described in the corresponding alloc function.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
* desc - a pointer which will reference the descriptor to be alloc'd.
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_free_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
int status = 0;
DESC_STRCT *p;
/*------------------------------------------------------------------------*/
if( *desc == NULL ) {
status = -EFAULT;
}
if( status == 0 ) {
p = (*desc)->next_desc_addr;
/* Free the 2nd descriptor */
if( p != NULL ) {
p->buf_addr = NULL;
p->buf_phys_addr = 0;
status = wl_pci_dma_free_desc( pdev, lp, &p );
}
}
/* Free the buffer and 1st descriptor */
if( status == 0 ) {
SET_BUF_SIZE( *desc, HCF_MAX_PACKET_SIZE );
status = wl_pci_dma_free_desc_and_buf( pdev, lp, desc );
}
return status;
} // wl_pci_dma_free_rx_packet
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_alloc_desc_and_buf()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates a DMA descriptor and buffer, and associates them with one
* another.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
* desc - a pointer which will reference the descriptor to be alloc'd
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_alloc_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc, int size )
{
int status = 0;
/*------------------------------------------------------------------------*/
// if( desc == NULL ) {
// status = -EFAULT;
// }
// if( status == 0 ) {
// status = wl_pci_dma_alloc_desc( pdev, lp, desc );
//
// if( status == 0 ) {
// status = wl_pci_dma_alloc_buf( pdev, lp, *desc, size );
// }
// }
return status;
} // wl_pci_dma_alloc_desc_and_buf
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_free_desc_and_buf()
*******************************************************************************
*
* DESCRIPTION:
*
* Frees a DMA descriptor and associated buffer.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
* desc - a pointer which will reference the descriptor to be alloc'd
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_free_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
int status = 0;
/*------------------------------------------------------------------------*/
if( desc == NULL ) {
status = -EFAULT;
}
if( status == 0 && *desc == NULL ) {
status = -EFAULT;
}
if( status == 0 ) {
status = wl_pci_dma_free_buf( pdev, lp, *desc );
if( status == 0 ) {
status = wl_pci_dma_free_desc( pdev, lp, desc );
}
}
return status;
} // wl_pci_dma_free_desc_and_buf
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_alloc_desc()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates one DMA descriptor in cache coherent memory.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_alloc_desc( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
// int status = 0;
// dma_addr_t pa;
// /*------------------------------------------------------------------------*/
//
// DBG_FUNC( "wl_pci_dma_alloc_desc" );
// DBG_ENTER( DbgInfo );
//
// if( desc == NULL ) {
// status = -EFAULT;
// }
// if( status == 0 ) {
// *desc = pci_alloc_consistent( pdev, sizeof( DESC_STRCT ), &pa );
// }
// if( *desc == NULL ) {
// DBG_ERROR( DbgInfo, "pci_alloc_consistent() failed\n" );
// status = -ENOMEM;
// } else {
// memset( *desc, 0, sizeof( DESC_STRCT ));
// (*desc)->desc_phys_addr = cpu_to_le32( pa );
// }
// DBG_LEAVE( DbgInfo );
// return status;
} // wl_pci_dma_alloc_desc
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_free_desc()
*******************************************************************************
*
* DESCRIPTION:
*
* Frees one DMA descriptor in cache coherent memory.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_free_desc( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT **desc )
{
int status = 0;
/*------------------------------------------------------------------------*/
if( *desc == NULL ) {
status = -EFAULT;
}
if( status == 0 ) {
pci_free_consistent( pdev, sizeof( DESC_STRCT ), *desc,
(*desc)->desc_phys_addr );
}
*desc = NULL;
return status;
} // wl_pci_dma_free_desc
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_alloc_buf()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates one DMA buffer in cache coherent memory, and associates a DMA
* descriptor with this buffer.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_alloc_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT *desc, int size )
{
int status = 0;
dma_addr_t pa;
/*------------------------------------------------------------------------*/
// DBG_FUNC( "wl_pci_dma_alloc_buf" );
// DBG_ENTER( DbgInfo );
//
// if( desc == NULL ) {
// status = -EFAULT;
// }
// if( status == 0 && desc->buf_addr != NULL ) {
// status = -EFAULT;
// }
// if( status == 0 ) {
// desc->buf_addr = pci_alloc_consistent( pdev, size, &pa );
// }
// if( desc->buf_addr == NULL ) {
// DBG_ERROR( DbgInfo, "pci_alloc_consistent() failed\n" );
// status = -ENOMEM;
// } else {
// desc->buf_phys_addr = cpu_to_le32( pa );
// SET_BUF_SIZE( desc, size );
// }
// DBG_LEAVE( DbgInfo );
return status;
} // wl_pci_dma_alloc_buf
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_free_buf()
*******************************************************************************
*
* DESCRIPTION:
*
* Allocates one DMA buffer in cache coherent memory, and associates a DMA
* descriptor with this buffer.
*
* PARAMETERS:
*
* pdev - a pointer to the device's pci_dev structure
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wl_pci_dma_free_buf( struct pci_dev *pdev, struct wl_private *lp,
DESC_STRCT *desc )
{
int status = 0;
/*------------------------------------------------------------------------*/
if( desc == NULL ) {
status = -EFAULT;
}
if( status == 0 && desc->buf_addr == NULL ) {
status = -EFAULT;
}
if( status == 0 ) {
pci_free_consistent( pdev, GET_BUF_SIZE( desc ), desc->buf_addr,
desc->buf_phys_addr );
desc->buf_addr = 0;
desc->buf_phys_addr = 0;
SET_BUF_SIZE( desc, 0 );
}
return status;
} // wl_pci_dma_free_buf
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_hcf_supply()
*******************************************************************************
*
* DESCRIPTION:
*
* Supply HCF with DMA-related resources. These consist of:
* - buffers and descriptors for receive purposes
* - one 'reclaim' descriptor for the transmit path, used to fulfill a
* certain H25 DMA engine requirement
* - one 'reclaim' descriptor for the receive path, used to fulfill a
* certain H25 DMA engine requirement
*
* This function is called at start-of-day or at re-initialization.
*
* PARAMETERS:
*
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
void wl_pci_dma_hcf_supply( struct wl_private *lp )
{
int i;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_dma_hcf_supply" );
DBG_ENTER( DbgInfo );
//if( lp->dma.status == 0 );
//{
/* Hand over the Rx/Tx reclaim descriptors to the HCF */
if( lp->dma.tx_reclaim_desc ) {
DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc );
hcf_dma_tx_put( &lp->hcfCtx, lp->dma.tx_reclaim_desc, 0 );
lp->dma.tx_reclaim_desc = NULL;
DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc );
}
if( lp->dma.rx_reclaim_desc ) {
DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc );
hcf_dma_rx_put( &lp->hcfCtx, lp->dma.rx_reclaim_desc );
lp->dma.rx_reclaim_desc = NULL;
DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc );
}
/* Hand over the Rx descriptor chain to the HCF */
for( i = 0; i < NUM_RX_DESC; i++ ) {
DBG_PRINT( "lp->dma.rx_packet[%d]: 0x%p\n", i, lp->dma.rx_packet[i] );
hcf_dma_rx_put( &lp->hcfCtx, lp->dma.rx_packet[i] );
lp->dma.rx_packet[i] = NULL;
DBG_PRINT( "lp->dma.rx_packet[%d]: 0x%p\n", i, lp->dma.rx_packet[i] );
}
//}
DBG_LEAVE( DbgInfo );
return;
} // wl_pci_dma_hcf_supply
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_hcf_reclaim()
*******************************************************************************
*
* DESCRIPTION:
*
* Return DMA-related resources from the HCF. These consist of:
* - buffers and descriptors for receive purposes
* - buffers and descriptors for transmit purposes
* - one 'reclaim' descriptor for the transmit path, used to fulfill a
* certain H25 DMA engine requirement
* - one 'reclaim' descriptor for the receive path, used to fulfill a
* certain H25 DMA engine requirement
*
* This function is called at end-of-day or at re-initialization.
*
* PARAMETERS:
*
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
void wl_pci_dma_hcf_reclaim( struct wl_private *lp )
{
int i;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_dma_hcf_reclaim" );
DBG_ENTER( DbgInfo );
wl_pci_dma_hcf_reclaim_rx( lp );
for( i = 0; i < NUM_RX_DESC; i++ ) {
DBG_PRINT( "rx_packet[%d] 0x%p\n", i, lp->dma.rx_packet[i] );
// if( lp->dma.rx_packet[i] == NULL ) {
// DBG_PRINT( "wl_pci_dma_hcf_reclaim: rx_packet[%d] NULL\n", i );
// }
}
wl_pci_dma_hcf_reclaim_tx( lp );
for( i = 0; i < NUM_TX_DESC; i++ ) {
DBG_PRINT( "tx_packet[%d] 0x%p\n", i, lp->dma.tx_packet[i] );
// if( lp->dma.tx_packet[i] == NULL ) {
// DBG_PRINT( "wl_pci_dma_hcf_reclaim: tx_packet[%d] NULL\n", i );
// }
}
DBG_LEAVE( DbgInfo );
return;
} // wl_pci_dma_hcf_reclaim
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_hcf_reclaim_rx()
*******************************************************************************
*
* DESCRIPTION:
*
* Reclaim Rx packets that have already been processed by the HCF.
*
* PARAMETERS:
*
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
void wl_pci_dma_hcf_reclaim_rx( struct wl_private *lp )
{
int i;
DESC_STRCT *p;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_dma_hcf_reclaim_rx" );
DBG_ENTER( DbgInfo );
//if( lp->dma.status == 0 )
//{
while ( ( p = hcf_dma_rx_get( &lp->hcfCtx ) ) != NULL ) {
if( p && p->buf_addr == NULL ) {
/* A reclaim descriptor is being given back by the HCF. Reclaim
descriptors have a NULL buf_addr */
lp->dma.rx_reclaim_desc = p;
DBG_PRINT( "reclaim_descriptor: 0x%p\n", p );
continue;
}
for( i = 0; i < NUM_RX_DESC; i++ ) {
if( lp->dma.rx_packet[i] == NULL ) {
break;
}
}
/* An Rx buffer descriptor is being given back by the HCF */
lp->dma.rx_packet[i] = p;
lp->dma.rx_rsc_ind++;
DBG_PRINT( "rx_packet[%d] 0x%p\n", i, lp->dma.rx_packet[i] );
}
//}
DBG_LEAVE( DbgInfo );
} // wl_pci_dma_hcf_reclaim_rx
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_get_tx_packet()
*******************************************************************************
*
* DESCRIPTION:
*
* Obtains a Tx descriptor from the chain to use for Tx.
*
* PARAMETERS:
*
* lp - a pointer to the device's wl_private structure.
*
* RETURNS:
*
* A pointer to the retrieved descriptor
*
******************************************************************************/
DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp )
{
int i;
DESC_STRCT *desc = NULL;
/*------------------------------------------------------------------------*/
for( i = 0; i < NUM_TX_DESC; i++ ) {
if( lp->dma.tx_packet[i] ) {
break;
}
}
if( i != NUM_TX_DESC ) {
desc = lp->dma.tx_packet[i];
lp->dma.tx_packet[i] = NULL;
lp->dma.tx_rsc_ind--;
memset( desc->buf_addr, 0, HCF_DMA_TX_BUF1_SIZE );
}
return desc;
} // wl_pci_dma_get_tx_packet
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_put_tx_packet()
*******************************************************************************
*
* DESCRIPTION:
*
* Returns a Tx descriptor to the chain.
*
* PARAMETERS:
*
* lp - a pointer to the device's wl_private structure.
* desc - a pointer to the descriptor to return.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc )
{
int i;
/*------------------------------------------------------------------------*/
for( i = 0; i < NUM_TX_DESC; i++ ) {
if( lp->dma.tx_packet[i] == NULL ) {
break;
}
}
if( i != NUM_TX_DESC ) {
lp->dma.tx_packet[i] = desc;
lp->dma.tx_rsc_ind++;
}
} // wl_pci_dma_put_tx_packet
/*============================================================================*/
/*******************************************************************************
* wl_pci_dma_hcf_reclaim_tx()
*******************************************************************************
*
* DESCRIPTION:
*
* Reclaim Tx packets that have either been processed by the HCF due to a
* port disable or a Tx completion.
*
* PARAMETERS:
*
* lp - the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp )
{
int i;
DESC_STRCT *p;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_pci_dma_hcf_reclaim_tx" );
DBG_ENTER( DbgInfo );
//if( lp->dma.status == 0 )
//{
while ( ( p = hcf_dma_tx_get( &lp->hcfCtx ) ) != NULL ) {
if( p != NULL && p->buf_addr == NULL ) {
/* A Reclaim descriptor is being given back by the HCF. Reclaim
descriptors have a NULL buf_addr */
lp->dma.tx_reclaim_desc = p;
DBG_PRINT( "reclaim_descriptor: 0x%p\n", p );
continue;
}
for( i = 0; i < NUM_TX_DESC; i++ ) {
if( lp->dma.tx_packet[i] == NULL ) {
break;
}
}
/* An Rx buffer descriptor is being given back by the HCF */
lp->dma.tx_packet[i] = p;
lp->dma.tx_rsc_ind++;
DBG_PRINT( "tx_packet[%d] 0x%p\n", i, lp->dma.tx_packet[i] );
}
//}
if( lp->netif_queue_on == FALSE ) {
netif_wake_queue( lp->dev );
WL_WDS_NETIF_WAKE_QUEUE( lp );
lp->netif_queue_on = TRUE;
}
DBG_LEAVE( DbgInfo );
return;
} // wl_pci_dma_hcf_reclaim_tx
/*============================================================================*/
#endif // ENABLE_DMA
/*******************************************************************************
* 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 PCI.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_pci.h,v $
*
******************************************************************************/
#ifndef __WL_PCI_H__
#define __WL_PCI_H__
/*******************************************************************************
* constant definitions
******************************************************************************/
#define WL_LKM_PCI_VENDOR_ID 0x11C1 // Lucent Microelectronics
#define WL_LKM_PCI_DEVICE_ID_0 0xAB30 // Mini PCI
#define WL_LKM_PCI_DEVICE_ID_1 0xAB34 // Mini PCI
#define WL_LKM_PCI_DEVICE_ID_2 0xAB11 // WARP CardBus
/*******************************************************************************
* function prototypes
******************************************************************************/
int wl_adapter_init_module( void );
void wl_adapter_cleanup_module( void );
int wl_adapter_insert( struct net_device *dev );
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 );
#ifdef ENABLE_DMA
void wl_pci_dma_hcf_supply( struct wl_private *lp );
void wl_pci_dma_hcf_reclaim( struct wl_private *lp );
DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp );
void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc );
void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp );
#endif // ENABLE_DMA
#endif // __WL_PCI_H__
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* This file defines handling routines for the private IOCTLs
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/03 11:39:39 $
* $Revision: 1.5 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_priv.c,v $
*
******************************************************************************/
/*******************************************************************************
* include files
******************************************************************************/
#include <wl_version.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <debug.h>
#include <hcf.h>
#include <hcfdef.h>
#include <wl_if.h>
#include <wl_internal.h>
#include <wl_enc.h>
#include <wl_main.h>
#include <wl_priv.h>
#include <wl_util.h>
#include <wl_netdev.h>
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 );
/*******************************************************************************
* global variables
******************************************************************************/
#if DBG
extern dbg_info_t *DbgInfo;
#endif // DBG
/* If USE_UIL is not defined, then none of the UIL Interface code below will
be included in the build */
#ifdef USE_UIL
/*******************************************************************************
* wvlan_uil()
*******************************************************************************
*
* DESCRIPTION:
*
* The handler function for the UIL interface.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_uil( struct uilreq *urq, struct wl_private *lp )
{
int ioctl_ret = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil" );
DBG_ENTER( DbgInfo );
switch( urq->command ) {
case UIL_FUN_CONNECT:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_CONNECT\n");
ioctl_ret = wvlan_uil_connect( urq, lp );
break;
case UIL_FUN_DISCONNECT:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_DISCONNECT\n");
ioctl_ret = wvlan_uil_disconnect( urq, lp );
break;
case UIL_FUN_ACTION:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_ACTION\n" );
ioctl_ret = wvlan_uil_action( urq, lp );
break;
case UIL_FUN_SEND_DIAG_MSG:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_SEND_DIAG_MSG\n");
ioctl_ret = wvlan_uil_send_diag_msg( urq, lp );
break;
case UIL_FUN_GET_INFO:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_GET_INFO\n");
ioctl_ret = wvlan_uil_get_info( urq, lp );
break;
case UIL_FUN_PUT_INFO:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_PUT_INFO\n");
ioctl_ret = wvlan_uil_put_info( urq, lp );
break;
default:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- UNSUPPORTED UIL CODE: 0x%X", urq->command );
ioctl_ret = -EOPNOTSUPP;
break;
}
DBG_LEAVE( DbgInfo );
return ioctl_ret;
} // wvlan_uil
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_connect()
*******************************************************************************
*
* DESCRIPTION:
*
* Connect to the UIL in order to make a request.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_connect( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_connect" );
DBG_ENTER( DbgInfo );
if( !( lp->flags & WVLAN2_UIL_CONNECTED )) {
lp->flags |= WVLAN2_UIL_CONNECTED;
urq->hcfCtx = &( lp->hcfCtx );
urq->result = UIL_SUCCESS;
} else {
DBG_WARNING( DbgInfo, "UIL_ERR_IN_USE\n" );
urq->result = UIL_ERR_IN_USE;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_connect
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_disconnect()
*******************************************************************************
*
* DESCRIPTION:
*
* Disonnect from the UIL after a request has been completed.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_disconnect( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_disconnect" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
if (lp->flags & WVLAN2_UIL_CONNECTED) {
lp->flags &= ~WVLAN2_UIL_CONNECTED;
/*
if (lp->flags & WVLAN2_UIL_BUSY) {
lp->flags &= ~WVLAN2_UIL_BUSY;
netif_start_queue(lp->dev);
}
*/
}
urq->hcfCtx = NULL;
urq->result = UIL_SUCCESS;
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_disconnect
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_action()
*******************************************************************************
*
* DESCRIPTION:
*
* Handler for the UIL_ACT_xxx subcodes associated with UIL_FUN_ACTION
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_action( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
ltv_t *ltv;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_action" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
/* Make sure there's an LTV in the request buffer */
ltv = (ltv_t *)urq->data;
if( ltv != NULL ) {
/* Switch on the Type field of the LTV contained in the request
buffer */
switch( ltv->typ ) {
case UIL_ACT_BLOCK:
DBG_TRACE( DbgInfo, "UIL_ACT_BLOCK\n" );
result = wvlan_uil_block( urq, lp );
break;
case UIL_ACT_UNBLOCK:
DBG_TRACE( DbgInfo, "UIL_ACT_UNBLOCK\n" );
result = wvlan_uil_unblock( urq, lp );
break;
case UIL_ACT_SCAN:
DBG_TRACE( DbgInfo, "UIL_ACT_SCAN\n" );
urq->result = hcf_action( &( lp->hcfCtx ), MDD_ACT_SCAN );
break;
case UIL_ACT_APPLY:
DBG_TRACE( DbgInfo, "UIL_ACT_APPLY\n" );
urq->result = wl_apply( lp );
break;
case UIL_ACT_RESET:
DBG_TRACE( DbgInfo, "UIL_ACT_RESET\n" );
urq->result = wl_go( lp );
break;
default:
DBG_WARNING( DbgInfo, "Unknown action code: 0x%x\n", ltv->typ );
break;
}
} else {
DBG_ERROR( DbgInfo, "Bad LTV for this action\n" );
urq->result = UIL_ERR_LEN;
}
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_action
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_block()
*******************************************************************************
*
* DESCRIPTION:
*
* Sets a block in the driver to prevent access to the card by other
* processes.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_block( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_block" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
if( capable( CAP_NET_ADMIN )) {
lp->flags |= WVLAN2_UIL_BUSY;
netif_stop_queue(lp->dev);
WL_WDS_NETIF_STOP_QUEUE( lp );
urq->result = UIL_SUCCESS;
} else {
DBG_ERROR( DbgInfo, "EPERM\n" );
urq->result = UIL_FAILURE;
result = -EPERM;
}
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_block
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_unblock()
*******************************************************************************
*
* DESCRIPTION:
*
* Unblocks the driver to restore access to the card by other processes.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_unblock( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_unblock" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
if( capable( CAP_NET_ADMIN )) {
if (lp->flags & WVLAN2_UIL_BUSY) {
lp->flags &= ~WVLAN2_UIL_BUSY;
netif_wake_queue(lp->dev);
WL_WDS_NETIF_WAKE_QUEUE( lp );
}
} else {
DBG_ERROR( DbgInfo, "EPERM\n" );
urq->result = UIL_FAILURE;
result = -EPERM;
}
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_unblock
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_send_diag_msg()
*******************************************************************************
*
* DESCRIPTION:
*
* Sends a diagnostic message to the card.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
DESC_STRCT Descp[1];
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_send_diag_msg" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
if( capable( CAP_NET_ADMIN )) {
if ((urq->data != NULL) && (urq->len != 0)) {
if (lp->hcfCtx.IFB_RscInd != 0) {
u_char *data;
// Verify the user buffer
result = verify_area(VERIFY_READ, urq->data, urq->len);
if (result != 0) {
DBG_ERROR( DbgInfo, "verify_area failed, result: %d\n", result );
urq->result = UIL_FAILURE;
DBG_LEAVE( DbgInfo );
return result;
}
if ((data = kmalloc(urq->len, GFP_KERNEL)) != NULL) {
memset( Descp, 0, sizeof( DESC_STRCT ));
memcpy( data, urq->data, urq->len );
Descp[0].buf_addr = (wci_bufp)data;
Descp[0].BUF_CNT = urq->len;
Descp[0].next_desc_addr = 0; // terminate list
hcf_send_msg( &(lp->hcfCtx), &Descp[0], HCF_PORT_0 );
kfree( data );
} else {
DBG_ERROR( DbgInfo, "ENOMEM\n" );
urq->result = UIL_FAILURE;
result = -ENOMEM;
DBG_LEAVE( DbgInfo );
return result;
}
} else {
urq->result = UIL_ERR_BUSY;
}
} else {
urq->result = UIL_FAILURE;
}
} else {
DBG_ERROR( DbgInfo, "EPERM\n" );
urq->result = UIL_FAILURE;
result = -EPERM;
}
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_send_diag_msg
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_put_info()
*******************************************************************************
*
* DESCRIPTION:
*
* Sends a specific RID directly to the driver to set configuration info.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
ltv_t *pLtv;
bool_t ltvAllocated = FALSE;
ENCSTRCT sEncryption;
#ifdef USE_WDS
hcf_16 hcfPort = HCF_PORT_0;
#endif /* USE_WDS */
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_put_info" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
if( capable( CAP_NET_ADMIN )) {
if(( urq->data != NULL ) && ( urq->len != 0 )) {
/* Make sure that we have at least a command and length to send. */
if( urq->len < ( sizeof( hcf_16 ) * 2 )) {
urq->len = sizeof( lp->ltvRecord );
urq->result = UIL_ERR_LEN;
DBG_ERROR( DbgInfo, "No Length/Type in LTV!!!\n" );
DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
DBG_LEAVE( DbgInfo );
return result;
}
/* Verify the user buffer */
result = verify_area( VERIFY_READ, urq->data, urq->len );
if( result != 0 ) {
urq->result = UIL_FAILURE;
DBG_ERROR( DbgInfo, "verify_area(), VERIFY_READ FAILED\n" );
DBG_LEAVE( DbgInfo );
return result;
}
/* Get only the command and length information. */
copy_from_user( &( lp->ltvRecord ), urq->data, sizeof( hcf_16 ) * 2 );
/* Make sure the incoming LTV record length is within the bounds of the
IOCTL length */
if((( lp->ltvRecord.len + 1 ) * sizeof( hcf_16 )) > urq->len ) {
urq->len = sizeof( lp->ltvRecord );
urq->result = UIL_ERR_LEN;
DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
DBG_LEAVE( DbgInfo );
return result;
}
/* If the requested length is greater than the size of our local
LTV record, try to allocate it from the kernel stack.
Otherwise, we just use our local LTV record. */
if( urq->len > sizeof( lp->ltvRecord )) {
if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) {
ltvAllocated = TRUE;
} else {
DBG_ERROR( DbgInfo, "Alloc FAILED\n" );
urq->len = sizeof( lp->ltvRecord );
urq->result = UIL_ERR_LEN;
result = -ENOMEM;
DBG_LEAVE( DbgInfo );
return result;
}
} else {
pLtv = &( lp->ltvRecord );
}
/* Copy the data from the user's buffer into the local LTV
record data area. */
copy_from_user( pLtv, urq->data, urq->len );
/* We need to snoop the commands to see if there is anything we
need to store for the purposes of a reset or start/stop
sequence. Perform endian translation as needed */
switch( pLtv->typ ) {
case CFG_CNF_PORT_TYPE:
lp->PortType = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_OWN_MAC_ADDR:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_CNF_OWN_CHANNEL:
lp->Channel = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
/* CFG_CNF_OWN_SSID currently same as CNF_DESIRED_SSID. Do we
need seperate storage for this? */
//case CFG_CNF_OWN_SSID:
case CFG_CNF_OWN_ATIM_WINDOW:
lp->atimWindow = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_SYSTEM_SCALE:
lp->DistanceBetweenAPs = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
case CFG_CNF_MAX_DATA_LEN:
/* TODO: determine if we are going to store anything based
on this */
break;
case CFG_CNF_PM_ENABLED:
lp->PMEnabled = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_MCAST_RX:
lp->MulticastReceive = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_MAX_SLEEP_DURATION:
lp->MaxSleepDuration = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_HOLDOVER_DURATION:
lp->holdoverDuration = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_OWN_NAME:
memset( lp->StationName, 0, sizeof( lp->StationName ));
memcpy( (void *)lp->StationName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_LOAD_BALANCING:
lp->loadBalancing = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_MEDIUM_DISTRIBUTION:
lp->mediumDistribution = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#ifdef WARP
case CFG_CNF_TX_POW_LVL:
lp->txPowLevel = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
//case CFG_CNF_SHORT_RETRY_LIMIT: // Short Retry Limit
//case 0xFC33: // Long Retry Limit
case CFG_SUPPORTED_RATE_SET_CNTL: // Supported Rate Set Control
lp->srsc[0] = pLtv->u.u16[0];
lp->srsc[1] = pLtv->u.u16[1];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
pLtv->u.u16[1] = CNV_INT_TO_LITTLE( pLtv->u.u16[1] );
break;
case CFG_BASIC_RATE_SET_CNTL: // Basic Rate Set Control
lp->brsc[0] = pLtv->u.u16[0];
lp->brsc[1] = pLtv->u.u16[1];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
pLtv->u.u16[1] = CNV_INT_TO_LITTLE( pLtv->u.u16[1] );
break;
case CFG_CNF_CONNECTION_CNTL:
lp->connectionControl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
//case CFG_PROBE_DATA_RATE:
#endif // HERMES25
#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
//;?should we restore this to allow smaller memory footprint
case CFG_CNF_OWN_DTIM_PERIOD:
lp->DTIMPeriod = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#ifdef WARP
case CFG_CNF_OWN_BEACON_INTERVAL: // Own Beacon Interval
lp->ownBeaconInterval = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#endif // WARP
case CFG_COEXISTENSE_BEHAVIOUR: // Coexistence behavior
lp->coexistence = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#ifdef USE_WDS
case CFG_CNF_WDS_ADDR1:
memcpy( &lp->wds_port[0].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
hcfPort = HCF_PORT_1;
break;
case CFG_CNF_WDS_ADDR2:
memcpy( &lp->wds_port[1].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
hcfPort = HCF_PORT_2;
break;
case CFG_CNF_WDS_ADDR3:
memcpy( &lp->wds_port[2].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
hcfPort = HCF_PORT_3;
break;
case CFG_CNF_WDS_ADDR4:
memcpy( &lp->wds_port[3].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
hcfPort = HCF_PORT_4;
break;
case CFG_CNF_WDS_ADDR5:
memcpy( &lp->wds_port[4].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
hcfPort = HCF_PORT_5;
break;
case CFG_CNF_WDS_ADDR6:
memcpy( &lp->wds_port[5].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
hcfPort = HCF_PORT_6;
break;
#endif /* USE_WDS */
case CFG_CNF_MCAST_PM_BUF:
lp->multicastPMBuffering = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_REJECT_ANY:
lp->RejectAny = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#endif
case CFG_CNF_ENCRYPTION:
lp->EnableEncryption = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_CNF_AUTHENTICATION:
lp->authentication = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
//;?should we restore this to allow smaller memory footprint
//case CFG_CNF_EXCL_UNENCRYPTED:
//lp->ExcludeUnencrypted = pLtv->u.u16[0];
//pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
//break;
case CFG_CNF_MCAST_RATE:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_CNF_INTRA_BSS_RELAY:
lp->intraBSSRelay = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#endif
case CFG_CNF_MICRO_WAVE:
/* TODO: determine if we are going to store anything based on this */
break;
//case CFG_CNF_LOAD_BALANCING:
/* TODO: determine if we are going to store anything based on this */
//break;
//case CFG_CNF_MEDIUM_DISTRIBUTION:
/* TODO: determine if we are going to store anything based on this */
//break;
//case CFG_CNF_RX_ALL_GROUP_ADDRESS:
// TODO: determine if we are going to store anything based on this
//break;
//case CFG_CNF_COUNTRY_INFO:
/* TODO: determine if we are going to store anything based on this */
//break;
case CFG_CNF_OWN_SSID:
//case CNF_DESIRED_SSID:
case CFG_DESIRED_SSID:
memset( lp->NetworkName, 0, sizeof( lp->NetworkName ));
memcpy( (void *)lp->NetworkName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0] );
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
/* take care of the special network name "ANY" case */
if(( strlen( &pLtv->u.u8[2] ) == 0 ) ||
( strcmp( &pLtv->u.u8[2], "ANY" ) == 0 ) ||
( strcmp( &pLtv->u.u8[2], "any" ) == 0 )) {
/* set the SSID_STRCT llen field (u16[0]) to zero, and the
effectually null the string u8[2] */
pLtv->u.u16[0] = 0;
pLtv->u.u8[2] = 0;
}
break;
case CFG_GROUP_ADDR:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_CREATE_IBSS:
lp->CreateIBSS = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_RTS_THRH:
lp->RTSThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_TX_RATE_CNTL:
lp->TxRateControl[0] = pLtv->u.u16[0];
lp->TxRateControl[1] = pLtv->u.u16[1];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
pLtv->u.u16[1] = CNV_INT_TO_LITTLE( pLtv->u.u16[1] );
break;
case CFG_PROMISCUOUS_MODE:
/* TODO: determine if we are going to store anything based on this */
break;
//case CFG_WAKE_ON_LAN:
/* TODO: determine if we are going to store anything based on this */
//break;
#if 1 //;? #if (HCF_TYPE) & HCF_TYPE_AP
//;?should we restore this to allow smaller memory footprint
case CFG_RTS_THRH0:
lp->RTSThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_TX_RATE_CNTL0:
//;?no idea what this should be, get going so comment it out lp->TxRateControl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
#ifdef USE_WDS
case CFG_RTS_THRH1:
lp->wds_port[0].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_1;
break;
case CFG_RTS_THRH2:
lp->wds_port[1].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_2;
break;
case CFG_RTS_THRH3:
lp->wds_port[2].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_3;
break;
case CFG_RTS_THRH4:
lp->wds_port[3].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_4;
break;
case CFG_RTS_THRH5:
lp->wds_port[4].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_5;
break;
case CFG_RTS_THRH6:
lp->wds_port[5].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_6;
break;
case CFG_TX_RATE_CNTL1:
lp->wds_port[0].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_1;
break;
case CFG_TX_RATE_CNTL2:
lp->wds_port[1].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_2;
break;
case CFG_TX_RATE_CNTL3:
lp->wds_port[2].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_3;
break;
case CFG_TX_RATE_CNTL4:
lp->wds_port[3].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_4;
break;
case CFG_TX_RATE_CNTL5:
lp->wds_port[4].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_5;
break;
case CFG_TX_RATE_CNTL6:
lp->wds_port[5].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
hcfPort = HCF_PORT_6;
break;
#endif /* USE_WDS */
#endif /* (HCF_TYPE) & HCF_TYPE_AP */
case CFG_DEFAULT_KEYS:
{
CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)pLtv;
pKeys->key[0].len = CNV_INT_TO_LITTLE( pKeys->key[0].len );
pKeys->key[1].len = CNV_INT_TO_LITTLE( pKeys->key[1].len );
pKeys->key[2].len = CNV_INT_TO_LITTLE( pKeys->key[2].len );
pKeys->key[3].len = CNV_INT_TO_LITTLE( pKeys->key[3].len );
memcpy( (void *)&(lp->DefaultKeys), (void *)pKeys,
sizeof( CFG_DEFAULT_KEYS_STRCT ));
}
break;
case CFG_TX_KEY_ID:
lp->TransmitKeyID = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_SCAN_SSID:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_TICK_TIME:
/* TODO: determine if we are going to store anything based on this */
break;
/* these RIDS are Info RIDs, and should they be allowed for puts??? */
case CFG_MAX_LOAD_TIME:
case CFG_DL_BUF:
//case CFG_HSI_SUP_RANGE:
case CFG_NIC_SERIAL_NUMBER:
case CFG_NIC_IDENTITY:
case CFG_NIC_MFI_SUP_RANGE:
case CFG_NIC_CFI_SUP_RANGE:
case CFG_NIC_TEMP_TYPE:
case CFG_NIC_PROFILE:
case CFG_FW_IDENTITY:
case CFG_FW_SUP_RANGE:
case CFG_MFI_ACT_RANGES_STA:
case CFG_CFI_ACT_RANGES_STA:
case CFG_PORT_STAT:
case CFG_CUR_SSID:
case CFG_CUR_BSSID:
case CFG_COMMS_QUALITY:
case CFG_CUR_TX_RATE:
case CFG_CUR_BEACON_INTERVAL:
case CFG_CUR_SCALE_THRH:
case CFG_PROTOCOL_RSP_TIME:
case CFG_CUR_SHORT_RETRY_LIMIT:
case CFG_CUR_LONG_RETRY_LIMIT:
case CFG_MAX_TX_LIFETIME:
case CFG_MAX_RX_LIFETIME:
case CFG_CF_POLLABLE:
case CFG_AUTHENTICATION_ALGORITHMS:
case CFG_PRIVACY_OPT_IMPLEMENTED:
//case CFG_CURRENT_REMOTE_RATES:
//case CFG_CURRENT_USED_RATES:
//case CFG_CURRENT_SYSTEM_SCALE:
//case CFG_CURRENT_TX_RATE1:
//case CFG_CURRENT_TX_RATE2:
//case CFG_CURRENT_TX_RATE3:
//case CFG_CURRENT_TX_RATE4:
//case CFG_CURRENT_TX_RATE5:
//case CFG_CURRENT_TX_RATE6:
case CFG_NIC_MAC_ADDR:
case CFG_PCF_INFO:
//case CFG_CURRENT_COUNTRY_INFO:
case CFG_PHY_TYPE:
case CFG_CUR_CHANNEL:
//case CFG_CURRENT_POWER_STATE:
//case CFG_CCAMODE:
case CFG_SUPPORTED_DATA_RATES:
break;
case CFG_AP_MODE:
//;? lp->DownloadFirmware = ( pLtv->u.u16[0] ) + 1;
DBG_ERROR( DbgInfo, "set CFG_AP_MODE no longer supported\n" );
break;
case CFG_ENCRYPT_STRING:
/* TODO: ENDIAN TRANSLATION HERE??? */
memset( lp->szEncryption, 0, sizeof( lp->szEncryption ));
memcpy( (void *)lp->szEncryption, (void *)&pLtv->u.u8[0],
( pLtv->len * sizeof( hcf_16 )) );
wl_wep_decode( CRYPT_CODE, &sEncryption,
lp->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 */
lp->TransmitKeyID = sEncryption.wTxKeyID + 1;
lp->EnableEncryption = sEncryption.wEnabled;
memcpy( &lp->DefaultKeys, &sEncryption.EncStr,
sizeof( CFG_DEFAULT_KEYS_STRCT ));
break;
/*case CFG_COUNTRY_STRING:
memset( lp->countryString, 0, sizeof( lp->countryString ));
memcpy( (void *)lp->countryString, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
break;
*/
case CFG_DRIVER_ENABLE:
lp->driverEnable = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_WOLAS_ENABLE:
lp->wolasEnable = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_SET_WPA_AUTH_KEY_MGMT_SUITE:
lp->AuthKeyMgmtSuite = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_DISASSOCIATE_ADDR:
pLtv->u.u16[ETH_ALEN / 2] = CNV_INT_TO_LITTLE( pLtv->u.u16[ETH_ALEN / 2] );
break;
case CFG_ADD_TKIP_DEFAULT_KEY:
case CFG_REMOVE_TKIP_DEFAULT_KEY:
/* Endian convert the Tx Key Information */
pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
break;
case CFG_ADD_TKIP_MAPPED_KEY:
break;
case CFG_REMOVE_TKIP_MAPPED_KEY:
break;
/* some RIDs just can't be put */
case CFG_MB_INFO:
case CFG_IFB:
default:
break;
}
/* This code will prevent Static Configuration Entities from
being sent to the card, as they require a call to
UIL_ACT_APPLY to take effect. Dynamic Entities will be sent
immediately */
switch( pLtv->typ ) {
case CFG_CNF_PORT_TYPE:
case CFG_CNF_OWN_MAC_ADDR:
case CFG_CNF_OWN_CHANNEL:
case CFG_CNF_OWN_SSID:
case CFG_CNF_OWN_ATIM_WINDOW:
case CFG_CNF_SYSTEM_SCALE:
case CFG_CNF_MAX_DATA_LEN:
case CFG_CNF_PM_ENABLED:
case CFG_CNF_MCAST_RX:
case CFG_CNF_MAX_SLEEP_DURATION:
case CFG_CNF_HOLDOVER_DURATION:
case CFG_CNF_OWN_NAME:
case CFG_CNF_LOAD_BALANCING:
case CFG_CNF_MEDIUM_DISTRIBUTION:
#ifdef WARP
case CFG_CNF_TX_POW_LVL:
case CFG_CNF_CONNECTION_CNTL:
//case CFG_PROBE_DATA_RATE:
#endif // HERMES25
#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
//;?should we restore this to allow smaller memory footprint
case CFG_CNF_OWN_DTIM_PERIOD:
#ifdef WARP
case CFG_CNF_OWN_BEACON_INTERVAL: // Own Beacon Interval
#endif // WARP
#ifdef USE_WDS
case CFG_CNF_WDS_ADDR1:
case CFG_CNF_WDS_ADDR2:
case CFG_CNF_WDS_ADDR3:
case CFG_CNF_WDS_ADDR4:
case CFG_CNF_WDS_ADDR5:
case CFG_CNF_WDS_ADDR6:
#endif
case CFG_CNF_MCAST_PM_BUF:
case CFG_CNF_REJECT_ANY:
#endif
case CFG_CNF_ENCRYPTION:
case CFG_CNF_AUTHENTICATION:
#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
//;?should we restore this to allow smaller memory footprint
case CFG_CNF_EXCL_UNENCRYPTED:
case CFG_CNF_MCAST_RATE:
case CFG_CNF_INTRA_BSS_RELAY:
#endif
case CFG_CNF_MICRO_WAVE:
//case CFG_CNF_LOAD_BALANCING:
//case CFG_CNF_MEDIUM_DISTRIBUTION:
//case CFG_CNF_RX_ALL_GROUP_ADDRESS:
//case CFG_CNF_COUNTRY_INFO:
//case CFG_COUNTRY_STRING:
case CFG_AP_MODE:
case CFG_ENCRYPT_STRING:
//case CFG_DRIVER_ENABLE:
case CFG_WOLAS_ENABLE:
case CFG_MB_INFO:
case CFG_IFB:
break;
/* Deal with this dynamic MSF RID, as it's required for WPA */
case CFG_DRIVER_ENABLE:
if( lp->driverEnable ) {
//hcf_cntl_port( &( lp->hcfCtx ),
// HCF_PORT_ENABLE | HCF_PORT_0 );
// //hcf_cntl( &( lp->hcfCtx ),
// // HCF_PORT_ENABLE | HCF_PORT_0 );
//hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_ENABLE );
// //hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_CONNECT );
hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_ENABLE | HCF_PORT_0 );
hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_CONNECT );
} else {
//hcf_cntl_port( &( lp->hcfCtx ),
// HCF_PORT_DISABLE | HCF_PORT_0 );
// //hcf_cntl( &( lp->hcfCtx ),
// // HCF_PORT_DISABLE | HCF_PORT_0 );
//hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISABLE );
// //hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISCONNECT );
hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISABLE | HCF_PORT_0 );
hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISCONNECT );
}
break;
default:
wl_act_int_off( lp );
urq->result = hcf_put_info(&(lp->hcfCtx), (LTVP) pLtv);
wl_act_int_on( lp );
break;
}
if( ltvAllocated ) {
kfree( pLtv );
}
} else {
urq->result = UIL_FAILURE;
}
} else {
DBG_ERROR( DbgInfo, "EPERM\n" );
urq->result = UIL_FAILURE;
result = -EPERM;
}
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_put_info
/*============================================================================*/
/*******************************************************************************
* wvlan_uil_get_info()
*******************************************************************************
*
* DESCRIPTION:
*
* Sends a specific RID directly to the driver to retrieve configuration
* info.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
int i;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_uil_get_info" );
DBG_ENTER( DbgInfo );
if( urq->hcfCtx == &( lp->hcfCtx )) {
if(( urq->data != NULL ) && ( urq->len != 0 )) {
ltv_t *pLtv;
bool_t ltvAllocated = FALSE;
/* Make sure that we have at least a command and length */
if( urq->len < ( sizeof( hcf_16 ) * 2 )) {
urq->len = sizeof( lp->ltvRecord );
DBG_ERROR( DbgInfo, "No Length/Type in LTV!!!\n" );
DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
urq->result = UIL_ERR_LEN;
DBG_LEAVE( DbgInfo );
return result;
}
/* Verify the user's LTV record header. */
result = verify_area( VERIFY_READ, urq->data, sizeof( hcf_16 ) * 2 );
if( result != 0 ) {
DBG_ERROR( DbgInfo, "verify_area(), VERIFY_READ FAILED\n" );
urq->result = UIL_FAILURE;
DBG_LEAVE( DbgInfo );
return result;
}
/* Get only the command and length information. */
result = copy_from_user( &( lp->ltvRecord ), urq->data, sizeof( hcf_16 ) * 2 );
/* Make sure the incoming LTV record length is within the bounds of
the IOCTL length. */
if((( lp->ltvRecord.len + 1 ) * sizeof( hcf_16 )) > urq->len ) {
DBG_ERROR( DbgInfo, "Incoming LTV too big\n" );
urq->len = sizeof( lp->ltvRecord );
urq->result = UIL_ERR_LEN;
DBG_LEAVE( DbgInfo );
return result;
}
/* Determine if hcf_get_info() is needed or not */
switch ( lp->ltvRecord.typ ) {
case CFG_NIC_IDENTITY:
memcpy( &lp->ltvRecord.u.u8[0], &lp->NICIdentity, sizeof( lp->NICIdentity ));
break;
case CFG_PRI_IDENTITY:
memcpy( &lp->ltvRecord.u.u8[0], &lp->PrimaryIdentity, sizeof( lp->PrimaryIdentity ));
break;
case CFG_AP_MODE:
DBG_ERROR( DbgInfo, "set CFG_AP_MODE no longer supported, so is get useful ????\n" );
lp->ltvRecord.u.u16[0] =
CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP;
break;
//case CFG_DRV_INFO:
case CFG_ENCRYPT_STRING:
case CFG_COUNTRY_STRING:
case CFG_DRIVER_ENABLE:
case CFG_WOLAS_ENABLE:
// TODO: determine if we're going to support these
urq->result = UIL_FAILURE;
break;
case CFG_DRV_INFO:
DBG_TRACE( DbgInfo, "Intercept CFG_DRV_INFO\n" );
result = cfg_driver_info( urq, lp );
break;
case CFG_DRV_IDENTITY:
DBG_TRACE( DbgInfo, "Intercept CFG_DRV_IDENTITY\n" );
result = cfg_driver_identity( urq, lp );
break;
case CFG_IFB:
/* IFB can be a security hole */
if( !capable( CAP_NET_ADMIN )) {
result = -EPERM;
break;
}
/* Else fall through to the default */
case CFG_FW_IDENTITY: // For Hermes-1, this is cached
default:
/* Verify the user buffer */
result = verify_area( VERIFY_WRITE, urq->data, urq->len );
if( result != 0 ) {
DBG_ERROR( DbgInfo, "verify_area(), VERIFY_WRITE FAILED\n" );
urq->result = UIL_FAILURE;
break;
}
/* If the requested length is greater than the size of our local
LTV record, try to allocate it from the kernel stack.
Otherwise, we just use our local LTV record. */
if( urq->len > sizeof( lp->ltvRecord )) {
if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) {
ltvAllocated = TRUE;
/* Copy the command/length information into the new buffer. */
memcpy( pLtv, &( lp->ltvRecord ), sizeof( hcf_16 ) * 2 );
} else {
urq->len = sizeof( lp->ltvRecord );
urq->result = UIL_ERR_LEN;
DBG_ERROR( DbgInfo, "kmalloc FAILED\n" );
DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
result = -ENOMEM;
break;
}
} else {
pLtv = &( lp->ltvRecord );
}
wl_act_int_off( lp );
urq->result = hcf_get_info( &( lp->hcfCtx ), (LTVP) pLtv );
wl_act_int_on( lp );
// Copy the LTV into the user's buffer.
//copy_to_user( urq->data, pLtv, urq->len );
//if( ltvAllocated )
//{
// kfree( pLtv );
//}
//urq->result = UIL_SUCCESS;
break;
}
/* Handle endian conversion of special fields */
switch( lp->ltvRecord.typ ) {
/* simple int gets just need the first hcf_16 byte flipped */
case CFG_CNF_PORT_TYPE:
case CFG_CNF_OWN_CHANNEL:
case CFG_CNF_OWN_ATIM_WINDOW:
case CFG_CNF_SYSTEM_SCALE:
case CFG_CNF_MAX_DATA_LEN:
case CFG_CNF_PM_ENABLED:
case CFG_CNF_MCAST_RX:
case CFG_CNF_MAX_SLEEP_DURATION:
case CFG_CNF_HOLDOVER_DURATION:
case CFG_CNF_OWN_DTIM_PERIOD:
case CFG_CNF_MCAST_PM_BUF:
case CFG_CNF_REJECT_ANY:
case CFG_CNF_ENCRYPTION:
case CFG_CNF_AUTHENTICATION:
case CFG_CNF_EXCL_UNENCRYPTED:
case CFG_CNF_INTRA_BSS_RELAY:
case CFG_CNF_MICRO_WAVE:
case CFG_CNF_LOAD_BALANCING:
case CFG_CNF_MEDIUM_DISTRIBUTION:
#ifdef WARP
case CFG_CNF_TX_POW_LVL:
case CFG_CNF_CONNECTION_CNTL:
case CFG_CNF_OWN_BEACON_INTERVAL: // Own Beacon Interval
case CFG_COEXISTENSE_BEHAVIOUR: // Coexistence Behavior
//case CFG_CNF_RX_ALL_GROUP_ADDRESS:
#endif // HERMES25
case CFG_CREATE_IBSS:
case CFG_RTS_THRH:
case CFG_PROMISCUOUS_MODE:
//case CFG_WAKE_ON_LAN:
case CFG_RTS_THRH0:
case CFG_RTS_THRH1:
case CFG_RTS_THRH2:
case CFG_RTS_THRH3:
case CFG_RTS_THRH4:
case CFG_RTS_THRH5:
case CFG_RTS_THRH6:
case CFG_TX_RATE_CNTL0:
case CFG_TX_RATE_CNTL1:
case CFG_TX_RATE_CNTL2:
case CFG_TX_RATE_CNTL3:
case CFG_TX_RATE_CNTL4:
case CFG_TX_RATE_CNTL5:
case CFG_TX_RATE_CNTL6:
case CFG_TX_KEY_ID:
case CFG_TICK_TIME:
case CFG_MAX_LOAD_TIME:
case CFG_NIC_TEMP_TYPE:
case CFG_PORT_STAT:
case CFG_CUR_TX_RATE:
case CFG_CUR_BEACON_INTERVAL:
case CFG_PROTOCOL_RSP_TIME:
case CFG_CUR_SHORT_RETRY_LIMIT:
case CFG_CUR_LONG_RETRY_LIMIT:
case CFG_MAX_TX_LIFETIME:
case CFG_MAX_RX_LIFETIME:
case CFG_CF_POLLABLE:
case CFG_PRIVACY_OPT_IMPLEMENTED:
//case CFG_CURRENT_REMOTE_RATES:
//case CFG_CURRENT_USED_RATES:
//case CFG_CURRENT_SYSTEM_SCALE:
//case CFG_CURRENT_TX_RATE1:
//case CFG_CURRENT_TX_RATE2:
//case CFG_CURRENT_TX_RATE3:
//case CFG_CURRENT_TX_RATE4:
//case CFG_CURRENT_TX_RATE5:
//case CFG_CURRENT_TX_RATE6:
case CFG_PHY_TYPE:
case CFG_CUR_CHANNEL:
//case CFG_CURRENT_POWER_STATE:
//case CFG_CCAMODE:
// lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
// break;
/* name string gets just need the first hcf_16 byte flipped (length of string) */
case CFG_CNF_OWN_SSID:
case CFG_CNF_OWN_NAME:
//case CNF_DESIRED_SSID:
case CFG_DESIRED_SSID:
case CFG_SCAN_SSID:
case CFG_CUR_SSID:
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
break;
/* non-length counted strings need no byte flipping */
case CFG_CNF_OWN_MAC_ADDR:
/* this case is no longer valid: CFG_CNF_WDS_ADDR */
case CFG_CNF_WDS_ADDR1:
case CFG_CNF_WDS_ADDR2:
case CFG_CNF_WDS_ADDR3:
case CFG_CNF_WDS_ADDR4:
case CFG_CNF_WDS_ADDR5:
case CFG_CNF_WDS_ADDR6:
case CFG_GROUP_ADDR:
case CFG_NIC_SERIAL_NUMBER:
case CFG_CUR_BSSID:
case CFG_NIC_MAC_ADDR:
case CFG_SUPPORTED_DATA_RATES: /* need to ensure we can treat this as a string */
break;
//case CFG_CNF_COUNTRY_INFO: /* special case, see page 75 of 022486, Rev C. */
//case CFG_CURRENT_COUNTRY_INFO: /* special case, see page 101 of 022486, Rev C. */
/*
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[3] );
for( i = 4; i < lp->ltvRecord.len; i++ ) {
lp->ltvRecord.u.u16[i] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[i] );
}
break;
*/
case CFG_DEFAULT_KEYS:
{
CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)&lp->ltvRecord.u.u8[0];
pKeys[0].len = CNV_INT_TO_LITTLE( pKeys[0].len );
pKeys[1].len = CNV_INT_TO_LITTLE( pKeys[1].len );
pKeys[2].len = CNV_INT_TO_LITTLE( pKeys[2].len );
pKeys[3].len = CNV_INT_TO_LITTLE( pKeys[3].len );
}
break;
case CFG_CNF_MCAST_RATE:
case CFG_TX_RATE_CNTL:
case CFG_SUPPORTED_RATE_SET_CNTL: // Supported Rate Set Control
case CFG_BASIC_RATE_SET_CNTL: // Basic Rate Set Control
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
break;
case CFG_DL_BUF:
case CFG_NIC_IDENTITY:
case CFG_COMMS_QUALITY:
case CFG_PCF_INFO:
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[2] );
break;
case CFG_FW_IDENTITY:
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[2] );
lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[3] );
break;
//case CFG_HSI_SUP_RANGE:
case CFG_NIC_MFI_SUP_RANGE:
case CFG_NIC_CFI_SUP_RANGE:
case CFG_NIC_PROFILE:
case CFG_FW_SUP_RANGE:
lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[2] );
lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[3] );
lp->ltvRecord.u.u16[4] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[4] );
break;
case CFG_MFI_ACT_RANGES_STA:
case CFG_CFI_ACT_RANGES_STA:
case CFG_CUR_SCALE_THRH:
case CFG_AUTHENTICATION_ALGORITHMS:
for( i = 0; i < ( lp->ltvRecord.len - 1 ); i++ ) {
lp->ltvRecord.u.u16[i] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[i] );
}
break;
/* done at init time, and endian handled then */
case CFG_PRI_IDENTITY:
break;
case CFG_MB_INFO:
//wvlanEndianTranslateMailbox( pLtv );
break;
/* MSF and HCF RIDS */
case CFG_IFB:
case CFG_DRV_INFO:
case CFG_AP_MODE:
case CFG_ENCRYPT_STRING:
case CFG_COUNTRY_STRING:
case CFG_DRIVER_ENABLE:
case CFG_WOLAS_ENABLE:
default:
break;
}
// Copy the LTV into the user's buffer.
copy_to_user( urq->data, &( lp->ltvRecord ), urq->len );
if( ltvAllocated ) {
kfree( &( lp->ltvRecord ));
}
urq->result = UIL_SUCCESS;
} else {
urq->result = UIL_FAILURE;
}
} else {
DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE( DbgInfo );
return result;
} // wvlan_uil_get_info
/*============================================================================*/
/*******************************************************************************
* cfg_driver_info()
*******************************************************************************
*
* DESCRIPTION:
*
* Retrieves driver information.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int cfg_driver_info( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "cfg_driver_info" );
DBG_ENTER( DbgInfo );
/* Make sure that user buffer can handle the driver information buffer */
if( urq->len < sizeof( lp->driverInfo )) {
urq->len = sizeof( lp->driverInfo );
urq->result = UIL_ERR_LEN;
DBG_LEAVE( DbgInfo );
return result;
}
/* Verify the user buffer. */
result = verify_area( VERIFY_WRITE, urq->data, sizeof( lp->driverInfo ));
if( result != 0 ) {
urq->result = UIL_FAILURE;
DBG_LEAVE( DbgInfo );
return result;
}
lp->driverInfo.card_stat = lp->hcfCtx.IFB_CardStat;
// Copy the driver information into the user's buffer.
urq->result = UIL_SUCCESS;
copy_to_user( urq->data, &( lp->driverInfo ), sizeof( lp->driverInfo ));
DBG_LEAVE( DbgInfo );
return result;
} // cfg_driver_info
/*============================================================================*/
/*******************************************************************************
* cfg_driver_identity()
*******************************************************************************
*
* DESCRIPTION:
*
* Retrieves ID information from the card.
*
* PARAMETERS:
*
* urq - a pointer to the UIL request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* UIL_SUCCESS
* UIL_ERR_xxx value otherwise
*
******************************************************************************/
int cfg_driver_identity( struct uilreq *urq, struct wl_private *lp )
{
int result = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_driver_identity" );
DBG_ENTER( DbgInfo );
/* Make sure that user buffer can handle the driver identity structure. */
if( urq->len < sizeof( lp->driverIdentity )) {
urq->len = sizeof( lp->driverIdentity );
urq->result = UIL_ERR_LEN;
DBG_LEAVE( DbgInfo );
return result;
}
/* Verify the user buffer. */
result = verify_area( VERIFY_WRITE, urq->data, sizeof( lp->driverIdentity ));
if( result != 0 ) {
urq->result = UIL_FAILURE;
DBG_LEAVE( DbgInfo );
return result;
}
/* Copy the driver identity into the user's buffer. */
urq->result = UIL_SUCCESS;
copy_to_user( urq->data, &( lp->driverIdentity ), sizeof( lp->driverIdentity ));
DBG_LEAVE( DbgInfo );
return result;
} // cfg_driver_identity
/*============================================================================*/
#endif /* USE_UIL */
/* If WIRELESS_EXT is not defined, then the functions that follow will not be
included in the build. */
/* NOTE: Are these still even needed? */
#ifdef WIRELESS_EXT
/*******************************************************************************
* wvlan_set_netname()
*******************************************************************************
*
* DESCRIPTION:
*
* Set the ESSID of the card.
*
* PARAMETERS:
*
* wrq - a pointer to the wireless request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_set_netname(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_set_netname" );
DBG_ENTER( DbgInfo );
wl_lock(lp, &flags);
memset( lp->NetworkName, 0, sizeof( lp->NetworkName ));
memcpy( lp->NetworkName, extra, wrqu->data.length);
/* Commit the adapter parameters */
wl_apply(lp);
wl_unlock(lp, &flags);
DBG_LEAVE( DbgInfo );
return ret;
} // wvlan_set_netname
/*============================================================================*/
/*******************************************************************************
* wvlan_get_netname()
*******************************************************************************
*
* DESCRIPTION:
*
* Get the ESSID of the card.
*
* PARAMETERS:
*
* wrq - a pointer to the wireless request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_get_netname(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
int status = -1;
wvName_t *pName;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_get_netname" );
DBG_ENTER( DbgInfo );
wl_lock(lp, &flags);
/* Get the current network name */
lp->ltvRecord.len = 1 + ( sizeof( *pName ) / sizeof( hcf_16 ));
lp->ltvRecord.typ = CFG_CUR_SSID;
status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
if( status == HCF_SUCCESS ) {
pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
memset(extra, '\0', HCF_MAX_NAME_LEN);
wrqu->data.length = pName->length;
memcpy(extra, pName->name, pName->length);
} else {
ret = -EFAULT;
}
wl_unlock(lp, &flags);
DBG_LEAVE( DbgInfo );
return ret;
} // wvlan_get_netname
/*============================================================================*/
/*******************************************************************************
* wvlan_set_station_nickname()
*******************************************************************************
*
* DESCRIPTION:
*
* Set the card's station nickname.
*
* PARAMETERS:
*
* wrq - a pointer to the wireless request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_set_station_nickname(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_set_station_nickname" );
DBG_ENTER( DbgInfo );
wl_lock(lp, &flags);
memset( lp->StationName, 0, sizeof( lp->StationName ));
memcpy( lp->StationName, extra, wrqu->data.length);
/* Commit the adapter parameters */
wl_apply( lp );
wl_unlock(lp, &flags);
DBG_LEAVE( DbgInfo );
return ret;
} // wvlan_set_station_nickname
/*============================================================================*/
/*******************************************************************************
* wvlan_get_station_nickname()
*******************************************************************************
*
* DESCRIPTION:
*
* Get the card's station nickname.
*
* PARAMETERS:
*
* wrq - a pointer to the wireless request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_get_station_nickname(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
int status = -1;
wvName_t *pName;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_get_station_nickname" );
DBG_ENTER( DbgInfo );
wl_lock( lp, &flags );
/* Get the current station name */
lp->ltvRecord.len = 1 + ( sizeof( *pName ) / sizeof( hcf_16 ));
lp->ltvRecord.typ = CFG_CNF_OWN_NAME;
status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
if( status == HCF_SUCCESS ) {
pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
memset(extra, '\0', HCF_MAX_NAME_LEN);
wrqu->data.length = pName->length;
memcpy(extra, pName->name, pName->length);
} else {
ret = -EFAULT;
}
wl_unlock(lp, &flags);
//out:
DBG_LEAVE( DbgInfo );
return ret;
} // wvlan_get_station_nickname
/*============================================================================*/
/*******************************************************************************
* wvlan_set_porttype()
*******************************************************************************
*
* DESCRIPTION:
*
* Set the card's porttype
*
* PARAMETERS:
*
* wrq - a pointer to the wireless request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_set_porttype(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
hcf_16 portType;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_set_porttype" );
DBG_ENTER( DbgInfo );
wl_lock(lp, &flags);
/* Validate the new value */
portType = *((__u32 *)extra);
if( !(( portType == 1 ) || ( portType == 3 ))) {
ret = -EINVAL;
goto out_unlock;
}
lp->PortType = portType;
/* Commit the adapter parameters */
wl_apply( lp );
out_unlock:
wl_unlock(lp, &flags);
//out:
DBG_LEAVE( DbgInfo );
return ret;
}
/*============================================================================*/
/*******************************************************************************
* wvlan_get_porttype()
*******************************************************************************
*
* DESCRIPTION:
*
* Get the card's porttype
*
* PARAMETERS:
*
* wrq - a pointer to the wireless request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_get_porttype(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra)
{
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
int ret = 0;
int status = -1;
hcf_16 *pPortType;
__u32 *pData = (__u32 *)extra;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_get_porttype" );
DBG_ENTER( DbgInfo );
wl_lock( lp, &flags );
/* Get the current port type */
lp->ltvRecord.len = 1 + ( sizeof( *pPortType ) / sizeof( hcf_16 ));
lp->ltvRecord.typ = CFG_CNF_PORT_TYPE;
status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
if( status == HCF_SUCCESS ) {
pPortType = (hcf_16 *)&( lp->ltvRecord.u.u32 );
*pData = CNV_LITTLE_TO_INT( *pPortType );
} else {
ret = -EFAULT;
}
wl_unlock(lp, &flags);
//out:
DBG_LEAVE( DbgInfo );
return ret;
} // wvlan_get_porttype
/*============================================================================*/
#endif // WIRELESS_EXT
#ifdef USE_RTS
/*******************************************************************************
* wvlan_rts()
*******************************************************************************
*
* DESCRIPTION:
*
* IOCTL handler for RTS commands
*
* PARAMETERS:
*
* rrq - a pointer to the rts request buffer
* lp - a pointer to the device's private adapter structure
*
* RETURNS:
*
* 0 on success
* errno value otherwise
*
******************************************************************************/
int wvlan_rts( struct rtsreq *rrq, __u32 io_base )
{
int ioctl_ret = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wvlan_rts" );
DBG_ENTER( DbgInfo );
DBG_PRINT( "io_base: 0x%08x\n", io_base );
switch( rrq->typ ) {
case WL_IOCTL_RTS_READ:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_READ\n");
rrq->data[0] = IN_PORT_WORD( io_base + rrq->reg );
DBG_TRACE( DbgInfo, " reg 0x%04x ==> 0x%04x\n", rrq->reg, CNV_LITTLE_TO_SHORT( rrq->data[0] ) );
break;
case WL_IOCTL_RTS_WRITE:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_WRITE\n");
OUT_PORT_WORD( io_base + rrq->reg, rrq->data[0] );
DBG_TRACE( DbgInfo, " reg 0x%04x <== 0x%04x\n", rrq->reg, CNV_LITTLE_TO_SHORT( rrq->data[0] ) );
break;
case WL_IOCTL_RTS_BATCH_READ:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_BATCH_READ\n");
IN_PORT_STRING_16( io_base + rrq->reg, rrq->data, rrq->len );
DBG_TRACE( DbgInfo, " reg 0x%04x ==> %d bytes\n", rrq->reg, rrq->len * sizeof (__u16 ) );
break;
case WL_IOCTL_RTS_BATCH_WRITE:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_BATCH_WRITE\n");
OUT_PORT_STRING_16( io_base + rrq->reg, rrq->data, rrq->len );
DBG_TRACE( DbgInfo, " reg 0x%04x <== %d bytes\n", rrq->reg, rrq->len * sizeof (__u16) );
break;
default:
DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- UNSUPPORTED RTS CODE: 0x%X", rrq->typ );
ioctl_ret = -EOPNOTSUPP;
break;
}
DBG_LEAVE( DbgInfo );
return ioctl_ret;
} // wvlan_rts
/*============================================================================*/
#endif /* USE_RTS */
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_priv.h,v $
*
******************************************************************************/
#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__
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/04 12:36:10 $
* $Revision: 1.10 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_profile.c,v $
*
******************************************************************************/
/* 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>
/*******************************************************************************
* global variables
******************************************************************************/
/* Definition needed to prevent unresolved external in unistd.h */
static int errno;
#if DBG
extern p_u32 DebugFlag;
extern dbg_info_t *DbgInfo;
#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;
/*------------------------------------------------------------------------*/
DBG_FUNC( "parse_config" );
DBG_ENTER( DbgInfo );
/* Get the wavelan specific info for this device */
wvlan_config = (struct wl_private *)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 = (char*)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
DBG_LEAVE( DbgInfo );
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];
/*------------------------------------------------------------------------*/
DBG_FUNC( "translate_option" );
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 = wl_atoi( value ); //;?DebugFlag;
}
DbgInfo->DebugFlag = wl_atoi( value ); //;?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 = wl_atoi( value );
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 = wl_atoi( value );
if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) {
lp->brsc[0] = value_convert;
} else {
DBG_WARNING( DbgInfo, "%s invaid; 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 = wl_atoi( value );
if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) {
lp->brsc[1] = value_convert;
} else {
DBG_WARNING( DbgInfo, "%s invaid; 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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) {
lp->srsc[0] = value_convert;
} else {
DBG_WARNING( DbgInfo, "%s invaid; 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 = wl_atoi( value );
if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) {
lp->srsc[1] = value_convert;
} else {
DBG_WARNING( DbgInfo, "%s invaid; 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 = wl_atoi( value );
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 = wl_atoi( value );
if (( value_convert >= PARM_MIN_TX_KEY ) && ( value_convert <= PARM_MAX_TX_KEY )) {
lp->TransmitKeyID = wl_atoi( value );
} 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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
/* ;? 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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 = wl_atoi( value );
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 seperating 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;
/*------------------------------------------------------------------------*/
DBG_FUNC( "ParseConfigLine" );
DBG_ENTER( DbgInfo );
/* 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';
}
}
}
DBG_LEAVE( DbgInfo );
} // ParseConfigLine
/*============================================================================*/
#endif // USE_PROFILE
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/23 11:46:19 $
* $Revision: 1.3 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_profile.h,v $
*
******************************************************************************/
#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__
/*
* ex: sw=4
*/
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
#include <net/iw_handler.h>
#include <linux/sysfs.h>
#include <debug.h>
#include <hcf.h>
#include <hcfdef.h>
#include <wl_if.h>
#include <wl_internal.h>
#include <wl_util.h>
#include <wl_main.h>
#include <wl_wext.h>
#include <wl_priv.h>
static inline int dev_isalive(const struct net_device *dev)
{
return dev->reg_state == NETREG_REGISTERED;
}
/*
* empirically even if tallies are defined as 32 bits entities, only
* high 16 bits are relevant; low half is always zero. It means tallies
* are pretty much useless for traffic counting but at least give overview
* about where error come from
*/
static ssize_t show_tallies(struct device *d, struct device_attribute *attr,
char *buf)
{
struct net_device *dev = to_net_dev(d);
struct wl_private *lp = wl_priv(dev);
unsigned long flags;
CFG_HERMES_TALLIES_STRCT tallies;
ssize_t ret = -EINVAL;
read_lock(&dev_base_lock);
if (dev_isalive(dev)) {
wl_lock(lp, &flags);
if ((ret = wl_get_tallies(lp, &tallies)) == 0) {
wl_unlock(lp, &flags);
ret = snprintf(buf, PAGE_SIZE,
"TxUnicastFrames: %u\n"
"TxMulticastFrames: %u\n"
"TxFragments: %u\n"
"TxUnicastOctets: %u\n"
"TxMulticastOctets: %u\n"
"TxDeferredTransmissions: %u\n"
"TxSingleRetryFrames: %u\n"
"TxMultipleRetryFrames: %u\n"
"TxRetryLimitExceeded: %u\n"
"TxDiscards: %u\n"
"RxUnicastFrames: %u\n"
"RxMulticastFrames: %u\n"
"RxFragments: %u\n"
"RxUnicastOctets: %u\n"
"RxMulticastOctets: %u\n"
"RxFCSErrors: %u\n"
"RxDiscardsNoBuffer: %u\n"
"TxDiscardsWrongSA: %u\n"
"RxWEPUndecryptable: %u\n"
"RxMsgInMsgFragments: %u\n"
"RxMsgInBadMsgFragments: %u\n"
"RxDiscardsWEPICVError: %u\n"
"RxDiscardsWEPExcluded: %u\n"
,
(unsigned int)tallies.TxUnicastFrames,
(unsigned int)tallies.TxMulticastFrames,
(unsigned int)tallies.TxFragments,
(unsigned int)tallies.TxUnicastOctets,
(unsigned int)tallies.TxMulticastOctets,
(unsigned int)tallies.TxDeferredTransmissions,
(unsigned int)tallies.TxSingleRetryFrames,
(unsigned int)tallies.TxMultipleRetryFrames,
(unsigned int)tallies.TxRetryLimitExceeded,
(unsigned int)tallies.TxDiscards,
(unsigned int)tallies.RxUnicastFrames,
(unsigned int)tallies.RxMulticastFrames,
(unsigned int)tallies.RxFragments,
(unsigned int)tallies.RxUnicastOctets,
(unsigned int)tallies.RxMulticastOctets,
(unsigned int)tallies.RxFCSErrors,
(unsigned int)tallies.RxDiscardsNoBuffer,
(unsigned int)tallies.TxDiscardsWrongSA,
(unsigned int)tallies.RxWEPUndecryptable,
(unsigned int)tallies.RxMsgInMsgFragments,
(unsigned int)tallies.RxMsgInBadMsgFragments,
(unsigned int)tallies.RxDiscardsWEPICVError,
(unsigned int)tallies.RxDiscardsWEPExcluded);
} else {
wl_unlock( lp, &flags );
}
}
read_unlock(&dev_base_lock);
return ret;
}
static DEVICE_ATTR(tallies, S_IRUGO, show_tallies, NULL);
static struct attribute *wlags_attrs[] = {
&dev_attr_tallies.attr,
NULL
};
static struct attribute_group wlags_group = {
.name = "wlags",
.attrs = wlags_attrs,
};
void register_wlags_sysfs(struct net_device *net)
{
struct device *dev = &(net->dev);
struct wl_private *lp = wl_priv(net);
lp->sysfsCreated = sysfs_create_group(&dev->kobj, &wlags_group);
}
void unregister_wlags_sysfs(struct net_device *net)
{
struct device *dev = &(net->dev);
struct wl_private *lp = wl_priv(net);
if (lp->sysfsCreated)
sysfs_remove_group(&dev->kobj, &wlags_group);
}
#ifdef CONFIG_SYSFS
extern void register_wlags_sysfs(struct net_device *);
extern void unregister_wlags_sysfs(struct net_device *);
#else
static void register_wlags_sysfs(struct net_device *) { return; };
static void unregister_wlags_sysfs(struct net_device *) { return; };
#endif
/*******************************************************************************
* 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 misc utility functions.
*
*------------------------------------------------------------------------------
*
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/04 12:36:10 $
* $Revision: 1.6 $
* $Source: /usr/local/cvs/wl_lkm/wireless/wl_util.c,v $
*
******************************************************************************/
/*******************************************************************************
* 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 <asm/io.h>
// #include <asm/system.h>
// #include <asm/bitops.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
// #include <linux/skbuff.h>
// #include <linux/if_arp.h>
// #include <linux/ioport.h>
#include <debug.h>
#include <hcf.h>
// #include <hcfdef.h>
#include <wl_if.h>
#include <wl_internal.h>
#include <wl_util.h>
#include <wl_wext.h>
#include <wl_main.h>
/*******************************************************************************
* global variables
******************************************************************************/
/* A matrix which maps channels to frequencies */
#define MAX_CHAN_FREQ_MAP_ENTRIES 50
static const long chan_freq_list[][MAX_CHAN_FREQ_MAP_ENTRIES] =
{
{1,2412},
{2,2417},
{3,2422},
{4,2427},
{5,2432},
{6,2437},
{7,2442},
{8,2447},
{9,2452},
{10,2457},
{11,2462},
{12,2467},
{13,2472},
{14,2484},
{36,5180},
{40,5200},
{44,5220},
{48,5240},
{52,5260},
{56,5280},
{60,5300},
{64,5320},
{149,5745},
{153,5765},
{157,5785},
{161,5805}
};
#if DBG
extern dbg_info_t *DbgInfo;
#endif /* DBG */
/*******************************************************************************
* dbm()
*******************************************************************************
*
* DESCRIPTION:
*
* Return an energy value in dBm.
*
* PARAMETERS:
*
* value - the energy value to be converted
*
* RETURNS:
*
* the value in dBm
*
******************************************************************************/
int dbm( int value )
{
/* Truncate the value to be between min and max. */
if( value < HCF_MIN_SIGNAL_LEVEL )
value = HCF_MIN_SIGNAL_LEVEL;
if( value > HCF_MAX_SIGNAL_LEVEL )
value = HCF_MAX_SIGNAL_LEVEL;
/* Return the energy value in dBm. */
return ( value - HCF_0DBM_OFFSET );
} // dbm
/*============================================================================*/
/*******************************************************************************
* percent()
*******************************************************************************
*
* DESCRIPTION:
*
* Return a value as a percentage of min to max.
*
* PARAMETERS:
*
* value - the value in question
* min - the minimum range value
* max - the maximum range value
*
* RETURNS:
*
* the percentage value
*
******************************************************************************/
int percent( int value, int min, int max )
{
/* Truncate the value to be between min and max. */
if( value < min )
value = min;
if( value > max )
value = max;
/* Return the value as a percentage of min to max. */
return ((( value - min ) * 100 ) / ( max - min ));
} // percent
/*============================================================================*/
/*******************************************************************************
* is_valid_key_string()
*******************************************************************************
*
* DESCRIPTION:
*
* Checks to determine if the WEP key string is valid
*
* PARAMETERS:
*
* s - the string in question
*
* RETURNS:
*
* non-zero if the string contains a valid key
*
******************************************************************************/
int is_valid_key_string( char *s )
{
int l;
int i;
/*------------------------------------------------------------------------*/
l = strlen( s );
/* 0x followed by 5 or 13 hexadecimal digit pairs is valid */
if( s[0] == '0' && ( s[1] == 'x' || s[1] == 'X' )) {
if( l == 12 || l == 28 ) {
for( i = 2; i < l; i++ ) {
if( !isxdigit( s[i] ))
return 0;
}
return 1;
} else {
return 0;
}
}
/* string with 0, 5, or 13 characters is valid */
else
{
return( l == 0 || l == 5 || l == 13 );
}
} // is_valid_key_string
/*============================================================================*/
/*******************************************************************************
* hexdigit2int()
*******************************************************************************
*
* DESCRIPTION:
*
* Converts a hexadecimal digit character to an integer
*
* PARAMETERS:
*
* c - the hexadecimal digit character
*
* RETURNS:
*
* the converted integer
*
******************************************************************************/
int hexdigit2int( char c )
{
if( c >= '0' && c <= '9' )
return c - '0';
if( c >= 'A' && c <= 'F' )
return c - 'A' + 10;
if( c >= 'a' && c <= 'f' )
return c - 'a' + 10;
return 0;
} // hexdigit2int
/*============================================================================*/
/*******************************************************************************
* key_string2key()
*******************************************************************************
*
* DESCRIPTION:
*
* Converts a key_string to a key, Assumes the key_string is validated with
* is_valid_key_string().
*
* PARAMETERS:
*
* ks - the valid key string
* key - a pointer to a KEY_STRUCT where the converted key information will
* be stored.
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void key_string2key( char *ks, KEY_STRCT *key )
{
int l,i,n;
char *p;
/*------------------------------------------------------------------------*/
l = strlen( ks );
/* 0x followed by hexadecimal digit pairs */
if( ks[0] == '0' && ( ks[1] == 'x' || ks[1] == 'X' )) {
n = 0;
p = (char *)key->key;
for( i = 2; i < l; i+=2 ) {
*p++ = ( hexdigit2int( ks[i] ) << 4 ) + hexdigit2int (ks[i+1] );
n++;
}
/* Note that endian translation of the length field is not needed here
because it's performed in wl_put_ltv() */
key->len = n;
}
/* character string */
else
{
strcpy( (char *)key->key, ks );
key->len = l;
}
return;
} // key_string2key
/*============================================================================*/
#if DBG
/*******************************************************************************
* DbgHwAddr()
*******************************************************************************
*
* DESCRIPTION:
*
* Convert a hardware ethernet address to a character string
*
* PARAMETERS:
*
* hwAddr - an ethernet address
*
* RETURNS:
*
* a pointer to a string representing the ethernet address
*
******************************************************************************/
const char *DbgHwAddr(unsigned char *hwAddr)
{
static char buffer[18];
/*------------------------------------------------------------------------*/
sprintf( buffer, "%02X:%02X:%02X:%02X:%02X:%02X",
hwAddr[0], hwAddr[1], hwAddr[2], hwAddr[3], hwAddr[4], hwAddr[5] );
return buffer;
} // DbgHwAddr
/*============================================================================*/
#endif /* DBG */
/*******************************************************************************
* wl_has_wep()
*******************************************************************************
*
* DESCRIPTION:
*
* Checks to see if the device supports WEP
*
* PARAMETERS:
*
* ifbp - the IFB pointer of the device in question
*
* RETURNS:
*
* 1 if WEP is known enabled, else 0
*
******************************************************************************/
int wl_has_wep (IFBP ifbp)
{
CFG_PRIVACY_OPT_IMPLEMENTED_STRCT ltv;
int rc, privacy;
/*------------------------------------------------------------------------*/
/* This function allows us to distiguish bronze cards from other types, to
know if WEP exists. Does not distinguish (because there's no way to)
between silver and gold cards. */
ltv.len = 2;
ltv.typ = CFG_PRIVACY_OPT_IMPLEMENTED;
rc = hcf_get_info( ifbp, (LTVP) &ltv );
privacy = CNV_LITTLE_TO_INT( ltv.privacy_opt_implemented );
//return rc ? 0 : privacy;
return 1;
} // wl_has_wep
/*============================================================================*/
/*******************************************************************************
* wl_hcf_error()
*******************************************************************************
*
* DESCRIPTION:
*
* Report the type of HCF error message
*
* PARAMETERS:
*
* none
*
* RETURNS:
*
* A descriptive string indicating the error, quiet otherwise.
*
******************************************************************************/
void wl_hcf_error( struct net_device *dev, int hcfStatus )
{
char buffer[64], *pMsg;
/*------------------------------------------------------------------------*/
if( hcfStatus != HCF_SUCCESS ) {
switch( hcfStatus ) {
case HCF_ERR_TIME_OUT:
pMsg = "Expected adapter event did not occur in expected time";
break;
case HCF_ERR_NO_NIC:
pMsg = "Card not found (ejected unexpectedly)";
break;
case HCF_ERR_LEN:
pMsg = "Command buffer size insufficient";
break;
case HCF_ERR_INCOMP_PRI:
pMsg = "Primary functions are not compatible";
break;
case HCF_ERR_INCOMP_FW:
pMsg = "Primary functions are compatible, "
"station/ap functions are not";
break;
case HCF_ERR_BUSY:
pMsg = "Inquire cmd while another Inquire in progress";
break;
//case HCF_ERR_SEQ_BUG:
// pMsg = "Unexpected command completed";
// break;
case HCF_ERR_DEFUNCT_AUX:
pMsg = "Timeout on ack for enable/disable of AUX registers";
break;
case HCF_ERR_DEFUNCT_TIMER:
pMsg = "Timeout on timer calibration during initialization process";
break;
case HCF_ERR_DEFUNCT_TIME_OUT:
pMsg = "Timeout on Busy bit drop during BAP setup";
break;
case HCF_ERR_DEFUNCT_CMD_SEQ:
pMsg = "Hermes and HCF are out of sync";
break;
default:
sprintf( buffer, "Error code %d", hcfStatus );
pMsg = buffer;
break;
}
printk( KERN_INFO "%s: Wireless, HCF failure: \"%s\"\n",
dev->name, pMsg );
}
} // wl_hcf_error
/*============================================================================*/
/*******************************************************************************
* wl_endian_translate_event()
*******************************************************************************
*
* DESCRIPTION:
*
* Determines what type of data is in the mailbox and performs the proper
* endian translation.
*
* PARAMETERS:
*
* pLtv - an LTV pointer
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_endian_translate_event( ltv_t *pLtv )
{
DBG_FUNC( "wl_endian_translate_event" );
DBG_ENTER( DbgInfo );
switch( pLtv->typ ) {
case CFG_TALLIES:
break;
case CFG_SCAN:
{
int numAPs;
SCAN_RS_STRCT *pAps = (SCAN_RS_STRCT*)&pLtv->u.u8[0];
numAPs = (hcf_16)(( (size_t)( pLtv->len - 1 ) * 2 ) /
(sizeof( SCAN_RS_STRCT )));
while( numAPs >= 1 ) {
numAPs--;
pAps[numAPs].channel_id =
CNV_LITTLE_TO_INT( pAps[numAPs].channel_id );
pAps[numAPs].noise_level =
CNV_LITTLE_TO_INT( pAps[numAPs].noise_level );
pAps[numAPs].signal_level =
CNV_LITTLE_TO_INT( pAps[numAPs].signal_level );
pAps[numAPs].beacon_interval_time =
CNV_LITTLE_TO_INT( pAps[numAPs].beacon_interval_time );
pAps[numAPs].capability =
CNV_LITTLE_TO_INT( pAps[numAPs].capability );
pAps[numAPs].ssid_len =
CNV_LITTLE_TO_INT( pAps[numAPs].ssid_len );
pAps[numAPs].ssid_val[pAps[numAPs].ssid_len] = 0;
}
}
break;
case CFG_ACS_SCAN:
{
PROBE_RESP *probe_resp = (PROBE_RESP *)pLtv;
probe_resp->frameControl = CNV_LITTLE_TO_INT( probe_resp->frameControl );
probe_resp->durID = CNV_LITTLE_TO_INT( probe_resp->durID );
probe_resp->sequence = CNV_LITTLE_TO_INT( probe_resp->sequence );
probe_resp->dataLength = CNV_LITTLE_TO_INT( probe_resp->dataLength );
#ifndef WARP
probe_resp->lenType = CNV_LITTLE_TO_INT( probe_resp->lenType );
#endif // WARP
probe_resp->beaconInterval = CNV_LITTLE_TO_INT( probe_resp->beaconInterval );
probe_resp->capability = CNV_LITTLE_TO_INT( probe_resp->capability );
probe_resp->flags = CNV_LITTLE_TO_INT( probe_resp->flags );
}
break;
case CFG_LINK_STAT:
#define ls ((LINK_STATUS_STRCT *)pLtv)
ls->linkStatus = CNV_LITTLE_TO_INT( ls->linkStatus );
break;
#undef ls
case CFG_ASSOC_STAT:
{
ASSOC_STATUS_STRCT *pAs = (ASSOC_STATUS_STRCT *)pLtv;
pAs->assocStatus = CNV_LITTLE_TO_INT( pAs->assocStatus );
}
break;
case CFG_SECURITY_STAT:
{
SECURITY_STATUS_STRCT *pSs = (SECURITY_STATUS_STRCT *)pLtv;
pSs->securityStatus = CNV_LITTLE_TO_INT( pSs->securityStatus );
pSs->reason = CNV_LITTLE_TO_INT( pSs->reason );
}
break;
case CFG_WMP:
break;
case CFG_NULL:
break;
default:
break;
}
DBG_LEAVE( DbgInfo );
return;
} // wl_endian_translate_event
/*============================================================================*/
/*******************************************************************************
* msf_assert()
*******************************************************************************
*
* DESCRIPTION:
*
* Print statement used to display asserts from within the HCF. Only called
* when asserts in the HCF are turned on. See hcfcfg.h for more information.
*
* PARAMETERS:
*
* file_namep - the filename in which the assert occurred.
* line_number - the line number on which the assert occurred.
* trace - a comment associated with the assert.
* qual - return code or other value related to the assert
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void msf_assert( unsigned int line_number, hcf_16 trace, hcf_32 qual )
{
DBG_PRINT( "HCF ASSERT: Line %d, VAL: 0x%.8x\n", line_number, /*;?*/(u32)qual );
} // msf_assert
/*============================================================================*/
/*******************************************************************************
* wl_parse_ds_ie()
*******************************************************************************
*
* DESCRIPTION:
*
* This function parses the Direct Sequence Parameter Set IE, used to
* determine channel/frequency information.
*
* PARAMETERS:
*
* probe_rsp - a pointer to a PROBE_RESP structure containing the probe
* response.
*
* RETURNS:
*
* The channel on which the BSS represented by this probe response is
* transmitting.
*
******************************************************************************/
hcf_8 wl_parse_ds_ie( PROBE_RESP *probe_rsp )
{
int i;
int ie_length = 0;
hcf_8 *buf;
hcf_8 buf_size;
/*------------------------------------------------------------------------*/
if( probe_rsp == NULL ) {
return 0;
}
buf = probe_rsp->rawData;
buf_size = sizeof( probe_rsp->rawData );
for( i = 0; i < buf_size; i++ ) {
if( buf[i] == DS_INFO_ELEM ) {
/* Increment by 1 to get the length, and test it; in a DS element,
length should always be 1 */
i++;
ie_length = buf[i];
if( buf[i] == 1 ) {
/* Get the channel information */
i++;
return buf[i];
}
}
}
/* If we get here, we didn't find a DS-IE, which is strange */
return 0;
} // wl_parse_ds_ie
/*******************************************************************************
* wl_parse_wpa_ie()
*******************************************************************************
*
* DESCRIPTION:
*
* This function parses the Probe Response for a valid WPA-IE.
*
* PARAMETERS:
*
* probe_rsp - a pointer to a PROBE_RESP structure containing the probe
* response
* length - a pointer to an hcf_16 in which the size of the WPA-IE will
* be stored (if found).
*
* RETURNS:
*
* A pointer to the location in the probe response buffer where a valid
* WPA-IE lives. The length of this IE is written back to the 'length'
* argument passed to the function.
*
******************************************************************************/
hcf_8 * wl_parse_wpa_ie( PROBE_RESP *probe_rsp, hcf_16 *length )
{
int i;
int ie_length = 0;
hcf_8 *buf;
hcf_8 buf_size;
hcf_8 wpa_oui[] = WPA_OUI_TYPE;
/*------------------------------------------------------------------------*/
if( probe_rsp == NULL || length == NULL ) {
return NULL;
}
buf = probe_rsp->rawData;
buf_size = sizeof( probe_rsp->rawData );
*length = 0;
for( i = 0; i < buf_size; i++ ) {
if( buf[i] == GENERIC_INFO_ELEM ) {
/* Increment by one to get the IE length */
i++;
ie_length = probe_rsp->rawData[i];
/* Increment by one to point to the IE payload */
i++;
/* Does the IE contain a WPA OUI? If not, it's a proprietary IE */
if( memcmp( &buf[i], &wpa_oui, WPA_SELECTOR_LEN ) == 0 ) {
/* Pass back length and return a pointer to the WPA-IE */
/* NOTE: Length contained in the WPA-IE is only the length of
the payload. The entire WPA-IE, including the IE identifier
and the length, is 2 bytes larger */
*length = ie_length + 2;
/* Back up the pointer 2 bytes to include the IE identifier and
the length in the buffer returned */
i -= 2;
return &buf[i];
}
/* Increment past this non-WPA IE and continue looking */
i += ( ie_length - 1 );
}
}
/* If we're here, we didn't find a WPA-IE in the buffer */
return NULL;
} // wl_parse_wpa_ie
/*******************************************************************************
* wl_print_wpa_ie()
*******************************************************************************
*
* DESCRIPTION:
*
* Function used to take a WPA Information Element (WPA-IE) buffer and
* display it in a readable format.
*
* PARAMETERS:
*
* buffer - the byte buffer containing the WPA-IE
* length - the length of the above buffer
*
* RETURNS:
*
* A pointer to the formatted WPA-IE string. Note that the format used is
* byte-by-byte printing as %02x hex values with no spaces. This is
* required for proper operation with some WPA supplicants.
*
******************************************************************************/
hcf_8 * wl_print_wpa_ie( hcf_8 *buffer, int length )
{
int count;
int rows;
int remainder;
int rowsize = 4;
hcf_8 row_buf[64];
static hcf_8 output[512];
/*------------------------------------------------------------------------*/
memset( output, 0, sizeof( output ));
memset( row_buf, 0, sizeof( row_buf ));
/* Determine how many rows will be needed, and the remainder */
rows = length / rowsize;
remainder = length % rowsize;
/* Format the rows */
for( count = 0; count < rows; count++ ) {
sprintf( row_buf, "%02x%02x%02x%02x",
buffer[count*rowsize], buffer[count*rowsize+1],
buffer[count*rowsize+2], buffer[count*rowsize+3]);
strcat( output, row_buf );
}
memset( row_buf, 0, sizeof( row_buf ));
/* Format the remainder */
for( count = 0; count < remainder; count++ ) {
sprintf( row_buf, "%02x", buffer[(rows*rowsize)+count]);
strcat( output, row_buf );
}
return output;
} // wl_print_wpa_ie
/*============================================================================*/
/*******************************************************************************
* wl_is_a_valid_chan()
*******************************************************************************
*
* DESCRIPTION:
*
* Checks if a given channel is valid
*
* PARAMETERS:
*
* channel - the channel
*
* RETURNS:
*
* 1 if TRUE
* 0 if FALSE
*
******************************************************************************/
int wl_is_a_valid_chan( int channel )
{
int i;
/*------------------------------------------------------------------------*/
/* Strip out the high bit set by the FW for 802.11a channels */
if( channel & 0x100 ) {
channel = channel & 0x0FF;
}
/* Iterate through the matrix and retrieve the frequency */
for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
if( chan_freq_list[i][0] == channel ) {
return 1;
}
}
return 0;
} // wl_is_a_valid_chan
/*============================================================================*/
/*******************************************************************************
* wl_get_chan_from_freq()
*******************************************************************************
*
* DESCRIPTION:
*
* Checks if a given frequency is valid
*
* PARAMETERS:
*
* freq - the frequency
*
* RETURNS:
*
* 1 if TRUE
* 0 if FALSE
*
******************************************************************************/
int wl_is_a_valid_freq( long frequency )
{
int i;
/*------------------------------------------------------------------------*/
/* Iterate through the matrix and retrieve the channel */
for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
if( chan_freq_list[i][1] == frequency ) {
return 1;
}
}
return 0;
} // wl_is_a_valid_freq
/*============================================================================*/
/*******************************************************************************
* wl_get_freq_from_chan()
*******************************************************************************
*
* DESCRIPTION:
*
* Function used to look up the frequency for a given channel on which the
* adapter is Tx/Rx.
*
* PARAMETERS:
*
* channel - the channel
*
* RETURNS:
*
* The corresponding frequency
*
******************************************************************************/
long wl_get_freq_from_chan( int channel )
{
int i;
/*------------------------------------------------------------------------*/
/* Strip out the high bit set by the FW for 802.11a channels */
if( channel & 0x100 ) {
channel = channel & 0x0FF;
}
/* Iterate through the matrix and retrieve the frequency */
for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
if( chan_freq_list[i][0] == channel ) {
return chan_freq_list[i][1];
}
}
return 0;
} // wl_get_freq_from_chan
/*============================================================================*/
/*******************************************************************************
* wl_get_chan_from_freq()
*******************************************************************************
*
* DESCRIPTION:
*
* Function used to look up the channel for a given frequency on which the
* adapter is Tx/Rx.
*
* PARAMETERS:
*
* frequency - the frequency
*
* RETURNS:
*
* The corresponding channel
*
******************************************************************************/
int wl_get_chan_from_freq( long frequency )
{
int i;
/*------------------------------------------------------------------------*/
/* Iterate through the matrix and retrieve the channel */
for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
if( chan_freq_list[i][1] == frequency ) {
return chan_freq_list[i][0];
}
}
return 0;
} // wl_get_chan_from_freq
/*============================================================================*/
/*******************************************************************************
* wl_process_link_status()
*******************************************************************************
*
* DESCRIPTION:
*
* Process the link status message signaled by the device.
*
* PARAMETERS:
*
* lp - a pointer to the device's private structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_process_link_status( struct wl_private *lp )
{
hcf_16 link_stat;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_process_link_status" );
DBG_ENTER( DbgInfo );
if( lp != NULL ) {
//link_stat = lp->hcfCtx.IFB_DSLinkStat & CFG_LINK_STAT_FW;
link_stat = lp->hcfCtx.IFB_LinkStat & CFG_LINK_STAT_FW;
switch( link_stat ) {
case 1:
DBG_TRACE( DbgInfo, "Link Status : Connected\n" );
wl_wext_event_ap( lp->dev );
break;
case 2:
DBG_TRACE( DbgInfo, "Link Status : Disconnected\n" );
break;
case 3:
DBG_TRACE( DbgInfo, "Link Status : Access Point Change\n" );
break;
case 4:
DBG_TRACE( DbgInfo, "Link Status : Access Point Out of Range\n" );
break;
case 5:
DBG_TRACE( DbgInfo, "Link Status : Access Point In Range\n" );
break;
default:
DBG_TRACE( DbgInfo, "Link Status : UNKNOWN (0x%04x)\n", link_stat );
break;
}
}
DBG_LEAVE( DbgInfo );
return;
} // wl_process_link_status
/*============================================================================*/
/*******************************************************************************
* wl_process_probe_response()
*******************************************************************************
*
* DESCRIPTION:
*
* Process the probe responses retunred by the device as a result of an
* active scan.
*
* PARAMETERS:
*
* lp - a pointer to the device's private structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_process_probe_response( struct wl_private *lp )
{
PROBE_RESP *probe_rsp;
hcf_8 *wpa_ie = NULL;
hcf_16 wpa_ie_len = 0;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_process_probe_response" );
DBG_ENTER( DbgInfo );
if( lp != NULL ) {
probe_rsp = (PROBE_RESP *)&lp->ProbeResp;
wl_endian_translate_event( (ltv_t *)probe_rsp );
DBG_TRACE( DbgInfo, "(%s) =========================\n", lp->dev->name );
DBG_TRACE( DbgInfo, "(%s) length : 0x%04x.\n", lp->dev->name,
probe_rsp->length );
if( probe_rsp->length > 1 ) {
DBG_TRACE( DbgInfo, "(%s) infoType : 0x%04x.\n", lp->dev->name,
probe_rsp->infoType );
DBG_TRACE( DbgInfo, "(%s) signal : 0x%02x.\n", lp->dev->name,
probe_rsp->signal );
DBG_TRACE( DbgInfo, "(%s) silence : 0x%02x.\n", lp->dev->name,
probe_rsp->silence );
DBG_TRACE( DbgInfo, "(%s) rxFlow : 0x%02x.\n", lp->dev->name,
probe_rsp->rxFlow );
DBG_TRACE( DbgInfo, "(%s) rate : 0x%02x.\n", lp->dev->name,
probe_rsp->rate );
DBG_TRACE( DbgInfo, "(%s) frame cntl : 0x%04x.\n", lp->dev->name,
probe_rsp->frameControl );
DBG_TRACE( DbgInfo, "(%s) durID : 0x%04x.\n", lp->dev->name,
probe_rsp->durID );
DBG_TRACE( DbgInfo, "(%s) address1 : %s\n", lp->dev->name,
DbgHwAddr( probe_rsp->address1 ));
DBG_TRACE( DbgInfo, "(%s) address2 : %s\n", lp->dev->name,
DbgHwAddr( probe_rsp->address2 ));
DBG_TRACE( DbgInfo, "(%s) BSSID : %s\n", lp->dev->name,
DbgHwAddr( probe_rsp->BSSID ));
DBG_TRACE( DbgInfo, "(%s) sequence : 0x%04x.\n", lp->dev->name,
probe_rsp->sequence );
DBG_TRACE( DbgInfo, "(%s) address4 : %s\n", lp->dev->name,
DbgHwAddr( probe_rsp->address4 ));
DBG_TRACE( DbgInfo, "(%s) datalength : 0x%04x.\n", lp->dev->name,
probe_rsp->dataLength );
DBG_TRACE( DbgInfo, "(%s) DA : %s\n", lp->dev->name,
DbgHwAddr( probe_rsp->DA ));
DBG_TRACE( DbgInfo, "(%s) SA : %s\n", lp->dev->name,
DbgHwAddr( probe_rsp->SA ));
#ifdef WARP
DBG_TRACE( DbgInfo, "(%s) channel : %d\n", lp->dev->name,
probe_rsp->channel );
DBG_TRACE( DbgInfo, "(%s) band : %d\n", lp->dev->name,
probe_rsp->band );
#else
DBG_TRACE( DbgInfo, "(%s) lenType : 0x%04x.\n", lp->dev->name,
probe_rsp->lenType );
#endif // WARP
DBG_TRACE( DbgInfo, "(%s) timeStamp : %d.%d.%d.%d.%d.%d.%d.%d\n",
lp->dev->name,
probe_rsp->timeStamp[0],
probe_rsp->timeStamp[1],
probe_rsp->timeStamp[2],
probe_rsp->timeStamp[3],
probe_rsp->timeStamp[4],
probe_rsp->timeStamp[5],
probe_rsp->timeStamp[6],
probe_rsp->timeStamp[7]);
DBG_TRACE( DbgInfo, "(%s) beaconInt : 0x%04x.\n", lp->dev->name,
probe_rsp->beaconInterval );
DBG_TRACE( DbgInfo, "(%s) capability : 0x%04x.\n", lp->dev->name,
probe_rsp->capability );
DBG_TRACE( DbgInfo, "(%s) SSID len : 0x%04x.\n", lp->dev->name,
probe_rsp->rawData[1] );
if( probe_rsp->rawData[1] > 0 ) {
char ssid[HCF_MAX_NAME_LEN];
memset( ssid, 0, sizeof( ssid ));
strncpy( ssid, &probe_rsp->rawData[2],
probe_rsp->rawData[1] );
DBG_TRACE( DbgInfo, "(%s) SSID : %s\n",
lp->dev->name, ssid );
}
/* Parse out the WPA-IE, if one exists */
wpa_ie = wl_parse_wpa_ie( probe_rsp, &wpa_ie_len );
if( wpa_ie != NULL ) {
DBG_TRACE( DbgInfo, "(%s) WPA-IE : %s\n",
lp->dev->name, wl_print_wpa_ie( wpa_ie, wpa_ie_len ));
}
DBG_TRACE( DbgInfo, "(%s) flags : 0x%04x.\n",
lp->dev->name, probe_rsp->flags );
}
DBG_TRACE( DbgInfo, "\n" );
/* If probe response length is 1, then the scan is complete */
if( probe_rsp->length == 1 ) {
DBG_TRACE( DbgInfo, "SCAN COMPLETE\n" );
lp->probe_results.num_aps = lp->probe_num_aps;
lp->probe_results.scan_complete = TRUE;
/* Reset the counter for the next scan request */
lp->probe_num_aps = 0;
/* Send a wireless extensions event that the scan completed */
wl_wext_event_scan_complete( lp->dev );
} else {
/* Only copy to the table if the entry is unique; APs sometimes
respond more than once to a probe */
if( lp->probe_num_aps == 0 ) {
/* Copy the info to the ScanResult structure in the private
adapter struct */
memcpy( &( lp->probe_results.ProbeTable[lp->probe_num_aps] ),
probe_rsp, sizeof( PROBE_RESP ));
/* Increment the number of APs detected */
lp->probe_num_aps++;
} else {
int count;
int unique = 1;
for( count = 0; count < lp->probe_num_aps; count++ ) {
if( memcmp( &( probe_rsp->BSSID ),
lp->probe_results.ProbeTable[count].BSSID,
ETH_ALEN ) == 0 ) {
unique = 0;
}
}
if( unique ) {
/* Copy the info to the ScanResult structure in the
private adapter struct. Only copy if there's room in the
table */
if( lp->probe_num_aps < MAX_NAPS )
{
memcpy( &( lp->probe_results.ProbeTable[lp->probe_num_aps] ),
probe_rsp, sizeof( PROBE_RESP ));
}
else
{
DBG_WARNING( DbgInfo, "Num of scan results exceeds storage, truncating\n" );
}
/* Increment the number of APs detected. Note I do this
here even when I don't copy the probe response to the
buffer in order to detect the overflow condition */
lp->probe_num_aps++;
}
}
}
}
DBG_LEAVE( DbgInfo );
return;
} // wl_process_probe_response
/*============================================================================*/
/*******************************************************************************
* wl_process_updated_record()
*******************************************************************************
*
* DESCRIPTION:
*
* Process the updated information record message signaled by the device.
*
* PARAMETERS:
*
* lp - a pointer to the device's private structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_process_updated_record( struct wl_private *lp )
{
DBG_FUNC( "wl_process_updated_record" );
DBG_ENTER( DbgInfo );
if( lp != NULL ) {
lp->updatedRecord.u.u16[0] = CNV_LITTLE_TO_INT( lp->updatedRecord.u.u16[0] );
switch( lp->updatedRecord.u.u16[0] ) {
case CFG_CUR_COUNTRY_INFO:
DBG_TRACE( DbgInfo, "Updated Record: CFG_CUR_COUNTRY_INFO\n" );
wl_connect( lp );
break;
case CFG_PORT_STAT:
DBG_TRACE( DbgInfo, "Updated Record: WAIT_FOR_CONNECT (0xFD40)\n" );
//wl_connect( lp );
break;
default:
DBG_TRACE( DbgInfo, "UNKNOWN: 0x%04x\n",
lp->updatedRecord.u.u16[0] );
}
}
DBG_LEAVE( DbgInfo );
return;
} // wl_process_updated_record
/*============================================================================*/
/*******************************************************************************
* wl_process_assoc_status()
*******************************************************************************
*
* DESCRIPTION:
*
* Process the association status event signaled by the device.
*
* PARAMETERS:
*
* lp - a pointer to the device's private structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_process_assoc_status( struct wl_private *lp )
{
ASSOC_STATUS_STRCT *assoc_stat;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_process_assoc_status" );
DBG_ENTER( DbgInfo );
if( lp != NULL ) {
assoc_stat = (ASSOC_STATUS_STRCT *)&lp->assoc_stat;
wl_endian_translate_event( (ltv_t *)assoc_stat );
switch( assoc_stat->assocStatus ) {
case 1:
DBG_TRACE( DbgInfo, "Association Status : STA Associated\n" );
break;
case 2:
DBG_TRACE( DbgInfo, "Association Status : STA Reassociated\n" );
break;
case 3:
DBG_TRACE( DbgInfo, "Association Status : STA Disassociated\n" );
break;
default:
DBG_TRACE( DbgInfo, "Association Status : UNKNOWN (0x%04x)\n",
assoc_stat->assocStatus );
break;
}
DBG_TRACE( DbgInfo, "STA Address : %s\n",
DbgHwAddr( assoc_stat->staAddr ));
if(( assoc_stat->assocStatus == 2 ) && ( assoc_stat->len == 8 )) {
DBG_TRACE( DbgInfo, "Old AP Address : %s\n",
DbgHwAddr( assoc_stat->oldApAddr ));
}
}
DBG_LEAVE( DbgInfo );
return;
} // wl_process_assoc_status
/*============================================================================*/
/*******************************************************************************
* wl_process_security_status()
*******************************************************************************
*
* DESCRIPTION:
*
* Process the security status message signaled by the device.
*
* PARAMETERS:
*
* lp - a pointer to the device's private structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_process_security_status( struct wl_private *lp )
{
SECURITY_STATUS_STRCT *sec_stat;
/*------------------------------------------------------------------------*/
DBG_FUNC( "wl_process_security_status" );
DBG_ENTER( DbgInfo );
if( lp != NULL ) {
sec_stat = (SECURITY_STATUS_STRCT *)&lp->sec_stat;
wl_endian_translate_event( (ltv_t *)sec_stat );
switch( sec_stat->securityStatus ) {
case 1:
DBG_TRACE( DbgInfo, "Security Status : Dissassociate [AP]\n" );
break;
case 2:
DBG_TRACE( DbgInfo, "Security Status : Deauthenticate [AP]\n" );
break;
case 3:
DBG_TRACE( DbgInfo, "Security Status : Authenticate Fail [STA] or [AP]\n" );
break;
case 4:
DBG_TRACE( DbgInfo, "Security Status : MIC Fail\n" );
break;
case 5:
DBG_TRACE( DbgInfo, "Security Status : Associate Fail\n" );
break;
default:
DBG_TRACE( DbgInfo, "Security Status : UNKNOWN (0x%04x)\n",
sec_stat->securityStatus );
break;
}
DBG_TRACE( DbgInfo, "STA Address : %s\n",
DbgHwAddr( sec_stat->staAddr ));
DBG_TRACE( DbgInfo, "Reason : 0x%04x \n", sec_stat->reason );
}
DBG_LEAVE( DbgInfo );
return;
} // wl_process_security_status
/*============================================================================*/
int wl_get_tallies(struct wl_private *lp,
CFG_HERMES_TALLIES_STRCT *tallies)
{
int ret = 0;
int status;
CFG_HERMES_TALLIES_STRCT *pTallies;
DBG_FUNC( "wl_get_tallies" );
DBG_ENTER(DbgInfo);
/* Get the current tallies from the adapter */
lp->ltvRecord.len = 1 + HCF_TOT_TAL_CNT * sizeof(hcf_16);
lp->ltvRecord.typ = CFG_TALLIES;
status = hcf_get_info(&(lp->hcfCtx), (LTVP)&(lp->ltvRecord));
if( status == HCF_SUCCESS ) {
pTallies = (CFG_HERMES_TALLIES_STRCT *)&(lp->ltvRecord.u.u32);
memcpy(tallies, pTallies, sizeof(*tallies));
DBG_TRACE( DbgInfo, "Get tallies okay, dixe: %d\n", sizeof(*tallies) );
} else {
DBG_TRACE( DbgInfo, "Get tallies failed\n" );
ret = -EFAULT;
}
DBG_LEAVE( DbgInfo );
return ret;
}
/*******************************************************************************
* wl_atoi()
*******************************************************************************
*
* DESCRIPTION:
*
* Believe it or not, we need our own implementation of atoi in the kernel.
*
* PARAMETERS:
*
* string - the ASCII string to convert to an integer
*
* RETURNS:
*
* unsigned integer
*
******************************************************************************/
unsigned int wl_atoi( char *string )
{
unsigned int base = 10; //default to decimal
unsigned int value = 0;
unsigned int c;
int i = strlen( string );
if ( i > 2 && string[0] == '0' && ( string[1] | ('X'^'x') ) == 'x' ) {
base = 16;
string +=2;
}
while ( ( c = *string++ ) != '\0' ) {
if ( value > UINT_MAX / base ) { //test for overrun
DBG_FUNC( "wl_atoi" ); //don't overload the log file with good messages
DBG_ENTER( DbgInfo );
DBG_ERROR( DbgInfo, "string \"%s\", lenght exceeds expectations\n", string );
printk( "<1>string \"%s\", lenght exceeds expectations\n", string );
DBG_LEAVE( DbgInfo );
break;
}
c -= '0';
if ( 0 <= c && c <= 9 ) value = base * value + c;
else if ( base == 16 ) {
c += '0';
c |= 'A'^'a';
c = c - 'a'+ 10;
if ( 10 <= c && c <= 15 ) value = base * value + c;
}
}
return value;
} // wl_atoi
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_util.h,v $
*
******************************************************************************/
#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 );
int hexdigit2int( char c );
void wl_hcf_error( struct net_device *dev, int hcfStatus );
void wl_endian_translate_event( ltv_t *pLtv );
int wl_has_wep( IFBP ifbp );
#if DBG
const char *DbgHwAddr( unsigned char *hwAddr );
#endif // DBG
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 );
unsigned int wl_atoi( char *string );
#endif // __WL_UTIL_H__
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* This 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/08/04 12:36:10 $
* $Revision: 1.7 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_version.h,v $
*
******************************************************************************/
#ifndef __WL_VERSION_H__
#define __WL_VERSION_H__
/*******************************************************************************
* include files
******************************************************************************/
//#include <linux/config.h>
#include <linux/version.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
#ifdef BUS_PCMCIA
#if defined HERMES25
#define MODULE_NAME DRIVER_NAME "_h25_cs"
#else
#define MODULE_NAME DRIVER_NAME "_h2_cs"
#endif /* HERMES25 */
#elif defined BUS_PCI
#if defined HERMES25
#define MODULE_NAME DRIVER_NAME "_h25"
#else
#define MODULE_NAME DRIVER_NAME "_h2"
#endif /* HERMES25 */
#endif /* BUS_XXX */
#ifdef DBG
#define MODULE_DATE __DATE__ " " __TIME__
#else
#define MODULE_DATE "07/18/2004 13:30:00"
#endif // DBG
//#define STR2(m) #m
//#define STR1(m) STR2(m)
//#define MODULE_NAME STR1( MOD_NAME )
#define VERSION_INFO MODULE_NAME " v" DRV_VERSION_STR \
" for " BUS_TYPE ", " \
MODULE_DATE " by " VENDOR_NAME
#define WIRELESS_SUPPORT 15 // The version of wireless extensions we support
//#define DBG_MOD_NAME DRIVER_NAME ":" BUS_TYPE ":" HW_TYPE ":" FW_TYPE
#define DBG_MOD_NAME MODULE_NAME
/*******************************************************************************
* bus architechture 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
*/
#if USE_WEXT
#define HAS_WIRELESS_EXTENSIONS
#endif // USE_WEXT
#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__
This source diff could not be displayed because it is too large. You can view the blob instead.
/*******************************************************************************
* 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.
*
******************************************************************************/
/*******************************************************************************
* VERSION CONTROL INFORMATION
*******************************************************************************
*
* $Author: nico $
* $Date: 2004/07/19 08:16:15 $
* $Revision: 1.2 $
* $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_wext.h,v $
*
******************************************************************************/
#ifndef __WL_WEXT_H__
#define __WL_WEXT_H__
#ifdef WIRELESS_EXT
/*******************************************************************************
* 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;
#else
#error WIRELESS_EXT
#endif // WIRELESS_EXT
#endif // __WL_WEXT_H__
config WLAGS49_H25
tristate "Linksys HERMES II.5 WCF54G_Wireless-G_CompactFlash_Card"
depends on WLAN_80211 && WIRELESS_EXT
---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, addapted for Ubuntu 9.04.
#
# Makefile for wlags49_h2_cs.ko and wlags49_h25_cs.ko
#
# Default build for Hermes-II base cards (possibly identified with
# "manfid: 0x0156, 0x0003" in "pccardctl ident" output), comment
# -DHERMES25 below
#
# If you want to build for Hermes-II.5 base cards (possibly identified with
# "manfid: 0x0156, 0x0004" in "pccardctl ident" output), uncomment
# -DHERMES25 below
#
# If you want to build AP support (untested), comment out -DSTA_ONLY
INSTALLDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless
EXTRA_CFLAGS += -I$(KERNELDIR)/include
EXTRA_CFLAGS += -I$(src) \
-DBUS_PCMCIA \
-DUSE_WPA \
-DUSE_WEXT \
-DSTA_ONLY \
-DWVLAN_49 \
-DHERMES25 \
# -DDBG \
# -DDBG_LVL=5 \
# -DUSE_UIL \
# -DUSE_PROFILE \
ifeq ($(findstring HERMES25,$(EXTRA_CFLAGS)),)
WLNAME := wlags49_h2_cs
$(WLNAME)-y := sta_h2.o
ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
$(WLNAME)-y += ap_h2.o
endif
else
WLNAME=wlags49_h25_cs
$(WLNAME)-y := sta_h25.o
ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
$(WLNAME)-y += ap_h25.o
endif
endif
# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
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
$(WLNAME)-$(CONFIG_SYSFS) += wl_sysfs.o
# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
clean:
rm -fr *.o *.ko *.mod.c *.mod.o .*.*.cmd Module.symvers \
Module.markers modules.order .tmp_versions
install: default
-rmmod $(WLNAME)
install -d $(INSTALLDIR)
install -m 0644 -o root -g root $(WLNAME).ko $(INSTALLDIR)
/sbin/depmod -aq
=======================================================================
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.
=======================================================================
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/ap_h25.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/debug.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhf.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhf.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/dhfcfg.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcf.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcf.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcfcfg.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/hcfdef.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/mdd.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/mmd.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/mmd.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/sta_h25.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_cs.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_cs.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_enc.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_enc.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_if.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_internal.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_main.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_main.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_netdev.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_netdev.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_priv.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_priv.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_profile.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_profile.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_sysfs.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_sysfs.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_util.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_util.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_version.h"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_wext.c"
/* Use common source from wlags49_h2 */
#include "../wlags49_h2/wl_wext.h"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment