Advertisement
Guest User

g_nokia.diff

a guest
Sep 6th, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.50 KB | None | 0 0
  1. diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c
  2. index 9b89035..e85bccc 100644
  3. --- a/drivers/usb/gadget/nokia.c
  4. +++ b/drivers/usb/gadget/nokia.c
  5. @@ -18,9 +18,9 @@
  6.  #include <linux/kernel.h>
  7.  #include <linux/device.h>
  8.  
  9. -#include "u_serial.h"
  10. +//#include "u_serial.h"
  11.  #include "u_ether.h"
  12. -#include "u_phonet.h"
  13. +//#include "u_phonet.h"
  14.  #include "gadget_chips.h"
  15.  
  16.  /* Defines */
  17. @@ -38,10 +38,10 @@
  18.   * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
  19.   */
  20.  #define USBF_OBEX_INCLUDED
  21. -#include "f_mass_storage.c"
  22. -#include "f_ecm.c"
  23. +//#include "f_mass_storage.c"
  24. +//#include "f_ecm.c"
  25.  //#include "f_obex.c"
  26. -#include "f_phonet.c"
  27. +//#include "f_phonet.c"
  28.  #include "u_ether.c"
  29.  
  30.  /*-------------------------------------------------------------------------*/
  31. @@ -98,6 +98,7 @@ MODULE_LICENSE("GPL");
  32.  
  33.  /*-------------------------------------------------------------------------*/
  34.  
  35. +#if 0
  36.  static struct fsg_module_parameters fsg_mod_data = {
  37.     .stall = 0,
  38.     .luns = 2,
  39. @@ -108,12 +109,16 @@ static struct fsg_module_parameters fsg_mod_data = {
  40.  FSG_MODULE_PARAMETERS(/* no prefix */, fsg_mod_data);
  41.  
  42.  static struct fsg_common fsg_common;
  43. +#endif
  44.  
  45. +#if 0
  46.  static struct usb_function *f_acm_cfg1;
  47.  static struct usb_function *f_acm_cfg2;
  48. +#endif
  49.  static u8 hostaddr[ETH_ALEN];
  50.  static struct eth_dev *the_dev;
  51.  
  52. +/*
  53.  enum {
  54.     TTY_PORT_OBEX0,
  55.     TTY_PORT_OBEX1,
  56. @@ -121,6 +126,7 @@ enum {
  57.  };
  58.  
  59.  static unsigned char tty_lines[TTY_PORTS_MAX];
  60. +*/
  61.  
  62.  static struct usb_configuration nokia_config_500ma_driver = {
  63.     .label      = "Bus Powered",
  64. @@ -138,16 +144,18 @@ static struct usb_configuration nokia_config_100ma_driver = {
  65.     .MaxPower   = 100,
  66.  };
  67.  
  68. -static struct usb_function_instance *fi_acm;
  69. +//static struct usb_function_instance *fi_acm;
  70.  
  71.  static int __init nokia_bind_config(struct usb_configuration *c)
  72.  {
  73. -   struct usb_function *f_acm;
  74. +// struct usb_function *f_acm;
  75.     int status = 0;
  76.  
  77. +/*
  78.     status = phonet_bind_config(c);
  79.     if (status)
  80.         printk(KERN_DEBUG "could not bind phonet config\n");
  81. +*/
  82.  
  83.  /*
  84.     status = obex_bind_config(c, tty_lines[TTY_PORT_OBEX0]);
  85. @@ -159,6 +167,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
  86.         printk(KERN_DEBUG "could not bind obex config %d\n", 0);
  87.  */
  88.  
  89. +#if 0
  90.     f_acm = usb_get_function(fi_acm);
  91.     if (IS_ERR(f_acm))
  92.         return PTR_ERR(f_acm);
  93. @@ -176,17 +185,20 @@ static int __init nokia_bind_config(struct usb_configuration *c)
  94.         f_acm_cfg1 = f_acm;
  95.     else
  96.         f_acm_cfg2 = f_acm;
  97. +#endif
  98.  
  99. +/*
  100.     status = fsg_bind_config(c->cdev, c, &fsg_common);
  101.     if (status)
  102.         printk(KERN_DEBUG "could not bind fsg config\n");
  103.     fsg_common_put(&fsg_common);
  104. +*/
  105.  
  106.     return status;
  107.  err_ecm:
  108. -   usb_remove_function(c, f_acm);
  109. +// usb_remove_function(c, f_acm);
  110.  err_conf:
  111. -   usb_put_function(f_acm);
  112. +// usb_put_function(f_acm);
  113.     return status;
  114.  }
  115.  
  116. @@ -194,10 +206,11 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
  117.  {
  118.     struct usb_gadget   *gadget = cdev->gadget;
  119.     int         status;
  120. -   int         cur_line;
  121. +// int         cur_line;
  122.     void            *retp;
  123. -   struct fsg_config   fsg_cfg;
  124. +// struct fsg_config   fsg_cfg;
  125.  
  126. +/*
  127.     status = gphonet_setup(cdev->gadget);
  128.     if (status < 0)
  129.         goto err_phonet;
  130. @@ -207,6 +220,7 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
  131.         if (status)
  132.             goto err_ether;
  133.     }
  134. +*/
  135.  
  136.     the_dev = gether_setup(cdev->gadget, hostaddr);
  137.     if (IS_ERR(the_dev)) {
  138. @@ -214,6 +228,7 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
  139.         goto err_ether;
  140.     }
  141.  
  142. +/*
  143.     fsg_config_from_params(&fsg_cfg, &fsg_mod_data);
  144.     fsg_cfg.vendor_name = "Nokia";
  145.     fsg_cfg.product_name = "N900";
  146. @@ -222,6 +237,7 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
  147.         status = PTR_ERR(retp);
  148.         goto err_fsg;
  149.     }
  150. +*/
  151.  
  152.     status = usb_string_ids_tab(cdev, strings_dev);
  153.     if (status < 0)
  154. @@ -235,9 +251,9 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
  155.     if (!gadget_supports_altsettings(gadget))
  156.         goto err_usb;
  157.  
  158. -   fi_acm = usb_get_function_instance("acm");
  159. -   if (IS_ERR(fi_acm))
  160. -       goto err_usb;
  161. +// fi_acm = usb_get_function_instance("acm");
  162. +// if (IS_ERR(fi_acm))
  163. +//     goto err_usb;
  164.  
  165.     /* finally register the configuration */
  166.     status = usb_add_config(cdev, &nokia_config_500ma_driver,
  167. @@ -256,34 +272,34 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
  168.     return 0;
  169.  
  170.  err_put_cfg1:
  171. -   usb_put_function(f_acm_cfg1);
  172. +// usb_put_function(f_acm_cfg1);
  173.  err_acm_inst:
  174. -   usb_put_function_instance(fi_acm);
  175. +// usb_put_function_instance(fi_acm);
  176.  err_usb:
  177. -   fsg_common_put(&fsg_common);
  178. +// fsg_common_put(&fsg_common);
  179.  err_fsg:
  180.     gether_cleanup(the_dev);
  181.  err_ether:
  182. -   cur_line--;
  183. -   while (cur_line >= 0)
  184. -       gserial_free_line(tty_lines[cur_line--]);
  185. +// cur_line--;
  186. +// while (cur_line >= 0)
  187. +//     gserial_free_line(tty_lines[cur_line--]);
  188.  
  189. -   gphonet_cleanup();
  190. +// gphonet_cleanup();
  191.  err_phonet:
  192.     return status;
  193.  }
  194.  
  195.  static int __exit nokia_unbind(struct usb_composite_dev *cdev)
  196.  {
  197. -   int i;
  198. +// int i;
  199.  
  200. -   usb_put_function(f_acm_cfg1);
  201. -   usb_put_function(f_acm_cfg2);
  202. -   usb_put_function_instance(fi_acm);
  203. -   gphonet_cleanup();
  204. +// usb_put_function(f_acm_cfg1);
  205. +// usb_put_function(f_acm_cfg2);
  206. +// usb_put_function_instance(fi_acm);
  207. +// gphonet_cleanup();
  208.  
  209. -   for (i = 0; i < TTY_PORTS_MAX; i++)
  210. -       gserial_free_line(tty_lines[i]);
  211. +// for (i = 0; i < TTY_PORTS_MAX; i++)
  212. +//     gserial_free_line(tty_lines[i]);
  213.  
  214.     gether_cleanup(the_dev);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement