Skip to content

Latest commit

 

History

History
105 lines (92 loc) · 4.99 KB

usb_moded-dyn-config.h

File metadata and controls

105 lines (92 loc) · 4.99 KB
 
May 10, 2011
May 10, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
Copyright (C) 2011 Nokia Corporation. All rights reserved.
author: Philippe De Swert <philippe.de-swert@nokia.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
*/
#ifndef USB_MODED_DYN_CONFIG_H_
#define USB_MODED_DYN_CONFIG_H_
#define MODE_DIR_PATH "/etc/usb-moded/dyn-modes"
Sep 10, 2013
Sep 10, 2013
27
#define DIAG_DIR_PATH "/etc/usb-moded/diag"
May 10, 2011
May 10, 2011
28
29
30
31
32
33
#define MODE_ENTRY "mode"
#define MODE_NAME_KEY "name"
#define MODE_MODULE_KEY "module"
#define MODE_NEEDS_APPSYNC_KEY "appsync"
#define MODE_NETWORK_KEY "network"
Sep 18, 2013
Sep 18, 2013
34
#define MODE_MASS_STORAGE "mass_storage"
May 10, 2011
May 10, 2011
35
#define MODE_NETWORK_INTERFACE_KEY "network_interface"
May 27, 2013
May 27, 2013
36
#define MODE_OPTIONS_ENTRY "options"
May 27, 2013
May 27, 2013
37
38
#define MODE_SYSFS_PATH "sysfs_path"
#define MODE_SYSFS_VALUE "sysfs_value"
Jun 18, 2013
Jun 18, 2013
39
#define MODE_SYSFS_RESET_VALUE "sysfs_reset_value"
May 27, 2013
May 27, 2013
40
#define MODE_SOFTCONNECT "softconnect"
Apr 18, 2014
Apr 18, 2014
41
#define MODE_SOFTCONNECT_DISCONNECT "softconnect_disconnect"
May 27, 2013
May 27, 2013
42
#define MODE_SOFTCONNECT_PATH "softconnect_path"
Jul 19, 2013
Jul 19, 2013
43
44
45
46
/* Instead of hard-coding values that never change or have only one option,
android engineers prefered to have sysfs entries... go figure... */
#define MODE_ANDROID_EXTRA_SYSFS_PATH "android_extra_sysfs_path"
#define MODE_ANDROID_EXTRA_SYSFS_VALUE "android_extra_sysfs_value"
Aug 21, 2013
Aug 21, 2013
47
48
49
/* in combined android gadgets we sometime need more than one extra sysfs path or value */
#define MODE_ANDROID_EXTRA_SYSFS_PATH2 "android_extra_sysfs_path2"
#define MODE_ANDROID_EXTRA_SYSFS_VALUE2 "android_extra_sysfs_value2"
Oct 5, 2015
Oct 5, 2015
50
51
52
53
#define MODE_ANDROID_EXTRA_SYSFS_PATH3 "android_extra_sysfs_path3"
#define MODE_ANDROID_EXTRA_SYSFS_VALUE3 "android_extra_sysfs_value3"
#define MODE_ANDROID_EXTRA_SYSFS_PATH4 "android_extra_sysfs_path4"
#define MODE_ANDROID_EXTRA_SYSFS_VALUE4 "android_extra_sysfs_value4"
Aug 23, 2013
Aug 23, 2013
54
55
/* For windows different modes/usb profiles need their own idProduct */
#define MODE_IDPRODUCT "idProduct"
Nov 5, 2015
Nov 5, 2015
56
#define MODE_IDVENDOROVERRIDE "idVendorOverride"
Nov 30, 2013
Nov 30, 2013
57
#define MODE_HAS_NAT "nat"
Dec 10, 2013
Dec 10, 2013
58
#define MODE_HAS_DHCP_SERVER "dhcp_server"
Apr 15, 2015
Apr 15, 2015
59
60
61
#ifdef CONNMAN
#define MODE_CONNMAN_TETHERING "connman_tethering"
#endif
May 10, 2011
May 10, 2011
62
63
64
65
66
67
68
/**
* Struct keeping all the data needed for the definition of a dynamic mode
*/
typedef struct mode_list_elem
{
/*@{ */
Aug 23, 2013
Aug 23, 2013
69
70
71
72
char *mode_name; /* mode name */
char *mode_module; /* needed module for given mode */
int appsync; /* requires appsync or not */
int network; /* bring up network or not */
Sep 18, 2013
Sep 18, 2013
73
int mass_storage; /* Use mass-storage functions */
Aug 23, 2013
Aug 23, 2013
74
75
76
77
78
79
80
81
82
83
84
char *network_interface; /* Which network interface to bring up if network needs to be enabled */
char *sysfs_path; /* path to set sysfs options */
char *sysfs_value; /* option name/value to write to sysfs */
char *sysfs_reset_value; /* value to reset the the sysfs to default */
char *softconnect; /* value to be written to softconnect interface */
char *softconnect_disconnect; /* value to set on the softconnect interface to disable after disconnect */
char *softconnect_path; /* path for the softconnect */
char *android_extra_sysfs_path; /* path for static value that never changes that needs to be set by sysfs :( */
char *android_extra_sysfs_value; /* static value that never changes that needs to be set by sysfs :( */
char *android_extra_sysfs_path2; /* path for static value that never changes that needs to be set by sysfs :( */
char *android_extra_sysfs_value2; /* static value that never changes that needs to be set by sysfs :( */
Oct 5, 2015
Oct 5, 2015
85
86
87
88
char *android_extra_sysfs_path3; /* path for static value that never changes that needs to be set by sysfs :( */
char *android_extra_sysfs_value3; /* static value that never changes that needs to be set by sysfs :( */
char *android_extra_sysfs_path4; /* path for static value that never changes that needs to be set by sysfs :( */
char *android_extra_sysfs_value4; /* static value that never changes that needs to be set by sysfs :( */
Aug 23, 2013
Aug 23, 2013
89
char *idProduct; /* product id to assign to a specific profile */
Nov 5, 2015
Nov 5, 2015
90
char *idVendorOverride; /* Temporary vendor override for special modes used by odms in testing/manufacturing */
Nov 30, 2013
Nov 30, 2013
91
int nat; /* If NAT should be set up in this mode or not */
Dec 10, 2013
Dec 10, 2013
92
int dhcp_server; /* if a DHCP server needs to be configured and started or not */
Apr 15, 2015
Apr 15, 2015
93
94
95
96
#ifdef CONNMAN
char* connman_tethering; /* connman's tethering technology path */
#endif
/*@} */
May 10, 2011
May 10, 2011
97
98
}mode_list_elem;
Sep 18, 2013
Sep 18, 2013
99
/* diag is used to select a secondary configuration location for diagnostic purposes */
Sep 10, 2013
Sep 10, 2013
100
GList *read_mode_list(int diag);
Oct 22, 2013
Oct 22, 2013
101
102
103
void list_item_free(mode_list_elem *list_item);
void free_mode_list(GList *modelist);
May 10, 2011
May 10, 2011
104
105
#endif /* USB_MODED_DYN_CONFIG_H_ */