Commit Graph

3758 Commits

Author SHA1 Message Date
chris
8276e3ab68 Add the optional ability to parse the cs's eeprom data structure. I've made
it optional as I'm not able to confirm the eeprom format is the same on
earlier cs89x0's.  Certainly the my 8920M and the data sheet for 8900A use the
same format.

This allows my RiscStation to examine the cs's eeprom to find it's mac
address, previously it was unable to do this, as the eeprom offsets were hard
coded for locating the mac address.
2004-07-04 13:09:12 +00:00
mycroft
94e2ec5a8b Back off the trigger level a little. Testing shows that it's not terribly
reliable at 14.
2004-07-04 09:46:44 +00:00
mycroft
35186738e8 Minor simplification. 2004-07-04 09:28:05 +00:00
mycroft
df4e7d03fc Incorporate 4 changes that have been suggested:
* At high speed, set the FIFO trigger to the maximum value to reduce interrupt
  load.  PR 15448.
* Handler the case of IIR=RXRDY and LSR=!LSR_RCV_MASK differently, to avoid a
  hang with some chips.  PR 21184, and possibly PR 10974 and PR 8248.
* Remove the extra wait at the end of com_common_putc(), after writing a
  character out, so that we get another TXRDY interrupt.  This prevents stalls
  when normal output and kernel output are mixed.  PR 4263.
* Do not "preload" the TX FIFO; wait for a TXRDY interrupt to come in after
  enabling it.
2004-07-04 08:09:03 +00:00
mycroft
2aa1e3c773 Fix a bug in the packet "padding" code. If we're padding a packet with an odd
size, we were writing out too much data, possibly causing the chip to lock up.
2004-07-04 00:31:20 +00:00
dyoung
b678db6630 Indicate link status changes on the routing socket. 2004-07-02 23:41:34 +00:00
dyoung
d16482800f Cosmetic: shift a break-statement into the right column. 2004-07-02 21:22:18 +00:00
dyoung
ef5c009e5c wi_start compaction: check for software descriptor exhaustion in
one place.  Check for the _RUN state in one place.
2004-07-02 21:20:10 +00:00
mycroft
e8699d813a Add debugging code to dump the filter setup descriptor, similar to the transmit
path.
2004-07-02 19:53:31 +00:00
bouyer
a784628775 Fix PR 25788 by Arto Huusko using a cleaned up version of the provided patch.
Not reading the mii media status if the interface isn't up doesn't hurt,
as the real media status isn't reported if the interface isn't up anyway
(checked on i386).
On my alpha500, I tracked down the machine check to the GO_WINDOW(4) at
line 1858 of elinkxl.c. It's possible that the problem which was fixed in
rev 1.72 was also the GO_WINDOW(4) used in the non-mii case. tr from ddb
and a single-step show different results, and I trust the single-step
one :)
2004-07-02 16:58:36 +00:00
drochner
e87f74fd64 put the __packed__ attribute close to the struct definition
(to appease gcc-3.4), and use the compiler-independant __packed
form for consistency
2004-07-01 20:56:34 +00:00
heas
9efbbebf3a do not reset the chip (and subsequently the phy) when unnecessary; that is,
for address changes, multicast filter changes, or adjusting promiscuous mode.
Fixes resetting the phy for things like start/stopping tcpdump.

ok petrov@, martin@, pk@
2004-06-28 20:50:52 +00:00
bouyer
5a33ee9f49 For now, remove the ATAPI_SOFT_RESET done at attach time. I added this to get a
IBM pcmcia external cdrom drive working, but it cause troubles for others
IDE/ATAPI devices. Need to find another way to get this IBM drive to probe.
2004-06-23 21:10:52 +00:00
dyoung
bb016ff89a Only drain the transmit queue if we are idling the transmit section. 2004-06-23 09:41:54 +00:00
dyoung
ff69458fef After we wait for the MAC's transmit section to idle, drain the
transmit queue and cancel the watchdog timer.  This ends the annoying
"atw0: transmit timeout" messages that disrupted my WiFi tonight.
2004-06-23 09:27:59 +00:00
dyoung
60565a3dfb Fix a commit-o: handle all cases in the switch-statement. 2004-06-23 09:05:50 +00:00
dyoung
4e2ccd85f7 The ADM8211C uses a different BBP type-number for RFMD parts than
the original ADM8211.
2004-06-23 08:13:29 +00:00
dyoung
7d226b79b8 Don't skip the reset! atw was not getting reset at device attachment.
atw seems to work better now that it gets this right: for one thing,
the RSSI can be seen to change as I walk around the office with my
laptop.

Thanks to Todd C. Miller for pointing out my mistake.
2004-06-23 08:12:28 +00:00
dyoung
1a4ea7342a Fix typo: change ATW_RFTYPE_RFMD and family to ATW_BBPTYPE_RFMD.
This does not make any functional difference: each manufacturer's
RF type-number is the same as its BBP type-number.
2004-06-23 08:05:01 +00:00
thorpej
bddc74072e Define and use pcmciabuscf_controller as an alias for
cf_loc[PCMCIABUSCF_CONTROLLER] and pcmciabuscf_socket
as an alias for cf_loc[PCMCIABUSCF_SOCKET].
2004-06-20 18:09:46 +00:00
thorpej
221edc1cb1 Define and use zsccf_channel as an alias for cf_loc[ZSCCF_CHANNEL]. 2004-06-20 18:07:35 +00:00
dyoung
43dcf72c5f Finally, refactor wi_media_change and ieee80211_media_change.
ieee80211_media_change handles a lot more conditions than
wi_media_change did.

This helps with the second bug mentioned in kern/25604, which causes
"SIOCSIFMEDIA: Invalid argument."
2004-06-06 05:32:17 +00:00
dyoung
86fed42ae8 In ad hoc mode, ignore the MAC's link up/down indication, since it
does not appear to be reliable.
2004-06-06 04:38:33 +00:00
dyoung
9494e60fdb No need to detect and exit on short 802.11 packets, since
ieee80211_input will do that (and tap the packet).
2004-06-05 07:12:45 +00:00
mycroft
a4135d1d48 Only downgrade modes due to an actual CRC error. Downgrading on other errors
is anti-social -- especially given that there's no way to upgrade again short
of rebooting.

Also, downgrade UDMA modes more slowly.  It's entirely possible that they're
using an 80-wire cable, but it's just too long for the higher modes, or there
is minor crosstalk.
2004-06-01 19:32:30 +00:00
mrg
a596504c46 - update URLs for sigmatel.
- add entry for "SigmaTel STAC9758/59" (seen on a new emuxki card)
2004-06-01 13:35:59 +00:00
dyoung
4d9e630e22 Don't set a frame's WEP bits, the 802.11 layer already has. 2004-05-31 11:42:00 +00:00
dyoung
17bc2a623e Define several new registers for the ADM8211C/CR parts. Improve
old register descriptions.
2004-05-31 11:40:56 +00:00
dyoung
ee1c094dae No need for ath_start to set the WEP bit in the frame header, the
802.11 layer does it for us.
2004-05-31 11:39:39 +00:00
dyoung
ac60cbd35f It's only necessary to set do_encrypt in one place, so do that. 2004-05-31 11:28:48 +00:00
dyoung
3e45584fea Cosmetic: fix comment typo, change bit-test style. 2004-05-31 11:28:03 +00:00
dyoung
4d6f61112f Name the shift, txpower << 2 -> LSHIFT(txpower, RF3000_GAINCTL_TXVGC_MASK). 2004-05-31 10:49:32 +00:00
dyoung
ab84dc7c5f Wrap a line. Remove a useless comment. 2004-05-31 09:05:01 +00:00
dyoung
97c923cdc2 Describe Tx/Rx state a little better using clue from the ADM8211C/CR
datasheet.
2004-05-31 09:00:24 +00:00
dyoung
e4e9f15d6a Use bpf_mtap2. 2004-05-31 08:52:53 +00:00
toshii
b5fa366e57 Minor clean ups. No functional change.
- use RTK_RX_DESC_CNT where appropriate
  - remove unused members
2004-05-30 03:43:26 +00:00
christos
fd8537e01d fix another scrolling use that leaked. 2004-05-29 02:04:56 +00:00
christos
1143925e65 move scroll function definition last. 2004-05-28 22:38:28 +00:00
christos
7208404c41 PR/19925: David Ferlier: Add scrolling support to wscons. 2004-05-28 21:42:29 +00:00
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
dyoung
224491add0 Move the ath(4) sysctls to hw.ath from ath. 2004-03-15 03:26:04 +00:00
wiz
4fdf521f76 It's extension, not extention. From Miod Vallat (miod at online fr). 2004-03-14 20:11:24 +00:00
minoura
b332b550b9 Add Intel ICHn PCI-LPC bridge driver.
It is a pcib, but with sysmon watchdog support.
2004-03-14 08:04:38 +00:00
bjh21
759fb56651 Convert to use pckbport infrastructure -- another file I missed on the first
pass.
2004-03-13 23:03:43 +00:00
bjh21
dff5222d3a Abstract the interface between pckbc(4), and the pckbd(4) and pms(4)
drivers that attach to it.  This allows for other host interface chips
that use the same keyboards and mice, such as the ones in the ARM
IOMD20, ARM7500, and SA-1111.  The PC-compatible driver is still
called pckbc(4), and the new abstraction layer is "pckbport", so the
child devices have moved from sys/dev/pckbc to sys/dev/pckbport, which
also contains some code shared between all host controllers.  To avoid
incompatibility, pckbdreg.h is still installed in
/usr/include/dev/pckbc.

In theory, this shouldn't cause any behavioural changes in the drivers
concerned.  Thy just use rather more function pointers than before.  Tested
on i386 and (with a new host driver) acorn32.  Compiled on several other
affected architectures.
2004-03-13 17:31:33 +00:00
dyoung
a0e5ea5bcb Enable extended channel set.
Add some debug code for printing the HAL's notion of available
channels if hw.ath.debug = 1.
2004-03-13 05:43:08 +00:00
jkunz
17e4dce36a Import MI part of new Intel i82596 Ethernet driver. 2004-03-12 11:37:17 +00:00
jmc
2311909a8b Provide standard workaround for \!defined __BUS_SPACE_HAS_STREAM_METHODS 2004-03-11 05:59:33 +00:00
bouyer
eefc140c02 The 1010-66 always generate AIP values on the bus, regardless of the SCNTL4
settings. Disable AIP completely, as this confuse pre-Ultra160 drives.
From FreeBSD.
2004-03-10 22:02:53 +00:00
bouyer
6338d77271 The real value of the message is in msgin, not
esiop_cmd->cmd_tables->msg_in[0], so print the correct value.
2004-03-10 21:51:29 +00:00
dyoung
bfe1b324c6 Fix endianness bug to make awi(4) work on macppc (and other big-endian
machines).
2004-03-08 06:52:44 +00:00
dyoung
65e1a3b112 Oops, ath(4) tells dBm signal, not dB signal. 2004-03-03 00:05:16 +00:00
kleink
02a87b49d9 Back out previous. 2004-03-01 23:46:44 +00:00
kleink
b66915a096 Cosmetics; add missing newline to autoconf output. 2004-03-01 20:29:24 +00:00
dyoung
3644406951 Attach the ath(4) sysctls:
ath.dwell: channel dwell time (ms) for AP/station scanning
ath.calibrate: chip calibration interval (secs)
ath.outdoor: enable/disable outdoor operation
ath.countrycode: (opaque?) country code
ath.regdomain: (opaque?) regulatory domain
ath.debug: 0 (no debug messages), 1 (some messages), 2 (all messages)
2004-03-01 01:19:45 +00:00
dyoung
d68ab48dd5 Update ath(4)'s Hardware Abstraction Layer (HAL) to version 0.9.6.11.
Both the API and ABI changed, hence the changes to so many .c and
.h files.
2004-02-29 00:47:21 +00:00
drochner
c6de49574c The interrupt claim stuff is broken -- data buffers
and external interrupt handlers should be completely
unrelated.
For now, just remove the obvious culprit in the nibble/ps2
case to make NTP pps signal capturing work again.
External handlers should be passed to the lower level,
and they should have full power and responsibility if
they are installed, and their lavel should be selected
by the frontend.
Being here, comment out <machine/intr.h> - it is not
used yet, and do some more conmetic cleanup.
2004-02-24 17:41:09 +00:00
wiz
73e1501b98 parameter with two es. From Peter Postma. 2004-02-24 15:22:01 +00:00
wiz
f05e6f1a3a occured -> occurred. From Peter Postma. 2004-02-24 15:12:51 +00:00
wiz
dc4cc98b15 becuase -> because. From Peter Postma. 2004-02-24 15:05:53 +00:00
yamt
635ee237b0 support h/w assisted vlan tag insertion. 2004-02-19 14:21:40 +00:00
yamt
9324f158e1 support h/w assisted vlan tag removal. 2004-02-19 13:34:51 +00:00
dyoung
8ecfa06341 Move the RF Microdevices RF3000 & Silicon Laboratories SI4126/SI4136
register sets into their own header files for re-use by future
drivers.
2004-02-17 21:20:55 +00:00
bjh21
5aca86918f Add a new MI attribute, pckbc_machdep_cnattach, and change pckbc_cnattach()
to only call pckbc_machdep_cnattach() if this is present.  This allows
pckbc_machdep_cnattach() to be omitted entirely on most ports, where it only
returns ENXIO anyway.

The devices with this attribute at the moment are pc(4) on i386 and bebox, and
pckbc on sparc, where pckbc_machdep_cnattach() mysteriously returns 0 rather
than ENXIO.
2004-02-14 14:33:28 +00:00
wiz
e365329be5 Spell length with h after t. Inspired by a commit by brad@openbsd. 2004-02-13 18:02:05 +00:00
wiz
d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
wiz
f5b32c1e69 RealTek -> Realtek. 2004-02-13 10:00:54 +00:00
dyoung
05bd205756 KNF. Change
static
        void mem_write_2(...)

to

        static void
        mem_write_2(...)
2004-02-13 01:22:20 +00:00
jdolecek
63e9ee7bf5 add Gary Thorpe copyright notice 2004-02-10 21:55:38 +00:00
jdolecek
fba6bed686 fix atppcintr() to support shared interrupts properly
problem found and fix provided by Paul Shupak
2004-02-10 18:42:48 +00:00
dyoung
6f9c4a91f1 If the firmware returns to us an RSS descriptor index that is out
of bounds, then complain and recover by freeing all of the descriptors.
That will usually provoke additional complaints---see the next
paragraph.

If the firmware returns to us an RSS descriptor that is in-bounds
but out of service (id_node == NULL), then gripe and get out of
the interrupt handler. ***This will still leak RSS descriptors.***
I'm working on a better solution. Possibly I will just free all of
the descriptors.
2004-02-10 01:08:05 +00:00
dyoung
9f147300d1 Disable rate-adaptation for Lucent firmware version 8.42.1, per a
bug report from Simon Burge: the firmware seems to lock up.

If rate-adaptation is disabled on a Lucent card, then do all the
rate-adaptation work *except* for writing the new transmit rate,
since I suspect that is what locks-up the firmware.
2004-02-10 00:59:38 +00:00
dyoung
b664edb5ad Shorten the retry count on Prism APs to improve the speed of
rate-adaptation.
2004-02-10 00:52:12 +00:00
dyoung
d32ed08a80 Factor out the initialization/reset of RSS descriptors, making
wi_rssdescs_init, wi_rssdescs_reset, which I will use to receover
when the firmware botches up the RSS descriptor index.
2004-02-10 00:47:41 +00:00
dyoung
c9dcac9ffa The radiotap header is little-endian. 2004-02-10 00:32:40 +00:00
hpeyerl
e3c5164736 On some 'fast' i386 motherboards, the timing between consecutive reads
and writes of the EEPROM are too fast so invalid data is returned. So we
increase the DELAY()s.  The right thing would be to check a ready bit
on the E^2 if such a thing exists.  (checked by potr)
2004-02-09 22:29:26 +00:00
augustss
bc9ffbf1a7 Add some EEPROM related defines. 2004-02-04 15:43:14 +00:00
jdolecek
b267be2d28 some style changes - g/c redundant cast, simplify code in atppc_read_ivar() 2004-02-03 18:54:59 +00:00
dyoung
cc1434eac0 wi_stop tells which stations' rssadapt descriptors it cleans up
when IFF_DEBUG is set.
2004-01-31 10:40:19 +00:00
dyoung
5e9822c7e9 Get rid of __P. 2004-01-29 10:25:49 +00:00
dyoung
a0b92c808f Add atw_pci_enable, atw_pci_disable. Fixes a panic at "ifconfig
down" that was reported by Darren Reed.
2004-01-29 10:06:19 +00:00
dyoung
a2c00c4caa Only pass 802.11 frames up if they are greater than the minimum
size or else if monitor mode is enabled.
2004-01-29 10:02:24 +00:00
dyoung
b7522c81e7 Avoid division by zero when computing the link-lost lost-beacons
threshold.
2004-01-29 10:01:14 +00:00
dyoung
9641999af3 Deal with the RSSI as an unsigned value. 2004-01-29 09:59:57 +00:00
dyoung
d1354038ef Fix whitespace in Si4126 register definitions. 2004-01-29 09:55:35 +00:00
dyoung
f7b1f8ea0b Wrap the bit-twiddling macros so that they don't get redefined if
more than one header file defines them.
2004-01-29 09:53:18 +00:00
jdolecek
2d2c0ad74d don't limit size of DMA transfer by size of FIFO
problem reported and fix provided in PR kern/24200 by Paul Shupak
2004-01-28 20:08:35 +00:00
onoe
c65191a490 Adopt to new 802.11 framework.
Add support of version 5.30.17 firmware of PCMCIA 350 series.
MPI350 mini-PCI is NOT YET supported.
MONITOR mode is still not yet working.
2004-01-28 15:07:52 +00:00
drochner
b82ddc9975 -make it compile with ATPPC_DEBUG
-minor cleanup (whitespace, avoid a typecast)
2004-01-28 14:26:24 +00:00
jdolecek
a2fc9113b3 print the parallel port capabilities and FIFO attributes always,
not just with ATPPC_DEBUG/ATPPC_VERBOSE
remove the printf("\n") on start of atppc_sc_attach()
2004-01-25 11:41:17 +00:00
bjh21
1c34707a4c Remove dollar signs from foreign RCSIDs per doc/3RDPARTY.
Add __KERNEL_RCSID() to .c files.
2004-01-25 00:28:01 +00:00
simonb
2763a4b916 Fix NTP PPSAPI support (enabled with "options PPS_SYNC"):
From PR kern/13702 from Charles Carvalho.  Tested on alpha and
i386 with a Laipac TF10 PPS-capable GPS.  The com.c change was
copied wholesale from Charles' z8530tty.c patch.
2004-01-23 05:01:19 +00:00
jdolecek
83ee4751e2 Resurrect "dev" variable from atppc_sc_attach() removed in rev 1.4
(#ifdef ATPPC_DEBUG), so that this compiles with the option set

Fixes PR kern/24193 by Paul Shupak
2004-01-22 14:28:57 +00:00
jdolecek
e17503e59e Reset the service bit of ECP register, so that write threshold would
be identified correctly
Problem reported and fix provided in PR kern/24185 by Paul Shupak
2004-01-22 14:22:20 +00:00
bjh21
ff75178c6b Remove unused "dev" variable from atppc_sc_attach().
Remove unused include of <dev/isa/isavar.h>, which fails on non-ISA platforms.
2004-01-22 01:21:41 +00:00
abs
637b0ef23e If we are explicitly asked for entropy, provide it. 2004-01-21 00:47:37 +00:00
bjh21
f782033436 Add RCSID comments. 2004-01-21 00:33:37 +00:00
jdolecek
0fb67944af make compile - fix print formats 2004-01-20 19:58:00 +00:00
jdolecek
e23cd1a78a Import Gary Thorpe's netbsd-ppbus 1.3. This is NetBSD port
of FreeBSD Parallel Port Bus framework. Work in progress.
2004-01-19 23:22:23 +00:00
onoe
a42258dab0 Do not return EINPROGRESS but 0 in awi_newstate, since the EINPROGRESS
handling was changed in net80211 framework.
This fix wiconfig -D awi0 to work again for DS phys.
XXX FH phys takes 20 seconds to complete scan, so wiconfig timed out.
2004-01-16 14:13:15 +00:00
onoe
d21d916e1d Correct beacon (src/bssid) for hostap and adhoc mode. 2004-01-15 13:29:05 +00:00
onoe
5ff2748cd5 Fix: panic when rate is specified but chan is left unspecified.
Add FreeBSD glues to share drivers.
2004-01-15 09:39:15 +00:00
onoe
090e150c3f ANSIfy. 2004-01-15 09:33:48 +00:00
dyoung
8c117e1a38 NetBSD's KASSERT takes just one argument while FreeBSD's takes two,
so I have added IASSERT(cond, complaint) to the compatibility header
file and s/KASSERT/IASSERT/'d.
2004-01-13 23:37:29 +00:00
dyoung
55e0f7c6a4 Rounding to the nearest multiple of 2 with roundup(constant, 2) is
easier to read than `constant + 1'.
2004-01-10 07:54:55 +00:00
dyoung
0370da2a5d In atw_rf3000_tune, enable I/O with the modem and RF front-end
"just in time" instead of at the top of the function.
2004-01-10 07:51:16 +00:00
dyoung
348c2d9603 Do not set IEEE80211_F_IBSSON in hostap mode. Treat hostap-mode
when the link condition changes by returning.

Note that hostap mode still does not work in atw, and ADMtek has
told me that the hardware will not support it, but I remain hopeful.
2004-01-10 07:47:02 +00:00
dyoung
005d4641ca Report received-early interrupt with a debug printf.
Print the Serial EEPROM and the MAC address it contains when
atw_debug > 0, because atw_debug > 1 is a little too strict.
2004-01-10 07:41:18 +00:00
dyoung
f38df7cae7 Misc. cosmetic changes.
Add a debug printf to the input path.
2004-01-10 07:03:28 +00:00
dyoung
a94687e30c Use new docs provided by RFMD to give some meaning to
previously-undocumented registers and magic numbers on the RF3000
baseband.
2004-01-10 06:30:35 +00:00
dyoung
bd26cc12f9 Get rid of empty #if 0/#endif stanza. 2004-01-10 06:02:32 +00:00
thorpej
cb9ba8776e Add a comment about some code that should be cleaned up. 2004-01-07 22:03:56 +00:00
tsutsui
47c4c87d2c Fix bus error trap on X68030/25MHz on-board SPC, which may have some quirk.
Problem reported by Yasushi Oshima.
2004-01-06 18:07:17 +00:00
wiz
a5bf3b3c4c Spell controller with two ls. Inspired by miod@openbsd. 2004-01-04 16:19:43 +00:00
thorpej
197f2f50da More structure member namespace cleanup: thread -> ch_thread 2004-01-03 23:59:58 +00:00
thorpej
a963286f8d More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
2004-01-03 22:56:52 +00:00
thorpej
3fb652250b More comment/whitespace tidy-up. 2004-01-03 19:31:09 +00:00
thorpej
5bd80d8373 Rename "struct channel_softc" to "struct wdc_channel". 2004-01-03 01:50:52 +00:00
thorpej
181abd742b Tidy this file up a little. 2004-01-01 21:18:28 +00:00
thorpej
9bc0bf3f15 Prepend "wdc_" to wait_for_drq, wait_for_unbusy, and wait_for_ready. 2004-01-01 20:25:22 +00:00
thorpej
763657a529 Tidy up this file somewhat. 2004-01-01 20:18:33 +00:00
thorpej
527c829fa0 Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers.  Clean up the member names of these structures while at it.
2004-01-01 17:18:53 +00:00
thorpej
abf619ebfb Simplify setting up the channel queue a little. 2003-12-30 20:20:21 +00:00
thorpej
3787a92812 Move the register definitions for ATA Task File registers to atareg.h;
they are also used by controllers that do not map the registers into the
system address space, and are thus distinct from the "controller" registers.
2003-12-30 19:30:13 +00:00
thorpej
ed96a1cec2 Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function.  wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach().  The
WDC_CAPABILITY_DRVPROBE bit is gone.
2003-12-30 17:18:11 +00:00
thorpej
68f89cabfe Use ANSI function decls. 2003-12-30 16:40:12 +00:00
thorpej
0ad3db4759 Move most of the atabus layer into ata.c. 2003-12-30 16:28:37 +00:00
christos
1b57662119 make the printf statements on chip_io_map complete lines. 2003-12-28 01:21:37 +00:00
lha
b8fd6b90c7 add SMART Read Log constant 2003-12-20 19:45:52 +00:00
thorpej
52f06d7766 If we're running on a Connectix Virtual PC, we might get a packet longer
than a max size Ethernet frame without getting a frame-too-long error.  VPC
seems to be adding 4 zeros at the end of every frame.  Detect this condition
and simply truncate the packet to a max size Ethernet frame.

I now have no problems with networking on NetBSD inside Virtual PC 6.
2003-12-18 18:39:36 +00:00
dyoung
59eb8ab913 Synchronize with FreeBSD:
* add constants to enums

 * HAL update: stops panics, fixes ad hoc-mode beacons, some API
   changes

 * get and use mac/phy/rf front-end revision codes

 * add a custom ath(4) ic_node_getrssi callback which does RSSI
   averaging

 * do not immediately scan, but re-associate after missing beacons.

 * bug fix: don't if_init after detach.

 * HAL diagnostics ioctl, SIOCGATHDIAG

 * send DS parameters element in beacons

 * const-ify some pointers

 * consolidate rx-filter settings into ath_calcrxfilter

 * abstract FreeBSD `ticks', NetBSD `hardclock_ticks' with ATH_TICKS()

 * misc. other changes
2003-12-16 06:48:08 +00:00
thorpej
9de2760c3e Add a (*drv_probe)() optional callback into the driver to probe for
drives on a channel.  Drivers should provide this if they have some
sort of intelligent probing mechanism.
2003-12-15 00:27:13 +00:00
thorpej
e4aa90cdc6 Rename __wdcprobe() to wdcprobe1(). 2003-12-14 18:51:10 +00:00
dyoung
ea63a1a6cd PR 23428: support National Datacomm Corporation NCP130A2 board.
Thanks T. M. Pederson for sending the patches.
2003-12-14 10:04:33 +00:00
thorpej
d8f4e7306d No need to include wdvar.h anymore. 2003-12-14 05:34:29 +00:00
martin
cc7556d487 Fix compilation for ports w/o __GENERIC_SOFT_INTERRUPTS_ALL_LEVELS. 2003-12-12 22:35:13 +00:00
martin
9489d737cd In parallel to the interrupt handler pckbcintr provide two functions
pckbcintr_hard and pckbcintr_soft, which, together, do the same as
pckbcintr. The first is called from the interrupt handler, the second
from a softinterrupt at arbitrary protection level (lower or equal to
IPL_TTY). They pass data via a small ringbuffer.

The new functions are intended for platforms that, due to
hardware/firmware restrictions are not able to make pckbcintr called at
IPL_TTY, like Krups javastations. Using the monolithic pckbcintr on
these plattforms leads to the input handlers for the slot data to be
run at elevated priority, causing various race conditions.
2003-12-12 14:30:16 +00:00
ad
ae788c30d0 Mirror change made in FreeBSD, rev 1.39 of aac.c. May address PR 23574.
bzero out the sync command buffer when sending commands.  This was causing
problems when enumerating multiple arrays.
2003-12-09 20:12:14 +00:00
dyoung
609617af90 Enable RSSI-based rate-adaptation for wi(4). This enables wi(4)-based
APs to run at "full speed" where before they ran at just 1 or 2Mb/s.
The AP will adapt the data rate for each client based on packet
losses and the received signal strength.

I have also enabled rate adaptation for STA mode and for IBSS mode,
but the hardware gives us less control over the data rate in those
modes.
2003-12-07 05:44:49 +00:00
dyoung
d942dc3968 In _STA mode, don't panic when a stray beacon-miss interrupt is
received.  Instead, ignore it. It's normal for a stray to come
during the transition to monitor mode.
2003-12-07 05:09:02 +00:00
dyoung
9270de9dc4 Updates to 802.11 radiotap. The _DB_ flags were used everywhere to
denote a signed dBm Rx power, so rename them to _DBM_ and change
the signedness.  Add new _DB_ flags for unsigned Rx power measured
from an arbitrary reference.

Try to synchronize net80211/ieee80211_radiotap.h with my tcpdump
sources (which public tcpdump has not seen, yet) and with FreeBSD.
2003-12-07 04:49:17 +00:00
dyoung
78b6786442 Make the MASK_TO_SHIFT expression less "tall." Hopefully helps
work-around the gcc bug reported by Erik Osheim.
2003-12-07 04:22:57 +00:00
dyoung
69ed3fa879 Cosmetic: add some whitespace for readability. 2003-12-07 04:19:27 +00:00
yamt
3b65e1745b - disable ipv4 checksum offloading as it seems to have a problem.
- add comments to describe it.
2003-12-06 11:27:28 +00:00
pk
5255e234b9 cac_cmd:
* don't let cac_ccb_alloc() sleep since it regularly runs in an
    interrupt context
  * return EAGAIN instead EBUSY (or -1), which is what the upper ld
    layer expects to get on transient resource shortages.
  * ignore error from cac_ccb_start(), since a `fifo full' condition is
    handled internally in the lower layer, i.e. the transaction started
    from ldstart() has been queued at the lower layer and must be taken
    off ld's disk queue.
2003-12-05 10:23:00 +00:00
keihan
b8702f530b netbsd.org -> NetBSD.org
This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean".  Thanks for the patiance, and sorry for all the commits.
2003-12-04 13:57:30 +00:00
bouyer
67e9511d69 Move WDC_NREG from wdcreg.h to wdcvar.h. First part of fix for
port-macppc/23604.
2003-12-03 12:01:18 +00:00
bjh21
8e1125601f Include wdcreg.h for WDC_NREGS (used by wdcvar.h). 2003-11-29 19:33:34 +00:00
he
fc44e8511e Patterned after the rest of the code, add one more check that
chp->wdc is non-null before de-referencing it.
2003-11-29 16:17:31 +00:00
fvdl
6242a54566 There are some cards that map the ATA control and IDE DMA registers
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.

To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.

	bus_space_write_4(tag, handle, offset, value)

becomes

	bus_space_write_4(tag, handles[offset], 0, value)

Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).
2003-11-27 23:02:40 +00:00
bouyer
a452a585a7 Some combination of controller/drive sends a continous stream of
interrupt while SRST is asserted. Work around by blocking interrupts while
SRST is asserted, and clearing any pending interrupt before unblocking.
Fix kern/23529 from Michael Hertrick.
2003-11-25 21:03:15 +00:00