Skip to content

Latest commit

 

History

History
95 lines (78 loc) · 3.87 KB

usb_moded.h

File metadata and controls

95 lines (78 loc) · 3.87 KB
 
Mar 22, 2011
Mar 22, 2011
1
/*
Aug 24, 2018
Aug 24, 2018
2
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
Apr 9, 2019
Apr 9, 2019
3
* Copyright (C) 2012-2019 Jolla. All rights reserved.
Aug 24, 2018
Aug 24, 2018
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
*
* @author: Philippe De Swert <philippe.de-swert@nokia.com>
* @author: Philippe De Swert <philippedeswert@gmail.com>
* @author: Philippe De Swert <philippe.deswert@jollamobile.com>
* @author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
* @author: Andrew den Exter <andrew.den.exter@jolla.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Lesser GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the Lesser GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
Mar 28, 2018
Mar 28, 2018
24
*/
Aug 11, 2017
Aug 11, 2017
25
Aug 24, 2018
Aug 24, 2018
26
27
#ifndef USB_MODED_H_
# define USB_MODED_H_
Mar 22, 2011
Mar 22, 2011
28
Aug 24, 2018
Aug 24, 2018
29
# ifdef STATIC_CONFIG
Sep 5, 2018
Sep 5, 2018
30
# include "../config-static.h" // NOTRIM
Aug 24, 2018
Aug 24, 2018
31
# else
Sep 5, 2018
Sep 5, 2018
32
# include "../config.h" // NOTRIM
Aug 24, 2018
Aug 24, 2018
33
# endif
Apr 26, 2016
Apr 26, 2016
34
Apr 9, 2019
Apr 9, 2019
35
36
# include "usb_moded-dyn-config.h"
Aug 24, 2018
Aug 24, 2018
37
38
# include <stdbool.h>
# include <stdio.h>
Apr 26, 2016
Apr 26, 2016
39
Sep 5, 2018
Sep 5, 2018
40
# include <glib.h>
Aug 24, 2018
Aug 24, 2018
41
42
43
44
/* ========================================================================= *
* Constants
* ========================================================================= */
Apr 26, 2016
Apr 26, 2016
45
Aug 24, 2018
Aug 24, 2018
46
# define USB_MODED_LOCKFILE "/var/run/usb_moded.pid"
Apr 26, 2016
Apr 26, 2016
47
Aug 24, 2018
Aug 24, 2018
48
49
/** Name of the wakelock usb_moded uses for temporary suspend delay */
# define USB_MODED_WAKELOCK_STATE_CHANGE "usb_moded_state"
Apr 26, 2016
Apr 26, 2016
50
Aug 24, 2018
Aug 24, 2018
51
52
/** Name of the wakelock usb_moded uses for input processing */
# define USB_MODED_WAKELOCK_PROCESS_INPUT "usb_moded_input"
Apr 26, 2016
Apr 26, 2016
53
Aug 24, 2018
Aug 24, 2018
54
55
/** How long usb_moded will delay suspend by default [ms] */
# define USB_MODED_SUSPEND_DELAY_DEFAULT_MS 5000
Nov 7, 2016
Nov 7, 2016
56
Aug 24, 2018
Aug 24, 2018
57
58
59
/** How long usb_moded is allowed to block suspend [ms] */
# define USB_MODED_SUSPEND_DELAY_MAXIMUM_MS \
(USB_MODED_SUSPEND_DELAY_DEFAULT_MS * 2)
Mar 24, 2017
Mar 24, 2017
60
Aug 24, 2018
Aug 24, 2018
61
/* ========================================================================= *
Apr 9, 2019
Apr 9, 2019
62
* Prototypes
Aug 24, 2018
Aug 24, 2018
63
64
* ========================================================================= */
Apr 9, 2019
Apr 9, 2019
65
66
67
/* ------------------------------------------------------------------------- *
* USBMODED
* ------------------------------------------------------------------------- */
Sep 5, 2018
Sep 5, 2018
68
Apr 9, 2019
Apr 9, 2019
69
70
71
72
GList *usbmoded_get_modelist (void);
void usbmoded_load_modelist (void);
void usbmoded_free_modelist (void);
const modedata_t *usbmoded_get_modedata (const char *modename);
Apr 9, 2019
Apr 9, 2019
73
modedata_t *usbmoded_dup_modedata (const char *modename);
Apr 9, 2019
Apr 9, 2019
74
75
76
77
78
79
80
81
82
83
84
85
86
87
bool usbmoded_get_rescue_mode (void);
void usbmoded_set_rescue_mode (bool rescue_mode);
bool usbmoded_get_diag_mode (void);
void usbmoded_set_diag_mode (bool diag_mode);
void usbmoded_set_cable_connection_delay(int delay_ms);
int usbmoded_get_cable_connection_delay(void);
void usbmoded_allow_suspend (void);
void usbmoded_delay_suspend (void);
bool usbmoded_can_export (void);
bool usbmoded_init_done_p (void);
void usbmoded_set_init_done (bool reached);
void usbmoded_probe_init_done (void);
void usbmoded_exit_mainloop (int exitcode);
void usbmoded_handle_signal (int signum);
Aug 24, 2018
Aug 24, 2018
88
Apr 9, 2019
Apr 9, 2019
89
90
91
92
93
94
/* ------------------------------------------------------------------------- *
* MAIN
* ------------------------------------------------------------------------- */
int main(int argc, char *argv[]);
Aug 24, 2018
Aug 24, 2018
95
#endif /* USB_MODED_H_ */