Commit 778071af authored by phdeswer's avatar phdeswer

Merge pull request #43 from nemomobile/diag

[diag] update diag mode to newer android standard. Fixes JB#31988
parents 6e4a9c41 d764ae59
......@@ -7,7 +7,7 @@ network_interface = rndis0
[options]
sysfs_path = /sys/class/android_usb/android0/functions
sysfs_value = rndis,adb,diag,serial
sysfs_value = diag,serial,rmnet,qdss,adb,rndis
sysfs_reset_value = none
softconnect_path = /sys/class/android_usb/android0/enable
softconnect = 1
......@@ -16,4 +16,8 @@ android_extra_sysfs_path = /sys/class/android_usb/android0/f_diag/clients
android_extra_sysfs_value = diag
android_extra_sysfs_path2 = /sys/class/android_usb/android0/f_serial/transports
android_extra_sysfs_value2 = smd
android_extra_sysfs_path3 = /sys/class/android_usb/android0/f_rmnet/transports
android_extra_sysfs_value3 = qti,bam
android_extra_sysfs_path4 = /sys/class/android_usb/android0/f_qdss/transports
android_extra_sysfs_value4 = qti,bam_dmux
idProduct = 0A04
[mode]
name = diag_mode
module = none
appsync = 1
network = 1
network_interface = rndis0
[options]
sysfs_path = /sys/class/android_usb/android0/functions
sysfs_value = rndis,adb,diag,serial
sysfs_reset_value = none
softconnect_path = /sys/class/android_usb/android0/enable
softconnect = 1
softconnect_disconnect = 0
android_extra_sysfs_path = /sys/class/android_usb/android0/f_diag/clients
android_extra_sysfs_value = diag
android_extra_sysfs_path2 = /sys/class/android_usb/android0/f_serial/transports
android_extra_sysfs_value2 = smd
idProduct = 0A04
......@@ -2,3 +2,4 @@
name = adbd.service
mode = diag_mode
systemd = 1
post = 1
[info]
name = adbd-prepare.service
mode = diag_mode
systemd = 1
AC_INIT([usb_moded], [0.85])
AC_INIT([usb_moded], [0.85.1])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_CONFIG_HEADER([config.h])
......
usb-moded (0.85.1) unstable; urgency=low
* [diag] update diag mode to newer android standard.
-- Philippe De Swert <philippe.deswert@jolla.com> Mon, 05 Oct 2015 16:41:10 +0300
usb-moded (0.85) unstable; urgency=low
* [usb-moded] Do not retry network when there is no need.
......
Name: usb-moded
Version: 0.82
Release: 5
Version: 0.85
Release: 1
Summary: USB mode controller
Group: System/System Control
License: LGPLv2
......@@ -117,6 +117,20 @@ system bus.
This package contains the diag config for use with the android
gadget driver.
%package diag-mode-androidv5-qcom
Summary: USB mode controller - android v5 or newer diag mode config for qcom
Group: Config
%description diag-mode-androidv5-qcom
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the diag config for use with the android
gadget driver.
%package acm-mode-android
Summary: USB mode controller - android acm mode config
Group: Config
......@@ -384,8 +398,14 @@ systemctl daemon-reload || :
%files diag-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/diag_mode_old.ini
%{_sysconfdir}/usb-moded/run/adb-diag.ini
%files diag-mode-androidv5-qcom
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/diag_mode.ini
%{_sysconfdir}/usb-moded/run/adb-diag.ini
%{_sysconfdir}/usb-moded/run/diag-adb-prepare.ini
%files acm-mode-android
%defattr(-,root,root,-)
......
......@@ -50,6 +50,10 @@ void list_item_free(mode_list_elem *list_item)
free(list_item->android_extra_sysfs_value);
free(list_item->android_extra_sysfs_path2);
free(list_item->android_extra_sysfs_value2);
free(list_item->android_extra_sysfs_path3);
free(list_item->android_extra_sysfs_value3);
free(list_item->android_extra_sysfs_path4);
free(list_item->android_extra_sysfs_value4);
free(list_item->idProduct);
#ifdef CONNMAN
free(list_item->connman_tethering);
......@@ -142,9 +146,13 @@ static struct mode_list_elem *read_mode_file(const gchar *filename)
list_item->softconnect_path = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_SOFTCONNECT_PATH, NULL);
list_item->android_extra_sysfs_path = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_PATH, NULL);
list_item->android_extra_sysfs_path2 = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_PATH2, NULL);
list_item->android_extra_sysfs_path3 = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_PATH3, NULL);
list_item->android_extra_sysfs_path4 = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_PATH4, NULL);
//log_debug("Android extra mode sysfs path2 = %s\n", list_item->android_extra_sysfs_path2);
list_item->android_extra_sysfs_value = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_VALUE, NULL);
list_item->android_extra_sysfs_value2 = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_VALUE2, NULL);
list_item->android_extra_sysfs_value3 = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_VALUE3, NULL);
list_item->android_extra_sysfs_value4 = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_ANDROID_EXTRA_SYSFS_VALUE4, NULL);
//log_debug("Android extra value2 = %s\n", list_item->android_extra_sysfs_value2);
list_item->idProduct = g_key_file_get_string(settingsfile, MODE_OPTIONS_ENTRY, MODE_IDPRODUCT, NULL);
list_item->nat = g_key_file_get_integer(settingsfile, MODE_OPTIONS_ENTRY, MODE_HAS_NAT, NULL);
......
......@@ -47,6 +47,10 @@ android engineers prefered to have sysfs entries... go figure... */
/* 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"
#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"
/* For windows different modes/usb profiles need their own idProduct */
#define MODE_IDPRODUCT "idProduct"
#define MODE_HAS_NAT "nat"
......@@ -77,6 +81,10 @@ typedef struct mode_list_elem
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 :( */
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 :( */
char *idProduct; /* product id to assign to a specific profile */
int nat; /* If NAT should be set up in this mode or not */
int dhcp_server; /* if a DHCP server needs to be configured and started or not */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment