Print this page
fixup .text where possible
7127  remove -Wno-missing-braces from Makefile.uts


   6  * You may not use this file except in compliance with the License.
   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 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #pragma ident   "%Z%%M% %I%     %E% SMI"
  27 
  28 /*
  29  * DL_IB MAC Type plugin for the Nemo mac module
  30  */
  31 
  32 #include <sys/types.h>
  33 #include <sys/modctl.h>
  34 #include <sys/dlpi.h>
  35 #include <sys/ib/clients/ibd/ibd.h>
  36 #include <sys/mac.h>
  37 #include <sys/mac_ib.h>
  38 #include <sys/dls.h>
  39 #include <sys/byteorder.h>
  40 #include <sys/strsun.h>
  41 #include <inet/common.h>
  42 #include <sys/note.h>
  43 
  44 static uint8_t ib_brdcst[] = { 0x00, 0xff, 0xff, 0xff,
  45     0xff, 0x10, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
  46     0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff };
  47 
  48 static struct modlmisc mac_ib_modlmisc = {
  49         &mod_miscops,
  50         "Infiniband MAC Type plugin 1.0"
  51 };
  52 
  53 static struct modlinkage mac_ib_modlinkage = {
  54         MODREV_1,
  55         &mac_ib_modlmisc,
  56         NULL
  57 };
  58 
  59 static mactype_ops_t mac_ib_type_ops;
  60 
  61 int
  62 _init(void)
  63 {
  64         mactype_register_t *mtrp;
  65         int     err;
  66 
  67         if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
  68                 return (ENOTSUP);
  69         mtrp->mtr_ident = MAC_PLUGIN_IDENT_IB;
  70         mtrp->mtr_ops = &mac_ib_type_ops;
  71         mtrp->mtr_mactype = DL_IB;
  72         mtrp->mtr_nativetype = DL_IB;
  73         mtrp->mtr_addrlen = IPOIB_ADDRL;
  74         mtrp->mtr_brdcst_addr = ib_brdcst;
  75 
  76         /*




   6  * You may not use this file except in compliance with the License.
   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 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 


  26 /*
  27  * DL_IB MAC Type plugin for the Nemo mac module
  28  */
  29 
  30 #include <sys/types.h>
  31 #include <sys/modctl.h>
  32 #include <sys/dlpi.h>
  33 #include <sys/ib/clients/ibd/ibd.h>
  34 #include <sys/mac.h>
  35 #include <sys/mac_ib.h>
  36 #include <sys/dls.h>
  37 #include <sys/byteorder.h>
  38 #include <sys/strsun.h>
  39 #include <inet/common.h>
  40 #include <sys/note.h>
  41 
  42 static uint8_t ib_brdcst[] = { 0x00, 0xff, 0xff, 0xff,
  43     0xff, 0x10, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
  44     0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff };
  45 
  46 static struct modlmisc mac_ib_modlmisc = {
  47         &mod_miscops,
  48         "Infiniband MAC Type plugin 1.0"
  49 };
  50 
  51 static struct modlinkage mac_ib_modlinkage = {
  52         MODREV_1,
  53         {   &mac_ib_modlmisc,
  54             NULL }
  55 };
  56 
  57 static mactype_ops_t mac_ib_type_ops;
  58 
  59 int
  60 _init(void)
  61 {
  62         mactype_register_t *mtrp;
  63         int     err;
  64 
  65         if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
  66                 return (ENOTSUP);
  67         mtrp->mtr_ident = MAC_PLUGIN_IDENT_IB;
  68         mtrp->mtr_ops = &mac_ib_type_ops;
  69         mtrp->mtr_mactype = DL_IB;
  70         mtrp->mtr_nativetype = DL_IB;
  71         mtrp->mtr_addrlen = IPOIB_ADDRL;
  72         mtrp->mtr_brdcst_addr = ib_brdcst;
  73 
  74         /*