/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/sysmacros.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <sys/byteorder.h>
#include <libintl.h> /* for gettext(3c) */
/* MAXIMGSIZE = 1.4 * 1024 * 1024 bytes */
/* Currently the largest firmware image size is 1.4 MB */
/* 1468006 = 1.4 * 1024 * 1024 */
extern struct vrfyplugin *verifier;
/* required functions for this plugin */
/*
* Important information about how this verification plugin works
*
* Direct-attached disks (sd instances) which support firmware
* download accept image files up to 1.4 * 1024 * 1024 bytes in
* size, and do their own verification of the image, rejecting the
* file if it is not appropriate for them.
*
* All that we need to do here is set the various verifier fields
* correctly, and check that the filesize as read from the filesystem
* is less than 1.4 * 1024 * 1024 bytes.
*/
int
{
gettext("\nsd-GENERIC firmware image verifier: "
"supplied filename %s exceeds maximum allowable "
"size of %d bytes\n"),
return (FWFLASH_FAILURE);
}
"sd-GENERIC verifier for device\n"
"vid %s, pid %s, rev %s\npath %s\n",
devicenode->ident->vid,
devicenode->ident->pid,
devicenode->ident->revid,
devicenode->addresses[0]);
return (FWFLASH_SUCCESS);
}