如何使华为 E3276 工作

如何使华为 E3276 工作

我的新华为 E3276 USB 调制解调器有问题。我找到了一个解决方案,引用如下(原帖:https://answers.launchpad.net/ubuntu/+source/gnome-nettool/+question/211095):

“在 Linux 社区的支持下,华为 E3276 现在已得到支持(请参阅此处的帖子http://lists.freedesktop.org/archives/libqmi-devel/2012-November/thread.html)。您需要更新 cdc_ncm.ko 驱动程序,然后连接

echo -e "AT^NDISDUP=1,1,\"online.telia.se\"\r" > /dev/ttyUSB0
dhclient wwan0

假设您已经预先配置了 usb 模式切换:

echo "12d1 1506" > /sys/bus/usb-serial/drivers/option1/new_id

与瑞典 Telia 合作。

Bjorn 很快会把这个推送到 Linux 主分支,但如果你急于破解,你可以更新

drivers/net/usb/cdc_ncm.c 

有了这个:

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 4cd582a..74fab1a 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -540,10 +540,12 @@ advance:
  (ctx->ether_desc == NULL) || (ctx->control != intf))
   goto error;

- /* claim interfaces, if any */
- temp = usb_driver_claim_interface(driver, ctx->data, dev);
- if (temp)
- goto error;
+ /* claim data interface, if different from control */
+ if (ctx->data != ctx->control) {
+ temp = usb_driver_claim_interface(driver, ctx->data, dev);
+ if (temp)
+ goto error;
+ }

  iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber;

@@ -623,6 +625,10 @@ static void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf)

  tasklet_kill(&ctx->bh);

+ /* handle devices with combined control and data interface */
+ if (ctx->control == ctx->data)
+ ctx->data = NULL;
+
   /* disconnect master --> disconnect slave */
  if (intf == ctx->control && ctx->data) {
   usb_set_intfdata(ctx->data, NULL);
@@ -1245,6 +1251,14 @@ static const struct usb_device_id cdc_devs[] = {
     .driver_info = (unsigned long) &wwan_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,
+ },
+
  /* Generic CDC-NCM devices */
  { USB_INTERFACE_INFO(USB_CLASS_COMM,
   USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),"

我刚刚安装了 Ubuntu 12.10,我的问题首先是我不知道如何编辑

drivers/net/usb/cdc_ncm.c. 

我是否需要先安装某些东西才能编辑cdc_ncm.c?感谢您的帮助!

相关内容