summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2016-08-18 13:05:03 +0200
committerBjørn Mork <bjorn@mork.no>2016-08-18 13:05:03 +0200
commit361c99430615b101556d45e1432d2910a1996f6e (patch)
treea8c4a0b617c5457b27375998a74c0cf16f2b70e8
parentc39fc1ff07fec98afe53ac70941a19a91e3422d2 (diff)
swi_setusbcomp: add qdl switch
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rwxr-xr-xscripts/swi_setusbcomp.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/swi_setusbcomp.pl b/scripts/swi_setusbcomp.pl
index e536a1f..8098a9a 100755
--- a/scripts/swi_setusbcomp.pl
+++ b/scripts/swi_setusbcomp.pl
@@ -10,15 +10,17 @@ use IPC::Shareable;
use Fcntl ':mode';
use File::Basename;
use Time::HiRes qw (sleep);
+use Data::Dumper;
my $maxctrl = 4096; # default, will be overridden by ioctl if supported
my $mgmt = "/dev/cdc-wdm0";
my $reset;
my $usbreset;
+my $qdl;
my $debug;
my $verbose = 1;
my $usbcomp;
-
+
# a few global variables
my $msgs;
my $dmscid;
@@ -32,6 +34,7 @@ GetOptions(
'device=s' => \$mgmt,
'reset!' => \$reset,
'usbreset!' => \$usbreset,
+ 'qdl!' => \$qdl,
'debug!' => \$debug,
'verbose!' => \$verbose,
'help|h|?' => \&usage,
@@ -551,6 +554,13 @@ unless ($lastqmi = &do_qmi(0x0022, &mk_qmi(0, 0, 0x0022, { 0x01 => pack("C", 2),
$dmscid = $lastqmi->{'tlvs'}{0x01}[1]; # save the DMS CID
print "Got QMI DMS client ID '$dmscid'\n" if $verbose;
+
+# Bootloader mode trumps the rest of this script....
+if ($qdl) {
+ $lastqmi = &do_qmi(0x003e, &mk_qmi(2, $dmscid, 0x003e, {}));
+ &quit;
+}
+
#QMI_DMS_SWI_SETUSBCOMP (or whatever)
# get USB comp = 0x555B
# set USB comp = 0x555C
@@ -689,7 +699,7 @@ sub quit {
close(F);
# dump all messages received
- print Dumper($msgs) if $debug;
+## print Dumper($msgs) if $debug;
# attempt to reset USB device
&usbreset if ($usbreset);
@@ -706,6 +716,7 @@ Where [options] are
--usbcomp=<num> change USB composition setting
--reset issue a QMI reset request
--usbreset USB device reset - might be necessary for MC74xx
+ --qdl reboot modem into bootloader QDL mode
--debug enable verbose debug output
--help this help text