[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 2

busresolve Device Configuration Subroutine

Purpose

Allocates bus resources for Micro Channel adapters.

Syntax

#include <cf.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>
int busresolve 
(logname, flag, conf_list, 
not_res_list, busname)
char * logname;
int  flags;
char * conf_list;
char *  not_res_list;
char * busname; 

Parameters

logname Specifies the device logical name.
flags Specifies either the boot phase or 0.
conf_list Points to an array of at least 512 characters.
not_res_list Points to an array of at least 512 characters.
busname Specifies the logical name of the bus.

Description

The busresolve device configuration subroutine is invoked by a device's configuration method to allocate bus resources for all devices that have predefined bus resource attributes. It also is invoked by the bus Configuration method to resolve attributes of all devices in the Defined state.

This subroutine first queries the Customized Attribute and Predefined Attribute object classes to retrieve a list of current bus resource attribute settings and a list of possible settings for each attribute. To resolve conflicts between the values assigned to an already available device and the current device, the subroutine adjusts the values for attributes of devices in the Defined state. For example, the busresolve subroutine makes sure that the current device is not assigned the same interrupt level as an already available device when invoked at run time. These values are updated in the customized Attribute object class.

The busresolve subroutine never modifies attributes of devices that are already in the Available state. It ignores devices in the Defined state if their chgstatus field in the Customized Devices object class indicates that they are missing.

When the logname parameter is set to the logical name of a device, the busresolve subroutine adjusts the specified device's bus resource attributes if necessary to resolve any conflicts with devices that are already in the Available state. A device's Configuration method should invoke the busresolve subroutine to ensure that its bus resources are allocated properly when configuring the device at run time. The Configuration method does not need to do this when run as part of system boot because the bus device's Configuration method would have already performed it.

If the logname parameter is set to a null string, the busresolve subroutine allocates bus resources for all devices that are not already in the Available state. The bus device's Configuration method invokes the busresolve subroutine in this way during system boot.

The flags parameter is set to 1 for system boot phase 1; 2 for system boot phase 2; and 0 when the busresolve subroutine is invoked during run time. The busresolve subroutine can be invoked only to resolve a specific device's bus resources at run time. That is, the flags parameter must be 0 when the logname parameter specifies a device logical name.

The E_BUSRESOURCE value indicates that the busresolve subroutine was not able to resolve all conflicts. In this case, the conf_list parameter will contain a list of the logical names of the devices for which it successfully resolved attributes. The not_res_list parameter will also contain a list of the logical names of the devices for which it could not successfully resolve all attributes. Devices whose names appear in the not_res_list parameter must not be configured into the Available state.

When writing a Configure method for a device having bus resources, make sure that it fails and returns a value of E_BUSRESOURCE if the busresolve subroutine does not return an E_OK value.

Note: If the conf_list and not_res_list strings are not at least 512 characters, there may be insufficient space to hold the device names.

Return Values

E_OK Indicates that all bus resources were resolved and allocated successfully.
E_ARGS Indicates that the parameters to the busresolve subroutine were not valid. For example, the logname parameter specifies a device logical name, but the flags parameter is not set to 0 for run time.
E_MALLOC Indicates that the malloc operation if necessary memory storage failed.
E_NOCuDv Indicates that there is no customized device data for the bus device whose logical name is specified by the busname parameter.
E_ODMGET Indicates that an ODM error occurred while retrieving data from the Configuration data base.
E_PARENTSTATE Indicates that the bus device whose name is specified by the busname parameter is not in the Available state.
E_BUSRESOLVE Indicates that a bus resource for a device did not resolve. The logname parameter can identify the particular device. However, if this parameter is null, then an E_BUSRESOLVE value indicates that the bus resource for some unspecified device in the system did not resolve.

Files

/usr/lib/libcfg.a Archive of device configuration subroutines.

ODM Device Configuration Object Classes.

List of Device Configuration Subroutines.

Related Information

Understanding ODM Object Classes and Objects in AIX General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Home | Search ]