📄 wavelan_cs.h
字号:
* ------------------------------------- * - Revisited multicast code (it was mostly wrong). * - protect code in wv_82593_reconfig with dev->tbusy (oups !) * * Changes made in sixth release (2.9.1a) : * -------------------------------------- * - Change the detection code for multi manufacturer code support * - Correct bug (hang kernel) in init when we were "rejecting" a card * * Changes made in seventh release (2.9.1b) : * ---------------------------------------- * - Update to wireless extensions changes * - Silly bug in card initial configuration (psa_conf_status) * * Changes made in eigth release : * ----------------------------- * - Small bug in debug code (probably not the last one...) * - 1.2.13 support (thanks to Clark Woodworth) * * Changes made for release in 2.9.2b : * ---------------------------------- * - Level threshold is now a standard wireless extension (version 4 !) * - modules parameters types for kernel > 2.1.17 * - updated man page * - Others cleanup from David Hinds * * Changes made for release in 2.9.5 : * --------------------------------- * - byte count stats (courtesy of David Hinds) * - Remove dev_tint stuff (courtesy of David Hinds) * - Others cleanup from David Hinds * - Encryption setting from Brent Elphick (thanks a lot !) * - 'base' to 'u_long' for the Alpha (thanks to Stanislav Sinyagin) * * Changes made for release in 2.9.6 : * --------------------------------- * - fix bug : no longuer disable watchdog in case of bogus interrupt * - increase timeout in config code for picky hardware * - mask unused bits in status (Wireless Extensions) * * Changes integrated by Justin Seger <jseger@MIT.EDU> & David Hinds : * ----------------------------------------------------------------- * - Roaming "hack" from Joe Finney <joe@comp.lancs.ac.uk> * - PSA CRC code from Bob Gray <rgray@bald.cs.dartmouth.edu> * - Better initialisation of the i82593 controller * from Joseph K. O'Sullivan <josullvn+@cs.cmu.edu> * * Changes made for release in 3.0.10 : * ---------------------------------- * - Fix eject "hang" of the driver under 2.2.X : * o create wv_flush_stale_links() * o Rename wavelan_release to wv_pcmcia_release & move up * o move unregister_netdev to wavelan_detach() * o wavelan_release() no longer call wavelan_detach() * o Suppress "release" timer * o Other cleanups & fixes * - New MAC address in the probe * - Reorg PSA_CRC code (endian neutral & cleaner) * - Correct initialisation of the i82593 from Lucent manual * - Put back the watchdog, with larger timeout * - TRANSMIT_NO_CRC is a "normal" error, so recover from it * from Derrick J Brashear <shadow@dementia.org> * - Better handling of TX and RX normal failure conditions * - #ifdef out all the roaming code * - Add ESSID & "AP current address" ioctl stubs * - General cleanup of the code * * Changes made for release in 3.0.13 : * ---------------------------------- * - Re-enable compilation of roaming code by default, but with * do_roaming = 0 * - Nuke `nwid=nwid^ntohs(beacon->domain_id)' in wl_roam_gather * at the demand of John Carol Langford <jcl@gs176.sp.cs.cmu.edu> * - Introduced WAVELAN_ROAMING_EXT for incomplete ESSID stuff. * * Changes made for release in 3.0.15 : * ---------------------------------- * - Change e-mail and web page addresses * - Watchdog timer is now correctly expressed in HZ, not in jiffies * - Add channel number to the list of frequencies in range * - Add the (short) list of bit-rates in range * - Developp a new sensitivity... (sens.value & sens.fixed) * * Changes made for release in 3.1.2 : * --------------------------------- * - Fix check for root permission (break instead of exit) * - New nwid & encoding setting (Wireless Extension 9) * * Changes made for release in 3.1.12 : * ---------------------------------- * - reworked wv_82593_cmd to avoid using the IRQ handler and doing * ugly things with interrupts. * - Add IRQ protection in 82593_config/ru_start/ru_stop/watchdog * - Update to new network API (softnet - 2.3.43) : * o replace dev->tbusy (David + me) * o replace dev->tstart (David + me) * o remove dev->interrupt (David) * o add SMP locking via spinlock in splxx (me) * o add spinlock in interrupt handler (me) * o use kernel watchdog instead of ours (me) * o verify that all the changes make sense and work (me) * - Re-sync kernel/pcmcia versions (not much actually) * - A few other cleanups (David & me)... * * Changes made for release in 3.1.22 : * ---------------------------------- * - Check that SMP works, remove annoying log message * * Changes made for release in 3.1.24 : * ---------------------------------- * - Fix unfrequent card lockup when watchdog was reseting the hardware : * o control first busy loop in wv_82593_cmd() * o Extend spinlock protection in wv_hw_config() * * Wishes & dreams: * ---------------- * - Cleanup and integrate the roaming code * (std debug, set DomainID, decay avg and co...) *//***************************** INCLUDES *****************************//* Linux headers that we need */#include <linux/config.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/init.h>#include <linux/sched.h>#include <linux/ptrace.h>#include <linux/slab.h>#include <linux/string.h>#include <linux/timer.h>#include <linux/interrupt.h>#include <linux/spinlock.h>#include <linux/in.h>#include <linux/delay.h>#include <asm/uaccess.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 <linux/fcntl.h>#ifdef CONFIG_NET_PCMCIA_RADIO#include <linux/wireless.h> /* Wireless extensions */#endif/* Pcmcia headers that we need */#include <pcmcia/cs_types.h>#include <pcmcia/cs.h>#include <pcmcia/cistpl.h>#include <pcmcia/cisreg.h>#include <pcmcia/ds.h>#include <pcmcia/version.h>/* Wavelan declarations */#include "i82593.h" /* Definitions for the Intel chip */#include "wavelan.h" /* Others bits of the hardware *//*********************** KERNEL COMPATIBILITY ***********************//* Hyde some uglyness... *//* These are also useful... */#ifndef HAVE_NETIF_QUEUE#define devstate(dev) ((dev->tbusy) | (dev->start << 1))#else /* 2.3.47 */#define devstate(dev) (dev->state)#endif /* 2.3.47 *//************************** DRIVER OPTIONS **************************//* * `#define' or the following symbols to change the behaviour * of the driver... */#define WAVELAN_ROAMING /* Include experimental roaming code *///#define WAVELAN_ROAMING_EXT /* Enable roaming wireless extensions *///#define SET_PSA_CRC /* Set the CRC in PSA (slower) */#define USE_PSA_CONFIG /* Use info from the PSA *///#define STRUCT_CHECK /* Verify padding of structures *///#define EEPROM_IS_PROTECTED /* Doesn't seem to be necessary */#define MULTICAST_AVOID /* Avoid extra multicast (I'm sceptical) *///#define SET_MAC_ADDRESS /* Experimental */#ifdef WIRELESS_EXT /* If wireless extension exist in the kernel *//* Warning : these stuff will slow down the driver... */#define WIRELESS_SPY /* Enable spying addresses *///#define HISTOGRAM /* Enable histogram of sig level... */#endif/****************************** DEBUG ******************************///#define DEBUG_MODULE_TRACE /* Module insertion/removal *///#define DEBUG_CALLBACK_TRACE /* Calls made by Linux *///#define DEBUG_INTERRUPT_TRACE /* Calls to handler *///#define DEBUG_INTERRUPT_INFO /* type of interrupt & so on */#define DEBUG_INTERRUPT_ERROR /* problems *///#define DEBUG_CONFIG_TRACE /* Trace the config functions *///#define DEBUG_CONFIG_INFO /* What's going on... */#define DEBUG_CONFIG_ERRORS /* Errors on configuration *///#define DEBUG_TX_TRACE /* Transmission calls *///#define DEBUG_TX_INFO /* Header of the transmitted packet *///#define DEBUG_TX_FAIL /* Normal failure conditions */#define DEBUG_TX_ERROR /* Unexpected conditions *///#define DEBUG_RX_TRACE /* Transmission calls *///#define DEBUG_RX_INFO /* Header of the transmitted packet *///#define DEBUG_RX_FAIL /* Normal failure conditions */#define DEBUG_RX_ERROR /* Unexpected conditions *///#define DEBUG_PACKET_DUMP 32 /* Dump packet on the screen *///#define DEBUG_IOCTL_TRACE /* Misc call by Linux *///#define DEBUG_IOCTL_INFO /* Various debug info */#define DEBUG_IOCTL_ERROR /* What's going wrong */#define DEBUG_BASIC_SHOW /* Show basic startup info *///#define DEBUG_VERSION_SHOW /* Print version info *///#define DEBUG_PSA_SHOW /* Dump psa to screen *///#define DEBUG_MMC_SHOW /* Dump mmc to screen *///#define DEBUG_SHOW_UNUSED /* Show also unused fields *///#define DEBUG_I82593_SHOW /* Show i82593 status *///#define DEBUG_DEVICE_SHOW /* Show device parameters *//************************ CONSTANTS & MACROS ************************/#ifdef DEBUG_VERSION_SHOWstatic const char *version = "wavelan_cs.c : v23 (SMP + wireless extensions) 20/12/00\n";#endif/* Watchdog temporisation */#define WATCHDOG_JIFFIES (256*HZ/100)/* Fix a bug in some old wireless extension definitions */#ifndef IW_ESSID_MAX_SIZE#define IW_ESSID_MAX_SIZE 32#endif/* ------------------------ PRIVATE IOCTL ------------------------ *//* Wireless Extension Backward compatibility - Jean II * If the new wireless device private ioctl range is not defined, * default to standard device private ioctl range */#ifndef SIOCIWFIRSTPRIV#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE#endif /* SIOCIWFIRSTPRIV */#define SIOCSIPQTHR SIOCIWFIRSTPRIV /* Set quality threshold */#define SIOCGIPQTHR SIOCIWFIRSTPRIV + 1 /* Get quality threshold */#define SIOCSIPROAM SIOCIWFIRSTPRIV + 2 /* Set roaming state */#define SIOCGIPROAM SIOCIWFIRSTPRIV + 3 /* Get roaming state */#define SIOCSIPHISTO SIOCIWFIRSTPRIV + 6 /* Set histogram ranges */#define SIOCGIPHISTO SIOCIWFIRSTPRIV + 7 /* Get histogram values *//*************************** WaveLAN Roaming **************************/#ifdef WAVELAN_ROAMING /* Conditional compile, see above in options */#define WAVELAN_ROAMING_DEBUG 0 /* 1 = Trace of handover decisions */ /* 2 = Info on each beacon rcvd... */#define MAX_WAVEPOINTS 7 /* Max visible at one time */#define WAVEPOINT_HISTORY 5 /* SNR sample history slow search */#define WAVEPOINT_FAST_HISTORY 2 /* SNR sample history fast search */#define SEARCH_THRESH_LOW 10 /* SNR to enter cell search */#define SEARCH_THRESH_HIGH 13 /* SNR to leave cell search */#define WAVELAN_ROAMING_DELTA 1 /* Hysteresis value (+/- SNR) */#define CELL_TIMEOUT 2*HZ /* in jiffies */#define FAST_CELL_SEARCH 1 /* Boolean values... */#define NWID_PROMISC 1 /* for code clarity. */typedef struct wavepoint_beacon{ unsigned char dsap, /* Unused */ ssap, /* Unused */ ctrl, /* Unused */ O,U,I, /* Unused */ spec_id1, /* Unused */ spec_id2, /* Unused */ pdu_type, /* Unused */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -