|
Lines 32-39
Link Here
|
| 32 |
#define ACPI_VIDEO_HEAD_INVALID (~0u - 1) |
32 |
#define ACPI_VIDEO_HEAD_INVALID (~0u - 1) |
| 33 |
#define ACPI_VIDEO_HEAD_END (~0u) |
33 |
#define ACPI_VIDEO_HEAD_END (~0u) |
| 34 |
|
34 |
|
|
|
35 |
static PMClose doLnxACPIOpen(void); |
| 35 |
static void lnxCloseACPI(void); |
36 |
static void lnxCloseACPI(void); |
| 36 |
static pointer ACPIihPtr = NULL; |
37 |
static pointer ACPIihPtr = NULL; |
|
|
38 |
static OsTimerPtr acpiTimer = NULL; |
| 37 |
PMClose lnxACPIOpen(void); |
39 |
PMClose lnxACPIOpen(void); |
| 38 |
|
40 |
|
| 39 |
/* in milliseconds */ |
41 |
/* in milliseconds */ |
|
Lines 52-57
lnxACPIReopen(OsTimerPtr timer, CARD32 t
Link Here
|
| 52 |
|
54 |
|
| 53 |
#define LINE_LENGTH 80 |
55 |
#define LINE_LENGTH 80 |
| 54 |
|
56 |
|
|
|
57 |
static CARD32 |
| 58 |
lnxACPICheckTimer(OsTimerPtr timer, CARD32 now, pointer arg) |
| 59 |
{ |
| 60 |
#if DEBUG |
| 61 |
ErrorF("ACPI: trying to reopen\n"); |
| 62 |
#endif |
| 63 |
if (doLnxACPIOpen()) { |
| 64 |
#if DEBUG |
| 65 |
ErrorF("ACPI: successfully reopened\n"); |
| 66 |
#endif |
| 67 |
acpiTimer = NULL; |
| 68 |
return 0; |
| 69 |
} |
| 70 |
return 5000; |
| 71 |
} |
| 72 |
|
| 55 |
static int |
73 |
static int |
| 56 |
lnxACPIGetEventFromOs(int fd, pmEvent *events, int num) |
74 |
lnxACPIGetEventFromOs(int fd, pmEvent *events, int num) |
| 57 |
{ |
75 |
{ |
|
Lines 132-147
lnxACPIConfirmEventToOs(int fd, pmEvent
Link Here
|
| 132 |
} |
150 |
} |
| 133 |
} |
151 |
} |
| 134 |
|
152 |
|
| 135 |
PMClose |
153 |
static PMClose |
| 136 |
lnxACPIOpen(void) |
154 |
doLnxACPIOpen(void) |
| 137 |
{ |
155 |
{ |
| 138 |
int fd; |
156 |
int fd; |
| 139 |
struct sockaddr_un addr; |
157 |
struct sockaddr_un addr; |
| 140 |
int r = -1; |
158 |
int r = -1; |
| 141 |
|
159 |
|
| 142 |
#ifdef DEBUG |
|
|
| 143 |
ErrorF("ACPI: OSPMOpen called\n"); |
| 144 |
#endif |
| 145 |
if (ACPIihPtr || !xf86Info.pmFlag) |
160 |
if (ACPIihPtr || !xf86Info.pmFlag) |
| 146 |
return NULL; |
161 |
return NULL; |
| 147 |
|
162 |
|
|
Lines 169-174
lnxACPIOpen(void)
Link Here
|
| 169 |
return lnxCloseACPI; |
184 |
return lnxCloseACPI; |
| 170 |
} |
185 |
} |
| 171 |
|
186 |
|
|
|
187 |
PMClose |
| 188 |
lnxACPIPoll(void) |
| 189 |
{ |
| 190 |
TimerSet(NULL, 0, 5000, lnxACPICheckTimer, NULL); |
| 191 |
return lnxCloseACPI; |
| 192 |
} |
| 193 |
|
| 194 |
PMClose |
| 195 |
lnxACPIOpen(void) |
| 196 |
{ |
| 197 |
PMClose ret; |
| 198 |
#ifdef DEBUG |
| 199 |
ErrorF("ACPI: OSPMOpen called\n"); |
| 200 |
#endif |
| 201 |
if (!(ret = doLnxACPIOpen())) |
| 202 |
xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", ACPI_SOCKET, |
| 203 |
strerror(errno)); |
| 204 |
|
| 205 |
return ret; |
| 206 |
} |
| 207 |
|
| 172 |
static void |
208 |
static void |
| 173 |
lnxCloseACPI(void) |
209 |
lnxCloseACPI(void) |
| 174 |
{ |
210 |
{ |
|
Lines 182-186
lnxCloseACPI(void)
Link Here
|
| 182 |
shutdown(fd, 2); |
218 |
shutdown(fd, 2); |
| 183 |
close(fd); |
219 |
close(fd); |
| 184 |
ACPIihPtr = NULL; |
220 |
ACPIihPtr = NULL; |
|
|
221 |
xf86PMGetEventFromOs = NULL; |
| 222 |
xf86PMConfirmEventToOs = NULL; |
| 223 |
if (acpiTimer) { |
| 224 |
TimerCancel(acpiTimer); |
| 225 |
acpiTimer = NULL; |
| 226 |
} |
| 185 |
} |
227 |
} |
| 186 |
} |
228 |
} |