The C Source, Patches and (shudder!) Bugs
Post Reply
MaoMaoRain
Posts: 1
Joined: 09 Jul 2013, 05:27

ZTE MF195E 3G dongle 19d2:1580

Post by MaoMaoRain » 09 Jul 2013, 06:37

ruler:

Code: Select all

########################################################
# ZTE MF195

DefaultVendor= 0x19d2
DefaultProduct=0x1580

TargetVendor=  0x19d2
TargetProduct= 0x1581

StartupDelay=1

CheckSuccess=20
#NeedResponse=1
MessageEndpoint= 0x01
MessageContent="555342431849128600000000000008ff000000000000030000000000000000"
code patch:

Code: Select all

--- usb-modeswitch-1.2.6/usb_modeswitch.c	2013-06-02 21:16:42.000000000 +0800
+++ ./usb-modeswitch/usb_modeswitch.c	2013-07-09 12:29:14.000000000 +0800
@@ -78,6 +78,7 @@
 
 int DefaultVendor=0, DefaultProduct=0, TargetVendor=0, TargetProduct=-1, TargetClass=0;
 int MessageEndpoint=0, ResponseEndpoint=0, ReleaseDelay=0;
+int StartupDelay=0;
 int targetDeviceCount=0, searchMode;
 int devnum=-1, busnum=-1;
 int ret;
@@ -172,6 +173,7 @@
 	ParseParamString(configFilename, MessageContent);
 	ParseParamString(configFilename, MessageContent2);
 	ParseParamString(configFilename, MessageContent3);
+	ParseParamInt(configFilename, StartupDelay);
 	ParseParamInt(configFilename, ReleaseDelay);
 	ParseParamHex(configFilename, NeedResponse);
 	ParseParamHex(configFilename, ResponseEndpoint);
@@ -406,6 +408,11 @@
 		}
 	}
 
+	if (StartupDelay) {
+		SHOW_PROGRESS(output,"Delay %dS before Startup, wait the dongle ready ...\n", StartupDelay);
+		sleep(StartupDelay);
+	}
+
 	if (devnum == -1) {
 		searchMode = SEARCH_DEFAULT;
 	} else {

kernel version
Linux version 2.6.30

log:

# usb 1-1.2: new high speed USB device using ehci_hcd and address 15
usb 1-1.2: configuration #1 chosen from 1 choice
usb storage return false
generic_probe wake up Monitor!!
Blocking the interface for 1 s before Startup ...
Looking for target devices ...
No devices in target mode or clausb 1-1.2: usbfs: process 2064 (usb_modeswitch) did not claim interface 0 before use
ss found
Looking for default devices ...
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Accessing device 015 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using interface number 0
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
-------------------------
Vendor String: ZTE
Model String: USB SCSI CD-ROM
Revision String: 0001
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: ZTE
Product: MF195E
Serial No.: 2D144B6AE702FC2B432F8898226937D830421F64
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01

Checking for mode switch (max. 20 times, once per second) ...
usb 1-1.2: USB disconnect, address #15
generic_disconnect wake up Monitor!!
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
usb 1-1.2: new high speed USB device using ehci_hcd and address 16
usb 1-1.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
usb0: register 'cdc_ether' at usb-0000:00:0a.0-1.2, CDC Ethernet Device, 02:02:fc:2b:43:2f
usbnet: interface usb0 registered.
Searching for target devices ...
usb storage return false
generic_probe wake up Monitor!!
Searching for target devices ...
found matching product ID
adding device

Found target device, now opening
Found correct target device

Mode switch succeeded. Bye.

(ssk) USB LTE Wan usb0 link up

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: ZTE MF195E 3G dongle 19d2:1580

Post by Josh » 09 Jul 2013, 19:15

Very interesting.

However, as long as the device is not 'opened', it is not really 'blocked'. So you might achieve the same effect by adding "WaitBefore=1" to the configuration. This parameter is evaluated by the dispatcher script and does basically the same ...

Did you try that parameter?

Post Reply