华为usb共享网络 linux,arm linux下调试Huawei的3G USB 上网模块12d1:1505总结

内核版本:linux-2.6.36.4

SCSI必须配置:

CONFIG_SCSI_MOD=y

CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y

CONFIG_BLK_DEV_SR=y

CONFIG_BLK_DEV_SR_VENDOR=y

CONFIG_CHR_DEV_SG=y

USB必须配置:

CONFIG_USB_SUPPORT=y

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB=y

CONFIG_USB_OHCI_HCD=y

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

CONFIG_USB_STORAGE=m

CONFIG_USB_LIBUSUAL=y

CONFIG_USB_SERIAL=y

CONFIG_USB_SERIAL_WWAN=m

CONFIG_USB_SERIAL_OPTION=m

编译后将产生模块:usb_wwan.ko、option.ko和usb-storage.ko

插入模块顺序:

insmod usb_wwan.ko

insmod option.ko

insmod usb-storage.ko

必须修改的源码:

文件:drivers/usb/storage/initializers.c

增加:

int usb_stor_huawei_init(struct us_data *us)

{

int result = 0;

us->iobuf[0] = 0x0;

result = usb_stor_control_msg(us, us->send_ctrl_pipe,

USB_REQ_SET_FEATURE,

USB_TYPE_STANDARD | USB_RECIP_DEVICE,

0x01, 0x0, us->iobuf, 0x0, 1000);

US_DEBUGP("usb_control_msg performing result is %d\n", result);

return 0;

}

int usb_stor_huawei_scsi_init(struct us_data *us)

{

int result = 0;

int act_len = 0;

unsigned char cmd[32] = {0x55, 0x53, 0x42, 0x43, 0xEE, 0x00, 0x00, 0x00,

0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x11,

0x06, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

result = usb_stor_bulk_transfer_buf (us, us->send_bulk_pipe, cmd, 31, &act_len);

US_DEBUGP("usb_stor_bulk_transfer_buf performing result is %d, transfer the actual length=%d\n",

result, act_len);

return result;

}

文件:drivers/usb/storage/initializers.h

增加:

int usb_stor_huawei_init(struct us_data *us);

int usb_stor_huawei_scsi_init(struct us_data *us);

文件:drivers/usb/storage/unusual_devs.h

增加:

UNUSUAL_DEV(  0x12d1, 0x1505, 0x0000, 0x0000,

"HUAWEI MOBILE",

"Mass Storage",

US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_scsi_init,

0),

总结:这款USB上网转换模块就是垃圾,还必须做个USB模式切换。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值