Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/atwreg.h
RevisionDateAuthorComments
 1.23  06-Feb-2009  dyoung Define some bitfields that come from a reference driver.
 1.22  08-Sep-2008  gmcgarry branches: 1.22.2;
Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.h
preprocessor macros.
 1.21  12-Jun-2008  dyoung branches: 1.21.2;
Elaborate on a comment.
 1.20  04-May-2008  martin branches: 1.20.2; 1.20.4;
Move to standard TNF 2 clause license
 1.19  16-Nov-2007  dyoung branches: 1.19.14; 1.19.16; 1.19.18;
Cosmetic: rename some variables and constants. Move some constants
from atw.c to atwreg.h.
 1.18  16-Nov-2007  dyoung Replace some magic numbers with HFA3861A register names.

Do not alias the Rx descriptor word ar_ctl to ar_rssi with a #define.
Instead, call the member ar_ctlrssi.

Convert the ugly macro ATW_RXDESC_INIT() to an inline subroutine,
atw_rxdesc_init().

Do not load an empty IEEE80211_RADIOTAP_FLAGS field into the Tx
radiotap header.
 1.17  09-Jan-2007  dyoung branches: 1.17.18; 1.17.20; 1.17.24; 1.17.26;
Let the compiler know it should both pack the members of the rx/tx
descriptors without any padding between, and use 4-byte alignment.
 1.16  26-Nov-2006  dyoung Add 'volatile' to rx/tx descriptor fields.
 1.15  31-Aug-2006  dyoung branches: 1.15.2; 1.15.4;
Per discussion on tech-kern and tech-userlevel, move the bit-twiddling
macros, __BIT, __BITS, SHIFTIN, SHIFTOUT, and __arraycount() from
lib/libkern/libkern.h to sys/cdefs.h. Add a __-prefix to SHIFTIN
and SHIFTOUT, and add a manual page for the bit-twiddling macros,
bits(3).

Make the __BIT and __BITS macros "widthless," as best I can, by
changing their type to uintmax_t from uint32_t. XXX The manual
page lags this change by a bit.

Define __PRIxBIT and __PRIxBITS printf(3) format strings.
 1.14  08-Mar-2006  dyoung Change macro names to avoid collisions:

BIT -> __BIT
BITS -> __BITS
 1.13  08-Mar-2006  dyoung Move my bit-twiddling macros to libkern.h from my drivers, where
I had duplicated them. Improve the macros' names. Simplify their
implementation.

A brief description of each macro is below.

BIT(n): Return a bitmask with bit m set, where the least
significant bit is bit 0.

BITS(m, n): Return a bitmask with bits m through n, inclusive,
set. It does not matter whether m>n or m<=n.
The least significant bit is bit 0.

A "bitfield" is a span of consecutive bits defined by a
bitmask, where 1s select the bits in the bitfield. SHIFTIN,
SHIFTOUT, and SHIFTOUT_MASK help read and write bitfields
from device registers.

SHIFTIN(v, mask): Left-shift bits `v' into the bitfield
defined by `mask', and return them. No
side-effects.

SHIFTOUT(v, mask): Extract and return the bitfield selected
by `mask' from `v', right-shifting the
bits so that the rightmost selected bit
is at bit 0. No side-effects.

SHIFTOUT_MASK(mask): Right-shift the bits in `mask' so that
the rightmost non-zero bit is at bit
0. This is useful for finding the
greatest unsigned value that a bitfield
can hold. No side-effects. Note that
SHIFTOUT_MASK(m) = SHIFTOUT(m, m).

Examples:

/*
* Register definitions taken from the RFMD RF3000 manual.
*/
#define RF3000_GAINCTL 0x11 /* TX variable gain control */
#define RF3000_GAINCTL_TXVGC_MASK BITS(7, 2)
#define RF3000_GAINCTL_SCRAMBLER BIT(1)

/*
* Shift the transmit power into the transmit-power field of the
* gain-control register and write it to the baseband processor.
*/
atw_rf3000_write(sc, RF3000_GAINCTL,
SHIFTIN(txpower, RF3000_GAINCTL_TXVGC_MASK));


/*
* Register definitions taken from the ADMtek ADM8211 manual.
*
*/
#define ATW_RXSTAT_OWN BIT(31) /* 1: NIC may fill descriptor */
/* ... */
#define ATW_RXSTAT_DA1 BIT(17) /* DA bit 1, admin'd address */
#define ATW_RXSTAT_DA0 BIT(16) /* DA bit 0, group address */
#define ATW_RXSTAT_RXDR_MASK BITS(15,12) /* RX data rate */
#define ATW_RXSTAT_FL_MASK BITS(11,0) /* RX frame length, last
* descriptor only
*/

/* Extract the frame length from the Rx descriptor's
* status field.
*/
len = SHIFTOUT(rxstat, ATW_RXSTAT_FL_MASK);
 1.12  11-Dec-2005  christos branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10;
merge ktrace-lwp.
 1.11  27-Feb-2005  perry branches: 1.11.4;
nuke trailing whitespace
 1.10  23-Jul-2004  dyoung branches: 1.10.2; 1.10.6; 1.10.8;
Improve register definitions and slightly demystify some magic
numbers.
 1.9  15-Jul-2004  dyoung Refine some register definitions.
 1.8  31-May-2004  dyoung Define several new registers for the ADM8211C/CR parts. Improve
old register descriptions.
 1.7  17-Feb-2004  dyoung Move the RF Microdevices RF3000 & Silicon Laboratories SI4126/SI4136
register sets into their own header files for re-use by future
drivers.
 1.6  29-Jan-2004  dyoung Fix whitespace in Si4126 register definitions.
 1.5  29-Jan-2004  dyoung Wrap the bit-twiddling macros so that they don't get redefined if
more than one header file defines them.
 1.4  10-Jan-2004  dyoung Use new docs provided by RFMD to give some meaning to
previously-undocumented registers and magic numbers on the RF3000
baseband.
 1.3  07-Dec-2003  dyoung Make the MASK_TO_SHIFT expression less "tall." Hopefully helps
work-around the gcc bug reported by Erik Osheim.
 1.2  13-Oct-2003  dyoung Why don't I make up my mind? No need to left-shift the country
codes when I right-shift the country-code register! Fixes a bug
reported by Dan Carosone: regulatory domain "ETSI" registered as
domain "Spain/Other", so he could only tune channels 10 and 11.
 1.1  06-Jul-2003  dyoung Oops. Add the atw(4) sources, too.
 1.10.8.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.6.1  29-Apr-2005  kent sync with -current
 1.10.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.10.2.2  03-Aug-2004  skrll Sync with HEAD
 1.10.2.1  23-Jul-2004  skrll file atwreg.h was added on branch ktrace-lwp on 2004-08-03 10:46:11 +0000
 1.11.4.4  07-Dec-2007  yamt sync with head
 1.11.4.3  26-Feb-2007  yamt sync with head.
 1.11.4.2  30-Dec-2006  yamt sync with head.
 1.11.4.1  21-Jun-2006  yamt sync with head.
 1.12.10.1  19-Apr-2006  elad sync with head.
 1.12.8.2  03-Sep-2006  yamt sync with head.
 1.12.8.1  13-Mar-2006  yamt sync with head.
 1.12.6.1  22-Apr-2006  simonb Sync with head.
 1.12.4.1  09-Sep-2006  rpaulo sync with head
 1.15.4.1  10-Dec-2006  yamt sync with head.
 1.15.2.1  12-Jan-2007  ad Sync with head.
 1.17.26.1  19-Nov-2007  mjf Sync with HEAD.
 1.17.24.1  18-Nov-2007  bouyer Sync with HEAD
 1.17.20.1  09-Jan-2008  matt sync with HEAD
 1.17.18.1  21-Nov-2007  joerg Sync with HEAD.
 1.19.18.2  04-May-2009  yamt sync with head.
 1.19.18.1  16-May-2008  yamt sync with head.
 1.19.16.2  17-Jun-2008  yamt sync with head.
 1.19.16.1  18-May-2008  yamt sync with head.
 1.19.14.3  28-Sep-2008  mjf Sync with HEAD.
 1.19.14.2  29-Jun-2008  mjf Sync with HEAD.
 1.19.14.1  02-Jun-2008  mjf Sync with HEAD.
 1.20.4.1  18-Jun-2008  simonb Sync with head.
 1.20.2.2  24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.20.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.21.2.1  19-Oct-2008  haad Sync with HEAD.
 1.22.2.1  03-Mar-2009  skrll Sync with HEAD.

RSS XML Feed