Welcome
He wants to build the image of the Gargoyle is based on OpenWRT r37768. But I need to patch the drivers option.ci cdc_ncm.c to work with the modem Huawei E3276. Cdc_ncm.c driver patch that was visible on the modem WWAN interface. Unfortunately, I do not know how to do or where to find a good patch for these two files?

To patch was applied to the driver when compiling where should you put it?
Throw to / target/linux/generic/patches-3.3
just do not know what the numbers given in the catalog for file names patch

Kernel 3.3.8 is my gargoyle
Below we wanted to add patches but I do not know if they are good?

--- a/drivers/usb/serial/option.c    2012-06-01 09:16:13.000000000 +0200
+++ b/drivers/usb/serial/option.c    2013-08-25 00:56:10.000000000 +0200
@@ -683,6 +683,7 @@
     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x01) },  /* E398 3G Modem */
     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x02) },  /* E398 3G PC UI Interface */
     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x03) },  /* E398 3G Application Interface */
+    { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x12) },  /* E3276*/
     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
--- a/drivers/net/usb/cdc_ncm.c 2013-08-26 11:48:47.192159927 +0200
 +++ b/drivers/net/usb/cdc_ncm.c 2013-08-26 11:47:02.820163864 +0200
@@ -140,11 +140,35 @@
 static struct usb_driver cdc_ncm_driver;
 static const struct ethtool_ops cdc_ncm_ethtool_ops;
 
+/* Same as cdc_ncm_info, but with FLAG_WWAN */
 +static const struct driver_info wwan_info = {
+ .description = "Mobile Broadband Network Device",
+ .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET
+   | FLAG_WWAN,
+ .bind = cdc_ncm_bind,
 + .unbind = cdc_ncm_unbind,
+ .check_connect = cdc_ncm_check_connect,
+ .manage_power = cdc_ncm_manage_power,
+ .status = cdc_ncm_status,
+ .rx_fixup = cdc_ncm_rx_fixup,
+ .tx_fixup = cdc_ncm_tx_fixup,
+};
 +
 static const struct usb_device_id cdc_devs[] = {
  { USB_INTERFACE_INFO(USB_CLASS_COMM,
   USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
   .driver_info = (unsigned long)&cdc_ncm_info,
  },
+ /* Huawei NCM devices disguised as vendor specific */
 + { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16),
+  .driver_info = (unsigned long)&wwan_info,
+ },
+ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46),
+  .driver_info = (unsigned long)&wwan_info,
 + },
+ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76),
+   .driver_info = (unsigned long)&wwan_info,
+ },
  {
  },
 };

I have a package ipk where drivers are improved(patched for E3276) but Is it possible to decompile the package to extract the files and option.c cdc_ncm.c?

(Last edited by PiterEL on 26 Aug 2013, 13:35)