Deleted Added
full compact
acpi_battery.c (82372) acpi_battery.c (85556)
1/*-
2 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/acpica/acpi_battery.c 82372 2001-08-26 22:50:15Z msmith $
26 * $FreeBSD: head/sys/dev/acpica/acpi_battery.c 85556 2001-10-26 17:43:05Z iwasaki $
27 */
28
29#include "opt_acpi.h" /* XXX trim includes */
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/proc.h>
33#include <sys/lock.h>
34#include <sys/malloc.h>

--- 25 unchanged lines hidden (view full) ---

60 struct acpi_battdesc battdesc;
61};
62
63static TAILQ_HEAD(,acpi_batteries) acpi_batteries;
64static int acpi_batteries_initted = 0;
65static int acpi_batteries_units = 0;
66static struct acpi_battinfo acpi_battery_battinfo;
67
27 */
28
29#include "opt_acpi.h" /* XXX trim includes */
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/proc.h>
33#include <sys/lock.h>
34#include <sys/malloc.h>

--- 25 unchanged lines hidden (view full) ---

60 struct acpi_battdesc battdesc;
61};
62
63static TAILQ_HEAD(,acpi_batteries) acpi_batteries;
64static int acpi_batteries_initted = 0;
65static int acpi_batteries_units = 0;
66static struct acpi_battinfo acpi_battery_battinfo;
67
68static int
68int
69acpi_battery_get_units(void)
70{
71
72 return (acpi_batteries_units);
73}
74
69acpi_battery_get_units(void)
70{
71
72 return (acpi_batteries_units);
73}
74
75static int
75int
76acpi_battery_get_battdesc(int logical_unit, struct acpi_battdesc *battdesc)
77{
78 int i;
79 struct acpi_batteries *bp;
80
81 if (logical_unit < 0 || logical_unit >= acpi_batteries_units) {
82 return (ENXIO);
83 }

--- 6 unchanged lines hidden (view full) ---

90 return (0);
91 }
92 i++;
93 }
94
95 return (ENXIO);
96}
97
76acpi_battery_get_battdesc(int logical_unit, struct acpi_battdesc *battdesc)
77{
78 int i;
79 struct acpi_batteries *bp;
80
81 if (logical_unit < 0 || logical_unit >= acpi_batteries_units) {
82 return (ENXIO);
83 }

--- 6 unchanged lines hidden (view full) ---

90 return (0);
91 }
92 i++;
93 }
94
95 return (ENXIO);
96}
97
98static int
98int
99acpi_battery_get_battinfo(int unit, struct acpi_battinfo *battinfo)
100{
101 int error;
102 struct acpi_battdesc battdesc;
103
104 error = 0;
105 if (unit == -1) {
106 error = acpi_cmbat_get_battinfo(-1, battinfo);

--- 144 unchanged lines hidden ---
99acpi_battery_get_battinfo(int unit, struct acpi_battinfo *battinfo)
100{
101 int error;
102 struct acpi_battdesc battdesc;
103
104 error = 0;
105 if (unit == -1) {
106 error = acpi_cmbat_get_battinfo(-1, battinfo);

--- 144 unchanged lines hidden ---