does different things depending what's in %ebx.
We weren't setting %ebx here *at all*; so we did not get SCHEDOP_yield,
which was what was wanted; so unpredictable things happened, notably
immediate return to the NetBSD idle loop, in other words spinning on CPU.
Definitely not cool!
Michael Kukat caught this one and suggested this fix on port-xen.
Following Charles Hannum's wi(4) optimizations, there could be a
Transmit command outstanding after wi_tx_intr or wi_start returns.
The driver would blithely issue a second command [*] before the
first command was finished, taking the first command's WI_EV_CMD
indication to mean the second command had finished. The driver
would be dreadfully confused when the second command's results did
not meet its expectations (e.g., a RID mismatch error would occur).
The packet transmit section of the code would never read the
WI_EV_CMD it expected, so transmissions would cease.
This patch counts the outstanding transmit commands (there can be
only one) and, if a transmit command is outstanding at the top of
wi_cmd(), wi_cmd waits for the command to complete. If there was
a transmit command outstanding when wi_cmd begins, it calls
wi_cmd_intr() on its way out.
I have tested this on an Orinoco card. Previously, the card would
stop transmitting or the kernel would panic as desynchronization
occurred. Now it works beautifully.
[*] A second command could be issued by wi_ioctl or else by
wi_intr->wi_info_intr->wi_newstate->wi_read_xrid->wi_read_rid.
wi_read_rid(sc, rid, &val, &buflen) == 0 && buflen == sizeof(val),
become wi_read_xrid calls
wi_read_xrid(sc, rid, &val, sizeof(val)) == 0.
If the actual RID length is different from the expected RID length,
wi_read_rid prints to the log.
Originally written by rafal@ back in April 2003. Field-tested by many
people since.
(I am not committing the pmap hack at this time; although pmap changes are
necessary to fully address the r5k panic/coma problems, the implementation
needs further thought)
pthread_cond_timedwait().
XXX as noted in the comments, in the situations where these are
useful, they should never be called in a single-threaded
process. Perhaps they should die rather than return 0.
Addresses xsrc/28630.
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....
bpf(4)).
While doing that, still keep around the full cdevsw interface, so that the
ethfoo interfaces can be accessed either through /dev/ethfooN or through
the cloning device /dev/ethfoo (whose minor number is 0xfffff). Interfaces
created through the cloning device are destroyed at close() time.
Also add an ioctl() to be used by the cloning interface user to know the
minor number of the created interface, so it can be manipulated later to
get an address set and turned up (otherwise EHOSTDOWN is returned on read
and write).
Document some of the new functions, but read, write, ioctl and kqfilter
still has to be commented.
used in non-simulation code, and thus is just wasting space (and
making the code more confusing to read!). Turf the switch, left-shift
the indentation of code, and nuke 'state' field of struct RF_RaidReconDesc_s.
No real functional changes.