Commit Graph

1727 Commits

Author SHA1 Message Date
dante 8c999651eb Change adw_isr_callback() status handler
Add a catch for DMA Error which show up on Intel 82443BX Host Bridge/Controller (rev. 0x03). This doesn't fix the problem, but reset the SCSI bus and reinitialize the host adapter
Minor cosmetical changes

Thanks a lot to Greg Oster and Andan Lauber
2000-05-10 21:22:34 +00:00
pk 1bf775b965 Conform bus_dmamem_{alloc,map} usage to bus_dma(9) specs. 2000-05-09 22:42:08 +00:00
explorer 6b66bf5d80 set paa_busname to pcmcia, like the i82365.c driver does. 2000-05-08 19:44:34 +00:00
dante 6644e670f7 Change the way ADW_CARRIER is allocated and handled.
Increased ADW_MAX_CCB to 63 and ADW_MAX_CARRIER to 253
Print WDTR/SDTR negotiation result per target
Protect AdvISR() inside splbio()/splx() pair
Add a pending queue to keep track of all the CCBs that are being executed by the host adapter.
Rewrote timeout handler in a more efficient way:
    After 3 timeout now the SCSI is resetted and all pending queues not completed are now reenqueued in the waiting queue so to get executed just after the BUS Reset (hoping that resetting the SCSI BUS and reinitializing the adapter could solve the problem).
2000-05-08 17:21:33 +00:00
mycroft f5bd37be57 Make the SPARC audioamd driver at least *compile*. Well, the C code, that is.
*sigh*
2000-05-08 02:44:31 +00:00
martin 41dc1a6839 Avoid stomping on the W0_CONFIG_CTRL register which seems not to be
implemented on EISA cards. This makes a 3Com 3C597 Fast Etherlink TX
work for me at last, fixing PR kern/7067.
2000-05-07 14:03:25 +00:00
wiz 7392f90215 multiple inclusion protection 2000-05-07 03:01:58 +00:00
wiz 006e9528a1 install bt8xx.h for bktr 2000-05-07 00:29:03 +00:00
wiz c2f780fbfd Import of (finally busspaced) bktr-driver from FreeBSD (part 2).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
2000-05-07 00:17:13 +00:00
soren 6a1547768c Typos. 2000-05-06 00:44:00 +00:00
matt 2b44ae84ee LP64 printf fix. (I wish size_t was unsigned long on all platforms). 2000-05-05 17:52:38 +00:00
bouyer 904ca34539 Ops, restore sync/wide parameters after a reselect.
Also, better handling of parity errors.
2000-05-05 09:32:48 +00:00
bouyer 4c9516aa3b Rework the command queue, to avoid having commands blocked at the end
of the queue. Load is now properly balanced across all disks of the same bus.
2000-05-05 09:05:44 +00:00
ad fc89ce9f53 Oops, nuke unused structure member. 2000-05-04 17:27:25 +00:00
bouyer 2306b4a34e When a WDTR message is rejected, initiate sync negotiation anyway.
When a SDTR message is rejected indicate that target is async
Add a missing bus_dma_sync call.
2000-05-04 17:18:27 +00:00
bouyer f5b572d26b - LP64 issues in debug printfs.
- on a phase mismatch, do byte recovery only if we were in data phase.
  Otherwise just clear the fifo.
- Properly handle reject of a sync or wide negotiation.
2000-05-04 16:56:13 +00:00
thorpej b29178acf3 Remove unnecessary junk on #undef line that some C preprocessors
get cranky about.
2000-05-03 19:19:04 +00:00
thorpej e37397c2e8 `typedef void ifnet_ret_t;' isn't valid C -- use #define, instead. 2000-05-03 19:17:54 +00:00
thorpej ab635a46d3 Slight change to previous. 2000-05-03 19:15:27 +00:00
thorpej 2d66ccbd13 Don't return an uninitialized error code. 2000-05-03 18:58:37 +00:00
thorpej 01e8438aa8 Fill in ccb->ccb_req.sgcount with the value that's guaranteed to
be initialized.
2000-05-03 18:58:15 +00:00
bouyer 3bb9a5f666 - do sync/wide negotiation
- use a circular queue for the start slots, so that order has better chances
  to be preserved.
2000-05-02 19:03:02 +00:00
augustss f9dbbf4c92 Make am7930 driver machine independent. PR 10032 from Gregory McGarry. 2000-05-02 06:30:49 +00:00
tsutsui 9498452c05 - Move some initialization into MI rl_attach() from each bus attachment.
- Use proper CARDBUS_* macro in if_rl_cardbus.c
- Use product ID read from PCI configuration space rather than from EEPROM
  in if_rl_pci.c.

Patch sent from Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp> and
some cosmetic changes by me.
2000-05-01 15:08:50 +00:00
soren ac6e6c980d Add Seeq 8003 register definitions. 2000-05-01 08:06:17 +00:00
dante 1dbea6c0f9 Add new microcode for all of the supported boards.
Fix minor glitches.
Add preliminary support for ASB-3940U3W host adapters; it might work w/ autotermination on.
ASB-3940U3W support is not yet tested due to lack of board.
2000-04-30 18:52:14 +00:00
tsutsui 439b360ab9 Modify EEPROM read functions and handle also 9356 EEPROM.
Fixes kern/9861.
2000-04-30 12:00:40 +00:00
is 4cacfc5684 change 10base-t media _setting_ to set autodetect instead.
Contrary to what the rtl8019 docs say, this seems to be necessary.
Observed by myself when implementing non-auto earlier, and independently
complained about by Antti Kante in PR 9962.
2000-04-28 17:49:03 +00:00
augustss 308fa27a0d Unmute some mixer controls by default. From OpenBSD. 2000-04-28 12:39:59 +00:00
bouyer fcf693203f More big-endian fixes from Izumi Tsutsui. 2000-04-27 16:49:07 +00:00
bouyer bf7a94ec2b Fix copyrigth notice. 2000-04-27 14:06:57 +00:00
bouyer ce7f4dafe1 Big-endian fixes from Izumi Tsutsui. 2000-04-26 20:00:31 +00:00
ad d5d441a516 - Bump xfer size limit to the maximum allowable.
- 20 CCBs is enough to maintain a constantly stuffed inbound FIFO.
2000-04-26 15:58:01 +00:00
ad 75bb77ed56 - Rearrange some spl*() calls to be as intended.
- Scan cac_cd in cac_shutdown(), don't use a SIMPLEQ.
2000-04-26 15:54:02 +00:00
tsutsui b4f524c223 - Allocate mbuf dynamically on Tx and use bus_dmamap_load_mbuf(9).
- Call bus_dmamap_sync(9) as appropriate.
- Leave only register declarations in rtl81x9reg.h and
  split other stuff into rtl81x9var.h.

bus_dma(9) code mostly taken from thorpej's if_rtp.c.
2000-04-26 14:02:34 +00:00
thorpej 8b8597dae0 Recognize the Crystal CS4297A codec, and add a couple of macros
to manipulate AC97 codec IDs.
2000-04-26 00:00:41 +00:00
bouyer eba93ce7d2 Ops, need to restore correct DSA value after a phase mismatch, we may have
been interrupted during a S/G operation.
2000-04-25 20:02:33 +00:00
bouyer 88be4752d0 - Change the script to start new commands in an asyncronous way, using
'command slots' in which the host can put command and wait for the script
 to start them
- Change siop.c to do full disconnect/reslelect, allowing as much as one
 command per target/lun to run in parallel.
- Fix bug in registers init where a board without BIOS would end at
  ID 0 (now the driver works on alpha too).
- better handling of messages, sending back a MSG_EXT_SDTR in response to an
  incoming MSG_EXT_SDTR, and MSG_MESSAGE_REJECT for unhandled messages.
- fix use of bus_dmamap_sync() and htole32().
- supports shared interrups
- change some int8 and int16 to int, for alpha and mips benefits ( suggested by
  Toru Nishimura)
2000-04-25 16:27:05 +00:00
tsutsui 6369b56c99 Fix two endian problems. rtk now works on macppc.
- Use le32toh() on reading rxstat from the Rx DMA buffer.
- rl_read_eeprom() should return EEPROM values in little endian
  when caller requires byte-stream data.

bus_dma(9) fixes are still on-going.

XXX rtk on macppc seems to make tons of CRC errors...
XXX Does it work fine on i386 or others?
2000-04-25 14:16:46 +00:00
tsutsui 6f9392b42a Merge changes of sys/pci/if_rl.c rev. 1.8->1.10. (from kern/9870)
Also remove unused pbase, vbase and PCI_CAP_PWRMGMT declarations.
2000-04-24 15:25:00 +00:00
bouyer 19ada4a82a Snapshot of work in progress: new driver for the NCR 53c8xx SCSI controller
(the name 'siop' is still being discussed, may change).
Only basic disconnect/reselect for now, no sync/wide negotiation.
Tested with 810A, 875 and 895 on i386 only.
The bus-independant part should also be able to handle the 53c720 and 53c770.
A new driver with enhanced script should appear for the 825/875/895 'soon'.
2000-04-21 17:56:58 +00:00
enami debe6e88b6 Calculate an offset of mailbox_in correctly by renaming BHA_MBO_OFFSET
to BHA_MBX_OFFSET and using it also for mailbox_in.  Since all mailboxes
should be placed in a single continuous memory due to a hardware limitation,
an offset of any mailbox can be/should be calculated using a same expression.
2000-04-19 02:39:12 +00:00
matt 0aae0cd7a6 only print packets if debug > 1 2000-04-16 17:03:42 +00:00
pk 321bc31690 Remove spurious splx() call. 2000-04-14 20:33:48 +00:00
mrg dfe176302c add some casts to (u_long) to shut up gcc 2000-04-14 08:22:49 +00:00
itojun ecb5f2e56a revisit in6_ifattach().
- be persistent on initializing interfaces, even if there's manually-
  assigned linklocal, multicast/whatever initialization is necessary.
- do not cache mac addr in the kernel.  grab mac addr from existing cards
  (this is important when you swap ethernet cards back and forth)
now ppp6 works just fine!

call in6_ifattach() on ATM PVC interface to assign link-local, using
hardware MAC address as seed.

(the change is in sync with kame tree).
2000-04-12 10:36:38 +00:00
haya e49807d100 Incorporate the changes of RL81x9 driver provided by M. Kanaoka
<kanaoka@ann.hi-ho.ne.jp>.  He separated the driver into IC specific
portion and bus attachment portion and added cardbus attachent.
2000-04-10 07:42:55 +00:00
thorpej 0ed7436590 Add a patchable variable `tlp_srom_debug' that enables dumping of
SROM output, etc.
2000-04-07 18:58:15 +00:00
mrg 952f1cf1d0 avoid using uninitalised variables inside WDCDEBUG. 2000-04-05 06:27:36 +00:00
mrg 36b65b7d48 return if we can't map DMA buffers 2000-04-05 05:54:02 +00:00
thorpej 5a41b5bf56 - if_tlp_cardbus.c: Use the `pmreg' pointer passed by by
cardbus_get_capability() [mirror change already made to if_tlp_pci.c]
- if_tlp_cardbus.c: If we don't find an ISV SROM, try to grab the
  Ethernet address from the CIS.
- if_tlp_cardbus.c: set CardBus cards to store-and-forward mode from
  the get-go.
- Put the TxThresh tables in tulipvar.h, and use them in the CardBus
  and PCI front-ends to go to store-and-forward mode.
- Document the Xircom X3201-3 clone a little more.
2000-04-04 19:22:50 +00:00
bouyer 77f1e5eb02 Add checks to detect busy-waits, conditionnal on new debug flag
DEBUG_DELAY (0x40). This will print how much time we did loop in wdcwait(),
if we had to read registers more than one time.
2000-04-04 12:43:13 +00:00
bouyer fcb3e9ddac Better fix to previous: delay(100) before the IDENTIFY, and if it fails
delay(1000000) and retry. The 1s delay is needed for some special case only,
no need to hang the machine for that long everytime (especially for PCMCIA).
2000-04-04 09:25:51 +00:00
cgd 1f0de7e7d2 actually put a _comment_ before the second read of the ident register
that Charles added in rev 1.58.  Not only is it good programming practice
to explain magic, but code that looks like:

                reg = pcic_read(h, PCIC_IDENT);
                reg = pcic_read(h, PCIC_IDENT);

is _gonna_ be interpreted as a cut-n-paste error by someone eventually.
2000-04-03 01:55:25 +00:00
mycroft b1c28384dc If the SROM size is to far out of range, issue a diagnostic and set the size
to 1Kb.  Some boards (e.g. my SMC9332) have a broken MicroWire interface.
2000-04-02 23:38:05 +00:00
thorpej dc680eb373 Slight correction to last: really only do it if it's a 21142 or 21143. 2000-04-02 19:02:34 +00:00
nathanw c0a4c9e67d Move bt463 code to dev/ic and adapt to the new ramdac interface.
Set default window type to 24-bit truecolor.
Correctly set pseudocolor mode.
2000-04-02 18:57:36 +00:00
nathanw c66f54d73d Adapt to change in ramdac interface. 2000-04-02 18:55:01 +00:00
nathanw 2b4ac6a7b9 Add ramdac_register() to interface structure. 2000-04-02 18:54:33 +00:00
mycroft e70fd4b33c During the socket probe, read the ident register twice.
I don't understand why, but sometimes the clone chips in hpcmips boxes read
all-0s the first time.
2000-04-02 18:29:14 +00:00
mycroft 229fcf5bbe When using MII on 2114[23] chips, zero the SIA TXRX register to disable the
internal Nway engine.  This fixed a major performance problem.
Thanks to Matt Thomas for pointing this out.
2000-04-02 17:23:33 +00:00
bouyer b2cd1f029a Bump delay() from 100 to 1000000 before attempting a IDENTIFY just after a
reset - solves a problem reported by cpg@aladdin.de.
2000-04-01 14:50:32 +00:00
bouyer 26f6c9a9cf - DMA code cleanup: pciide_dma_finish() doesn't stop/unload the current DMA op
if an IRQ was not detected, unless the force flag was given. Use this to
  detect if the IRQ was for us (closer to shared IRQ for controllers which
  don't have their own IRQ handler in pciide.c) and to poll for DMA xfer.
  Also makes the timeout recovery code simpler.
- ATAPI cleanup: don't call controller-specific functions from atapiconf.c
  (wdc_*), so that it's possible to attach an atapibus to something else
  than a wdc/pciide (Hi Lennart :).
  Overload struct scsi_adapter with struct atapi_adapter, defined
  as struct scsi_adapter + atapi-specific callbacks. scsipi_link still points
  to an scsi_adapter, atapi code casts it to atapi_adapter if needed.
  Move atapi_softc to atapiconf.h so that it can be used by the underlying
  controller code (e.g. atapi_wdc.c).
  Add an atapi-specific callback *atapi_probedev(), which probe a drive
  in a controller-specific way, allocate the sc_link and fills in the
  ataparams if needed. It then calls atapi_probedev() (from atapiconf.c)
  to do the generic initialisations and attach the device.
- While I'm there merge and centralise the state definitions in atavar.h.
  It should now be possible to use a common ata/atapi routine to set the
  drive's modes (will do later).
2000-04-01 14:32:22 +00:00
augustss 169ac5b3c1 Remove register declarations. 2000-03-30 12:41:09 +00:00
simonb 5a5c310fae Delete redundant decls of fxp_enable(), fxp_disable() - they're in
i82557var.h.
2000-03-30 02:06:17 +00:00
simonb 9e370d4402 Delete redundant decl of com_attach_subr(), it's in comvar.h. 2000-03-30 02:04:30 +00:00
simonb b75e08a514 Delete redundant decl of aicattach(), it's in aic6360var.h. 2000-03-30 02:02:53 +00:00
tsutsui c693409acb Nuke register declarations. 2000-03-29 13:57:51 +00:00
tsutsui ac8fa9c43d Remove "register" declaration. 2000-03-29 13:09:02 +00:00
ad 627a9ec886 Spelling error. 2000-03-29 12:02:01 +00:00
simonb 8a447f3757 Remove reduncdant decl of wdc_kill_pending - it's in <dev/ic/wdcvar.h>. 2000-03-29 03:56:53 +00:00
simonb bfb011b813 Remove duplicate ncr53c9x_dmaselect declaration. 2000-03-29 03:03:28 +00:00
kleink ba9bb9dcd5 Cosmetical nit in previous. 2000-03-27 17:00:50 +00:00
onoe 6daecf7901 Fix multicast filter to set IFF_ALLMULTI flag properly. Also clear
unused group address from filter.
2000-03-27 12:58:01 +00:00
onoe 720e17c11e Do not try to lock out MAC until the firmware correctly start up, to avoid
"awi: failed to lock interrupt" message when IRQ are shared with other
devices [PR kern/9660]
2000-03-27 12:54:59 +00:00
onoe ab9d324f37 backout changes between 1.10 and 1.12 to re-enable awictl stuff.
Actually, it is partially duplicated with SIOC[GS]IFMEDIA and
SIOC[GS]80211NWID ioctls currently supported.  But I'd like to leave it
until configuration interface for common 802.11 stuff will be cleaned up.
2000-03-27 12:52:45 +00:00
kleink 230876cf26 Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
  make them type-generic, which is necessary i.e. to operate on file offsets
  without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
  integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
2000-03-26 20:42:21 +00:00
soren 7b737d77b3 For Cobalt Networks 21143's, always use store-and-forward and toggle
a GPIO line to fully reset the PHY.
2000-03-26 10:53:39 +00:00
itojun 130ac9eafe don't call if_deactivate with NULL ifp.
sc->sc_ifp can be NULL if awi_pcmcia_attach() fails, so you will see panic
if you remove a card which fails on attach.
2000-03-26 10:09:33 +00:00
fvdl aa0f78b2f6 We can use openings = 16 here; this won't even exhaust the number of
allocated SCBs for 16 targets, and it's a noticeable difference.
2000-03-25 21:09:08 +00:00
fvdl 97688d9a83 Do simple tagged queueing, enabled by default. 2000-03-25 19:52:12 +00:00
tsutsui 9100212ef0 Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
2000-03-25 15:27:54 +00:00
ad b84aceb90d The bus_space stuff handles byte order conversions for us. 2000-03-25 13:38:35 +00:00
ad cefe92ae42 Remove paraniod debug check that was mistakenly committed. 2000-03-24 14:33:09 +00:00
hannken 43e3ea96f3 Fix typos from last commit (callout). 2000-03-24 11:46:46 +00:00
thorpej 75f3a36686 Remove bogus callout_init(), pointed out by soren@netbsd.org. 2000-03-23 17:51:51 +00:00
soren 2c88f0bb92 s/32-bits/32-bit/ (Hi Al!) 2000-03-23 15:04:49 +00:00
onoe 6654f3bc85 While am79c930 controller allows unaligned access, bus_space_read/write
must be aligned.  So awi_read/write_2/4 issues multiple bsr1/bsw1 when
unaligned.
2000-03-23 13:57:58 +00:00
enami dce7fa489c Fix a typo in comment in previous commit. 2000-03-23 08:20:06 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
onoe 3ae525eaa3 Sorry I forgot to commit this file.. 2000-03-23 06:04:24 +00:00
mycroft dcd265af9c GC unused variable. 2000-03-23 05:26:00 +00:00
mycroft e695f87102 Remove AWICTL stuff that is obsoleted by SIOC[SG]IFMEDIA and SIOC[SG]80211NWID.
Also, disable AWICTL completely until awictl.h appears.
2000-03-23 05:19:44 +00:00
ws 7da71e5f9e Make IPKDB working again.
Add support for i386 debugging and pci-based ne2000 boards.
2000-03-22 20:58:25 +00:00
ws 1b83998bd7 Add bus_space_barrier.
Add DELAY in some busy loops to allow the dma engine to actually do something
(neccessary on fast processors).
2000-03-22 18:02:59 +00:00
onoe 5644a7e248 Update awi driver, which now supports AMD 79c930 based 802.11 DS cards
as well as 802.11 FH cards.  Also, it can operate in infrastructure mode,
adhoc mode, and wi(4) (aka WaveLAN/IEEE) compatible adhoc mode.
2000-03-22 11:22:20 +00:00
mycroft b58a073f39 There's no need to frob cfg4/cfg5 in _attach(), since _reset() does it. 2000-03-22 03:27:56 +00:00
ad e32aed3c4e Pass xfer size to disk_unbusy(). 2000-03-21 19:47:59 +00:00
enami 83446dedc1 - Test the generic device active flag instead of home grown one.
- Test also it in wdcintr.
2000-03-20 22:53:36 +00:00
ad 424f6471cb - Remove dead code.
- Make synchronous writes optional, disabled by default (*way* too slow).
- Handle case where dm_nsegs > CAC_SG_SIZE.
- Fix a couple of silly bugs.
- Fix use of __attribute__((__packed__));
2000-03-20 18:48:34 +00:00