Commit Graph

4618 Commits

Author SHA1 Message Date
dsl
1b3b0fe4f7 include sys/cdefs.h before opt_xxx.h 2007-07-19 22:18:54 +00:00
dyoung
1f1797c9c0 Suppress spurious timeouts and avoid wedging in OACTIVE state:
1 Set or clear OACTIVE as transmit buffers are depleted or
        replenished, respectively.  Do not use 802.11 acknowledgements
        as a criteria for clearing OACTIVE.

        2 Let each transmit queue count down to timeout independently,
        and get rid of the shared countdown (sc_tx_timer).  When
        we add a packet to a transmit queue, restart the queue's
        countdown.  Stop a transmit queue's countdown when the
        queue empties.
2007-07-17 01:26:17 +00:00
ad
bba99c25aa Generic soft interrupts are mandatory. 2007-07-14 21:02:36 +00:00
martin
70b0dadb9c Do not stop a callout before it is initialized. 2007-07-12 17:42:17 +00:00
he
6b95c79e89 Adapt to the new signature for callout_init(). 2007-07-11 19:15:02 +00:00
ad
7a863e51a0 Adjust to match callout_init signature change. 2007-07-10 22:53:29 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
mjacob
cbd714c116 Oh, dear, I didn't have an i386 or amd64 up and running and
missed a LITTLE ENDIAN version of a define.
2007-07-08 05:22:33 +00:00
mjacob
3ee1a2adaa Do a number of 24XX related fixes: fix the actual getting of initiator
status correctly (which we never were doing before). Add an underrun
checker for 24XX. The process of sorting this out led to a whole bunch
of endian surprises that had to be dealt with. Fix NVRAM endian issues
for the 24XX as well.

Do a little 2200 related cleanup- in particular, turn off complaints about
not finding a fast posting handle when running with RIO enabled- we are
somehow getting duplicate completions in this case. If we ignore them and
don't complain, all is well, and we actually start averaging > 2 commands
completed per interrupt.
2007-07-07 00:49:48 +00:00
xtraeme
edbf497407 mfi_sensor_gtredata:
- There's no need to set edata->units again, it was set already before.
- Remove the last ENVSYS_SVALID assignment that overrides previous
  assignments (found by mhitch@).
2007-07-04 17:07:04 +00:00
xtraeme
50094295cc ug_gtredata: add another break in the default case. Just for consistency
with other code.
2007-07-03 09:40:28 +00:00
xtraeme
93edd2a3c9 ug2_gtredata: add missing break in default case. 2007-07-03 09:32:05 +00:00
xtraeme
f77ec0c18c Winbond W83627EHF-A support, from OpenBSD. 2007-07-02 17:49:47 +00:00
xtraeme
a5d1788b65 ug*_gtredata: use the edata pointer rather than using the edata array
index.
2007-07-01 21:28:34 +00:00
xtraeme
4a7e371eab There's no need to use another envsys_data_t pointer that points to
the sensor specified in the softc, use edata passed in by the gtredata
function. Also remove a line of code that is not needed anymore with
envsys2.
2007-07-01 11:46:54 +00:00
xtraeme
4510a124e4 There's no need to set ENVSYS_FMONNOTSUPP in sensor's flags anymore,
userland limits for this type of sensor is disabled by sysmon_envsys(9).
2007-07-01 11:35:31 +00:00
xtraeme
bb8e671373 Imported envsys 2, a brief description of the new features:
(Part 2: drivers)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 08:29:48 +00:00
xtraeme
da3f163bd2 Imported envsys 2, a brief description of the new features:
(Part 2: drivers)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 07:37:12 +00:00
tsutsui
8dedfc4041 - avoid possible NULL pointer dereference in error path
- call Debugger() only #ifdef OSIOP_DEBUG
Partially from OpenBSD.
2007-06-30 19:35:08 +00:00
tsutsui
25f9eea68b Use more TAILQ macro. From OpenBSD. 2007-06-30 19:24:30 +00:00
tsutsui
b00d562b51 Backout previous; defer bus_dmamap_sync(9) op against data buffer instead.
XXX ews4800mips (which has 128byte L2 cacheline) still has
XXX some problem in sd_read_capacity() on some unclear condition.
2007-06-30 14:56:48 +00:00
tsutsui
8c07627095 Copy SCSI command before bus_dmamap_sync(9) PREREAD ops against
data xfer buffer because command and data buffers might be in
the same cacheline.
2007-06-30 14:32:50 +00:00
tsutsui
8df8a6ae3f Rather than preparing DMA map for SCSI command (which is
less than 16 bytes) of each SCSI command block (acb), just
prepare DMA safe buffer in struct osiop_ds and copy commands
into the buffer on each transfer to save resources and
reduce small and unaligned cache flush ops.

As a side effect, sizeof struct osiop_ds (DMA safe data buffer)
is now 256 bytes (including padding) so it could be more
cacheline friendly on bus_dmamap_sync(9) ops.

Tested on Express5800/230 (arc) and EWS4800/360AD (ews4800mips),
and no visible performance difference on bonnie.
(hppa and mvme68k are untested)
2007-06-30 14:08:58 +00:00
mhitch
6fc4ae964e CAC_GET4() was incorrectly defined, fix it. Not used currently, but bio(4)
support I'm working on does.
2007-06-27 17:57:55 +00:00
mjacob
959a8b2a95 When loading firmware for the 23XX and 24XX cards and DMA'ing it from
the request queue, remember to convert it to little endian format.
2007-06-26 21:00:18 +00:00
bouyer
deb08fe320 We're not ready to handle ATAPI yet so just claim there's no drive to the
upper layer. This should work around a NULL pointer dereference when
an ATAPI device is detected on a AHCI device.
2007-06-25 20:58:07 +00:00
christos
5568917ed8 PR/36538: Greg A. Woods: fix printfs to match driver name. 2007-06-24 19:07:00 +00:00
fvdl
fc625d2eff * Add bus_dmamap_sync calls for cmd structure.
* During initialization, use the right port index when setting up the
  physical pointers for a port. Fixes issue with non-contigous ports.

Reviewed by Manuel.
2007-06-21 11:32:54 +00:00
tsutsui
d851aeff1e Set DCR_TFT[01] and DCR_RFT[01] bits of DCR register for TX/RX thresholds
in each MD attachment since optimized values could be machine dependent.
2007-06-08 17:08:46 +00:00
briggs
f82d990bc1 Bring in changes from FreeBSD...
* Allocate commands on-demand.
* Update a bunch of constants and some structures.
* Use __attribute__ ((__packed__)) instead of __packed to be consistent.
* Support more commands for devices that can apparently handle them.
* Support a "new comm. interface" present in more recent Adaptec
  firmware.  This reduces the amount of PCI bus traffic in handling
  commands.
* Support larger commands going to the adapter--if the adapter can
  support them.
* Support 64-bit commands for archs where sizeof(bus_addr_t) > 4 and
  for adapters that advertise SGMAP64.
* Handle the WINDOW4G option and NO4GB quirk by excluding 2G-4G window
  unless we have the WINDOW4G capability without the NO4GB quirk.
* Ask the adapter more about its capabilities and try to use those if
  they seem sane.
* Do our bus_dmamap_sync() inside dequeue_fib instead of following,
  since we have the information that we need there.
* Provide access functions for some adapters that I haven't seen yet
  (MIPS-based "Rocket" adapters).  Not yet used.
2007-06-05 04:04:13 +00:00
tsutsui
a2d77b96dc In sonic_reset(), make sure to stop TX, RX and timer
and clear and disable all interrupts.
Required by mac68k obio sonic cards, and
no bad side effect on arc jazzio sonic.
2007-06-02 10:48:24 +00:00
tsutsui
8964fdca7a Sync tda_status and rda_status DMA descriptors also after they are polled
in interrupt handlers for systems which don't have BUS_DMA_COHERENT support.
2007-06-02 06:41:34 +00:00
dyoung
57e4ee7cd0 Fix rtw(4) on NetBSD/macppc: use bus_space_write_region_stream_4()
instead of bus_space_write_region_4() to write WEP Rx keys to the
NIC.  Thanks macallan@ for detecting the bug and testing the fix.
2007-05-29 18:38:20 +00:00
dyoung
58c85a01d2 Cosmetic: simplify a memset() statement, use __arraycount(), and
remove a gratuitous return statement at the end of a void subroutine.
2007-05-29 18:33:38 +00:00
dyoung
85c572c7f9 Simplify multicast filter programming, and take care to avoid
gratuitous device resets when the kernel adds/deletes a multicast
address.
2007-05-29 18:32:07 +00:00
briggs
f5462cf43d Clear interrupt status at once instead of piecemeal.
Enable a few more bits in the I/O requested by ld and check for the fast
response bit when reading back from the queue.
Both changes come from reading the FreeBSD driver and testing on a Dell
CERC SATA controller.
2007-05-26 18:10:46 +00:00
briggs
a21419937e Import code from FreeBSD to tell the controller how much physical RAM the
system has.  This has the (scary-because-we've-been-running-so-long-
without-it) commit message (for the first version of the change):
        Tell the controller how much physical memory we have.  Without this
        there was a chance that our DMA regions would collide with the
        memory window used by the cache on the controller.  The result would
        be massive data corruption.  This seemed to mainly affect systems with
        >2GB of memory.
2007-05-26 12:45:02 +00:00
tsutsui
19c950bfd5 Fix a typo in RFACT of the second 3.3Vcc of W83627EHF. From OpenBSD. 2007-05-26 04:19:29 +00:00
briggs
ffe5a7921a Don't use pointers in device structures.
Bring in some newer stuff for the init structure from FreeBSD.
2007-05-26 02:09:40 +00:00
mjacob
f0b57d5f54 Major update to isp(4) driver to bring it in line with external sources.
The major changes are:

 + 4Gb (24XX) card support
 + Rewritten fabric and loop evaluation code
 + New f/w sets

The 4Gb changes required major rototilling, which caused a rewrite of
fabric and loop eval code. The latter can now be set up to tune for
dynamic device arrival/departure if the framework is set up for it,
or to be firm about waiting for devices.

Testing has been principally on amd64, i386 and sparc64 and seems to
not have broken things for me.
2007-05-24 21:30:41 +00:00
briggs
4208391f45 Some changes from the FreeBSD driver:
* Include definitions of adapter-initiated fibs.
* Send aifs back to the adapter after we receive them.
* Use indexes instead of pointers in 32-bit hardware registers.
* If we get a message that there's a printf from the adapter, but we have
  a NUL in the first character of the printf string, change the NUL to a
  space.
2007-05-24 15:07:47 +00:00
rumble
b1a93d335f Fix comments about the cf_flags layout and use macros to test whether
tags, sync, and disconnect/reconnect are to be disabled or not.
2007-05-21 19:25:54 +00:00
rumble
305139637d Check in a workaround before I lose or forget about it:
My SGI issued IBM DORS-32160 will respond to every message with a sync
negotiation (even IDENTIFY) until it gets a response it likes (and it
definitely doesn't like async). Unfortunately, this locks us into an endless
loop after sending IDENTIFY, since the device responds with a SYNC
negotiation that we refuse to accept. This refusal results in a new
target-initiated sync negotiation, and so on...

To work around this, permit negotiating sync mode on an unexpected
target-initiated sync negotiation.
2007-05-21 18:56:32 +00:00
joerg
1044d56390 If the interrupt status register reads as 0xffff in rtk_intr, assume
that the card is gone and abort the loop. This fixes hot-plugging of
cardbus cards.

From FreeBSD's rl(4).
2007-05-18 14:10:37 +00:00
joerg
a6f33abf23 Make rtk_list_tx_init return void. The return value was constant and
never used.
2007-05-18 14:08:57 +00:00
bouyer
920d7a6afe Split the ahcisata driver in pci front-end and bus-independant back-end. 2007-05-12 11:04:58 +00:00
tsutsui
25476aa317 Pull a fix for PCIe variants from FreeBSD's if_re.c rev 1.71:
> - With the PCIe devices, it looks issuing a TX command while there's
>   already a transmission in progress doesn't have any effect. In other
>   words, if you send two packets in rapid succession, the second one may
>   end up sitting in the TX DMA ring until another transmit command is
>   issued later in the future. Basically, if re_txeof() sees that there
>   are still descriptors outstanding, it needs to manually resume the
>   TX DMA channel by issuing another TX command to make sure all
>   transmissions are flushed out. (The PCI devices seem to keep the
>   TX channel moving until all descriptors have been consumed. I'm not
>  sure why the PCIe devices behave differently.)
2007-05-10 14:04:47 +00:00
xtraeme
59000b719e Missing __KERNEL_RCSID(). 2007-05-08 17:17:14 +00:00
xtraeme
ff1c414804 Split the ug(4) driver in three components:
* dev/ic/ug.c (main code shared by the attachments)
	* dev/isa/ug_isa.c (isa attachment)
	* dev/acpi/ug_acpi.c (acpi attachment)

That means that ug(4) can now be attached via ACPI.

Thanks to Mihai Chelaru for the good work.
2007-05-08 16:48:37 +00:00
rumble
f2bf28e11c Report whether we're using DMA and what type on attach, since I keep losing
track while testing.
2007-05-08 02:08:17 +00:00