Transplantation of adding the 3G wireless network interface card function on the MIPs embedded platform (I)

Source: Internet
Author: User

I. Environment

1. Linux kernel of the Development Board: 2.6.28.10

2.3G wireless network adapter: Huawei E303 (vendorid: 12d1 productid: 14fe)

 

Ii. related software:

1.usb-modeswitch-1.1.7.tar: USB device Working Mode Conversion Tool

2.usb-modeswitch-data-20110227.tar: used to configure usb_modeswitch.conf

3.libusb-1.0.8.tar: provides a set of system APIs for usb_modeswitch.

4.libusb-compat-0.1.3.tar: compatible with version 1.0 and 0.1

Iii. Description:

  • 1. Pay attention to parameter settings when configuring. Configure for libusb-1.0.8 and libusb-compat-0.1.3 (specify cross compiler, specify size side settings ):

#. /Configure -- Build = i686-linux -- Host = MIPS-Linux-GNU -- prefix =/home/WSL/libusb-1.0.8/install "cc = MIPS-Linux-GNU-El" "ldflags =- el"

  • 2. Note the following when modifying the MAKEFILE file in USB-modeswitch (Modify the bold part.):

Cc = MIPS-Linux-GNU-gcc
Cflags + =-wall-El
Libs =-lusb-1.0-lusb

Rm =/bin/Rm-F
Objs = usb_modeswitch.c
Prefix = $ (destdir)/usr
Etcdir = $ (destdir)/etc
Udevdir = $ (destdir)/lib/udev
Sbindir = $ (prefix)/sbin
Mandir = $(prefix)/share/man/Man1
Ldflags =-L/home/WSL/libusb-1.0.8/install/lib-L/home/WSL/libusb-compat-0.1.3/install/lib-wl, -R/home/WSL/libusb-1.0.8/install/lib-wl,-r/home/WSL/libusb-compat-0.1.3/install/lib
Includedir1 =-I/home/WSL/libusb-1.0.8/install/include/libusb-1.0
Includedir2 =-I/home/WSL/libusb-compat-0.1.3/install/include
Libdir1 =-L/home/WSL/libusb-1.0.8/install/lib
Libdir2 =-L/home/WSL/libusb-compat-0.1.3/install/lib

. Phony: clean install uninstall

ALL: $ (Prog)

$ (Prog): $ (objs)
$ (Cc)$ (Includedir1) $ (includedir2) $ (libdir1) $ (libdir2)-O $ (Prog) $ (objs) $ (cflags) $ (libs) $ (ldflags)

  • 3. Edit the usb_modeswitch.conf file in the usb_modeswitch directory and add the following content:

# T-Mobile NL (Huawei e352)
#
# Contributor: Alex Hermann

Defaultvendor = 0x12d1
Defaultproduct = 0x14fe

Targetvendor = 0x12d1
Targetproduct = 0x1506

Messagecontent = "55534243123456780000000000000011062000000100000000000000000000"

Messageendpoint = 0x01

Checksuccess = 5

Required weimode = 0

  • 4. Copy the above libusb dynamic library and libusb-compat (under Lib) to the Development Board library directory (/LIB, download the above generated usb_modeswitch executable program (no file type) and usb_modeswitch.conf configuration file to a directory on the Development Board (which is also executed in this place when execution is executed.

  • 5. Compile the driver option of the 3G module. ko: device Drivers ---> USB support ---> <m> USB serial converter support ---> [*] USB generic serial driverh and <m> USB driver for GSM and CDMA modems "must be compiled into modules, ttyusb0, ttyusb1, and ttyusb2 can be generated during subsequent conversions.

Find the USB 3g driver file driver // USB/serial/option. c In the kernel source package, and add the required wei_product_ec1260 0x1446 to the 3G card. Return to the kernel top-level directory make modules and compile usbserial and option into modules usbserial. Ko and option. Ko. Download the compiled usbserial. Ko and option. Ko to the Development Board and load them using insmod.

  • 6. Now you can useUsb_modeswitch-C ~ /Usb_modeswitch.confSwitch the 3G card mode. There will be some information, you will see several serial information after converting to 3G mode, ttyusb0, ttyusb1, ttyusb2

(Print the following results. I do not know whether the result is successful or not)

#./Usb_modeswitch-w-C usb_modeswitch.conf

Reading config file: usb_modeswitch.conf

* Usb_modeswitch: handle USB devices with multiple modes
* Version 1.1.6 (c) Josua dietze 2010
* Based on libusb0 (0.1.12 and above)

! Please report New tolerations!

Defaultvendor = 0x12d1
Defaultproduct = 0x14fe
Targetvendor = 0x12d1
Targetproduct = 0x1506
Targetclass = not set
Targetproductlist = ""

Detachstorageonly = 0
Required weimode = 0
Sierramode = 0
Sonymode = 0
Gctmode = 0
Kobilmode = 0
Messageendpoint = 0x01
Messagecontent = "55534243123456780000000000000011062000000100000000000000000000"
Needresponse = 0
Responseendpoint = not set
Interface = 0x00

Inquiredevice enabled (default)
Success check enabled, Max. Wait time 5 seconds
System integration Mode disabled

Looking for target devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
No devices in target mode or class found
Looking for default devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Found matching product ID
Adding Device
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Found devices in default mode, class or configuration (1)
Accessing device 004 on bus 001...
Getting the current device configuration...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached...
Looking for active driver...
No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
-------------------------
Vendor string: Huawei
Model string: Mass Storage
Revision string: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Huawei
Product: Huawei mobile
Serial No.: not provided
-------------------------
Setting up communication with interface 0...
USB 1-1: usbfs: Process 546 (usb_modeswitch) did not claim interface 0 before use
Using endpoint 0x01 for message sending...
Trying to send message 1 to endpoint 0x01...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
Device is gone, skipping any further commands

Checking for mode switch (max. 5 times, once per second )...
Searching for target devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching for target devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching for target devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching for target devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching for target devices...
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 12d1: 14fe
Found matching vendor ID
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
Searching devices, found usb id 1d6b: 0002
No new devices in target mode or class found

Mode switch has failed. Bye.

#

Print the above results. I do not know whether it is successful or not, but I have no 3G wireless network card that can be paid online. The experiment can only be stopped here, further research is required.

  • (To be continued)

References:

Embedded Linux 3G wireless network card driver _ UP-NETARM2410-ChinaUnix blog environment: hardware: dvs365 Development Board, chip DaVinci dm365. telecommunications Huawei ec189 3G wireless network card. Software: Ti-customized Embedded ARM-Linux, kernel version 2.6.18. introduction: Because the 3G wireless network adapter works in the same mode, most of its porting is the same, so this development is also applicable to other embedded development boards, such as dm6446 and arm. Same

3G Nic used on the Development Board (Mode Conversion)-zhanghaijin0911 column-blog channel-csdn. net has been working on the 3G driver since the start of school. In fact, the driver comes with the kernel, and it is OK to compile it. The key is to convert the default storage mode to the 3G mode, today, the conversion is successful, and the process is recorded. Refer to blog posts! I. Environment 1. Linux kernel: 2.6.30.42.3g card: Huawei ec1261 (ec12

Detailed solution for 3G cards on the Development Board in Linux (applicable to most 3g cards) _ Linux programming _ Linux community-portal website usb_modeswitch is a universal tool for converting the working mode of USB devices, only in Linux can it play a huge role. With the development of mobile communication and wireless communication, more and more devices are made into USB interfaces, such as some wireless network adapters and 3G data cards. Manufacturers of these devices generally provide drivers in windows. When these devices are plugged in for the first time, they are in the CDROM + flash mode, from which drivers can be installed, after the driver is installed, the driver will be converted to the 3G mode, and a usb modem device will appear. Currently, all 3g cards are like this. This is the so-called & ldquo; zerocd & rdquo ;.

The 3G module implements pppoe dial-up Internet MP on the arm Development Board-development documentation-taoke Baba 3G module implements pppoe dial-up Internet MP on the arm Development Board

The topic for migrating Huawei e1750 to dm355-kuangmengjie-blog channel-csdn. net, embedded system environment and hardware 1, kernel: Linux-2.6.102, plate comes with USB interface: usb2.03, 3g nic: Huawei e1750 (of course, also need to go to Unicom to do USIM card, it is about 200 RMB, and 80 RMB/second per month is a universal tool for converting the working mode of USB devices, because generally 3G NICs do not come with Linux drivers, all must be converted. 2、libusb-0.1.12.tar.gz libusb is provided to usb_mode

04_linux dynamic module _ Baidu Library Online interactive document sharing platform. Here, you can share your documents with tens of millions of users. Read the documents of other users in full text, you can also download the document using the points obtained from the shared document.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.