Author Message

<  Everything Coding  ~  Error in usb_modeswitch.tcl 2.2.6

PostPosted: Fri Jan 08, 2016 7:58 pm Reply with quote
Posts: 3 Joined: Wed Dec 19, 2012 8:39 pm
Hi!

In version 2.2.6 usb_modeswitch.tcl is missing initialization of flags(nombim), which causes it to crash at line 258 if compiled with libjim.
The symptom is you would see an output similar to this, and no switching will occur:

Code:
# cat /var/log/usb_modeswitch_1-1

USB_ModeSwitch log from Fri Jan  08 09:10:01 PST 2016

Use global config file: /etc/usb_modeswitch.conf
Raw args from udev: /1-1

Use top device dir /sys/bus/usb/devices/1-1
Check class of first interface ...
 Interface 0 class is 08.

----------------
USB values from sysfs:
  manufacturer  HUAWEI_MOBILE
  product       HUAWEI_MOBILE
  serial        0123456789ABCDEF
----------------
bNumConfigurations is 1 - don't check for active configuration
ConfigList: /usr/share/usb_modeswitch/12d1:1f01 /usr/share/usb_modeswitch/12d1:#linux
SCSI attributes not needed, move on
Check config: /usr/share/usb_modeswitch/12d1:1f01
! matched. Read config data
config: NoDriverLoading is set to active
Driver will not be handled by usb_modeswitch
#



A simple fix is to initialize the flag at the beginning of the script:
Code:
--- usb_modeswitch.tcl.orig     2015-11-01 01:11:22.000000000 -0700
+++ usb_modeswitch.tcl  2016-01-08 09:48:59.234541012 -0800
@@ -28,6 +28,7 @@ set flags(logging) 1
 set flags(noswitching) 0
 set flags(stordelay) 0
 set flags(logwrite) 0
+set flags(nombim) 0

 # Execution starts at file bottom


Offline
PostPosted: Sat Jan 09, 2016 11:04 pm Reply with quote
Site Admin Posts: 6441 Joined: Sat Nov 03, 2007 12:30 am
Thanks for spotting this !!

It's really weird though that the tcl script is running at all ... It should exit with an error every time a modem configuration is found ...


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
2 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron