2- After installing Adb and Fastboot, hold Shift button and right click on anywhere on the screen.
3-You will see:"Open Command Window Here" option on right click menu. Click it and open command.
4-Type
Code:
adb devices
Code:
1dd876ba device
Code:
adb shell
Code:
setprop sys.usb.config rndis,diag,adb
Code:
setprop sys.usb.config mtp
7-After opening your diag port, using you can flash ROMs with qfil inside the Qualcomm service tool (qpst) or do some modifications on modem configurations.
However, if you can't even boot (system, recovery, fastboot etc.), here is the solution:
Hold volume up button (volume down to Marshmellow) when a device is closed and plug cell phone into the computer. Your computer will recognize diag com port for a short time. If you can manage to click on the download button on qfil at that time, qfil will hang on that port and flash your system successfully.