Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scsi_get_device_type_string(9f) [opensolaris man page]

scsi_get_device_type_string(9F) 			   Kernel Functions for Drivers 			   scsi_get_device_type_string(9F)

NAME
scsi_get_device_type_string - look up per-device-type, returning matching information string SYNOPSIS
#include <sys/scsi/scsi.h> char *scsi_get_device_type_string(char *prop_name, dev_info_t *dip, struct scsi_device *devp); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
prop_name Name of string array property that contains a list of paired device-type information. dip Pointer to the device info node for this HBA driver. devp Pointer to a scsi_device(9S) structure of the target. DESCRIPTION
The scsi_get_device_type_string() function looks up the prop_name property, which can be specified in the HBA's driver.conf(4)file. This property allows specification of per-device-type information. The syntax for prop_name in a driver.conf(4) file is: The formal syntax is: prop_name = <duplet> [, <duplet> *]; where: <duplet> := "<vid+pid>", "<information" The string <vid+pid> is returned by the device on a SCSI inquiry command. This string can contain any character in the range 0x20-0x7e. Characters such as double quote (") or single quote ('), which are not permitted in property value strings, are represented by their octal equivalent (for example, 42 and 47). Trailing spaces can be truncated. For example: scsi_vhci_failover_override = "STK FLEXLINE 400", "f_asym_lsi", "SUN T4", "f_tpgs";; The scsi_get_device_type_string() function searches the list of duplets for a matching INQUIRY string. If a match is found, scsi_get_device_type_string returns a copy of the <information> string. The meaning of the returned <information> string is determined by the caller. RETURN VALUES
scsi_get_device_type_string() returns a copy of the matching <information> string, or if no match is found, NULL is returned. When a non- NULL value is returned, the caller is responsible for freeing the <information> string via: kmem_free(info, strlen(info) + 1); CONTEXT
This function can be called from kernel or interrupt context. SEE ALSO
driver.conf(4) Writing Device Drivers SunOS 5.11 12 Jul 2007 scsi_get_device_type_string(9F)

Check Out this Related Man Page

ddi_prop_exists(9F)                                        Kernel Functions for Drivers                                        ddi_prop_exists(9F)

NAME
ddi_prop_exists - check for the existence of a property SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> int ddi_prop_exists(dev_t match_dev, dev_info_t *dip, uint_t flags, char *name); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
match_dev Device number associated with property or DDI_DEV_T_ANY. dip Pointer to the device info node of device whose property list should be searched. flags Possible flag values are some combination of: "small and bold">DDI_PROP_DONTPASS Do not pass request to parent device information node if the property is not found. DDI_PROP_NOTPROM Do not look at PROM properties (ignored on platforms that do not support PROM properties). name String containing the name of the property. DESCRIPTION
ddi_prop_exists() checks for the existence of a property regardless of the property value data type. Properties are searched for based on the dip, name, and match_dev. The property search order is as follows: 1. Search software properties created by the driver. 2. Search the software properties created by the system (or nexus nodes in the device info tree). 3. Search the driver global properties list. 4. If DDI_PROP_NOTPROM is not set, search the PROM properties (if they exist). 5. If DDI_PROP_DONTPASS is not set, pass this request to the parent device information node. 6. Return 0 if not found and 1 if found. Usually, the match_dev argument should be set to the actual device number that this property is associated with. However, if the match_dev argument is DDI_DEV_T_ANY, then ddi_prop_exists() will match the request regardless of the match_dev the property was created with. That is the first property whose name matches name will be returned. If a property was created with match_dev set to DDI_DEV_T_NONE then the only way to look up this property is with a match_dev set to DDI_DEV_T_ANY. PROM properties are always created with match_dev set to DDI_DEV_T_NONE. name must always be set to the name of the property being looked up. RETURN VALUES
ddi_prop_exists() returns 1 if the property exists and 0 otherwise. CONTEXT
These functions can be called from user or kernel context. EXAMPLES
Example 1: : Using ddi_prop_exists() The following example demonstrates the use of ddi_prop_exists(). /* * Enable "whizzy" mode if the "whizzy-mode" property exists */ if (ddi_prop_exists(xx_dev, xx_dip, DDI_PROP_NOTPROM, "whizzy-mode") == 1) { xx_enable_whizzy_mode(xx_dip); } else { xx_disable_whizzy_mode(xx_dip); } SEE ALSO
ddi_prop_get_int(9F), ddi_prop_lookup(9F), ddi_prop_remove(9F), ddi_prop_update(9F) Writing Device Drivers SunOS 5.10 22 May 1995 ddi_prop_exists(9F)
Man Page