Commit Graph

72766 Commits

Author SHA1 Message Date
mycroft c09a793e93 Push atime/mtime updates even further -- into the reclaim path, so they happen
rarely in the normal case.  (Note: This happens at reboot/shutdown time because
all file systems are unmounted.)

Also, for IN_MODIFY, use IN_ACCESSED, not IN_MODIFIED; otherwise "ls -l" of
your device node or FIFO would cause the time stamps to get written too
quickly.
2004-08-14 14:32:04 +00:00
mycroft 5d31d187f3 Partially fix a performance problem in the partial-truncate case. We were
doing synchronous writes unnecessarily in a couple of places.  Now it's 1
write per truncate in my test case rather than 3.  :-P
2004-08-14 02:26:57 +00:00
mycroft 14ae52970e There is no need to do a synchronous write when truncating a short symlink. 2004-08-14 01:32:02 +00:00
mycroft 9f8efecd46 In the indirect block unwind case, we only need to do the synchronous writes
of the inode in the softdep case.  XXX This is really a deficiency in softdep.
2004-08-14 01:30:56 +00:00
mycroft bc25b30608 Add a new flag, IN_MODIFY. This is like IN_UPDATE|IN_CHANGE, but unlike
setting those flags, it does not cause the inode to be written in the periodic
sync.  This is used for writes to special files (devices and named pipes) and
FIFOs.

Do not preemptively sync updates to access times and modification times.  They
are now updated in the inode only opportunistically, or when the file or device
is closed.  (Really, it should be delayed beyond close, but this is enough to
help substantially with device nodes.)

And the most amusing part:
Trickle sync was broken on both FFS and ext2fs, in different ways.  In FFS, the
periodic call to VFS_SYNC(MNT_LAZY) was still causing all file data to be
synced.  In ext2fs, it was causing the metadata to *not* be synced.  We now
only call VOP_UPDATE() on the node if we're doing MNT_LAZY.  I've confirmed
that we do in fact trickle correctly now.
2004-08-14 01:08:02 +00:00
mycroft 81e93c0081 Add a new flag, UPDATE_CLOSE, to be used internally by file systems. 2004-08-13 23:15:39 +00:00
mycroft fbf03babff There is an annoying deadlock that goes like this:
* Process A is closing one file descriptor belonging to a device.  In doing so,
  ffs_update() is called and starts writing a block synchronously.  (Note: This
  leaves the vnode locked.  It also has other instances -- stdin, et al -- of
  the same device open, so v_usecount is definitely non-zero.)
* Process B does a revoke() on the device.  The revoke() has to wait for the
  vnode to be unlocked because ffs_update() is still in progress.
* Process C tries to open() the device.  It wedges in checkalias() repeatedly
  calling vget() because it returns EBUSY immediately.

To fix, this:
* checkalias() now uses LK_SLEEPFAIL rather than LK_NOWAIT.  Therefore it will
  wait for the vnode to become unlocked, but it will recheck that it is on the
  hash list, in case it was in the process of being revoke()d or was revoke()d
  again before we were woken up.
* Since we're relying on the vnode lock to tell us that the vnode hasn't been
  removed from the hash list *anyway*, I have moved the code to remove it into
  the DOCLOSE section of vclean(), inside the vnode lock.

In the example at hand, process A was sh(1), process B was a child of init(8),
and process C was syslogd(8).
2004-08-13 22:48:06 +00:00
jdolecek 8ac2263519 constify 2004-08-13 21:45:03 +00:00
jdolecek 42d15fca03 on Linux, unlink() fails with EISDIR if the target is directory,
rather than EPERM; to emulate this properly, translate the error to EISDIR
if the target patch exists and points to a directory

this fixes the 'ant clean' problem reported by Marc Recht on current-users@
with SuSE 9.1 libraries
2004-08-13 21:27:32 +00:00
uch 579420e43b use HCAJ, HCVJ group instead of HCAJ1, HCVJ1C_JP 2004-08-13 15:55:14 +00:00
uch 9d15e929e7 recompile. 2004-08-13 15:52:28 +00:00
uch 5adb2fdc5d add WCE101 and WCE200 binary install target. 2004-08-13 15:51:45 +00:00
uch 986311dca4 add SH7707 2004-08-13 15:50:09 +00:00
uch e659dc81a4 fix debug print. 2004-08-13 15:49:37 +00:00
uch abe2d7cbc7 regen. 2004-08-13 15:49:13 +00:00
uch 7ee4f55250 add SH7707 and HP360LX. add HCAJ and HCVJ group for Sharp Telios 2004-08-13 15:48:51 +00:00
uch 643a469d36 set user specified console as default. 2004-08-13 15:48:21 +00:00
uch 00539717e3 add debug print. 2004-08-13 15:47:53 +00:00
simonb 384a2881c7 Fix a couple of niggles:
. Incorrect name in the kernel config ident lines.
. Call the commented out NetBSD 0.9 binary compat option "COMPAT_09" and
    not "COMPAT_10"(!).
2004-08-13 15:42:02 +00:00
tsutsui d91b03bd13 Use bus_space(9) on news68k.
Update/sort the comment/ifdefs about bus_space-using ports.

XXX which should we use defined(__${MACHINE_CPU}__) or defined(${MACHINE})?
2004-08-13 12:59:20 +00:00
tsutsui e6be65a968 Adapt to NCR5380_USE_BUS_SPACE. 2004-08-13 12:54:44 +00:00
mycroft e3dd5f4885 Rearrange slightly so that we don't blow up if the card disappears during the
initial enable.
2004-08-13 12:42:11 +00:00
pooka b151590832 kill "magic" number 2004-08-13 11:25:58 +00:00
mycroft 1d167b13be amd64 also has bus_space... 2004-08-13 10:52:18 +00:00
drochner d9a2463d75 oops - forgot the isapnp attachment when I added joystick support
recently
fixes PR port-i386/26630 by George F. Costanzo
2004-08-13 08:45:25 +00:00
mycroft 27b5b1440c Remove a really gratuitous 1s delay. 2004-08-13 04:36:08 +00:00
thorpej 46f4277564 WDCDEBUG -> ATADEBUG. 2004-08-13 04:10:49 +00:00
mycroft c369e5b81c Fix two annoying display glitches with "fast scrolling" and
WSDISPLAY_SCROLLSUPPORT.
2004-08-13 04:03:38 +00:00
thorpej ab20886f7b Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.
2004-08-13 03:12:59 +00:00
thorpej 577bf67014 Move wdcstart() to ata.c and rename it to atastart(). 2004-08-13 02:16:40 +00:00
thorpej 996c3ca90e Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer(). 2004-08-13 02:10:43 +00:00
thorpej e6d61c5bc9 Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.
2004-08-12 22:39:40 +00:00
thorpej 2eaa5c6142 Move wdc_kill_pending() to ata.c and rename it ata_kill_pending(). 2004-08-12 22:33:45 +00:00
thorpej 2600c55e01 - Move wdc_xfer_pool, wdc_get_xfer(), wdc_free_xfer() to ata.c, and rename
to ata_*.
- Use a static initializer for the ata_xfer_pool.
2004-08-12 21:34:52 +00:00
thorpej 52ed169a28 Move wdc_probe_caps() to ata.c and rename it ata_probe_caps(). 2004-08-12 21:10:18 +00:00
thorpej ac7276784a Move wdc_downgrade_mode() to ata.c and rename it to ata_downgrade_mode(). 2004-08-12 21:05:09 +00:00
thorpej 9939d3c63d Move wdc_print_modes() into ata.c and rename it ata_print_modes(). 2004-08-12 20:59:27 +00:00
mycroft 7aa8e97898 Simplify a little. Pass down the card type from pcmcia_function_enable(),
which just gets it from the config entry for the function it's enabling.
Multifunction cards are defined to be of type I/O on every function, so there
is no possibility of accidentally switching.
2004-08-12 19:59:07 +00:00
mycroft cba67af302 Remove sc_offset. It's always 0, and if we did want to use it, "that's what
bus_space_subregion() is for".
2004-08-12 19:42:03 +00:00
mycroft 7fdb60e126 delay() -> tsleep() 2004-08-12 19:32:36 +00:00
mycroft f881dcb9b2 Remove the "known bugs" section. I've fixed both of them.
Use tsleep() rather than delay().  XXX Most of these are probably unnecessary
anyway.  In particular, I believe that what xi_full_reset() does is totally
gratuitous after power-cycling the socket; it should only be necessary if we
want to use power-saving mode.
2004-08-12 18:23:50 +00:00
mycroft bc9922c5ca Now that we write the IOBASE in generic code, don't do it here. Instead,
implement the hackish/stupid test for the AX88190 by just checking whether
the IOBASE is available in the CCR.

This is unspeakably wrong, but it leaves the code doing ~the same thing it
did before.
2004-08-12 17:33:17 +00:00
mycroft 3c4f1ecaa3 If the card is being detached, do not try to write the CCR to disable the
function.
2004-08-12 17:31:06 +00:00
mycroft 438f4e5647 Always write the IOBASE/IOLIMIT registers if they're set in the CCR mask. We
can't really rely on multifunction devices having a CIS that reflects this --
e.g. some cards use a combined Ethernet+modem chip, but only actually serve
one of the functions.  (We have to assume the configuration index reflects the
bits needed to enable the function.)
2004-08-12 17:26:51 +00:00
mycroft dc63cc8d34 The AX88790 hack never made any sense. It's setting the PWRDWN bit in the CCR!
So, I'm removing it.
2004-08-12 17:13:54 +00:00
mycroft 03a381d5d5 Write the configuration option register -- possibly switching the device into
its I/O mode -- as the *last* write to the CCR.
2004-08-12 17:07:52 +00:00
mycroft 8e026e9d56 Don't call socket_settype() to enable I/O interrupts until after we've written
the CCR.
2004-08-12 17:06:49 +00:00
mycroft 1714f4f98a My previous understanding of the I/O base/limit registers was incorrect.
However, so was the old code.  Now it works correctly.  :-)
2004-08-12 16:04:20 +00:00
mycroft 849d423c4e Whoops. Swap the order of the delref() and the config_pending_decr(). 2004-08-12 14:36:46 +00:00
mycroft 306522b970 I can't actually use the FORCE register this way. Just try turning the socket
power off.
2004-08-12 13:42:17 +00:00
mycroft 6269226dde Copyright maintenance. 2004-08-12 13:39:38 +00:00
mycroft 768040dd66 Various cleanup:
* Clean up the socket state earlier in the attach process -- not relying on
  the socket attachment to do it.
* Get rid of PCIC_LASTSTATE_HALF.  It's pointless.
* In pcic_wait_ready(), also check for the card vanishing, like in pccbb.
* Assert #RESET before powering up the card, not after.  (I think it was
  actually okay because the value was left as 0 from a previous disable or
  the initial socket attach, but...
* If the card fails to come ready, don't bother reinstating windows or
  anything -- just power it down.
2004-08-12 13:37:40 +00:00
hannken bc4af00256 Make it compile again for sparc64/DIAGNOSTIC.
All archs should use `cpuid_t ci_cpuid' ...
2004-08-12 12:15:21 +00:00
mycroft 6b8a90b3fe A bunch of random cleanup:
* Like the i82365 code, add a "delay" function that uses tsleep() to wait, and
  use this in the socket enable/disable paths.  This gets rid of the annoying
  system pauses during card insertion and removal.  (There are still some
  issues related to this in various drivers -- notably big delay()s in wi and
  xi.)
* Move the power-change delay out of pccbb_power() and into the PCMCIA backend
  code -- specifically, once in the disable path and once in the enable path.
  We were being pretty schizo about this before.  Make these use tsleep().
  (Note: This should be safe because card insertion/removal is handled by a
  kernel process, not in an interrupt handler.  It works for me with
  DIAGNOSTIC.)
* If we get a "bad Vcc" error, attempt to force the socket to power off, and
  return an error.  If we don't do this, we will get "bad Vcc" errors forever
  and never be able to use another card without rebooting, which is dumb.
  XXX I haven't been able to test this very well, because it doesn't fail for
  me in the first place.  :-)
* Clean up the socket mappings earlier in the enable path.
* Try to be consistent about clearing PWRCTL (which contains OE) before turning
  off power.
2004-08-12 07:15:49 +00:00
thorpej 9167731c79 Rename some constants:
WDC_COMPLETE -> ATACMD_COMPLETE
WDC_QUEUED -> ATACMD_QUEUED
WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN
2004-08-12 05:02:50 +00:00
thorpej 3ddac9b2da Rename "struct wdc_command" to "struct ata_command". 2004-08-12 04:57:19 +00:00
thorpej 2e08b82ed7 Protect against multiple inclusion. 2004-08-12 04:31:33 +00:00
thorpej f45b99ef1d Add SATA queued read/write commands. 2004-08-12 04:26:06 +00:00
thorpej 77cc762658 Don't assume wdc-specific ATA / ATAPI code should be brought in if atabus
or atapibus are configured; use a separate wdc_common attribute to indicate
that the shared wdc code is also present.
2004-08-12 04:23:02 +00:00
mycroft d24f7ca79e Close a race condition in the datain loop. If we receive another byte between
reading the FIFO status and reading the interrupt status, we could end up
leaving it in the FIFO.  Force another round through the loop after reading the
interrupt status until the FIFO reads empty again.

Also, there is no point in having the extra loop to wait for the transfer
command to the controller to be acknowledged, because the transfer loop handles
that just fine -- and getting rid of it fixes another race condition.
2004-08-12 03:39:11 +00:00
mycroft 0ed22a5ae1 Output a message if we fail to find anything useful in the CIS, rather than
appearing to do nothing.
2004-08-11 20:57:40 +00:00
mycroft b2e0a4015a We don't need to implement DRIVE_NOSTREAM here, 'cause we never set
WDC_CAPABILITY_NOSTREAM.
2004-08-11 20:27:42 +00:00
mycroft 6e3decbf8a "I was mistaken."
The memory window is not actually activate in I/O card configurations.  It was
transparently falling back to 16-bit I/O mode.
Implement "memory card" mode correctly, with polling.
2004-08-11 19:48:57 +00:00
mycroft 6741190fbc Make datain_pio and dataout_pio function pointers in wdc_softc, which can
be overridden by the backend if desired.  Add experimental code to wdc_pcmcia
to use this in memory-mapped mode, disabled by default.
2004-08-11 18:41:46 +00:00
mycroft c8e7b2a367 The memory mode we were trying to use before is a total loss -- we don't get
any interrupts, and therefore wedge on any access.  However, there is another
memory mode that gives us a memory-mapped data register, which we can use.
Also set the new "DATA1K" flag to tell the wdc backend that we have a large
data area to read from -- this can be used with the region methods.
2004-08-11 18:06:22 +00:00
mycroft 139ff2a55b Change the behavior when a transfer mode setting is rejected. For PIO, fall
back to mode 3.  For DMA, fall back to mode 0.  These are the minimums for
ATAPI.  For UDMA, fail.
2004-08-11 17:51:24 +00:00
mycroft 04a46876e5 Add two helper functions -- wdc_datain_pio() and wdc_dataout_pio() -- which
encapsulate the logic for the various methods of transferring data.  Use these
throughout.
2004-08-11 17:49:27 +00:00
christos 5647899427 make the reset time a DIAGNOSTIC, and print the cpu#. 2004-08-11 16:25:51 +00:00
drochner ad1c914cc3 adapt to esl_pcmcia changes 2004-08-11 16:20:05 +00:00
mycroft c6c0aabf57 Correct the overrun loop while I'm at it. 2004-08-11 14:28:44 +00:00
mycroft 0ef13a458b Recode the datain_pio loop. This improves performance substantially (almost
2x) with my spc@pcmcia.
2004-08-11 14:22:34 +00:00
sekiya 1a682ebd64 Add 64-bit ABI bootloader (for IP30). Needs a slightly modified toolchain
and a 64-bit-clean libkern.a; once those bits are committed, this should be
100% good to go.
2004-08-11 11:45:26 +00:00
sekiya 8a3d53f346 Start routine for 64-bit ABI. 2004-08-11 11:41:19 +00:00
mycroft a1d101ba64 Add a settype function.
Nuke address windows earlier in power up sequence.
2004-08-11 06:56:57 +00:00
mycroft 3ebcfd93ee Forget to reset to memory mode on power up.
The hd64465 looks a bit incomplete, but "not my problem".
2004-08-11 06:30:15 +00:00
mycroft 7e4288f8a6 Attempt to fix these up, but I have no way to test them. 2004-08-11 06:16:10 +00:00
mycroft 9de9d325ad And the settype pointer. 2004-08-11 06:05:21 +00:00
mycroft d54277f76c Do not ever set IOIS8. We are not running on an 8088. 2004-08-11 04:35:35 +00:00
mycroft 8f96fc7c75 Always use PCMCIA_WIDTH_AUTO rather than PCMCIA_WIDTH_IO16. This spec is
pretty clear on how this works.
2004-08-11 04:25:28 +00:00
mycroft 310c1dab88 Do the read of the MAC address before enabling the function the first time,
so we're still in memory mode.
2004-08-11 03:56:03 +00:00
mycroft 70c487b124 Add a settype() function. Also clear the window enables when powering up or
down a socket, just to be safe.  (I've had problems with WinCE trashing my CF
card if there's state left behind...)
2004-08-11 01:54:46 +00:00
mycroft 8605b5b9c0 Nuke the address windows earlier, before the socket is powered up. Just in
case there are remnants left behind.
2004-08-11 01:51:41 +00:00
perseant a315d33325 Allow compilation in the absence of DIAGNOSTIC and/or DEBUG options. 2004-08-11 01:23:47 +00:00
mycroft 33ee9cbce7 Oops; fix a compile error. 2004-08-11 01:05:42 +00:00
mycroft 51be90e8ac Be more liberal in torching the old state in the disable and settype routines. 2004-08-11 01:04:40 +00:00
mycroft 38ce741470 Clear IOIE in settype(), too. Not that we currently change modes without
powering down the socket, but...
2004-08-11 00:59:40 +00:00
mycroft d978001d30 Clear some more ICR0 bits on socket enable/disable. 2004-08-11 00:58:08 +00:00
mycroft b9798ff4a2 Add a settype() function.
XXX Note that I haven't even compiled this, but any problems are likely to be
more straightforward than crashing with a null pointer dereference.
2004-08-11 00:55:38 +00:00
mycroft faaea66252 Fix uninitialized variable warnings (which did not appear on x86). 2004-08-11 00:32:44 +00:00
mycroft a23e15bcbe Rather than having a call up from the low-level driver to get the card type,
instead have a call down from the PCMCIA mid-layer to set it.  Use this from
pcmcia_function_enable().  (Currently the policy is the same, but this would
allow for more flexibility in deciding which mode to use.)

Now it is safe to hold the socket enabled during attach, so do that.  Only
one enable/disable cycle to attach a card now!
2004-08-11 00:18:18 +00:00
mycroft a6bd4c05d7 GC some unneeded struct elements. 2004-08-10 23:34:32 +00:00
mycroft 76ad292990 Move the socket reference counting into pcmcia_socket_{enable,disable}(), and
use that where needed.
2004-08-10 23:34:06 +00:00
mycroft 32dee96c25 Hold a reference between atabus_attach() and atabusconfig() to avoid an extra
enable/disable cycle.  Now my CF card attaches a bit faster.

XXX This code is split strangely between files.
2004-08-10 23:09:38 +00:00
mycroft 8c50dac2a1 Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller.  This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
2004-08-10 22:49:12 +00:00
dyoung 90691ca787 Cosmetic: remove extraneous blank line. 2004-08-10 21:58:31 +00:00
mycroft c2ecd3e635 Update to the new world order. While I'm here, simplify a lot. 2004-08-10 21:14:50 +00:00
mycroft 0a960e80ec +cs@pcmcia 2004-08-10 20:50:11 +00:00
mycroft 8355db5e7a Update to the new world order. 2004-08-10 20:47:17 +00:00
mycroft ab96663a2a Use the right function for disabling after attach. 2004-08-10 20:25:03 +00:00
mycroft 22d0dd0aab Whoops. This goes with the esl_pcmcia.c commit. 2004-08-10 19:55:20 +00:00
mycroft 2f2f7913ed This code was pretty far from even compiling before. It also doesn't implement
detach support.  However, update other parts of it.
2004-08-10 19:54:30 +00:00
mycroft a2606a74af Update to the new world order.
XXX This driver's backend should really be merged with ess.
2004-08-10 19:47:11 +00:00
mycroft 43a768d1a7 Remove an extra printf(). 2004-08-10 19:23:21 +00:00
mycroft 8534032c92 Constify. 2004-08-10 19:20:20 +00:00
mycroft bf4a3f1523 Whoops, look at both the ID numbers and the CIS strings in each pcmcia_product.
It's dumb that drivers depend on this, but...
2004-08-10 19:15:08 +00:00
mycroft 96221eb572 Constify. 2004-08-10 19:12:25 +00:00
mycroft 1e7c425a39 Replace another home-grown matching function. 2004-08-10 19:08:37 +00:00
drochner 5a11f34433 The amd64 address space layout is different.
We can't assume that kernel addresses are below
VM_MAX_KERNEL_ADDRESS.
2004-08-10 18:57:09 +00:00
mycroft 3a3d934204 Regen. 2004-08-10 18:45:36 +00:00
mycroft 99e8c8ddca Copyright maintenance. 2004-08-10 18:45:25 +00:00
mycroft 0515828a46 Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
2004-08-10 18:43:49 +00:00
mycroft adbea3511a Enhance pcmcia_product_lookup():
* Remove the "expected function" value.  This was just causing problems with
  multifunction cards.  Differentiating the functions is better done by
  checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings.  This necessitated changing the calling
  pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
2004-08-10 18:39:08 +00:00
mycroft f185d2861f Remove some CIS strings that we don't actually want to match on -- in some
cases they contain minor revision numbers, and one was even someone's MAC
address!
2004-08-10 18:00:15 +00:00
mycroft e489df60f6 Take a shot at updating this to the new world order. Hopefully someone will
test it for me...
2004-08-10 16:43:47 +00:00
mycroft d11fb31edb More careful about cleaning up pointers. 2004-08-10 16:04:16 +00:00
mycroft f1b2ffd886 Hold a reference to the adapter until scsibus_config() has been called. This
avoids an extra enable/disable cycle on removable controllers (i.e. PCMCIA).
2004-08-10 15:46:44 +00:00
mycroft 70ca4b2fa7 Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
2004-08-10 15:29:56 +00:00
mycroft 90f47f6065 Better fix for the previous. 2004-08-10 08:57:50 +00:00
mycroft 8ccc950011 Copyright maintenance. 2004-08-10 08:56:08 +00:00
mycroft 51376df968 Fix a reference count problem I introduced here. 2004-08-10 08:29:27 +00:00
skrll adf5c92842 Include <sys/cdefs.h> once. 2004-08-10 07:35:53 +00:00
mycroft 03515f2f84 Update to the new world order.
XXX Note: This eliminates some register writes that were done in the "init"
routine during attach.  If these are necessary, they need to do done somewhere
else, quite possibly the enable routine.
2004-08-10 07:04:19 +00:00
mycroft aebf4d4a6e Update to the new world order. 2004-08-10 07:03:14 +00:00
mycroft 4160a45384 For the c400, set 5380 compatibility mode on every pass through the reset
routine.  The PCMCIA attachment, at least, needs this.
2004-08-10 07:00:30 +00:00
mycroft 26df0f0126 Fix a printf(). 2004-08-10 06:23:50 +00:00
mycroft 6d1b8921aa Copyright maintenance. 2004-08-10 06:10:38 +00:00
mycroft 6c47211011 Update to the new world order. 2004-08-10 06:08:58 +00:00
mycroft ac82590655 Remove some useless code. 2004-08-10 06:05:40 +00:00
mycroft d55195e28b Update to the new world order.
"While I'm here..."
All that grotesque code allegedly for the 88190 and 88790 is actually just
mapping the CCR and writing to it.  So, enable the device normally and use
pcmcia_ccr_{read,write}() rather than doing this crap ourselves.
2004-08-10 05:24:56 +00:00
mycroft 1234bb195c Update to the new world order. 2004-08-10 05:23:04 +00:00
mycroft 9e12fe4182 Minor change to a printf(). 2004-08-10 05:22:33 +00:00
mycroft 1641421432 Move the location of a printf() I added. 2004-08-10 05:21:59 +00:00
mycroft 1a0a3e5f59 Update to the new world order. 2004-08-10 03:54:37 +00:00
mycroft baa0e65038 Make the enable state machine during attach more robust. 2004-08-10 03:54:26 +00:00
mycroft dae3551db2 Regen. 2004-08-10 03:03:29 +00:00
mycroft a866720a7e Remove a very silly hack WRT the Digital vendor ID. 2004-08-10 03:03:11 +00:00
mycroft 71e7860bbf GC the "quirk" code. 2004-08-10 03:00:29 +00:00
mycroft f96037f43b Use pcmcia_function_{configure,unconfigure}().
XXX Memory mapped mode seems to be flaky with my CF cards, so I have
disabled it for now.
2004-08-10 02:56:42 +00:00
mycroft 7f6dd84dc4 Use pcmcia_function_{configure,unconfigure}(). 2004-08-10 02:54:19 +00:00
mycroft 2137977a97 Be robust against child devices failing to handle the socket refcnt properly --
force it to 0 when a card is detached, possibly disabling the socket in the
process.

Add several new functions:
* pcmcia_config_alloc(pf, cfe)
  Tries to allocate all the I/O and memory spaces in a config entry.
* pcmcia_config_free(pf)
  Frees all the I/O and memory spaces for the active configuration.
* pcmcia_config_map(pf)
  Maps all the allocated I/O and memory spaces for the active configuration.
* pcmcia_config_unmap(pf)
  Unmaps all the allocated I/O and memory spaces for the active configuration.

And two higher-level functions:
* pcmcia_function_configure(pf, validator)
  Tries to find a CIS config entry that it can allocate the spaces for.  Each
  entry is verified by calling the "validator" function -- which can also do
  card- and driver-specific fixups.  If successful, the regions are all mapped.
* pcmcia_function_unconfigure(pf)
  Equivalent to calling both pcmcia_config_unmap() and pcmcia_config_free().

Most drivers are expected to use the latter two functions, which will greatly
reduce the amount of crufty code.
2004-08-10 02:50:52 +00:00
mycroft dc594b03f9 Be robust against the case of the child devices failing to decrement the
refcnt.
2004-08-10 02:40:51 +00:00
mycroft 646cec1d1d A few things:
* Kill off device nodes *before* we clear out the queue, to help prevent any
  new I/O being queued.
* More useful error reporting in wd_setcache() and wd_flushcache().
* Add a wd_standby() (tested but not used yet).

And the most important:
* In wddetach(), if the device was open, call adapt_delref() so that we
  propagate the disable up to our PCMCIA socket.
2004-08-10 02:33:58 +00:00
dyoung 2bcbb9cb72 IBSS fixes: get IBSS beacon generation right. Merge with a same-SSID,
same-channel IBSS.
2004-08-10 01:03:52 +00:00
dyoung 8abb07d1ac Make the node table into an LRU cache: least-recently used nodes
are at the end of the node queue.  Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver.  Every node in the table with ni_refcnt=0
is eligible to be garbage-collected.  The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now.  A sysctl,
net.link.ieee80211.maxnodecache, controls the maximum LRU cache
size.

While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match."  This keeps
net80211 from caching duplicate nodes in the table.
2004-08-10 00:57:20 +00:00
mycroft 16e317876a Minor change. 2004-08-09 22:24:37 +00:00
mycroft 125ba6ee0c Adapt to the new world order. 2004-08-09 22:02:11 +00:00
mycroft 975673d3f6 Adapt to the new world order. 2004-08-09 21:30:18 +00:00
mycroft 285bec8287 Minor code reduction. 2004-08-09 20:30:19 +00:00
mycroft b37b3de94e Adapt to the new world order. Now all my sm cards work. 2004-08-09 20:30:08 +00:00
mycroft 36c30a2f1a Dispense with all the interrupt multiplexing code here, and assume that the
underlying implementation DTRT.  This has the side effect of causing us to
ignore the INTR and INTRACK bits in the CCR -- but this seems for the best
anyway, since they are not reliably implemented.  (I note that Linux doesn't
bother either.)
2004-08-09 20:02:36 +00:00
mycroft 7848004c46 Do the I/O mapping in the main attach routine.
Also, we don't need to bother cleaning up on a failed attach -- we keep enough
state for the detach routine to do it.
2004-08-09 19:34:00 +00:00
mycroft bc7b11e4ff Add newlines to the messages... 2004-08-09 19:33:07 +00:00
mycroft b7a991ceb6 Whoops, nuke an unused variable. 2004-08-09 19:09:06 +00:00
mycroft 65d47754b3 Assume that io_map/unmap and intr_establish/disestablish will not be called
with the function enabled.  If this happens, issue a warning.  (This is only
really important for multifunction cards.)

This allows me to get rid of a bunch of extra code.
2004-08-09 19:08:19 +00:00
mycroft 1710cea8cf Enable DDB history. 2004-08-09 19:04:32 +00:00
mycroft f65dd54152 Correct the intr_establish order here. 2004-08-09 18:51:32 +00:00
mycroft 7b96c587dc Fix the intr_establish/disestablish order here too. 2004-08-09 18:41:36 +00:00
mycroft 9092e2c97e Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits.  pcmcia_intr_disestablish() continues to do this as a stopgap.
2004-08-09 18:30:51 +00:00
mycroft 2ae40d3e4f Do our io_map()s and intr_establish()es earlier. 2004-08-09 18:11:01 +00:00
mycroft af19b73069 Do io_map() and intr_establish() before enabling the function, always. This
prevents "stray interrupts" during attach.
2004-08-09 17:00:53 +00:00
mycroft deca9207b3 If the function is not enabled, do not attempt to immediately update the CCR.
XXX This is a stopgap until all drivers are converted to do their io_maps and
intr_establishes before function_enable.
2004-08-09 16:59:10 +00:00
mycroft 9a46d5ed7d Do an extra read of the IIR during initialization, just to ack any pending
interrupt.
2004-08-09 16:57:14 +00:00
mycroft c74553663e Add some code to deal with the interrupt mask register on early CEM cards.
Doesn't seem to work yet, but it's marginal progress.
2004-08-09 16:05:00 +00:00
chs ed0b81628a move DBG settings to CPPFLAGS and COPTS as appropriate
so that we can use the default DBG now.
2004-08-09 16:01:37 +00:00
mycroft c8180f49fd Use PCMCIA_WIDTH_AUTO, not PCMCIA_WIDTH_IO16, since we (sometimes) do 8-bit
access.
2004-08-09 15:40:56 +00:00
mycroft b03f5b32c7 Pass a valid alignment to pcmcia_io_alloc(). 2004-08-09 14:24:10 +00:00
mycroft 6d0330a781 Add {spc,xirc,mhzc}@pcmcia. All tested on a Multia. 2004-08-09 14:16:02 +00:00
mycroft 4e92489373 Add detach support for spc@pcmcia, modeled after aic@pcmcia. 2004-08-09 14:07:57 +00:00
mycroft f5eacc00f9 Don't loop forever if a card went away. 2004-08-09 13:52:21 +00:00
mycroft 10121549dd Add a hack that makes the address register programming more reliable on my
CE2 cards.
2004-08-09 13:30:16 +00:00
yamt 49b8d40924 #if SYSCTL_INCLUDE_DESCR -> #ifdef SYSCTL_INCLUDE_DESCR 2004-08-09 08:35:23 +00:00
junyoung 0889de87d0 xi -> xirc,com,xi 2004-08-09 05:23:52 +00:00
mycroft eaae9fcf2b The "savedpage" stuff is nonsense. Every place we touch the device is
protected by splnet(), so there's no reason to even try.
2004-08-09 05:11:33 +00:00
mycroft a271b4e6ab Go online in xi_init(), not xi_full_reset(). Enable/disable receive in
xi_init()/xi_stop().
2004-08-09 04:47:40 +00:00
mycroft 0e261f0935 Fix a debugging printf(). 2004-08-09 02:10:25 +00:00
mycroft 105470da05 Do not set INTRACK ourselves. 2004-08-09 02:01:16 +00:00
mycroft cafa5cc2d1 Implement the correct (I think) interrupt acknowledgement sequence. 2004-08-09 01:49:26 +00:00
mycroft 00a9c911e6 Multifunction fixes:
* Don't call handlers for functions that are not enabled.
* Always call the handler if the function doesn't support the STATUS register.
While I'm here, divide the CCR numbers by 2.
2004-08-09 01:32:04 +00:00
mycroft 213233a551 Access to this device is strictly 16-bit, so use PCMCIA_WIDTH_IO16. 2004-08-09 00:33:17 +00:00
mycroft 16ac152cca Do barriers on the ASIC space without touching the NIC space. 2004-08-09 00:26:15 +00:00
mycroft f0e2cfd7fc Eliminate most 8-bit access. Just the data in/out path remains. 2004-08-09 00:25:33 +00:00
mycroft c52e6e82ec Create two windows iff the config table asks for it. Try to make them
contiguous.  Map windows with mode AUTO since we have mixed size access.
2004-08-09 00:00:36 +00:00
mycroft 8231a1a314 Copyright maintenance. 2004-08-08 23:19:59 +00:00
mycroft ebed70c6e6 Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function.  Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
2004-08-08 23:17:12 +00:00
jdolecek b43cbaf291 fix two bugs in previous:
* flags passed from fork1() are FORK_*, not CLONE_*; thus, correct is to check
  for FORK_SHAREVM, not CLONE_VM
* fix a reference counting bug
2004-08-08 19:52:37 +00:00
christos 7e7559f105 by popular demand, bind the scroll keys by default. 2004-08-08 19:24:49 +00:00
christos 959186b32c disable the quirk on the console so that it can scroll. 2004-08-08 19:21:27 +00:00
mycroft ca7dc95cab Enable DDB history by default. 2004-08-08 16:38:50 +00:00
mycroft 76344241eb Look in the correct register for the BSR detection value.
Also, do this early, before writing any registers.
2004-08-08 16:20:43 +00:00
mycroft fa9798d4c2 Search all the configuration entries. 2004-08-08 15:44:13 +00:00
mycroft 91ad7491a9 AFAICT, there's no reason not to use PCMCIA_WIDTH_AUTO here. 2004-08-08 15:12:20 +00:00
rearnsha df8fa882b3 Add UVMHIST tracking for data and prefetch aborts. 2004-08-08 14:21:29 +00:00
yamt 96e7bb0952 ath_init1: return EIO rather than -1 on a failure of ath_hal_reset.
-1 isn't appropriate for if_init.
2004-08-08 13:01:03 +00:00
jdolecek 9aba366e0b Linux enforces CLONE_VM if CLONE_SIGHAND in clone(2) is specified,
follow the suit - this is intended to be Linux-compatible call
2004-08-08 11:02:10 +00:00
jdolecek 142def6b36 pass the fork flags down the emulation proc fork hook 2004-08-08 11:00:05 +00:00
kent c525acb34a VT1616i support 2004-08-08 10:41:57 +00:00
yamt 28b17ac69e in_control: fix address leaks on error, which causes a panic
("no domain for AF 0") on if_detach.
- SIOCAIFADDR, SIOCSIFADDR: free an address on error.
- SIOCSIFNETMASK, SIOCSIFDSTADDR: reject operations for an interface which
  has no AF_INET addresses.

partly from OpenBSD and FreeBSD.
reviewed by Christos Zoulas on tech-net@.
2004-08-08 09:52:41 +00:00
yamt 9cc3176930 kvtopte: use a correct base addr for LARGEPAGES. 2004-08-08 09:47:05 +00:00
jdolecek a714ac8294 linux processes sharing VM space (via clone() call) must also
share same 'break' value used for brk()/sbrk(), otherwise application SIGSEGVs
quickly once different threads try to adjust data segment size

this fixes linux Mozilla crashes with SuSE 9.1 libraries, and possibly
other linux applications using real threads
2004-08-08 09:40:50 +00:00
yamt a37fba2a04 correct VAs in a comment. 2004-08-08 09:40:48 +00:00