Commit Graph

26524 Commits

Author SHA1 Message Date
jruoho
5c49307bc7 Protect all header files against multiple inclusions. 2010-03-05 08:30:48 +00:00
dyoung
7a5d03568b Simplify this a bit (and reduce differences with if_rtw_pci.c): we
don't have to save the base address or write it to the BAR.
2010-03-05 00:54:01 +00:00
dyoung
ccf94312cd This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

Make a few changes of this kind:

-	ih = cardbus_intr_establish(cc, cf, ...);
+	ih = Cardbus_intr_establish(ct, ...);

-	cardbus_intr_disestablish(cc, cf, ih);
+	Cardbus_intr_disestablish(ct, ih);

Tested by plugging a Syba CardBus to FireWire adapter into an HP
Pavilion N3270, adding an address (169.254.0.7/16) to fwip0, attaching
and pinging a MacBook Pro.
2010-03-05 00:36:06 +00:00
jruoho
6957e12144 Remove ACPI_BUT_DEBUG by using ACPI_DEBUG_PRINT(x) instead. 2010-03-04 23:25:07 +00:00
jruoho
a087b17c08 Add missing semicolon. 2010-03-04 23:06:36 +00:00
dyoung
797e51d63e Make cosmetic changes in order to reduce differences with
sys/dev/cardbus/if_rtw_cardbus.c: remove an unnecessary #include.
Change a few cut & paste instances of ADM8211 to RTL8180.  Make the
suspend & resume functions static, add declarations for them at the top
of the file, and move the functions themselves to the bottom.
2010-03-04 22:57:37 +00:00
dyoung
5980434120 Extract both instances of the code that prints the PCI Secondary Status
Register into a subroutine.  Use terminology similar to that which
PCI System Architecture (4th Edition) uses.  For comparison with PCI
reference books, specify flags and fields with __BIT(n) and __BITS(m, n)
instead of hexadecimal constants.
2010-03-04 22:55:20 +00:00
dyoung
7ff20f205b This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.
2010-03-04 22:42:22 +00:00
dyoung
6cff081e8d Get rid of the #if 1 surrounding #include <dev/cardbus/rbus.h>.
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

ath, atw, and rtw work fine after this change.
2010-03-04 22:37:38 +00:00
dyoung
9b2935788e This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.
2010-03-04 22:34:37 +00:00
dyoung
3f128f06a2 Remove unnecessary #ifdef INET-enclosed #includes.
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.
2010-03-04 22:33:12 +00:00
jruoho
3c39e81041 Cleanup:
* Semantics.
  * No need for <dev/acpi/acpica.h>.
  * Reduce the amount of error reporting.
  * Remove ACPI_BUT_DEBUG and ACPIBUT_F_VERBOSE.

No functional change.
2010-03-04 22:29:47 +00:00
jruoho
029e3bd476 Fix two memory leaks. 2010-03-04 20:46:18 +00:00
jruoho
03b2d90825 Fix ACPI_DEBUG build failures reported by Greg A. Woods. 2010-03-04 20:17:30 +00:00
dyoung
55ce676397 It turns out that ppb at cardbus was not even in ALL. It has probably
not been compiled in a very long time.  With some minor changes, it was
possible to make it compile:

Use kmem_zalloc()/kmem_free() instead of alloca()/memset().

Use %zu and %zx for printf'ing bus_size_t.

Delete the declaration of an unused local variable.
2010-03-04 18:49:14 +00:00
dyoung
5a5c46dece Delete unfinished and unreachable code: ppb_cardbus_setup(),
ppb_cardbus_enable(), ppb_cardbus_disable().
2010-03-04 18:31:57 +00:00
dyoung
bee77fae60 Simplify interrupt (dis)establishment by two source transformations:
-       cardbus_intr_disestablish(cc, cf, ih);
+       Cardbus_intr_disestablish(ct, ih);

-       ih = cardbus_intr_establish(cc, cf, ...);
+       ih = Cardbus_intr_establish(ct, ...);

Tested by kiyohara@.
2010-03-04 16:40:54 +00:00
pgoyette
a91348ab44 This really should be ACPI_BUS_COMPONENT
Maybe I should stay out the acpi stuff?  :)
2010-03-04 13:11:14 +00:00
pgoyette
e349ece50a Fix this correctly. Thanks jruoho@ 2010-03-04 13:07:01 +00:00
jruoho
ed7fe01278 Provide the _COMPONENT definition and use ACPI_FREE(x) instead of
AcpiOsFree(). If the memory tracking of ACPICA is enabled, the latter is
guaranteed to leak memory, possibly also corrupting kernel memory.
2010-03-04 08:44:55 +00:00
pgoyette
f7785363d4 Replace ACPI_FREE() with AcpiOsFree() so we no longer need to define
_COMPONENT (we don't have a bit defined for SMBUS anyway).  This was
uncovered by turning on ACPI_DEBUG for the i386 ALL kernel config.

Reported by Greg Woods on current-users@
2010-03-04 03:10:18 +00:00
oster
0134fbe7d0 Don't attempt to read or write component label stuff from/to 'dead disks'.
Update used spares with the correct parity map bits too.

Addresses PR#42904 by Louis Guillaume.  Fix confirmed by submitter.
Thanks!
2010-03-03 14:23:27 +00:00
tsutsui
8f7c20ed4f Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.

 * move RTL8019 probe and attach code from each bus attachment
   to MI ne2000_detect() and ne2000_attach()
 * change a method for backend and attachment to specify 8 bit mode
   to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
 * handle more NE2000 8 bit mode specific settings, including
   bus_space(9) access width and available size of buffer memory
 * add a function to detect NE2000 8 bit mode
   (disabled by default, but enalbed by options NE2000_DETECT_8BIT
    to avoid possible regression on various ISA clones)
 * fix ipkdb attachment accordingly (untested)

Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.

See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
2010-03-03 13:39:57 +00:00
jruoho
4bf4e84b9e Convert the single instance of ACPI_EXTRA_DEBUG to ACPIVERBOSE. 2010-03-03 06:57:05 +00:00
jruoho
786707264c Refactor acpi_make_devnode() to make it a little more readable.
No functional change intended.
2010-03-03 06:54:25 +00:00
dyoung
eb66a866ff Simplify interrupt (dis)establishment by two source transformations:
-       cardbus_intr_disestablish(cc, cf, ih);
+       Cardbus_intr_disestablish(ct, ih);

-       ih = cardbus_intr_establish(cc, cf, ...);
+       ih = Cardbus_intr_establish(ct, ...);

Compiles.  Untested.  Let me know if you use this hardware with NetBSD
any longer.
2010-03-03 00:56:41 +00:00
pooka
b6d93fa026 For the nfs throttling kludge, test against v_tag == VT_NFS instead
of v_op (the latter imposes linkage).
2010-03-02 21:32:29 +00:00
dyoung
355cdbdce9 Simplify interrupt (dis)establishment by two source transformations:
-       cardbus_intr_disestablish(cc, cf, ih);
+       Cardbus_intr_disestablish(ct, ih);

-       ih = cardbus_intr_establish(cc, cf, ...);
+       ih = Cardbus_intr_establish(ct, ...);

Tested with ath & atw units on a Soekris net4521.
2010-03-02 20:31:14 +00:00
jruoho
4fcde464a0 Format string cosmetics (mainly from %d to %u). 2010-03-02 18:44:46 +00:00
martin
9e8ef1a77b Before destroying a autonegotiation callout, make sure it is quiet 2010-03-02 08:30:40 +00:00
jld
b95d388b8c When setting up a non-autoconfigured RAID set, fail a component if the
attempt to read its label fails.  OKed by oster@.
2010-03-01 21:10:26 +00:00
njoly
3fab0f4f60 Do initialise i2c_attach_args new members, for indirect configuration
too.
2010-03-01 17:35:21 +00:00
oster
e0010cd0df Don't merge a good parity map with random stuff in the event that the
first component is missing.  (Since the merging just OR's the maps,
this isn't that big of a deal, as it will just over-estimate the
amount of checking that needs to be done.)
2010-03-01 14:51:58 +00:00
jruoho
da6a111dbe Destroy the callout(9) when detaching. Also evaluate the removal of the
notify handler before going to demolishing business.
2010-03-01 13:16:21 +00:00
macallan
3bc5d8b535 make latching optional.
The SPARCbook docs claim it's necessary but my 3GX happily works without.
2010-03-01 05:42:08 +00:00
jruoho
5bc6f3c06a Semantics:
* Use ACPI_ADR_PCI_DEV(x) and ACPI_ADR_PCI_FUNC(x).
  * !ACPI_FAILURE -> ACPI_SUCCESS, UINT32 -> uint32_t
  * Remove whitespace.
2010-03-01 05:37:37 +00:00
macallan
539b768657 fix ancient typo, noticed by mouse@ 2010-03-01 05:26:53 +00:00
pgoyette
7e73c12204 Now that sysmon_envsys(8) has learned how to retrieve and update sensor
limit values from the device driver, remove the high_limit and low_limit
entries from the hw.dbcool<#>.<sensor> sysctl(8) tree.  These limits are
now directly accessible via envstat(8).  Simplify the remaining code
somewhat.

No objections raised on either tech-kern@ or current-users@

XXX The fan controllers's parameters (including those that are tied to
XXX temperature sensors) are still in sysctl, since there isn't any clean
XXX way to implement the fan controllers in sysmon_envsys yet.  It is on
XXX my To-Do list...
2010-03-01 03:14:49 +00:00
pgoyette
06d81b8ad2 Move definitions of internal data structures and flag bits to avoid
exposing them to user-land.
2010-02-28 20:04:04 +00:00
jruoho
86c3014958 Introduce support for ACPI kernel modules.
Tested on couple of laptops.
2010-02-28 17:22:41 +00:00
snj
ccaf1e96be Fight the ever-increasing size of src checkouts by spelling "useful"
without an extra l.
2010-02-28 15:52:16 +00:00
snj
77db2769ee Spelling police. 2010-02-28 15:33:21 +00:00
martin
3c21532a2a Interpret the "reg" property of i2c nodes more liberal, and depending
on the cell size in use.
I have been unable to find any documents about the i2c bindings for OF,
so this is all pretty much voodoo.
2010-02-28 13:59:05 +00:00
jruoho
0f58ad7ae9 Use native functions instead of polluting the namespace with ACPICA-macros. 2010-02-28 13:56:49 +00:00
martin
046723f091 Update pcf8584 driver from OpenBSD 2010-02-28 11:47:28 +00:00
martin
a56e529332 Add direct config support for a few devices 2010-02-28 11:36:27 +00:00
martin
5aa9335e67 Supporting cast for i2c direct configuration on OF machines 2010-02-28 11:35:40 +00:00
martin
9d9a688916 Generic (device property based) framework for optional direct configuration
of i2c devices, as discussed on tech-kern.
2010-02-28 11:34:42 +00:00
jruoho
5d978521d4 Cleanup:
* Semantics.
  * Remove ACPI_LID_DEBUG.
  * Reduce the amount of error reporting.
  * As the status of the lid (open/closed) is known upon suspend, move the
    state variable to the softc, and avoid one object evaluation this way.
2010-02-28 09:23:30 +00:00
tsutsui
1609b8d6f6 KNF, misc cosmetics. 2010-02-27 05:41:22 +00:00