SDI peripheral hot add/remove
SDI hot add/remove
is the ability to add and remove
SDI peripheral (target) devices
from a running system.
This feature works with all packages written for
any SDI versions,
including mounted filesystems,
the Veritas Volume Manager,
and raw device access through
/dev/rdsk and /dev/rmt.
The
hotplug
feature, which supports adding and removing
HBA devices,
provides similar functionality for
SDI version 4 HBA drivers
that use DDI version 8/8mp
may also support the
Coding in HBA drivers
To support device hot add/remove,
an HBA driver needs to include the following code:
-
It must have a
devflag(D1)
with HBA_HOT set when the HBA_INFO macro
(documented on the
hba_info(D4sdi)
man page)
is called.
-
In the
start(D2sdi)
routine, call the
sdi_register(D3sdi)
function.
sdi_register( )
fails if there are no devices on the bus.
On an HBA driver that has HBA_MP set,
it is not an error for
sdi_register( )
to return 0 devices found.
The HBA driver must not interpret this as an error.
-
Four additional
SDI subfunctions need to be provided in the
icmd(D2sdi)
entry point routine:
SFB_PAUSE-
stops all bus activity
and may not return until
all pending SDI functions have completed.
SFB_CONTINUE-
continues all bus activity
that had been stopped by an SFB_PAUSE.
SFB_RM_DEV-
removes or invalidates any data structures
associated with the device specified in the
sfb(D4sdi)
structure.
This function should fail
if the address is invalid,
there is no device,
or there are any pending jobs on the controller.
SFB_ADD_DEV-
adds or validates any data structures associated
with the device specified in the
sfb(D4sdi)
structure.
This function should fail
if the address is invalid
or there already is a device at this address.
Coding in target drivers
To support device hot add/remove,
a target driver needs to include the following code:
-
Call the
sdi_target_hotregister(D3sdi)
routine from the target driver's
rinit(D2sdi)
entry point routine.
-
Call the
rm_dev(D2sdi)
entry point to prepare a device
for removal from the system.
This usually entails flushing any cache on the device,
and possibly spinning down or unmounting the device.
Administrative interface
The administrative interface for
SDI hot add/remove is provided
in two commands:
sdiadd(1M)-
add new SDI peripheral device to the kernel.
sdirm(1M)-
remove SDI peripheral device from the kernel.
Design limitations
Note the following limitations when using
the SDI hot add/remove feature:
-
Hot add/remove works only if
both the target and HBA driver implement it.
-
The device must not be opened by any user-level process.
-
The SDI bus termination must not be altered.
-
The
hba_info(D4sdi)
structure for the HBA must set
the HBA_HOT flag.
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005