scsi_hba_iportmap_create, scsi_hba_iportmap_destroy, scsi_hba_iportmap_iport_add, scsi_hba_iportmap_iport_removecreate and manage an iportmap

#include <sys/scsi/scsi.h>

scsi_hba_iportmap_create(dev_info_t *dip, int csync_usec, int settle_usec, scsi_hba_iportmap_t **iportmapout);

scsi_hba_iportmap_destroy(scsi_hba_iportmap_t *iportmap);

scsi_hba_iportmap_iport_add(scsi_hba_iportmap_t *iportmap, char *ua, void *priv);

scsi_hba_iportmap_iport_remove(scsi_hba_iportmap_t *iportmap, char *ua);

This interface is still evolving in illumos. API and ABI stability is not guaranteed.

Pointer to dev_info structure.
A time in microseconds.
A time in microseconds.
An allocated iportmap.
Pointer where the iportmap is stored.
A character string that represents a unit address for an iport.
Drivers should pass NULL for this field.

The () and scsi_hba_iportmap_destroy() functions are used by HBA drivers to create and destroy an iportmap. For more information on an iportmap and its purpose, see iportmap(9).

The csync_usec and settle_usec are both times measured in microseconds that control two different properties of the iportmap and how it behaves. The value in settle_usec indicates the amount of time that the system should wait to quiesce all changes and consider the resulting system stable. Changes will not be reported until after settle_usec have passed. csync_usec indicates how much time needs to elapse after creation before an initial enumeration has been completed.

The dev_info structure passed into dip is usually the HBA driver's dev_info structure.

When the () function returns, iportmapout will be populated with a pointer to an iportmap that can be used to add and remove iports.

To destroy the iportmap, drivers should use the () function. As part of destroying the iportmap, all associated iports will be detached from the system by having the driver's detach(9E) entry point called.

When the driver needs to add an iport to the system, generally in response to a hotplug event, then the driver should call the () function. The value of ua should be a character string that uniquely identifies the device. If the driver is using a phymap, then this unit address should be the same one as the phymap's callback provided. Otherwise, the driver sets ua to a unique string which is generally the iport's WWN.

When the corresponding iport needs to be removed, then the driver should call the () function. The iport to remove is indicated by the ua argument, which should match the value passed into the () function.

The scsi_hba_iportmap_create() function is generally called during a driver's attach(9E) entry point.

The scsi_hba_iportmap_destroy() function is generally called during a driver's detach(9E) entry point.

The scsi_hba_iportmap_iport_add() and scsi_hba_iportmap_iport_remove() functions should be called from context.

Upon successful completion, the scsi_hba_iportmap_create(), scsi_hba_iportmap_iport_add(), and scsi_hba_iportmap_iport_remove() functions return DDI_SUCCESS. Otherwise, DDI_FAILURE is returned.

iport(9), iportmap(9), attach(9E), detach(9E)

April 18, 2017 OmniOS