Commit Graph

3413 Commits

Author SHA1 Message Date
matt ab3d7937b5 Fix uninitialized warning. 2003-10-30 21:19:02 +00:00
simonb b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00
bouyer f974ecc32b Remove check for the error register value at probe time. There have been report
on -current-users of some drives not returning the proper value here.
This shouldn't affect the probe time for the common cases.
2003-10-29 22:09:41 +00:00
bouyer 14cd9d8cff freese->freeze, as pointed out by Frederick Bruck. 2003-10-29 22:05:15 +00:00
bouyer ef9a315b24 - test if we have some work to do before tsleep() in the kernel thread,
in case the previous loop scheduled some more work to do (e.g. reset)
- use queue_freese to block the queue when a reset is pending too
- Avoid using WDCF_TH_RUN in some place that can be called from callout.
  If the kernel thread is tsleep()ing somewhere, we may come here with
  WDCF_TH_RUN set while being in the callout context. Fix a panic() in
  tsleep() reported by Chuck Silvers.
- Use AT_WAIT instead of WDCF_TH_RUN wdcwait(), as we may not be in the
  channel's thread context but still be able to tsleep(). Fix queue_freese
  panics for WDC_CAPABILITY_NOIRQ controllers (port-mac68k/23208 by
  Frederick Bruck).
2003-10-29 21:44:41 +00:00
tsutsui 18b32ac5ba Switch arc to use MI mc146818 tod driver. 2003-10-29 18:17:49 +00:00
tsutsui 21ebbd9f3e Add a bogus initializer to appease gcc's uninitialized warning.
XXX osiop_checkintr() should be rewritten.
2003-10-29 18:03:22 +00:00
tsutsui cb187dc1a7 Fix bogus GCC uninitialized variable warning. 2003-10-29 18:01:20 +00:00
tsutsui a17f7ef138 Eliminate an uninitialized variable warning. 2003-10-29 17:45:55 +00:00
tsutsui 159c103f63 Fix think-o about century handling in settime function. 2003-10-29 17:41:36 +00:00
tsutsui 2ba8cd8f89 Add MI driver for mc146818 based time-of-day clock with todr(9) support. 2003-10-29 17:00:40 +00:00
mycroft 3b7d66667e Return EINVAL rather than stepping off a null pointer. 2003-10-29 02:31:55 +00:00
mycroft 46ef74d63c Recode to remove bogus initializer. 2003-10-29 01:21:38 +00:00
mycroft 0b179751bd XXX: gcc 2003-10-29 01:12:23 +00:00
mycroft 9d009e4f2a Remove bogus initializer, and fix a typo in a loop variable instead. 2003-10-29 00:48:15 +00:00
mycroft 3741fa9860 Kill another bogus initializer. 2003-10-28 22:22:28 +00:00
matt ebe74b9e7f fix bogus GCC uninitialized variable warning. Use TAILQ_FOREACH. 2003-10-28 18:35:06 +00:00
christos 05f07448b6 Another possibly uninitialized lasttx 2003-10-26 19:11:33 +00:00
christos 93af726cde Don't return random garbage in the default case; return the smallest ring
descriptor instead.
2003-10-26 18:20:43 +00:00
fvdl e645b8b032 Add definitions for 8139C+ and 8169 chips. Not used yet. From FreeBSD. 2003-10-25 23:48:45 +00:00
christos 9269644881 Fix uninitialized variable warning. 2003-10-25 21:33:04 +00:00
christos d2705ee1d2 make this compile again. I should really rename the FreeBSD KASSERT to
KASSERT2 or something.
2003-10-25 21:32:44 +00:00
christos 987510aee5 KASSERT takes 2 arguments here. 2003-10-25 19:41:44 +00:00
christos b3ae88ff5d Fix uninitialized variable warning. 2003-10-25 19:12:08 +00:00
christos 8bfd5e3292 Fix uninitialized variable warnings 2003-10-25 18:34:14 +00:00
simonb 7e135f3a2e Make this compile with older gcc. 2003-10-25 13:45:07 +00:00
christos 21027e6048 more uninitialized variables 2003-10-25 08:37:00 +00:00
christos 551bd8b829 fix uninitialized variables 2003-10-25 08:30:46 +00:00
mycroft f253f37fb0 In wi_newstate(), read the BSSID into a temporary buffer that has guaranteed
alignment.  Fixes a really obscure failure mode on Alpha, and panics on other
machines.
2003-10-24 23:58:22 +00:00
briggs 7dc8540d52 Avoid a race condition that could allow a removable controller (such as
a compact flash card) to lock the atabus thread if it gets detached during
the probe process.
2003-10-22 23:59:00 +00:00
christos ddccf85c50 support for NE2000_TYPE_AX88790 from
Yong-Jhen Hong yongjhen at alqualonde dot org
2003-10-22 00:12:36 +00:00
simonb 7feb1a91fa Remove return after panic(). 2003-10-21 06:22:16 +00:00
yamt 65995a9aa2 don't swap powerhook and shutdownhook. 2003-10-21 01:00:57 +00:00
fvdl 5f1e7fa5f8 Correct NULL abuse. 2003-10-21 00:57:47 +00:00
fvdl 86c363960e Correct NULL abuse. 2003-10-21 00:25:59 +00:00
dyoung ab4a574ce1 Don't take the 802.11 header off of a frame until after we've given
it to the driver's BPF tap.
2003-10-19 22:00:54 +00:00
simonb 9833c17169 Remove some unreachable code with the comment "To shut up compiler"
that neither gcc 2.95.3 or 3.3.1 complains about if that bit of code
is missing...
2003-10-19 01:49:03 +00:00
simonb 59fb31d7cc Remove unreachable break after return and goto statements. 2003-10-19 01:44:48 +00:00
tsutsui fd5c63296f Fix some attach messages for new ahc(4). 2003-10-18 07:44:51 +00:00
dyoung 5dca575ce1 ieee80211_newstate() wants for ic->ic_state to equal the previous
state, so do not update ic->ic_state in wi_newstate() before calling
ieee80211_newstate(). Instead, update ic->ic_state when we do not
let ieee80211_newstate() run.
2003-10-17 03:58:23 +00:00
dyoung d531221c67 Prepare for wi rate adaptation. Add wi_write_txrate, which only
writes a hardware register when the data rate selection actually
changes. Add wi_cfg_txrate, which writes the data rate selection
regardless.

Name some fields in the wi Tx buffer which we will use for rate
adaptation.

Name the Prism "Alternate Retry Count" RID, WI_RID_ALT_RETRY_COUNT.
2003-10-16 10:57:35 +00:00
dyoung 50daf0a217 The upper & lower bounds on wi RSSI are completely bogus, AFAICT. 2003-10-16 10:38:07 +00:00
dyoung 7c0b454d52 Cosmetic change: shorten 6 lines to 2. 2003-10-16 10:04:14 +00:00
dyoung 1ff3c191c9 Fix WEP transmission, too. From FreeBSD/Sam Leffler. 2003-10-16 09:31:08 +00:00
dyoung bcde77e394 ath(4) failed to detect when the number of DMA segments exceeded
the number of descriptors, because of a disparity between the
bus_dmamap_load_mbuf implementation in FreeBSD and NetBSD. Now I
cover up the difference using ath_dmamap_load_mbuf.

Thanks Enami Tsugutomo for diagnosing this.
2003-10-16 09:13:30 +00:00
ichiro 581dfca276 add {shutdownhook,powerhook}disestablish() 2003-10-16 07:55:18 +00:00
itojun a4a1466cb5 add $NetBSD$ 2003-10-15 23:23:39 +00:00
enami 73473f6883 Return 0 on SIOC{ADD,DEL}MULTI. 2003-10-15 22:41:22 +00:00
itojun d587f445de s/printf/DPRINTF/ for ath_rate_ctl() 2003-10-15 22:19:31 +00:00
bouyer 70b50b0608 Make sure chp->atabus is initialised, and wakeup the right address when
shutting down the kernel thread.
2003-10-15 20:29:26 +00:00
bouyer ea6912c52d - don't ignore last bit when checking for floating bus value on slave
device; some ATAPI devices as master will report 0x7f in all registers
  for slave before reset
- For the same reason, remove the er1 check.
Makes slave device with a "strange" ATAPI master probe again.
Problem reported and fix tested by Gary Duzan on current-users.
2003-10-15 20:26:33 +00:00
bouyer 3d6919754d Clear chp->ch_drive[i].drive_flags if we didn't find a driver for the
drive.
2003-10-15 19:54:30 +00:00
dyoung e86c830f2a Fix WEP reception. 2003-10-15 11:40:07 +00:00
simonb 662c7128cd Re-order a little so that there's no unreachable code in this block. 2003-10-15 07:18:17 +00:00
enami 8823a8da9a Port multicast handling to NetBSD. Addresses PR23151. 2003-10-15 03:04:03 +00:00
dyoung f2a9708c75 Do not index arrays using enum constants, since enums can be
re-ordered and extended. Instead, use a switch-statement or a
key->value table with appropriate bounds-checking.
2003-10-14 23:13:44 +00:00
ichiro f4f7b1ae5c add support ath on cardbus
- implement power management
2003-10-14 17:47:03 +00:00
dyoung 031c2c9baa Why don't I make up my mind? No need to left-shift the country
codes when I right-shift the country-code register! Fixes a bug
reported by Dan Carosone: regulatory domain "ETSI" registered as
domain "Spain/Other", so he could only tune channels 10 and 11.
2003-10-13 16:35:49 +00:00
dyoung 2295b27590 Install athioctl.h, defining ioctls for Atheros 802.11a/b/g radios. 2003-10-13 08:29:48 +00:00
dyoung 372fd2b92a Adapt atw(4) to the new 802.11 layer.
Simplify atw_start, atw_newstate.

Synchronize access to atw_start by bracketing the call to
ieee80211_next_scan in atw_next_scan with splnet()/splx().
2003-10-13 08:22:19 +00:00
dyoung e31cc884ed Adapt awi(4) to the new 802.11 layer. 2003-10-13 08:10:48 +00:00
dyoung ef743c64b6 Switch wi(4) to the new 802.11 layer. 2003-10-13 08:07:21 +00:00
dyoung 2459b02669 Switch an(4) to using the header files in the new 802.11 layer. 2003-10-13 06:45:32 +00:00
dyoung a71225fe22 NetBSD/FreeBSD compatibility changes NetBSD, especially
locking, mbuf
2003-10-13 05:34:30 +00:00
dyoung ae577fc6ea Miscellaneous changes for NetBSD compatibility. 2003-10-13 05:23:07 +00:00
dyoung b495f27bbd A compatibility layer to smooth differences between NetBSD and
FreeBSD for ath(4).

XXX    Nobody with FreeBSD has signed off on this, so it may change
XXX    or go away entirely.
2003-10-13 05:16:20 +00:00
bouyer c298ea9fc9 Remove block that has been pasted twice. Pointed out by Alexander Yurchenko. 2003-10-12 19:28:50 +00:00
fvdl 7a26a8b8f5 Don't zap the lower 16 bits of the command/status register when clear
error bits.
2003-10-10 15:15:44 +00:00
briggs 85edb66218 Properly clear any latched errors before re-enabling SERR/PERR for PCI-X
in ahd_reset().
2003-10-10 15:02:08 +00:00
bouyer 0ea3fa883e Remove the check for WAIT+POLL+READ case in __wdccommand_start(),
this case is already handled in __wdccommand_intr().
Pointed out by Charles M. Hannum.
2003-10-09 18:40:19 +00:00
bouyer 7719e83c8b Following Matt Thomas's request, rename ata attribute to ata_hl, and
wdc_base to ata. We can now have
atabus* at ata?
in kernel config files.
2003-10-08 20:57:59 +00:00
pk ded7383371 In isp_fc_worker() reduce the timeout value used to poll for the link
status from 10 seconds to 250 milli seconds for the second and subsequent
attempts to determine the link status. This prevents unnecessary long
stalls after the device attach routines have completed.

Tested on a dual port QLogic 3212.  Approved by mjacob@feral.com.
2003-10-08 19:51:01 +00:00
fvdl 61834e8959 Cap the transfer size at MAXPHYS, the driver won't get bigger requests
than that. Allocating 16M per SCB is silly (as pointed out by
Frederick Bruckman).
2003-10-08 17:38:31 +00:00
bouyer 99d6009c2a Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
2003-10-08 10:58:12 +00:00
mycroft 32856df936 We really don't need to do 2 resets in wdc_channel_attach() -- the one done
by wdcprobe() is enough.
2003-10-08 08:47:58 +00:00
fvdl f4f3bc1663 OR in ahc->sc_dmaflags when passed to bus_dmamap_create() in ahc_alloc_scbs(),
in order to pass _ISADMA_32BIT if needed. Should fix SCB allocation
failure for 2842 VL cards.
2003-10-07 19:11:13 +00:00
martin 9e16642238 Adapt to recent PRI changes. 2003-10-07 19:02:36 +00:00
dyoung c3139592cc Initial import of ath(4) from FreeBSD. 2003-10-07 05:27:17 +00:00
bouyer 3e1a342dd1 Revert to polling for ata_get_params() in wdc_channel_attach().
When probing a nonexistent slave, we may timeout waiting for an interrupt.
In __wdccommand_start(), for polled data in commands, abort quickly if
status still read 0 after 400ns (for a nonexistant slave, the
command will either be aborted, or the status register will report 0; for
a real device we should have BSY, DRQ or ERR).
Thanks to Alexander Yurchenko for reporting the problem and testing the
fix.
2003-10-06 21:51:31 +00:00
dyoung 865b1e786b For memory-mapped access, get the endianness right on big-endian
hosts.  This makes awi work marginally better (although it's still
broken) on my Powerbook.
2003-10-04 22:04:36 +00:00
pooka dae7af8b24 Ready the kernel side of i4b for primary rate interface support by
removing assumptions that there are only two B channels and by
adding support for a varying number of channels.

Due to this, rename previously used isdn identified "bri" to "isdnif",
which better describes the current situation.
2003-10-03 16:38:44 +00:00
fvdl 7baac02537 Reenable negotiation by default for discovery commands, until I figure out
what the issue is.
2003-10-01 18:01:06 +00:00
itojun c6eceb7a58 avoid out-of-bounds memory access (array size out of sync). found by
openbsd 'bound' attribute.
2003-10-01 08:07:39 +00:00
briggs 701f5ff4ba Make sure that we don't blow away the enables in ahd_reset() on PCI-X. 2003-09-30 12:34:16 +00:00
wiz 37ac1db454 available, not avaliable. From miod@openbsd. 2003-09-29 09:50:21 +00:00
cube e57b040603 Change the way of setting a port value so that a change too small to
fit in the number of bits used for the port still does something.

This fixes PR pkg/18741 for ac97-based hardware. Other audio drivers
might need a similar fix.
2003-09-28 22:24:09 +00:00
kent 1bea39944d codec id for AD1985 2003-09-28 15:39:09 +00:00
tls d0ffab287c Remove NOSETTLE flag from channel in FibreChannel case. It makes sense that
it should be there, but in practice, on some systems an ugly race condition
rears its head: SCSI commands are issued before the FC thread ever runs, and
fail from then on forever.  Yuck.
2003-09-27 03:43:08 +00:00
wiz db579612f4 Definition, not defintion. From miod@openbsd. 2003-09-26 22:25:21 +00:00
simonb 5c54e29374 Cast through (void *) to appease gcc3. 2003-09-26 16:02:24 +00:00
mycroft eefae40298 Hide the use of config_interrupts() in one place. 2003-09-25 19:29:48 +00:00
pooka a99f02d0ee Add a driver for the CAPI-compliant AVM B1/T1 cards.
The driver backend is capable of supporting also ISA cards (no DMA)
and primary rate (PRI) cards in addition to the basic rate ones,
but I don't any to test on right now, so we don't support those
currently.

This code was originally written by Juha-Matti Liukkonen <jml@cubical.fi>
of Cubical Solutions Ltd. for FreeBSD, and was ported to NetBSD by
myself for the same company.
2003-09-25 15:53:26 +00:00
bouyer 703c60f5c6 Don't print modes we are using if we don't know which modes are really used. 2003-09-25 09:38:09 +00:00
martin d505bdda83 Fix rx buffer size bitmask, do not explicitly set burst length and use 1536
bytes buffers, so this driver can finally cope with full size ethernet
packets. From Peter Bex.
2003-09-23 19:37:39 +00:00
bouyer 5a2aac1c7c Fix a typo that prevented pre-ata drives from working since 1999. 2003-09-23 16:27:10 +00:00
mycroft f9d629fb93 Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.
2003-09-23 09:19:22 +00:00
enami a7c2135a0c Correctly resurrect the style in previous. While I'm here, also removed
whitespace at the end of line in comment.
2003-09-21 11:56:40 +00:00
bouyer c6beeca692 Since we can't detect ghost drives in the wdc back-end, resurect
WDC_CAPABILITY_SINGLE_DRIVE.
2003-09-21 11:14:00 +00:00
bouyer d9ce986b70 Remove the "Register ghost test". It won't work, because on ATA register
of both devices are written, and device 0 will respond for device 1 if
device 1 isn't present. Pointed out by Quentin Garnier.
So the only way to know if device 1 is there or not is to send a command, which
is done later.
Detecting the second device here isn't important and won't speed up the probe.
We just need to know if there is at last one device on the bus.

Fix PR kern/22869 from Julio M. Merino Vidal.
2003-09-20 21:42:47 +00:00
christos 5508d7c9b8 print the name of the driver that found the ghost 2003-09-20 07:07:39 +00:00