Image result for windows logoDuring my work with multipathing driver, I came across multiple situations where once devices were removed and added but they did not come back in time. Multi pathing driver would eventually be blamed for not presenting the paths (Since device is not back).

I thought to pen down some of the scenarios on how the LUN / target disovery happens
What happens when you remove/add cable from HBA to switch?

  1. HBA(miniport) driver raises “BusChangeDetected” notification to storport driver.
  2. Port driver generates “IoInvalidateDeviceRelations” which asks PNP to delete current device list
  3. Bus rescan happens and fresh list of LUNs is rebuilt for every target by sending a REPORT_LUNS request to LUN 0 of each target.
  4. If the above request fails then storport sends an INQUIRY to LUN 0.
  5. If inquiry is successful, INQUIRY will be sent to other luns as well and the list will be built.
  6. If INQUIRY fails on LUN 0 then storport moves to next target.
  7. Storport then compares this new list with the old and finds out the difference.
  8. For the difference of LUNs a PNP is generated to communicate that change to upper layer drivers on the stack.

To know more email:

Contributed by: Himanshu Sonkar | Calsoft Inc.