I have made the following changes intended for :
  CE:MW:Shared / usb-moded

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/7656

Thank You,
philippedeswert

[This message was auto-generated]

---

Request # 7656:

Messages from BOSS:

State: review at 2013-01-11T20:51:02 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:philippedeswert:branches:CE:MW:Shared / usb-moded -> 
CE:MW:Shared / usb-moded
  
changes files:
--------------
--- usb-moded.changes
+++ usb-moded.changes
@@ -0,0 +1,5 @@
+* Fri Jan 11 2013 Philippe De Swert <[email protected]> - 0.56
+- Fix possible compiltation issue with N900 support and android which are 
mutually exclusive
+- Fix g_file_storage fallback which did not work anymore with kmod
+- Warn when using dbus methods to change mode when not connected
+

old:
----
  usb-moded-0.55.tar.bz2

new:
----
  usb-moded-0.56.tar.bz2

spec files:
-----------
--- usb-moded.spec
+++ usb-moded.spec
@@ -1,5 +1,5 @@
 Name:     usb-moded
-Version:  0.55
+Version:  0.56
 Release:  0 
 Summary:  USB mode controller
 Group:    System/System Control

other changes:
--------------

++++++ usb-moded-0.55.tar.bz2 -> usb-moded-0.56.tar.bz2
--- configure.ac
+++ configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([usb_moded], [0.55])
+AC_INIT([usb_moded], [0.56])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 
 AM_CONFIG_HEADER([config.h])
--- debian/changelog
+++ debian/changelog
@@ -1,3 +1,11 @@
+usb-moded (0.56) unstable; urgency=low
+
+  * Fix possible compiltation issue with N900 support and android which are 
mutually exclusive
+  * Fix g_file_storage fallback which did not work anymore with kmod
+  * Warn when using dbus methods to change mode when not connected
+
+ -- Philippe De Swert <[email protected]> Fri, 11 Jan 2013 
18:57:58 +0200
+
 usb-moded (0.55) unstable; urgency=low
 
   * Add android gadget driver support
--- docs/usb_moded-doc.txt
+++ docs/usb_moded-doc.txt
@@ -213,3 +213,26 @@
 mode = mass_storage
 property = TRIGGER_CMD
 
+
+Softconnect support
+-------------------
+
+In some cases gadget drivers are not active by default. (for example with the 
android gadget driver)
+As there is no standard softconnect path, to use this feature it will have to 
be enabled 
+in the config file.
+
+[soft_connect]
+soft_connect_path = /path/where/softconnect/is
+
+NOTE: It is expected that the value to connect is "connect", and "disconnect" 
to disconnect.
+
+Android gadget driver support
+-----------------------------
+
+This will need usb_moded to be compiled after being configured with 
--enable-android 
+The regular gadget support will not work anymore as the android gadget driver 
is 
+supposed to be used built-in. A thusly build usb_moded will be usable on stock
+android kernels.
+
+atm only networking mode is fully supported, mass-storage partly.
+
--- src/usb_moded-dbus.c
+++ src/usb_moded-dbus.c
@@ -94,7 +94,10 @@
                {
                                /* check if usb is connected, since it makes no 
sense to change mode if it isn't */
                                if(!get_usb_connection_state())
+                               {
+                                       log_warning("USB not connected, not 
changing mode!\n");
                                        goto error_reply;
+                               }
                                /* check if the mode exists */
                                if(valid_mode(use))
                                        goto error_reply;
--- src/usb_moded-modesetting.c
+++ src/usb_moded-modesetting.c
@@ -245,6 +245,7 @@
   return 0;
 }
 
+#ifndef ANDROID
 #ifdef N900
 int set_ovi_suite_mode(void)
 {
@@ -277,6 +278,7 @@
   return(0);
 }
 #endif /* N900 */
+#endif /* ANDROID */
 
 #ifdef DYN_MODE
 int set_dynamic_mode(struct mode_list_elem *data)
@@ -399,6 +401,7 @@
                 }
 
         }
+#ifndef ANDROID
 #ifdef N900
         if(!strcmp(module, MODULE_NETWORK))
         {
@@ -413,6 +416,7 @@
                system("killall -SIGTERM acm");
         }
 #endif /* N900 */
+#endif /* ANDROID */
        if(!strcmp(module, MODULE_MTP))
        {
                /* stop service before umounting ;) */
--- src/usb_moded-modules.c
+++ src/usb_moded-modules.c
@@ -76,8 +76,12 @@
        const char *charging_args = NULL;
 
        ret = kmod_module_new_from_name(ctx, module, &mod);
-       if(!strcmp(module, MODULE_MASS_STORAGE) && (ret != 0))
+       /* since kmod_module_new_from_name does not check if the module
+           exists we test it's path in case we deal with the mass-storage one 
*/
+       if(!strcmp(module, MODULE_MASS_STORAGE) && 
+           (kmod_module_get_path(mod) == NULL))
        {
+         log_debug("Fallback on older g_file_storage\n");  
          ret = kmod_module_new_from_name(ctx, MODULE_FILE_STORAGE, &mod);
        }
        if(!strcmp(module, MODULE_CHARGING) && (ret != 0))
@@ -114,6 +118,7 @@
 int usb_moded_unload_module(const char *module)
 {
        int ret = 0;
+       const char * softconnect;
 
 #ifdef NO_KMOD
        gchar *command;
@@ -129,6 +134,12 @@
        kmod_module_unref(mod);
 
 #endif /* NO_KMOD */
+       softconnect = get_soft_connect_path();
+       if(softconnect) 
+       {
+               write_to_file(softconnect, "disconnect");
+               free((void *)softconnect);
+       }
 
        return(ret);
 }
@@ -253,7 +264,7 @@
        /* if we have MODULE_MASS_STORAGE it might be MODULE_FILE_STORAGE might
           be loaded. So check and unload that one if unloading fails first 
time */
        if(failure && !strcmp(MODULE_MASS_STORAGE, module))
-               failure = usb_moded_unload_module(module);
+               failure = usb_moded_unload_module(MODULE_FILE_STORAGE);
 
        while(failure)
        {
--- src/usb_moded.c
+++ src/usb_moded.c
@@ -257,6 +257,7 @@
        net = usb_network_up(); 
        goto end;
   }
+#ifndef ANDROID
 #ifdef N900 
   else if(!strcmp(mode, MODE_OVI_SUITE))
   {
@@ -268,6 +269,7 @@
        goto end;
   } 
 #endif /* N900 */
+#endif /* ANDROID */
 
   else if(!strcmp(mode, MODE_WINDOWS_NET))
   {    



Reply via email to