rtsddi.c (7c478bd9) | rtsddi.c (f4b3ec61) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the |
5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. | 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. |
8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* | 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
23 * Copyright 1992-2002 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29#include <sys/types.h> 30#include <sys/conf.h> 31#include <sys/modctl.h> --- 6 unchanged lines hidden (view full) --- 38#define INET_DEVDESC "PF_ROUTE socket STREAMS driver %I%" 39#define INET_DEVMINOR IPV4_MINOR 40#define INET_DEVMTFLAGS IP_DEVMTFLAGS /* since as a driver we're ip */ 41#define INET_MODMTFLAGS (D_MP|D_MTQPAIR|D_MTOUTPERIM|D_MTOCEXCL|D_SYNCSTR) 42 43#include "../inetddi.c" 44 45extern void rts_ddi_init(void); | 23 * Use is subject to license terms. 24 */ 25 26#pragma ident "%Z%%M% %I% %E% SMI" 27 28#include <sys/types.h> 29#include <sys/conf.h> 30#include <sys/modctl.h> --- 6 unchanged lines hidden (view full) --- 37#define INET_DEVDESC "PF_ROUTE socket STREAMS driver %I%" 38#define INET_DEVMINOR IPV4_MINOR 39#define INET_DEVMTFLAGS IP_DEVMTFLAGS /* since as a driver we're ip */ 40#define INET_MODMTFLAGS (D_MP|D_MTQPAIR|D_MTOUTPERIM|D_MTOCEXCL|D_SYNCSTR) 41 42#include "../inetddi.c" 43 44extern void rts_ddi_init(void); |
45extern void rts_ddi_destroy(void); |
|
46 47int 48_init(void) 49{ | 46 47int 48_init(void) 49{ |
50 int error; 51 |
|
50 INET_BECOME_IP(); 51 52 /* 53 * Note: After mod_install succeeds, another thread can enter 54 * therefore all initialization is done before it. 55 */ 56 rts_ddi_init(); | 52 INET_BECOME_IP(); 53 54 /* 55 * Note: After mod_install succeeds, another thread can enter 56 * therefore all initialization is done before it. 57 */ 58 rts_ddi_init(); |
57 return (mod_install(&modlinkage)); | 59 error = mod_install(&modlinkage); 60 if (error != 0) 61 rts_ddi_destroy(); 62 return (error); |
58} 59 60int 61_fini(void) 62{ | 63} 64 65int 66_fini(void) 67{ |
63 return (mod_remove(&modlinkage)); | 68 int error; 69 70 error = mod_remove(&modlinkage); 71 if (error != 0) 72 return (error); 73 74 rts_ddi_destroy(); 75 return (0); |
64} 65 66int 67_info(struct modinfo *modinfop) 68{ 69 return (mod_info(&modlinkage, modinfop)); 70} | 76} 77 78int 79_info(struct modinfo *modinfop) 80{ 81 return (mod_info(&modlinkage, modinfop)); 82} |