Integration Userguide for Huawei Dongles

139
Integration Userguide for Huawei Dongles Issue 02 Date 2017-01-04

Transcript of Integration Userguide for Huawei Dongles

Page 1: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles

Issue 02 Date 2017-01-04

Page 2: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Revision Record Revision version Change description Date 01 Initial release 2015-08-25 02 Add some cases 2017-01-04

Page 3: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 1

Table of Contents 1. Copyright Statement ............................................................................................ 4 2. Overview ............................................................................................................. 6 3. Guide to Kernel Driver Integration in Embedded Linux & Android for Huawei Dongles ..................................................................................................................... 7

3.1. Purpose ................................................................................................. 7 3.2. Scope ..................................................................................................... 7 3.3. Overview................................................................................................ 7

3.3.1. Linux Kernel Driver Architecture Supporting Huawei Dongles ............ 7 3.4. Schemes for Integrating Drivers into Linux Kernel .................................... 9

3.4.1. Procedure for Integrating the usb-storage Driver .............................. 9 3.4.2. Procedure for Integrating the usb-storage Driver into Linux Kernel with the Version 2.6.29 or Earlier ............................................................... 10 3.4.3. Procedure for Integrating the usb-storage Driver into Linux Kernel with the Version Later than 2.6.29 ............................................................. 13 3.4.4. Revising Driver Files for Integrating the USB Serial Port Driver ......... 17 3.4.5. Revising Driver Files for Integrating the USB Network Port Driver .... 23 3.4.6. Modifying the Compilation Configuration of Linux .......................... 29

3.5. Appendix.............................................................................................. 37 3.5.1. Checking the Integration Result ...................................................... 37 3.5.2. Checking the Current Port Mapping of Huawei Dongles .................. 38

3.6. Notes ................................................................................................... 39 3.6.1. In GSM mode, the data card need large electric current when search network, if the ability of the hardware power supply shortage could lead to data card restart........................................................................................ 39 3.6.2. Close AT echo. It is need to send ate0 command to close the AT echo before send other AT command. ................................................................ 40

4. modem dialing process ...................................................................................... 41 4.1. modem dialing process ......................................................................... 41

5. ndis dialing process ........................................................................................... 43 5.1. Gateway uses the NDIS method Description .......................................... 43 5.2. Interface Description ............................................................................ 43

5.2.1. Query the current system information ............................................ 43 5.2.2. Query Interface board NDIS support capabilities ............................. 46 5.2.3. NDIS dial command........................................................................ 47 5.2.4. Active connection status reporting command ................................. 48 5.2.5. DHCP query command ................................................................... 49 5.2.6. Subsequent operation .................................................................... 50

6. Data cartoons flash specifications ...................................................................... 51 6.1. Data cartoons flash specifications ......................................................... 51

7. Voice AT Commands and Basic Interaction Processes .......................................... 52

Page 4: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 2

7.1. Summary Description ........................................................................... 52 7.2. Command Interaction in Service Processes............................................ 52 7.3. CS Domain Service Commands .............................................................. 55

7.3.1. Setting Automatic Answer: S0 ........................................................ 55 7.3.2. Setting the Call Mode: +CMOD ....................................................... 56 7.3.3. Setting the Bearer Type: +CBST....................................................... 57 7.3.4. Setting the Handset Volume: +CLVL ................................................ 58 7.3.5. Displaying Current Call Information: +CLCC ..................................... 59 7.3.6. Ending All Current Calls: +CHUP ...................................................... 61 7.3.7. Selecting the Address Type: +CSTA.................................................. 61 7.3.8. Sending a DTMF Tone in the Multi-Party Call Service: +VTS ............. 62 7.3.9. Answering an Incoming Call: A........................................................ 63 7.3.10. Ending a Call: H .............................................................................. 63 7.3.11. Initiating a Call: D ........................................................................... 64 7.3.12. Sending a DTMF Tone During a Call: ^DTMF .................................... 66 7.3.13. Setting the Voice Mode: ^CVOICE ................................................... 67 7.3.14. Setting the Voice Mode: ^VMSET ................................................... 68 7.3.15. Setting the Voice Bearing Port: ^DDSETEX....................................... 69 7.3.16. Querying the Call Duration: ^CDUR................................................. 70 7.3.17. Setting Muting Control: +CMUT ...................................................... 71 7.3.18. Initiating a Call with a Sub-address: ^APDS ..................................... 72 7.3.19. Querying the Call Source Number: ^CLPR ....................................... 73 7.3.20. Reporting Call Status: ^CCALLSTATE ................................................ 74 7.3.21. Call Initiating Indication: ^ORIG ...................................................... 75 7.3.22. Network Connection Indication: ^CONF .......................................... 76 7.3.23. Call Connection Indication: ^CONN ................................................. 76 7.3.24. Call Ending Notification: ^CEND ...................................................... 77

7.4. Supplementary Service Commands ....................................................... 79 7.4.1. CLIP Service: +CLIP ......................................................................... 79 7.4.2. CLIR Service: +CLIR ......................................................................... 80 7.4.3. COLP Service: +COLP ...................................................................... 82 7.4.4. CUG Service: +CCUG ...................................................................... 83 7.4.5. Supplementary Service Notifications: +CSSN ................................... 84 7.4.6. Call-related Supplementary Services: +CHLD ................................... 85 7.4.7. Call Waiting Service: +CCWA........................................................... 87 7.4.8. Call Forwarding Service: +CCFC ....................................................... 89 7.4.9. Call Deflection Service: +CTFR ........................................................ 92 7.4.10. USSD Service: +CUSD ..................................................................... 94 7.4.11. Proactively Reporting the Calling Number: +CLIP ............................ 95 7.4.12. Proactively Reporting the Connected Number: +COLP ..................... 97 7.4.13. Proactively Reporting the Supplementary Service Indication: +CSSI . 98 7.4.14. Proactively Reporting the Supplementary Service Indication: +CSSU 99

Page 5: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 3

7.4.15. Proactively Reporting Call Waiting: +CCWA ................................... 100 7.4.16. Proactively Reporting the USSD Service: +CUSD ............................ 101 7.4.17. Multi-Line Selection: ^ALS ............................................................ 102 7.4.18. UUS1 Service: +CUUS1 ................................................................. 103 7.4.19. Proactively Reporting UUS1 Indication: +CUUS1I........................... 105 7.4.20. Proactively Reporting UUS1 Indication: +CUUS1U ......................... 106 7.4.21. Setting the USSD Transmission Mode: ^USSDMODE ...................... 107

8. Android RIL Integration Guide .......................................................................... 108 8.1. Overview............................................................................................ 108 8.2. What Are Supported ........................................................................... 110 8.3. Integration ......................................................................................... 110

9. FAQs positioning method ................................................................................. 113 9.1. After integration issues driver port...................................................... 113 9.2. After the drive-integrated Modem / Ndis dial problem ........................ 116

9.2.1. HIDS analyzer log grab method ..................................................... 117 9.2.2. SDT Analyzer log grab method ...................................................... 122 9.2.3. USB analyzer log grab method ...................................................... 124

9.3. Other questions ................................................................................. 135

Page 6: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 4

1. Copyright Statement Huawei Technologies Co., Ltd. provides customers with comprehensive technical support and service. For any assistance, please contact our local office or company headquarters. Copyright © Huawei Technologies Co., Ltd. 2017. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co., Ltd. The product described in this manual may include copyrighted software of Huawei Technologies Co., Ltd and possible licensors. Customers shall not in any manner reproduce, distribute, modify, decompile, disassemble, decrypt, extract, reverse engineer, lease, assign, or sublicense the said software, unless such restrictions are prohibited by applicable laws or such actions are approved by respective copyright holders under licenses. This document belongs to Huawei private, please contact the corresponding interface only after sending people to sign a confidentiality agreement. Trademarks and Permissions

, , HUAWEI, and are trademarks or registered trademarks of Huawei

Technologies Co., Ltd. Other trademarks, product, service and company names mentioned are the property of their respective owners. Notice Some features of the product and its accessories described herein rely on the software installed, capacities and settings of local network, and may not be activated or may be limited by local network operators or network service providers, thus the descriptions herein may not exactly match the product or its accessories you purchase. Huawei Technologies Co., Ltd reserves the right to change or modify any information or specifications contained in this manual without prior notice or obligation. Safety statement The dongle is used only as modem and NDIS dial-up service when it is used on the gateway. It cannot control the security of the service. The gateway needs to protect the service according to its needs (such as authentication of SMS and Internet function). NO WARRANTY THE CONTENTS OF THIS MANUAL ARE PROVIDED "AS IS". EXCEPT AS REQUIRED BY APPLICABLE LAWS, NO WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE MADE IN RELATION TO THE ACCURACY,

Page 7: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 5

RELIABILITY OR CONTENTS OF THIS MANUAL. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO CASE SHALL HUAWEI TECHNOLOGIES CO., LTD BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES, OR LOST PROFITS, BUSINESS, REVENUE, DATA, GOODWILL OR ANTICIPATED SAVINGS. Import and Export Regulations Customers shall comply with all applicable export or import laws and regulations and will obtain all necessary governmental permits and licenses in order to export, re-export or import the product mentioned in this manual including the software and technical data therein. Copyright Notice Huawei Technologies Co., Ltd. Huawei Industrial Base, Bantian, Longgang, Shenzhen 518129, People’s Republic of China Tel: +86-755-28780808 Global Hotline: +86-755-28560808 Website: www.huawei.com E-mail: [email protected] Please refer color and shape to product. Huawei reserves the right to make changes or improvements to any of the products without prior notice.

Page 8: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 6

2. Overview This document is related instructions for Huawei's data card devices integrated development activities. Product developers mainly for driver developers on Linux and Android systems. Integration processes may reference flow shown below.

Page 9: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 7

3. Guide to Kernel Driver Integration in

Embedded Linux & Android for

Huawei Dongles

3.1. Purpose This document provides instructions for driver developers of Linux-based products to integrate drivers into the products' Linux kernel for Huawei's dongles.

3.2. Scope Prerequisite This guide is applicable to:

• Huawei's LTE/WCDMA/CDMA dongles.

• The Linux kernel version 2.6.21 and later kernel version.

3.3. Overview

3.3.1. Linux Kernel Driver Architecture Supporting Huawei Dongles

The Huawei dongles communicate with Linux through USB interfaces. The Linux kernel needs to load USB drivers according to the information about the USB device interfaces reported by Huawei dongles. Huawei dongles can work properly only after the correct USB drivers are loaded. The following figure shows the inux kernel driver architecture supporting Huawei dongles in Linux.

Page 10: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 8

As shown in the preceding figure, in the USB driver architecture of Linux, the drivers related to Huawei dongles are the usb-storage driver, USB serial port driver and USB network driver ,where:

1. USB serial port driver modules

• The USB serial port driver support all the ports(including the modem port and the AT command port) except the ECM ports; the code of this driver has been added into the source code of Linux kernel.

2. usb-storage driver modules

• The USB disk driver supports USB hard drives, disks, CD-ROMs, and card readers.

3. USB network driver modules

• Use the system network driver later than Linux Kernel 2.6.38, can use the system NCM driver, the driver module loaded is cdc_ncm.

• Use huawei driver between Linux Kernel 2.6.25 to Linux Kernel 2.6.38 , it need to integrate hw_cdc_driver.c, the driver module loaded is hw_cdc_driver.

• Use the system ECM driver between Linux Kernel 2.6.21 to Linux Kernel 2.6.25 , don’t support usb network devices.

NOTICE: If you just need PPP dial, you have no use for integrating USB network driver.

Page 11: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 9

3.4. Schemes for Integrating Drivers into Linux Kernel

3.4.1. Procedure for Integrating the usb-storage Driver

Prerequisite

Page 12: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 10

3.4.2. Procedure for Integrating the usb-storage Driver into Linux Kernel with the Version 2.6.29 or Earlier

Prerequisite This integration scheme involves the following Linux kernel source code files: \drivers\usb\storage\usb.c \drivers\usb\storage\unusual_devs.h \drivers\usb\storage\initializers.c \drivers\usb\storage\initializers.h The integration procedure is as follows: Procedure Modify the usb.c file. 1.Add the following statement before the statement of "struct usb_device_id storage_usb_ids []={}":

#define HW_UNUSUAL_DEV(id_vendor, cl, sc, pr, \ vendorName, productName,useProtocol, useTransport, \

initFunction, flags) \ { \ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | USB_DEVICE_ID_MATCH_VENDOR, \ .idVendor = (id_vendor), \ .bInterfaceClass = (cl), \ .bInterfaceSubClass = (sc), \ .bInterfaceProtocol = (pr), \ .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }

2.Add the following statement after "#undef UNUSUAL_DEV" in the statement of "struct usb_device_id storage_usb_ids []={}":

#undef HW_UNUSUAL_DEV

3.Add the following statement in front of "static struct us_unusual_dev us_unusual_dev_list[]={}":

#define HW_UNUSUAL_DEV(idVendor, cl, sc, pr, \ vendor_name, product_name, use_protocol, use_transport, \ init_function, Flags) \ { \ .vendorName = vendor_name, \ .productName = product_name, \ .useProtocol = use_protocol, \

Page 13: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 11

.useTransport = use_transport, \

.initFunction = init_function, \ }

4.Add the following statement after "#undef UNUSUAL_DEV" in the statement of "static struct us_unusual_dev us_unusual_dev_list[]={}":

#undef HW_UNUSUAL_DEV

Modify the unusual_devs.h file. Add a product ID statement for the new USB-storage device after the last statement of the original vendor ID by searching for the keyword of 12d1 (if the vendor ID statement cannot be located, add the product ID statement between vendor ID less than 12d1 and vendor ID greater than 12d1 ), for example: HW_UNUSUAL_DEV ( 0x12d1, 0x08, 0x06, 0x50, "HUAWEI", "HUAWEI MOBILE Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_init, 0),

Modify the initializers.c file. 1.If it’s not usb_stor_huawei_e220_init function in this file,add it.If it’s exist,go to next step directly.

int usb_stor_huawei_e220_init(struct us_data *us) { int result; result = usb_stor_control_msg(us, us->send_ctrl_pipe,USB_REQ_SET_FEATURE,USB_TYPE_STANDARD | USB_RECIP_DEVICE, 0x01, 0x0, NULL, 0x0, 1000); US_DEBUGP("Huawei mode set result is %d\n", result); return 0; }

2.Add two defines under usb_stor_huawei_e220_init function: #define IS_HUAWEI_DONGLES 1 #define NOT_HUAWEI_DONGLES 0

3.Add the definition of the usb_stor_huawei_dongles_pid function: static int usb_stor_huawei_dongles_pid(struct us_data *us) { int ret = NOT_HUAWEI_DONGLES; struct usb_interface_descriptor *idesc = NULL; idesc = >pusb_intf->cur_altsetting->desc; if (NULL != idesc ) { if ( (0x0000 == le16_to_cpu(idesc->bInterfaceNumber))) { if ((0x1401 <= le16_to_cpu(us->pusb_dev->descriptor.idProduct) && 0x1600 >= le16_to_cpu(us->pusb_dev->descriptor.idProduct)) || (0x1c02 <= le16_to_cpu

Page 14: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 12

(us->pusb_dev->descriptor.idProduct) && 0x2202 >= le16_to_cpu (us->pusb_dev->descriptor.idProduct)) || (0x1001 == le16_to_cpu (us->pusb_dev->descriptor.idProduct)) || (0x1003 == le16_to_cpu (us->pusb_dev->descriptor.idProduct)) || (0x1004 == le16_to_cpu (us->pusb_dev->descriptor.idProduct))) { if ((0x1501 <= le16_to_cpu (us->pusb_dev->descriptor.idProduct)) && (0x1504 >= le16_to_cpu (us->pusb_dev->descriptor.idProduct))) { ret = NOT_HUAWEI_DONGLES; } else { ret = IS_HUAWEI_DONGLES; } } } return ret; }

4.Add the definition of the usb_stor_huawei_scsi_init function: 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x06, 0x30, 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, ); US_DEBUGP("usb_stor_bulk_transfer_buf performing result is %d, transfer the actual length=%d\n", result, act_len); return result; }

Remark:The back part in 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 present that the dongles can switch to MODEM port mode. If the dongles only support NDIS mode, you must change the red part to 0x01. If the switch command is 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,0x00,the port list is one of the below table:

Table 1 Port list

Port list PID

MDM+DIAG+PCUI 1001

If the switch command is 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, 0x01,0x00,the port list is one of the below table:

Page 15: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 13

Table 2 Port list

Port list PID

MDM+DIAG+PCUI+NDIS[+NDIS+NDIS+NDIS] 155E

MDM+DIAG+PCUI+SD+NDIS[+NDIS+NDIS+NDIS] 155F

DIAG+PCUI+SD+NDIS[+NDIS+NDIS+NDIS] 158E

5.Add the definition of the usb_stor_huawei_init function: int usb_stor_huawei_init(struct us_data *us) { int result = 0; if(usb_stor_huawei_dongles_pid(us)){ if ((0x1446 <= le16_to_cpu(us->pusb_dev->descriptor.idProduct))){ result = usb_stor_huawei_scsi_init(us); }else{ result = usb_stor_huawei_e220_init(us); } } return result; }

Modify the initializers.h file. Add the statement of the usb_stor_huawei_init function: int usb_stor_huawei_init(struct us_data *us);

3.4.3. Procedure for Integrating the usb-storage Driver into Linux Kernel with the Version Later than 2.6.29

Prerequisite This integration scheme involves the following Linux kernel source code files: \drivers\usb\storage\usb.c \drivers\usb\storage\usual-tables.c \drivers\usb\storage\unusual_devs.h \drivers\usb\storage\initializers.c \drivers\usb\storage\initializers.h The integration procedure is as follows:

Page 16: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 14

Procedure Modify the usb.c file. 1.Add the following statement before the statement of "static struct us_unusual_dev us_unusual_dev_list[] = {}":

#define HW_UNUSUAL_DEV(idVendor, cl, sc, pr, \ vendor_name, product_name, use_protocol, use_transport, \ init_function, Flags) \ { \ .vendorName = vendor_name, \ .productName = product_name, \ .useProtocol = use_protocol, \ .useTransport = use_transport, \ .initFunction = init_function, \ }

2.Add the following statement after the statement of "#undef COMPLIANT_DEV": #undef HW_UNUSUAL_DEV

Modify the usual-tables.c file. 1.Add the following statement before the statement of "struct usb_device_id usb_storage_usb_ids [] = {}":

#define HW_UNUSUAL_DEV(id_vendor, cl, sc, pr, \ vendorName, productName, useProtocol, useTransport, \ initFunction, flags) \ { \ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | USB_DEVICE_ID_MATCH_VENDOR, \ .idVendor = (id_vendor), \ .bInterfaceClass = (cl), \ .bInterfaceSubClass = (sc), \ .bInterfaceProtocol = (pr), \ .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }

2.Add the following statement after the statement of "#undef COMPLIANT_DEV": #undef HW_UNUSUAL_DEV

Modify the unusual_devs.h file. Add a product ID statement for the new USB-storage device after the last statement of the original vendor ID by searching for the keyword of 12d1, for example:

HW_UNUSUAL_DEV ( 0x12d1, 0x08, 0x06, 0x50, "HUAWEI", "HUAWEI MOBILE Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_init, 0),

(The red words shoulds be“USB_SC_DEVICE, USB_PR_DEVICE” in linux kernel version 2.6.37 or later.) Modify the initializer.c file.

Page 17: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 15

1.Add two defines under usb_stor_huawei_e220_init function: #define IS_HUAWEI_DONGLES 1 #define NOT_HUAWEI_DONGLES 0

2.Add the definition of the usb_stor_huawei_dongles_pid function: static int usb_stor_huawei_dongles_pid(struct us_data *us) { int ret = NOT_HUAWEI_DONGLES; struct usb_interface_descriptor *idesc = NULL; idesc = >pusb_intf->cur_altsetting->desc; if (NULL != idesc ) { if ( (0x0000 == idesc->bInterfaceNumber)) { if ((0x1401 <= us->pusb_dev->descriptor.idProduct && 0x1600 >= us->pusb_dev->descriptor.idProduct) || (0x1c02 <= us->pusb_dev->descriptor.idProduct && 0x2202 >= us->pusb_dev->descriptor.idProduct) || (0x1001 == us->pusb_dev->descriptor.idProduct) || (0x1003 == us->pusb_dev->descriptor.idProduct) || (0x1004 == us->pusb_dev->descriptor.idProduct)) { if ((0x1501 <= us->pusb_dev->descriptor.idProduct) && (0x1504 >= us->pusb_dev->descriptor.idProduct)) { ret = NOT_HUAWEI_DONGLES; } else { ret = IS_HUAWEI_DONGLES; } } } } return ret; }

3.Add the definition of the usb_stor_huawei_scsi_init function: 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x06, 0x30, 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, ); US_DEBUGP("usb_stor_bulk_transfer_buf performing result is %d, transfer the actual length=%d\n", result, act_len); return result; }

Remark:The back part in 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 present that

Page 18: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 16

the dongles can switch to MODEM port mode. If the dongles only support NDIS mode, you must change the red part to 0x01 If the switch command is 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,the port list is one of the below table:

Table 1 Port list

Port list PID

MDM+DIAG+PCUI 1001

If the switch command is 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, 0x01,0x00,the port list is one of the below table:

Table 2 Port list

Port list PID

MDM+DIAG+PCUI+NDIS[+NDIS+NDIS+NDIS] 155E

MDM+DIAG+PCUI+SD+NDIS[+NDIS+NDIS+NDIS] 155F

DIAG+PCUI+SD+NDIS[+NDIS+NDIS+NDIS] 158E

4.Add the definition of the usb_stor_huawei_init function: int usb_stor_huawei_init(struct us_data *us) { int result = 0; if(usb_stor_huawei_dongles_pid(us)){ if ((0x1446 <= le16_to_cpu(us->pusb_dev->descriptor.idProduct))){ result = usb_stor_huawei_scsi_init(us); }else{ result = usb_stor_huawei_e220_init(us); } } return result; }

Modify the initializers.h file. Add the statement of the usb_stor_huawei_init function: int usb_stor_huawei_init(struct us_data *us);

Page 19: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 17

3.4.4. Revising Driver Files for Integrating the USB Serial Port Driver

Prerequisite This integration scheme involves the following Linux kernel source code files:

drivers/usb/serial/option.c drivers/usb/serial/bus.c drivers/tty/tty_io.c or drivers/char/tty_io.c include/linux/tty.h

To support new interface type, make the following modifications: 1.Add the following definition before the statement of "static const struct usb_device_id option_ids[ ]:

#define HW_USB_DEVICE_AND_INTERFACE_INFO(vend, cl, sc, pr) \ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | USB_DEVICE_ID_MATCH_VENDOR, \ .idVendor = (vend), \ .bInterfaceClass = (cl), \ .bInterfaceSubClass = (sc), \ .bInterfaceProtocol = (pr)

2.Add the following sentences to the static const struct usb_device_id option_ids[ ] ID list:

{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x02, 0x02, 0xff) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x01) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x02) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x03) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x04) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x05) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x06) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x0A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x0B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x0E) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x0F) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x10) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x12) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x13) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x14) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x15) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x17) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01,

Page 20: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 18

0x18) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x19) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x1A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x1B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x1C) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x31) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x32) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x33) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x34) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x35) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x36) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x3A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x3B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x3E) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x3F) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x48) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x49) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x4A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x4B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x4C) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x61) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x62) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x63) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x64) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x65) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x66) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6E) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6F) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x72) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x73) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x74) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x75) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x78) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x79) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x7A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x7B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x7C) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x01) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x02) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x03) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02,

Page 21: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 19

0x04) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x05) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x06) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x0A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x0B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x0E) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x0F) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x10) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x12) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x13) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x14) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x15) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x17) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x18) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x19) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x1A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x1B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x1C) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x31) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x32) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x33) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x34) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x35) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x36) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x3A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x3B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x3E) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x3F) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x48) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x49) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x4A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x4B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x4C) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x61) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x62) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x63) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x64) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x65) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x66) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x6A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x6B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x6E) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02,

Page 22: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 20

0x6F) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x72) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x73) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x74) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x75) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x78) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x79) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7C) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x01) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x02) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x03) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x04) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x05) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x06) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0E) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0F) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x10) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x12) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x13) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x14) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x15) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x17) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x18) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x19) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1C) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x31) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x32) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x33) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x34) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x35) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x36) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3E) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3F) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x48) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03,

Page 23: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 21

0x49) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4A) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4B) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4C) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x61) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x62) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x63) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x64) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x65) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x66) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6E) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6F) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x72) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x73) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x74) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x75) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x78) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x79) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7A) },{ HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7B) }, { HW_USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7C) },

3. Modify the port name 1) Modify the initializers.h file. Add the following statement after the statement of “extern struct device *tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev);”.

extern struct device *tty_register_device_huawei(struct tty_driver *driver, unsigned index, struct device *dev); extern struct device *tty_register_device_huawei_158E(struct tty_driver *driver, unsigned index, struct device *dev)

2) Modify the tty_io.h file a) Add the following statement after the statement of “#define CHECK_TTY_COUNT 1 .

int ttycount = 0; int ttycount_158E = 0;

b) Add the following function after the function of “static void tty_line_name(struct tty_driver *driver, int index, char *p)” and static void tty_line_name_huawei_158E(struct tty_driver *driver, int index, char *p).

static void tty_line_name_huawei(struct tty_driver *driver, int index, char *p) static void tty_line_name_huawei_158E(struct tty_driver *driver, int index, char *p) static void tty_line_name_huawei(struct tty_driver *driver, int index, char *p) { if(ttycount == 0) { sprintf(p, "%s%d_modem", driver->name, index + driver->name_base);

Page 24: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 22

ttycount = ttycount +1; } else if (ttycount == 1) { sprintf(p, "%s%d_diag", driver->name, index + driver->name_base); ttycount = ttycount +1; } else if (ttycount == 2) { sprintf(p, "%s%d_pcui", driver->name, index + driver->name_base); ttycount = 0; } } static void tty_line_name_huawei_158E(struct tty_driver *driver, int index, char *p) { if(ttycount_158E == 0) { sprintf(p, "%s%d_diag", driver->name, index + driver->name_base); ttycount_158E = ttycount_158E +1; } else if (ttycount_158E == 1) { sprintf(p, "%s%d_pcui", driver->name, index + driver->name_base); ttycount_158E = 0; } }

c) Add the following function after the function of “struct device *tty_register_device(struct tty_driver *driver, unsigned index, struct device *device)” and struct device *tty_register_device_huawei_158E(struct tty_driver *driver, unsigned index, struct device *device).

struct device *tty_register_device_huawei(struct tty_driver *driver, unsigned index, struct device *device) struct device *tty_register_device_huawei_158E(struct tty_driver *driver, unsigned index, struct device *device)。 struct device *tty_register_device_huawei(struct tty_driver *driver, unsigned index, struct device *device) { char name[64]; dev_t dev = MKDEV(driver->major, driver->minor_start) + index; if (index >= driver->num) { printk(KERN_ERR "Attempt to register invalid tty line number " " (%d).\n", index); return ERR_PTR(-EINVAL); } if (driver->type == TTY_DRIVER_TYPE_PTY) pty_line_name(driver, index, name); else tty_line_name_huawei(driver, index, name); return device_create(tty_class, device, dev, NULL, name); }

Page 25: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 23

EXPORT_SYMBOL(tty_register_device_huawei); struct device *tty_register_device_huawei_158E(struct tty_driver *driver, unsigned index,struct device *device) { char name[64]; dev_t dev = MKDEV(driver->major, driver->minor_start) + index; if (index >= driver->num) { printk(KERN_ERR "Attempt to register invalid tty line number " " (%d).\n", index); return ERR_PTR(-EINVAL); } if (driver->type == TTY_DRIVER_TYPE_PTY) pty_line_name(driver, index, name); else tty_line_name_huawei_158E(driver, index, name); return device_create(tty_class, device, dev, NULL, name); } EXPORT_SYMBOL(tty_register_device_huawei_158E);

3) Modify the bus.c file. Add the “//” before the statement of “tty_register_device(usb_serial_tty_driver, minor, dev);” in the function of “static int usb_serial_device_probe(struct device *dev)”. Then add the following statement.

if(port->serial->dev->descriptor.idVendor == 0x12d1) { if(port->serial->dev->descriptor.idProduct == 0x158E) { tty_register_device_huawei_158E(usb_serial_tty_driver, minor, dev); } else { tty_register_device_huawei(usb_serial_tty_driver, minor, dev);} } else { tty_register_device(usb_serial_tty_driver, minor, dev); }

3.4.5. Revising Driver Files for Integrating the USB Network Port Driver

Use the system network driver later than Linux Kernel 2.6.38, can use the system NCM driver, the driver module loaded is cdc_ncm. Use huawei driver between Linux Kernel 2.6.25 to Linux Kernel 2.6.38 , it need to integrate hw_cdc_driver.c, the driver module loaded is hw_cdc_driver. Use the system ECM driver between Linux Kernel 2.6.21 to Linux Kernel 2.6.25 , don’t support usb network devices. 1.Use system network driver

Page 26: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 24

Notes: please check the “/drivers/net/usb/cdc_ncm.c” file, if it has the code following:

If it has this code, please deleted it; if not have this code, don’t care about it. Ensure driver compilation option in the configuration menu, please check .config file as shown below, it has been configured the NCM driver. In the integration, just make sure that the currently using driver is configured , for example, the currently using datacard is NCM model,just make sure that is configured with NCM.

If driver is not configured, run make menuconfig enter Device Drivers->Network device support->USB Network Adapters Select the Multi-purpose USB Networking Framework and its subordinate directories 2.Use Huawei Driver 1)Copy the hw_cdc_driver.c file provided by Huawei to directory /drivers/net/usb/. hw_cdc_driver.c Current version is v2.12.00.00, and please use the newest version.

Page 27: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 25

2)Modify the Kconfig file in the directory /drivers/net/usb, add the configuration of config USB_NET_HW_CDC_DRIVER

3)Modify the Makefile file in the directory /drivers/net/usb, add some contents shown in following picture.

Page 28: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 26

4)Open the Terminal , enter the kernel directory, then run the make menuconfig command.

5)According to the following picture, check compiling options of huawei network driver. Device Drivers->Network device support->USB Network Adapters

Page 29: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 27

Page 30: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 28

6)Click Exit to exit all configuration screens. When the following dialog box is displayed, click Yes to save configurations.

Page 31: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 29

7)After the configuration is complete,run the make command to compile the revised kernel version. The picture show the .config file in the kernel directory.

3.4.6. Modifying the Compilation Configuration of Linux

Ensure that the following configuration options are enabled. For detailed configuration operations, see section "Configuration Procedure for Driver Integration." Prerequisite 1.Confirming the Following Configurations in the .config File

Page 32: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 30

1. Configuration options related to the USB serial port driver CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_OPTION=y

2. Configuration options related to the USB network adapter driver CONFIG_MII=y CONFIG_USBNET=y

3. Configuration options related to PPP dial-up connections CONFIG_PPP=y CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=y CONFIG_PPP_SYNC_TTY=y CONFIG_PPP_DEFLATE=y CONFIG_PPP_BSDCOMP=y

NOTE:

For Linux kernel with the version earlier than 2.6.29, the configuration option of CONFIG_USB_LIBUSUAL does not need to be compiled. For details, see Step 2 in section "Configuration Procedure for Driver Integration."

2. Configuration Procedure for Driver Integration Procedure Open the Terminal tool, enter the kernel directory (assume that the kernel is in the /usr/src/mydroid/ directory, that is, cd /usr/src/mydroid/kernel), and run the make <configuration> command (in this guide, assume that the standard make menuconfig command is used).

Select related configuration options. a.Do not select the [ ] The shared table of common (or usual) storage devices option,

Page 33: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 31

as shown in the following figure.

Page 34: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 32

b.Configure options related to the USB serial port driver.

Page 35: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 33

c.Configure options related to PPP dial-up connections.

Page 36: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 34

Page 37: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 35

d.Configure options related to the USB network adapter driver.

Page 38: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 36

Click Exit to exit all configuration screens. When the following dialog box is displayed, click Yes to save the configuration.

After the configuration is complete, run the make command to compile the revised kernel version.

Page 39: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 37

3.5. Appendix

3.5.1. Checking the Integration Result

1.USB Serial Port Driver integration succeed. After insert the data card , Run the dmesg command to check whether the integration succeeds. If the following (or similar) information is contained in the log, the integration succeeds. (Different products have different idProduct and different number of ttyUSB*.)

Run the ls /dev/ttyUSB* command to check whether the port mapping succeeds.

Introduction of port use: Modem Port : ppp dail. Diag Port : obligate port. Pcui Port: AT port, can use AT command. Notes: the way of send AT command. 1) open terminal (tag as T1), run ls /dev/ttyUSB* command can find the port name

Page 40: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 38

2)In T1 run cat /dev/ttyUSB2_pcui command 3)Open a new terminal (tag as T2), run AT command,now theT1 display the AT result.

2.USB Network Driver integration succeed. Run the “cat /proc/bus/usb/devices”or ”cat /sys/kernel/debug/usb/devices “command to check driver of huawei devices 12d1 load-on.

If the system NCM driver is loaded, the red frame is “Driver=cdc_ncm”; If the huawei driver is loaded, the red frame is “Driver=huawei_ether”;

3.5.2. Checking the Current Port Mapping of Huawei Dongles

Prerequisite

Page 41: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 39

Provide the following logs if the port mapping fails:

• Open the Terminal tool, run the dmesg command, and save the return result in the dmesg.txt file.

• Run the ls –l /sys/bus/usb/devices/ command and save the returned result in the logcat.txt file.

• Run the ls –l /sys/bus/usb/drivers/ command and save the returned result in the logcat.txt file. Make sure that this option directory is contained in this file. If not, check and revise the file according to section "Configuration Procedure for Driver Integration."

• Run the ls –l /sys/bus/usb/drivers/option/***/ command and save the returned result in the logcat.txt file.

• Run the cat /sys/bus/usb/drivers/option/***/bInterface* command and save the returned result in the logcat.txt file.

• The red part is Arabic numbers in the form similar to "1-1:1.0", "1-1:1.1", or "1-1:1.*".

• If the cat /proc/bus/usb/devices command can be executed, save the returned result in the logcat.txt file. (If not, omit the command.)

3.6. Notes

3.6.1. In GSM mode, the data card need large electric current when search network, if the ability of the hardware power supply shortage could lead to data card restart.

In GSM mode, the data card need large electric current when search network, if the ability of the hardware power supply shortage could lead to data card restart. (host current capacity requirements of instantaneous 1.5A, long 650mA).

Page 42: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 40

3.6.2. Close AT echo. It is need to send ate0 command to close the AT echo before send other AT command.

Close AT echo. It is need to send ate0 command to close the AT echo before send other AT command.

Page 43: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 41

4. modem dialing process

4.1. modem dialing process 1.Dial Control Method Only need to operate MDM and PCUI mouth can, as shown, the drive needs to determine whether the loading.

2.MODEM dial-up connection timing Timing shown in Figure connection.

3.MOODE Dial off Timing Off timing as shown.

Page 44: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 42

Page 45: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 43

5. ndis dialing process

5.1. Gateway uses the NDIS method Description

Prerequisite NDIS dial Flowchart:

5.2. Interface Description

5.2.1. Query the current system information

1.Query the current system information Gateway before dialing need to query the current system information, such as a system service status, domain, whether roaming, system mode, SIM card status. 【Note】 on E3276s-150, please give priority to use SYSINFOEX query command, in order to be compatible for old products, please preferentially With SYSINFOEX query commands,

Page 46: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 44

if the device does not support SYSINFOEX query, use SYSINFO command query. AT structure SYSINFOEX please refer to AT commands documentation. 【Grammatical structure】

【Value Description】 <srv_status>:System service state. The values are as follows:

1. No service.(0)

2. Restricted service (1)

3. Valid service (2)

4. Restricted regional service. (3)

5. Power-saving and deep sleep state (4)

<srv_domain>:System service domain. The values are as follows:

1. No service. (0)

2. Only CS service (1)

3. Only PS service (2)

4. PS+CS service (3)

5. CS and PS not registered, searching (4)

<roam_status>:Roaming status. The values are as follows:

1. Non roaming state (0)

2. Roaming state (1)

<sys_mode>:System mode. The values are as follows:

1. No service. (0)

2. AMPS mode (not in use currently) (1)

3. CDMA mode (not in use currently) (2)

Page 47: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 45

4. GSM/GPRS mode (3)

5. HDR mode (4)

6. WCDMA mode (5)

7. GPS mode (6)

8. GSM/WCDMA (7)

9. CDMA/HDR HYBRID (Not support) (8)

10. TD-SCDMA mode (15)

<sim_state>:SIM card state. The values are as follows:

1. Invalid USIM card state or pin code locked (0)

2. Valid USIM card state (1)

3. USIM is invalid in case of CS (2)

4. USIM is invalid in case of PS (3)

5. USIM is invalid in case of either CS or PS (4)

6. USIM card is not existent, (255)

<reserved>:reserved. E618 used it to indicate the simlock state. <sys_submode>:System sub mode, the values are as follows:

1. No service (0)

2. GSM mode (1)

3. GPRS mode (2)

4. EDGE mode (3)

5. WCDMA mode (4)

6. HSDPA mode (5)

7. HSUPA mode (6)

8. HSDPA mode and HSUPA mode (7)

9. TD_SCDMA mode (8)

10. HSPA+ mode (9)

11. HSPA+(64QAM) mode (17)

12. 18: HSPA+(MIMO) mode (18)

Notice:When the returned value of<sys_submode> is out of (0~18), you should treat it

Page 48: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 46

as 4(WCDMA)by default.

5.2.2. Query Interface board NDIS support capabilities

Gateway needs to support Modem or NDIS, after the handover is completed veneer, by the second serial port (PCUI) issued an AT inquire whether to support the gateway mode NDIS. 【Grammatical structure】

【Interface Description】

Page 49: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 47

5.2.3. NDIS dial command

If the gateway queries to the product support NDIS dialing, you need to send a second serial port (PCUI) under NDIS AT dial to the data card. 【Grammatical structure】

【Interface Description】

• The command is used for NDIS Dial

• AT^NDISDUP=1,1 //dial up

• AT^NDISDUP =1,0 //hang up

• Note: A NDIS port is demanded

【Value Description】

Page 50: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 48

5.2.4. Active connection status reporting command

【Grammatical structure】

【Value Description】

Page 51: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 49

5.2.5. DHCP query command

This command is used to query DHCP PC-related information, including the IP address, default gateway, subnet mask, DHCP server, CID and the like. 【Grammatical structure】

【Value Description】

Page 52: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 50

5.2.6. Subsequent operation

Get behind the gateway IP address corresponding to the CID, based on the IP address for additional information related to such as DNS, gateway information in the network connection, etc. Excursus When the board supports only profile (0x00), but at the same time they need to support SD, you need to use rewind (0x00) command, then the board will switch to Windows on port form.

Page 53: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 51

6. Data cartoons flash specifications

6.1. Data cartoons flash specifications Prerequisite

Page 54: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 52

7. Voice AT Commands and Basic

Interaction Processes

7.1. Summary Description Prerequisite If the customer realize the circuit domain on Android or linux host system (CS) voice capabilities, the need to develop additional programs on the host computer for diag port voice data is parsed; Board voice channel diag port, voice data format as a standard PCM format.

7.2. Command Interaction in Service Processes

Prerequisite 1.Flowchart of successfully initiating a call.

Page 55: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 53

2.Flowchart for a Call Failure Due to an MS Reason. If the current status of the MS does not meet voice call requirements, the MS reports the failure reason in ^CEND.

3.Flowchart for a Call Failure Due to a Network Reason. If the current status of the MS meets voice call requirements, the MS reports the call initiating indication in ^ORIG; if the network connection fails due to a network reason, the MS reports the failure reason in ^CEND.

Page 56: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 54

4.Flowchart of Rejecting or Ending a Call as the Called Party. If the current status of the MS meets voice call requirements, the MS reports the call initiating indication in ^ORIG; if the network connection succeeds, the MS reports the network connection indication in ^CONF; if the call fails because the local party rejects the call or the peer party hangs up, the MS reports the failure reason in ^CEND.

5.Flowchart for Incoming Call Indication.

Page 57: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 55

7.3. CS Domain Service Commands

7.3.1. Setting Automatic Answer: S0

Description This command sets automatic answer. Syntax

Page 58: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 56

Parameter

Example

7.3.2. Setting the Call Mode: +CMOD

Description This command sets the call mode.

NOTE:

Call modes include the single mode and alternating mode.

• In the single mode, a call supports only one basic service (voice or fax).

• In the alternating mode, a call supports two basic services (by alternating the voice and fax services). Currently, only single-mode calls are supported.

Syntax

Parameter

Page 59: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 57

Example

7.3.3. Setting the Bearer Type: +CBST

Description This command sets the bearer type. Syntax

Parameter

Page 60: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 58

Example

7.3.4. Setting the Handset Volume: +CLVL

Description This command sets the volume of the handset or loudspeaker during a call. Syntax

Parameter

Page 61: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 59

Example

7.3.5. Displaying Current Call Information: +CLCC

Description This command displays all current calls. Syntax

Parameter

Page 62: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 60

Example

Page 63: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 61

7.3.6. Ending All Current Calls: +CHUP

Description This command ends all current calls. Syntax

Parameter

Example

7.3.7. Selecting the Address Type: +CSTA

Description This command selects the type of the called number when a call is initiated. Syntax

Page 64: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 62

Parameter

Example

7.3.8. Sending a DTMF Tone in the Multi-Party Call Service: +VTS

Description This command sends a dual tone multiple frequency (DTMF) tone to the network side in the multi-party call service. Syntax

Page 65: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 63

Parameter

Example

7.3.9. Answering an Incoming Call: A

Description This command answers the current incoming call. Syntax

Parameter

Example

7.3.10. Ending a Call: H

Description This command disconnects the connection with the remote user in the single mode

Page 66: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 64

(for details, see the +CMOD command). In a multi-party call, all users that are connected will be disconnected.

Syntax

Parameter

Example

7.3.11. Initiating a Call: D

Description This command initiates a call. (The process can be interrupted.) Syntax

Page 67: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 65

Parameter

Example

Page 68: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 66

7.3.12. Sending a DTMF Tone During a Call: ^DTMF

Description This command sends a DTMF tone to the network side during a call. Syntax

Parameter

Example

Page 69: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 67

7.3.13. Setting the Voice Mode: ^CVOICE

Description This command queries the voice mode supported by the data card. If voice is not supported, ERROR is returned; otherwise, the voice mode supported currently is returned. Syntax

Parameter

Page 70: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 68

Example

7.3.14. Setting the Voice Mode: ^VMSET

Description This command sets and queries the voice mode. Syntax

Parameter

Page 71: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 69

Example

7.3.15. Setting the Voice Bearing Port: ^DDSETEX

Description This command obtains and enables the voice data bearing port. Syntax

Page 72: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 70

Parameter

Example

7.3.16. Querying the Call Duration: ^CDUR

Description This command queries the duration of the current call. Syntax

Page 73: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 71

Parameter

Example

7.3.17. Setting Muting Control: +CMUT

Description This command sets uplink muting control. This command complies with the 3GPP TS 27.007 protocol. Syntax

Parameter

Page 74: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 72

Example

7.3.18. Initiating a Call with a Sub-address: ^APDS

Description This command initiates a call with a sub-address. (The process can be interrupted.) Syntax

Parameter

Page 75: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 73

Example

7.3.19. Querying the Call Source Number: ^CLPR

Description This command queries the call source number and existence indication. Syntax

Page 76: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 74

Parameter

Example

7.3.20. Reporting Call Status: ^CCALLSTATE

Description This command proactively reports call status changes to the AP. Syntax

Parameter

Page 77: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 75

Example

7.3.21. Call Initiating Indication: ^ORIG

Description After a user initiates a CS domain call, this command proactively notifies the user that the UE is initiating the call to the network. Syntax

Parameter

Example

Page 78: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 76

7.3.22. Network Connection Indication: ^CONF

Description This command proactively notifies a user that the UE receives the network connection indication for the call initiated by the user. Syntax

Parameter

Example

7.3.23. Call Connection Indication: ^CONN

Description This command proactively notifies a user that a call has been connected. Syntax

Parameter

Example

Page 79: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 77

7.3.24. Call Ending Notification: ^CEND

Description The command proactively reports the call ending reason and call duration to a user after a call ends. Syntax

Parameter

Page 80: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 78

Page 81: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 79

Example

7.4. Supplementary Service Commands

7.4.1. CLIP Service: +CLIP

Description This command enables or disables the calling line identification presentation (CLIP) service. When the CLIP service is enabled and the network allows, the calling number of an incoming call is reported. Syntax

Parameter

Page 82: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 80

Example

7.4.2. CLIR Service: +CLIR

Description This command enables or disables the calling line identification restriction (CLIR) service. When the CLIR service is enabled and the network allows, the calling number is not displayed to the called party. Syntax

Page 83: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 81

Parameter

Example

Page 84: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 82

7.4.3. COLP Service: +COLP

Description This command enables or disables the connected line identification presentation (COLP) service. When the COLP service is enabled and the network allows, the actually connected called number is displayed to the calling party after a call is connected. Syntax

Parameter

Example

Page 85: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 83

7.4.4. CUG Service: +CCUG

Description This command manages the CUG service. Syntax

Parameter

Page 86: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 84

Example

7.4.5. Supplementary Service Notifications: +CSSN

Description This command enables or disables supplementary service notifications, which are classified into +CSSI and +CSSU notifications.

• +CSSI: notifications received as the calling party.

• +CSSU: notifications received as the called party or during a call.

Page 87: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 85

Syntax

Parameter

Example

7.4.6. Call-related Supplementary Services: +CHLD

Description

Page 88: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 86

This command controls the following supplementary services:

• Call hold and unhold

• Multi-party call

Syntax

Parameter

Example

Page 89: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 87

7.4.7. Call Waiting Service: +CCWA

Description This command performs operations related to call waiting, including activation, deactivation, and status query. When the call waiting service is activated, and a new call arrives during the current call, call waiting information is reported.

NOTE:

The status query process can be interrupted.

Syntax

Parameter

Page 90: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 88

Example

Page 91: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 89

7.4.8. Call Forwarding Service: +CCFC

Description This command performs operations related to call forwarding, including registration, deletion, activation, deactivation, and status query. During status query,<class> must be set to a specific service type. Syntax

Parameter

Page 92: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 90

Page 93: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 91

Example

Page 94: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 92

7.4.9. Call Deflection Service: +CTFR

Description

Syntax

Parameter

Page 95: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 93

Example

Page 96: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 94

7.4.10. USSD Service: +CUSD

Description This command controls the unstructured supplementary service data (USSD) service. A USSD operation can be initiated by the network or TE. Syntax

Parameter

Page 97: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 95

Example

7.4.11. Proactively Reporting the Calling Number: +CLIP

Description This command reports +CLIP: <number>,<type> for an incoming call after CLIP is enabled. Syntax

Parameter

Page 98: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 96

Example

Page 99: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 97

7.4.12. Proactively Reporting the Connected Number: +COLP

Description This command reports the connected number when a call is initiated after COLP is enabled. Syntax

Parameter

Example

Page 100: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 98

7.4.13. Proactively Reporting the Supplementary Service Indication: +CSSI

Description This command reports +CSSI: <code1>[,<index>] when a supplementary service is triggered after +CSSI is enabled. Syntax

Parameter

Example

Page 101: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 99

7.4.14. Proactively Reporting the Supplementary Service Indication: +CSSU

Description This command reports +CSSU: <code2>[,<index>[,<number>,<type>]] when a supplementary service is triggered after +CSSU is enabled. Syntax

Parameter

Example

Page 102: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 100

7.4.15. Proactively Reporting Call Waiting: +CCWA

Description This command reports +CCWA:<number> ,<type>,<class> when a new call arrives during a call after call waiting result code reporting is enabled. Syntax

Parameter

Example

Page 103: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 101

7.4.16. Proactively Reporting the USSD Service: +CUSD

Description This command reports +CUSD:<m>[,<str>,<dcs>] when the network responds to the USSD service request initiated by the TE or the network initiates the USSD service request. Syntax

Parameter

Example

Page 104: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 102

7.4.17. Multi-Line Selection: ^ALS

Description This command sets the number used to initiate calls when the SIM card supports two phone numbers. Syntax

Parameter

Example

Page 105: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 103

7.4.18. UUS1 Service: +CUUS1

Description This command is used to control user-to-user signaling 1 (UUS1) service. For details, see the 3G 22.087 protocol.

• When the message type and User-to-User Information Element (UUIE) coexist, the UUS1 service of the message type is activated.

• When only the message is set but UUIE information does not exist, the UUS1 service of the message type is deactivated.

Syntax

Page 106: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 104

Parameter

Example

Page 107: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 105

7.4.19. Proactively Reporting UUS1 Indication: +CUUS1I

Description If +CUUS1I is enabled, this command reports messages to the application in the +CUUS1I format if messages sent by the network contain the UUIE in the MO process or when the local party ends the call. Syntax

Parameter

Page 108: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 106

Example

7.4.20. Proactively Reporting UUS1 Indication: +CUUS1U

Description If +CUUS1U is enabled, this command reports messages to the application in the +CUUS1U format if messages sent by the network contain the UUIE in the MT process or when the peer party ends the call. Syntax

Parameter

Example

Page 109: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 107

7.4.21. Setting the USSD Transmission Mode: ^USSDMODE

Description This commands set the USSD mode to transparent or non-transparent. The setting result does not need to be saved in the NV. During initialization, the board first tries to read the NV. If the NV is not activated, the board queries the default USSD mode from the ussd_default_table table. The ^USSDMODE? command queries the USSD mode supported by the board currently, and returns the current value of global variable ussd_mode. Syntax

Parameter

Example

Page 110: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 108

8. Android RIL Integration Guide

8.1. Overview 1.Introduction to the Huawei RIL

• RIL is short for Radio Interface Layer.

• When an Android operating system (OS) works with a module/modem to provide functions such as data, voice and Global Positioning System (GPS) services, the Android OS must communicate with the module/modem. The RIL is used to implement the communication between an Android OS and a module/modem.

• To enable Android to support different communications methods (such as using AT commands or QMI commands), Google divides the RIL into two components: an RIL Daemon (RILD) and a Vendor RIL. The RILD monitors the requests (for example, a request for making a call) from the upper layers of Android, and invokes the interfaces implemented at the Vendor RIL to send the requests to the module/modem. Then the module/modem handles the requests. For Huawei modules, this process is to convert the requests into corresponding AT commands and send the commands to the modules.

• The RILD has been designed by Google and does not require any modification. The Vendor RIL is designed by vendors, and it is the Huawei RIL in this document.

RIL architecture

Page 111: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 109

2.Huawei RIL Deliverables HUAWEI RIL deliverables contains three files, if necessary, please contact the person in charge of communication in the map accessible.

1. RIL library file: libhuawei-ril.so.

NOTE:

This is the Vendor RIL.

2. ip-up script

NOTE:

When a Point-to-Point Protocol (PPP) link is established successfully, this script is executed to set the ip, dns and gw parameters.

3. ip-down script

NOTE:

Page 112: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 110

When a PPP link failed to be established, this script is executed to clear the ip, dns and gw parameters.

8.2. What Are Supported 1.Supported Functions The Huawei RIL supports the following:

• Basic device and network management service for WCDMA, CDMA2000 and TD-SCDMA;

• Data service for WCDMA, CDMA2000 and TD-SCDMA;

• SMS service for WCDMA, CDMA2000 and TD-SCDMA;

• Basic PCM voice service for WCDMA, CDMA2000 and TD-SCDMA;

• Phonebook service for WCDMA and TD-SCDMA;

• Voice supplementary services for WCDMA,CDMA;

• USSD service for WCDMA;

• Support for GPS + GLONASS two positioning system positioning.

2.Supported Android Versions At present, the Huawei RIL supports the following versions of Android:

• Android 2.x

• Android 3.x

• Android 4.x

8.3. Integration Integrating the Huawei RIL

NOTE:

The following integration procedure is based on a platform of Nvidia Tegra 2 + Android 2.2. Integration on other platforms may be slightly different.

1.Launching libhuawei-ril.so Modifying the initialization script (system/core/rootdir/init.rc): service ril-daemon /system/bin/rild -l libhuawei-ril.so Put libhuawei-ril.so into /system/lib 2.Modifying the Rights of Device Ports Please make sure the device ports, PCUI and MODEM, possess readable, writable, and

Page 113: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 111

executive rights. For example, add commands, chmod 777 /dev/ttyUSB0 chmod 777 /dev/ttyUSB2 or, chmod 777 /dev/ttyACM0 chmod 777 /dev/ttyACM1 in the initialization script rootdir/init.rc.

NOTE:

• Usually, for TD-SCDMA module,

• /dev/ttyACM0 is modem port, while /dev/ttyACM1 is PCUI port.

• In addition:

• The modem/pcui/diag/ port names depend on the modules instructions of which you can refer to.

3.Preparing ip-up and ip-down scripts Copy ip-up and ip-down scripts to directory /etc/ppp.

NOTE:

• Scripts ip-up and ip-down need readable, writable and executive rights.

• For example, add commands,

• chmod 777 /etc/ppp/ip-up

• chmod 777 /etc/ppp/ip-down

• in the initialization script rootdir/init.rc.

4.Modifying the Right of RILD RILD needs executive right. For example, comment out the function switchUser()in the file /hardware/ril/rild/ rild.c: // switchUser(); 5.Notification for CDMA2000 support on Android2.3 To support CDMA2000 module in Android2.3, the preferred network mode should be changed to “4”, preferred_network_mode of WCDMA and TD-SCDMA module is “0”. For example: Using adb shell to execute the following command: sqlite3 /data/data/com.android.providers.settings/databases/settings.db update secure set value='4' where name='preferred_network_mode'; .quit Now, the system can use the CDMA module. 6.Notifications for CDMA2000 SMS support 1. Modify the following functions on the file: {android_root}/frameworks/base/telephony/java/com/android/internal/telephony/cd

Page 114: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 112

ma /SmsMessage.java (1) privateGetSubmitPdu():modify “int teleservice = bearerData.hasUserDataHeader ? SmsEnvelope.TELESERVICE_WEMT : SmsEnvelope.TELESERVICE_WMT;” to “int teleservice = SmsEnvelope.TELESERVICE_WMT;” (2)createFromEfRecord(): modify “int size = data[1];” to “int size = data[1] & 0xff;” (3)parsePduFromEfRecord():modify “int parameterLen = dis.readByte();” to “int parameterLen = dis.readByte() & 0xff;” 2. Modify the following function on the file: {android_root}/frameworks/base/telephony/java/com/android/internal/telephony/cdma /sms/BearderData.java (1) decode7bitAscii():modify “int wantedBits = (offset * 8) + (numFields * 7);” to “if (48 == offset) { offset++; numFields = numFields - 7; } int wantedBits = offset + (numFields * 7);” 7.Sending AT commands through OEM-HOOK-STRING RIL OEM-HOOK interfaces allow users send AT commands to module/modem directly. Currently, Huawei RIL only implements the interface OEM-HOOK-STRING. Following example shows how to send AT command from framework directly. Sending command “AT^SWSPATH=2” to switch the module to PCM mode when SIM ready. File: GsmServiceStateTracker.java or CdmaServiceStateTracker.java, Function: public void handleMessage (Message msg), Sample: case EVENT_SIM_READY: phone.invokeOemRilRequestStrings(new String[]{ "AT^SWSPATH=2" }, mHandler.obtainMessage(EVENT_OEM_RIL_MESSAGE));

Page 115: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 113

9. FAQs positioning method

9.1. After integration issues driver port 1.Serial driver successfully integrate confirm Huawei data card is inserted, the terminal perform "dmesg" command to check the integration is successful, the following (or similar) message, if presence information log, It indicates a successful integration (idProduct vary depending, ttyUSB number is also associated with the product * of the product):

The implementation of "ls / dev / ttyUSB *" command to query whether the port mapping is successful:

Port Purpose Description: modem port: for data channel after the ppp dialing and dialing. diag port: reserved ports. pcui Port: AT port, issued at use. Note: AT commands issued in terminal mode

1. Open a terminal (labeled 1), enter ls / dev / ttyUSB * command, you can query mapping out the serial port names.

Page 116: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 114

2. Enter the cat / dev / ttyUSB2_pcui command in Terminal 1, press the Enter key.

3. Reopen terminal (labeled 2), enter in a terminal issued 2 AT command, press the Enter key, then the terminal 1 displays return information AT commands.

2.Network port driver successfully integrate confirm Execute "cat / proc / bus / usb / devices" or "cat / sys / kernel / debug / usb / devices", view Huawei equipment 12d1 corresponding interface driver loaded situation in the results:

If the loading system ECM driven, the red box office of Driver = cdc_ether;

Page 117: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 115

If the loading system NCM driven, the red box office of Driver = cdc_ncm; If the load is Huawei's network card driver, then the red box at the Driver = huawei_ether. 3.Drive-integrated failed log acquisition method If you follow the instructions After integration, can not be mapped port or can not find the corresponding port configuration (note instructions must be strictly in accordance with the integrated operations), the need to provide log positioning Open the terminal, the implementation of "dmesg" command and save the output

to dmesg.txt documents. The implementation of "ls -l / sys / bus / usb / devices /" command to save the

output to logcat.txt documents. implementation of "ls -l / sys / bus / usb / drivers /" command to save the output

to logcat.txt documentation to ensure that there are options for this directory option, if not refer toDriven integrated configuration procedure checks to confirm the changes correctly.

The implementation of "ls -l / sys / bus / usb / drivers / option / *** /" command to save the output file in logcat.txt

Execute "cat / sys / bus / usb / drivers / option / *** / bInterface * command to save the output file in logcat.txt

Red part is similar to the "1-1: 1.0" "1-1: 1.1" "1-1: 1. *" The Arab word of this structure.

If you can execute "cat / proc / bus / usb / devices" this command, set the output stored in logcat.txt documents (if not, please ignore this command).

4.Port Switching Problems Description: The port shape is incorrect Solution:In the integrated when required dialing mode selection switch command. Integrated Document "Huawei's data cards embedded Linux and Android kernel driver integrated guidance documents" in function "usb_stor_huawei_scsi_init" as defined in

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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x11, 0x06, 0x30, 0x00, 0x00, 0x01, 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; }

Note: where 0x06, 0x30, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, reference 00 indicates the default bold segment switched to MODEM Dial,

Page 118: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 116

Reported MODEM + DIAG + PCUI port, PID is 0x1001, if you need to switch to NDIS dialing, you can modify the standard bold section 0x01, Port morphology of MDM + DIAG + PCUI + NDIS [+ NDIS + NDIS + NDIS] port, PID of 0x155E, or morphology of port MDM + DIAG + PCUI + SD + NDIS [+ NDIS + NDIS + NDIS] port, PID is 0x155F. If issued 0x06, 0x30, 0x00, 0x00, 0x01, 0x00, 0x00, command 0x00 field, the port reported the following form:

Table 1 Port form

Port order PID

MDM+DIAG+PCUI 1001

If issued 0x06, 0x30, 0x00, 0x00, 0x01, 0x00, 0x01,command 0x00 field, the port reported the following form:

Table 2 Port form

Port order PID

MDM+DIAG+PCUI+NDIS 155E

MDM+DIAG+PCUI+SD+NDIS 155F

9.2. After the drive-integrated Modem / Ndis dial problem

1.Modem Dial issue alarms

First crawled under USB analyzer log, look at the AT command processing, the board is already registered before dialing successfully obtained a valid service. If not, you can use the PC in the same environment verification, crawling on the PC board SDT or HIDS log analyzes; (under normal circumstances registration is not related with integrated side)

Veneer obtain a valid service, but modem dial-up fails. The more common problems, see the tripartite integration cases.

Modem dialing through USB analyzer log, troubleshoot packet information LCP, IPCP and authentication processes.

Page 119: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 117

2. Ndis Dial issue alarms

The method of analysis is consistent with the modem, the registration status of the investigation before the board;

Crawl USB analyzer log, first dial the AT command analysis and other parameters are all right; if the PC environment can reproduce, they crawl log analysis on a PC.

9.2.1. HIDS analyzer log grab method

Prerequisite 1.Preparation

1. Open debug port

a. at^datalock=xxxxx(SIMLOCK CODE) b. at^setport="ff;12,3,16,13,14,A,5" c. at^spword=xxxxxx(SHELL CODE) d. at^shell=2 e. at^reset

2. open the debug port.

open debug switch g_ulIfForwardToPc=1 g_ulCapPusch=1 g_ulCapPdsch=1

2.HIDS Tool

1. Open HIDS Tool

Page 120: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 118

2. Connect port

Connect the UE to PC, after all the ports mapping finished, do as follows:

a. Normally, using the default port to connect.

b. if the tools cannot connect the port. You need save this xml to Next chart trail. After completing, reboot HIDS tool.

Page 121: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 119

c. Open the LV ALL Messages Windows, you can see log will print.

3. Save log

a. You may the click File->Save As

b. After key in the name, touch preservation

Page 122: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 120

c. Please send this HIDS_Q1.dftx to us.

3 Wireshark Tool

1. Select the network card:

a. Capture -> Options…

b. Select the test network card ,and then click the “Start ” to collect the logs

Page 123: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 121

2. After the issue replicated , please stop the tool

3. Save the logs , and feedback it.

Page 124: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 122

9.2.2. SDT Analyzer log grab method

Prerequisite 1.Open SDT,when the datacard register network,choose the 3G application interface com which you need Establish.like following picture

2.Click connect OM

Page 125: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 123

3.Open the message list

4.Reproduce issue ,when it is finish,save the log.

Page 126: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 124

Parent topic: After the drive-integrated Modem / Ndis dial problem(See 9.2)

9.2.3. USB analyzer log grab method

Prerequisite 1.Setting up the Analyzer, follow these steps:

Open the Analyzer, click the green box to pop up the following window, according to the following diagram set

Page 127: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 125

Page 128: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 126

Page 129: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 127

Page 130: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 128

Page 131: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 129

Close the dialog After selecting

Page 132: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 130

Page 133: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 131

Page 134: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 132

Page 135: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 133

Close After selecting this dialog box and click OK as shown below.

Select "General" option, as shown choose "Manual Trigger", then click "OK"

Page 136: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 134

Click below location to start ripping Log.

If it is a long time test, please set it according to the figure below

Page 137: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 135

9.3. Other questions 1.SMS tripartite integration issues

Confirm send SMS format, view the message board supports this format Confirm the customer Procedure Verify that the network is ok The above three points to confirm there is no problem, grab boards and equipment at the command interaction of log (sdt log) specific analysis of specific issues

2.Android Ril integration issues

Ril deliverables for the library file (libhuawei-ril.so), ip-up script (script executed when the link is established successfully ppp when RIL need to provide integrated,

Set ip / dns / gw information), ip-down script (executed when the script ppp link establishment fails to clear ip / dns / gw information).

If there is a problem, you can get through the following methods log: See RIL's log: adb logcat -v time -b radio See Android system log: adb logcat -v time

Page 138: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 136

See kernel log: adb shell dmesg Android system serial port:

adb shell into the Android system; (adb tool installation package, Android driver package)

echo -e "at+cfun=0\r\n" > /dev/ttyUSB0 Look at the return value, the log can be viewed in the RIL

3.Failed domain names

Description: Enter the correct domain name information, you can not open the page. The reason is that the DNS does not get to the pad. Solution: The ip-up and ip-down script copies to both Android system under / etc / ppp directory:

adb push ip-up /etc/ppp adb push ip-down /etc/ppp

To ip-up and ip-down script gives two readable, writable and executable permissions:

chmod 777 /etc/ppp/ip-up chmod 777 /etc/ppp/ip-down

4.Close AT Echo

Before sending the other at the board instruction, we need to send ate0 to close AT echo. Doing so may cause an infinite loop.

5. GSM network search reboot problem

In GSM mode, when the search network data card required current is large, if the lack of hardware power supply capacity may cause data card restart. (Host instantaneous current capability requirements 2A, long 1A).

6. E3372h Unsuccessful dial-up probability

Description: E3372h the probability of dialing is not successful, APN is correct Solution: The client switch command issued by the gateway 11 06 20 is the linux on the switch command, instead of the tripartite adapter requires the gateway to issue the switch command 11 06 30, modify the switch command to 11 06 30.

7. K5160 downlink rate of only 20Mbps

Description: K5160 downlink speed is only 20Mbps, and The usb negotiation rate is usb1.1. Solution: Gateway in the switch from the CD-ROM mode to the network card

Page 139: Integration Userguide for Huawei Dongles

Integration Userguide for Huawei Dongles Confidential

Issue 02 (2017-01-04) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd. 137

mode, an increase of 500ms delay.