fwflash.h revision d65b419ea7828ceaecc8f2ed7188237add6b14dc
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * we search for a variable (fwplugin_version, type uint32_t) 2N/A * which should equal FWPLUGIN_VERSION_1 2N/A * An opaque handle for dlopen()/dlclose() to use. 2N/A * made up of [drivername].so 2N/A * is the identification plugin for devices attached to 2N/A * the host using the ses(7D) driver. 2N/A * The driver name that this plugin will search for in 2N/A * the device tree snapshot using di_drv_first_node(3DEVINFO) 2N/A * and di_drv_next_node(3DEVINFO). 2N/A * Function entry point to support the command-line "-r" 2N/A * option - read image from device to persistent storage. 2N/A * Not all plugins and devices will support this operation. 2N/A * Function entry point to support the command-line "-f" 2N/A * option - writes from persistent storage to device 2N/A * All identification plugins must support this operation. 2N/A * Function entry point used to build the list of valid, flashable 2N/A * devices attached to the system using the loadable module drvname. 2N/A * (Not all devices attached using drvname will be valid for this 2N/A * start allows us to display flashable devices attached with 2N/A * different drivers and provide the user with a visual clue 2N/A * that these devices are different to others that are detected. 2N/A * All identification plugins must support this operation. 2N/A * Function entry point to support the command-line "-l" 2N/A * All identification plugins must support this operation. 2N/A * Function entry point to allow the plugin to clean up its 2N/A * data structure use IF plugin_version == FWPLUGIN_VERSION_2. 2N/A * If this function is not defined in the plugin, that is not 2N/A * an error condition unless the plugin_version variable is 2N/A * made up of fwflash-[drivername].so 2N/A * is the identification plugin for devices attached to 2N/A * the host using the ses(7D) driver. 2N/A * The driver name that this plugin will search for in 2N/A * the device tree snapshot using di_drv_first_node(3DEVINFO) 2N/A * and di_drv_next_node(3DEVINFO). 2N/A * pointer to the actual plugin, so we can access its 2N/A * function entry points 2N/A /* pointer to the next element in the list */ 2N/A /* vendor ID, eg "HITACHI " */ 2N/A /* product ID, eg "DK32EJ36NSUN36G " */ 2N/A /* revision, eg "PQ08" */ 2N/A * Additional, encapsulated identifying information. 2N/A * This pointer allows us to add details such as the 2N/A * IB hba sector size, which command set should be 2N/A * used or a part number. 2N/A * The fully qualified filename. No default location for 2N/A * the firmware image file is mandated. 2N/A /* Pointer to the identification plugin required */ 2N/A /* pointer to the identification summary structure */ 2N/A * fully qualified pathname, with /devices/.... prefix 2N/A * Which drivername did we find this device attached with 2N/A * in our device tree walk? Eg, ses or tavor or sgen... 2N/A * What class of device is this? For tavor-attached devices, 2N/A * we set this to "IB". For other devices, unless there is 2N/A * a common name to use, just make this the same as the 2N/A /* pointer to the VPR structure */ 2N/A * In the original fwflash(1M), it was possible to select a 2N/A * device for flashing by using an index number called a 2N/A * dev_num. We retain that concept for pluggable fwflash, with 2N/A * the following change - whenever our identification plugin has 2N/A * finished and found at least one acceptable device, we bump the 2N/A * index number by 100. This provides the user with another key 2N/A * to distinguish the desired device from a potentially very large 2N/A * list of similar-looking devices. 2N/A * Contains SAS or FC Port-WWNs, or IB GUIDS. Both SAS and FC only 2N/A * need one entry in this array since they really only have one 2N/A * address which we should track. IB devices can have 4 GUIDs 2N/A * (System Image, Node Image, Port 1 and Port 2). 2N/A * Pointer to the plugin needed to flash this device, and 2N/A * to use for printing appropriate device-specific information 2N/A * as required by the "-l" option to fwflash(1M). 2N/A /* Next entry in the list */ 2N/A * this type of plugin is for the firmware image vendor-specific 2N/A * verification functions, which we load from FWVERIFYPLUGINDIR 2N/A * made up of [drivername]-[vendorname].so 2N/A * is the verification plugin for ses-attached devices which 2N/A * have a vendorname of "SUN". 2N/A * The vendor name, such as "SUN" or "MELLANOX" 2N/A * An opaque handle for dlopen()/dlclose() to use. 2N/A * Firmware image size in bytes, as reported by 2N/A * Flashable devices frequently have different buffers 2N/A * to use for different image types. We track the buffer 2N/A * required for this particular image with this variable. 2N/A * Once the verifier has figured out what sort of image 2N/A * it's been passed, it will know what value to use for 2N/A * Points to the entire firmware image in memory. 2N/A * We do this so we can avoid multiple open()/close() 2N/A * operations, and to make it easier for checksum 2N/A * We also store the name of the firmware file that 2N/A * we point to with *fwimage. This is needed in cases 2N/A * where we need to key off the name of the file to 2N/A * determine whether a different buffer in the target 2N/A * device should be targeted. 2N/A * For example, our "standard" firmware image (file.fw) 2N/A * might require use of buffer id 0, but a boot image 2N/A * (boot.fw) might require use of buffer id 17. In each 2N/A * case, it is the verifier plugin that determines the 2N/A * specific bufferid that is needed by that firmware image. 2N/A * The verification function entry point. The code 2N/A * the nominated firmware image file is valid for 2N/A * the selected devicenode. 2N/A * Note that if the verification fails, the image 2N/A * does _not_ get force-flashed to the device. 2N/A/* Flags for argument parsing */ /* global variables for fwflash */ * utility defines and macros, since the firmware image we get * from LSI is ARM-format and that means byte- and short-swapping /* common functions for fwflash */