USB Power Management Test Scripts (SWOEMP-4089)
=================================================
Location: SDX55/Linux/USB/scripts/

All tests validate the modem via get_device_info (qmicli/mbimcli).
No data call, APN, or ping is required.

Scripts
-------
  common.sh            Shared helpers (sourced by other scripts, do not run directly)
  modem_info.sh        Quick device info sanity check
  logging.sh           Enable/disable driver debug logging
  pm_autosuspend.sh    USB runtime autosuspend test
  pm_connected_idle.sh Modem idle reliability test
  pm_superspeed.sh     SuperSpeed power/control transition test

Prerequisites
-------------
1. Ubuntu host with modem on USB port.
2. Drivers built and installed from USB directory:
     cd SDX55/Linux/USB
     make install
     reboot
3. Secure boot disabled in BIOS if drivers fail to load.
4. Verify modem enumeration:
     lsusb -d 1199:
     lsusb -t          # expect qcserial and qmi_wwan (or cdc_mbim)
     ls /dev/cdc-wdm0
5. Install test tools:
     sudo apt install libqmi-utils     # QMI/RmNet (EM9293)
     sudo apt install libmbim-utils    # MBIM mode only
6. SIM inserted for modem registration (data call not required).
7. Run all test scripts as root.

Steps to Execute (full PM test sequence)
----------------------------------------
  cd SDX55/Linux/USB/scripts

  Step 1 — Sanity check:
    sudo ./modem_info.sh

  Step 2 — Enable driver logging (optional):
    sudo ./logging.sh enable

  Step 3 — Runtime autosuspend test:
    sudo ./pm_autosuspend.sh

  Step 4 — Modem idle reliability test:
    sudo ./pm_connected_idle.sh

  Step 5 — SuperSpeed transition test:
    sudo ./pm_superspeed.sh

  Step 6 — Disable logging (optional):
    sudo ./logging.sh disable

Individual Tests (custom parameters)
------------------------------------
  sudo ./modem_info.sh
  sudo ./logging.sh enable|disable
  sudo ./pm_autosuspend.sh [idle_seconds] [cycles]       # default: 30s, 10 cycles
  sudo ./pm_connected_idle.sh [minutes] [interval_sec]   # default: 3 min, 30s
  sudo ./pm_superspeed.sh [cycles]                       # default: 5 cycles

Pass Criteria
-------------
  Each test passes if get_device_info succeeds after every PM idle/transition
  cycle. Scripts exit with code 0 on pass, 1 on failure.

Logs
----
  /tmp/usb_pm_test/test.log
  /tmp/usb_pm_test/usb_state_*.txt
  /tmp/usb_pm_test/dmesg_*.log

SuperSpeed Notes
----------------
  Host-triggered:  pm_superspeed.sh toggles power/control (on/auto).
  Modem-triggered: wait for modem idle, monitor lsusb -t and power/control,
                   then run modem_info.sh to verify link restores.
