[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Kernel Extensions and Device Support Programming Concepts

Writing a Device Method

Device methods are programs associated with a device that perform basic device configuration operations. These operations consist of defining, undefining, configuring, unconfiguring, and reconfiguring a device. Some devices also use optional start and stop operations.

There are five basic device methods:

Define Creates a device instance in the Customized database.
Configure Configures a device instance already represented in the Customized database. This method is responsible for making a device available for use in the system.
Change Reconfigures a device by allowing device characteristics or attributes to be changed.
Unconfigure Makes a configured device unavailable for use in the system. The device instance remains in the Customized database but must be reconfigured before it can be used.
Undefine Deletes a device instance from the Customized database.

Some devices also require these two optional methods:

Stop Provides the ability to stop a device without actually unconfiguring it. For example, a command can be issued to the device driver telling it to stop accepting normal I/O requests.
Start Starts a device that has been stopped with the Stop method. For example, a command can be issued to the device driver informing it that it can now accept normal I/O requests.

Invoking Methods

One device method can invoke another device method. For instance, a Configure method for a device may need to invoke the Define method for child devices. The Change method can invoke the Unconfigure and Configure methods. To ensure proper operation, a method that invokes another method must always use the odm_run_method subroutine.

Example Methods

See the /usr/samples directory for example device method source code. These source code excerpts are provided for example purposes only. The examples do not function as written.

Related Information

Adding an Unsupported Device to the System.

Loading a Device Driver.

ODM Device Configuration Object Classes.

Understanding Device Methods Interfaces.

Accessing Device Attributes.

The odm_run_method subroutine.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]