From 9c4605d3b6441bf3cd8244e96b672ebe58bcc63b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:17:04 +0000 Subject: import usb_modeswitch-2.5.1-1.el7 --- diff --git a/.gitignore b/.gitignore index 791871c..836e119 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/usb-modeswitch-2.4.0.tar.bz2 +SOURCES/usb-modeswitch-2.5.1.tar.bz2 diff --git a/.usb_modeswitch.metadata b/.usb_modeswitch.metadata index 2363ce6..b0b65b3 100644 --- a/.usb_modeswitch.metadata +++ b/.usb_modeswitch.metadata @@ -1 +1 @@ -12fc5f398e2f1290f3e5f2f1610a1ad2332edf79 SOURCES/usb-modeswitch-2.4.0.tar.bz2 +32fb8c620a3a9b26864f1854ab99ae5988879066 SOURCES/usb-modeswitch-2.5.1.tar.bz2 diff --git a/SOURCES/0001-Bring-back-the-module-binding.patch b/SOURCES/0001-Bring-back-the-module-binding.patch deleted file mode 100644 index 8228f95..0000000 --- a/SOURCES/0001-Bring-back-the-module-binding.patch +++ /dev/null @@ -1,334 +0,0 @@ -From cf2afa734597ef88b8f5871bf18cf849b105e51d Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Mon, 25 Jul 2016 12:03:22 +0200 -Subject: [PATCH] Bring back the module binding - -We still need it for some devices. - -http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2560 ---- - usb_modeswitch.sh | 23 +++++- - usb_modeswitch.tcl | 214 +++++++++++++++++++++++++++++++++++++++++++++++++---- - 2 files changed, 221 insertions(+), 16 deletions(-) - -diff --git a/usb_modeswitch.sh b/usb_modeswitch.sh -index b126ec3..f4b76dd 100755 ---- a/usb_modeswitch.sh -+++ b/usb_modeswitch.sh -@@ -40,7 +40,27 @@ fi - PATH=/sbin:/usr/sbin:$PATH - case "$1" in - --driver-bind) -- # driver binding code removed -+ ( -+ dir=$(ls -d /sys$2/ttyUSB* 2>/dev/null) -+ sleep 1 -+ if [ ! -z "$dir" ]; then -+ exit 0 -+ fi -+ set +e -+ device_in "bind_list" $v_id $p_id -+ if [ "$?" = "1" ]; then -+ id_attr="/sys/bus/usb-serial/drivers/option1/new_id" -+ if [ ! -e "$id_attr" ]; then -+ modprobe option 2>/dev/null || true -+ fi -+ if [ -e "$id_attr" ]; then -+ echo "$v_id $p_id ff" > $id_attr -+ else -+ modprobe -r usbserial 2>/dev/null -+ modprobe usbserial "vendor=0x$v_id" "product=0x$p_id" 2>/dev/null -+ fi -+ fi -+ ) & - exit 0 - ;; - --symlink-name) -@@ -53,7 +73,6 @@ case "$1" in - exit 0 - ;; - esac -- - IFS='/' read -r p1 p2 < 0} { - set config(Configuration) $cfgno -+ set config(DriverModule) "" - set flags(config) "Configuration=$cfgno" - } else { - Log " No MBIM configuration found, switch to legacy modem mode" -@@ -290,10 +291,6 @@ foreach mconfig $configList { - set report "ok:busdev" - break - } -- if {$config(Configuration) == 0} { -- Log "Config file contains dummy method, do nothing. Exit" -- SafeExit -- } - UnbindDriver $devdir $ifdir - # Now we are actually switching - if $flags(logging) { -@@ -348,19 +345,68 @@ if [regexp {ok:busdev} $report] { - ReadUSBAttrs $devdir $ifdir - } - --# driver binding removed !! -+# Checking for bound drivers if there is an interface with class 0xff - --if {[string length "$usb(idVendor)$usb(idProduct)"] < 8} { -- if {![regexp {ok:(\w{4}):(\w{4})} $report d usb(idVendor) usb(idProduct)]} { -- Log "No target vendor/product ID found or given, can't continue. Abort" -- SafeExit -+if {$config(DriverModule) != "" && [regexp {ok:} $report]} { -+ if [HasFF $devdir] { -+ AddToList link_list $usb(idVendor):$usb(idProduct) -+ } else { -+ set config(DriverModule) "" -+ Log " No vendor-specific class found, skip driver check" - } - } --# wait for drivers to bind --after 500 --if {[llength [glob -nocomplain $devdir/$ifdir/ttyUSB*]] > 0} { -- Log "Serial USB driver bound to interface 0\n will try to guess and symlink modem port on next connect" -- AddToList link_list $usb(idVendor):$usb(idProduct) -+ -+# If module is set (it is by default), driver shall be loaded. -+# If not, then NoDriverLoading is active -+ -+if {$config(DriverModule) != ""} { -+ if {[string length "$usb(idVendor)$usb(idProduct)"] < 8} { -+ if {![regexp {ok:(\w{4}):(\w{4})} $report d usb(idVendor) usb(idProduct)]} { -+ Log "No target vendor/product ID found or given, can't continue. Abort" -+ SafeExit -+ } -+ } -+ # wait for any drivers to bind automatically -+ after 1500 -+ Log "Now check for bound driver ..." -+ if {![file exists $devdir/$ifdir/driver]} { -+ Log " no driver has bound to interface 0 yet" -+ -+ # If device is known, the sh wrapper will take care, else: -+ if {[InBindList $usb(idVendor):$usb(idProduct)] == 0} { -+ Log "Device is not in \"bind_list\" yet, bind it now" -+ -+ # Load driver -+ CheckDriverBind $usb(idVendor) $usb(idProduct) -+ -+ # Old/slow systems may take a while to create the devices -+ set counter 0 -+ while {![file exists $devdir/$ifdir/driver]} { -+ if {$counter == 14} {break} -+ after 500 -+ incr counter -+ } -+ if {$counter == 14} { -+ Log " driver binding failed" -+ } else { -+ Log " driver was bound to the device" -+ AddToList bind_list $usb(idVendor):$usb(idProduct) -+ } -+ } -+ } else { -+ Log " driver has bound, device is known" -+ if {[llength [glob -nocomplain $devdir/$ifdir/ttyUSB*]] > 0} { -+ AddToList link_list $usb(idVendor):$usb(idProduct) -+ } -+ } -+} else { -+ # Just in case "NoDriverLoading" was added after the first bind -+ RemoveFromBindList $usb(idVendor):$usb(idProduct) -+} -+ -+if [regexp {ok:$} $report] { -+ # "NoDriverLoading" was set -+ Log "No driver check or bind for this device" - } - - # In newer kernels there is a switch to avoid the use of a device -@@ -553,6 +599,8 @@ return "Use global config file: $configFile" - proc ParseDeviceConfig {cfg} { - - global config -+set config(DriverModule) "" -+set config(DriverIDPath) "" - set config(WaitBefore) "" - set config(TargetVendor) "" - set config(TargetProduct) "" -@@ -561,6 +609,7 @@ set config(Configuration) "" - set config(NoMBIMCheck) 0 - set config(PantechMode) 0 - set config(CheckSuccess) 20 -+set loadDriver 1 - - foreach pname [lsort [array names config]] { - if [regexp -line "^\[^# \]*?$pname.*?= *(0x(\\w+)|\"(\[0-9a-fA-F,\]+)\"|(\[0-9\]+)) *\$" $cfg d config($pname)] { -@@ -568,6 +617,26 @@ foreach pname [lsort [array names config]] { - } - } - -+if [regexp -line {^[^#]*?NoDriverLoading.*?=.*?(1|yes|true).*?$} $cfg] { -+ set loadDriver 0 -+ Log "config: NoDriverLoading is set to active" -+} -+ -+# For general driver loading; TODO: add respective device names. -+# Presently only useful for HSO devices (which are recounted now) -+if $loadDriver { -+ if {$config(DriverModule) == ""} { -+ set config(DriverModule) "option" -+ set config(DriverIDPath) "/sys/bus/usb-serial/drivers/option1" -+ } else { -+ if {$config(DriverIDPath) == ""} { -+ set config(DriverIDPath) "/sys/bus/usb/drivers/$config(DriverModule)" -+ } -+ } -+ Log "Driver module is \"$config(DriverModule)\", ID path is $config(DriverIDPath)\n" -+} else { -+ Log "Driver will not be handled by usb_modeswitch" -+} - set config(WaitBefore) [string trimleft $config(WaitBefore) 0] - - } -@@ -768,6 +837,92 @@ return $symlinkName - # end of proc {SymLinkName} - - -+# Load and bind driver (default "option") -+# -+proc {CheckDriverBind} {vid pid} { -+global config -+ -+foreach fn {/sbin/modprobe /usr/sbin/modprobe} { -+ if [file exists $fn] { -+ set loader $fn -+ } -+} -+Log "Module loader is $loader" -+ -+set idfile $config(DriverIDPath)/new_id -+if {![file exists $idfile]} { -+ if {$loader == ""} { -+ Log "Can't do anymore without module loader; get \"modtools\"!" -+ return -+ } -+ Log "\nTry to load module \"$config(DriverModule)\"" -+ if [catch {set result [exec $loader -v $config(DriverModule)]} err] { -+ Log " Running \"$loader $config(DriverModule)\" gave an error:\n $err" -+ } else { -+ Log " Module was loaded successfully:\n$result" -+ } -+} else { -+ Log "Module is active already" -+} -+set i 0 -+while {$i < 50} { -+ if [file exists $idfile] { -+ break -+ } -+ after 20 -+ incr i -+} -+if {$i < 50} { -+ Log "Try to add ID to driver \"$config(DriverModule)\"" -+ SysLog "usb_modeswitch: add device ID $vid:$pid to driver \"$config(DriverModule)\"" -+ SysLog "usb_modeswitch: please report the device ID to the Linux USB developers!" -+ if [catch {exec echo "$vid $pid ff" >$idfile} err] { -+ Log " Error adding ID to driver:\n $err" -+ } else { -+ Log " ID added to driver; check for new devices in /dev" -+ } -+} else { -+ Log " \"$idfile\" not found, check if kernel version is at least 2.6.27" -+ Log "Fall back to \"usbserial\"" -+ set config(DriverModule) usbserial -+ Log "\nTry to unload driver \"usbserial\"" -+ if [catch {exec $loader -r usbserial} err] { -+ Log " Running \"$loader -r usbserial\" gave an error:\n $err" -+ Log "No more fallbacks" -+ return -+ } -+ after 50 -+ Log "\nTry to load driver \"usbserial\" with device IDs" -+ if [catch {set result [exec $loader -v usbserial vendor=0x$vid product=0x$pid]} err] { -+ Log " Running \"$loader usbserial\" gave an error:\n $err" -+ } else { -+ Log " Driver was loaded successfully:\n$result" -+ } -+} -+ -+} -+# end of proc {CheckDriverBind} -+ -+ -+# Check if USB ID is listed as needing driver binding -+proc {InBindList} {id} { -+ -+set listfile /var/lib/usb_modeswitch/bind_list -+if {![file exists $listfile]} {return 0} -+set rc [open $listfile r] -+set buffer [read $rc] -+close $rc -+if [string match *$id* $buffer] { -+Log "Found $id in bind_list" -+ return 1 -+} else { -+Log "No $id in bind_list" -+ return 0 -+} -+ -+} -+# end of proc {InBindList} -+ - # Add USB ID to list of devices needing later treatment - proc {AddToList} {name id} { - -@@ -791,6 +946,37 @@ close $lc - # end of proc {AddToList} - - -+# Remove USB ID from bind list (NoDriverLoading is set) -+proc {RemoveFromBindList} {id} { -+ -+set listfile /var/lib/usb_modeswitch/bind_list -+if [file exists $listfile] { -+ set rc [open $listfile r] -+ set buffer [read $rc] -+ close $rc -+ set idList [split [string trim $buffer] \n] -+} else { -+ return -+} -+set idx [lsearch $idList $id] -+if {$idx > -1} { -+ set idList [lreplace $idList $idx $idx] -+} else { -+ return -+} -+if {[llength $idList] == 0} { -+ file delete $listfile -+ return -+} -+set buffer [join $idList "\n"] -+if [catch {set lc [open $listfile w]}] {return} -+puts $lc $buffer -+close $lc -+ -+} -+# end of proc {RemoveFromBindList} -+ -+ - proc {CheckSuccess} {devdir} { - - global config usb flags --- -2.7.4 - diff --git a/SOURCES/0001-usb_modeswitch-don-t-return-a-value-from-stack.patch b/SOURCES/0001-usb_modeswitch-don-t-return-a-value-from-stack.patch deleted file mode 100644 index afe92a4..0000000 --- a/SOURCES/0001-usb_modeswitch-don-t-return-a-value-from-stack.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 93686f8ba8c1ed6bf559dbfda53f9c7d702c76b5 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 21 Jul 2016 18:13:58 +0200 -Subject: [PATCH] usb_modeswitch: don't return a value from stack - -The memory is not allocated anymore when the function returns and that -causes no end of mayhem and undefined behavior. - -Let's make it static so that it's perserved after the return. It wastes -LINE_DIM bytes of memory and requires the caller to consume the value -before another call, but that's no problem. - -http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2557 ---- - usb_modeswitch.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/usb_modeswitch.c b/usb_modeswitch.c -index f9c8b2e..3373ccf 100644 ---- a/usb_modeswitch.c -+++ b/usb_modeswitch.c -@@ -1855,7 +1855,8 @@ char* ReadParseParam(const char* FileName, char *VariableName) - char *FirstQuote, *LastQuote, *P1, *P2; - int Line=0; - unsigned Len=0, Pos=0; -- char Str[LINE_DIM], *token, *configPos; -+ static char Str[LINE_DIM]; -+ char *token, *configPos; - FILE *file = NULL; - - // Reading and storing input during the first call --- -2.7.4 - diff --git a/SOURCES/0001-usb_modeswitch-fix-a-wrong-comparison.patch b/SOURCES/0001-usb_modeswitch-fix-a-wrong-comparison.patch new file mode 100644 index 0000000..863e880 --- /dev/null +++ b/SOURCES/0001-usb_modeswitch-fix-a-wrong-comparison.patch @@ -0,0 +1,26 @@ +From bcb5b8702adbf568598988fccf256586b5788fcb Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 18 Aug 2017 10:37:15 +0200 +Subject: [PATCH 1/2] usb_modeswitch: fix a wrong comparison + +The char pointer should be dereferences when checking the string is empty. +--- + usb_modeswitch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usb_modeswitch.c b/usb_modeswitch.c +index b2b930b..6948a84 100644 +--- a/usb_modeswitch.c ++++ b/usb_modeswitch.c +@@ -1707,7 +1707,7 @@ struct libusb_device* search_devices( int *numFound, int vendor, char* productLi + *numFound = 0; + + /* Sanity check */ +- if (!vendor || productList == '\0') ++ if (!vendor || *productList == '\0') + return NULL; + + listcopy = malloc(strlen(productList)+1); +-- +2.13.0 + diff --git a/SOURCES/0002-usb_modeswitch-count-the-target-devices-from-zero.patch b/SOURCES/0002-usb_modeswitch-count-the-target-devices-from-zero.patch new file mode 100644 index 0000000..144d93d --- /dev/null +++ b/SOURCES/0002-usb_modeswitch-count-the-target-devices-from-zero.patch @@ -0,0 +1,26 @@ +From 9d05fe0e0f6b049520d97a47d042d5cfad35b5d6 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 18 Aug 2017 10:40:41 +0200 +Subject: [PATCH 2/2] usb_modeswitch: count the target devices from zero + +Most likely a typo here. +--- + usb_modeswitch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usb_modeswitch.c b/usb_modeswitch.c +index 6948a84..4a1fb5c 100644 +--- a/usb_modeswitch.c ++++ b/usb_modeswitch.c +@@ -1579,7 +1579,7 @@ int checkSuccess() + * Target device on the same bus with higher device number is returned, + * description is read for syslog message + */ +- for (i=i; i < CheckSuccess; i++) { ++ for (i=0; i < CheckSuccess; i++) { + SHOW_PROGRESS(output," Search for target devices ...\n"); + dev = search_devices(&newTargetCount, TargetVendor, TargetProductList, + TargetClass, 0, SEARCH_TARGET); +-- +2.13.0 + diff --git a/SOURCES/device_reference-utf8.patch b/SOURCES/device_reference-utf8.patch new file mode 100644 index 0000000..e6991a2 --- /dev/null +++ b/SOURCES/device_reference-utf8.patch @@ -0,0 +1,74 @@ +--- device_reference.txt 2014-05-29 22:18:46.000000000 +0200 ++++ device_reference_utf8.txt 2014-11-24 20:51:17.647221466 +0100 +@@ -60,7 +60,7 @@ + ######################################################## + # Option GlobeTrotter GT MAX 3.6 (aka "T-Mobile Web'n'walk Card Compact II") + # +-# Contributor: Bernd Holzmüller ++# Contributor: Bernd Holzmüller + + DefaultVendor= 0x05c6 + DefaultProduct= 0x1000 +@@ -279,7 +279,7 @@ + # + # Probably works with DetachStorageOnly too + # +-# Contributor: Flávio Moringa and others ++# Contributor: Flávio Moringa and others + + DefaultVendor= 0x19d2 + DefaultProduct= 0x2000 +@@ -777,7 +777,7 @@ + # + # Recommended init command: ATE0V1&D2&C1S0=0 + # +-# Contributor: Jérôme Oufella ++# Contributor: Jérôme Oufella + + DefaultVendor= 0x1004 + DefaultProduct= 0x1000 +@@ -1336,7 +1336,7 @@ + ######################################################## + # LG HDM-2100 (EVDO Rev.A USB modem) + # +-# Contributor: Jérôme Oufella ++# Contributor: Jérôme Oufella + + DefaultVendor= 0x1004 + DefaultProduct=0x607f +@@ -1641,7 +1641,7 @@ + ######################################################## + # Huawei U8110 / U8300 / Joy, Vodafone 845 (Android smartphone) + # +-# Contributor: David Erosa García ++# Contributor: David Erosa García + + DefaultVendor= 0x12d1 + DefaultProduct=0x1031 +@@ -1658,7 +1658,7 @@ + ######################################################## + # Nokia CS-10 + # +-# Contributor: WacÅ‚aw Sierek ++# Contributor: Wacław Sierek + + DefaultVendor= 0x0421 + DefaultProduct=0x060c +@@ -1700,7 +1700,7 @@ + ####################################################### + # Samsung GT-B3730 + # +-# Contributor: Per Øyvind Karlsen ++# Contributor: Per Øyvind Karlsen + + DefaultVendor= 0x04e8 + DefaultProduct=0x689a +@@ -1771,7 +1771,7 @@ + ####################################################### + # Huawei EC168C (from Zantel) + # +-# Contributor: Ã…smund Hjulstad ++# Contributor: Åsmund Hjulstad + + DefaultVendor= 0x12d1 + DefaultProduct=0x1446 diff --git a/SOURCES/device_reference.txt b/SOURCES/device_reference.txt index c580fff..d3065d9 100644 --- a/SOURCES/device_reference.txt +++ b/SOURCES/device_reference.txt @@ -1,16 +1,16 @@ # -# Device and Configuration Reference (UTF-8 encoding used) +# Device Reference (UTF-8 encoding used) # -# Last modified: 2013-08-07 +# Last modified: 2017-02-05 # # Collection of configurations for usb_modeswitch, a mode switching # tool for controlling flip flop (multiple mode) USB devices # # Detailed instructions and a friendly forum on the homepage: # http://www.draisberghof.de/usb_modeswitch -# -# You may want to check for a newer version of this file at: -# http://www.draisberghof.de/usb_modeswitch/device_reference.txt +# +# Note that new devices are no longer added to this file. See the +# config files included with the data package for these # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -21,187 +21,18 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# For custom settings: -# Numbers can be decimal or hexadecimal, MessageStrings MUST be -# hexadecimal without prepended "0x". Digits 9-16 in the known -# MessageStrings are arbitrary; I set them to "12345678" - -# What it all means (short command line flags appended): -# -# -# * DefaultVendor -v -# * DefaultProduct -p -# -# This is the ID the USB device shows after having been plugged in. -# The program needs this, either on the command line or in the config -# file; if not found -> no action. -# -# -# * TargetVendor -V -# * TargetProduct -P -# -# These are the IDs of the USB device after successful mode switching. -# They are optional, but I recommend to provide them for better analysis. -# You definitely need them if you enable CheckSuccess (see below) -# -# -# * TargetProductList (file only) -# -# Like TargetProduct, but more than one possibility. Only used in automated -# config files (in /etc/usb_modeswitch.d). -# -# -# * TargetClass -C -# -# Some weird devices don't change IDs. They only switch the device class. -# If the device has the target class -> no action (and vice versa) -# -# -# * MessageEndpoint -m -# -# A kind of address inside the interface to which the "message" -# (the sequence that does the actual switching) is directed. -# Obsolete since version 0.9.7, only useful for testing -# -# -# * MessageContent -M -# -# A hex string containing the "message" sequence; it will be -# sent as a USB bulk transfer -# -# -# * MessageContent2, ...3 -2/-3 -# -# Additional "messages". Use with "NeedResponse"! -# -# -# * ReleaseDelay -w -# -# Waiting time after message transfers. Helps with some sensitive devices -# that don't want any traffic after the mode switch initialisation -# -# -# * ResponseEndpoint -r -# * NeedResponse <0/1> -n -# -# Some devices were reported to require receiving the response of the -# bulk transfer to do the switching properly. Usually not needed. -# Starting from version 1.0.0 the ResponseEndpoint is autodetected -# if not given -# -# -# * DetachStorageOnly <0/1> -d -# -# Some early devices just needed to be detached from the usb-storage -# driver to initiate the mode switching. Now paractically obsolete for -# switching, but still comes handy sometimes -# -# -# * HuaweiMode <0/1> -H -# -# Some early Huawei devices can be switched by a special control -# message. Don't use with recent devices -# -# -# * SonyMode <0/1> -O -# -# Some Sony-Ericsson devices can be switched by a special control -# message. May take a long time (20+ seconds). -# -# -# * SierraMode <0/1> -S -# * KobilMode <0/1> -T -# * GCTMode <0/1> -G -# * SequansMode <0/1> -N -# * MobileActionMode <0/1> -A -# * QisdaMode <0/1> -B -# * QuantaMode <0/1> -E -# * PantechMode <0/1> -F -# * BlackberryMode <0/1> -Z -# * CiscoMode <0/1> -L -# -# -# Flags to support devices that need special control messages. -# The names are referring to the respective manufacturers. -# -# -# * ResetUSB <0/1> -R -# -# Few devices or systems need a rougher treatment. If the switching seems -# to do something but your system does not reflect it, try this somewhat -# brutal method to do a reset after switching. -# Mind that if your device switched OK before, this may set it back to -# storage mode ... -# -# -# * Interface -i -# * Configuration -u -# * AltSetting -a -# -# More USB parameter to help with tricky devices and for doing lots -# of cruel experiments ... -# -## Note: -## AltSetting/Configuration changes and ResetUSB are executed after all -## other steps and can be combined or used on their own (e.g. a reset -## might have the same effect as a manual replug) -# -# -# * InquireDevice <0|1> -I (disables inquiry) -# -# The standard since 1.0.0 is to do a SCSI inquiry on the default device -# before other actions. This might be a future way to identify a device -# without ambiguities. If it causes trouble with your device, just disable. -# -# -# * CheckSuccess -s -# -# Check continuously if the switch succeeded for max seconds. -# First, an interface access test: most devices vanish after -# switching and can't be accessed anymore. -# Second, a recount of target devices: one more than at the initial -# count, at the same bus with a higher device number -> device -# switched fine. -# It's safe to give a higher value than needed; checking stops as -# soon as the target device is found -# -# -# * NoDriverLoading <0|1> (no command line parameter) -# -# The binary tells the wrapper script NOT to check for and initiate -# binding of the serial driver after switching. -# Mostly useful for non-modem devices. -# +# For a parameter reference see file REFERENCE in the data package or +# http://www.draisberghof.de/usb_modeswitch/parameter_reference.txt # -# * WaitBefore (no command line parameter) -# -# Waiting time before taking any action. Helps with some sensitive setups. -# -# -# -# -> All other entries in config files are just ignored <- +# If you find new working codes and configurations, please report +# them! -# Additional command line flags: -# -# Verbose output -W -# No output at all -q -# Use config file -c -# Use stdin for long config -t -# Give long config as string -f -# Give bus number for ID'ing -b -# Give dev number for ID'ing -g -# For filling in all this information for an unknown device, -# see instructions and links on the homepage: -# http://www.draisberghof.de/usb_modeswitch -# -# If you find working codes and configurations, please contribute -# them! - ####################################################### # Option GlobeSurfer Icon (aka "Vodafone EasyBox") +# This is the thing that started it all ... # # The MessageContent is identical for all Option devices @@ -2270,19 +2101,6 @@ TargetClass=0xff MessageContent="55534243123456780000000000000606f50402527000000000000000000000" -######################################################## -# Vodafone/ZTE K3806-Z - -DefaultVendor= 0x19d2 -DefaultProduct=0x0013 - -TargetVendor= 0x19d2 -TargetProduct= 0x0015 - -MessageContent="5553424312345678000000000000061b000000020000000000000000000000" - -NeedResponse=1 - ######################################################## # T-Mobile NL (Huawei E352) # @@ -3023,21 +2841,7 @@ NeedResponse=1 ######################################################## -# TW-3G HSPA+ -# -# Contributor: Nordic Nurse - -DefaultVendor= 0x1c9e -DefaultProduct=0x98ff - -TargetVendor= 0x1c9e -TargetProduct= 0x9801 - -MessageContent="55534243123456780000000080000606f50402527000000000000000000000" - - -######################################################## -# Samsung GT-B1110 +# Samsung GT-B1110 # # Contributor: Spelroth @@ -3962,7 +3766,6 @@ TargetVendor= 0x12d1 TargetProduct= 0x1400 MessageContent="55534243123456780000000000000011062000000000000100000000000000" -CheckMBIM=1 ######################################################## @@ -3992,4 +3795,47 @@ TargetProduct= 0x6085 PantechMode=1 + +####################################################### +# Quanta MobileGenie 4G lte +# +# Contributor: Richard Wood + +DefaultVendor= 0x0408 +DefaultProduct=0xea43 + +TargetVendor= 0x0408 +TargetProduct= 0xea47 + +MessageContent="5553424312345678000000000000061b000000020000000000000000000000" + + ######################################################## +# AVM Fritz!Wlan USB Stick N v2 +# +# Contributor: merla + +DefaultVendor= 0x057c +DefaultProduct=0x62ff + +TargetVendor= 0x057c +TargetProduct= 0x8501 + +MessageContent="5553424312345678000000000000061b000000ff0000000000000000000000" + + +######################################################## +# Alcatel-sbell ASB TL131 TD-LTE +# +# Contributor: scateu + +DefaultVendor= 0x05c6 +DefaultProduct=0x9024 + +TargetVendor= 0x05c6 +TargetProduct= 0x9025 + +MessageContent="5553424312345678000000000000061b000000020000000000000000000000" + + +####################################################### diff --git a/SPECS/usb_modeswitch.spec b/SPECS/usb_modeswitch.spec index f8b28ca..cb3a3f4 100644 --- a/SPECS/usb_modeswitch.spec +++ b/SPECS/usb_modeswitch.spec @@ -1,8 +1,8 @@ %define source_name usb-modeswitch Name: usb_modeswitch -Version: 2.4.0 -Release: 5%{?dist} +Version: 2.5.1 +Release: 1%{?dist} Summary: USB Modeswitch gets mobile broadband cards in operational mode Summary(de): USB Modeswitch aktiviert UMTS-Karten Group: Applications/System @@ -14,15 +14,14 @@ Source1: http://www.draisberghof.de/usb_modeswitch/device_reference.txt # http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2546 Patch0: rhbz948451-fix-manual-pages.patch - +# Submitted upstream (2014-11-24) +Patch1: device_reference-utf8.patch # http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2556 -Patch1: 0001-Fix-crash-on-early-fail.patch - -# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2557 -Patch2: 0001-usb_modeswitch-don-t-return-a-value-from-stack.patch - -# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2560 -Patch3: 0001-Bring-back-the-module-binding.patch +Patch2: 0001-Fix-crash-on-early-fail.patch +# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2732 +Patch3: 0001-usb_modeswitch-fix-a-wrong-comparison.patch +# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2733 +Patch4: 0002-usb_modeswitch-count-the-target-devices-from-zero.patch BuildRequires: libusbx-devel BuildRequires: systemd @@ -45,14 +44,13 @@ Vodafone, Option, ZTE und Novatell werden unterstützt. %prep %setup -q -n %{source_name}-%{version} -%patch0 -p1 -b .manpage -%patch1 -p1 -b .libusb_exit -%patch2 -p1 -b .stack -%patch3 -p1 -b .binding +cp -f %{SOURCE1} device_reference.txt -# convert device_reference.txt encoding to UTF-8 -iconv --from=ISO-8859-1 --to=UTF-8 %{SOURCE1} >device_reference.txt -touch -r %{SOURCE1} device_reference.txt +%patch0 -p1 -b .manpage +%patch1 -p0 -b .utf8 +%patch2 -p1 -b .libusb_exit +%patch3 -p1 -b .char_deref +%patch4 -p1 -b .zero_iter # Fix the ppc64le build cp -f /usr/lib/rpm/redhat/config.guess jim/autosetup/config.guess @@ -83,6 +81,10 @@ make install-static \ %changelog +* Tue Aug 29 2017 Lubomir Rintel - 2.5.1-1 +- New 2.5.1 release (rh #1483051) +- Remove the binding patch + * Thu Jul 21 2016 Lubomir Rintel - 2.4.0-5 - Bring back the module binding