Index Index for
Section 9
Index Alphabetical
listing for D
Bottom of page Bottom of
page

driver_framework(9r)

NAME

driver_framework - General: Configures a device driver and its hardware into the system

SYNOPSIS

int driver_framework( struct hwconfig *configuration );

ARGUMENTS

configuration Pointer to a hwconfig data structure, which defines the hardware configuration request.

DESCRIPTION

Note The driver_framework interface replaces the configure_driver and unconfigure_driver interfaces. For this release, the configure_driver and unconfigure_driver are still available for backward compatibility. The driver_framework interface provides hardware configuration support for kernel and user-generated configuration requests. It determines the validity of a configuration request and dispatches the request, as appropriate. The driver_framework interface can be called at any time in the kernel boot path or after multi-user time. Device drivers and system administrators call the driver framework kernel interface to perform the following operations: · Load a module into the kernel To specify this operation, set the type member of the hwconfig structure to HWCONFIG_LOAD_MODULE. · Configure an instance of an adapter and unload the driver, if possible To specify this operation, set the type member of the hwconfig structure to the bitwise AND of HWCONFIG_BUS and HWCONFIG_CONFIGURE_REQUEST. · Unconfigure an instance of an adapter To specify this operation, set the type member of the hwconfig structure to the bitwise AND of HWCONFIG_BUS, HWCONFIG_UNCONFIGURE_REQUEST, and HWCONFIG_UNLOAD_REQUEST. · Configure all controllers on a bus To specify this operation, set the type member of the hwconfig structure to the bitwise AND of HWCONFIG_CONTROLLER_ALL and HWCONFIG_CONFIGURE_REQUEST. · Unconfigure all controllers on a bus and unload the driver, if possible To specify this operation, set the type member of the hwconfig structure to the bitwise AND of HWCONFIG_CONTROLLER_ALL, HWCONFIG_UNCONFIGURE_REQUEST, and HWCONFIG_UNLOAD_REQUEST. · Configure an instance of a controller To specify this operations, set the type member of the hwconfig structure to the bitwise AND of HWCONFIG_CONTROLLER_INSTANCE and HWCONFIG_CONFIGURE_REQUEST. · Configure all devices on a controller To specify this operation, set the type member of the hwconfig structure to HWCONFIG_DEVICE_ALL. · Configure an instance of a device on a controller To specify this operation, set the type member of the hwconfig structure to HWCONFIG_DEVICE_INSTANCE.

RETURN VALUES

The driver_framework interface returns one the following values: ESUCCESS Normal successful completion EINVAL Invalid request ENOTSUP Valid request is not supported by the driver ENODEV Device not found

EXAMPLE

The driver development tool generates the following code to initialize the hwconfig structure and call the driver_framework interface for the example device driver: if (temp_is_dynamic) { temp_hwconfig.type = HWCONFIG_CONTROLLER_ALL | HWCONFIG_CONFIGURE_REQUEST; temp_hwconfig.parent_bus = HWCONFIG_ALL; temp_hwconfig.parent_bus_instance = WILDNUM; temp_hwconfig.driver_name = mcfgname; temp_hwconfig.driver_struct = &tempdriver; retval = driver_framework(&temp_hwconfig);

SEE ALSO

Data Structures: hwconfig(9s) Kernel Interfaces: configure_driver(9r), unconfigure_driver(9r)

Index Index for
Section 9
Index Alphabetical
listing for D
Top of page Top of
page