Commit Graph

131 Commits

Author SHA1 Message Date
Hans Petter Selasky
0e1152fcc2 The SYSCTL data pointers can come from userspace and must not be
directly accessed. Although this will work on some platforms, it can
throw an exception if the pointer is invalid and then panic the kernel.

Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-28 12:00:39 +00:00
Hans Petter Selasky
f0188618f2 Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified.

- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.

- Logical OR where binary OR was expected.

- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.

- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.

- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.

- Updated "EXAMPLES" section in SYSCTL manual page.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-21 07:31:21 +00:00
Jung-uk Kim
0c10b85a19 Consistently cast ACPICA 64-bit integer types when we print them. 2013-06-26 23:52:10 +00:00
Takanori Watanabe
df07418447 A driver for Intel Rapid Start Technology ACPI device.
Note that it is just for 'Advanced' configuration for Rapid start technology.
2013-05-08 12:53:21 +00:00
John Baldwin
897986b47e Only cleanup CMI-related state on detach if the system supports CMI.
PR:		kern/163268
MFC after:	1 week
2013-04-29 18:54:31 +00:00
Jung-uk Kim
22989042a9 Fix white spaces. 2013-04-23 18:30:33 +00:00
Eitan Adler
512515147b Remove tautological compare.
PR:		kern/176712
Submitted by:	Hiren Panchasara <hiren.panchasara@gmail.com>
Approved by:	cperciva (mentor)
2013-04-23 13:02:48 +00:00
Sofian Brabez
61bfd86762 Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
Reviewed by:	cognet
Approved by:	cognet
2013-01-30 18:01:20 +00:00
Baptiste Daroussin
2ef2a08637 add support for newer Lenovo ThinkPads to acpi_ibm
PR:		kern/164538
Submitted by:	Pierre Imai <pierre@imai.at>
MFC after:	2 weeks
2012-10-29 10:22:00 +00:00
Andriy Gapon
178f3ce611 acpi_wmi: move wmi_info_list into sc
different instances of acpi_wmi couldn't properly share it and, in fact,
there was no reason to do that

MFC after:	10 days
2012-10-14 09:31:11 +00:00
Alexander Motin
461a98a279 Add acpi_asus_wmi(4) -- driver for random extras found on WMI-compatible
Asus laptops. It is alike to acpi_asus(4), but uses WMI interface instead
of separate ACPI device.

On Asus EeePC T101MT netbook it allows to handle hotkeys and on/off WLAN,
Bluetooth, LCD backlight, camera, cardreader and touchpad.

On Asus UX31A ultrabook it allows to handle hotkeys, on/off WLAN, Bluetooth,
Wireless LED, control keyboard backlight brightness, monitor temperature
and fan speed. LCD brightness control doesn't work now for unknown reason,
possibly requiring some video card initialization.

Sponsored by:	iXsystems, Inc.
2012-07-02 08:31:29 +00:00
Mitsuru IWASAKI
ae2f080bc4 Add in-driver event handler.
MFC after:	3 days
2012-06-23 18:43:54 +00:00
Kevin Lo
bbdf953e9b Add missing MODULE_DEPEND() so that acpi.ko and aibs.ko can be
loaded dynamically.
2012-02-28 15:12:26 +00:00
Marius Strobl
4b7ec27007 - There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.
2011-11-22 21:28:20 +00:00
Jaakko Heinonen
885c97af51 Append unit number to the WMI status device name to allow attaching
multiple acpi_wmi(4) instances.

PR:		kern/162491
Reviewed by:	avg
2011-11-22 16:44:50 +00:00
Ed Schouten
d745c852be Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
2011-11-07 06:44:47 +00:00
Matthew D Fleming
f4f04709ac Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. 2011-01-19 00:57:58 +00:00
Matthew D Fleming
6dc7dc9a3e sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.
Commit the rest of the devices.
2011-01-12 19:53:56 +00:00
Andriy Gapon
c82eedb465 acpi_fujitsu: update for P8010
PR:		kern/121102
Submitted by:	Anish Mistry <amistry@am-productions.biz>
MFC after:	3 weeks
2010-12-11 10:55:18 +00:00
Jung-uk Kim
01b36cb089 Remove an unnecessary hack from ACPICA 20100915 (r212761). 2010-09-16 20:11:40 +00:00
Andriy Gapon
f5aadc99a6 make acpi_hp device a child of acpi_wmi
to properly reflect dependency between the devices/drivers

PR:		kern/147858
Suggested by:	jhb
Tested by:	Maciej Suszko <maciej@suszko.eu>
MFC after:	1 week
2010-09-11 08:09:14 +00:00
Andriy Gapon
9fa1edb882 acpi_hp: fix bus attachment code
- add identify method to create driver's own device_t
- successfully probe only driver's own device_t instead of any device_t
- (ab)use device order to hopefully be probed/attached after acpi_wmi

PR:		kern/147858
Tested by:	Maciej Suszko <maciej@suszko.eu>
MFC after:	1 week
2010-09-06 07:34:32 +00:00
Rui Paulo
daef39e7ae Remove the acpi_aiboost driver. It has been replaced by aibs(4). 2010-07-25 17:55:57 +00:00
Rui Paulo
bbe4a97d41 Import the acpi_aibs(4) driver written by Constantine A. Murenin.
It has more features than acpi_aiboost(4) and it will eventually replace
acpi_aiboost(4).

Submitted by:	Constantine A. Murenin <cnst at FreeBSD.org>
Reviewed by:	freebsd-acpi, imp
MFC after:	1 month
2010-06-25 15:32:46 +00:00
Jung-uk Kim
7b2d603ef0 Fix one more case where a string is passed via format argument instead.
Found by:	clang
2010-06-11 20:08:20 +00:00
Jung-uk Kim
30363a9a9e Remove unused assignment.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 4537, 4538, 4539)
2010-06-11 19:53:42 +00:00
Jung-uk Kim
80fba82198 Fix a possible dereference of null pointer.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 3423)
2010-06-11 18:19:23 +00:00
Jung-uk Kim
f67f8ffd43 Prefer correct and simpler backlight control methods for ASUS G2K laptop. 2010-02-13 02:30:43 +00:00
Gavin Atkinson
b31b20fa02 Add support for a few more Sony-specific ACPI features (default display
brightness, wired LAN power and bass gain), and update the description of
one previously unknown feature (display contrast).  While here, expand on
a comment and remove two defines left over from an old version of the code.

Also update man page to document the above changes, and correct grammar.

PR:		kern/127581
2010-02-07 18:36:30 +00:00
Jung-uk Kim
9a179dd8be Merge ACPICA 20100121. 2010-01-21 21:14:28 +00:00
Mitsuru IWASAKI
a50f74cc3a Update acpi_ibm syctl nodes on resume.
This should fix some Thinkpad specific problems such as
connecting to a headphone jack is not functional on X41.

Reviewed by:	takawata
MFC after:	1 week
2010-01-05 20:29:30 +00:00
John Baldwin
62ec4c19c4 - Numerous whitespace and style fixes.
- More descriptive error messages when failing to parse components during
  attach.
2009-10-29 18:03:16 +00:00
John Baldwin
08bfbfaa08 Remove unnecessary locking from attach(). This fixes a LOR between the
acpi_ibm lock and the sysctl lock.

MFC after:	3 days
2009-09-24 16:51:56 +00:00
John Baldwin
fd0a5b2f1e The elements in the component arrays may be direct Package objects rather
than references to objects.  In that case, simply use the Package directly.

I think a recent change to ACPI-CA is causing the interpreter to
automatically expand these references.

Reported by:	Olivier Smedts  olivier gid0 org
MFC after:	3 days
2009-09-22 18:34:23 +00:00
John Baldwin
5c84347532 Re-remove the IBM0057 ID used for PS/2 mouse controllers. The asl for the
61p includes the hotkey device as IBM0068 and the mouse as IBM0057 similar
to other systems.

Submitted by:	marius
MFC after:	3 days
2009-09-20 13:28:19 +00:00
Rui Paulo
9e760f2578 acpi_hp.c:
- sysctl dev.acpi_hp.0.verbose to toggle debug output
- A modification so this can deal with different array lengths
  when reading the CMI BIOS - now it works ok on HP Compaq nx7300
  as well.
- Change behaviour to query only max_instance-1 CMI BIOS instances,
  because all HPs seen so far are broken in that respect
  (or there is a fundamental misunderstanding on my side, possible
  as well). This way a disturbing ACPI Error Field exceeds Buffer
  message is avoided.
- New bit to set on dev.acpi_hp.0.cmi_detail (0x8) to
  also query the highest guid instance of CMI bios

acpi_hp.4:
- Document dev.acpi_hp.0.verbose sysctl in man page
- Document new bit for dev.acpi_hp.0.cmi_detail
- Add a section to manpage about hardware that has been reported
  to work ok

Submitted by:	Michael Gmelin <freebsdusb at bindone.de>
Approved by:	re (kib)
MFC after:	2 weeks
2009-07-03 21:12:37 +00:00
Rui Paulo
0f73b657a9 acpi_wmi_if:
- Document different semantics for ACPI_WMI_PROVIDES_GUID_STRING_METHOD

acpi_wmi.c:
- Modify acpi_wmi_provides_guid_string_method to return absolut number of
  instances known for the given GUID.

acpi_hp.c:
- sysctl dev.acpi_hp.0.verbose to toggle debug output
- A modification so this can deal with different array lengths
  when reading the CMI BIOS - now it works ok on HP Compaq nx7300
  as well.
- Change behaviour to query only max_instance-1 CMI BIOS instances,
  because all HPs seen so far are broken in that respect
  (or there is a fundamental misunderstanding on my side, possible
  as well). This way a disturbing ACPI Error Field exceeds Buffer
  message is avoided.
- New bit to set on dev.acpi_hp.0.cmi_detail (0x8) to
  also query the highest guid instance of CMI bios

acpi_hp.4:
- Document dev.acpi_hp.0.verbose sysctl in man page
- Document new bit for dev.acpi_hp.0.cmi_detail
- Add a section to manpage about hardware that has been reported
  to work ok

Submitted by:	Michael Gmelin, freebsdusb at bindone.de
Approved by:	re (kib)
MFC after:	2 weeks
2009-06-30 09:51:41 +00:00
Rui Paulo
07bed1516d Fix build with ACPI_DEBUG.
MFC after:	2 weeks
2009-06-23 15:08:03 +00:00
Rui Paulo
df849145b5 * Driver for ACPI WMI (Windows Management Instrumentation)
* Driver for ACPI HP extra functionations, which required
  ACPI WMI driver.

Submitted by:	Michael <freebsdusb at bindone.de>
Approved by:	re
MFC after:	2 weeks
2009-06-23 13:17:25 +00:00
Jung-uk Kim
129d3046ef Import ACPICA 20090521. 2009-06-05 18:44:36 +00:00
Christian Brueffer
e831cd36d0 Remove unused variables.
Found with:	Coverity Prevent(tm)
CID:		544, 545
2009-05-12 23:22:58 +00:00
Attilio Rao
4060f1bbd0 - Add the support for the Asus A3F and A3E device
- Fix style for A3N and for a comment

Submitted by:	Akira Funahashi <funa@funa.org>
Tested by:	Marcin Nowak <marcin.nowak@simplusnet.pl>,
		Diego Sardina <diego.sardina@gmx.com>
PR:		kern/128634
2009-04-04 17:01:32 +00:00
Warner Losh
e3545bcc26 device_shutdown returns int. 2009-02-05 18:39:33 +00:00
Stanislav Sedov
d85f3935ec - Fix incorrect array declaration that was causing the stack overflow
on some (most?) Asus laptops.

Discussed with:	rpaulo
Approved by:	kib (mentor)
MFC after:	2 weeks
2008-12-27 20:48:11 +00:00
Rui Paulo
31fb990621 Add support for Asus A8Sr notebooks.
PR:		128553
Submitted by:	Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Reviewed by:	philip
MFC after:	2 months
2008-11-04 11:52:50 +00:00
Ed Schouten
d172be1fd0 Fix a typo in a comment in the ACPI Fujitsu driver.
The word "hotkys" should read "hotkeys".

Submitted by:	Jille Timmermans <jille quis cx>
2008-09-08 06:29:24 +00:00
Rui Paulo
de32615879 Fix typo in comment. 2008-08-19 22:28:24 +00:00
Dag-Erling Smørgrav
2616144e43 Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.

Obtained from:	Varnish
MFC after:	2 weeks
2008-08-09 11:14:05 +00:00
Rui Paulo
0fc34be4c7 Fix my previous commit. We actually should pass evaluation args in
AcpiEvaluateObject() calls, otherwise, we are not able to bring devices
back up (NULL means 0, hence always off).
While there add missing WLAN on/off support.

MFC after:	3 days
Pointy hat to:	rpaulo
2008-07-04 23:40:53 +00:00
Remko Lodder
aa219554e0 Style fix (space into tab).
Approved by:	imp (mentor, implicit)
2008-06-28 08:36:47 +00:00