This patch modifies the midlayer for the addition of transport
  objects to be layered between the scsi_host and the scsi_target.
  FC will be the first consumer - placing the remote port between
  the host and the target.

  There are 4 areas of modification:
  - Opening up the starget creation so that transports can
    control the allocation and teardown of SCSI targets.
  - Adding a linked list of targets to the shost, which is searched
    at sdev creation when looking for a target already allocated by
    a transport.
  - Dealing with all the code that expects the device above the scsi
    target to be a scsi host. The dev_to_shost() function is subverted
    to start at the supplied device and check for a scsi host device.
    If not a scsi host, go to the next parent and check again. Allows
    any number of objects between the starget and shost, while providing
    source compatibility.
  - Addition of a scsi_forget_target() routine. The transport will
    have a remove_host() function which will want to tear down the
    scsi devices under whatever transport objects exist. On unload,
    the driver will call the transport_remove_host() function
    immediately prior to the scsi_remove_host() call.
    In transport_remove_host(), in traversing the list of attached
    sdevs, functions such as shost_for_each_device() are unusable,
    as they utilize scsi_device_get(), which attempts to take
    out references on the module, which is marked for deletion.
    Therefore, we use a function that walks the __devices list w/o
    enforcing the references.

-- James S

Attachment: p00001_scsimid.patch
Description: p00001_scsimid.patch

Reply via email to