USBGadgetHAL: Set Diag DLOAD PID
If QC VID/PID is used and Diag appears as the first function,
write the PID value to the diag driver so it can update the DLOAD
cookie in IMEM. This will allow for RAMDUMP mode to re-enumerate
using the same VID/PID to avoid any COM port reassignment when
re-enumerating on Windows.
Change-Id: Ied441073adf377188f852fc3c3a5da33b13a956f
diff --git a/hal/UsbGadget.cpp b/hal/UsbGadget.cpp
index 54297b8..f9284b7 100644
--- a/hal/UsbGadget.cpp
+++ b/hal/UsbGadget.cpp
@@ -271,6 +271,10 @@
} else if (linkFunction(supported_funcs[funcname]().c_str(), i))
return -1;
+ // Set Diag PID for QC DLOAD mode
+ if (i == 0 && !strcasecmp(vid, "0x05c6") && funcname == "diag")
+ WriteStringToFile(pid, FUNCTIONS_PATH "diag.diag/pid");
+
++i;
}