fwflash.h revision c4800545504378963d9f2eeb253f06899664f9f6
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 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 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 * start allows us to display flashable devices attached with * different drivers and provide the user with a visual clue * that these devices are different to others that are detected. * All identification plugins must support this operation. * Function entry point to support the command-line "-l" * option - list/report flashable devices attached to the system. * All identification plugins must support this operation. * made up of fwflash-[drivername].so * is the identification plugin for devices attached to * the host using the ses(7D) driver. * The driver name that this plugin will search for in * the device tree snapshot using di_drv_first_node(3DEVINFO) * and di_drv_next_node(3DEVINFO). * pointer to the actual plugin, so we can access its /* pointer to the next element in the list */ /* vendor ID, eg "HITACHI " */ /* product ID, eg "DK32EJ36NSUN36G " */ /* revision, eg "PQ08" */ * Additional, encapsulated identifying information. * This pointer allows us to add details such as the * IB hba sector size, which command set should be * The fully qualified filename. No default location for * for the firmware image file is mandated. /* Pointer to the identification plugin required */ /* pointer to the identification summary structure */ * fully qualified pathname, with /devices/.... prefix * Which drivername did we find this device attached with * in our device tree walk? Eg, ses or tavor or sgen... * What class of device is this? For tavor-attached devices, * we set this to "IB". For other devices, unless there is * a common name to use, just make this the same as the /* pointer to the VPR structure */ * In the original fwflash(1M), it was possible to select a * device for flashing by using an index number called a * dev_num. We retain that concept for pluggable fwflash, with * the following change - whenever our identification plugin has * finished and found at least one acceptable device, we bump the * index number by 100. This provides the user with another key * to distinguish the desired device from a potentially very large * list of similar-looking devices. * Contains SAS or FC Port-WWNs, or IB GUIDS. Both SAS and FC only * need one entry in this array since they really only have one * address which we should track. IB devices can have 4 GUIDs * (System Image, Node Image, Port 1 and Port 2). * Pointer to the plugin needed to flash this device, and * to use for printing appropriate device-specific information * as required by the "-l" option to fwflash(1M). /* Next entry in the list */ * this type of plugin is for the firmware image vendor-specific * verification functions, which we load from FWVERIFYPLUGINDIR * made up of [drivername]-[vendorname].so * is the verification plugin for ses-attached devices which * have a vendorname of "SUN". * The vendor name, such as "SUN" or "MELLANOX" * An opaque handle for dlopen()/dlclose() to use. * Firmware image size in bytes, as reported by * Flashable devices frequently have different buffers * to use for different image types. We track the buffer * required for this particular image with this variable. * Once the verifier has figured out what sort of image * it's been passed, it will know what value to use for * Points to the entire firmware image in memory. * We do this so we can avoid multiple open()/close() * operations, and to make it easier for checksum * We also store the name of the firmware file that * we point to with *fwimage. This is needed in cases * where we need to key off the name of the file to * determine whether a different buffer in the target * device should be targeted. * For example, our "standard" firmware image (file.fw) * might require use of buffer id 0, but a boot image * (boot.fw) might require use of buffer id 17. In each * case, it is the verifier plugin that determines the * specific bufferid that is needed by that firmware image. * The verification function entry point. The code * in fwflash.c calls this function to verify that * the nominated firmware image file is valid for * the selected devicenode. * Note that if the verification fails, the image * does _not_ get force-flashed to the device. /* 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 */