447 lines
24 KiB

* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
* --------------------------------------------------------------------
* linux-wlan
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
* Alternatively, the contents of this file may be used under the
* terms of the GNU Public License version 2 (the "GPL"), in which
* case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision
* by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this
* file under either the MPL or the GPL.
* --------------------------------------------------------------------
* Inquiries regarding the linux-wlan Open Source project can be
* made directly to:
* AbsoluteValue Systems Inc.
* --------------------------------------------------------------------
* Portions of the development of this software were funded by
* Intersil Corporation as part of PRISM(R) chipset product development.
* --------------------------------------------------------------------
- Made USB port reset in open() an option, DEFAULT IS OFF.
- Cleaned up the top edge of hfa384x*.c (needs some more).
- Added the notion of CMD vs. AUX format MAC chip addresses.
- Modified isgoodpdr() to accept anything less than 0x1000.
- Updated the wlan-ng scripts for the new open/close behavior.
- Fixed a bunch of issues that caused bad breakage for hot-plugging
the USB module.
- Added a module argument to enable/disable the MAC (or usbport) reset
performed in prism2sta_open().
- Moved the port reset corereset() and the call to the open(). This
gets the port reset out of the probe_usb() context and appears to
solve the recursive probe problem in some cases.
- Cleaned up the overlength usb packet problems
- Added rmemreq/resp and wmemreq/resp support
- Fixed some of the 64-byte packet problems in a few commands.
- Note: hfa384x*.c are currently undergoing some changes. I believe
these changes have broken some things for pcmcia/pci/plx support. I'm
not certain since I haven't tested them. As such, this is a USB ONLY
- Cleaned up the use of hfa384x_drvr_*() vs. hfa384x_cmd_*() a little.
This is a work in progress.
- Rewrote the USB request/response machine again.
- Added tnewsham's keygen program to the add-ons directory. I don't
include it in the overall build because I'm not comfortable with making
this package dependent on openssl right now. It is supposed to generate
keys in a manner identical to the windows software. I have not personally
verified this. If someone wants to contribute more complete build
instructions for this program, please do.
- IMPORTANT! Note that we've changed the up/down behavior. You now
must 'up' the linux netdevice interface (e.g. ifconfig wlan0 up) prior
to using wlanctl-ng. Also, wlanctl commands aren't available after
"ifconfig down". From a low-level perspective, this is how most
linux netdevices work. We originally started trying to create a
setup where "ifconfig up" on an interface that wasn't associated would
fail. With PCI and even more so with USB, that has proven unworkable.
The idea now is:
Step 1: ifconfig wlan0 up
Enables the hardware so it's ready to handle wlanctl-ng commands.
Step 2: wlanctl-ng <various commands>, repeat
Set up the dot11 configuration and get yourself associated or
Step 3: ifconfig wlan0 <address>
After getting a "real" 802.11 connection, assign the address
to the interface (via static numbers, dhcp or whatever).
Note that it is very important that you do _not_ down the interface
between the initial 'ifconfig up' and the later ifconfig that assigns
the address. 'ifconfig down' will shut down and reset the hardware.
If you down the interface, all that good work in step 2 will be lost.
- Rewrote the USB request/response machine
- Moved all memmapped/irq interface elements from prism2*.c to hfa384x.c
in preparation for adding USB support.
- Fixed 'make clean' so it doesn't generate .depend files.
- Removed some leftover pcmcia-cs dependencies for non-pcmcia targets.
- Added module param "prism2_ignorevcc". If set to non-zero, we just
accept the Voltage we get from pcmcia-cs without checking. USE WITH
- Changed the voltage setting code such that we never try to change it.
- Added NETGEAR PCI info.
- Fixed a problem with the interrrupt enable in mlme_start().
- Fixed the netdevice_t problem.
- Added some new CIS entries.
- Fixed some byte order things re: dblythe's patch. The problem went
a little farther than the patch so I had to change some things.
- Added lye's fix for the netdevice_t problem on various targets.
- Added an Ad-Hoc support patch from ????? (please identify yourself,
it's a nice bit of code and stays within the spirit of things). Adhoc
still needs work though. Remember, only the _first_ STA in an IBSS
should issue an MLME-Start.request. All the rest should scan/join
- Re-added the monitor mode stuff. At this point I guess Intersil won't
be taking it out. Many thanks to those who maintained the patches and
my apologies for the hassle.
- As part of the PCI stuff, rewrote the scripts for 'fixed' (i.e. non-
hotswappable) cards like the ISL3874 and PLX based PCI adapters.
- Added support for the dot11req_reset command. It should perform a
complete reset of the MAC and driver. Note that the MAC needs to be
completely reconfigured from userland after the reset has occurred.
Also added an internal call to the reset function when unloading a
PCI or PLX driver. We need this reset to make sure that the card is
no longer generating interrupts. Fixed this problem: If the driver
is unloaded, the card is still generating interrupts, and another active
device+driver is using the same interrupt....system locks up. DDT.
- Rewrote the PCI support for PLX and ISL3874. The rewrite was targeted
at 2.4.7 with additional code to provide backward compatibility for
2.2.x. NOTE: the PCI code still doesn't support the PCI power
management stuff. It will probably need more work when laptops w/
the ISL3874 based mini-PCI cards show up.
- Whoops, forgot to put this in the original 0.1.9 release
- Added support for the ISL3874 based mini-pci card. Also cleaned
up some of the PLX stuff (needs more work though).
- Fixed some script bugs relating to WEP and generated keys.
- Fixed the autojoin auth type control
- Added/Changed some PDR numbers (thanks to BroMax for supplying hardware)
- Received a large patch from bjames of Rebel Computing. Here's a
summary in his words:
> Minor bugs (not already found in 0.1.8-pre10):
> 1. p80211metamsg.c:
> - Wrong conversion functions for "p2req_mmi_read" (value). enumint ==>
> int
> 2. prism2sta.c:
> - "dot11_desired_bss_type" in "priv" structure left at 0 (i.e. an
> invalid value) after initialization so mibget could not retrieve a value
> unless the network was started. Initialized to 1.
> 3. prism2mgmt.c:
> - "prism2mgmt_channel_info()" uses HFA384x_RID_SCANREQUEST_LEN instead
> of ...CHANNELINFOREQUEST... (However, they're the same size.)
> 4. prism2mgmt.c:
> - "prism2mgmt_auxport_read()" did not set the resultcode to "success" if
> the read succeeded.
> 5. p80211types.c:
> - "p80211_fromtext_displaystr()" tests for length < maxlen. This
> probably should have been <= maxlen (i.e. excluding the \0), based on
> the maxlen values in "p80211metamib.c" and based in what
> "p80211_isvalid_displaystr()" checks. Also,
> "p80211_isvalid_displaystr()" assumes that "pstr->len" includes the \0
> when it does the minlen check. It probably shouldn't do this.
> 6. p80211metamsg.c:
> - dot11_reassociate command has a "dot11req_reassociatefailuretimeout"
> argument which should probably be "reassociatefailuretimeout".
> 7. prism2sta.c:
> - WLAN_PCI ==> WLAN_PLX in "init_module()".
> Enhancements:
> 1. All Prism2 RIDs are now accessible. Unfortunately, rather a lot was
> changed to do this:
> - Rather than cut and paste many more cases into the monster
> "prism2mib.c" switch statement, "prism2mib.c" was completely reworked to
> be table-driven with a bunch of semi-generic processing functions. That
> made it a lot easier to add new DIDs. Several RID lengths in hfa384x.h
> had to be changed from 0 to their actual value since more of the lengths
> get used, now. (Changed: prism2mib.c, hfa384x.h)
> - 2 new data types were added to "p80211types.c". One to handle integer
> arrays (i.e. multi-word RID that a DID didn't need to be
> added for each element) and bit arrays (just to make them easier to deal
> with). However, there wasn't enough room in the packed DID to add new
> types, so the type was removed from the DID (and from P80211DID_MKID)
> and a function written to determine the type based on the conversion
> functions. (Changed: p80211meta.h, p80211types.h, p80211meta.c,
> p80211types.c, mkmetastruct.c, p80211metamib.c p80211metamsg.c,
> wlanctl/help.c)
> Integer arrays look like: p2PRIIdentity=21,0,0,3
> "meta->maxlen" specifies the number of integers.
> Bit arrays look like: p2ChannelList=0,1,2,3,4,5,6,7,8,9,10
> for bits 0-10. "meta->min" and "meta->max" give the range of bits
> allowed.
> - The "p2Table" DIDs were split into p2Static, p2Dynamic, p2Behavior,
> etc., in order to correspond with the Prism Driver Programmer's Manual.
> A few of the names were also changed in order to correspond to the
> manual. (Changed: p80211metamib.c, prism2mib.c) The changed names (of
> the supported DIDs) are:
> p2SystemScale ==> p2CnfSystemScale
> p2MaxDataLen ==> p2CnfMaxDataLength
> p2EnhancePowerSaveMode ==> p2CnfPMEPS
> p2MaxSleepDurection ==> p2CnfMaxSleepDuration
> p2PMHoldoverDuration ==> p2CnfPMHoldoverDuration
> p2OwnName ==> p2CnfOwnName
> p2McastPMBuffer ==> p2CnfMulticastPMBuffering
> p2TxControlDepth ==>p2CnfTxControl
> p2RoamingMode ==> p2CnfRoamingMode
> p2MMLife ==> p2CnfMMLife
> p2AltRetryCount ==> p2CnfAltRetryCount
> p2ReserveDuration ==> p2CnfAPPCFInfo (bit 1)
> p2ExcludeLongPreamble ==> p2CnfExcludeLongPreamble
> - Added new RIDS from the Prism Driver Programmer's Manual 1.70
> (2000-11-29). Added p2CnfPriorityQUsage, p2CnfTimCtrl,
> p2CnfThirty2Tally, p2CnfEnhSecurity. Added "algorithm" to AuthRequest.
> 2. A user utility program was written to do such things as query all
> read-able MIBs, query all write-able MIBs, set all write-able MIBs,
> etc. A "p2req_enable" command was added (similar to the
> "dot11req_start" command but without requiring all the 802.11
> arguments). This allows the driver to be started in a straight forward
> manner, simply by setting all write-able MIBs and then enabling it.
> (Changed: p80211metamsg.c, prism2sta.c, prism2mgmt.c, prism2mgmt.h)
> 3. Support added for Prism2 CommTallies and a DID added to query the
> values. The values will come back as an array of integers. Support
> also added for 32-bit tallies (i.e. p2CnfThirty2Tally). (Changed:
> prism2mib.c, prism2sta.c, prism2mgmt.h, p80211metamib.c, hfa384x.h)
> 4. Access Point support:
> - Added support for maintaining a list of authenticated/associated
> stations and a DID added to query the list. (Changed: prism2mib.c,
> prism2sta.c, prism2mgmt.h, p80211metamib.c)
> - Added support for host control of authentications (allowed and denied
> lists) and a DID added to set and query the lists. Support for Prism2
> AuthenticationRequest information frames. Not tested yet. (Changed:
> prism2mib.c, prism2sta.c, prism2mgmt.h, p80211metamib.c)
> - Added support for Prism2 PowerSaveUserCount information frames and a
> DID added to query the value. (Changed: prism2mib.c, prism2sta.c,
> prism2mgmt.h, p80211metamib.c)
> - Added a new data type to "p80211types.c" to handle arrays of MAC
> address (used to set/query the above lists). (Changed: p80211types.h,
> p80211types.c, mkmetastruct.c, wlanctl/help.c)
> Address arrays look like:
> p2Authenticated=00:50:51:52:53:54,00:60:61:62:63:64,00:70:71:72:73:74
> "meta->maxlen" specifies the maximum number of addresses.
> - Unforetunately, all these lists are limited in length by the length of
> the mibattribute parameter in mibget/mibset. This is not very nice but
> it was the quickest/easiest way to implement it.
> 5. Changed maximum mibattribute length from 256 to 384 to support
> querying commtallies and MAC address arrays. (Changed: p80211types.h)
> 6. 128-bit WEP key support:
> - Rather than creating different MIB's for 64-bit and 128-bit WEP keys,
> the "octetstr" definition for dot11WEPDefaultKey0, etc., was changed to
> allow for a range of lengths (e.g. from 5 to 13). The
> dot11WEP128DefaultKey0, etc., MIBs were removed. (Changed:
> p80211meta.c, p80211types.c, p80211metamib.c, p80211metamsg.c,
> mkmetastruct.c, wlanctl/help.c)
> - WLAN_WEP_KEYLEN changed to WLAN_WEP_MAXKEYLEN and set to 13.
> (Changed: p80211hdr.h)
> - Optional "length" argument added to "nwepgen.c" so that either 5 or 13
> byte keys can be handled. (Changed: nwepgen.c)
> - 128-bit-specific parts of "etc/pcmcia/wlan-ng" are no longer
> necessary. Genstr changes to handle generation of 13-byte keys using
> nwepgen. (Changed: etc/pcmcia/wlan-ng)
> - WEPDefaultKey's were made write-only. A new
> "P80211ENUM_resultcode_cant_get_writeonly_mib" was added. (Changed:
> p80211types.h, p80211types.c, p80211metamib.c, prism2mib.c)
> 7. Access code in DID:
> - This was changed from a single bit flag (P80211DID_ACCESS_READONLY and
> P80211DID_ACCESS_READWRITE) to a pair of flags (P80211DID_ACCESS_READ
> and P80211DID_ACCESS_WRITE) since some MIBs are read/write, some are
> read-only, and some are write-only (e.g. WEP keys). This makes it
> easier to determine which MIBs are read-able and write-able without
> having to go all the way to the driver and then interpret a failure
> error code. (Changed: p80211types.h, p80211metamib.c)
> 8. It was a bit of a hassle switching between the station driver and the
> AP driver...which we seemed to be doing a lot. The additional cost was
> not particulary high to simply compile in both station functionality and
> AP functionality. A change was made so that "prism2sta_initmac()" set
> an "ap" flag when it detected AP firmware. "prism2mgmt.c" then uses the
> flag to determine whether or not to allow station-only or AP-only
> commands to be executed. "prism2mib.c" also uses this to handle the
> mode-specific MIBs. This made it possible for the same module to
> support either stations or APs, thereby simplifying the "make", the
> install, and switching between stations and APs. The only thing that
> needs to change, is the value of "IS_AP" in "wlan-ng.opts".
> 9. Miscellaneous small additions:
> - Network state (stopped, started) added and a DID to query it.
> - User-settable comment string added and a DID to set/query it.
> - Some event logging (authentications, associations, etc.) can be
> enabled/disabled at run time rather than only at compile time. A DID
> was added to set/query it.
> - A "p2req_readcis" command (similar to "p2req_readpda") was added.
> 10. Small changes:
> - Added bounds checking to "p80211item_fromtext_boundedint". This was
> the only "fromtext" function that did not already do complete
> validation. It should no longer be necessary to call the "isvalid"
> function if "fromtext" has just been called. The call to "isvalid" was
> removed from "wlanctl". (Changed: p80211types.c, wlanctl.c)
> - "p80211item_maxitemlen()" wasn't really adding much of value so it was
> amalgamated into "p80211item_getoffset()". The DID type is now only
> checked once instead of three times. (Changed: p80211meta.h,
> p80211meta.c)
> - "hfa384x_drvr_setconfig16()" and "hfa384x_drvr_setconfig32()" changed
> their input parameters when converting to hf384x byte order. Potential
> source of bugs. Changed to use a local variable. (Changed: hfa384x.c)
> - ScanRequest, JoinRequest, etc., moved from the "Information Record"
> section to the "Configuration Record" section. (Changed: hfa384x.h)
> - Re-worked "p80211_fromtext_setmibattribute()" to make it a little
> easier to follow the logic. (Changed: p80211types.c)
> - Type of "channellist" argument in "p2req_channel_info" command changed
> from "octetstr" to "bitarray" to make it easier to deal with (can
> specify a variable number of channels and don't need to use hex
> values). (Changed: p80211metamsg.c, prism2mgmt.c)
> - "auxctl" parameter set to HFA384x_AUX_CTL_EXTDS in
> "prism2mgmt_auxport_read()" and "prism2mgmt_auxport_write()" so that
> they are still compatible with 0.1.7. (Changed: prism2mgmt.c)
> - Re-worked "prism2mgmt_set_grpaddr()" and added comments so that it's
> more obvious what is going on. Also, deleted the check which produced
> an error if an attempt was made to delete an address from an empty
> list. This makes things more consistent and predictable (i.e. the same
> as attempting to delete an address which is above the last group
> address...the attempt is simply ignored). Replaced the "memcpy()" call
> with "memmove()" since "memcpy()" is not guaranteed to work with
> overlapping ranges. (Changed: prism2mib.c)
> - Minimum length of "dot11OperationRateSet" changed from 126 to 1 to
> match the 802.11 standard. (Changed: p80211metamib.c)
- Fixed some ci/co related problems pointed out by wbinjie.
- Added ygalayda's startup scripts for PCI in the directory
./etc/wlan_pci. They aren't installed, that will have to be done
by hand. I have not tested these scripts myself.
- Added sbaer's 'NULL check' fix in p80211_indicate_shutdown().
- Added ctedrow's 'alloc not checked' fix in prism2sta_int_rx().
- Added pkundrat's auth mib changes.
- fgrau's conf.modules/modules.conf fix.
- Added ygalayda's submission for the Global Sun GL24110P PLX based
adapter. Also included a Makefile fix.
- Fixed some script bugs relating to 128-bit WEP based on smmclusky's
observations. These changes have not yet been tested by me.
- Added rlazarev's additions to the pcmcia startup scripts
- Added pkundrat's wlandev-name fix for 2.3.99+ kernels
- Fixed some type/(to|from)text mismatches per note from pkundrat
- Fixed some missing MKITEMNAMEs per note from pkundrat
- Added D-LINK and SMC to the linux-wlan-ng.conf file
- Added Zoom, Linksys and Addtron to the linux-wlan-ng.conf file
- Added pkundrat's meta-item minlen stuff.
- Added conditionals for PLX vs. PCMCIA build
- Changed _pci driver filename to _plx
- Fixed undconditional MOD_INC in prismt2sta_open()
- Removed identification of old PCF firmware.
- Fixed version.h generation bug from pre5
- Added dhsu's (Eumitcom) code for supporting the PLX based PCI cards.
- pkundrat's (whoops, sorry peter) PDA display program in ./scripts.
I haven't used it because my perl setup is messed up and I'm perl
- bcarr's patches for alpha boxes.
- wwoods's patches for 2.2.18 and adding bytes received to the
- proskin's patch adding 'network stop'
- Most of proskin's patch containing Configure fixes, adding file
existence checks, and making sure directories are present.
- tgriffin's patch for mrproper/memleak/nullcheck/freeonsuccess.
conf.modules change is already there.
- Added most of jhicks ARM related patches. I had to leave out the
HOST vs. TARGET compile variables in the Makefiles though. Some folks
are using that stuff.
- Added script changes and new mib items to support 128-bit WEP per hong's
- Added conf.modules alias instead of symlink
- Added a compat macro for kfree_s to wlan_compat.h per the suggestion
from rbraun.
- Added pkundrat's 'chinfo' patch
- Added pkundrat's 'small fixes' patch
- Added some contributed patches supporting a fix to our 'reassoc
under load' problem
- Added wlannoenable pcmcia scheme support to prevent card initialization.
- Removed a PDR patch requirement.
- Fixed the "converting eth in unknown mode" bug
- Added APM/ACPI suspend/resume handling
- Added PPC support
- Added Prism test command support
- Integrated patch to fix some structure alignment problems for ARM
- Added multi-transmit buffer support
- And much, much more.....
- Fixed usage of pcmcia scheme file so we're not stomping on the user's
scheme setting.
- Updated the wlan-ng script for the new config variable names and added
configurable download utility and a set of user MIB settings.
- Added support for the Samsung and Z-Com cards.
- Changed the name of the module (from pcmcia's point of view).
- Fixed the "echo \c" problem in Configure
- Added new and rearranged existing wlan-ng.opts configuration variables.
- Created a scheme for "addon software" in the ./src/Makefile
- Made some changes to the target detection conditionals in wlan_compat.h
to better support LinuxPPC (port isn't finished yet).
- Finally fixed the byteorder stuff to use (duh) byteorder.h
- Fixed a bad free of the TX skb when we signal an error to higher layers.
- Moved some code around and added rules to the prism2/driver (new directory
too) Makefile. This is so we build two separate drivers; one for STA,
one for AP. Both drivers are built from the same source files with
the code conditional on the WLAN_AP and WLAN_STA defines.
- Fixed the plugging in prism2dl so it reports ALL missing PDRs.
- Added an anonymously contributed patch that adds support for the -m
and -s cmdline options for prism2dl. Thanks! You know who you are.@-)
- Added some fixes to the dependency file generation.
- Fixed a flash programming timeout miscalculation...and fixed it again
when I introduced an integer promotion problem.
- Added the STA vs. AP conditionals to prism2mgmt. Note that this causes
a few compile time warnings. They're harmless and will go away in the
next release.
- Created the file prism2mib.c to hold all the MIB get/set stuff which is
getting a little out of hand.
- Added pcmcia config support for the Z-Com (supposedly) dual voltage card.
Unfortunately the engineering sample I have doesn't seem to work at 5v,
or it might be the code.....not sure yet. We're still a little
bleeding edge with that card.
- Cleaned up the version, compatibility range, and serial number
log messages.
- Added a loop limit to the interrupt handler. (duh)
- Changed the names of the driver modules for STA and AP. make install
then creates a softlink depending on the make config selection. One
note, both drivers report the same dev_info string to pcmcia-cs. Trying
to load both of them simultaneously would be bad (I have no idea what
would happen, I just thought of it).
- Changed a bunch of types and constants for hfa384x.
- Added functions for a couple of new commands in the hfa384x.
- Began adding support for the Prism2 unique MIB items.