Commit Graph

1272 Commits

Author SHA1 Message Date
jakllsch 89097d7fef don't run off the end of the source resource buffer 2014-04-14 01:56:18 +00:00
riastradh f58fb90d2f Fix unused variable warning in non-modular apple_smc build. 2014-04-01 17:49:40 +00:00
riastradh 9456e37730 Rework Apple SMC attachment goo and split into multiple modules.
The four modules are apple_smc for the core functions, apple_smc_acpi
for attachment at acpi, and apple_smc_fan & apple_smc_temp for stuff
on the SMC.

Seems like there's a lot more bookkeeping necessary to maintain
children of an applesmc device implemented by loadable modules.
Maybe there's a better way I just haven't figured out yet.
2014-04-01 17:48:39 +00:00
riastradh 0396c57641 First draft of drivers for the Apple System Management Controller.
Device interface derived by reading the Linux driver source code and
<http:///www.parhelia.ch/blog/statics/k3_keys.html> as of 2012-12-05.

Includes support for attaching fan and temperature sensors to sysmon.
No accelerometer yet.

Compile-tested only, based on some run-testing of experiments from
userland.  Module attachment is not quite finished, so it won't work
yet.
2014-04-01 17:47:36 +00:00
maxv 38b6f18cc1 Some {} are missing. The behavior is thus wrong: the code always jumps to
out1.

Spotted by my code scanner.

ok christos@
2014-03-01 16:59:41 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
christos f5fe8e85e2 fix unused 2014-01-25 21:11:20 +00:00
apb b29660a1ad + Please also update ACPI_DATE in include/acapps.h. 2014-01-18 09:51:08 +00:00
christos 6865ff7222 use ACPI_DEBUG not ACPI_DEBUGGER which is used internally by acpica 2013-12-27 20:55:59 +00:00
christos 0a1a7e4862 Add new functions 2013-12-27 18:53:25 +00:00
christos e9e92000ab - remove function list that was out of date
- explain magical munging so that people are not scared to update in the future.
2013-12-27 18:53:16 +00:00
christos a76e346af4 function argument changed width 2013-12-27 18:52:16 +00:00
christos 5b339ad5cf constant changed name 2013-12-27 18:51:44 +00:00
jruoho c41db882ba As discussed with bouyer@, fix a too eager T-state validation check to
accomodate new Intel CPUs.
2013-11-20 13:39:59 +00:00
christos 0d211931ed fix unused variable warnings 2013-10-20 21:13:15 +00:00
christos 6888745cca remove unused variable 2013-10-17 21:18:43 +00:00
christos 83c3d19b88 print a warning if we failed. 2013-10-16 17:31:28 +00:00
christos 5d72dee0e3 remove unused variable 2013-10-16 17:30:42 +00:00
christos 9b9040ce5f reverse the polarity of the extra key option, always enabling them. 2013-03-30 19:05:20 +00:00
christos 262712cd9f Define THINKPAD_EXTENDED_HOTKEYS to enable more hotkeys on ThinkPads.
This has only been tested on a T61.
XXX: Should we put THINKPAD_EXTENDED_HOTKEYS into a opt_*.h include
     (defflag) or just always enable it?
2013-03-30 03:09:44 +00:00
riastradh 8b7a790367 Match LEN0068 in thinkpad(4) too, as newer Thinkpads report.
Tested on a W530.  Lots of stuff is missing, though.
2012-11-24 20:56:39 +00:00
cegger 51eec0573c Add support for various things:
- hddtemp sensor
- ambient light sensor on/off (via sysctl)
- display info
- docking station info
2012-10-12 13:02:28 +00:00
chs 323db750fc locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.
2012-09-23 00:31:05 +00:00
chs 7a69ec70ee re-enable the code to disable link devices at startup, ie. revert rev 1.3.
this fixes PCI interrupts on some systems (eg. HP XW9400) and we suspect that
the problems which led to the original change were caused by buggy early
implementations of ACPI, which are now ignored by date.
2012-09-23 00:26:25 +00:00
jruoho ce0335d479 Use KM_SLEEP. 2012-08-14 14:38:02 +00:00
jruoho 4f0c2c3f04 Collect rnd(9) entropy from coretemp(4), acpibat(4), aibs(4), hpacel(4),
thinkpad(4), and aps(4).
2012-08-14 14:36:43 +00:00
pgoyette fa22835bbb Replace local handling of entropy gathering with the new common code
recently introduced into sysmon_envsys(4).

Thanks to jruoho@ for testing.
2012-07-29 02:58:27 +00:00
christos a0b6dd8ad5 Treat empty package returned from _AL<n> method the same as non-existent.
From jmcneill.
2012-07-19 18:03:32 +00:00
spz 1fdd2bae8c add function switch to switch on/off "wireless WAN", aka GSM et al modem
not tested to actually work, extensively tested not to do any harm if you
don't have a wwan
2012-07-15 11:52:01 +00:00
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
jruoho 06ade55260 Remove the upper limit for the number of T-states. 2012-04-27 04:38:24 +00:00
jruoho 24d5434adb As in Linux, prevent BIOS from trying to map addresses beyond ULONG_MAX. 2012-04-22 06:33:04 +00:00
jruoho 0addcacfb8 Now that 6.0 is branched, remove the ACPI-related sysctl nodes in machdep. 2012-04-10 13:48:24 +00:00
jruoho 78d78ed5a9 Fix a regression introduced during the change of the DMI naming conventions
(rev. 1.48). Also add a quirk for ASUSTeK's M2A-MX in order to allow
powernow(4) to attach (reported by bouyer@).
2012-03-27 18:37:57 +00:00
bouyer e15100e94c Do not use uninitialized level if fujitsu_bp_get_brightness() returned
an error; from gcc -O3 (completely harmless in this case though).
2012-03-15 16:19:02 +00:00
jruoho 87e0bf89e7 Set the flag for checking for PCI bus master activity only for C3. 2012-02-25 17:22:52 +00:00
tls 7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
christos 4383182c44 make it never match for now. 2012-01-22 20:25:25 +00:00
christos 26e776da8e make it handle legacy devices too, although the ones in the table are not. 2012-01-22 20:24:27 +00:00
christos 2bf32572a7 remove aborted work in progress 2012-01-22 13:53:24 +00:00
christos 6fb39d18da add a tpm driver from bsssd.sourceforge.net 2012-01-22 06:44:28 +00:00
jmcneill 13b0b03b15 initialize fan sensor state to ENVSYS_SINVALID, should fix:
asus0 at acpi0 (ATKD, ASUS010-16843008)
sme_update_sensor_dictionary: can not update sensor state 0 unknown
asus0: couldn't register with envsys
2012-01-21 18:13:56 +00:00
mrg 5249bbc553 provide a lock for mpu_attach. 2011-12-09 08:56:54 +00:00
mrg 8de08fa998 put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.
2011-11-24 03:35:56 +00:00
jmcneill 8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
jruoho f7eabaaeb3 Add comment. 2011-11-15 07:43:37 +00:00
jmcneill bd2d899c84 add a machdep.dmi sysctl tree with the following read-only keys:
system-vendor, system-product, system-version, system-serial, system-uuid
 bios-vendor, bios-version
 board-vendor, board-product, board-version, board-serial
the *-serial and *-uuid keys are marked with CTLFLAG_PRIVATE

a few of the pmf platform key names changed so update callers to match
2011-11-14 02:44:59 +00:00
jruoho 67fcddd627 Revert the revision 1.5 in cpufreq(9). Instead, document that the KPI can
not be used before interrupts have been enabled. Suggested by macallan@.
2011-10-27 05:25:07 +00:00
jruoho 77e84d0e62 Initialize P-states to P0 (i.e. the highest frequency). 2011-10-20 06:57:23 +00:00
jmcneill 11e87ad5a9 clear fixed events and disable GPEs before re-enabling interrupts on resume
from S1
2011-10-18 23:47:26 +00:00