1*10128SFei.Feng@Sun.COM /* 2*10128SFei.Feng@Sun.COM * CDDL HEADER START 3*10128SFei.Feng@Sun.COM * 4*10128SFei.Feng@Sun.COM * The contents of this file are subject to the terms of the 5*10128SFei.Feng@Sun.COM * Common Development and Distribution License (the "License"). 6*10128SFei.Feng@Sun.COM * You may not use this file except in compliance with the License. 7*10128SFei.Feng@Sun.COM * 8*10128SFei.Feng@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*10128SFei.Feng@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*10128SFei.Feng@Sun.COM * See the License for the specific language governing permissions 11*10128SFei.Feng@Sun.COM * and limitations under the License. 12*10128SFei.Feng@Sun.COM * 13*10128SFei.Feng@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*10128SFei.Feng@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*10128SFei.Feng@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*10128SFei.Feng@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*10128SFei.Feng@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*10128SFei.Feng@Sun.COM * 19*10128SFei.Feng@Sun.COM * CDDL HEADER END 20*10128SFei.Feng@Sun.COM */ 21*10128SFei.Feng@Sun.COM 22*10128SFei.Feng@Sun.COM /* 23*10128SFei.Feng@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*10128SFei.Feng@Sun.COM * Use is subject to license terms. 25*10128SFei.Feng@Sun.COM */ 26*10128SFei.Feng@Sun.COM 27*10128SFei.Feng@Sun.COM /* 28*10128SFei.Feng@Sun.COM * misc module wrapper for a firmware module for uath driver 29*10128SFei.Feng@Sun.COM * User must use elfwrap(1) to convert raw firmware data file to 30*10128SFei.Feng@Sun.COM * ELF object file. Then use ld(1) to link the ELF object file and 31*10128SFei.Feng@Sun.COM * this module to produce a kernel loadable module. 32*10128SFei.Feng@Sun.COM */ 33*10128SFei.Feng@Sun.COM 34*10128SFei.Feng@Sun.COM #include <sys/types.h> 35*10128SFei.Feng@Sun.COM #include <sys/param.h> 36*10128SFei.Feng@Sun.COM #include <sys/errno.h> 37*10128SFei.Feng@Sun.COM #include <sys/modctl.h> 38*10128SFei.Feng@Sun.COM 39*10128SFei.Feng@Sun.COM 40*10128SFei.Feng@Sun.COM extern struct mod_ops mod_miscops; 41*10128SFei.Feng@Sun.COM static struct modlmisc modlmisc = { 42*10128SFei.Feng@Sun.COM &mod_miscops, 43*10128SFei.Feng@Sun.COM "uath firmware wrapper module 1.1" 44*10128SFei.Feng@Sun.COM }; 45*10128SFei.Feng@Sun.COM static struct modlinkage modlinkage = { 46*10128SFei.Feng@Sun.COM MODREV_1, 47*10128SFei.Feng@Sun.COM &modlmisc, 48*10128SFei.Feng@Sun.COM 0 49*10128SFei.Feng@Sun.COM }; 50*10128SFei.Feng@Sun.COM 51*10128SFei.Feng@Sun.COM int _init(void)52*10128SFei.Feng@Sun.COM_init(void) 53*10128SFei.Feng@Sun.COM { 54*10128SFei.Feng@Sun.COM return (mod_install(&modlinkage)); 55*10128SFei.Feng@Sun.COM } 56*10128SFei.Feng@Sun.COM 57*10128SFei.Feng@Sun.COM int _fini(void)58*10128SFei.Feng@Sun.COM_fini(void) 59*10128SFei.Feng@Sun.COM { 60*10128SFei.Feng@Sun.COM return (mod_remove(&modlinkage)); 61*10128SFei.Feng@Sun.COM } 62*10128SFei.Feng@Sun.COM 63*10128SFei.Feng@Sun.COM int _info(struct modinfo * modinfop)64*10128SFei.Feng@Sun.COM_info(struct modinfo *modinfop) 65*10128SFei.Feng@Sun.COM { 66*10128SFei.Feng@Sun.COM return (mod_info(&modlinkage, modinfop)); 67*10128SFei.Feng@Sun.COM } 68