interactignore_user_abort

ignore_user_abort  时间:2021-04-05  阅读:()
WCDMA<ELinuxUSBDriverUserGuideUMTS/HSPA/LTEModuleSeriesRev.
WCDMA<E_Linux_USB_Driver_User_Guide_V1.
8Date:2017-09-01www.
quectel.
comUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released1/47Ouraimistoprovidecustomerswithtimelyandcomprehensiveservice.
Foranyassistance,pleasecontactourcompanyheadquarters:QuectelWirelessSolutionsCo.
,Ltd.
7thFloor,HongyeBuilding,No.
1801HongmeiRoad,XuhuiDistrict,Shanghai200233,ChinaTel:+862151086236Email:info@quectel.
comOrourlocaloffice.
Formoreinformation,pleasevisit:http://quectel.
com/support/sales.
htmFortechnicalsupport,ortoreportdocumentationerrors,pleasevisit:http://quectel.
com/support/technical.
htmOrEmailto:support@quectel.
comGENERALNOTESQUECTELOFFERSTHEINFORMATIONASASERVICETOITSCUSTOMERS.
THEINFORMATIONPROVIDEDISBASEDUPONCUSTOMERS'REQUIREMENTS.
QUECTELMAKESEVERYEFFORTTOENSURETHEQUALITYOFTHEINFORMATIONITMAKESAVAILABLE.
QUECTELDOESNOTMAKEANYWARRANTYASTOTHEINFORMATIONCONTAINEDHEREIN,ANDDOESNOTACCEPTANYLIABILITYFORANYINJURY,LOSSORDAMAGEOFANYKINDINCURREDBYUSEOFORRELIANCEUPONTHEINFORMATION.
ALLINFORMATIONSUPPLIEDHEREINISSUBJECTTOCHANGEWITHOUTPRIORNOTICE.
COPYRIGHTTHEINFORMATIONCONTAINEDHEREISPROPRIETARYTECHNICALINFORMATIONOFQUECTELCO.
,LTD.
TRANSMITTING,REPRODUCTION,DISSEMINATIONANDEDITINGOFTHISDOCUMENTASWELLASUTILIZATIONOFTHECONTENTAREFORBIDDENWITHOUTPERMISSION.
OFFENDERSWILLBEHELDLIABLEFORPAYMENTOFDAMAGES.
ALLRIGHTSARERESERVEDINTHEEVENTOFAPATENTGRANTORREGISTRATIONOFAUTILITYMODELORDESIGN.
CopyrightQuectelWirelessSolutionsCo.
,Ltd.
2017.
Allrightsreserved.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released2/47AbouttheDocumentHistoryRevisionDateAuthorDescription1.
02015-02-27JoeWANGInitial1.
12015-3-25CarlYINUpdatedsupportedproducts1.
22015-3-30KentXUAddedZeroPacketfeatureinSection3.
2.
2and3.
3.
21.
32015-06-24CarlYIN1.
AddedGobiNetandQMIWWANdescriptioninSection3.
4and3.
52.
AddedbuildingdriversasakernelmoduleinSection3.
2.
4/3.
3.
4/3.
4.
3/3.
5.
43.
AddedpowermanagementinChapter44.
AddedFAQandkernelloginChapter61.
42015-12-161.
DeletedAuto-ConnectofGobiNetandQMIWWAN2.
Updatedtheusageofquectel-CM1.
52016-05-13CarlYIN/NeoHOUUpdatedsupportedmodules1.
62016-08-23KentXUAddedEC20R2.
0insupportedmodules1.
72017-05-24KentXUAddedEG91/EG95/EG06/EP06/EM06/BG96insupportedmodules1.
82017-09-01KentXUUpdateddescriptionofsupportedmodulesandaddedAG35insupportedmodules.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released3/47ContentsAbouttheDocument.
2Contents.
3TableIndex.
5FigureIndex61Introduction72ProductsOverview83SystemSetup103.
1.
LinuxUSBDriverStructure103.
2.
USBSerialDriverforUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35113.
2.
1.
AddVIDandPID.
113.
2.
2.
AddtheZeroPacketMechanism.
123.
2.
3.
AddResetResume.
133.
2.
4.
EnlargeBulkoutURBs143.
2.
5.
UseGobiNetorQMIWWAN.
143.
2.
6.
ModifyKernelConfiguration.
163.
2.
7.
BuildandLoadDriverasAKernelModuleforPCinLinux173.
3.
CDCACMDriverforUG95/UG96173.
3.
1.
ModifyDriverSourceCode.
173.
3.
2.
AddtheZeroPacketMechanism.
183.
3.
3.
AddResetResume.
183.
3.
4.
ModifyKernelConfiguration.
193.
3.
5.
BuildandLoadDriverasaKernelModuleforPCinLinux203.
4.
GobiNetDriverforUC20/EC2x/EGxx/EP06/EM06/BG96/AG35203.
4.
1.
ModifyDriverSourceCode.
213.
4.
2.
ModifyKernelConfiguration.
213.
4.
3.
BuildandLoadDriverasaKernelModuleforPCinLinux223.
5.
QMIWWANDriverforUC20/EC2x/EGxx/EP06/EM06/BG96/AG35223.
5.
1.
AddVIDandPID.
233.
5.
2.
AddSupportforRawIPModeforEC2x/EGxx/EP06/EM06/BG96/AG35.
243.
5.
3.
ModifyKernelConfiguration.
283.
5.
4.
BuildandLoadDriverasaKernelModuleforPCinLinux293.
6.
ConfigureKerneltoSupportPPP.
304PowerManagement314.
1.
EnableUSBAutoSuspend.
314.
2.
EnableUSBRemoteWakeup325TesttheModule.
345.
1.
TestATFunction345.
2.
TestPPPFunction355.
3.
TestGobiNetorQMIWWAN.
40UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released4/476FAQandKernelLog446.
1.
HowtoCheckWhetherUSBDriverExistsintheModule.
446.
2.
HowtoCheckWhethertheModuleWorksWellwiththeCorrespondingUSBDriver.
447AppendixAReferences.
47UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released5/47TableIndexTABLE1:SUPPORTEDPRODUCTS.
7TABLE2:INTERFACEINFORMATION8TABLE3:TERMSANDABBREVIATIONS.
47UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released6/47FigureIndexFIGURE1:USBDRIVERSTRUCTURE.
10FIGURE2:CONFIGUREUSBSERIALINKERNEL16FIGURE3:CONFIGURECDCACMDRIVERINKERNEL.
20FIGURE4:CONFIGUREQMIWWANDRIVERINKERNEL29FIGURE5:CONFIGUREPPPINKERNEL30FIGURE6:ATTESTRESULTFOREC2034FIGURE7:USBSERIALFORUC1545FIGURE8:USBSERIALANDGOBINETFORUC2045FIGURE9:USBSERIALANDQMIWWANFORUC20.
46FIGURE10:CDCACMFORUG95/UG96.
46UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released7/471IntroductionThisdocumentintroduceshowtogeneratetheUSBdriverforQuectelmoduleinLinuxOS,andhowtousethemoduleaftertheUSBdriverisloadedsuccessfully.
ThisdocumentisapplicabletoQuectelUCxx1),EC2x2),EGxx3),EP06,EM06,BG96,AG35,UG95andUG96modules.
1.
1)UCxxcontainsUC15andUC20.
2.
2)EC2xcontainsEC25,EC21andEC20.
3.
3)EGxxcontainsEG91,EG95andEG06.
Thefollowingtableshowsthedetails.
Table1:SupportedProductsProductDriverSupportedNoteUC15USBSerial√RefertoSection3.
2forUSBSerialdriverUC20USBSerial√RefertoSection3.
2forUSBSerialdriverGobiNet√RefertoSection3.
4forGobiNetdriverQMIWWAN√RefertoSection3.
5forQMIWWANdriverEC25EC21EC20EG91EG95EG06EP06EM06BG96AG35USBSerial√RefertoSection3.
2forUSBSerialdriverGobiNet√RefertoSection3.
4forGobiNetdriverQMIWWAN√RefertoSection3.
5forQMIWWANdriverUG95UG96CDCACM√RefertoSection3.
3forCDCACMdriverNOTESUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released8/472ProductsOverviewUSBonQuectelUMTS/HSPA/LTEmodulecontainsseveraldifferentfunctionalinterfaces.
ThefollowingtabledescribestheinterfaceinformationofdifferentmodulesintheLinuxsystem.
Table2:InterfaceInformationProductUSBDriverInterfaceUC15VID:0x05c6PID:0x9090UC20VID:0x05c6PID:0x9003EC25VID:0x2c7cPID:0x0125EC21VID:0x2c7cPID:0x0121EC20VID:0x05c6PID:0x9215EG91VID:0x2c7cPID:0x0191EG95VID:0x2c7cPID:0x0195EG06VID:0x2c7cPID:0x0306EP06VID:0x2c7cPID:0x0306EM06VID:0x2c7cPID:0x0306BG96VID:0x2c7cPID:0x0296AG35VID:0x2c7cPID:0x0435USBSerialttyUSB0→DMttyUSB1→ForGPSNMEAmessageoutputttyUSB2→ForATcommandcommunicationttyUSB3→ForPPPconnectionsorATcommandcommunicationUC20VID:0x05c6PID:0x9003EC25VID:0x2c7cPID:0x0125EC21VID:0x2c7cPID:0x0121EC20VID:0x05c6PID:0x9215EG91VID:0x2c7cPID:0x0191EG95VID:0x2c7cPID:0x0195EG06VID:0x2c7cPID:0x0306EP06VID:0x2c7cPID:0x0306EM06VID:0x2c7cPID:0x0306BG96VID:0x2c7cPID:0x0296AG35VID:0x2c7cPID:0x0435GobiNetorQMIWWANethXorwwanX→Interface4canbeusedasUSBnetworkadapterUG95/UG96VID:0x1519PID:0x0020CDCACMttyACM0→ForPPPconnectionsorATcommandcommunicationttyACM1→Trace1ttyACM2→Trace2ttyACM3→ForATcommandcommunicationUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released9/47ttyACM4→ForATcommandcommunicationttyACM5→ReservedttyACM6→ReservedUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released10/473SystemSetupThischaptermainlydescribesthegeneralorganizationoftheUSBstackinLinuxandhowtouseUSBserial,CDCACM,GobiNetandQMIWWANdrivers,aswellashowtocompileandloadthedrivers.
3.
1.
LinuxUSBDriverStructureUSBisakindofhierarchicalbusstructure.
ThedatatransmissionbetweenUSBdevicesandhostisachievedbyUSBcontroller.
ThefollowingpictureillustratesthearchitectureofUSBdriver.
LinuxUSBhostdriverincludesthreeparts:USBhostcontrollerdriver,USBcoreandUSBdevicedrivers.
Figure1:USBDriverStructureUSBhostcontrollerdriver,thebottomofthehierarchicalstructure,isasoftwaremodulewhichinteractsdirectlywithhardware.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released11/47USBcore,thecoreofthewholeUSBhostdriver,isresponsibleforthemanagementofUSBbus,USBbusdevicesandUSBbusbandwidth;itprovidestheinterfacesforUSBdevicedrivers,throughwhichtheapplicationscanaccesstheUSBsystemfiles.
USBdevicedriversinteractwiththeapplications,andmainlyprovidetheinterfacesforaccessingthespecificUSBdevices.
3.
2.
USBSerialDriverforUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35IfcustomersareusingUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35andrequiringUSBserialdriver,pleasereadthissectionfordetails.
Otherwise,pleaseskipthissection.
WhenthemoduleisattachedtotheUSBserialdriver,thedriverwillcreatedevicefilesindirectory/dev,namedasbelow:ttyUSB0/ttyUSB1/ttyUSB2…ThefollowingpartsshowhowtointegrateUSBserialdriver.
3.
2.
1.
AddVIDandPIDInordertorecognizethemodule,customersshouldaddmoduleVIDandPIDinformationasbelow:File:[KERNEL]/drivers/usb/serial/option.
cstaticconststructusb_device_idoption_ids[]={#if1//AddedbyQuectel{USB_DEVICE(0x05C6,0x9090)},/*QuectelUC15*/{USB_DEVICE(0x05C6,0x9003)},/*QuectelUC20*/{USB_DEVICE(0x2C7C,0x0125)},/*QuectelEC25*/{USB_DEVICE(0x2C7C,0x0121)},/*QuectelEC21*/{USB_DEVICE(0x05C6,0x9215)},/*QuectelEC20*/{USB_DEVICE(0x2C7C,0x0191)},/*QuectelEG91*/{USB_DEVICE(0x2C7C,0x0195)},/*QuectelEG95*/{USB_DEVICE(0x2C7C,0x0306)},/*QuectelEG06/EP06/EM06*/{USB_DEVICE(0x2C7C,0x0296)},/*QuectelBG96*/{USB_DEVICE(0x2C7C,0x0435)},/*QuectelAG35*/#endifForEC20module,ifthefollowingfilesandstatementsexistinthekernelsourcefiles,pleasedeletethem,astheywillconflictwithEC20'sUSBdriver.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released12/47File:[KERNEL]/drivers/usb/serial/qcserial.
c{USB_DEVICE(0x05c6,0x9215)},/*AcerGobi2000Modemdevice(VP413)*/File:[KERNEL]/drivers/net/usb/qmi_wwan.
c{QMI_GOBI_DEVICE(0x05c6,0x9215)},/*AcerGobi2000Modemdevice(VP413)*/3.
2.
2.
AddtheZeroPacketMechanismAsrequiredbytheUSBprotocol,customersneedtoaddthemechanismforprocessingzeropacketsduringbulkouttransmission.
ForLinuxkernelversionhigherthan2.
6.
34:File:[KERNEL]/drivers/usb/serial/usb_wwan.
cstaticstructurb*usb_wwan_setup_urb(structusb_serial*serial,intendpoint,intdir,void*ctx,char*buf,intlen,void(*callback)(structurb*)){……usb_fill_bulk_urb(urb,serial->dev,usb_sndbulkpipe(serial->dev,endpoint)|dir,buf,len,callback,ctx);#if1//AddedbyQuectelforzeropacketif(dir==USB_DIR_OUT){structusb_device_descriptor*desc=&serial->dev->descriptor;if(desc->idVendor==cpu_to_le16(0x05C6)&&desc->idProduct==cpu_to_le16(0x9090))urb->transfer_flags|=URB_ZERO_PACKET;if(desc->idVendor==cpu_to_le16(0x05C6)&&desc->idProduct==cpu_to_le16(0x9003))urb->transfer_flags|=URB_ZERO_PACKET;if(desc->idVendor==cpu_to_le16(0x05C6)&&desc->idProduct==cpu_to_le16(0x9215))urb->transfer_flags|=URB_ZERO_PACKET;if(desc->idVendor==cpu_to_le16(0x2C7C))urb->transfer_flags|=URB_ZERO_PACKET;}#endifreturnurb;}ForLinuxkernelversionlowerthan2.
6.
35:File:[KERNEL]/drivers/usb/serial/option.
c/*Helperfunctionsusedbyoption_setup_urbs*/staticstructurb*option_setup_urb(structusb_serial*serial,intendpoint,UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released13/47intdir,void*ctx,char*buf,intlen,void(*callback)(structurb*)){……usb_fill_bulk_urb(urb,serial->dev,usb_sndbulkpipe(serial->dev,endpoint)|dir,buf,len,callback,ctx);#if1//AddedbyQuectelforzeropacketif(dir==USB_DIR_OUT){structusb_device_descriptor*desc=&serial->dev->descriptor;if(desc->idVendor==cpu_to_le16(0x05C6)&&desc->idProduct==cpu_to_le16(0x9090))urb->transfer_flags|=URB_ZERO_PACKET;if(desc->idVendor==cpu_to_le16(0x05C6)&&desc->idProduct==cpu_to_le16(0x9003))urb->transfer_flags|=URB_ZERO_PACKET;if(desc->idVendor==cpu_to_le16(0x05C6)&&desc->idProduct==cpu_to_le16(0x9215))urb->transfer_flags|=URB_ZERO_PACKET;if(desc->idVendor==cpu_to_le16(0x2C7C))urb->transfer_flags|=URB_ZERO_PACKET;#endifreturnurb;}3.
2.
3.
AddResetResumeSomeUSBhostcontrollers/USBhubswilllostpowerorberesetwhenMCUenteringintosuspend/sleepmode,andtheycannotresumeUSBdevicesafterMCUexitsfromsuspend/sleepmode.
Pleaseaddthefollowingstatementstoenablereset-resumeprocess.
ForLinuxkernelversionhigherthan3.
4:File:[KERNEL]/drivers/usb/serial/option.
cstaticstructusb_serial_driveroption_1port_device={……#ifdefCONFIG_PM.
suspend=usb_wwan_suspend,.
resume=usb_wwan_resume,#if1//AddedbyQuectel.
reset_resume=usb_wwan_resume,#endif#endif};UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released14/47ForLinuxkernelversionlowerthan3.
5:File:[KERNEL]/drivers/usb/serial/usb-serial.
c/*DriverstructureweregisterwiththeUSBcore*/staticstructusb_driverusb_serial_driver={.
name="usbserial",.
probe=usb_serial_probe,.
disconnect=usb_serial_disconnect,.
suspend=usb_serial_suspend,.
resume=usb_serial_resume,#if1//AddedbyQuectel.
reset_resume=usb_serial_resume,#endif.
no_dynamic_id=1,.
supports_autosuspend=1,};3.
2.
4.
EnlargeBulkoutURBsForLinuxkernelversionlowerthan2.
6.
29,bulkoutURBsneedtobeenlargedtogetfasteruplinkspeed.
File:[KERNEL]/drivers/usb/serial/option.
c#defineN_IN_URB4#defineN_OUT_URB4//Quectel1#defineIN_BUFLEN4096#defineOUT_BUFLEN4096//Quectel1283.
2.
5.
UseGobiNetorQMIWWANIfcustomersareusingUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35andrequiringGobiNetorQMIWWAN,pleaseaddthefollowingstatementstopreventthesemodules'interface4frombeingusedasUSBserialdevice.
ForLinuxkernelversionhigherthan2.
6.
30:File:[KERNEL]/drivers/usb/serial/option.
cstaticintoption_probe(structusb_serial*serial,conststructusb_device_id*id){structusb_wwan_intf_private*data;……#if1//AddedbyQuectel//QuectelUC20'sinterface4canbeusedasUSBnetworkdeviceif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released15/47serial->dev->descriptor.
idProduct==cpu_to_le16(0x9003)&&serial->interface->cur_altsetting->desc.
bInterfaceNumber>=4)return-ENODEV;//QuectelEC20'sinterface4canbeusedasUSBnetworkdeviceif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9215)&&serial->interface->cur_altsetting->desc.
bInterfaceNumber>=4)return-ENODEV;//QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96/AG35'sinterface4canbeusedasUSBnetworkdeviceif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x2C7C)&&serial->interface->cur_altsetting->desc.
bInterfaceNumber>=4)return-ENODEV;#endif/*Storedeviceidsowecanuseitduringattach.
*/usb_set_serial_data(serial,(void*)id);return0;}ForLinuxkernelversionlowerthan2.
6.
31:File:[KERNEL]/drivers/usb/serial/option.
cstaticintoption_startup(structusb_serial*serial){……dbg("%s",__func__);#if1//AddedbyQuectel//QuectelUC20'sinterface4canbeusedasUSBnetworkdeviceif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9003)&&serial->interface->cur_altsetting->desc.
bInterfaceNumber>=4)return-ENODEV;//QuectelEC20'sinterface4canbeusedasUSBnetworkdeviceif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9215)&&serial->interface->cur_altsetting->desc.
bInterfaceNumber>=4)return-ENODEV;//QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96/AG35'sinterface4canbeusedasUSBnetworkdeviceif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x2C7C)&&serial->interface->cur_altsetting->desc.
bInterfaceNumber>=4)return-ENODEV;#endif……UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released16/47}3.
2.
6.
ModifyKernelConfigurationThereareseveralmandatoryselecteditemsinkernelconfiguration,pleasefollowthestepsbelowtoconfigurethekernel:Step1:Changetokerneldirectory.
cdStep2:Setenvironmentvariables,andimportboard'sdefconfig.
ThefollowingisanexampleforRaspeberryPiboard.
exportARCH=armexportCROSS_COMPILE=arm-none-linux-gnueabi-makebcmrpi_defconfigStep3:Compilethekernel.
makemenuconfigStep4:EnableCONFIG_USB_SERIAL_OPTION[*]DeviceDrivers→[*]USBSupport→[*]USBSerialConvertersupport→[*]USBdriverforGSMandCDMAmodemsFigure2:ConfigureUSBSerialinKernelUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released17/473.
2.
7.
BuildandLoadDriverasAKernelModuleforPCinLinuxPleasefollowthestepsbelowtobuildthedriverasakernelmodule,andusemodprobecommandtoloadthemodulewithLinuxOSonPC.
Step1:Changetokerneldirectory.
cdStep2:Buildthedriver.
sudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/usb/serialobj-m=option.
omodulessudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/usb/serialobj-m=usb_wwan.
omodulessudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/usb/serialobj-m=qcserial.
omodulesStep3:Loadthedriverandreboot.
sudocpdrivers/usb/serial/option.
ko/lib/modules/`uname-r`/kernel/drivers/usb/serialsudocpdrivers/usb/serial/usb_wwan.
ko/lib/modules/`uname-r`/kernel/drivers/usb/serialsudocpdrivers/usb/serial/qcserial.
ko/lib/modules/`uname-r`/kernel/drivers/usb/serialsudodepmodsudoreboot3.
3.
CDCACMDriverforUG95/UG96IfcustomersareusingUG95/UG96andrequiringCDCACMdriver,pleasereadthissectionfordetails.
Otherwise,pleaseskipthissection.
WhenthemoduleisattachedtoCDCACMdriver,thedriverwillcreatedevicefilesindirectory/dev,namedasbelow:ttyACM0/ttyACM1/ttyACM2…ThefollowingpartsshowhowtointegratetheCDCACMdriver.
3.
3.
1.
ModifyDriverSourceCodeThedeviceisattachedtoCDCACMdriveraccordingtotheUSBclasstype,socustomersdonotneedtoaddPIDandVIDinformationindriversourcecode.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released18/473.
3.
2.
AddtheZeroPacketMechanismAsrequiredbytheUSBprotocol,customersneedtoaddthemechanismforprocessingzeropacketsduringtransmissiontofile[KERNEL]/drivers/usb/class/cdc-acm.
c:ThisdocumenttakestheLinux3.
2asanexample,andtheremaybealittledifferencetootherversions;buttheyarebasicallythesame.
Pleaseaddthefollowingstatementstotheacm_probefunction,asshownbelow:…….
for(i=0;iwb[i]);snd->urb=usb_alloc_urb(0,GFP_KERNEL);if(snd->urb==NULL){dev_err(&intf->dev,"outofmemory(writeurbsusb_alloc_urb)\n");gotoalloc_fail7;}if(usb_endpoint_xfer_int(epwrite))usb_fill_int_urb(snd->urb,usb_dev,usb_sndbulkpipe(usb_dev,epwrite->bEndpointAddress),NULL,acm->writesize,acm_write_bulk,snd,epwrite->bInterval);elseusb_fill_bulk_urb(snd->urb,usb_dev,usb_sndbulkpipe(usb_dev,epwrite->bEndpointAddress),NULL,acm->writesize,acm_write_bulk,snd);snd->urb->transfer_flags|=URB_NO_TRANSFER_DMA_MAP;#if1//AddedbyQuectelforzeropacketif(usb_dev->descriptor.
idVendor==0x1519&&usb_dev->descriptor.
idProduct==0x0020)snd->urb->transfer_flags|=URB_ZERO_PACKET;#endifsnd->instance=acm;}usb_set_intfdata(intf,acm)…….
3.
3.
3.
AddResetResumeSomeUSBhostcontrollers/USBhubswilllostpowerorberesetwhenMCUenteringintosuspend/sleepmode,andtheycannotresumeUSBdevicesafterMCUexitsfromsuspend/sleepmode.
Pleaseaddthefollowingstatementstoenablereset-resumeprocess.
ForLinuxkernelversionlowerthan2.
6.
35:UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released19/47File:[KERNEL]/drivers/usb/class/cdc-acm.
cstaticstructusb_driveracm_driver={.
name="cdc_acm",.
probe=acm_probe,.
disconnect=acm_disconnect,#ifdefCONFIG_PM.
suspend=acm_suspend,.
resume=acm_resume,#if1//AddedbyQuectel.
reset_resume=acm_resume,#endif#endif.
id_table=acm_ids,#ifdefCONFIG_PM.
supports_autosuspend=1,#endif};3.
3.
4.
ModifyKernelConfigurationThereareseveralmandatoryselecteditemsinkernelconfiguration,pleasefollowthestepsbelowtoconfigurethekernel:Step1:Changetokerneldirectory.
cdStep2:Setenvironmentvariables,andimportboard'sdefconfig.
ThefollowingisanexampleforRaspeberryPiboard.
exportARCH=armexportCROSS_COMPILE=arm-none-linux-gnueabi-makebcmrpi_defconfigStep3:Compilethekernel.
makemenuconfigStep4:EnableCONFIG_USB_ACM[*]DeviceDrivers→[*]USBSupport→[*]USBModem(CDCACM)supportUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released20/47Figure3:ConfigureCDCACMDriverinKernel3.
3.
5.
BuildandLoadDriverasaKernelModuleforPCinLinuxPleasefollowthestepsbelowtobuildthedriverasakernelmodule,andusemodprobecommandtoloadthemodulewithLinuxOSonPC.
Step1:Changetokerneldirectory.
cdStep2:Buildthedriver.
sudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/usb/classobj-m=cdc-acm.
omodulesStep3:Loadthedriverandreboot.
sudocpdrivers/usb/class/cdc-acm.
ko/lib/modules/`uname-r`/kernel/drivers/usb/classsudodepmodsudoreboot3.
4.
GobiNetDriverforUC20/EC2x/EGxx/EP06/EM06/BG96/AG35IfcustomersareusingUC20/EC2x/EGxx/EP06/EM06/BG96/AG35andrequiringGobiNetdriver,pleasereadthissectionfordetails.
Otherwise,pleaseskipthissection.
WhenthemoduleisattachedtoGobiNetdriver,thedriverwillcreateanetworkdeviceandaQMIchannel.
ThenetworkdeviceisnamedasethX(usbXifthekernelversionis2.
6.
39orolder),andtheQMIchannelUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released21/47isnamedas/dev/qcqmiX.
Thenetworkdeviceisusedfordatatransmission,andQMIchannelisusedforQMImessageinteraction.
ThefollowingpartsshowhowtointegratetheGobiNetdriver.
3.
4.
1.
ModifyDriverSourceCodeTheGobiNetdriverisprovidedbyQuectelasaformofsourcefile.
Customersshouldcopythesourcefilesto[KERNEL]/drivers/net/usb/(or[KERNEL]/drivers/usb/net/ifthekernelversionislowerthan2.
6.
22).
3.
4.
2.
ModifyKernelConfigurationThereareseveralmandatoryselecteditemsinkernelconfiguration,pleasefollowthestepsbelowtoconfigurethekernel:Step1:Changetokerneldirectory.
cdStep2:Setenvironmentvariables,andimportboard'sdefconfig.
ThefollowingisanexampleforRaspeberryPiboard.
exportARCH=armexportCROSS_COMPILE=arm-none-linux-gnueabi-makebcmrpi_defconfigStep3:Compilethekernel.
makemenuconfigStep4:EnableCONFIG_USB_USBNET[*]DeviceDrivers→-*-Networkdevicesupport→USBNetworkAdapters→{*}Multi-purposeUSBNetworkingFrameworkStep5:Pleaseaddthefollowingstatementstofile[KERNEL]/drivers/net/usb/Makefile(or[KERNEL]/drivers/usb/net/Makefileifthekernelversionislowerthan2.
6.
22).
obj-y+=GobiNet.
oGobiNet-objs:=GobiUSBNet.
oQMIDevice.
oQMI.
oUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released22/47ForEC20module,ifthefollowingfilesandstatementsexistinthekernelsourcefiles,pleasedeletethem,astheywillconflictwithEC20'sUSBdriver.
File:[KERNEL]/drivers/usb/serial/qcserial.
c{USB_DEVICE(0x05c6,0x9215)},/*AcerGobi2000Modemdevice(VP413)*/File:[KERNEL]/drivers/net/usb/qmi_wwan.
c{QMI_GOBI_DEVICE(0x05c6,0x9215)},/*AcerGobi2000Modemdevice(VP413)*/3.
4.
3.
BuildandLoadDriverasaKernelModuleforPCinLinuxPleasefollowthestepsbelowtobuildthedriverasakernelmodule,andusemodprobecommandtoloadthemodulewithLinuxOSonPC.
Step1:Changetokerneldirectory.
cdStep2:Buildthedriver.
sudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/net/usbobj-m=GobiNet.
omodulessudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/usb/serialobj-m=qcserial.
omodulesStep3:Loadthedriverandreboot.
sudocpdrivers/net/usb/GobiNet.
ko/lib/modules/`uname-r`/kernel/drivers/net/usbsudocpdrivers/usb/serial/qcserial.
ko/lib/modules/`uname-r`/kernel/drivers/usb/serialsudodepmodsudoreboot3.
5.
QMIWWANDriverforUC20/EC2x/EGxx/EP06/EM06/BG96/AG35IfcustomersareusingUC20/EC2x/EGxx/EP06/EM06/BG96/AG35andrequiringQMIWWANdriver,meanwhile,theLinuxkernelversionishigherthan3.
3,pleasereadthissectionfordetails.
Otherwise,pleaseskipthissection.
WhenthemoduleisattachedtoQMIWWANdriver,thedriverwillcreateanetworkdeviceandaQMIchannel.
ThenetworkdeviceisnamedaswwanX,andQMIchannelisnamedas/dev/cdc-wdmX.
Thenetworkdeviceisusedfordatatransmission,andQMIchannelisusedforQMImessageinteraction.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released23/47ThefollowingpartsshowhowtointegratetheQMIWWANdriver.
3.
5.
1.
AddVIDandPIDQMIWWANdriversourcefileis[KERNEL]/drivers/net/usb/qmi_wwan.
c.
Inordertorecognizethemodule,customersshouldaddmodulePIDandVIDinformationasbelow:File:[KERNEL]/drivers/net/usb/qmi_wwan.
cstaticconststructusb_device_idproducts[]={#if1//AddedbyQuectel#ifndefQMI_FIXED_INTF/*mapQMI/wwanfunctionbyafixedinterfacenumber*/#defineQMI_FIXED_INTF(vend,prod,num)\.
match_flags=USB_DEVICE_ID_MATCH_DEVICE|USB_DEVICE_ID_MATCH_INT_INFO,\.
idVendor=vend,\.
idProduct=prod,\.
bInterfaceClass=0xff,\.
bInterfaceSubClass=0xff,\.
bInterfaceProtocol=0xff,\.
driver_info=(unsignedlong)&qmi_wwan_force_int##num,#endif{QMI_FIXED_INTF(0x05C6,0x9003,4)},/*QuectelUC20*/{QMI_FIXED_INTF(0x2C7C,0x0125,4)},/*QuectelEC25*/{QMI_FIXED_INTF(0x2C7C,0x0121,4)},/*QuectelEC21*/{QMI_FIXED_INTF(0x05C6,0x9215,4)},/*QuectelEC20*/{QMI_FIXED_INTF(0x2C7C,0x0191,4)},/*QuectelEG91*/{QMI_FIXED_INTF(0x2C7C,0x0195,4)},/*QuectelEG95*/{QMI_FIXED_INTF(0x2C7C,0x0306,4)},/*QuectelEG06/EP06/EM06*/{QMI_FIXED_INTF(0x2C7C,0x0296,4)},/*QuectelBG96*/{QMI_FIXED_INTF(0x2C7C,0x0435,4)},/*QuectelAG35*/#endifForEC20module,ifthefollowingfilesandstatementsexistinthekernelsourcefiles,pleasedeletethem,astheywillconflictwithEC20'sUSBdriver.
File:[KERNEL]/drivers/usb/serial/qcserial.
c{USB_DEVICE(0x05c6,0x9215)},/*AcerGobi2000Modemdevice(VP413)*/File:[KERNEL]/drivers/net/usb/qmi_wwan.
c{QMI_GOBI_DEVICE(0x05c6,0x9215)},/*AcerGobi2000Modemdevice(VP413)*/UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released24/473.
5.
2.
AddSupportforRawIPModeforEC25/EC21/EGxx/EP06/EM06/BG96/AG35QMIWWANdriversourcefileis[KERNEL]/drivers/net/usb/qmi_wwan.
c.
EC25/EC21/EGxx/EP06/EM06/BG96/AG35onlysupportrawIPmode(IPpacketsnotencapsulatedinEthernetframes).
SoEthernetheadermustbestrippedwhenpacketsaresenttothemodule,andbeaddedwhenpacketsarereceivedfromthemodule.
PleaseaddthefollowingstatementstosupportrawIPmode.
File:[KERNEL]/drivers/net/usb/qmi_wwan.
c#include#include#if1//AddedbyQuectel#includestructsk_buff*qmi_wwan_tx_fixup(structusbnet*dev,structsk_buff*skb,gfp_tflags){if(dev->udev->descriptor.
idVendor!
=cpu_to_le16(0x2C7C))returnskb;//SkipEthernetheaderfrommessageif(skb_pull(skb,ETH_HLEN)){returnskb;}else{dev_err(&dev->intf->dev,"PacketDropped");}//Filterthepacketout,releaseitdev_kfree_skb_any(skb);returnNULL;}#include#if(LINUX_VERSION_CODEudev->descriptor.
idVendor!
=cpu_to_le16(0x2C7C))return1;/*Thischeckisnolongerdonebyusbnet*/if(skb->lennet->hard_header_len)UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released25/47return0;switch(skb->data[0]&0xf0){case0x40:proto=htons(ETH_P_IP);break;case0x60:proto=htons(ETH_P_IPV6);break;case0x00:if(is_multicast_ether_addr(skb->data))return1;/*possiblybogusdestination-rewritejustincase*/skb_reset_mac_header(skb);gotofix_dest;default:/*passalongotherpacketswithoutmodifications*/return1;}if(skb_headroom(skb)h_proto=proto;memset(eth_hdr(skb)->h_source,0,ETH_ALEN);fix_dest:memcpy(eth_hdr(skb)->h_dest,dev->net->dev_addr,ETH_ALEN);return1;}/*verysimplisticdetectionofIPv4orIPv6headers*/staticboolpossibly_iphdr(constchar*data){return(data[0]&0xd0)==0x40;}#endif#endif……/*iffollowfunctionexist,modifyitasbelow*/staticintqmi_wwan_bind(structusbnet*dev,structusb_interface*intf){……UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released26/47#if1//AddedbyQuectelif(dev->udev->descriptor.
idVendor==cpu_to_le16(0x2C7C)){dev_info(&intf->dev,"QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35workonRawIPmode\n");dev->net->flags|=IFF_NOARP;#if(LINUX_VERSION_CODEnet->dev_addr)){dev->net->dev_addr[0]|=0x02;/*setlocalassignmentbit*/dev->net->dev_addr[0]&=0xbf;/*clear"IP"bit*/}#endifusb_control_msg(interface_to_usbdev(intf),usb_sndctrlpipe(interface_to_usbdev(intf),0),0x22,//USB_CDC_REQ_SET_CONTROL_LINE_STATE0x21,//USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE1,//activeCDCDTRintf->cur_altsetting->desc.
bInterfaceNumber,NULL,0,100);}#endiferr:returnstatus;}……/*iffollowfunctionexist,modifyitasbelow*/staticintqmi_wwan_bind_shared(structusbnet*dev,structusb_interface*intf){……#if1//AddedbyQuectelif(dev->udev->descriptor.
idVendor==cpu_to_le16(0x2C7C)){dev_info(&intf->dev,"QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35workonRawIPmode\n");dev->net->flags|=IFF_NOARP;#if(LINUX_VERSION_CODEnet->dev_addr)){dev->net->dev_addr[0]|=0x02;/*setlocalassignmentbit*/dev->net->dev_addr[0]&=0xbf;/*clear"IP"bit*/UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released27/47}#endifusb_control_msg(interface_to_usbdev(intf),usb_sndctrlpipe(interface_to_usbdev(intf),0),0x22,//USB_CDC_REQ_SET_CONTROL_LINE_STATE0x21,//USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE1,//activeCDCDTRintf->cur_altsetting->desc.
bInterfaceNumber,NULL,0,100);}#endiferr:returnstatus;}……/*iffollowstructexist,modifyitasbelow*/staticconststructdriver_infoqmi_wwan_info={……#if1//AddedbyQuectel.
tx_fixup=qmi_wwan_tx_fixup,.
rx_fixup=qmi_wwan_rx_fixup,#endif}……/*iffollowstructexist,modifyitasbelow*/staticconststructdriver_infoqmi_wwan_force_int4={……#if1//AddedbyQuectel.
tx_fixup=qmi_wwan_tx_fixup,.
rx_fixup=qmi_wwan_rx_fixup,#endif};/*iffollowstructexist,modifyitasbelow*/staticconststructdriver_infoqmi_wwan_shared={……#if1//AddedbyQuectel.
tx_fixup=qmi_wwan_tx_fixup,.
rx_fixup=qmi_wwan_rx_fixup,#endifUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released28/47};3.
5.
3.
ModifyKernelConfigurationThereareseveralmandatoryselecteditemsinkernelconfiguration,pleasefollowthestepsbelowtoconfigurethekernel:Step1:Changetokerneldirectory.
cdStep2:Setenvironmentvariables,andimportboard'sdefconfig.
ThefollowingisanexampleforRaspeberryPiboard.
exportARCH=armexportCROSS_COMPILE=arm-none-linux-gnueabi-makebcmrpi_defconfigStep3:Compilethekernel.
makemenuconfigStep4:EnableCONFIG_USB_NET_QMI_WWAN[*]DeviceDrivers→-*-Networkdevicesupport→USBNetworkAdapters→{*}Multi-purposeUSBNetworkingFrameworkQMIWWANdriverforQualcommMSMbased3GandLTEmodemsUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released29/47Figure4:ConfigureQMIWWANDriverinKernel3.
5.
4.
BuildandLoadDriverasaKernelModuleforPCinLinuxPleasefollowstepsbelowtobuildthedriverasakernelmodule,andusemodprobecommandtoloadthemodulewithLinuxOSonPC.
Step1:Changetokerneldirectory.
cdStep2:Buildthedriver.
sudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/net/usbobj-m=qmi_wwan.
omodulessudomake-C/lib/modules/`uname-r`/buildM=`pwd`/drivers/usb/serialobj-m=qcserial.
omodulesStep3:Loadthedriverandreboot.
sudocpdrivers/net/usb/qmi_wwan.
ko/lib/modules/`uname-r`/kernel/drivers/net/usbsudocpdrivers/usb/serial/qcserial.
ko/lib/modules/`uname-r`/kernel/drivers/usb/serialsudodepmodsudorebootUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released30/473.
6.
ConfigureKerneltoSupportPPPIfcustomersneedtousePPPfunction,pleasefollowthestepsbelowtoconfigurekerneltosupportPPP.
Step1:Changetokerneldirectory.
cdStep2:Setenvironmentvariables,andimportboard'sdefconfig.
Thefollowingshowsanexample.
exportARCH=armexportCROSS_COMPILE=arm-none-linux-gnueabi-makebcmrpi_defconfigStep3:Compilethekernel.
makemenuconfigStep4:EnableCONFIG_PPP_ASYNCCONFIG_PPP_SYNC_TTYCONFIG_PPP_DEFLATE.
[*]DeviceDrivers→[*]Networkdevicesupport→[*]PPP(point-to-pointprotocol)supportFigure5:ConfigurePPPinKernelUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released31/474PowerManagementTheLinuxUSBsystemprovidestwoadvancedpowermanagementfeatures:USBAutoSuspendandUSBRemoteWakeup.
Thischapterintroduceshowtoenablethefeatures.
Iftheyarerequiredbyyourproduct,pleasereadthischapterfordetails.
Otherwise,pleaseignorethischapter.
WhenUSBcommunicationbetweentheUSBhostandtheUSBdevicesisidleforsometime(forexamples3seconds),theUSBhostcanmaketheUSBdevicesenterintosuspendmodeautomatically.
ThisfeatureiscalledUSBAutoSuspend.
USBRemoteWakeupallowsasuspendedUSBdevicetoremotelywakeuptheUSBhostovertheUSBwhichmayalsobesuspended(e.
g.
deepsleepmode).
TheUSBdeviceperformsanactivitytowakeuptheUSBhost,thentheUSBhostwillbewokenupbytheremoteactivity.
4.
1.
EnableUSBAutoSuspendForUSBserialdriver,pleaseaddthefollowingstatementstooption_probe()functioninfile[KERNEL]/drivers/usb/serial/option.
c.
staticintoption_probe(structusb_serial*serial,conststructusb_device_id*id){structusb_wwan_intf_private*data;……#if1//AddedbyQuectel//ForUSBAutoSuspendif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9090)){pm_runtime_set_autosuspend_delay(&serial->dev->dev,3000);usb_enable_autosuspend(serial->dev);}if(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9003)){pm_runtime_set_autosuspend_delay(&serial->dev->dev,3000);usb_enable_autosuspend(serial->dev);}if(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9215)){pm_runtime_set_autosuspend_delay(&serial->dev->dev,3000);UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released32/47usb_enable_autosuspend(serial->dev);}if(serial->dev->descriptor.
idVendor==cpu_to_le16(0x2C7C)){pm_runtime_set_autosuspend_delay(&serial->dev->dev,3000);usb_enable_autosuspend(serial->dev);}#endif/*Storedeviceidsowecanuseitduringattach.
*/usb_set_serial_data(serial,(void*)id);return0;}ForCDCACMdriver,pleaseaddthefollowingstatementstoacm_probe()functioninfile[KERNEL]/drivers/usb/class/cdc-acm.
c.
staticintacm_probe(structusb_interface*intf,conststructusb_device_id*id){structusb_cdc_union_desc*union_header=NULL;……#if1//AddedbyQuectel//ForUSBAutoSuspendif((usb_dev->descriptor.
idVendor==0x1519)&&(usb_dev->descriptor.
idProduct==0x0020)){pm_runtime_set_autosuspend_delay(&usb_dev->dev,3000);usb_enable_autosuspend(usb_dev);}#endifreturn0;alloc_fail8:if(acm->country_codes){……}4.
2.
EnableUSBRemoteWakeupForUSBserialdriver,pleaseaddthefollowingstatementstooption_probe()functioninfile[KERNEL]/drivers/usb/serial/option.
c.
staticintoption_probe(structusb_serial*serial,conststructusb_device_id*id){structusb_wwan_intf_private*data;……UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released33/47#if1//AddedbyQuectel//ForUSBRemoteWakeupif(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9090)){device_init_wakeup(&serial->dev->dev,1);//usbremotewakeup}if(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9003)){device_init_wakeup(&serial->dev->dev,1);//usbremotewakeup}if(serial->dev->descriptor.
idVendor==cpu_to_le16(0x05C6)&&serial->dev->descriptor.
idProduct==cpu_to_le16(0x9215)){device_init_wakeup(&serial->dev->dev,1);//usbremotewakeup}if(serial->dev->descriptor.
idVendor==cpu_to_le16(0x2C7C)){device_init_wakeup(&serial->dev->dev,1);//usbremotewakeup}#endif/*Storedeviceidsowecanuseitduringattach.
*/usb_set_serial_data(serial,(void*)id);return0;}ForCDCACMdriver,pleaseaddthefollowingstatementstoacm_probe()functioninfile[KERNEL]/drivers/usb/class/cdc-acm.
c.
staticintacm_probe(structusb_interface*intf,conststructusb_device_id*id){structusb_cdc_union_desc*union_header=NULL;……#if1//AddedbyQuectel//ForUSBRemoteWakeupif((usb_dev->descriptor.
idVendor==0x1519)&&(usb_dev->descriptor.
idProduct==0x0020)){device_init_wakeup(&usb_dev->dev,1);//usbremotewakeup}#endifreturn0;alloc_fail8:if(acm->country_codes){……}UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released34/475TesttheModuleGenerally,ATandPPPfunctionsaresupportedonUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35/UG95/UG96modules.
IfcustomersareusingUC20/EC2x/EGxx/EP06/EM06/BG96/AG35andhaveinstalledGobiNetorQMIWWANdriver,theUSBnetworkadapterfunctioncanalsobeusedonthemodule.
Thefollowingpartshowshowtotestthesefunctions.
5.
1.
TestATFunctionAfterthemoduleisconnectedandUSBdriverisloadedsuccessfully,therewillcreateseveraldevicefilesin/dev.
TheATportofUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35is/dev/ttyUSB2,andtheATportofUG95/UG96is/dev/ttyACM3.
ThencustomerscanuseUARTporttoolssuchas"minicom"or"busyboxmicrocom"totestATfunction,asshownbelow:#busyboxmicrocom/dev/ttyUSB2ThefollowingisanexampleforEC20:Figure6:ATTestResultforEC20UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released35/475.
2.
TestPPPFunctionInordertosetupPPPcall,thefollowingfilesarerequired.
Pleasecheckiftheyexistinthemodule:1.
pppdandchatprogram:Ifthetwoprogramsdonotexist,customerscandownloadthesourcecodeofthemfromhttps://ppp.
samba.
org/download.
htmlandportthemtothemodule.
2.
OnePPPscriptfilenamedas/etc/ppp/ip-upwhichisusedtosetDNS(DomainNameSystem).
Ifthereisnosuchfile,pleaseuselinux-ppp-scripts\ip-upprovidedbyQuectel.
3.
Threescriptsnamedasquectel-ppp,quectel-chat-connectandquectel-chat-disconnect.
TheyareprovidedbyQuectelindirectorylinux-ppp-scripts.
Dependingondifferentmodules,customersmayneedtomakesomechanges.
Formoreinformation,pleaserefertolinux-ppp-scripts\readme.
Customersshouldcopyquectel-ppp,quectel-chat-connectandquectel-chat-disconnecttothedirectory/etc/ppp/peers,thenstarttosetupPPPcallviathefollowingcommand:#pppdcallquectel-ppp&Theprocessofdialingisshownasbelow(exampleofEC20):#pppdoptionsineffect:debug#(from/etc/ppp/peers/quectel-ppp)nodetach#(from/etc/ppp/peers/quectel-ppp)dump#(from/etc/ppp/peers/quectel-ppp)noauth#(from/etc/ppp/peers/quectel-ppp)usertest#(from/etc/ppp/peers/quectel-ppp)passwordfrom/etc/ppp/peers/quectel-ppp)remotename3gppp#(from/etc/ppp/peers/quectel-ppp)/dev/ttyUSB3#(from/etc/ppp/peers/quectel-ppp)115200#(from/etc/ppp/peers/quectel-ppp)lock#(from/etc/ppp/peers/quectel-ppp)connectchat-s-v-f/etc/ppp/peers/quectel-chat-connect#(from/etc/ppp/peers/quectel-ppp)disconnectchat-s-v-f/etc/ppp/peers/quectel-chat-disconnect#(from/etc/ppp/peers/quectel-ppp)nocrtscts#(from/etc/ppp/peers/quectel-ppp)modem#(from/etc/ppp/peers/quectel-ppp)UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released36/47hide-password#(from/etc/ppp/peers/quectel-ppp)novj#(from/etc/ppp/peers/quectel-ppp)novjccomp#(from/etc/ppp/peers/quectel-ppp)ipcp-accept-local#(from/etc/ppp/peers/quectel-ppp)ipcp-accept-remote#(from/etc/ppp/peers/quectel-ppp)ipparam3gppp#(from/etc/ppp/peers/quectel-ppp)noipdefault#(from/etc/ppp/peers/quectel-ppp)ipcp-max-failure10#(from/etc/ppp/peers/quectel-ppp)defaultroute#(from/etc/ppp/peers/quectel-ppp)usepeerdns#(from/etc/ppp/peers/quectel-ppp)noccp#(from/etc/ppp/peers/quectel-ppp)aborton(BUSY)aborton(NOCARRIER)aborton(NODIALTONE)aborton(ERROR)aborton(NOANSWER)timeoutsetto30secondssend(AT^M)expect(OK)^MOK--gotitsend(ATE0^M)expect(OK)^M^MOK--gotitUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released37/47send(ATI;+CSUB;+CSQ;+CPIN;+COPS;+CGREG;&D2^M)expect(OK)^M^MQuectel^MEC20^MRevision:EC20CQAR02A03E2G_BETA0914^M^MSubEdition:V01^M^M+CSQ:23,99^M^M+CPIN:READY^M^M+COPS:0,0,"CHN-CT",7^M^M+CGREG:2,1,"FFFE","6916934",7^M^MOK--gotitsend(AT+CGDCONT=1,"IP","3gnet",,0,0^M)expect(OK)^M^MOK--gotitsend(ATD*99#^M)expect(CONNECT)UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released38/47^M^MCONNECT--gotitScriptchat-s-v-f/etc/ppp/peers/quectel-chat-connectfinished(pid3017),status=0x0Serialconnectionestablished.
usingchannel3Usinginterfaceppp0Connect:ppp0/dev/ttyUSB3sent[LCPConfReqid=0x1]rcvd[LCPConfReqid=0x4]sent[LCPConfAckid=0x4]rcvd[LCPConfAckid=0x1]rcvd[LCPDiscReqid=0x5magic=0x45c0e381]rcvd[CHAPChallengeid=0x1,name="UMTS_CHAP_SRVR"]sent[CHAPResponseid=0x1,name="test"]rcvd[CHAPSuccessid=0x1""]CHAPauthenticationsucceededCHAPauthenticationsucceededsent[IPCPConfReqid=0x1]rcvd[IPCPConfReqid=0x4]sent[IPCPConfNakid=0x4]rcvd[IPCPConfNakid=0x1]sent[IPCPConfReqid=0x2]rcvd[IPCPConfReqid=0x5]UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released39/47sent[IPCPConfAckid=0x5]rcvd[IPCPConfAckid=0x2]CouldnotdetermineremoteIPaddress:defaultingto10.
64.
64.
64localIPaddress100.
65.
245.
137remoteIPaddress10.
64.
64.
64primaryDNSaddress61.
132.
163.
68secondaryDNSaddress202.
102.
213.
68Script/etc/ppp/ip-upstarted(pid3020)Script/etc/ppp/ip-upfinished(pid3020),status=0x0NowPPPcallissetupsuccessfully.
PleaseusefollowingcommandstocheckIP/DNS/Route.
#ifconfigppp0ppp0Linkencap:Point-to-PointProtocolinetaddr:100.
65.
245.
137P-t-P:10.
64.
64.
64Mask:255.
255.
255.
255UPPOINTOPOINTRUNNINGNOARPMULTICASTMTU:1500Metric:1RXpackets:15errors:0dropped:0overruns:0frame:0TXpackets:19errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:3RXbytes:1057(1.
0KiB)TXbytes:1228(1.
1KiB)#cat/etc/resolv.
confnameserver61.
132.
163.
68nameserver202.
102.
213.
68#route-nKernelIProutingtableDestinationGatewayGenmaskFlagsMetricRefUseIface10.
64.
64.
640.
0.
0.
0255.
255.
255.
255UH000ppp0UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released40/470.
0.
0.
00.
0.
0.
00.
0.
0.
0U000ppp0#pingwww.
baidu.
comPINGwww.
a.
shifen.
com(115.
239.
211.
112)56(84)bytesofdata.
64bytesfrom115.
239.
211.
112:icmp_seq=1ttl=54time=46.
4msFollowingcommandscanbeusedtoterminatePPPDprocesstodisconnectaPPPcall:#killallpppdTerminatingonsignal15Connecttime0.
4minutes.
Sent0bytes,received0bytes.
5.
3.
TestGobiNetorQMIWWANIfcustomersareusingUC20/EC2x/EGxx/EP06/EM06/BG96/AG35andrequiringGobiNetorQMIWWANdriver,pleasereadthissectionfordetails.
Otherwise,pleaseskipthissection.
Ifcustomerswanttosetupdataconnectionmanually,QuectelprovidesaConnectManagerprogramtosetupdataconnection.
TheConnectManagerisprovidedintheformofsourcecodeindirectoryquectel-CM.
PleasefollowstepsbelowtotestGobiNetorQMIWWAN:Step1:CompileConnectManager.
ForPCLinux:#makeForemendedLinux:#makeCROSS-COMPILE=arm-none-linux-gnueabi-Pleasereplacearm-none-linux-gnueabi-bycrosscompileronthemodule.
Theoutputofthisstepisquectel-CM.
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released41/47Step2:Preparebusyboxudhcpctool.
quectel-CMwillcallbusyboxudhpctoobtainIPandNDS,andbusyboxudhpcwillcallscriptfile/usr/share/udhcpc/default.
scripttosetIP/DNS/RoutingtableforLinuxboard.
Customerscandownloadthistool'ssourcecodefromhttps://busybox.
net/,thenenableCONFIG_UDHCPCinbusyboxmenuconfig,andcopythescriptfile[BUSYBOX]/examples/udhcp/simple.
scripttoLinuxboard(renamedas/usr/share/udhcpc/default.
script).
Step3:Usequectel-CMtosetupdatacall.
AfterthemoduleisconnectedandGobiNetorQMIWWANdriverisloadedsuccessfully,aUSBnetworkadapterandaQMIchannelwillbecreated.
TheUSBnetworkadapterofGobiNetisnamedasethX(orusbXifthekernelversionis2.
6.
39orolder),andtheQMIchannelisnamedas/dev/qcqmiX.
TheUSBnetworkadapterofQMIWWANisnamedaswwanX,andtheQMIchannelnameisnamedas/dev/cdc-wdmX.
quectel-CMwillsendQMImessagetothemoduleviaQMIchanneltosetupdataconnection.
Pleaserefertothefollowingmessagetousequectel-CM:#quectel-CM-hUsage:.
/quectel-CM[-s[apn[userpasswordauth]]][-ppincode][-flogfilename]-s[apn[userpasswordauth]]Setapn/user/password/authgetfromyournetworkprovider-ppincodeVerifysimcardpinifsimcardislocked-flogfilenameSavelogmessageofthisprogramtofileExample1:.
/quectel-CMExample2:.
/quectel-CM-s3gnetExample3:.
/quectel-CM-s3gnetcarl12340-p1234-fgobinet_log.
txtTheprocessofquectel-CMisshownasbelow(exampleofEC20&GobiNet):#quectel-CM–sctnet&[01-01_00:26:45:355]Quectel_ConnectManager_SR01A01V10[01-01_00:26:45:356].
/quectel-CMprofile=ctnet///,pincode=[01-01_00:26:45:357]Findqmichannel=/dev/qcqmi2[01-01_00:26:45:358]Findusbnet_adapter=eth2[01-01_00:26:45:368]GetclientWDS=7[01-01_00:26:45:400]GetclientDMS=8[01-01_00:26:45:432]GetclientNAS=9UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released42/47[01-01_00:26:45:464]GetclientWDA=10[01-01_00:26:45:496]requestBaseBandVersionEC20CQAR02A03E2G_BETA09141[Sep14201513:51:27][01-01_00:26:45:560]requestGetSIMStatusSIMStatus:SIM_READY[01-01_00:26:45:624]requestGetProfilectnet///0[01-01_00:26:45:656]requestRegistrationStateMCC:460,MNC:11,PS:Attached,DataCap:LTE[01-01_00:26:45:688]requestQueryDataCallConnectionStatus:DISCONNECTED[01-01_00:26:45:720]requestRegistrationStateMCC:460,MNC:11,PS:Attached,DataCap:LTE[01-01_00:26:45:752]requestQueryDataCallConnectionStatus:DISCONNECTED[01-01_00:26:45:816]requestSetupDataCallWdsConnectionIPv4Handle:0x43cc4478[01-01_00:26:45:912]requestQueryDataCallConnectionStatus:CONNECTED[01-01_00:26:45:937]udhcpc(v1.
20.
2)started[01-01_00:26:45:956]Sendingdiscover.
.
.
[01-01_00:26:45:960]Sendingselectfor10.
172.
27.
151.
.
.
[01-01_00:26:45:964]Leaseof10.
172.
27.
151obtained,leasetime7200[01-01_00:26:45:984]deletingroutersroute:SIOCDELRT:Nosuchprocess[01-01_00:26:46:003]addingdns61.
132.
163.
68[01-01_00:26:46:003]addingdns202.
102.
213.
68Step4:UsethefollowingcommandstocheckIP/DNS/Route.
#ifconfigeth2eth2Linkencap:EthernetHWaddrD2:B6:0C:28:AA:C6inetaddr:10.
172.
27.
151Bcast:10.
172.
27.
159Mask:255.
255.
255.
240inet6addr:fe80::d0b6:cff:fe28:aac6/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:4errors:0dropped:0overruns:0frame:0TXpackets:12errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:1224(1.
1KiB)TXbytes:1960(1.
9KiB)UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released43/47#cat/etc/resolv.
confnameserver61.
132.
163.
68nameserver202.
102.
213.
68#route-nKernelIProutingtableDestinationGatewayGenmaskFlagsMetricRefUseIface0.
0.
0.
010.
172.
27.
1450.
0.
0.
0UG000eth210.
172.
27.
1440.
0.
0.
0255.
255.
255.
240U000eth2#pingwww.
baidu.
comPINGwww.
a.
shifen.
com(115.
239.
211.
112)56(84)bytesofdata.
64bytesfrom115.
239.
211.
112:icmp_seq=1ttl=53time=24.
8msStep5:Usethefollowingcommandtoterminatequectel-CMprocesstodisconnectdataconnection:#killallquectel-CM[01-01_00:32:11:341]requestDeactivateDefaultPDPerr=0[01-01_00:32:11:544]GobiNetThreadexit[01-01_00:32:11:545]mainexitUMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released44/476FAQandKernelLog6.
1.
HowtoCheckWhetherUSBDriverExistsintheModuleUSBdrivercanbecheckedfromthecontentofdirectory/sys/bus/usb/drivers.
Forexample:carl@carl-OptiPlex-7010:~$ls/sys/bus/usb/driverscdc_acmcdc_wdmftdi_sioGobiNethuboptionqmi_wwanusbusbfsusbhidusbserialusbserial_genericIfUSBserialdriverisrequired,pleasemakesureoptionexists.
IfCDCACMdriverisrequired,pleasemakesurecdc_acmexists.
IfGobiNetdriverisrequired,pleasemakesureGobiNetexists.
IfQMIWWANdriverisrequired,pleasemakesureqmi_wwanexists.
6.
2.
HowtoCheckWhethertheModuleWorksWellwiththeCorrespondingUSBDriverThischaptershowsthekernellogaboutthemoduleattachingthecorrespondingUSBdriverinLinux.
Ifthemoduledoesnotworkwell,pleasecomparethekernelloginthemodulewiththekernelloginthischaptertohelpyoutroubleshoot.
1.
ForUCxx/EC2x/EGxx/EP06/EM06/BG96/AG35withUSBserialdriver:KernellogsofthesemodulesarealmostthesameexceptfortheVID&PIDinformation(markedbyreadboxinthefollowingfigure).
UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released45/47Figure7:USBSerialforUC152.
UC20/EC2x/EGxx/EP06/EM06/BG96/AG35withUSBserialandGobiNetdriver:KernellogsofthesemodulesarealmostthesameexceptfortheVID&PIDinformation(markedbyreadboxinthefollowingfigure).
Figure8:USBSerialandGobiNetforUC20UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released46/473.
UC20/EC2x/EGxx/EP06/EM06/BG96/AG35withUSBserialandQMIWWANdriver:KernellogsofthesemodulesarealmostthesameexceptfortheVID&PIDinformation(markedbyreadboxinthefollowingfigure).
Figure9:USBSerialandQMIWWANforUC204.
ForUG95/UG96withCDCACMdriverFigure10:CDCACMforUG95/UG96UMTS/HSPA/LTEModuleSeriesWCDMA<ELinuxUSBDriverUserGuideWCDMA<E_Linux_USB_Driver_User_GuideConfidential/Released47/477AppendixAReferencesTable3:TermsandAbbreviationsAbbreviationsDescriptionsACMAbstractControlModelCDCCommunicationsDeviceClassDNSDomainNameSystemNDISNetworkDriverInterfaceSpecificationNMEANationalMarineElectronicsAssociationOSOperatingSystemPCPersonalComputerPIDProductIDPPPPointtoPointProtocolVIDVendorID

DogYun(300元/月),韩国独立服务器,E5/SSD+NVMe

DogYun(中文名称狗云)新上了一批韩国自动化上架独立服务器,使用月减200元优惠码后仅需每月300元,双E5 CPU,SSD+NVMe高性能硬盘,支持安装Linux或者Windows操作系统,下单自动化上架。这是一家成立于2019年的国人主机商,提供VPS和独立服务器租用等产品,数据中心包括中国香港、美国洛杉矶、日本、韩国、德国、荷兰等。下面分享这款自动化上架韩国独立服务器的配置和优惠码信息。...

Hostodo美国独立日优惠套餐年付13.99美元起,拉斯维加斯/迈阿密机房

Hostodo又发布了几款针对7月4日美国独立日的优惠套餐(Independence Day Super Sale),均为年付,基于KVM架构,采用NVMe硬盘,最低13.99美元起,可选拉斯维加斯或者迈阿密机房。这是一家成立于2014年的国外VPS主机商,主打低价VPS套餐且年付为主,基于OpenVZ和KVM架构,产品性能一般,支持使用PayPal或者支付宝等付款方式。商家客服响应也比较一般,推...

云俄罗斯VPSJusthost俄罗斯VPS云服务器justg:JustHost、RuVDS、JustG等俄罗斯vps主机

俄罗斯vps云服务器商家推荐!俄罗斯VPS,也叫毛子主机(毛子vps),因为俄罗斯离中国大陆比较近,所以俄罗斯VPS的延迟会比较低,国内用户也不少,例如新西伯利亚机房和莫斯科机房都是比较热门的俄罗斯机房。这里为大家整理推荐一些好用的俄罗斯VPS云服务器,这里主要推荐这三家:justhost、ruvds、justg等俄罗斯vps主机,方便大家对比购买适合自己的俄罗斯VPS。一、俄罗斯VPS介绍俄罗斯...

ignore_user_abort为你推荐
渣渣辉商标渣渣辉是什么意思啊?急救知识纳入考试急救证容易拿到么?比肩工场大运比肩主事,运行长生地是什么意思?原代码什么是原代码丑福晋八阿哥胤禩有几个福晋 都叫啥名儿呀钟神发跪求钟神发名言出处,A站大神看过来www.haole012.comhttp://fj.qq.com/news/wm/wm012.htm 这个链接的视频的 第3分20秒开始的 背景音乐 是什么?www.se222se.com原来的www站到底222eee怎么了莫非不是不能222eee在收视com了,/?求解www.15job.com南方人才市场有官方网站是什么?sodu.tw给个看免费小说的网站
虚拟主机是什么 高防直连vps 网易域名邮箱 新加坡主机 vultr美国与日本 tier idc测评网 gitcafe 监控宝 回程路由 国外网站代理服务器 有奖调查 免费高速空间 常州联通宽带 国外视频网站有哪些 东莞idc 云服务器比较 万网主机 免费php空间 徐州电信 更多