Commit Graph

3485 Commits

Author SHA1 Message Date
Matt Jacob
d81ba9d532 Make a static chain of isp softcs- gdb usage becomes a lot easier.
Add in a very large amount of target mode support code- this is just
a first pass at this. It's a difficult thing because some of the code
can be in platform independent areas (see isp_target.?) but a lot has
to be in platform dependent areas because of not only the tight coupling
of received commands/events and the specific OS subsystem but because
the platform independent code has (deliberately) no event/wait mechanisms.
2000-01-03 23:55:30 +00:00
Matt Jacob
ac1fd1487e Raise default FCP logintime to 60 seconds. Move the position
of where we could have seen the loop up at least once so it
makes sense. Change some stuff in ispscsicmd so we don't get
stuck there if the loop has never come up yet. Add in some
target mode support code.
2000-01-03 23:52:41 +00:00
Matt Jacob
9e11e5bea2 Support target mode operations. This involves having some variant
dma mapping callback routines to select from as target mode
entries are handled a fair bit differently from normal initiator
mode entries.
2000-01-03 23:50:13 +00:00
Matt Jacob
40b27503d8 Role platform minor revision. Add in some target mode only
private structure definitions.
2000-01-03 22:15:16 +00:00
Matt Jacob
f38e1372e5 add isp_print_qentry inline function 2000-01-03 22:14:24 +00:00
Matt Jacob
41593b2586 Roll minor revision number and add a more finalized list
of target mode related enums.
2000-01-03 22:13:40 +00:00
Matt Jacob
361959970f Add missing target mode flag and fix the RQSTYPE_CTIO0
to be CTIO as it should be.
2000-01-03 22:12:53 +00:00
Søren Schmidt
14fc459ef4 Fix link problem on ISA only systems.. 2000-01-03 20:01:18 +00:00
Bill Paul
73bf949c34 It appears that under certain circumstances that I still can't quite pin
down, the dc driver and receiver can fall out of sync with one another,
resulting in a condition where the chip continues to receive packets
but the driver never notices. Normally, the receive handler checks each
descriptor starting from the current producer index to see if the chip
has relinquished ownership, indicating that a packet has been received.
The driver hands the packet off to ether_input() and then prepares the
descriptor to receive another frame before moving on to the next
descriptor in the ring. But sometimes, the chip appears to skip a
descriptor. This leaves the driver testing the status word in a descriptor
that never gets updated. The driver still gets "RX done" interrupts but
never advances further into the RX ring, until the ring fills up and the
chip interrupts again to signal an error condition. Sometimes, the
driver will remain in this desynchronized state, resulting in spotty
performance until the interface is reset.

Fortunately, it's fairly simple to detect this condition: if we call
the rxeof routine but the number of received packets doesn't increase,
we suspect that there could be a problem. In this case, we call a new
routine called dc_rx_resync(), which scans ahead in the RX ring to see
if there's a frame waiting for us somewhere beyond that the driver thinks
is the current producer index. If it finds one, it bumps up the index
and calls the rxeof handler again to snarf up the packet and bring the
driver back in sync with the chip. (It may actually do this several times
in the event that there's more than one "hole" in the ring.)

So far the only card supported by if_dc which has exhibited this problem
is a LinkSys LNE100TX v2.0 (82c115 PNIC II), and it only seems to happen
on one particular system, however the fix is general enough and has low
enough overhead that we may as well apply it for all supported chipsets.
I also implemented the same fix for the 3Com xl driver, which is apparently
vulnerable to the same problem.

Problem originally noted and patch tested by: Matt Dillon
2000-01-03 15:28:47 +00:00
Søren Schmidt
aa966b9a64 Add support for VIA 82C596 controller
Better shared irq handeling for Promise & HPT366 controllers

Setup prober PIO mode timings on Promise & HPT366 controllers

Update Copyright headers to be Y2K compliant :)
2000-01-03 10:26:59 +00:00
Warner Losh
fe98624bbb Connect interrupts and start processing them. We panic on card removal
now, but we're getting interrupts!
o Add pcic_suspend/pcic_resume so we can detach our children on suspention
  and fix the state of the pcic on resume.
o Remove some unused parts of softc.
o Centralize resource activation/deactivation for pcic bridge chip in
  the stylistic pcic_activate/pcic_deactivate.
o Add bus_print_child method so we can see the pccard attachment.
o Add pcic_identify in an attempt to make it possible to automatically id
  the pcic devices.  This works great, but we cannot divine the irq to use
  from this method, nor the memory hole.  For the moment, KLUDGE irq to be
  10 and memory hold to be 0xd0000.
o Loose the pnp probe stuff.  This may be a big mistake, but it is easy
  enough to add back later.  I did this so the identify routines can do their
  thing unmolested by pnp information.  The whole identify thing may be a bad
  idea to be ripped out later.
o change return type of pcic_intr to void, make it static and ripple
  this through the code.
o Add explicit call to bus_generic_attach at the end of pcic_attach to
  get any children probed/attached.
o add some comments about future directions/questionable things being
  done at different layers, etc.
2000-01-03 06:45:16 +00:00
Seigo Tanimura
769309aaf2 Do not start/stop DMA transfer if it is already started/stopped. 2000-01-03 05:26:12 +00:00
Seigo Tanimura
f259d7eed5 - Handle an interrupt for csa primarily in the bridge driver,
then invoke the children. As the value of HISR can be read
  only once, pass the HISR to the children via struct
  csa_bridgeinfo, stored in the ivars of them.
- Clear the contents of serial FIFO upon stopping the DMA for
  playing. This may eliminate buzz on playing. Experimental.
2000-01-03 02:51:16 +00:00
Cameron Grant
43607766d6 revert buffer size to 64k 2000-01-01 21:50:20 +00:00
Gerard Roudier
a6fa47ec0d - Add device entry for the next generation of C1010 device
(pci dev_id 0x21).
- Start the SCRIPTS processor without resetting the SCSI BUS
  at initialization.
- Remove the "Host adapter CCB chain" (got useless given the
  new queuing scheme).
- Display correctly the state of SCSI signals, when SCSI BUS
  looks bad.
- Cosmetic changes in messages printed out at initialization.
- Notifications and messages on RESET conditions slightly
  reworked.
- TEKRAM 24C16 NVRAM support fixed (also reported ok).
2000-01-01 15:24:44 +00:00
Seigo Tanimura
f7e00c54d1 Correct the delay durations as in the sample sources provided by Crystal Semiconductor. 2000-01-01 09:07:03 +00:00
Peter Wemm
7d674827c8 Recognize the CSC0101 ID for the Thinkpad series.
PR:		15633
Submitted by:	gibbs
1999-12-30 20:07:20 +00:00
Peter Wemm
32ef0d3eb6 Attach the CS4610 PCI / CS4239 setup in isa compatability mode as CSC0100.
The PCI component is non-AC97 apparently.

PR:		15632
Submitted by:	gibbs
1999-12-30 20:04:11 +00:00
Greg Lehey
6bfed0f9c0 Don't forget the 'stripe' and 'mirror' keywords when we turn debugging
off.

Reported-by:	ppyy <ppyy@bentium.com>
1999-12-30 07:13:22 +00:00
David E. O'Brien
4d129adce5 Go ahead and take these off the vendor branch as Gerard Roudier is now
a committer and will be maintaining these in the usual manner.

Add $FreeBSD$'s to get them off on the right foot.
1999-12-30 06:19:10 +00:00
Cameron Grant
69cbc772d9 make ess cards use a 64k buffer again, by implementing esschan_init() 1999-12-30 04:04:43 +00:00
Cameron Grant
2635fee807 make es1373 chips with ac97 2.1 work on troublesome motherboards
Submitted by:	Russell Cattelan <cattelan@thebarn.com>
1999-12-29 05:44:17 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Cameron Grant
a0b57fb738 - latest 2ndbuffer patch
- make chn_setdir work for rec on isa cards
- note: es1371 does not irq in smp

Submitted by:	tanimura
1999-12-29 03:46:54 +00:00
KATO Takenori
6fb89845b4 Added following modes:
5in     HD 2 heads, 77 cylinders, 8 sectors/track, 1024 bytes/sector
 5/3.5in DD 2 heads, 80 cylinders, 8 sectors/track, 512 bytes/sector

Meanings of the rogrammer-readeble fd name were explained by Brian
Fundakowski Feldman and Peter Wemm in hackers list and NOKUBI
Hirotaka.

Reviewed by:	nyan
1999-12-28 07:38:38 +00:00
Peter Wemm
358746d7a8 Fix a panic when doing non-multiples of PAGE_SIZE or misaligned transfers
to a swap backed vn device.

OK'ed by:	dillon
1999-12-28 07:32:34 +00:00
Bill Paul
ed63a7aaef This commit adds device driver support for the ADMtek AN986 Pegasus
USB ethernet chip. Adapters that use this chip include the LinkSys
USB100TX. There are a few others, but I'm not certain of their
availability in the U.S. I used an ADMtek eval board for development.
Note that while the ADMtek chip is a 100Mbps device, you can't really
get 100Mbps speeds over USB. Regardless, this driver uses miibus to
allow speed and duplex mode selection as well as autonegotiation.
Building and kldloading the driver as a module is also supported.

Note that in order to make this driver work, I had to make what some
may consider an ugly hack to sys/dev/usb/usbdi.c. The usbd_transfer()
function will use tsleep() for synchronous transfers that don't complete
right away. This is a problem since there are times when we need to
do sync transfers from an interrupt context (i.e. when reading registers
from the MAC via the control endpoint), where tsleep() us a no-no.
My hack allows the driver to have the code poll for transfer completion
subject to the xfer->timeout timeout rather that calling tsleep().
This hack is controlled by a quirk entry and is only enabled for the
ADMtek device.

Now, I'm sure there are a few of you out there ready to jump on me
and suggest some other approach that doesn't involve a busy wait. The
only solution that might work is to handle the interrupts in a kernel
thread, where you may have something resembling a process context that
makes it okay to tsleep(). This is lovely, except we don't have any
mechanism like that now, and I'm not about to implement such a thing
myself since it's beyond the scope of driver development. (Translation:
I'll be damned if I know how to do it.) If FreeBSD ever aquires such
a mechanism, I'll be glad to revisit the driver to take advantage of
it. In the meantime, I settled for what I perceived to be the solution
that involved the least amount of code changes. In general, the hit
is pretty light.

Also note that my only USB test box has a UHCI controller: I haven't
I don't have a machine with an OHCI controller available.

Highlights:

- Updated usb_quirks.* to add UQ_NO_TSLEEP quirk for ADMtek part.
- Updated usbdevs and regenerated generated files
- Updated HARDWARE.TXT and RELNOTES.TXT files
- Updated sysinstall/device.c and userconfig.c
- Updated kernel configs -- device aue0 is commented out by default
- Updated /sys/conf/files
- Added new kld module directory
1999-12-28 02:01:18 +00:00
Warner Losh
f9fe4786ef Two nits and disable isa probe due to its overly agressive claiming of
devices.
o Return ENXIO from sn_isa_probe
o Fix SN_DEBUG printf
o Use IFQ_MAXLEN rather than 8

I'll fix the isa probe when I get access to a real isa attachment
device to test against here in a few days.

Overly agressive snagging behavior noticed by: phk
1999-12-28 01:07:16 +00:00
Matt Jacob
762fa8a53f Add in missing ENABLE TARGET MODE opcode. 1999-12-27 08:47:11 +00:00
Peter Wemm
9928855f97 Recognize the GVC0505 (GVC 56k Faxmodem) as a sio device.
Obtained from: Dan J Fraser <dfraser@capybara.org> (for NetBSD)
1999-12-27 05:02:25 +00:00
Peter Wemm
7c361b70c5 Fix a mistake in the PNP EISA-encoding of the Avance ALS120 id.
Submitted by:	Bryan Liesner <bleez@netaxs.com>
1999-12-26 10:51:47 +00:00
Mike Smith
b9256fe34e Fix the firmware build number output (again). 1999-12-25 01:45:22 +00:00
Doug Rabson
7e864cbf08 Don't pass u_int32_t pointers to BUS_READ_IVAR since it tends to make
alphas panic.
1999-12-24 16:22:45 +00:00
Mike Smith
1a5bb1b602 Cosmetic fix; get the firmware build code and customisation tag the
right way around.

Submitted by:	"Chris D. Faulhaber" <jedgar@fxp.org>
1999-12-24 07:04:23 +00:00
Bill Paul
c0cdcd0b3e Fix one bug and make one minor enhancement:
- In uhci_intr() check to see if sc->sc_bus.bdev is NULL, and if it is,
  ack any pending interrupts and disable them, then return. It is possible
  for interrupts to be delivered the moment a handler is set up at attach
  time in uhci_pci.c, particularly when attempting to kldload the usb.ko
  module after the system is already up. However the driver isn't ready
  to field interrupts at that time and certain pointers in the softc
  struct aren't initialized yet, and we invariably end up falling off
  the end of one of them. The effect is that kldloading the usb module
  will panic the system in uhci_intr(). This added sanity check stops
  this from happening: I can now kldload the usb.ko module without any
  problems and load/attach other USB drivers after it.

  Of course the uhci driver has no detach method, but that's another
  problem.

- In uhci_run(), set the UHCI_CMD_MAXP bit in the command register to
  allow 64-byte packets to be used for full speed bandwidth reclamation.
  Certain high speed devices (in this case the ADMtek USB ethernet
  adapter) require this bit to be set, otherwise babble errors occur
  at the end of large (between 1100 and 1500 byte) transfers. This
  should not affect other devices, although supposedly it is less efficient
  than the 32-byte setting. Unfortunately, this is a per-bus setting,
  not a per-device setting, so we can't just enable it for certain
  devices on the USB bus.
1999-12-23 05:18:58 +00:00
Warner Losh
b616727984 Newbusify the driver.
Add support, kinda, for megaheartz xjack nic cards.  This support
works well for one machine per ethernet segment because it hard codes
the MAC address.  The pccardd in -current doesn't have support to
parse the ethernet address from the CIS in the funky way that the
megaheartz card does things (it includes it in the info tuple, as
ascii, which is non-standard).  I'd rather kludge this for the moment
and work to read the CIS from the kernel rather than mess with
pccardd.

The isa attachment is untested.  The pccard attachment is known to
work since I'm committing over it.

Card Obtained from: Chris D. Faulhaber <jedger@fxp.org>
1999-12-22 08:44:13 +00:00
Mike Smith
9eee27f16d Updates resulting from new documentation from Mylex and some cleaning:
- Don't keep private copies of some of the data fields from the
   ENQUIRY and ENQUIRY2 commands.  Instead, standardise on the ENQUIRY2
   command for initial adapter information, and keep a copy of the entire
   structure.  Refer to it where appropriate.

 - Move all of the controller description functionality into a new
   function.  Print lots more controller data if bootverbose is set.
   Add knowledge of the DAC960 PR, PT, PTL0 and PRL controllers, rename
   the 960PTL -> PTL0 and 1100P -> 1100PVX.

 - Correctly terminate an error message.

The controller interface procedures have been reviewed against the
Mylex-supplied documentation; no changes appear necessary at this
time.
1999-12-22 01:21:28 +00:00
Matt Jacob
34b4347208 Oops- got the initiator and initiator/target f/w reversed for
the 1080/1240/1280 case.
1999-12-22 00:18:15 +00:00
Søren Schmidt
3ace5ae2c8 Yet another cleanup of the VIA code, this time it should work
on all combinations (I hope)...

Add DMA support for the AMD 756 chip (K7 chipset) this is actually the
same as the VIA 82C686 chip (the ATA part that is).

Treat the intel MX chipset PIIX as a PIIX4

Allow UDMA on all disks that say they can handle it.

Cleanup probe printf's a bit

Remove alot of the old #ifdef DEBUG crap.
1999-12-21 20:18:56 +00:00
Peter Wemm
2996751a32 Collapse a bunch of unused MD_CS42nn tags into a single one. This saves
going to a lot of trouble to identify it and set the tag and then not use
it.  Convert the pnp id matching to the preferred table based system.
@@@0001 (CMI8330 ldn 0) is a mss, not a SB.
1999-12-21 14:09:19 +00:00
Peter Wemm
93111ff410 Tidy up a few loose ends, including adding the pnp tags in comments.
Remove @@@0001 - it's an MSS, not a SB, at least according to the
original pre-sbc code and according to a pnpinfo report that Cameron has.
1999-12-21 14:04:14 +00:00
Peter Wemm
e9feccdcb4 Remove #if NISA > 0 - this is best done by the configuration process.
It had a heap of unreferenced stuff if there was no isa configured in the
system.
1999-12-21 13:55:46 +00:00
Eivind Eklund
369dc8ceb8 Change incorrect NULLs to 0s 1999-12-21 11:14:12 +00:00
Peter Wemm
684fb19e34 Extract a list of extra isa pnp modem ID's from NetBSD and OpenBSD. Some
of these are bound to have a PNP05xx compatid, but there's no easy way to
tell.  Since it's just an ID list and uses the pnp header's description
strings rather than encoding strings here, it doesn't seem to be too
expensive to err on the safe side.
1999-12-21 09:16:03 +00:00
Cameron Grant
9035ec00a0 minor cleanup
Parts Submitted by:	Ville-Pertti Keinonen <will@ztango.com>
1999-12-21 08:43:28 +00:00
Joerg Wunsch
e34c71ea40 Add a flag to disable FIFO probing. The code seems to have a chance of
misdetecting FIFO capabilities, at least on my girlfriend's Thinkpad 755,
the driver doesn't work using the FIFO.

While i was at it, i (partially) fixed option FCC_YE since it would no
longer have compiled at all under -current.  I've also made an attempt
to document the device driver flags value (ab-)used internally by this
option.

RELENG_3 candidate, but with a slightly different patch there (will go
to jkh in email).
1999-12-21 08:33:03 +00:00
Warner Losh
5882e70cb6 Delay creation of threads until after the idle thread is created, more
or less.  This is a kludge because there is no support for delayed
creation of threads early in the boot process.

NEWCARD new boots and the thread process starts and is visible from
ps.

Now, on to dev/pccard.
1999-12-21 08:32:15 +00:00
Eivind Eklund
4cb867eea6 Incorrect uses of NULL changed to 0 1999-12-21 08:24:35 +00:00
Eivind Eklund
2046577307 Remove unused variable 1999-12-21 08:20:36 +00:00
Cameron Grant
637e117737 don't use the sbpro mic vol register during init on ess cards; it causes
feedback and we use the native one elsewhere.
1999-12-21 06:18:03 +00:00