480 /*
481 * Attempt to unregister the mac.
482 */
483 if ((xnbup->u_mh != NULL) && (mac_unregister(xnbup->u_mh) != 0))
484 return (DDI_FAILURE);
485 kmem_free(xnbup, sizeof (*xnbup));
486
487 xnb_detach(dip);
488
489 return (DDI_SUCCESS);
490 }
491
492 DDI_DEFINE_STREAM_OPS(ops, nulldev, nulldev, xnbu_attach, xnbu_detach,
493 nodev, NULL, D_MP, NULL, ddi_quiesce_not_supported);
494
495 static struct modldrv modldrv = {
496 &mod_driverops, "xnbu driver", &ops
497 };
498
499 static struct modlinkage modlinkage = {
500 MODREV_1, &modldrv, NULL
501 };
502
503 int
504 _init(void)
505 {
506 int i;
507
508 mac_init_ops(&ops, "xnbu");
509
510 i = mod_install(&modlinkage);
511 if (i != DDI_SUCCESS)
512 mac_fini_ops(&ops);
513
514 return (i);
515 }
516
517 int
518 _fini(void)
519 {
520 int i;
|
480 /*
481 * Attempt to unregister the mac.
482 */
483 if ((xnbup->u_mh != NULL) && (mac_unregister(xnbup->u_mh) != 0))
484 return (DDI_FAILURE);
485 kmem_free(xnbup, sizeof (*xnbup));
486
487 xnb_detach(dip);
488
489 return (DDI_SUCCESS);
490 }
491
492 DDI_DEFINE_STREAM_OPS(ops, nulldev, nulldev, xnbu_attach, xnbu_detach,
493 nodev, NULL, D_MP, NULL, ddi_quiesce_not_supported);
494
495 static struct modldrv modldrv = {
496 &mod_driverops, "xnbu driver", &ops
497 };
498
499 static struct modlinkage modlinkage = {
500 MODREV_1, { &modldrv, NULL }
501 };
502
503 int
504 _init(void)
505 {
506 int i;
507
508 mac_init_ops(&ops, "xnbu");
509
510 i = mod_install(&modlinkage);
511 if (i != DDI_SUCCESS)
512 mac_fini_ops(&ops);
513
514 return (i);
515 }
516
517 int
518 _fini(void)
519 {
520 int i;
|