Commit 30b91586 authored by Philippe De Swert's avatar Philippe De Swert

* N900 Meego support improvements

* Autplay improvements for windows
Signed-off-by: default avatarPhilippe De Swert <phdeswer@lumi.maa>
parent 322e7e30
AC_INIT([usb_moded], [0.34])
AC_INIT([usb_moded], [0.35])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_CONFIG_HEADER([config.h])
......@@ -45,12 +45,21 @@ AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
AC_ARG_ENABLE([nokia], AS_HELP_STRING([--enable-nokia], [Enable Nokia extra's @<:@default=false@:>@]),
[case "${enableval}" in
yes) nokia=true ; CFLAGS="-DNOKIA $CFLAGS" ;;
yes) nokia=true ; CFLAGS="-DNOKIA -DN900 $CFLAGS" ;;
no) nokia=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-nokia]) ;;
esac],[nokia=false])
AM_CONDITIONAL([NOKIA], [test x$nokia = xtrue])
AC_ARG_ENABLE([n900], AS_HELP_STRING([--enable-n900], [Enable N900 extra's @<:@default=false@:>@]),
[case "${enableval}" in
yes) n900=true ; CFLAGS="-DN900 $CFLAGS" ;;
no) n900=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-n900]) ;;
esac],[n900=false])
AM_CONDITIONAL([N900], [test x$n900 = xtrue])
AC_ARG_ENABLE([bme], AS_HELP_STRING([--enable-bme], [Enable Nokia bme cable connection interface @<:@default=false@:>@]),
[case "${enableval}" in
yes) bme=true ; CFLAGS="-DBME $CFLAGS" ;;
......
usb-moded (0.35) unstable; urgency=low
* Have g_nokia support for N900 on Meego
* Increase mass-storage file export timeout to make sure autoplay keeps working
on Windows(tm)
-- Philippe De Swert <philippe.de-swert@nokia.com> Fri, 15 Apr 2011 16:30:08 +0300
usb-moded (0.34) unstable; urgency=low
* Fixes for USB autoplay. Fixes: NB#220474
......
......@@ -186,14 +186,14 @@ const char * find_cdrom_path(void)
g_key_file_free(settingsfile);
return(ret);
}
keys = g_key_file_get_keys (settingsfile, CDROM_PATH_ENTRY, NULL, NULL);
keys = g_key_file_get_keys (settingsfile, CDROM_ENTRY, NULL, NULL);
if(keys == NULL)
return ret;
while (*keys != NULL)
{
if(!strcmp(*keys, CDROM_PATH_KEY))
{
tmp_char = g_key_file_get_string(settingsfile, CDROM_PATH_ENTRY, *keys, NULL);
tmp_char = g_key_file_get_string(settingsfile, CDROM_ENTRY, *keys, NULL);
if(tmp_char)
{
log_debug("cdrom key value = %s\n", tmp_char);
......@@ -205,4 +205,35 @@ const char * find_cdrom_path(void)
g_key_file_free(settingsfile);
return(ret);
}
int find_cdrom_timeout(void)
{
GKeyFile *settingsfile;
gboolean test = FALSE;
gchar **keys;
int ret = 0;
settingsfile = g_key_file_new();
test = g_key_file_load_from_file(settingsfile, FS_MOUNT_CONFIG_FILE, G_KEY_FILE_NONE, NULL);
if(!test)
{
log_debug("no conffile\n");
g_key_file_free(settingsfile);
return(ret);
}
keys = g_key_file_get_keys (settingsfile, CDROM_ENTRY, NULL, NULL);
if(keys == NULL)
return ret;
while (*keys != NULL)
{
if(!strcmp(*keys, CDROM_TIMEOUT_KEY))
{
ret = g_key_file_get_integer(settingsfile, CDROM_ENTRY, *keys, NULL);
log_debug("key value = %d\n", ret);
}
keys++;
}
g_key_file_free(settingsfile);
return(ret);
}
#endif /* NOKIA */
......@@ -31,8 +31,9 @@
#define ALT_MOUNT_KEY "mount"
#define UDEV_PATH_ENTRY "udev"
#define UDEV_PATH_KEY "path"
#define CDROM_PATH_ENTRY "cdrom"
#define CDROM_ENTRY "cdrom"
#define CDROM_PATH_KEY "path"
#define CDROM_TIMEOUT_KEY "timeout"
const char * find_mounts(void);
int find_sync(void);
......@@ -43,4 +44,5 @@ const char * find_udev_path(void);
#ifdef NOKIA
const char * find_cdrom_path(void);
int find_cdrom_timeout(void);
#endif
......@@ -130,8 +130,8 @@ umount: command = g_strconcat("mount | grep ", mounts[i], NULL);
ret = 0;
}
/* activate mounts after sleeping 1s to be sure enumeration happened and autoplay will work */
sleep(1);
/* activate mounts after sleeping 1s to be sure enumeration happened and autoplay will work in windows*/
usleep(1800);
for(i=0 ; mounts[i] != NULL; i++)
{
sprintf(command2, "echo %i > /sys/devices/platform/musb_hdrc/gadget/gadget-lun%d/nofua", fua, i);
......@@ -152,10 +152,14 @@ umount: command = g_strconcat("mount | grep ", mounts[i], NULL);
}
#ifdef NOKIA
#ifdef N900
int set_ovi_suite_mode(GList *applist)
{
int net = 0;
#ifdef NOKIA
int timeout = 1;
#endif /* NOKIA */
#ifdef APP_SYNC
/* do not go through the appsync routine if there is no applist */
......@@ -171,12 +175,18 @@ int set_ovi_suite_mode(GList *applist)
if(net)
net = system("ifdown usb0 ; ifup usb0");
#ifdef NOKIA
/* timeout for exporting CDROM image */
timeout = find_cdrom_timeout();
g_timeout_add_seconds(1, export_cdrom, NULL);
#endif /* NOKIA */
return(0);
}
#endif /* N900 */
#ifdef NOKIA
gboolean export_cdrom(gpointer data)
{
const char *path = NULL, *command = NULL;
......@@ -262,7 +272,7 @@ int usb_moded_mode_cleanup(const char *module)
}
}
#ifdef NOKIA
#ifdef N900
if(!strcmp(module, MODULE_NETWORK))
{
/* preventive sync in case of bad quality mtp clients */
......@@ -274,7 +284,7 @@ int usb_moded_mode_cleanup(const char *module)
/* DIRTY WORKAROUND: acm/phonet does not work as it should, remove when it does */
system("killall -SIGTERM acm");
}
#endif /* NOKIA */
#endif /* N900 */
return(ret);
......
......@@ -156,6 +156,7 @@ kill:
system("for i in `lsof -t /dev/mtp*`; do kill -9 $i ; done");
/* try again since there seem to be hard to kill processes there */
system("killall -9 obexd");
system("killall -9 msycnd");
success = usb_moded_unload_module(module);
}
......
......@@ -207,7 +207,7 @@ void set_usb_mode(const char *mode)
goto end;
}
#ifdef NOKIA
#ifdef N900
if(!strcmp(mode, MODE_OVI_SUITE))
{
check_module_state(MODULE_NETWORK);
......@@ -216,7 +216,7 @@ void set_usb_mode(const char *mode)
if(!ret)
ret = set_ovi_suite_mode(applist);
}
#endif /* NOKIA */
#endif /* N900 */
if(!strcmp(mode, MODE_WINDOWS_NET))
{
......
......@@ -8,3 +8,7 @@ nofua = 1
[altmount]
mount = /home/user/MyDocs
[cdrom]
path =
timeout =
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