赞
踩
1、make menuconfig
需要支持
Kenrel modules -> USB Support -> kmod-usb-net -> kmod-usb-net-rndis
2、添加配置。
内核文件路径大致如下
openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7628/linux-3.18.29/drivers/usb/serial/option.c
修改两个文件 :
注意 P_ID 和 V_ID 需要使用对应的地址(可在官方手册上查)。 1) option.c 第一个位置: static const struct usb_device_id option_ids[] = { //+add by airm2m for Air72x { USB_DEVICE(0x1782, 0x4e00) }, //-add by airm2m for Air72x *** } 第二个位置: #ifdef CONFIG_PM .suspend = usb_wwan_suspend, .resume = usb_wwan_resume, //+add by airm2m for Air726 .reset_resume = usb_wwan_resume, //-add by airm2m for Air726 *** 第三个位置(避免当成usb存储设备): static int option_probe(struct usb_serial *serial, const struct usb_device_id *id) { *** if (is_blacklisted( iface_desc->bInterfaceNumber, OPTION_BLACKLIST_RESERVED_IF, (const struct option_blacklist_info *) id->driver_info)) return -ENODEV; //+add by airm2m for Air72x if(dev_desc->idVendor == cpu_to_le16(0x1782) && dev_desc->idProduct == cpu_to_le16(0x4e00) && iface_desc->bInterfaceNumber <= 1) return -ENODEV; //-add by airm2m for Air72x *** } 2) usb_wwan.c文件 static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, int endpoint, int dir, void *ctx, char *buf, int len, void (*callback) (struct urb *)) { struct usb_serial *serial = port->serial; struct urb *urb; urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ if (!urb) return NULL; usb_fill_bulk_urb(urb, serial->dev, usb_sndbulkpipe(serial->dev, endpoint) | dir, buf, len, callback, ctx); //+add by airm2m for Air72x if(dir == USB_DIR_OUT){ struct usb_device_descriptor *desc = &serial->dev->descriptor; if(desc->idVendor == cpu_to_le16(0x1782) && desc->idProduct == cpu_to_le16(0x4e00)) { urb->transfer_flags |= URB_ZERO_PACKET; } } //-add by airm2m for Air72x *** } 3、修改内核 make kernel_menuconfig 勾选如下: [*] Device Drivers → [*] USB Support → <*>Support for Host-side USB → [*] USB Serial Converter support → [*] USB driver for GSM and CDMA modems 重新编译 make V=s
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。