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