more minor changes to WaveLAN driver

Trevor Johnson (trevor@jpj.net)
Fri, 19 Jun 1998 08:06:22 -0400 (EDT)


This patch makes some minor changes to the comments and printk()
statements in the driver (spelling, punctuation, grammar and such). It
also removes comments from some of the fee_read() calls which seemed
redundant, and changes the way they're indented. I tried to go to the
wavelan.netland.nl Web site which was mentioned, but its name doesn't
resolve any more (I tried from two different hosts) so I replaced it with
www.wavelan.com.
___
Trevor Johnson

diff -ru linux/drivers/net/wavelan.c linux-2.1.106-local-tourrilhes/drivers/net/wavelan.c
--- linux/drivers/net/wavelan.c Sat Jun 13 12:01:39 1998
+++ linux-2.1.106-local-tourrilhes/drivers/net/wavelan.c Fri Jun 19 04:57:08 1998
@@ -264,7 +264,7 @@
static void
psa_write(u_long ioaddr,
u_short hacr,
- int o, /* Offset in psa */
+ int o, /* Offset in PSA */
u_char * b, /* Buffer in memory */
int n) /* Length of buffer */
{
@@ -403,7 +403,7 @@
* Get the type of encryption available.
*/
static inline int
-mmc_encr(u_long ioaddr) /* i/o port of the card */
+mmc_encr(u_long ioaddr) /* I/O port of the card */
{
int temp;

@@ -420,7 +420,7 @@
* I hope this one will be optimally inlined.
*/
static inline void
-fee_wait(u_long ioaddr, /* i/o port of the card */
+fee_wait(u_long ioaddr, /* I/O port of the card */
int delay, /* Base delay to wait for */
int number) /* Number of time to wait */
{
@@ -436,7 +436,7 @@
* Read bytes from the Frequency EEPROM (frequency select cards).
*/
static void
-fee_read(u_long ioaddr, /* i/o port of the card */
+fee_read(u_long ioaddr, /* I/O port of the card */
u_short o, /* destination offset */
u_short * b, /* data buffer */
int n) /* number of registers */
@@ -471,7 +471,7 @@
* Jean II
*/
static void
-fee_write(u_long ioaddr, /* i/o port of the card */
+fee_write(u_long ioaddr, /* I/O port of the card */
u_short o, /* destination offset */
u_short * b, /* data buffer */
int n) /* number of registers */
@@ -486,7 +486,7 @@
fee_wait(ioaddr, 10, 100);

/* Read the protected register. */
- printk("Protected 2 : %02X-%02X\n",
+ printk("Protected 2: %02X-%02X\n",
mmc_in(ioaddr, mmroff(0, mmr_fee_data_h)),
mmc_in(ioaddr, mmroff(0, mmr_fee_data_l)));
#endif /* DOESNT_SEEM_TO_WORK */
@@ -501,7 +501,7 @@
mmc_out(ioaddr, mmwoff(0, mmw_fee_addr), o + n);
mmc_out(ioaddr, mmwoff(0, mmw_fee_ctrl), MMW_FEE_CTRL_PRWRITE);
#ifdef DOESNT_SEEM_TO_WORK /* disabled */
- /* Or use : */
+ /* or use: */
mmc_out(ioaddr, mmwoff(0, mmw_fee_ctrl), MMW_FEE_CTRL_PRCLEAR);
#endif /* DOESNT_SEEM_TO_WORK */

@@ -758,7 +758,7 @@
/* Read the first transmit buffer */
obram_read(ioaddr, acoff(lp->tx_first_in_use, ac_status), (unsigned char *)&tx_status, sizeof(tx_status));

- /* Hack for reconfiguration... */
+ /* Hack for reconfiguration */
if(tx_status == 0xFFFF)
if(!wv_config_complete(dev, ioaddr, lp))
break; /* Not completed */
@@ -787,7 +787,7 @@
lp->tx_first_in_use -= NTXBLOCKS * TXBLOCKZ;
}

- /* Hack for reconfiguration... */
+ /* Hack for reconfiguration */
if(tx_status == 0xFFFF)
continue;

@@ -921,7 +921,7 @@
static void
wv_psa_show(psa_t * p)
{
- printk(KERN_DEBUG "##### WaveLAN psa contents: #####\n");
+ printk(KERN_DEBUG "##### WaveLAN PSA contents: #####\n");
printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n",
p->psa_io_base_addr_1,
p->psa_io_base_addr_2,
@@ -1107,10 +1107,10 @@
printk(KERN_DEBUG "status: ");
printk("stat 0x%x[%s%s%s%s] ",
(scb.scb_status & (SCB_ST_CX | SCB_ST_FR | SCB_ST_CNA | SCB_ST_RNR)) >> 12,
- (scb.scb_status & SCB_ST_CX) ? "cmd completion interrupt," : "",
+ (scb.scb_status & SCB_ST_CX) ? "command completion interrupt," : "",
(scb.scb_status & SCB_ST_FR) ? "frame received," : "",
- (scb.scb_status & SCB_ST_CNA) ? "cmd unit not active," : "",
- (scb.scb_status & SCB_ST_RNR) ? "rcv unit not ready," : "");
+ (scb.scb_status & SCB_ST_CNA) ? "command unit not active," : "",
+ (scb.scb_status & SCB_ST_RNR) ? "receiving unit not ready," : "");
printk("cus 0x%x[%s%s%s] ",
(scb.scb_status & SCB_ST_CUS) >> 8,
((scb.scb_status & SCB_ST_CUS) == SCB_ST_CUS_IDLE) ? "idle" : "",
@@ -1166,7 +1166,7 @@
printk(KERN_DEBUG "##### WaveLAN i82586 receiver unit status: #####\n");
printk(KERN_DEBUG "ru:");
/*
- * Not implemented yet...
+ * Not implemented yet
*/
printk("\n");
} /* wv_ru_show */
@@ -1335,7 +1335,7 @@
#endif

#ifdef DEBUG_BASIC_SHOW
- /* Now, let's go for the basic stuff */
+ /* Now, let's go for the basic stuff. */
printk(KERN_NOTICE "%s: WaveLAN at %#x,", dev->name, ioaddr);
for(i = 0; i < WAVELAN_ADDR_SIZE; i++)
printk("%s%02X", (i == 0) ? " " : ":", dev->dev_addr[i]);
@@ -1353,9 +1353,8 @@
{
unsigned short freq;

- /* Ask the EEPROM to read the frequency from the first area */
- fee_read(ioaddr, 0x00 /* 1st area - frequency.... */,
- &freq, 1);
+ /* Ask the EEPROM to read the frequency from the first area. */
+ fee_read(ioaddr, 0x00, &freq, 1);

/* Print frequency */
printk(", 2.00, %ld", (freq >> 6) + 2400L);
@@ -1539,16 +1538,16 @@
return 0;
}

-#ifdef WIRELESS_EXT /* if wireless extension exists in the kernel */
+#ifdef WIRELESS_EXT /* if wireless extensions exist in the kernel */

/*------------------------------------------------------------------*/
/*
- * Frequency setting (for hardware able of it)
- * It's a bit complicated and you don't really want to look into it...
+ * Frequency setting (for hardware capable of it)
+ * It's a bit complicated and you don't really want to look into it.
* (called in wavelan_ioctl)
*/
static inline int
-wv_set_frequency(u_long ioaddr, /* i/o port of the card */
+wv_set_frequency(u_long ioaddr, /* I/O port of the card */
iw_freq * frequency)
{
const int BAND_NUM = 10; /* Number of bands */
@@ -1560,8 +1559,8 @@
/* Setting by frequency */
/* Theoretically, you may set any frequency between
* the two limits with a 0.5 MHz precision. In practice,
- * I don't want you to have trouble with local
- * regulations. */
+ * I don't want you to have trouble with local regulations.
+ */
if((frequency->e == 1) &&
(frequency->m >= (int) 2.412e8) && (frequency->m <= (int) 2.487e8))
{
@@ -1587,8 +1586,7 @@
u_short table[10]; /* Authorized frequency table */

/* Read the frequency table. */
- fee_read(ioaddr, 0x71 /* frequency table */,
- table, 10);
+ fee_read(ioaddr, 0x71, table, 10);

#ifdef DEBUG_IOCTL_INFO
printk(KERN_DEBUG "Frequency table: ");
@@ -1616,29 +1614,26 @@
unsigned short area_verify[16];
unsigned short dac_verify[2];
/* Corresponding gain (in the power adjust value table)
- * see AT&T WaveLAN Data Manual, REF 407-024689/E, page 3-8
- * & WCIN062D.DOC, page 6.2.9 */
+ * See AT&T WaveLAN Data Manual, REF 407-024689/E, page 3-8
+ * and WCIN062D.DOC, page 6.2.9. */
unsigned short power_limit[] = { 40, 80, 120, 160, 0 };
int power_band = 0; /* Selected band */
unsigned short power_adjust; /* Correct value */

- /* Search for the gain */
+ /* Search for the gain. */
power_band = 0;
while((freq > power_limit[power_band]) &&
(power_limit[++power_band] != 0))
;

/* Read the first area. */
- fee_read(ioaddr, 0x00,
- area, 16);
+ fee_read(ioaddr, 0x00, area, 16);

/* Read the DAC. */
- fee_read(ioaddr, 0x60,
- dac, 2);
+ fee_read(ioaddr, 0x60, dac, 2);

/* Read the new power adjust value. */
- fee_read(ioaddr, 0x6B - (power_band >> 1),
- &power_adjust, 1);
+ fee_read(ioaddr, 0x6B - (power_band >> 1), &power_adjust, 1);
if(power_band & 0x1)
power_adjust >>= 8;
else
@@ -1682,15 +1677,13 @@
fee_write(ioaddr, 0x60,
dac, 2);

- /* We now should verify here that the writing of the EEPROM was OK. */
+ /* We now should verify here that the writing of the EEPROM went OK. */

/* Reread the first area. */
- fee_read(ioaddr, 0x00,
- area_verify, 16);
+ fee_read(ioaddr, 0x00, area_verify, 16);

/* Reread the DAC. */
- fee_read(ioaddr, 0x60,
- dac_verify, 2);
+ fee_read(ioaddr, 0x60, dac_verify, 2);

/* Compare. */
if(memcmp(area, area_verify, 16 * 2) ||
@@ -1710,16 +1703,16 @@
mmc_out(ioaddr, mmwoff(0, mmw_fee_ctrl),
MMW_FEE_CTRL_READ | MMW_FEE_CTRL_DWLD);

- /* Wait until the download is finished */
+ /* Wait until the download is finished. */
fee_wait(ioaddr, 100, 100);

/* We must now download the power adjust value (gain) to
- * the synthesizers (from the EEPROM - area 7 - DAC) */
+ * the synthesizers (from the EEPROM - area 7 - DAC). */
mmc_out(ioaddr, mmwoff(0, mmw_fee_addr), 0x61);
mmc_out(ioaddr, mmwoff(0, mmw_fee_ctrl),
MMW_FEE_CTRL_READ | MMW_FEE_CTRL_DWLD);

- /* Wait until the download is finished */
+ /* Wait for the download to finish. */
fee_wait(ioaddr, 100, 100);

#ifdef DEBUG_IOCTL_INFO
@@ -1745,22 +1738,21 @@

/*------------------------------------------------------------------*/
/*
- * Give the list of available frequencies
+ * Give the list of available frequencies.
*/
static inline int
-wv_frequency_list(u_long ioaddr, /* i/o port of the card */
- iw_freq * list, /* List of frequency to fill */
+wv_frequency_list(u_long ioaddr, /* I/O port of the card */
+ iw_freq * list, /* List of frequencies to fill */
int max) /* Maximum number of frequencies */
{
u_short table[10]; /* Authorized frequency table */
long freq = 0L; /* offset to 2.4 GHz in .5 MHz + 12 MHz */
int i; /* index in the table */

- /* Read the frequency table */
- fee_read(ioaddr, 0x71 /* frequency table */,
- table, 10);
+ /* Read the frequency table. */
+ fee_read(ioaddr, 0x71 /* frequency table */, table, 10);

- /* Check all frequencies */
+ /* Check all frequencies. */
i = 0;
for(freq = 0; freq < 150; freq++)
/* Look in the table if the frequency is allowed */
@@ -1837,8 +1829,8 @@

/*------------------------------------------------------------------*/
/*
- * Perform ioctl: configuration and information
- * This is here that are treated the wireless extensions (iwconfig)
+ * Perform ioctl for configuration and information.
+ * It is here that the wireless extensions are treated (iwconfig).
*/
static int
wavelan_ioctl(struct device * dev, /* device on which the ioctl is applied */
@@ -1857,7 +1849,7 @@
printk(KERN_DEBUG "%s: ->wavelan_ioctl(cmd=0x%X)\n", dev->name, cmd);
#endif

- /* Disable interrupts & save flags */
+ /* Disable interrupts and save flags. */
x = wv_splhi();

/* Look what is the request */
@@ -1866,21 +1858,21 @@
/* --------------- WIRELESS EXTENSIONS --------------- */

case SIOCGIWNAME:
- strcpy(wrq->u.name, "Wavelan");
+ strcpy(wrq->u.name, "WaveLAN");
break;

case SIOCSIWNWID:
/* Set NWID in WaveLAN. */
if(wrq->u.nwid.on)
{
- /* Set NWID in psa */
+ /* Set NWID in psa. */
psa.psa_nwid[0] = (wrq->u.nwid.nwid & 0xFF00) >> 8;
psa.psa_nwid[1] = wrq->u.nwid.nwid & 0xFF;
psa.psa_nwid_select = 0x01;
psa_write(ioaddr, lp->hacr, (char *)psa.psa_nwid - (char *)&psa,
(unsigned char *)psa.psa_nwid, 3);

- /* Set NWID in mmc */
+ /* Set NWID in mmc. */
m.w.mmw_netw_id_l = wrq->u.nwid.nwid & 0xFF;
m.w.mmw_netw_id_h = (wrq->u.nwid.nwid & 0xFF00) >> 8;
mmc_write(ioaddr, (char *)&m.w.mmw_netw_id_l - (char *)&m,
@@ -1925,9 +1917,8 @@
{
unsigned short freq;

- /* Ask the EEPROM to read the frequency from the first area */
- fee_read(ioaddr, 0x00 /* 1st area - frequency... */,
- &freq, 1);
+ /* Ask the EEPROM to read the frequency from the first area. */
+ fee_read(ioaddr, 0x00, &freq, 1);
wrq->u.freq.m = ((freq >> 5) * 5 + 24000L) * 10000;
wrq->u.freq.e = 1;
}
@@ -2096,7 +2087,7 @@
{ SIOCGIPHISTO, 0, IW_PRIV_TYPE_INT | 16, "gethisto" },
};

- /* Verify the user buffer */
+ /* Verify the user buffer. */
ret = verify_area(VERIFY_WRITE, wrq->u.data.pointer,
sizeof(priv));
if(ret)
@@ -2149,7 +2140,7 @@
memset(lp->spy_stat, 0x00, sizeof(iw_qual) * IW_MAX_SPY);

#ifdef DEBUG_IOCTL_INFO
- printk(KERN_DEBUG "SetSpy - Set of new addresses is: \n");
+ printk(KERN_DEBUG "SetSpy: set of new addresses is: \n");
for(i = 0; i < wrq->u.data.length; i++)
printk(KERN_DEBUG "%02X:%02X:%02X:%02X:%02X:%02X \n",
lp->spy_address[i][0],
@@ -2226,7 +2217,7 @@

#ifdef HISTOGRAM
case SIOCSIPHISTO:
- /* Verif if the user is root */
+ /* Verify that the user is root. */
if(!suser())
return -EPERM;

@@ -2416,10 +2407,11 @@
u_char stats[3]; /* signal level, noise level, signal quality */

/* Read signal level, silence level and signal quality bytes. */
- /* Note: in the PCMCIA hardware, these are part of the frame. It seems
+ /* Note: in the PCMCIA hardware, these are part of the frame. It seems
* that for the ISA hardware, it's nowhere to be found in the frame,
* so I'm obliged to do this (it has a side effect on /proc/net/wireless).
- * Any ideas? */
+ * Any ideas?
+ */
mmc_out(ioaddr, mmwoff(0, mmw_freeze), 1);
mmc_read(ioaddr, mmroff(0, mmr_signal_lvl), stats, 3);
mmc_out(ioaddr, mmwoff(0, mmw_freeze), 0);
@@ -2773,7 +2765,7 @@
/*
* This routine is called when we want to send a packet (NET3 callback)
* In this routine, we check if the hardware is ready to accept
- * the packet. We also prevent reentrance. Then, we call the function
+ * the packet. We also prevent reentrance. Then we call the function
* to send the packet.
*/
static int
@@ -2876,7 +2868,7 @@
/* Disable encryption */
psa.psa_encryption_select = 0;

- /* Set to standard values
+ /* Set to standard values:
* 0x04 for AT,
* 0x01 for MCA,
* 0x04 for PCMCIA and 2.00 card (AT&T 407-024689/E document)
@@ -2891,7 +2883,7 @@
psa.psa_conf_status |= 1;

#ifdef USE_PSA_CONFIG
- /* Write the psa */
+ /* Write the psa. */
psa_write(ioaddr, lp->hacr, (char *)psa.psa_nwid - (char *)&psa,
(unsigned char *)psa.psa_nwid, 4);
psa_write(ioaddr, lp->hacr, (char *)&psa.psa_thr_pre_set - (char *)&psa,
@@ -2948,7 +2940,7 @@
mmc_write(ioaddr, 0, (u_char *)&m, sizeof(m));

/* The following code starts the modem of the 2.00 frequency
- * selectable cards at power on. It's not strictly needed for the
+ * selectable cards at power on. It's not strictly needed for the
* following boots.
* The original patch was by Joe Finney for the PCMCIA driver, but
* I've cleaned it up a bit and added documentation.
diff -ru linux/drivers/net/wavelan.h linux-2.1.106-local-tourrilhes/drivers/net/wavelan.h
--- linux/drivers/net/wavelan.h Mon Mar 17 14:54:26 1997
+++ linux-2.1.106-local-tourrilhes/drivers/net/wavelan.h Fri Jun 19 04:54:50 1998
@@ -1,34 +1,34 @@
/*
- * Wavelan ISA driver
+ * WaveLAN ISA driver
*
* Jean II - HPLB '96
*
* Reorganisation and extension of the driver.
- * Original copyrigth follow. See wavelan.p.h for details.
+ * Original copyright follows. See wavelan.p.h for details.
*
- * This file contain the declarations of the Wavelan hardware. Note that
- * the Wavelan ISA include a i82586 controler (see definitions in
+ * This file contains the declarations for the WaveLAN hardware. Note that
+ * the WaveLAN ISA includes a i82586 controller (see definitions in
* file i82586.h).
*
- * The main difference between the ISA hardware and the pcmcia one is
- * the Ethernet Controler (i82586 instead of i82593).
- * The i82586 allow multiple transmit buffers. The PSA need to be accessed
+ * The main difference between the ISA hardware and the PCMCIA one is
+ * the Ethernet controller (i82586 instead of i82593).
+ * The i82586 allows multiple transmit buffers. The PSA needs to be accessed
* through the host interface.
*/

#ifndef _WAVELAN_H
#define _WAVELAN_H

-/* The detection of the wavelan card is made by reading the MAC
- * address from the card and checking it. If you have a non AT&T
- * product (OEM, like DEC RoamAbout, or Digital Ocean, Epson, ...),
- * you might need to modify this part to accomodate your hardware...
+/* Detection of the WaveLAN card is done by reading the MAC
+ * address from the card and checking it. If you have a non-AT&T
+ * product (OEM, like DEC RoamAbout, Digital Ocean, or Epson),
+ * you might need to modify this part to accommodate your hardware.
*/
const char MAC_ADDRESSES[][3] =
{
- { 0x08, 0x00, 0x0E }, /* AT&T Wavelan (standard) & DEC RoamAbout */
- { 0x08, 0x00, 0x6A }, /* AT&T Wavelan (alternate) */
- /* Add your card here and send me the patch ! */
+ { 0x08, 0x00, 0x0E }, /* AT&T WaveLAN (standard) & DEC RoamAbout */
+ { 0x08, 0x00, 0x6A }, /* AT&T WaveLAN (alternate) */
+ /* Add your card here and send me the patch! */
};

#define WAVELAN_ADDR_SIZE 6 /* Size of a MAC address */
@@ -49,7 +49,7 @@
unsigned short hu_command; /* Command register */
#define HACR_RESET 0x0001 /* Reset board */
#define HACR_CA 0x0002 /* Set Channel Attention for 82586 */
-#define HACR_16BITS 0x0004 /* 16 bits operation (0 => 8bits) */
+#define HACR_16BITS 0x0004 /* 16-bit operation (0 => 8bits) */
#define HACR_OUT0 0x0008 /* General purpose output pin 0 */
/* not used - must be 1 */
#define HACR_OUT1 0x0010 /* General purpose output pin 1 */
@@ -112,11 +112,11 @@
/************************** MEMORY LAYOUT **************************/

/*
- * Onboard 64k RAM layout.
+ * Onboard 64 k RAM layout.
* (Offsets from 0x0000.)
*/
-#define OFFSET_RU 0x0000 /* 75 % memory */
-#define OFFSET_CU 0xC000 /* 25 % memory */
+#define OFFSET_RU 0x0000 /* 75% memory */
+#define OFFSET_CU 0xC000 /* 25% memory */
#define OFFSET_SCB (OFFSET_ISCP - sizeof(scb_t))
#define OFFSET_ISCP (OFFSET_SCP - sizeof(iscp_t))
#define OFFSET_SCP I82586_SCP_ADDR
@@ -151,26 +151,26 @@
unsigned char psa_univ_local_sel; /* [0x1C] Universal Local Selection */
#define PSA_UNIVERSAL 0 /* Universal (factory) */
#define PSA_LOCAL 1 /* Local */
- unsigned char psa_comp_number; /* [0x1D] Compatability Number: */
-#define PSA_COMP_PC_AT_915 0 /* PC-AT 915 MHz */
-#define PSA_COMP_PC_MC_915 1 /* PC-MC 915 MHz */
-#define PSA_COMP_PC_AT_2400 2 /* PC-AT 2.4 GHz */
-#define PSA_COMP_PC_MC_2400 3 /* PC-MC 2.4 GHz */
+ unsigned char psa_comp_number; /* [0x1D] Compatibility Number: */
+#define PSA_COMP_PC_AT_915 0 /* PC-AT 915 MHz */
+#define PSA_COMP_PC_MC_915 1 /* PC-MC 915 MHz */
+#define PSA_COMP_PC_AT_2400 2 /* PC-AT 2.4 GHz */
+#define PSA_COMP_PC_MC_2400 3 /* PC-MC 2.4 GHz */
#define PSA_COMP_PCMCIA_915 4 /* PCMCIA 915 MHz or 2.0 */
unsigned char psa_thr_pre_set; /* [0x1E] Modem Threshold Preset */
unsigned char psa_feature_select; /* [0x1F] Call code required (1=on) */
#define PSA_FEATURE_CALL_CODE 0x01 /* Call code required (Japan) */
- unsigned char psa_subband; /* [0x20] Subband */
+ unsigned char psa_subband; /* [0x20] Subband */
#define PSA_SUBBAND_915 0 /* 915 MHz or 2.0 */
-#define PSA_SUBBAND_2425 1 /* 2425 MHz */
-#define PSA_SUBBAND_2460 2 /* 2460 MHz */
-#define PSA_SUBBAND_2484 3 /* 2484 MHz */
-#define PSA_SUBBAND_2430_5 4 /* 2430.5 MHz */
+#define PSA_SUBBAND_2425 1 /* 2425 MHz */
+#define PSA_SUBBAND_2460 2 /* 2460 MHz */
+#define PSA_SUBBAND_2484 3 /* 2484 MHz */
+#define PSA_SUBBAND_2430_5 4 /* 2430.5 MHz */
unsigned char psa_quality_thr; /* [0x21] Modem Quality Threshold */
- unsigned char psa_mod_delay; /* [0x22] Modem Delay ??? (reserved) */
+ unsigned char psa_mod_delay; /* [0x22] Modem Delay (?) (reserved) */
unsigned char psa_nwid[2]; /* [0x23-0x24] Network ID */
- unsigned char psa_nwid_select; /* [0x25] Network ID Select On Off */
- unsigned char psa_encryption_select; /* [0x26] Encryption On Off */
+ unsigned char psa_nwid_select; /* [0x25] Network ID Select On/Off */
+ unsigned char psa_encryption_select; /* [0x26] Encryption On/Off */
unsigned char psa_encryption_key[8]; /* [0x27-0x2E] Encryption Key */
unsigned char psa_databus_width; /* [0x2F] AT bus width select 8/16 */
unsigned char psa_call_code[8]; /* [0x30-0x37] (Japan) Call Code */
@@ -183,8 +183,8 @@

#define PSA_SIZE 64

-/* Calculate offset of a field in the above structure
- * Warning : only even addresses are used */
+/* Calculate offset of a field in the above structure.
+ * Warning: only even addresses are used. */
#define psaoff(p,f) ((unsigned short) ((void *)(&((psa_t *) ((void *) NULL + (p)))->f) - (void *) NULL))

/******************** MODEM MANAGEMENT INTERFACE ********************/
@@ -196,25 +196,25 @@
struct mmw_t
{
unsigned char mmw_encr_key[8]; /* encryption key */
- unsigned char mmw_encr_enable; /* enable/disable encryption */
-#define MMW_ENCR_ENABLE_MODE 0x02 /* Mode of security option */
-#define MMW_ENCR_ENABLE_EN 0x01 /* Enable security option */
+ unsigned char mmw_encr_enable; /* Enable or disable encryption. */
+#define MMW_ENCR_ENABLE_MODE 0x02 /* mode of security option */
+#define MMW_ENCR_ENABLE_EN 0x01 /* Enable security option. */
unsigned char mmw_unused0[1]; /* unused */
- unsigned char mmw_des_io_invert; /* Encryption option */
-#define MMW_DES_IO_INVERT_RES 0x0F /* Reserved */
-#define MMW_DES_IO_INVERT_CTRL 0xF0 /* Control ??? (set to 0) */
+ unsigned char mmw_des_io_invert; /* encryption option */
+#define MMW_DES_IO_INVERT_RES 0x0F /* reserved */
+#define MMW_DES_IO_INVERT_CTRL 0xF0 /* control (?) (set to 0) */
unsigned char mmw_unused1[5]; /* unused */
unsigned char mmw_loopt_sel; /* looptest selection */
-#define MMW_LOOPT_SEL_DIS_NWID 0x40 /* disable NWID filtering */
-#define MMW_LOOPT_SEL_INT 0x20 /* activate Attention Request */
-#define MMW_LOOPT_SEL_LS 0x10 /* looptest w/o collision avoidance */
+#define MMW_LOOPT_SEL_DIS_NWID 0x40 /* Disable NWID filtering. */
+#define MMW_LOOPT_SEL_INT 0x20 /* Activate Attention Request. */
+#define MMW_LOOPT_SEL_LS 0x10 /* looptest, no collision avoidance */
#define MMW_LOOPT_SEL_LT3A 0x08 /* looptest 3a */
#define MMW_LOOPT_SEL_LT3B 0x04 /* looptest 3b */
#define MMW_LOOPT_SEL_LT3C 0x02 /* looptest 3c */
#define MMW_LOOPT_SEL_LT3D 0x01 /* looptest 3d */
unsigned char mmw_jabber_enable; /* jabber timer enable */
/* Abort transmissions > 200 ms */
- unsigned char mmw_freeze; /* freeze / unfreeeze signal level */
+ unsigned char mmw_freeze; /* freeze or unfreeze signal level */
/* 0 : signal level & qual updated for every new message, 1 : frozen */
unsigned char mmw_anten_sel; /* antenna selection */
#define MMW_ANTEN_SEL_SEL 0x01 /* direct antenna selection */
@@ -227,7 +227,7 @@
unsigned char mmw_thr_pre_set; /* level threshold preset */
/* Discard all packet with signal < this value (4) */
unsigned char mmw_decay_prm; /* decay parameters */
- unsigned char mmw_decay_updat_prm; /* decay update parameterz */
+ unsigned char mmw_decay_updat_prm; /* decay update parameters */
unsigned char mmw_quality_thr; /* quality (z-quotient) threshold */
/* Discard all packet with quality < this value (3) */
unsigned char mmw_netw_id_l; /* NWID low order byte */
@@ -237,31 +237,31 @@
/* 2.0 Hardware extension - frequency selection support */
unsigned char mmw_mode_select; /* for analog tests (set to 0) */
unsigned char mmw_unused3[1]; /* unused */
- unsigned char mmw_fee_ctrl; /* frequency eeprom control */
-#define MMW_FEE_CTRL_PRE 0x10 /* Enable protected instructions */
-#define MMW_FEE_CTRL_DWLD 0x08 /* Download eeprom to mmc */
-#define MMW_FEE_CTRL_CMD 0x07 /* EEprom commands : */
+ unsigned char mmw_fee_ctrl; /* frequency EEPROM control */
+#define MMW_FEE_CTRL_PRE 0x10 /* Enable protected instructions. */
+#define MMW_FEE_CTRL_DWLD 0x08 /* Download EEPROM to mmc. */
+#define MMW_FEE_CTRL_CMD 0x07 /* EEPROM commands: */
#define MMW_FEE_CTRL_READ 0x06 /* Read */
#define MMW_FEE_CTRL_WREN 0x04 /* Write enable */
-#define MMW_FEE_CTRL_WRITE 0x05 /* Write data to address */
-#define MMW_FEE_CTRL_WRALL 0x04 /* Write data to all addresses */
+#define MMW_FEE_CTRL_WRITE 0x05 /* Write data to address. */
+#define MMW_FEE_CTRL_WRALL 0x04 /* Write data to all addresses. */
#define MMW_FEE_CTRL_WDS 0x04 /* Write disable */
#define MMW_FEE_CTRL_PRREAD 0x16 /* Read addr from protect register */
#define MMW_FEE_CTRL_PREN 0x14 /* Protect register enable */
-#define MMW_FEE_CTRL_PRCLEAR 0x17 /* Unprotect all registers */
-#define MMW_FEE_CTRL_PRWRITE 0x15 /* Write addr in protect register */
+#define MMW_FEE_CTRL_PRCLEAR 0x17 /* Unprotect all registers. */
+#define MMW_FEE_CTRL_PRWRITE 0x15 /* Write address in protect register */
#define MMW_FEE_CTRL_PRDS 0x14 /* Protect register disable */
- /* Never issue this command (PRDS) : it's irreversible !!! */
+ /* Never issue the PRDS command: it's irreversible! */

- unsigned char mmw_fee_addr; /* EEprom address */
-#define MMW_FEE_ADDR_CHANNEL 0xF0 /* Select the channel */
+ unsigned char mmw_fee_addr; /* EEPROM address */
+#define MMW_FEE_ADDR_CHANNEL 0xF0 /* Select the channel. */
#define MMW_FEE_ADDR_OFFSET 0x0F /* Offset in channel data */
#define MMW_FEE_ADDR_EN 0xC0 /* FEE_CTRL enable operations */
#define MMW_FEE_ADDR_DS 0x00 /* FEE_CTRL disable operations */
#define MMW_FEE_ADDR_ALL 0x40 /* FEE_CTRL all operations */
#define MMW_FEE_ADDR_CLEAR 0xFF /* FEE_CTRL clear operations */

- unsigned char mmw_fee_data_l; /* Write data to EEprom */
+ unsigned char mmw_fee_data_l; /* Write data to EEPROM. */
unsigned char mmw_fee_data_h; /* high octet */
unsigned char mmw_ext_ant; /* Setting for external antenna */
#define MMW_EXT_ANT_EXTANT 0x01 /* Select external antenna */
@@ -293,13 +293,13 @@
#define MMR_DCE_STATUS_LOOPT_IND 0x02 /* loop test indicated */
#define MMR_DCE_STATUS_TX_BUSY 0x04 /* transmitter on */
#define MMR_DCE_STATUS_JBR_EXPIRED 0x08 /* jabber timer expired */
- unsigned char mmr_dsp_id; /* DSP id (AA = Daedalus rev A) */
+ unsigned char mmr_dsp_id; /* DSP ID (AA = Daedalus rev A) */
unsigned char mmr_unused2[2]; /* unused */
- unsigned char mmr_correct_nwid_l; /* # of correct NWID's rxd (low) */
- unsigned char mmr_correct_nwid_h; /* # of correct NWID's rxd (high) */
- /* Warning : Read high order octet first !!! */
- unsigned char mmr_wrong_nwid_l; /* # of wrong NWID's rxd (low) */
- unsigned char mmr_wrong_nwid_h; /* # of wrong NWID's rxd (high) */
+ unsigned char mmr_correct_nwid_l; /* # of correct NWIDs rxd (low) */
+ unsigned char mmr_correct_nwid_h; /* # of correct NWIDs rxd (high) */
+ /* Warning: read high-order octet first! */
+ unsigned char mmr_wrong_nwid_l; /* # of wrong NWIDs rxd (low) */
+ unsigned char mmr_wrong_nwid_h; /* # of wrong NWIDs rxd (high) */
unsigned char mmr_thr_pre_set; /* level threshold preset */
#define MMR_THR_PRE_SET 0x3F /* level threshold preset */
#define MMR_THR_PRE_SET_CUR 0x80 /* Current signal above it */
@@ -312,17 +312,17 @@
unsigned char mmr_sgnl_qual; /* signal quality */
#define MMR_SGNL_QUAL 0x0F /* signal quality */
#define MMR_SGNL_QUAL_ANT 0x80 /* current antenna used */
- unsigned char mmr_netw_id_l; /* NWID low order byte ??? */
+ unsigned char mmr_netw_id_l; /* NWID low order byte (?) */
unsigned char mmr_unused3[3]; /* unused */

/* 2.0 Hardware extension - frequency selection support */
- unsigned char mmr_fee_status; /* Status of frequency eeprom */
-#define MMR_FEE_STATUS_ID 0xF0 /* Modem revision id */
+ unsigned char mmr_fee_status; /* Status of frequency EEPROM */
+#define MMR_FEE_STATUS_ID 0xF0 /* Modem revision ID */
#define MMR_FEE_STATUS_DWLD 0x08 /* Download in progress */
-#define MMR_FEE_STATUS_BUSY 0x04 /* EEprom busy */
+#define MMR_FEE_STATUS_BUSY 0x04 /* EEPROM busy */
unsigned char mmr_unused4[1]; /* unused */
- unsigned char mmr_fee_data_l; /* Read data from eeprom (low) */
- unsigned char mmr_fee_data_h; /* Read data from eeprom (high) */
+ unsigned char mmr_fee_data_l; /* Read data from EEPROM (low) */
+ unsigned char mmr_fee_data_h; /* Read data from EEPROM (high) */
};

#define MMR_SIZE 36
diff -ru linux/drivers/net/wavelan.p.h linux-2.1.106-local-tourrilhes/drivers/net/wavelan.p.h
--- linux/drivers/net/wavelan.p.h Tue May 13 22:41:12 1997
+++ linux-2.1.106-local-tourrilhes/drivers/net/wavelan.p.h Fri Jun 19 04:54:51 1998
@@ -1,79 +1,79 @@
/*
- * Wavelan ISA driver
+ * WaveLAN ISA driver
*
* Jean II - HPLB '96
*
* Reorganisation and extension of the driver.
*
- * This file contain all definition and declarations necessary for the
- * wavelan isa driver. This file is a private header, so it should
- * be included only on wavelan.c !!!
+ * This file contains all definitions and declarations necessary for the
+ * WaveLAN ISA driver. This file is a private header, so it should
+ * be included only in wavelan.c!
*/

#ifndef WAVELAN_P_H
#define WAVELAN_P_H

-/************************** DOCUMENTATION **************************/
+/************************** DOCUMENTATION ***************************/
/*
- * This driver provide a Linux interface to the Wavelan ISA hardware
- * The Wavelan is a product of Lucent ("http://wavelan.netland.nl/").
+ * This driver provides a Linux interface to the WaveLAN ISA hardware.
+ * The WaveLAN is a product of Lucent (http://www.wavelan.com/).
* This division was formerly part of NCR and then AT&T.
- * Wavelan are also distributed by DEC (RoamAbout), Digital Ocean and
- * Aironet (Arlan). If you have one of those product, you will need to
- * make some changes below...
- *
- * This driver is still a beta software. A lot of bugs have been corrected,
- * a lot of functionalities are implemented, the whole appear pretty stable,
- * but there is still some area of improvement (encryption, performance...).
- *
- * To know how to use this driver, read the NET3 HOWTO.
- * If you want to exploit the many other fonctionalities, look comments
- * in the code...
+ * WaveLANs are also distributed by DEC (RoamAbout), Digital Ocean and
+ * Aironet (Arlan). If you have one of those products, you will need to
+ * make some changes below.
+ *
+ * This driver is still beta software. A lot of bugs have been corrected,
+ * a lot of functionality is implemented, and the whole appears stable,
+ * but there is still room for improvement (encryption, performance).
+ *
+ * To learn how to use this driver, read the NET3 HOWTO.
+ * If you want to exploit the many other functionalities, read the comments
+ * in the code.
*
- * This driver is the result of the effort of many peoples (see below).
+ * This driver is the result of the effort of many people (see below).
*/

/* ------------------------ SPECIFIC NOTES ------------------------ */
/*
- * wavelan.o is darn too big
- * -------------------------
- * That's true ! There is a very simple way to reduce the driver
- * object by 33% (yes !). Comment out the following line :
+ * wavelan.o is too darned big
+ * ---------------------------
+ * That's true! There is a very simple way to reduce the driver
+ * object by 33%! Comment out the following line:
* #include <linux/wireless.h>
*
- * MAC address and hardware detection :
- * ----------------------------------
- * The detection code of the wavelan chech that the first 3
- * octets of the MAC address fit the company code. This type of
- * detection work well for AT&T cards (because the AT&T code is
+ * MAC address and hardware detection:
+ * -----------------------------------
+ * The detection code for the WaveLAN checks that the first three
+ * octets of the MAC address fit the company code. This type of
+ * detection works well for AT&T cards (because the AT&T code is
* hardcoded in wavelan.h), but of course will fail for other
- * manufacturer.
+ * manufacturers.
*
- * If you are sure that your card is derived from the wavelan,
- * here is the way to configure it :
+ * If you are sure that your card is derived from the WaveLAN,
+ * here is the way to configure it:
* 1) Get your MAC address
- * a) With your card utilities (wfreqsel, instconf, ...)
- * b) With the driver :
+ * a) With your card utilities (wfreqsel, instconf, etc.)
+ * b) With the driver:
* o compile the kernel with DEBUG_CONFIG_INFO enabled
* o Boot and look the card messages
* 2) Set your MAC code (3 octets) in MAC_ADDRESSES[][3] (wavelan.h)
- * 3) Compile & verify
- * 4) Send me the MAC code - I will include it in the next version...
+ * 3) Compile and verify
+ * 4) Send me the MAC code. I will include it in the next version.
*
- * "CU Inactive" message at boot up :
+ * "CU Inactive" message at boot up:
* -----------------------------------
- * It seem that there is some weird timings problems with the
- * Intel microcontroler. In fact, this message is triggered by a
- * bad reading of the on board ram the first time we read the
- * control block. If you ignore this message, all is ok (but in
- * fact, currently, it reset the wavelan hardware).
+ * It seems that there is some weird timing problem with the
+ * Intel microcontroller. In fact, this message is triggered by a
+ * bad reading of the onboard RAM the first time we read the
+ * control block. If you ignore this message, all is OK (but in
+ * fact, currently, it resets the WaveLAN hardware).
*
- * To get rid of that problem, there is two solution. The first
+ * There are two ways to get rid of that problem. The first
* is to add a dummy read of the scb at the end of
- * wv_82586_config. The second is to add the timers
+ * wv_82586_config. The second is to add the timers
* wv_synchronous_cmd and wv_ack (the udelay just after the
- * waiting loops - seem that the controler is not totally ready
- * when it say it is !).
+ * waiting loops--it seems that the controller is not totally ready
+ * when it says it is).
*
* In the current code, I use the second solution (to be
* consistent with the original solution of Bruce Janson).
@@ -81,10 +81,10 @@

/* --------------------- WIRELESS EXTENSIONS --------------------- */
/*
- * This driver is the first one to support "wireless extensions".
- * This set of extensions provide you some way to control the wireless
- * caracteristics of the hardware in a standard way and support for
- * applications for taking advantage of it (like Mobile IP).
+ * This driver is the first to support "wireless extensions".
+ * This set of extensions provides a standard way to control the wireless
+ * characteristics of the hardware. Applications such as mobile IP may
+ * take advantage of it.
*
* You will need to enable the CONFIG_NET_RADIO define in the kernel
* configuration to enable the wireless extensions (this is the one
@@ -96,64 +96,64 @@

/* ---------------------------- FILES ---------------------------- */
/*
- * wavelan.c : The actual code for the driver - C functions
+ * wavelan.c: actual code for the driver: C functions
*
- * wavelan.p.h : Private header : local types / vars for the driver
+ * wavelan.p.h: private header: local types and variables for driver
*
- * wavelan.h : Description of the hardware interface & structs
+ * wavelan.h: description of the hardware interface and structs
*
- * i82586.h : Description if the Ethernet controler
+ * i82586.h: description of the Ethernet controller
*/

/* --------------------------- HISTORY --------------------------- */
/*
- * (Made with information in drivers headers. It may not be accurate,
- * and I garantee nothing except my best effort...)
+ * This is based on information in the drivers' headers. It may not be
+ * accurate, and I guarantee only my best effort.
*
- * The history of the Wavelan drivers is as complicated as history of
- * the Wavelan itself (NCR -> AT&T -> Lucent).
+ * The history of the WaveLAN drivers is as complicated as the history of
+ * the WaveLAN itself (NCR -> AT&T -> Lucent).
*
- * All started with Anders Klemets <klemets@paul.rutgers.edu>,
- * writting a Wavelan ISA driver for the MACH microkernel. Girish
+ * It all started with Anders Klemets <klemets@paul.rutgers.edu>
+ * writing a WaveLAN ISA driver for the Mach microkernel. Girish
* Welling <welling@paul.rutgers.edu> had also worked on it.
- * Keith Moore modify this for the Pcmcia hardware.
+ * Keith Moore modified this for the PCMCIA hardware.
*
- * Robert Morris <rtm@das.harvard.edu> port these two drivers to BSDI
- * and add specific Pcmcia support (there is currently no equivalent
- * of the PCMCIA package under BSD...).
+ * Robert Morris <rtm@das.harvard.edu> ported these two drivers to BSDI
+ * and added specific PCMCIA support (there is currently no equivalent
+ * of the PCMCIA package under BSD).
*
- * Jim Binkley <jrb@cs.pdx.edu> port both BSDI drivers to freeBSD.
+ * Jim Binkley <jrb@cs.pdx.edu> ported both BSDI drivers to FreeBSD.
*
- * Bruce Janson <bruce@cs.usyd.edu.au> port the BSDI ISA driver to Linux.
+ * Bruce Janson <bruce@cs.usyd.edu.au> ported the BSDI ISA driver to Linux.
*
- * Anthony D. Joseph <adj@lcs.mit.edu> started modify Bruce driver
+ * Anthony D. Joseph <adj@lcs.mit.edu> started to modify Bruce's driver
* (with help of the BSDI PCMCIA driver) for PCMCIA.
- * Yunzhou Li <yunzhou@strat.iol.unh.edu> finished is work.
+ * Yunzhou Li <yunzhou@strat.iol.unh.edu> finished this work.
* Joe Finney <joe@comp.lancs.ac.uk> patched the driver to start
- * correctly 2.00 cards (2.4 GHz with frequency selection).
+ * 2.00 cards correctly (2.4 GHz with frequency selection).
* David Hinds <dhinds@hyper.stanford.edu> integrated the whole in his
- * Pcmcia package (+ bug corrections).
+ * PCMCIA package (and bug corrections).
*
* I (Jean Tourrilhes - jt@hplb.hpl.hp.com) then started to make some
- * patchs to the Pcmcia driver. After, I added code in the ISA driver
+ * patches to the PCMCIA driver. Later, I added code in the ISA driver
* for Wireless Extensions and full support of frequency selection
- * cards. Then, I've done the same to the Pcmcia driver + some
- * reorganisation. Finally, I came back to the ISA driver to
- * upgrade it at the same level as the Pcmcia one and reorganise
- * the code
+ * cards. Then, I did the same to the PCMCIA driver, and did some
+ * reorganisation. Finally, I came back to the ISA driver to
+ * upgrade it at the same level as the PCMCIA one and reorganise
+ * the code.
* Loeke Brederveld <lbrederv@wavelan.com> from Lucent has given me
- * much needed informations on the Wavelan hardware.
+ * much needed information on the WaveLAN hardware.
*/

-/* The original copyrights and litteratures mention others names and
- * credits. I don't know what there part in this development was...
+/* The original copyrights and literature mention others' names and
+ * credits. I don't know what their part in this development was.
*/

-/* By the way : for the copyright & legal stuff :
- * Almost everybody wrote code under GNU or BSD license (or alike),
- * and want that their original copyright remain somewhere in the
+/* By the way, for the copyright and legal stuff:
+ * almost everybody wrote code under the GNU or BSD license (or similar),
+ * and want their original copyright to remain somewhere in the
* code (for myself, I go with the GPL).
- * Nobody want to take responsibility for anything, except the fame...
+ * Nobody wants to take responsibility for anything, except the fame.
*/

/* --------------------------- CREDITS --------------------------- */
@@ -162,121 +162,120 @@
* Linux operating system.
* It is based on other device drivers and information
* either written or supplied by:
- * Ajay Bakre (bakre@paul.rutgers.edu),
- * Donald Becker (becker@cesdis.gsfc.nasa.gov),
- * Loeke Brederveld (Loeke.Brederveld@Utrecht.NCR.com),
+ * Ajay Bakre <bakre@paul.rutgers.edu>,
+ * Donald Becker <becker@cesdis.gsfc.nasa.gov>,
+ * Loeke Brederveld <Loeke.Brederveld@Utrecht.NCR.com>,
* Brent Elphick <belphick@uwaterloo.ca>,
- * Anders Klemets (klemets@it.kth.se),
- * Vladimir V. Kolpakov (w@stier.koenig.ru),
- * Marc Meertens (Marc.Meertens@Utrecht.NCR.com),
- * Pauline Middelink (middelin@polyware.iaf.nl),
- * Robert Morris (rtm@das.harvard.edu),
- * Jean Tourrilhes (jt@hplb.hpl.hp.com),
- * Girish Welling (welling@paul.rutgers.edu),
+ * Anders Klemets <klemets@it.kth.se>,
+ * Vladimir V. Kolpakov <w@stier.koenig.ru>,
+ * Marc Meertens <Marc.Meertens@Utrecht.NCR.com>,
+ * Pauline Middelink <middelin@polyware.iaf.nl>,
+ * Robert Morris <rtm@das.harvard.edu>,
+ * Jean Tourrilhes <jt@hplb.hpl.hp.com>,
+ * Girish Welling <welling@paul.rutgers.edu>,
* Clark Woodworth <clark@hiway1.exit109.com>
- * Yongguang Zhang <ygz@isl.hrl.hac.com>...
+ * Yongguang Zhang <ygz@isl.hrl.hac.com>
*
* Thanks go also to:
- * James Ashton (jaa101@syseng.anu.edu.au),
- * Alan Cox (iialan@iiit.swan.ac.uk),
- * Allan Creighton (allanc@cs.usyd.edu.au),
- * Matthew Geier (matthew@cs.usyd.edu.au),
- * Remo di Giovanni (remo@cs.usyd.edu.au),
- * Eckhard Grah (grah@wrcs1.urz.uni-wuppertal.de),
- * Vipul Gupta (vgupta@cs.binghamton.edu),
- * Mark Hagan (mhagan@wtcpost.daytonoh.NCR.COM),
- * Tim Nicholson (tim@cs.usyd.edu.au),
- * Ian Parkin (ian@cs.usyd.edu.au),
- * John Rosenberg (johnr@cs.usyd.edu.au),
- * George Rossi (george@phm.gov.au),
- * Arthur Scott (arthur@cs.usyd.edu.au),
+ * James Ashton <jaa101@syseng.anu.edu.au>,
+ * Alan Cox <iialan@iiit.swan.ac.uk>,
+ * Allan Creighton <allanc@cs.usyd.edu.au>,
+ * Matthew Geier <matthew@cs.usyd.edu.au>,
+ * Remo di Giovanni <remo@cs.usyd.edu.au>,
+ * Eckhard Grah <grah@wrcs1.urz.uni-wuppertal.de>,
+ * Vipul Gupta <vgupta@cs.binghamton.edu>,
+ * Mark Hagan <mhagan@wtcpost.daytonoh.NCR.COM>,
+ * Tim Nicholson <tim@cs.usyd.edu.au>,
+ * Ian Parkin <ian@cs.usyd.edu.au>,
+ * John Rosenberg <johnr@cs.usyd.edu.au>,
+ * George Rossi <george@phm.gov.au>,
+ * Arthur Scott <arthur@cs.usyd.edu.au>,
* Stanislav Sinyagin <stas@isf.ru>
- * Peter Storey,
- * for their assistance and advice.
+ * and Peter Storey for their assistance and advice.
*
* Additional Credits:
*
- * My developpement has been done under Linux 2.0.x (Debian 1.1) with
+ * My development has been done under Linux 2.0.x (Debian 1.1) with
* an HP Vectra XP/60.
*
*/

/* ------------------------- IMPROVEMENTS ------------------------- */
/*
- * I proudly present :
+ * I proudly present:
*
- * Changes mades in first pre-release :
+ * Changes made in first pre-release:
* ----------------------------------
- * - Reorganisation of the code, function name change
- * - Creation of private header (wavelan.p.h)
- * - Reorganised debug messages
- * - More comments, history, ...
- * - mmc_init : configure the PSA if not done
- * - mmc_init : correct default value of level threshold for pcmcia
- * - mmc_init : 2.00 detection better code for 2.00 init
+ * - reorganisation of the code, function name change
+ * - creation of private header (wavelan.p.h)
+ * - reorganised debug messages
+ * - more comments, history, etc.
+ * - mmc_init: configure the PSA if not done
+ * - mmc_init: correct default value of level threshold for PCMCIA
+ * - mmc_init: 2.00 detection better code for 2.00 initialization
* - better info at startup
- * - irq setting (note : this setting is permanent...)
- * - Watchdog : change strategy (+ solve module removal problems)
- * - add wireless extensions (ioctl & get_wireless_stats)
+ * - IRQ setting (note: this setting is permanent)
+ * - watchdog: change strategy (and solve module removal problems)
+ * - add wireless extensions (ioctl and get_wireless_stats)
* get/set nwid/frequency on fly, info for /proc/net/wireless
- * - More wireless extension : SETSPY and GETSPY
- * - Make wireless extensions optional
- * - Private ioctl to set/get quality & level threshold, histogram
- * - Remove /proc/net/wavelan
- * - Supress useless stuff from lp (net_local)
+ * - more wireless extensions: SETSPY and GETSPY
+ * - make wireless extensions optional
+ * - private ioctl to set/get quality and level threshold, histogram
+ * - remove /proc/net/wavelan
+ * - suppress useless stuff from lp (net_local)
* - kernel 2.1 support (copy_to/from_user instead of memcpy_to/fromfs)
- * - Add message level (debug stuff in /var/adm/debug & errors not
+ * - add message level (debug stuff in /var/adm/debug and errors not
* displayed at console and still in /var/adm/messages)
* - multi device support
- * - Start fixing the probe (init code)
- * - More inlines
+ * - start fixing the probe (init code)
+ * - more inlines
* - man page
- * - Lot of others minor details & cleanups
+ * - many other minor details and cleanups
*
- * Changes made in second pre-release :
- * ----------------------------------
- * - Cleanup init code (probe & module init)
- * - Better multi device support (module)
- * - name assignement (module)
- *
- * Changes made in third pre-release :
- * ---------------------------------
- * - Be more conservative on timers
- * - Preliminary support for multicast (I still lack some details...)
+ * Changes made in second pre-release:
+ * -----------------------------------
+ * - clean up init code (probe and module init)
+ * - better multiple device support (module)
+ * - name assignment (module)
*
- * Changes made in fourth pre-release :
+ * Changes made in third pre-release:
* ----------------------------------
+ * - be more conservative on timers
+ * - preliminary support for multicast (I still lack some details)
+ *
+ * Changes made in fourth pre-release:
+ * -----------------------------------
* - multicast (revisited and finished)
- * - Avoid reset in set_multicast_list (a really big hack)
- * if somebody could apply this code for other i82586 based driver...
- * - Share on board memory 75% RU / 25% CU (instead of 50/50)
+ * - avoid reset in set_multicast_list (a really big hack)
+ * if somebody could apply this code for other i82586 based drivers
+ * - share onboard memory 75% RU and 25% CU (instead of 50/50)
*
- * Changes made for release in 2.1.15 :
- * ----------------------------------
- * - Change the detection code for multi manufacturer code support
+ * Changes made for release in 2.1.15:
+ * -----------------------------------
+ * - change the detection code for multi manufacturer code support
*
- * Changes made for release in 2.1.17 :
- * ----------------------------------
- * - Update to wireless extensions changes
- * - Silly bug in card initial configuration (psa_conf_status)
+ * Changes made for release in 2.1.17:
+ * -----------------------------------
+ * - update to wireless extensions changes
+ * - silly bug in card initial configuration (psa_conf_status)
*
- * Changes made for release in 2.1.27 & 2.0.30 :
- * -------------------------------------------
- * - Small bug in debug code (probably not the last one...)
- * - Remove extern kerword for wavelan_probe()
- * - Level threshold is now a standard wireless extension (version 4 !)
+ * Changes made for release in 2.1.27 & 2.0.30:
+ * --------------------------------------------
+ * - small bug in debug code (probably not the last one...)
+ * - remove extern keyword for wavelan_probe()
+ * - level threshold is now a standard wireless extension (version 4 !)
* - modules parameters types (new module interface)
*
- * Changes made for release in 2.1.36 :
- * ----------------------------------
+ * Changes made for release in 2.1.36:
+ * -----------------------------------
* - byte count stats (courtesy of David Hinds)
- * - Remove dev_tint stuff (courtesy of David Hinds)
- * - Encryption setting from Brent Elphick (thanks a lot !)
+ * - remove dev_tint stuff (courtesy of David Hinds)
+ * - encryption setting from Brent Elphick (thanks a lot!)
* - 'ioaddr' to 'u_long' for the Alpha (thanks to Stanislav Sinyagin)
*
- * Wishes & dreams :
- * ---------------
- * - Roaming
+ * Wishes & dreams:
+ * ----------------
+ * - roaming
*/

/***************************** INCLUDES *****************************/
@@ -309,52 +308,52 @@

#include <linux/wireless.h> /* Wireless extensions */

-/* Wavelan declarations */
+/* WaveLAN declarations */
#include "i82586.h"
#include "wavelan.h"

/****************************** DEBUG ******************************/

-#undef DEBUG_MODULE_TRACE /* Module insertion/removal */
-#undef DEBUG_CALLBACK_TRACE /* Calls made by Linux */
-#undef DEBUG_INTERRUPT_TRACE /* Calls to handler */
-#undef DEBUG_INTERRUPT_INFO /* type of interrupt & so on */
+#undef DEBUG_MODULE_TRACE /* module insertion/removal */
+#undef DEBUG_CALLBACK_TRACE /* calls made by Linux */
+#undef DEBUG_INTERRUPT_TRACE /* calls to handler */
+#undef DEBUG_INTERRUPT_INFO /* type of interrupt and so on */
#define DEBUG_INTERRUPT_ERROR /* problems */
-#undef DEBUG_CONFIG_TRACE /* Trace the config functions */
-#undef DEBUG_CONFIG_INFO /* What's going on... */
-#define DEBUG_CONFIG_ERRORS /* Errors on configuration */
-#undef DEBUG_TX_TRACE /* Transmission calls */
-#undef DEBUG_TX_INFO /* Header of the transmited packet */
+#undef DEBUG_CONFIG_TRACE /* Trace the config functions. */
+#undef DEBUG_CONFIG_INFO /* what's going on */
+#define DEBUG_CONFIG_ERRORS /* errors on configuration */
+#undef DEBUG_TX_TRACE /* transmission calls */
+#undef DEBUG_TX_INFO /* header of the transmitted packet */
#define DEBUG_TX_ERROR /* unexpected conditions */
-#undef DEBUG_RX_TRACE /* Transmission calls */
-#undef DEBUG_RX_INFO /* Header of the transmited packet */
+#undef DEBUG_RX_TRACE /* transmission calls */
+#undef DEBUG_RX_INFO /* header of the transmitted packet */
#define DEBUG_RX_ERROR /* unexpected conditions */
-#undef DEBUG_PACKET_DUMP 16 /* Dump packet on the screen */
-#undef DEBUG_IOCTL_TRACE /* Misc call by Linux */
-#undef DEBUG_IOCTL_INFO /* Various debug info */
-#define DEBUG_IOCTL_ERROR /* What's going wrong */
-#define DEBUG_BASIC_SHOW /* Show basic startup info */
-#undef DEBUG_VERSION_SHOW /* Print version info */
-#undef DEBUG_PSA_SHOW /* Dump psa to screen */
-#undef DEBUG_MMC_SHOW /* Dump mmc to screen */
-#undef DEBUG_SHOW_UNUSED /* Show also unused fields */
-#undef DEBUG_I82586_SHOW /* Show i82586 status */
-#undef DEBUG_DEVICE_SHOW /* Show device parameters */
-
-/* Options : */
-#define USE_PSA_CONFIG /* Use info from the PSA */
-#define IGNORE_NORMAL_XMIT_ERRS /* Don't bother with normal conditions */
-#undef STRUCT_CHECK /* Verify padding of structures */
-#undef PSA_CRC /* Check CRC in PSA */
-#undef OLDIES /* Old code (to redo) */
-#undef RECORD_SNR /* To redo */
-#undef EEPROM_IS_PROTECTED /* Doesn't seem to be necessary */
-#define MULTICAST_AVOID /* Avoid extra multicast (I'm sceptical) */
-
-#ifdef WIRELESS_EXT /* If wireless extension exist in the kernel */
-/* Warning : these stuff will slow down the driver... */
-#define WIRELESS_SPY /* Enable spying addresses */
-#undef HISTOGRAM /* Enable histogram of sig level... */
+#undef DEBUG_PACKET_DUMP 16 /* Dump packet on the screen. */
+#undef DEBUG_IOCTL_TRACE /* misc. call by Linux */
+#undef DEBUG_IOCTL_INFO /* various debugging info */
+#define DEBUG_IOCTL_ERROR /* what's going wrong */
+#define DEBUG_BASIC_SHOW /* Show basic startup info. */
+#undef DEBUG_VERSION_SHOW /* Print version info. */
+#undef DEBUG_PSA_SHOW /* Dump PSA to screen. */
+#undef DEBUG_MMC_SHOW /* Dump mmc to screen. */
+#undef DEBUG_SHOW_UNUSED /* Show unused fields too. */
+#undef DEBUG_I82586_SHOW /* Show i82586 status. */
+#undef DEBUG_DEVICE_SHOW /* Show device parameters. */
+
+/* Options */
+#define USE_PSA_CONFIG /* Use info from the PSA. */
+#define IGNORE_NORMAL_XMIT_ERRS /* Don't bother with normal conditions. */
+#undef STRUCT_CHECK /* Verify padding of structures. */
+#undef PSA_CRC /* Check CRC in PSA. */
+#undef OLDIES /* old code (to redo) */
+#undef RECORD_SNR /* to redo */
+#undef EEPROM_IS_PROTECTED /* doesn't seem to be necessary */
+#define MULTICAST_AVOID /* Avoid extra multicast (I'm sceptical). */
+
+#ifdef WIRELESS_EXT /* If wireless extensions exist in the kernel */
+/* Warning: this stuff will slow down the driver. */
+#define WIRELESS_SPY /* Enable spying addresses. */
+#undef HISTOGRAM /* Enable histogram of signal level. */
#endif

/************************ CONSTANTS & MACROS ************************/
@@ -364,7 +363,7 @@
#endif

/* Watchdog temporisation */
-#define WATCHDOG_JIFFIES 32 /* TODO: express in HZ. */
+#define WATCHDOG_JIFFIES 32 /* TODO: express in HZ. */

/* Macro to get the number of elements in an array */
#define NELS(a) (sizeof(a) / sizeof(a[0]))
@@ -396,23 +395,23 @@
/*
* Static specific data for the interface.
*
- * For each network interface, Linux keep data in two structure. "device"
- * keep the generic data (same format for everybody) and "net_local" keep
- * the additional specific data.
+ * For each network interface, Linux keeps data in two structures: "device"
+ * keeps the generic data (same format for everybody) and "net_local" keeps
+ * additional specific data.
* Note that some of this specific data is in fact generic (en_stats, for
* example).
*/
struct net_local
{
- net_local * next; /* Linked list of the devices */
- device * dev; /* Reverse link... */
+ net_local * next; /* linked list of the devices */
+ device * dev; /* reverse link */
en_stats stats; /* Ethernet interface statistics */
- int nresets; /* Number of hw resets */
- u_char reconfig_82586; /* Need to reconfigure the controler */
- u_char promiscuous; /* Promiscuous mode */
- int mc_count; /* Number of multicast addresses */
- timer_list watchdog; /* To avoid blocking state */
- u_short hacr; /* Current host interface state */
+ int nresets; /* number of hardware resets */
+ u_char reconfig_82586; /* We need to reconfigure the controller. */
+ u_char promiscuous; /* promiscuous mode */
+ int mc_count; /* number of multicast addresses */
+ timer_list watchdog; /* to avoid blocking state */
+ u_short hacr; /* current host interface state */

int tx_n_in_use;
u_short rx_head;
@@ -421,82 +420,83 @@
u_short tx_first_in_use;

#ifdef WIRELESS_EXT
- iw_stats wstats; /* Wireless specific stats */
+ iw_stats wstats; /* Wireless-specific statistics */
#endif

#ifdef WIRELESS_SPY
- int spy_number; /* Number of addresses to spy */
- mac_addr spy_address[IW_MAX_SPY]; /* The addresses to spy */
- iw_qual spy_stat[IW_MAX_SPY]; /* Statistics gathered */
+ int spy_number; /* number of addresses to spy */
+ mac_addr spy_address[IW_MAX_SPY]; /* the addresses to spy */
+ iw_qual spy_stat[IW_MAX_SPY]; /* statistics gathered */
#endif /* WIRELESS_SPY */
+
#ifdef HISTOGRAM
- int his_number; /* Number of intervals */
- u_char his_range[16]; /* Boundaries of interval ]n-1; n] */
- u_long his_sum[16]; /* Sum in interval */
+ int his_number; /* number of intervals */
+ u_char his_range[16]; /* boundaries of interval ]n-1; n] */
+ u_long his_sum[16]; /* sum in interval */
#endif /* HISTOGRAM */
};

/**************************** PROTOTYPES ****************************/

-/* ----------------------- MISC SUBROUTINES ------------------------ */
+/* ----------------------- MISC. SUBROUTINES ------------------------ */
static inline unsigned long /* flags */
wv_splhi(void); /* Disable interrupts */
static inline void
- wv_splx(unsigned long); /* ReEnable interrupts : flags */
+ wv_splx(unsigned long); /* Enable interrupts: flags */
static u_char
wv_irq_to_psa(int);
static int
wv_psa_to_irq(u_char);
/* ------------------- HOST ADAPTER SUBROUTINES ------------------- */
static inline u_short /* data */
- hasr_read(u_long); /* Read the host interface : base address */
+ hasr_read(u_long); /* Read the host interface: base address */
static inline void
- hacr_write(u_long, /* Write to host interface : base address */
+ hacr_write(u_long, /* Write to host interface: base address */
u_short), /* data */
hacr_write_slow(u_long,
u_short),
set_chan_attn(u_long, /* ioaddr */
- u_short), /* hacr */
+ u_short), /* hacr */
wv_hacr_reset(u_long), /* ioaddr */
wv_16_off(u_long, /* ioaddr */
- u_short), /* hacr */
+ u_short), /* hacr */
wv_16_on(u_long, /* ioaddr */
- u_short), /* hacr */
+ u_short), /* hacr */
wv_ints_off(device *),
wv_ints_on(device *);
/* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */
static void
- psa_read(u_long, /* Read the Parameter Storage Area */
+ psa_read(u_long, /* Read the Parameter Storage Area. */
u_short, /* hacr */
int, /* offset in PSA */
u_char *, /* buffer to fill */
int), /* size to read */
- psa_write(u_long, /* Write to the PSA */
+ psa_write(u_long, /* Write to the PSA. */
u_short, /* hacr */
- int, /* Offset in psa */
- u_char *, /* Buffer in memory */
- int); /* Length of buffer */
+ int, /* offset in PSA */
+ u_char *, /* buffer in memory */
+ int); /* length of buffer */
static inline void
- mmc_out(u_long, /* Write 1 byte to the Modem Manag Control */
+ mmc_out(u_long, /* Write 1 byte to the Modem Manag Control. */
u_short,
u_char),
- mmc_write(u_long, /* Write n bytes to the MMC */
+ mmc_write(u_long, /* Write n bytes to the MMC. */
u_char,
u_char *,
int);
-static inline u_char /* Read 1 byte from the MMC */
+static inline u_char /* Read 1 byte from the MMC. */
mmc_in(u_long,
u_short);
static inline void
- mmc_read(u_long, /* Read n bytes from the MMC */
+ mmc_read(u_long, /* Read n bytes from the MMC. */
u_char,
u_char *,
int),
- fee_wait(u_long, /* Wait for frequency EEprom : base address */
- int, /* Base delay to wait for */
- int); /* Number of time to wait */
+ fee_wait(u_long, /* Wait for frequency EEPROM: base address */
+ int, /* base delay to wait for */
+ int); /* time to wait */
static void
- fee_read(u_long, /* Read the frequency EEprom : base address */
+ fee_read(u_long, /* Read the frequency EEPROM: base address */
u_short, /* destination offset */
u_short *, /* data buffer */
int); /* number of registers */
@@ -539,60 +539,59 @@
wavelan_set_multicast_list(device *);
/* ----------------------- PACKET RECEPTION ----------------------- */
static inline void
- wv_packet_read(device *, /* Read a packet from a frame */
+ wv_packet_read(device *, /* Read a packet from a frame. */
u_short,
int),
- wv_receive(device *); /* Read all packets waiting */
+ wv_receive(device *); /* Read all packets waiting. */
/* --------------------- PACKET TRANSMISSION --------------------- */
static inline void
- wv_packet_write(device *, /* Write a packet to the Tx buffer */
+ wv_packet_write(device *, /* Write a packet to the Tx buffer. */
void *,
short);
static int
- wavelan_packet_xmit(struct sk_buff *, /* Send a packet */
+ wavelan_packet_xmit(struct sk_buff *, /* Send a packet. */
device *);
/* -------------------- HARDWARE CONFIGURATION -------------------- */
static inline int
- wv_mmc_init(device *), /* Initialize the modem */
- wv_ru_start(device *), /* Start the i82586 receiver unit */
- wv_cu_start(device *), /* Start the i82586 command unit */
- wv_82586_start(device *); /* Start the i82586 */
+ wv_mmc_init(device *), /* Initialize the modem. */
+ wv_ru_start(device *), /* Start the i82586 receiver unit. */
+ wv_cu_start(device *), /* Start the i82586 command unit. */
+ wv_82586_start(device *); /* Start the i82586. */
static void
- wv_82586_config(device *); /* Configure the i82586 */
+ wv_82586_config(device *); /* Configure the i82586. */
static inline void
wv_82586_stop(device *);
static int
- wv_hw_reset(device *), /* Reset the wavelan hardware */
+ wv_hw_reset(device *), /* Reset the WaveLAN hardware. */
wv_check_ioaddr(u_long, /* ioaddr */
u_char *); /* mac address (read) */
/* ---------------------- INTERRUPT HANDLING ---------------------- */
static void
- wavelan_interrupt(int, /* Interrupt handler */
+ wavelan_interrupt(int, /* interrupt handler */
void *,
struct pt_regs *);
static void
- wavelan_watchdog(u_long); /* Transmission watchdog */
+ wavelan_watchdog(u_long); /* transmission watchdog */
/* ------------------- CONFIGURATION CALLBACKS ------------------- */
static int
- wavelan_open(device *), /* Open the device */
- wavelan_close(device *), /* Close the device */
- wavelan_config(device *); /* Configure one device */
+ wavelan_open(device *), /* Open the device. */
+ wavelan_close(device *), /* Close the device. */
+ wavelan_config(device *); /* Configure one device. */
extern int
- wavelan_probe(device *); /* See Space.c */
+ wavelan_probe(device *); /* See Space.c. */

/**************************** VARIABLES ****************************/

/*
- * This is the root of the linked list of wavelan drivers
+ * This is the root of the linked list of WaveLAN drivers
* It is use to verify that we don't reuse the same base address
- * for two differents drivers and to make the cleanup when
- * removing the module.
+ * for two different drivers and to clean up when removing the module.
*/
static net_local * wavelan_list = (net_local *) NULL;

/*
- * This table is used to translate the psa value to irq number
- * and vice versa...
+ * This table is used to translate the PSA value to IRQ number
+ * and vice versa.
*/
static u_char irqvals[] =
{
@@ -603,7 +602,7 @@
};

/*
- * Table of the available i/o address (base address) for wavelan
+ * Table of the available I/O addresses (base addresses) for WaveLAN
*/
static unsigned short iobase[] =
{
@@ -612,7 +611,7 @@
* controllers.
* Leave out the others too -- we will always use 0x390 and leave
* 0x300 for the Ethernet device.
- * Jean II : 0x3E0 is really fine as well...
+ * Jean II: 0x3E0 is fine as well.
*/
0x300, 0x390, 0x3E0, 0x3C0
#endif /* 0 */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu