|
|
1.1 ! root 1: /* ! 2: * Wavelan ISA driver ! 3: * ! 4: * Jean II - HPLB '96 ! 5: * ! 6: * Reorganisation and extension of the driver. ! 7: * ! 8: * This file contain all definition and declarations necessary for the ! 9: * wavelan isa driver. This file is a private header, so it should ! 10: * be included only on wavelan.c !!! ! 11: */ ! 12: ! 13: #ifndef WAVELAN_P_H ! 14: #define WAVELAN_P_H ! 15: ! 16: /************************** DOCUMENTATION **************************/ ! 17: /* ! 18: * This driver provide a Linux interface to the Wavelan ISA hardware ! 19: * The Wavelan is a product of Lucent ("http://wavelan.netland.nl/"). ! 20: * This division was formerly part of NCR and then AT&T. ! 21: * Wavelan are also distributed by DEC (RoamAbout), Digital Ocean and ! 22: * Aironet (Arlan). If you have one of those product, you will need to ! 23: * make some changes below... ! 24: * ! 25: * This driver is still a beta software. A lot of bugs have been corrected, ! 26: * a lot of functionalities are implemented, the whole appear pretty stable, ! 27: * but there is still some area of improvement (encryption, performance...). ! 28: * ! 29: * To know how to use this driver, read the NET3 HOWTO. ! 30: * If you want to exploit the many other fonctionalities, look comments ! 31: * in the code... ! 32: * ! 33: * This driver is the result of the effort of many peoples (see below). ! 34: */ ! 35: ! 36: /* ------------------------ SPECIFIC NOTES ------------------------ */ ! 37: /* ! 38: * wavelan.o is darn too big ! 39: * ------------------------- ! 40: * That's true ! There is a very simple way to reduce the driver ! 41: * object by 33% (yes !). Comment out the following line : ! 42: * #include <linux/wireless.h> ! 43: * ! 44: * MAC address and hardware detection : ! 45: * ---------------------------------- ! 46: * The detection code of the wavelan chech that the first 3 ! 47: * octets of the MAC address fit the company code. This type of ! 48: * detection work well for AT&T cards (because the AT&T code is ! 49: * hardcoded in wavelan.h), but of course will fail for other ! 50: * manufacturer. ! 51: * ! 52: * If you are sure that your card is derived from the wavelan, ! 53: * here is the way to configure it : ! 54: * 1) Get your MAC address ! 55: * a) With your card utilities (wfreqsel, instconf, ...) ! 56: * b) With the driver : ! 57: * o compile the kernel with DEBUG_CONFIG_INFO enabled ! 58: * o Boot and look the card messages ! 59: * 2) Set your MAC code (3 octets) in MAC_ADDRESSES[][3] (wavelan.h) ! 60: * 3) Compile & verify ! 61: * 4) Send me the MAC code - I will include it in the next version... ! 62: * ! 63: * "CU Inactive" message at boot up : ! 64: * ----------------------------------- ! 65: * It seem that there is some weird timings problems with the ! 66: * Intel microcontroler. In fact, this message is triggered by a ! 67: * bad reading of the on board ram the first time we read the ! 68: * control block. If you ignore this message, all is ok (but in ! 69: * fact, currently, it reset the wavelan hardware). ! 70: * ! 71: * To get rid of that problem, there is two solution. The first ! 72: * is to add a dummy read of the scb at the end of ! 73: * wv_82586_config. The second is to add the timers ! 74: * wv_synchronous_cmd and wv_ack (the udelay just after the ! 75: * waiting loops - seem that the controler is not totally ready ! 76: * when it say it is !). ! 77: * ! 78: * In the current code, I use the second solution (to be ! 79: * consistent with the original solution of Bruce Janson). ! 80: */ ! 81: ! 82: /* --------------------- WIRELESS EXTENSIONS --------------------- */ ! 83: /* ! 84: * This driver is the first one to support "wireless extensions". ! 85: * This set of extensions provide you some way to control the wireless ! 86: * caracteristics of the hardware in a standard way and support for ! 87: * applications for taking advantage of it (like Mobile IP). ! 88: * ! 89: * You will need to enable the CONFIG_NET_RADIO define in the kernel ! 90: * configuration to enable the wireless extensions (this is the one ! 91: * giving access to the radio network device choice). ! 92: * ! 93: * It might also be a good idea as well to fetch the wireless tools to ! 94: * configure the device and play a bit. ! 95: */ ! 96: ! 97: /* ---------------------------- FILES ---------------------------- */ ! 98: /* ! 99: * wavelan.c : The actual code for the driver - C functions ! 100: * ! 101: * wavelan.p.h : Private header : local types / vars for the driver ! 102: * ! 103: * wavelan.h : Description of the hardware interface & structs ! 104: * ! 105: * i82586.h : Description if the Ethernet controler ! 106: */ ! 107: ! 108: /* --------------------------- HISTORY --------------------------- */ ! 109: /* ! 110: * (Made with information in drivers headers. It may not be accurate, ! 111: * and I garantee nothing except my best effort...) ! 112: * ! 113: * The history of the Wavelan drivers is as complicated as history of ! 114: * the Wavelan itself (NCR -> AT&T -> Lucent). ! 115: * ! 116: * All started with Anders Klemets <[email protected]>, ! 117: * writting a Wavelan ISA driver for the MACH microkernel. Girish ! 118: * Welling <[email protected]> had also worked on it. ! 119: * Keith Moore modify this for the Pcmcia hardware. ! 120: * ! 121: * Robert Morris <[email protected]> port these two drivers to BSDI ! 122: * and add specific Pcmcia support (there is currently no equivalent ! 123: * of the PCMCIA package under BSD...). ! 124: * ! 125: * Jim Binkley <[email protected]> port both BSDI drivers to freeBSD. ! 126: * ! 127: * Bruce Janson <[email protected]> port the BSDI ISA driver to Linux. ! 128: * ! 129: * Anthony D. Joseph <[email protected]> started modify Bruce driver ! 130: * (with help of the BSDI PCMCIA driver) for PCMCIA. ! 131: * Yunzhou Li <[email protected]> finished is work. ! 132: * Joe Finney <[email protected]> patched the driver to start ! 133: * correctly 2.00 cards (2.4 GHz with frequency selection). ! 134: * David Hinds <[email protected]> integrated the whole in his ! 135: * Pcmcia package (+ bug corrections). ! 136: * ! 137: * I (Jean Tourrilhes - [email protected]) then started to make some ! 138: * patchs to the Pcmcia driver. After, I added code in the ISA driver ! 139: * for Wireless Extensions and full support of frequency selection ! 140: * cards. Then, I've done the same to the Pcmcia driver + some ! 141: * reorganisation. Finally, I came back to the ISA driver to ! 142: * upgrade it at the same level as the Pcmcia one and reorganise ! 143: * the code ! 144: * Loeke Brederveld <[email protected]> from Lucent has given me ! 145: * much needed informations on the Wavelan hardware. ! 146: */ ! 147: ! 148: /* The original copyrights and litteratures mention others names and ! 149: * credits. I don't know what there part in this development was... ! 150: */ ! 151: ! 152: /* By the way : for the copyright & legal stuff : ! 153: * Almost everybody wrote code under GNU or BSD license (or alike), ! 154: * and want that their original copyright remain somewhere in the ! 155: * code (for myself, I go with the GPL). ! 156: * Nobody want to take responsibility for anything, except the fame... ! 157: */ ! 158: ! 159: /* --------------------------- CREDITS --------------------------- */ ! 160: /* ! 161: * This software was developed as a component of the ! 162: * Linux operating system. ! 163: * It is based on other device drivers and information ! 164: * either written or supplied by: ! 165: * Ajay Bakre ([email protected]), ! 166: * Donald Becker ([email protected]), ! 167: * Loeke Brederveld ([email protected]), ! 168: * Brent Elphick <[email protected]>, ! 169: * Anders Klemets ([email protected]), ! 170: * Vladimir V. Kolpakov ([email protected]), ! 171: * Marc Meertens ([email protected]), ! 172: * Pauline Middelink ([email protected]), ! 173: * Robert Morris ([email protected]), ! 174: * Jean Tourrilhes ([email protected]), ! 175: * Girish Welling ([email protected]), ! 176: * Clark Woodworth <[email protected]> ! 177: * Yongguang Zhang <[email protected]>... ! 178: * ! 179: * Thanks go also to: ! 180: * James Ashton ([email protected]), ! 181: * Alan Cox ([email protected]), ! 182: * Allan Creighton ([email protected]), ! 183: * Matthew Geier ([email protected]), ! 184: * Remo di Giovanni ([email protected]), ! 185: * Eckhard Grah ([email protected]), ! 186: * Vipul Gupta ([email protected]), ! 187: * Mark Hagan ([email protected]), ! 188: * Tim Nicholson ([email protected]), ! 189: * Ian Parkin ([email protected]), ! 190: * John Rosenberg ([email protected]), ! 191: * George Rossi ([email protected]), ! 192: * Arthur Scott ([email protected]), ! 193: * Stanislav Sinyagin <[email protected]> ! 194: * Peter Storey, ! 195: * for their assistance and advice. ! 196: * ! 197: * Additional Credits: ! 198: * ! 199: * My developpement has been done under Linux 2.0.x (Debian 1.1) with ! 200: * an HP Vectra XP/60. ! 201: * ! 202: */ ! 203: ! 204: /* ------------------------- IMPROVEMENTS ------------------------- */ ! 205: /* ! 206: * I proudly present : ! 207: * ! 208: * Changes mades in first pre-release : ! 209: * ---------------------------------- ! 210: * - Reorganisation of the code, function name change ! 211: * - Creation of private header (wavelan.p.h) ! 212: * - Reorganised debug messages ! 213: * - More comments, history, ... ! 214: * - mmc_init : configure the PSA if not done ! 215: * - mmc_init : correct default value of level threshold for pcmcia ! 216: * - mmc_init : 2.00 detection better code for 2.00 init ! 217: * - better info at startup ! 218: * - irq setting (note : this setting is permanent...) ! 219: * - Watchdog : change strategy (+ solve module removal problems) ! 220: * - add wireless extensions (ioctl & get_wireless_stats) ! 221: * get/set nwid/frequency on fly, info for /proc/net/wireless ! 222: * - More wireless extension : SETSPY and GETSPY ! 223: * - Make wireless extensions optional ! 224: * - Private ioctl to set/get quality & level threshold, histogram ! 225: * - Remove /proc/net/wavelan ! 226: * - Supress useless stuff from lp (net_local) ! 227: * - kernel 2.1 support (copy_to/from_user instead of memcpy_to/fromfs) ! 228: * - Add message level (debug stuff in /var/adm/debug & errors not ! 229: * displayed at console and still in /var/adm/messages) ! 230: * - multi device support ! 231: * - Start fixing the probe (init code) ! 232: * - More inlines ! 233: * - man page ! 234: * - Lot of others minor details & cleanups ! 235: * ! 236: * Changes made in second pre-release : ! 237: * ---------------------------------- ! 238: * - Cleanup init code (probe & module init) ! 239: * - Better multi device support (module) ! 240: * - name assignement (module) ! 241: * ! 242: * Changes made in third pre-release : ! 243: * --------------------------------- ! 244: * - Be more conservative on timers ! 245: * - Preliminary support for multicast (I still lack some details...) ! 246: * ! 247: * Changes made in fourth pre-release : ! 248: * ---------------------------------- ! 249: * - multicast (revisited and finished) ! 250: * - Avoid reset in set_multicast_list (a really big hack) ! 251: * if somebody could apply this code for other i82586 based driver... ! 252: * - Share on board memory 75% RU / 25% CU (instead of 50/50) ! 253: * ! 254: * Changes made for release in 2.1.15 : ! 255: * ---------------------------------- ! 256: * - Change the detection code for multi manufacturer code support ! 257: * ! 258: * Changes made for release in 2.1.17 : ! 259: * ---------------------------------- ! 260: * - Update to wireless extensions changes ! 261: * - Silly bug in card initial configuration (psa_conf_status) ! 262: * ! 263: * Changes made for release in 2.1.27 & 2.0.30 : ! 264: * ------------------------------------------- ! 265: * - Small bug in debug code (probably not the last one...) ! 266: * - Remove extern kerword for wavelan_probe() ! 267: * - Level threshold is now a standard wireless extension (version 4 !) ! 268: * ! 269: * Changes made for release in 2.1.36 : ! 270: * ---------------------------------- ! 271: * - Encryption setting from Brent Elphick (thanks a lot !) ! 272: * - 'ioaddr' to 'u_long' for the Alpha (thanks to Stanislav Sinyagin) ! 273: * ! 274: * Wishes & dreams : ! 275: * --------------- ! 276: * - Roaming ! 277: */ ! 278: ! 279: /***************************** INCLUDES *****************************/ ! 280: ! 281: #include <linux/module.h> ! 282: ! 283: #include <linux/kernel.h> ! 284: #include <linux/sched.h> ! 285: #include <linux/types.h> ! 286: #include <linux/fcntl.h> ! 287: #include <linux/interrupt.h> ! 288: #include <linux/stat.h> ! 289: #include <linux/ptrace.h> ! 290: #include <linux/ioport.h> ! 291: #include <linux/in.h> ! 292: #include <linux/string.h> ! 293: #include <linux/delay.h> ! 294: #include <asm/system.h> ! 295: #include <asm/bitops.h> ! 296: #include <asm/io.h> ! 297: #include <asm/dma.h> ! 298: #include <linux/errno.h> ! 299: #include <linux/netdevice.h> ! 300: #include <linux/etherdevice.h> ! 301: #include <linux/skbuff.h> ! 302: #include <linux/malloc.h> ! 303: #include <linux/timer.h> ! 304: ! 305: #include <linux/wireless.h> /* Wireless extensions */ ! 306: ! 307: /* Wavelan declarations */ ! 308: #include "i82586.h" ! 309: #include "wavelan.h" ! 310: ! 311: /****************************** DEBUG ******************************/ ! 312: ! 313: #undef DEBUG_MODULE_TRACE /* Module insertion/removal */ ! 314: #undef DEBUG_CALLBACK_TRACE /* Calls made by Linux */ ! 315: #undef DEBUG_INTERRUPT_TRACE /* Calls to handler */ ! 316: #undef DEBUG_INTERRUPT_INFO /* type of interrupt & so on */ ! 317: #define DEBUG_INTERRUPT_ERROR /* problems */ ! 318: #undef DEBUG_CONFIG_TRACE /* Trace the config functions */ ! 319: #undef DEBUG_CONFIG_INFO /* What's going on... */ ! 320: #define DEBUG_CONFIG_ERRORS /* Errors on configuration */ ! 321: #undef DEBUG_TX_TRACE /* Transmission calls */ ! 322: #undef DEBUG_TX_INFO /* Header of the transmited packet */ ! 323: #define DEBUG_TX_ERROR /* unexpected conditions */ ! 324: #undef DEBUG_RX_TRACE /* Transmission calls */ ! 325: #undef DEBUG_RX_INFO /* Header of the transmited packet */ ! 326: #define DEBUG_RX_ERROR /* unexpected conditions */ ! 327: #undef DEBUG_PACKET_DUMP 16 /* Dump packet on the screen */ ! 328: #undef DEBUG_IOCTL_TRACE /* Misc call by Linux */ ! 329: #undef DEBUG_IOCTL_INFO /* Various debug info */ ! 330: #define DEBUG_IOCTL_ERROR /* What's going wrong */ ! 331: #define DEBUG_BASIC_SHOW /* Show basic startup info */ ! 332: #undef DEBUG_VERSION_SHOW /* Print version info */ ! 333: #undef DEBUG_PSA_SHOW /* Dump psa to screen */ ! 334: #undef DEBUG_MMC_SHOW /* Dump mmc to screen */ ! 335: #undef DEBUG_SHOW_UNUSED /* Show also unused fields */ ! 336: #undef DEBUG_I82586_SHOW /* Show i82586 status */ ! 337: #undef DEBUG_DEVICE_SHOW /* Show device parameters */ ! 338: ! 339: /* Options : */ ! 340: #define USE_PSA_CONFIG /* Use info from the PSA */ ! 341: #define IGNORE_NORMAL_XMIT_ERRS /* Don't bother with normal conditions */ ! 342: #undef STRUCT_CHECK /* Verify padding of structures */ ! 343: #undef PSA_CRC /* Check CRC in PSA */ ! 344: #undef OLDIES /* Old code (to redo) */ ! 345: #undef RECORD_SNR /* To redo */ ! 346: #undef EEPROM_IS_PROTECTED /* Doesn't seem to be necessary */ ! 347: #define MULTICAST_AVOID /* Avoid extra multicast (I'm sceptical) */ ! 348: ! 349: #ifdef WIRELESS_EXT /* If wireless extension exist in the kernel */ ! 350: /* Warning : these stuff will slow down the driver... */ ! 351: #define WIRELESS_SPY /* Enable spying addresses */ ! 352: #undef HISTOGRAM /* Enable histogram of sig level... */ ! 353: #endif ! 354: ! 355: /************************ CONSTANTS & MACROS ************************/ ! 356: ! 357: #ifdef DEBUG_VERSION_SHOW ! 358: static const char *version = "wavelan.c : v16 (wireless extensions) 17/4/97\n"; ! 359: #endif ! 360: ! 361: /* Watchdog temporisation */ ! 362: #define WATCHDOG_JIFFIES 32 /* TODO: express in HZ. */ ! 363: ! 364: /* Macro to get the number of elements in an array */ ! 365: #define NELS(a) (sizeof(a) / sizeof(a[0])) ! 366: ! 367: /* ------------------------ PRIVATE IOCTL ------------------------ */ ! 368: ! 369: #define SIOCSIPQTHR SIOCDEVPRIVATE /* Set quality threshold */ ! 370: #define SIOCGIPQTHR SIOCDEVPRIVATE + 1 /* Get quality threshold */ ! 371: #define SIOCSIPLTHR SIOCDEVPRIVATE + 2 /* Set level threshold */ ! 372: #define SIOCGIPLTHR SIOCDEVPRIVATE + 3 /* Get level threshold */ ! 373: ! 374: #define SIOCSIPHISTO SIOCDEVPRIVATE + 6 /* Set histogram ranges */ ! 375: #define SIOCGIPHISTO SIOCDEVPRIVATE + 7 /* Get histogram values */ ! 376: ! 377: /* ----------------------- VERSION SUPPORT ----------------------- */ ! 378: ! 379: /* This ugly patch is needed to cope with old version of the kernel */ ! 380: #ifndef copy_from_user ! 381: #define copy_from_user memcpy_fromfs ! 382: #define copy_to_user memcpy_tofs ! 383: #endif ! 384: ! 385: /****************************** TYPES ******************************/ ! 386: ! 387: /* Shortcuts */ ! 388: typedef struct device device; ! 389: typedef struct enet_statistics en_stats; ! 390: typedef struct iw_statistics iw_stats; ! 391: typedef struct iw_quality iw_qual; ! 392: typedef struct iw_freq iw_freq; ! 393: typedef struct net_local net_local; ! 394: typedef struct timer_list timer_list; ! 395: ! 396: /* Basic types */ ! 397: typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */ ! 398: ! 399: /* ! 400: * Static specific data for the interface. ! 401: * ! 402: * For each network interface, Linux keep data in two structure. "device" ! 403: * keep the generic data (same format for everybody) and "net_local" keep ! 404: * the additional specific data. ! 405: * Note that some of this specific data is in fact generic (en_stats, for ! 406: * example). ! 407: */ ! 408: struct net_local ! 409: { ! 410: net_local * next; /* Linked list of the devices */ ! 411: device * dev; /* Reverse link... */ ! 412: en_stats stats; /* Ethernet interface statistics */ ! 413: int nresets; /* Number of hw resets */ ! 414: u_char reconfig_82586; /* Need to reconfigure the controler */ ! 415: u_char promiscuous; /* Promiscuous mode */ ! 416: int mc_count; /* Number of multicast addresses */ ! 417: timer_list watchdog; /* To avoid blocking state */ ! 418: u_short hacr; /* Current host interface state */ ! 419: ! 420: int tx_n_in_use; ! 421: u_short rx_head; ! 422: u_short rx_last; ! 423: u_short tx_first_free; ! 424: u_short tx_first_in_use; ! 425: ! 426: #ifdef WIRELESS_EXT ! 427: iw_stats wstats; /* Wireless specific stats */ ! 428: #endif ! 429: ! 430: #ifdef WIRELESS_SPY ! 431: int spy_number; /* Number of addresses to spy */ ! 432: mac_addr spy_address[IW_MAX_SPY]; /* The addresses to spy */ ! 433: iw_qual spy_stat[IW_MAX_SPY]; /* Statistics gathered */ ! 434: #endif /* WIRELESS_SPY */ ! 435: #ifdef HISTOGRAM ! 436: int his_number; /* Number of intervals */ ! 437: u_char his_range[16]; /* Boundaries of interval ]n-1; n] */ ! 438: u_long his_sum[16]; /* Sum in interval */ ! 439: #endif /* HISTOGRAM */ ! 440: }; ! 441: ! 442: /**************************** PROTOTYPES ****************************/ ! 443: ! 444: /* ----------------------- MISC SUBROUTINES ------------------------ */ ! 445: static inline unsigned long /* flags */ ! 446: wv_splhi(void); /* Disable interrupts */ ! 447: static inline void ! 448: wv_splx(unsigned long); /* ReEnable interrupts : flags */ ! 449: static u_char ! 450: wv_irq_to_psa(int); ! 451: static int ! 452: wv_psa_to_irq(u_char); ! 453: /* ------------------- HOST ADAPTER SUBROUTINES ------------------- */ ! 454: static inline u_short /* data */ ! 455: hasr_read(u_long); /* Read the host interface : base address */ ! 456: static inline void ! 457: hacr_write(u_long, /* Write to host interface : base address */ ! 458: u_short), /* data */ ! 459: hacr_write_slow(u_long, ! 460: u_short), ! 461: set_chan_attn(u_long, /* ioaddr */ ! 462: u_short), /* hacr */ ! 463: wv_hacr_reset(u_long), /* ioaddr */ ! 464: wv_16_off(u_long, /* ioaddr */ ! 465: u_short), /* hacr */ ! 466: wv_16_on(u_long, /* ioaddr */ ! 467: u_short), /* hacr */ ! 468: wv_ints_off(device *), ! 469: wv_ints_on(device *); ! 470: /* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */ ! 471: static void ! 472: psa_read(u_long, /* Read the Parameter Storage Area */ ! 473: u_short, /* hacr */ ! 474: int, /* offset in PSA */ ! 475: u_char *, /* buffer to fill */ ! 476: int), /* size to read */ ! 477: psa_write(u_long, /* Write to the PSA */ ! 478: u_short, /* hacr */ ! 479: int, /* Offset in psa */ ! 480: u_char *, /* Buffer in memory */ ! 481: int); /* Length of buffer */ ! 482: static inline void ! 483: mmc_out(u_long, /* Write 1 byte to the Modem Manag Control */ ! 484: u_short, ! 485: u_char), ! 486: mmc_write(u_long, /* Write n bytes to the MMC */ ! 487: u_char, ! 488: u_char *, ! 489: int); ! 490: static inline u_char /* Read 1 byte from the MMC */ ! 491: mmc_in(u_long, ! 492: u_short); ! 493: static inline void ! 494: mmc_read(u_long, /* Read n bytes from the MMC */ ! 495: u_char, ! 496: u_char *, ! 497: int), ! 498: fee_wait(u_long, /* Wait for frequency EEprom : base address */ ! 499: int, /* Base delay to wait for */ ! 500: int); /* Number of time to wait */ ! 501: static void ! 502: fee_read(u_long, /* Read the frequency EEprom : base address */ ! 503: u_short, /* destination offset */ ! 504: u_short *, /* data buffer */ ! 505: int); /* number of registers */ ! 506: /* ---------------------- I82586 SUBROUTINES ----------------------- */ ! 507: static /*inline*/ void ! 508: obram_read(u_long, /* ioaddr */ ! 509: u_short, /* o */ ! 510: u_char *, /* b */ ! 511: int); /* n */ ! 512: static inline void ! 513: obram_write(u_long, /* ioaddr */ ! 514: u_short, /* o */ ! 515: u_char *, /* b */ ! 516: int); /* n */ ! 517: static void ! 518: wv_ack(device *); ! 519: static inline int ! 520: wv_synchronous_cmd(device *, ! 521: const char *), ! 522: wv_config_complete(device *, ! 523: u_long, ! 524: net_local *); ! 525: static int ! 526: wv_complete(device *, ! 527: u_long, ! 528: net_local *); ! 529: static inline void ! 530: wv_82586_reconfig(device *); ! 531: /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */ ! 532: #ifdef DEBUG_I82586_SHOW ! 533: static void ! 534: wv_scb_show(unsigned short); ! 535: #endif ! 536: static inline void ! 537: wv_init_info(device *); /* display startup info */ ! 538: /* ------------------- IOCTL, STATS & RECONFIG ------------------- */ ! 539: static en_stats * ! 540: wavelan_get_stats(device *); /* Give stats /proc/net/dev */ ! 541: static void ! 542: wavelan_set_multicast_list(device *); ! 543: /* ----------------------- PACKET RECEPTION ----------------------- */ ! 544: static inline void ! 545: wv_packet_read(device *, /* Read a packet from a frame */ ! 546: u_short, ! 547: int), ! 548: wv_receive(device *); /* Read all packets waiting */ ! 549: /* --------------------- PACKET TRANSMISSION --------------------- */ ! 550: static inline void ! 551: wv_packet_write(device *, /* Write a packet to the Tx buffer */ ! 552: void *, ! 553: short); ! 554: static int ! 555: wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ ! 556: device *); ! 557: /* -------------------- HARDWARE CONFIGURATION -------------------- */ ! 558: static inline int ! 559: wv_mmc_init(device *), /* Initialize the modem */ ! 560: wv_ru_start(device *), /* Start the i82586 receiver unit */ ! 561: wv_cu_start(device *), /* Start the i82586 command unit */ ! 562: wv_82586_start(device *); /* Start the i82586 */ ! 563: static void ! 564: wv_82586_config(device *); /* Configure the i82586 */ ! 565: static inline void ! 566: wv_82586_stop(device *); ! 567: static int ! 568: wv_hw_reset(device *), /* Reset the wavelan hardware */ ! 569: wv_check_ioaddr(u_long, /* ioaddr */ ! 570: u_char *); /* mac address (read) */ ! 571: /* ---------------------- INTERRUPT HANDLING ---------------------- */ ! 572: static void ! 573: wavelan_interrupt(int, /* Interrupt handler */ ! 574: void *, ! 575: struct pt_regs *); ! 576: static void ! 577: wavelan_watchdog(u_long); /* Transmission watchdog */ ! 578: /* ------------------- CONFIGURATION CALLBACKS ------------------- */ ! 579: static int ! 580: wavelan_open(device *), /* Open the device */ ! 581: wavelan_close(device *), /* Close the device */ ! 582: wavelan_config(device *); /* Configure one device */ ! 583: extern int ! 584: wavelan_probe(device *); /* See Space.c */ ! 585: ! 586: /**************************** VARIABLES ****************************/ ! 587: ! 588: /* ! 589: * This is the root of the linked list of wavelan drivers ! 590: * It is use to verify that we don't reuse the same base address ! 591: * for two differents drivers and to make the cleanup when ! 592: * removing the module. ! 593: */ ! 594: static net_local * wavelan_list = (net_local *) NULL; ! 595: ! 596: /* ! 597: * This table is used to translate the psa value to irq number ! 598: * and vice versa... ! 599: */ ! 600: static u_char irqvals[] = ! 601: { ! 602: 0, 0, 0, 0x01, ! 603: 0x02, 0x04, 0, 0x08, ! 604: 0, 0, 0x10, 0x20, ! 605: 0x40, 0, 0, 0x80, ! 606: }; ! 607: ! 608: /* ! 609: * Table of the available i/o address (base address) for wavelan ! 610: */ ! 611: static unsigned short iobase[] = ! 612: { ! 613: #if 0 ! 614: /* Leave out 0x3C0 for now -- seems to clash with some video ! 615: * controllers. ! 616: * Leave out the others too -- we will always use 0x390 and leave ! 617: * 0x300 for the Ethernet device. ! 618: * Jean II : 0x3E0 is really fine as well... ! 619: */ ! 620: 0x300, 0x390, 0x3E0, 0x3C0 ! 621: #endif /* 0 */ ! 622: 0x390, 0x3E0 ! 623: }; ! 624: ! 625: #ifdef MODULE ! 626: /* Name of the devices (memory allocation) */ ! 627: static char devname[4][IFNAMSIZ] = { "", "", "", "" }; ! 628: ! 629: /* Parameters set by insmod */ ! 630: static int io[4] = { 0, 0, 0, 0 }; ! 631: static int irq[4] = { 0, 0, 0, 0 }; ! 632: static char * name[4] = { devname[0], devname[1], devname[2], devname[3] }; ! 633: #endif /* MODULE */ ! 634: ! 635: #endif /* WAVELAN_P_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.