small bit of style cleanup; added additional checks to see if a battery was damaged or it is just an empty slot

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV
2011-05-04 23:12:25 +00:00
parent f79510c141
commit 042aefc4ea
3 changed files with 27 additions and 10 deletions
+15 -6
View File
@@ -1,13 +1,19 @@
/*
* Copyright 2004-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef POWER_MANAGMENT_H
#define POWER_MANAGMENT_H
#include <Drivers.h>
// io controls
enum {
enum {
// ioctl response with kMagicFreqID
IDENTIFY_DEVICE = B_DEVICE_OP_CODES_END + 20001,
// CPU Frequence:
// get a list of freq_info, the list is terminated with a element with
// frequency = 0
@@ -20,13 +26,13 @@ enum {
WATCH_CPU_FREQ,
// stop all watching ioctl, ioctl return B_ERROR
STOP_WATCHING_CPU_FREQ,
GET_BATTERY_INFO,
GET_EXTENDED_BATTERY_INFO,
WATCH_BATTERY,
STOP_WATCHING_BATTERY
};
};
// CPU Frequence:
// magic id returned by IDENTIFY_DEVICE
@@ -35,6 +41,7 @@ const uint32 kMagicFreqID = 48921;
#define MAX_CPU_FREQUENCY_STATES 10
typedef struct {
uint16 frequency; // [Mhz]
uint16 volts;
@@ -47,6 +54,8 @@ typedef struct {
// magic id returned by IDENTIFY_DEVICE
const uint32 kMagicACPIBatteryID = 17822;
// Our known battery states
#define BATTERY_DISCHARGING 0x01
#define BATTERY_CHARGING 0x02
#define BATTERY_CRITICAL_STATE 0x04
@@ -73,7 +82,7 @@ typedef struct {
char model_number[32];
char serial_number[32];
char type[32];
char oem_info[32];
char oem_info[32];
} acpi_extended_battery_info;