Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/rtwvar.h
RevisionDateAuthorComments
 1.48  05-Oct-2019  mrg remove __packed attribute from struct ieee80211_radiotap_header
and all the structures that include it.

this should not change anything while avoiding packed vs alignment
warnings from GCC 8, and potentially pessimised code generation
due to the packed marker (there are no misaligned members, just
that the per-device parts may end unaligned.)

all consumers of these members are done from the properly aligned
packet members directly, or, as a union with a 64 byte member,
also properly aligned. codegen didn't appear to change, except
for the definition of sizeof(struct driver_[rt]x_radiotap_header)
in debug info, which is not directly used anywhere.
 1.47  19-Apr-2018  christos branches: 1.47.2;
s/static inline/static __inline/g for consistency.
 1.46  23-Oct-2017  msaitoh branches: 1.46.2;
If if_initialize() failed in the attach function, free resources and return.
 1.45  02-Feb-2017  nonaka branches: 1.45.6;
wlan interfaces make interrupt routine running on softint context.

see http://mail-index.netbsd.org/tech-kern/2016/12/06/msg021281.html

tested device:
* ath at pci: AR5212, AR5424
* athn at pci: AR9287
* ipw at pci: 2100BG
* iwi at pci: 2915ABG
* iwm at pci: 3165, 7260, 8260
* iwn at pci: 4945, 6235
* ral at pci: RT2560
* rtwn at pci: RTL8192CE
 1.44  15-Sep-2016  jdolecek branches: 1.44.2;
remove last isolated islands using BUS_SPACE_BARRIER_SYNC and
BUS_SPACE_BARRIER_X_BEFORE_X - these were only ever defined for mips and ia64,
and never actually implemented even there
 1.43  15-Mar-2010  dyoung branches: 1.43.18; 1.43.36; 1.43.40;
Make this compile on sparc64:

1 s/next_tick/next_tint/ because next_tick shadows a global on sparc64.

2 Fix the bus-barrier helper routines, which had the tag & handle
swapped (!!). Move the helpers from rtwreg.h to rtwvar.h, and
change RTW_BARRIER() into an inline subroutine called rtw_barrier().
 1.42  24-Feb-2010  dyoung branches: 1.42.2;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.41  17-Jan-2010  pooka branches: 1.41.2;
Forward declare struct bpf_if and use that as the type for bpf_if
instead of "void *". Buys us oo times the type-safety for 0 times
the price.
(no functional change)
 1.40  08-Jan-2010  dyoung Expand PMF_FN_* macros.
 1.39  19-Oct-2009  rmind Drop 3rd and 4th clauses from David Young's license.
Reviewed and approved by dyoung@ (copyright holder).
 1.38  16-Sep-2009  dyoung In pmf(9), improve the implementation of device self-suspension
and make suspension by self, by drvctl(8), and by ACPI system sleep
play nice together. Start solidifying some temporary API changes.

1. Extract a new header file, <sys/device_if.h>, from <sys/device.h> and
#include it from <sys/pmf.h> instead of <sys/device.h> to break the
circular dependency between <sys/device.h> and <sys/pmf.h>.

2. Introduce pmf_qual_t, an aggregate of qualifications on a PMF
suspend/resume call. Start to replace instances of PMF_FN_PROTO,
PMF_FN_ARGS, et cetera, with a pmf_qual_t.

3. Introduce the notion of a "suspensor," an entity that holds a
device in suspension. More than one suspensor may hold a device
at once. A device stays suspended as long as at least one
suspensor holds it. A device resumes when the last suspensor
releases it.

Currently, the kernel defines three suspensors,

3a the system-suspensor: for system suspension, initiated
by 'sysctl -w machdep.sleep_state=3', by lid closure, by
power-button press, et cetera,

3b the drvctl-suspensor: for device suspension by /dev/drvctl
ioctl, e.g., drvctl -S sip0.

3c the system self-suspensor: for device drivers that suspend
themselves and their children. Several drivers for network
interfaces put the network device to sleep while it is not
administratively up, that is, after the kernel calls if_stop(,
1). The self-suspensor should not be used directly. See
the description of suspensor delegates, below.

A suspensor can have one or more "delegates". A suspensor can
release devices that its delegates hold suspended. Right now,
only the system self-suspensor has delegates. For each device
that a self-suspending driver attaches, it creates the device's
self-suspensor, a delegate of the system self-suspensor.

Suspensors stop a system-wide suspend/resume cycle from waking
devices that the operator put to sleep with drvctl before the cycle.
They also help self-suspension to work more simply, safely, and in
accord with expectations.

4. Add the notion of device activation level, devact_level_t,
and a routine for checking the current activation level,
device_activation(). Current activation levels are DEVACT_LEVEL_BUS,
DEVACT_LEVEL_DRIVER, and DEVACT_LEVEL_CLASS, which respectively
indicate that the device's bus is active, that the bus and device are
active, and that the bus, device, and the functions of the device's
class (network, audio) are active.

Suspend/resume calls can be qualified with a devact_level_t.
The power-management framework treats a devact_level_t that
qualifies a device suspension as the device's current activation
level; it only runs hooks to reduce the activation level from
the presumed current level to the fully suspended state. The
framework treats a devact_level_t qualifying device resumption
as the target activation level; it only runs hooks to raise the
activation level to the target.

5. Use pmf_qual_t, devact_level_t, and self-suspensors in several
drivers.

6. Temporarily add an unused power-management workqueue that I will
remove or replace, soon.
 1.37  12-Mar-2008  dyoung branches: 1.37.4;
Use device_t and its accessors throughout. Use aprint_*_dev().

Improve PMF-ability.

Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().

Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).

In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.

In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.

In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).

rtw(4) improvements:

Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.

Remove activate() methods:

Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.

Make ath at cardbus resume with crypto functions intact:

Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.

Honor this property in cardbus_child_suspend().

Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?

Miscellaneous ath(4) changes:

Warn if ath(4) tries to write crypto keys to suspended
hardware.

Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.

Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.

Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
 1.36  25-Dec-2007  perry branches: 1.36.2; 1.36.6;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.35  21-Dec-2007  dyoung Do not embed a struct device in rtw_softc any longer. Register
both pci and cardbus attachments with CFATTACH_DECL_NEW(). Access
the softc through the device_t using device_private().

While I'm here, change a couple of KASSERT()s about the Rx buffer
length to a warning.
 1.34  20-Dec-2007  dyoung Remove shutdown hooks. Use KASSERT().
 1.33  16-Dec-2007  dyoung Synchronize device detachment with network interrupts. Use the
pmf network class instead of powerhooks.
 1.32  16-Nov-2007  dyoung branches: 1.32.2; 1.32.6;
Accommodate the variety of RF front-ends when radiotapping frames:
tap only RSSI when there is a Philips RF front-end. Tap both Barker
lock quality and RSSI when there is any other RF front-end.

Provide radiotap listeners a more complete picture of channel
activity:

in promiscuous mode, tap frames who do not pass the CRC32 check.
Flag packets that were received with a short preamble. Ask
the NIC to pass us 802.11 Control frames. Pass frames to
radiotap listeners before stripping the FCS. Re-order operations
in rtw_intr_rx() in order to accomplish all of this, taking
care not to pass a broken packet to net80211!

Do not provide a flags field when tapping xmitted frames.

Assert sane Rx packet lengths. Really should check and drop instead
of KASSERTing. I will revisit this, soon.

Update copyright.
 1.31  04-Mar-2007  christos branches: 1.31.14; 1.31.16; 1.31.20; 1.31.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30  06-Jan-2007  dyoung branches: 1.30.2;
I have made a small change that suppresses "recovery" from (spurious?)
tx timeouts on the beacon queue. The driver's recovery process
badly disrupts the MAC's receiver. This needs a closer look, later.

Every other fix is by Charles M. Hannum. Charles writes:

"With these, the device is quite stable under load, does not experience
xmit timeouts, no longer mysteriously freezes, and does not spew
a lot of garbage. It does, however, continue to get some "tx fifo
underflow"s.

global, SYSCTL_SETUP():
a) Removed unused sysctl variables.

rtw_io_enable():
b) Change rtw_io_enable to take a softc, and make it call
rtw_txring_fixup().
c) Enable the PCI multiple read/write bit.
d) Always reset rdb_next to 0 when starting the receive engine.

rtw_intr_rx():
e) When processing receive packets, store the next pointer in rdb_next
and read it back on the next round, to fix a race condition vs.
rtw_tune() during AP discovery and association.
f) Remove the special "skip to 0th descriptor" code, because it is no
longer needed.

rtw_collect_txring():
g) In the "force" case, stop when we catch up to the hardware xmit
pointer.

rtw_intr_beacon():
h) Resetting tdb_next here looked fishy to me, in light of changes in
rtw_collect_txring(). XXX However, this is the one part I haven't
tested.

rtw_txring_fixup():
i) Add function and line arguments, so we can print out information
about the caller.
j) In addition to reading the hardware pointer, skip over any
additional packets with OWN set -- we may have queued more.

rtw_rxring_fixup():
k) Remove this, because it's completely wrong.

rtw_intr_ioerror():
l) Don't handle receive overruns here; handle them in the normal receive
path. Also changed RTW_INTR_RX and RTW_INTR_IOERROR accordingly.
m) Do not fiddle with CR; the transmit engine is still running just
fine.
n) Do not fiddle with IMR; it was unnecessary.
o) Don't touch the receive engine at all; not necessary now that we're
leaving CR alone.
p) Remove the rtw_do_chip_reset case; it was dangerous and not actually
used.

rtw_intr():
q) Don't mask off ISR bits when we pass down the ISR value; it's not
necessary, and sometimes the other bits useful in debugging output.

rtw_seg_too_short():
r) Don't spew here; the caller will do it if necessary. (Stops spewage
in an expected case.)

rtw_rxdesc_blk:
s) Minor change to make the elements have the same order as txdesc_blk.

general:
t) Added a bunch of debugging output, #ifdef RTW_DIAG, that was useful
while investigating the ring management problems. Also moved
rtw_txring_fixup() into RTW_DIAG, as I believe the transmit pointer
is always kept in sync now, and the function has potential race
conditions.
 1.29  14-May-2006  dyoung branches: 1.29.8;
Make rtwvar.h, rtw.c agree whether rtw_host_rfio and rtw_debug are
static or extern. Problem noted by Tom Spindler.
 1.28  16-Feb-2006  perry branches: 1.28.2; 1.28.6;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.27  29-Dec-2005  dyoung branches: 1.27.2; 1.27.4; 1.27.6;
Add support for the GCT Semiconductor GRF5101 transceiver/synthesizer.
From OpenBSD.

GCT will not provide any documentation, so there are many magic
numbers in this code.
 1.26  24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.25  23-Nov-2005  dyoung Miscellaneous Realtek RTL8180L driver improvements:

1 Added new sysctl controls for debugging.

2 Improve detection & support for hardware WEP.

3 Revamp handling of transmit descriptor rings.

4 Reliably IFF_OACTIVE when transmit descriptors are available, to
stop the transmit section of the driver from freezing up.

5 Fix beacon transmission in adhoc and hostap modes. XXX There is
a wart in hostap mode, where beacons are transmitted at 1/2 the
correct rate. Load beacon descriptors when the RTW_INTR_BINT
interrupt arrives; schedule RTW_INTR_BINT 1ms ahead of the target
beacon time.

6 Recover more gracefully from tx/rx errors: avoid
transmitter/receiver/chip resets. Try to re-synchronize software
state with hardware state---e.g., load next descriptor pointer
from hardware.

7 Activate the transmit watchdog timer for beacons as well as other
packets.

8 Introduce rtw_idle() that waits for transmit DMA to finish; call
it before resetting the transmitter.
 1.24  27-Jun-2005  dyoung branches: 1.24.2; 1.24.8;
rtw: Try to get hardware WEP to work. It seems to work in
the RX direction, but not in the TX direction. The
net80211 crypto framework doesn't seem to cope very well
with the assymetry (I'm probably missing something), so
I will use software WEP for now.

net80211: In ieee80211_compute_duration, figure out whether to add
the WEP header to the packet overhead by checking the
WEP bit in the Frame Control field of the 802.11 header,
instead of checking the IEEE80211_F_PRIVACY flag.

Also, if the WEP bit is present, assume that the frame
described by (wh, len) has already already been WEP
encapsulated, and adjust the payload length accordingly.
XXX that's a grotty hack that I will have to revisit,
later.
 1.23  22-Jun-2005  dyoung Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD. Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]). Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
 1.22  02-Mar-2005  dyoung Misc. changes to improve ad hoc mode and to enable hostap mode:

Fix the work-around for the NIC bug where it skips to rx
descriptor 0. The driver used to skip to rx descriptor 1.
Hopefully this stops the out-of-order packet reception that
Charles Hannum saw.
When debugging is enabled, print rx-descriptor status flags
before printing the rx bit rate.

Add a debug message for when a beacon tx buffer reclamation.

Reset IFF_OACTIVE when we reset the transmitter.

Pass the consolidated LED state, a struct rtw_led_state,
to rtw_led_attach.

Choose the bit-rate for management frames (1Mb/s) at the
same place we choose for all other frames.

Do not use the NIC's short preamble or RTS options for
management frames. Label beacons for the NIC.

Following a Linux driver, take care not to zero arbitrary
bits in the TPPOLL register.

Use the new idiom for IBSS merges: disable transmitter,
kick the state machine.
Add a second descriptor to the beacon ring. The NIC seems
to like this much better.
 1.21  27-Feb-2005  perry nuke trailing whitespace
 1.20  04-Feb-2005  perry de-__P
 1.19  16-Jan-2005  dyoung branches: 1.19.2; 1.19.4;
Move the register access mode into struct rtw_regs. Change
rtw_set_access, rtw_set_access1 to match.

Add a subroutine for setting WEP keys. WEP isn't quite finished,
because I have to add the WEP header to Tx packets. Implement the
SIOCS80211NWKEY ioctl for setting WEP keys.

Program the LEDs based on operating state and packet activity.

* On a Revision F RTL8180, blink LED1 at 1Hz to indicate
scan/authenticate/associate states. In the run state, turn LED1
on. In every state, blink LED1 at 5Hz to indicate non-beacon
tx/rx activity. I would like to use two LEDs, but in all my
Rev. F instances, LED0 is not wired to an LED; instead, the
first LED is wired to indicate that the card's power is on.

* On a Revision D RTL8180, program the LEDs so that LED0 indicates
Tx, and LED1 indicates Rx. The Rx LED will blink annoyingly if
there are beacons in the air, but at least the Tx LED is useful.

* Store the hardware revision in the softc to support my futile
attempt at programming LEDs for both Rev. D and Rev. F parts;
I never did get Rev. D LEDs to work right.

* Add a debug flag RTW_DEBUG_LED for the LED transitions.

Add RTW_TPPOLL_ALL, RTW_TPPOLL_SALL to start and stop, respectively,
all of the transmit rings.

In ad hoc mode, allocate a beacon and load it into the beacon ring.
Start the ring. In one trial, the card re-transmitted the beacon
ring's contents several times before stopping. More programming
and testing for ad hoc mode is necessary. I'm not setting the
beacon flag in the transmit descriptor.

Revamp the transmit section to make better use of all the transmit
rings: beacon queue, high-, low-, and medium-priority rings. Put
beacon frames on the beacon ring. All other management frames,
and data frames, go on the medium-priority ring. Power-save data
frames go on the high-priority ring. (Note that powersaving is
not implemented!) This is a work in progress.

Send all 802.11 Management frames at 1Mbps.

After we put a packet on a transmit ring, tickle the right bit in
the TPPOLL to tell RTL8180. Stop all rings on error and in rtw_stop.

Use the RF chip type, not the RTL8180 revision, to choose between
host- and MAC-controlled RF serial I/O. Now the Netgear MA521
works.

Remove bogus definition of bit RTW_TPPOLL_FSWINT.
 1.18  03-Jan-2005  dyoung sys/dev/ic/rtw.c:

Cosmetic: remove two short ladders from rtw_init. Fit the
NIC registers print-out onto one line using the RTW_PRINT_REGS
macro.

sys/dev/ic/rtwvar.h:

Add RTW_PRINT_REGS wrapper macro for rtw_print_regs. It
is a null op unless defined(RTW_DEBUG).
 1.17  02-Jan-2005  dyoung Cosmetic: change u_int{8,16,32,64}_t to C99-style uint{8,16,32,64}_t,
which is preferred.
 1.16  29-Dec-2004  dyoung Remove unused rtw_softc variables and some other dead code.
 1.15  29-Dec-2004  dyoung I like the tlp/atw-style names for software descriptors, txsoft,
better than txctl. Change from rtw_txctl/rtw_rxctl to
rtw_txsoft/rtw_rxsoft. Change the descriptor blocks' names to
match: rtw_txctl_blk becomes rtw_txsoft_blk. Change the member-name
prefixes for both software and hardware descriptors.
 1.14  29-Dec-2004  dyoung Consolidate variables related to the rx ring in sc_rxdesc_blk,
which is a struct rtw_rxdesc_blk.

Put a copy of the DMA tag and the DMA map into the rx- and tx-ring
blocks so that I don't have to pass them to subroutines all of the
time.
 1.13  28-Dec-2004  dyoung Add bpf(4) packet taps to rtw(4). Now you can tap DLT_EN10MB
(Ethernet II), DLT_IEEE802_11 (802.11), and DLT_IEEE802_11_RADIO
(radiotap + 802.11).
 1.12  28-Dec-2004  dyoung Group receiver-related variables together: move sc_rxctl nearer to
sc_rxnext.

Add sc_nrxdesc, the number of receive descriptors that we are
actually able to use. sc_nrxdesc will ordinarily equal RTW_RXQLEN.
If buffers are exhausted, sc_nrxdesc < RTW_RXQLEN. My next commit
will change dev/ic/rtw.c to deal with buffer exhaustion.
 1.11  27-Dec-2004  dyoung Remove useless debug sysctls.

For AP scanning, change the channel dwell time from 1 second to
1/5 second.
 1.10  26-Dec-2004  mycroft Fix a compile error if no RTW_DEBUG.
 1.9  25-Dec-2004  dyoung The rx descriptor ring bug happens quite often, so printf'ing
occurrences is annoying. Only printf about it when rtw_debug
contains RTW_DEBUG_BUG.
 1.8  25-Dec-2004  dyoung Change rtw_debug from a debug level to a debug mask. Add a lot of
debug flags.

From Linux: handle an RTL8180 bug. Sometimes the NIC skips from
the middle of the ring to the 0th rx descriptor. Now the driver
resynchronizes.

Handle a receive descriptor underrun or Rx FIFO overflow condition
in the way that the Linux driver does. This kind of seems like
overkill, but whatever.

Protect rtw_ioctl with splnet().

Do not load a tx descriptor with a buffer shorter than 4 bytes.

Handle a transmit timeout less disruptively.
 1.7  23-Dec-2004  dyoung Round up the number of h/w Rx descriptors to the number of h/w,
not s/w, descriptors in 256 bytes (the descriptor ring alignment).
 1.6  20-Dec-2004  dyoung Realtek sample sources are not consistent about the "Digital PHY"
bit in the SROM. It seems as if it is set to 1 when the PHY is
*analog*, not *digital*. Fix my sources.

In rtw_intr_rx, use units of 500kb/s instead of 100kb/s for rate,
to be consistent with net80211's expectations. Polish up some
debugging ugly messages. Dump raw 802.11 packets if IFF_DEBUG|IFF_LINK2
and RTW_DEBUG is defined.

Polish power-state (on/sleep/off) handling. Especially improve
support for RFMD (totally untested) and Maxim. For Philips, take
the Digital PHY property into account.

Call the net80211 watchdog function from rtw_watchdog, so that we
scan again if auth/assoc fails.

Be a little more cautious about writing register[RTW_TPPOLL], since
other drivers are.... Don't frob the high/low-priority queues
right now, since I don't use them.

Add rtw_join_bss which programs the card with the BSSID and other
properties of a BSS. Use it on state transitions. Factor out
rtw_set_nettype.

Make rtw_recv_beacon call ieee80211_recv_mgmt instead of dropping
beacons on the floor! TBD IBSS merges.

Change some rtw_debug=2 printfs to rtw_debug=3 (RTW_DPRINTF3)
printfs so the console doesn't get spammed so badly at rtw_debug=2.
Change some debugging printfs to RTW_DPRINTFs. E.g., print the
"RF programming method" only if debugging is enabled.
 1.5  19-Dec-2004  dyoung Add the transmit section of rtw(4): build up and tear down transmit
descriptor rings, move packets from the transmit queues to the
transmit rings, handle transmission-completed interrupts. My
Linksys WPC11 ver. 4 with Maxim RF, generates interrupts like it
is successfully transmitting packets. Clearly there are bugs: my
G4 Powerbook locks up hard. I will debug tomorrow.
 1.4  13-Dec-2004  dyoung Fix a typo, s/high/low/.
 1.3  13-Dec-2004  dyoung At last, I have rtw w/ Philips RF receiving packets.

I added some sysctls to aid debugging:

* hw.rtw.debug -- enable debugging

* hw.rtw.flush_rfio -- Linux voodoo: possibly makes the MAC
"flush" bits down the serial bus to the RF

* hw.rtw.host_rfio: force the host to bang bits to the RF, instead
of the MAC banging bits

* hw.rtw.rfio_delay: after telling the MAC to bang bits to the
RF front-end, delay rfio_delay microseconds.

* hw.rtw.rfprog_fallback: there is this notion of the "RF
programming method." I believe the choice influences the
polarity/timing of the serial bus used to program the RF
front-end. I know the correct choice for Intersil/RFMD/Philips
front-ends, only. For all other front-ends, I "fallback" to
rfprog_fallback.

Make rtw_txdac_enable take an rtw_softc argument. I will probably
revert this change.

Add some Linux voodoo to rtw_continuous_tx_enable. I will probably
revert this change.

Important: add rtw_set_rfprog, which sets the correct RF programming
method. This change and the following change are probably responsible
for making the Philips RF work.

Important: RTW_CONFIG1 is an 8-bit register, treat it that way!

Important: RTW_BRSR is 16-bit, RTW_CRCOUNT, RTW_PHYDELAY, and
RTW_MSR are 8-bit: treat them that way!

Vastly simplify rtw_resume_ticks.

Note to self: set the LED state to match the power state.

Hedge against the possibility that RTW_MSR is protected as
RTW_CONFIG[0123] are, meanwhile reworking that section of rtw_init
a little.

Add sc_anaparm, which isn't used, yet....
 1.2  12-Dec-2004  dyoung Miscellaneous changes. Details below. Important changes flagged
with []. Using the driver with my Linksys WPC11 ver. 4, it seems
to be receiving packets for a change. The WPC11 ver. 4 has a Maxim
RF section. My no-name rtw with Philips RF section still does not
receive any packets.

Keep access-level (analog params > config[0123] registers > none)
in sc_access. Add rtw_set_access for changing the access level.

Make rtw_continuous_tx_enable and other subroutines use rtw_set_access
instead of rtw_config0123_enable and rtw_anaparm_enable.

Factor part of the chip-reset code into rtw_chip_reset1.

Change the 'struct foo (*bar)[N]'-style arguments to
'struct foo *bar'-style arguments.

Consolidate software/hardware Tx/Rx ring setup in rtw_hwring_setup,
rtw_swring_setup.

Add a new constant, SA2400_OPMODE_DEFAULTS, for the bits that we
*always* set in the SA2400 OPMODE register.

Factor some code out into rtw_sa2400_calibrate. (Inspired by the
Linux driver.)

[] When the receiver goes into underrun/overflow state, call a new
subroutine, rtw_kick() that stops the Rx/Tx processes, resets
the chip, reinitializes the Tx/Rx rings, and restarts Rx/Tx
processes. (Inspired by the Linux driver.)

[] In rtw_intr_rx, check for too-short packets before calling
ieee80211_find_rxnode. I believe this will prevent a repeat of
the MCHK exception I saw once on macppc.

[] Use seconds-elapased as well as microseconds-elapsed to set the
next "due date" for the timeout interrupt. This keeps the driver
from programming the timeout to expire too early.

[] In rtw_intr, read RTW_ISR at most 10 times, then get out. If
the interface is not enabled (RTW_F_ENABLED), then get out.

[] In rtw_stop, get out if the interface is not enabled (RTW_F_ENABLED).
Block IPL_NET interrupts. Don't read/write any registers if
the interface is invalid (RTW_F_INVALID).

[] Call rtw_stop in rtw_detach.
 1.1  26-Sep-2004  dyoung branches: 1.1.2;
Add work-in-progress driver rtw(4) for Realtek RTL8180 MAC/baseband.

Add register definitions for Maxim MAX2820 and Philips SA2400 radio
front-ends.
 1.1.2.8  11-Dec-2005  christos Sync with head.
 1.1.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.1.2.4  17-Jan-2005  skrll Sync with HEAD.
 1.1.2.3  18-Dec-2004  skrll Sync with HEAD.
 1.1.2.2  19-Oct-2004  skrll Sync with HEAD
 1.1.2.1  26-Sep-2004  skrll file rtwvar.h was added on branch ktrace-lwp on 2004-10-19 15:56:56 +0000
 1.19.4.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1  12-Feb-2005  yamt sync with head.
 1.19.2.2  29-Apr-2005  kent sync with -current
 1.19.2.1  16-Jan-2005  kent file rtwvar.h was added on branch kent-audio2 on 2005-04-29 11:28:52 +0000
 1.24.8.1  29-Nov-2005  yamt sync with head.
 1.24.2.6  17-Mar-2008  yamt sync with head.
 1.24.2.5  21-Jan-2008  yamt sync with head
 1.24.2.4  07-Dec-2007  yamt sync with head
 1.24.2.3  03-Sep-2007  yamt sync with head.
 1.24.2.2  26-Feb-2007  yamt sync with head.
 1.24.2.1  21-Jun-2006  yamt sync with head.
 1.27.6.2  01-Jun-2006  kardel Sync with head.
 1.27.6.1  22-Apr-2006  simonb Sync with head.
 1.27.4.1  09-Sep-2006  rpaulo sync with head
 1.27.2.1  18-Feb-2006  yamt sync with head.
 1.28.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.28.2.1  24-May-2006  yamt sync with head.
 1.29.8.1  12-Jan-2007  ad Sync with head.
 1.30.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.31.22.3  18-Feb-2008  mjf Sync with HEAD.
 1.31.22.2  27-Dec-2007  mjf Sync with HEAD.
 1.31.22.1  19-Nov-2007  mjf Sync with HEAD.
 1.31.20.1  18-Nov-2007  bouyer Sync with HEAD
 1.31.16.2  23-Mar-2008  matt sync with HEAD
 1.31.16.1  09-Jan-2008  matt sync with HEAD
 1.31.14.1  21-Nov-2007  joerg Sync with HEAD.
 1.32.6.1  02-Jan-2008  bouyer Sync with HEAD
 1.32.2.1  26-Dec-2007  ad Sync with head.
 1.36.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.36.2.1  24-Mar-2008  keiichi sync with head.
 1.37.4.2  11-Aug-2010  yamt sync with head.
 1.37.4.1  11-Mar-2010  yamt sync with head
 1.41.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.42.2.1  30-May-2010  rmind sync with head
 1.43.40.2  20-Mar-2017  pgoyette Sync with HEAD
 1.43.40.1  04-Nov-2016  pgoyette Sync with HEAD
 1.43.36.2  05-Feb-2017  skrll Sync with HEAD
 1.43.36.1  05-Oct-2016  skrll Sync with HEAD
 1.43.18.1  03-Dec-2017  jdolecek update from HEAD
 1.44.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.45.6.1  10-Dec-2017  snj Pull up following revision(s) (requested by msaitoh in ticket #427):
sys/arch/amiga/dev/if_bah_zbus.c: 1.17
sys/arch/arm/broadcom/bcm53xx_eth.c: 1.30
sys/arch/powerpc/booke/dev/pq3etsec.c: 1.32
sys/arch/usermode/dev/if_veth.c: 1.9
sys/dev/ic/an.c: 1.66
sys/dev/ic/athn.c: 1.17
sys/dev/ic/atw.c: 1.162
sys/dev/ic/bwi.c: 1.33
sys/dev/ic/dwc_gmac.c: 1.41-1.42
sys/dev/ic/malo.c: 1.10
sys/dev/ic/rt2560.c: 1.31
sys/dev/ic/rt2661.c: 1.36
sys/dev/ic/rt2860.c: 1.29
sys/dev/ic/rtw.c: 1.127
sys/dev/ic/rtwvar.h: 1.46
sys/dev/ic/smc90cx6.c: 1.71
sys/dev/ic/smc90cx6var.h: 1.12
sys/dev/ic/wi.c: 1.244
sys/dev/pci/if_ipw.c: 1.66
sys/dev/pci/if_iwi.c: 1.104
sys/dev/pci/if_iwm.c: 1.76
sys/dev/pci/if_iwn.c: 1.86
sys/dev/pci/if_rtwn.c: 1.13
sys/dev/pci/if_wm.c: 1.541
sys/dev/pci/if_wpi.c: 1.79
sys/dev/pci/ixgbe/ixgbe.c: 1.106
sys/dev/pci/ixgbe/ixv.c: 1.73 via patch
sys/dev/pcmcia/if_malo_pcmcia.c: 1.15
sys/dev/scsipi/if_se.c: 1.95
sys/dev/usb/if_upl.c: 1.60
sys/net/if.c: 1.396
sys/net/if.h: 1.241
sys/net/if_arc.h: 1.23
sys/net/if_arcsubr.c: 1.78
sys/net/if_bridge.c: 1.136-1.137
sys/net/if_etherip.c: 1.39
sys/net/if_faith.c: 1.56
sys/net/if_gif.c: 1.131
sys/net/if_loop.c: 1.96
sys/net/if_mpls.c: 1.30
sys/net/if_pppoe.c: 1.129
sys/net/if_srt.c: 1.27
sys/net/if_stf.c: 1.102
sys/net/if_tap.c: 1.100
sys/net/if_vlan.c: 1.105
sys/netinet/ip_carp.c: 1.91
sys/rump/net/lib/libshmif/if_shmem.c: 1.73-1.74
sys/rump/net/lib/libvirtif/if_virt.c: 1.55-1.56
if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.
Return if bah_attach_subr() failed.
If if_attach() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add some missing frees in bridge_clone_destroy().
- KNF
If error occured in bcmeth_ccb_attach(), free resources and return.
If error occured in pq3etsec_attach(), free resources and return.
If error occured in the attach function, free resources and return.
- If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
If if_initialize() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
failed.
- If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
- If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
If if_initialize() failed in the attach function, free resources and return.
If if_attach() failed in the attach function, free resources and return.
- If if_initialize() failed in the attach function, free resources and return.
- KNF
- If if_attach() failed in the attach function, free resources and return.
- KNF
Fix compile error.
Fix compile error.
We don't need '&mii', but just 'mii' for mii_detach().
Don't free sc_rthash twice
 1.46.2.1  22-Apr-2018  pgoyette Sync with HEAD
 1.47.2.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411

RSS XML Feed