Commit Graph

3569 Commits

Author SHA1 Message Date
toshii
02598e7452 A couple of changes for adding re(4) (Realtek gigabit ethernet):
- add necessary members in rtk_softc
  - make functions used by re(4) non-static
2004-05-28 15:21:32 +00:00
mycroft
0a5a28eeae Write the registers in the proscribed order -- sector,cyllo,cylhi (LSB first
for LBA).  This make no difference with real devices, but the funky IDE
analyzer can't search properly if the order is wrong.
2004-05-27 16:47:35 +00:00
thorpej
aeb454bce4 Clean-up of use of "precomp". It is used as "features" everywhere, so
rename the fields in wdc_command as appropriate.
2004-05-27 02:23:12 +00:00
thorpej
46986953d0 In wdcccommand(), load wd_features, not wd_precomp, with the features
provided by callers.

From Jordan Rhody @ Wasabi.
2004-05-27 02:09:26 +00:00
thorpej
2ecdd552dc Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers.  Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.
2004-05-25 20:42:40 +00:00
atatat
16122fe06c Remaining sysctl descriptions under hw subtree (ath and bge) 2004-05-25 04:38:36 +00:00
bouyer
5c594e4cc4 Add a delay(5000) between the ATAPI_SOFT_RESET and the channel reset.
Some ATAPI device never get out of busy if touched too fast after a reset.
Delay value from atapi_wdc.c; fix problem reported by Nicolas Joly on
current-users.
2004-05-24 20:45:30 +00:00
bouyer
eea7ca5986 Rmove a redundant BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE, and fix
another one (POST -> PRE)
2004-05-20 20:57:50 +00:00
bouyer
516871a573 Add support for the Ignore Wide Residue SCSI message. 2004-05-17 20:12:34 +00:00
bouyer
83478e12f3 when an unexpected disconnect occurs only compute the resid; do the
real save data pointers when we get the message (or rather, at disconnect
time following the message).
Factor out code to do this, and to deal with xs->resid, in siop_common.c.
2004-05-17 18:37:02 +00:00
bouyer
76fa396c1d Properly compute xs->resid, instead of assuming it'll always be 0 when
a command is done.
2004-05-17 11:10:24 +00:00
thorpej
56906b900a Patch from HITOSHI Osada:
* Add PAUSE-related event counters.
* Return flow control bits in fxp_mii_mediastatus().
2004-05-16 02:59:04 +00:00
thorpej
7e156484d4 Patch from HITOSHI Osada:
* Newer chips do not need the receiver lock-up workaround; detect when it
  is required.
2004-05-16 02:41:46 +00:00
bouyer
bf4920bc20 In wdcprobe1(), protect the register writability test with splbio().
What we do here seems to trigger interrupts on some pcmcia adapters, which
cause the kernel to hang.
Add some WDCDEBUG_PRINT((), DEBUG_PROBE).
Avoid touching registers of nonexistent drives, once we know which drive is
or is not here.

This makes the "IBM PCMCIA Portable CD-ROM Drive" (external CD drive with
PCMCIA adapter) work.
2004-05-15 17:15:09 +00:00
bouyer
879d21cebe Add a delay(10) after re-enabling interrupts in the control register.
Some controllers/drives (e.g. SataLink 3114 with WD Raptor) require
it. Should fix kern/23808 by Chris Gilbert, patch suplied by Chris Gilbert
on tech-kern, extended to all places enabling interrupts by me.
2004-05-08 15:03:32 +00:00
pk
4b19351352 On reset, clear state flags and the msgout queue and notify the upper layer. 2004-05-03 12:25:34 +00:00
thorpej
cdac01064e Rename the COM16650 option to COM_16650, for consistency with other
com variant options.
2004-05-01 19:03:59 +00:00
thorpej
dfc7fe9bbe Wait just a little longer for console output to finish when we're
attaching the console uart.
2004-05-01 06:12:18 +00:00
dyoung
0e7143de53 Sync with FreeBSD. Again, I lazily pull from the FreeBSD commit
log.

----------------------------
update copyright notice for 2004
----------------------------
add new statistics

Obtained from:	madwifi
----------------------------
update radiotap support to reflect recent changes:

o move tx taps from ath_start to ath_tx_start so lots more
  state is available to tap
o add tx flags
o add tx rate
o add tx power (constant for the moment)
o add tx antenna state
2004-04-30 23:59:55 +00:00
dyoung
149917ef8b Sync with FreeBSD. Here are the changes FreeBSD has made:
----------------------------
do proper subclassing of node free+copy; the previous hack falls apart when
the 802.11 layer does useful work

Obtained from:	madwifi
----------------------------
transmit beacon frames directly instead of defering them to a swi; there
was too much delay

Obtained from:	madwifi
----------------------------
update copyright notice for 2004
----------------------------
radiotap updates:

o force little-endian byte order for header
o pad header to 32-bit boundary to guard against applications that assume
  packet data alignment
2004-04-30 23:59:52 +00:00
dyoung
4c4f215885 From FreeBSD. Lots has changed. I lazily yank text from the
FreeBSD commit log:

----------------------------
use correct malloc type to allocate struct ieee80211_node's

Noticed by:	phk
----------------------------
do proper subclassing of node free+copy; the previous hack falls apart when
the 802.11 layer does useful work

Obtained from:	madwifi
----------------------------
transmit beacon frames directly instead of defering them to a swi; there
was too much delay

Obtained from:	madwifi
----------------------------
update copyright notice for 2004
----------------------------
check more quickly (and directly) if an interrupt is pending; this reduces
work done in ath_intr when the irq is shared

Obtained from:	madwifi
----------------------------
cleanup descriptor allocation if attach fails

Obtained from:	madwifi
----------------------------
remove use IEEE80211_C_RCVMGT
----------------------------
radiotap updates:

o force little-endian byte order for header
o pad header to 32-bit boundary to guard against applications that assume
  packet data alignment
----------------------------
Don't announce MAC addresses twice.
(ieee80211_ifattach() calls ether_ifattach().)
----------------------------
Make this compile on amd64.

"I'll cope" by:  sam
----------------------------
When draining the tx queue reclaim any node references held in packets.
This fixes a problem when operating as an AP where clients would get
stuck in the node table because the reference count never went to zero.
----------------------------
When ath_hal_stoptxdma returns an error dma is still likely stopped
so don't just stop trying to send a beacon frame or we'll be more likely
to lose sync.  This only seems to happen on some older chips.
----------------------------
use ath_reset instead of ath_init when recovering from a watchdog timeout:
resetting the hardware is sufficient, no need to reset the 802.11 fsm
----------------------------
make hw.ath.debug a tunable
----------------------------
make hw.ath.outdoor and hw.ath.countrycode tunables
----------------------------
split debugging messages up into classes;
ah_debug is now treated as a bit vector
----------------------------
update radiotap support to reflect recent changes:

o move tx taps from ath_start to ath_tx_start so lots more
  state is available to tap
o add tx flags
o add tx rate
o add tx power (constant for the moment)
o add tx antenna state
----------------------------
o eliminate widespread on-stack mbuf use for bpf by introducing
  a new bpf_mtap2 routine that does the right thing for an mbuf
  and a variable-length chunk of data that should be prepended.
o while we're sweeping the drivers, use u_int32_t uniformly when
  when prepending the address family (several places were assuming
  sizeof(int) was 4)
o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated
  mbufs have been eliminated; this may better be moved to the bpf
  routines
2004-04-30 23:59:48 +00:00
briggs
8f451cfae0 When we are recovering from a resource exhaustion on receive, make sure
that the RU is stopped before issuing an RU_START.
Fix suggested by Takahiro Kambe in PR kern/10622.
2004-04-28 15:25:45 +00:00
briggs
3d68e2f46f Back out revision 1.82. It seems to cause a number of device timeouts
on x86 boxes.  There must be a better way to deal with this that works
well for everyone.  In the meantime, back out to the version that works
for more people.
2004-04-28 03:37:58 +00:00
itojun
aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
itojun
4c6511de84 avoid unbounded sprintf(), use snprintf() 2004-04-21 18:03:13 +00:00
drochner
c6bba42c07 initialize the lock 2004-04-21 17:38:48 +00:00
wiz
3f9411f688 Spell removable with only two es. Inspired by jmc@openbsd. 2004-04-19 12:44:09 +00:00
bouyer
fca16a87e1 Make wdc_channel->ch_flags volatile, and cast it to (void *) when used
in tsleep()/wakeup() to appease gcc. Otherwise, the ch_flags value may
be cached in a register in atabus_thread(), and when it sets the WDCF_TH_RUN
bit after tsleep() it may loose loose the changes made by an interrupt handler
or another thread.
Problem analysed by Jukka Andberg on tech-kern.
2004-04-13 19:51:06 +00:00
matt
2d5e1958a5 Don't set M_HASFCS. Rather than just print we got a bad packet length,
actually print out the length that was bad.
2004-04-10 07:44:36 +00:00
briggs
d2074a867d Set the DMA SGL length correctly if the DMA request must be chained because
it is too large to fit in one SGL.
Fix from HITOSHI Osada <QFH02545 (at) nifty.com> in response to PR kern/24967.
2004-04-10 01:59:19 +00:00
enami
786727e51f Fix race condition introduced in rev 1.189; after the change, if there is
THRE interrupt occurs between the LSR read and IIR read, we won't see the
LSR_TXRDY bit when testing it in the variable `lsr' and we don't interrupted
again (as the corresponding bit in the IIR is cleared by reading, except
for some broken device).

Tested by Matthias Scheler and me, reviewed by Allen Briggs.
Closes PR#25010.
2004-04-05 22:33:08 +00:00
briggs
1c0ca89048 Be more careful about issuing CU_RESUME in fxp_start()--only doing
it if we think it's probably necessary.  Then do it again in the
tx interrupt handler, if we again think it's necessary.  This
reduces the number of commands we issue the chip.  Prior to this
change, the i82550 (running without extended feature set, so like
a '559) would sometimes fail in fxp_scb_wait() prior to issuing
another CU_RESUME, resulting in
	fxp0: WARNING: SCB timed out!
messages on the console, often followed by device timeouts.
2004-03-31 14:48:31 +00:00
mhitch
dbafb08630 Remove clauses 3 and 4. 2004-03-28 19:01:07 +00:00
atatat
b233127eb3 GC ath_node_root as well, but modify to work around the single
(tightly scoped) reason for recording the node address by recording
the assigned number.  Dink pci/if_bge.c to match, since ic/ath.c was
used as the archetype.
2004-03-27 04:37:59 +00:00
dyoung
f0b37d23ab Actually, disabling RSS rate-adaptation does not make any discernible
difference in locking up STA f/w 8.42.1.
2004-03-26 06:43:25 +00:00
dyoung
046f811cb5 Firmware revisions are decimal. 2004-03-26 06:39:56 +00:00
bouyer
27e1cb0c55 Deassert RST before re-enabling interrupts. Some drives (or controller)
require it.
From Michael van Elst in kern/24904.
2004-03-25 19:45:09 +00:00
dyoung
eaf23d986f Enable Tx and TxExc interrupts. Somehow this escaped my initial
commit. The rate adaptation code expects them. Usually wi gets
lucky, and an Rx/Alloc/Info event triggers the interrupt handler,
but I had not intended for wi to count on it.

Without Tx/TxExc interrupts enabled, wi will sometimes exhaust all
its rssdescs and cease transmitting.  Usually it sets IFF_OACTIVE
in that situation.
2004-03-25 06:17:51 +00:00
thorpej
df2f52dfc8 My copyright on this file is assigned to TNF. 2004-03-24 18:22:47 +00:00
drochner
ef369e0ed6 remove license clauses 3 and 4 from my cpoyright notices 2004-03-24 17:26:53 +00:00
wiz
f0d2889eb5 Move
(c) TNF
line from 4-clause UCB to 3-clause UCB license; in other words,
remove UCB's ad clause from the license TNF grants.
There is no point in TNF demanding that UCB's ad clause be followed
when even UCB doesn't demand it any longer.

Ok'd by board@ and agc@.
2004-03-24 15:38:41 +00:00
atatat
19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
matt
deeed00084 Set the M_HASFCS flag on received traffic. 2004-03-24 00:31:15 +00:00
christos
e4b3e03b4c Remove extraneous ; from OpenBSD. 2004-03-20 21:16:55 +00:00
he
2c34d70afa Adapt to the removal of NE2000_USE_WORD() macro, now replaced
by a field in ne2000_softc.
2004-03-18 23:38:17 +00:00
mycroft
2d3bb76a10 A random patch that's been in my source tree...
Figure out whether the shared memory region is word-accessible in the same
place we figure out its size, and store this in the softc, rather than using a
series of comparisons later.
2004-03-17 23:47:16 +00:00
dyoung
9ef4dd42f2 Prevent a buffer overflow that's been seen in the wild. The firmware
will sometimes return 0; subtracting 1 from that yields a too-big
buffer length.
2004-03-17 17:19:13 +00:00
dyoung
73a618d5f3 In wi(4), wi_choose_rate used to contain device-independent code.
I have pulled that code into the function ieee80211_rssadapt_choose
so that I can re-use it in ath(4), atw(4), and in other drivers.

In rssadapt(9), I have also created a struct ieee80211_rssadapt_expavgctl
that contains parameters for rate adaptation. When IEEE80211_RSSADAPT_DEBUG
is enabled, I will using sysctl to expose an ieee80211_rssadapt_expavgctl
for each wireless device.

Also in rssadapt(9), I have introduced an interpolate() macro which
makes the exponential-averaging code more compact.
2004-03-17 17:00:34 +00:00
bouyer
751597cddb cbd -> cdb
Command Block Descriptor -> Command Descriptor Block
Pointed out by Allen Briggs.
2004-03-16 19:10:43 +00:00
bouyer
542c876565 Extract the code printing the CBD from scsipi_print_sense(), so that it's
usable in other context.
Use the new scsipi_print_cbd() to dump the command in case of timeout
in siop/esiop.
2004-03-15 22:43:43 +00:00