679 evtchndrv_info, /* devo_getinfo */
680 nulldev, /* devo_identify */
681 nulldev, /* devo_probe */
682 evtchndrv_attach, /* devo_attach */
683 evtchndrv_detach, /* devo_detach */
684 nodev, /* devo_reset */
685 &evtchndrv_cb_ops, /* devo_cb_ops */
686 NULL, /* devo_bus_ops */
687 NULL, /* power */
688 ddi_quiesce_not_needed, /* devo_quiesce */
689 };
690
691 static struct modldrv modldrv = {
692 &mod_driverops, /* Type of module. This one is a driver */
693 "Evtchn driver", /* Name of the module. */
694 &evtchndrv_dev_ops /* driver ops */
695 };
696
697 static struct modlinkage modlinkage = {
698 MODREV_1,
699 &modldrv,
700 NULL
701 };
702
703 int
704 _init(void)
705 {
706 int err;
707
708 err = ddi_soft_state_init(&evtchndrv_statep,
709 sizeof (struct evtsoftdata), 1);
710 if (err)
711 return (err);
712
713 err = mod_install(&modlinkage);
714 if (err)
715 ddi_soft_state_fini(&evtchndrv_statep);
716 else
717 evtchndrv_clone_tab = kmem_zalloc(
718 sizeof (int) * evtchndrv_nclones, KM_SLEEP);
719 return (err);
720 }
|
679 evtchndrv_info, /* devo_getinfo */
680 nulldev, /* devo_identify */
681 nulldev, /* devo_probe */
682 evtchndrv_attach, /* devo_attach */
683 evtchndrv_detach, /* devo_detach */
684 nodev, /* devo_reset */
685 &evtchndrv_cb_ops, /* devo_cb_ops */
686 NULL, /* devo_bus_ops */
687 NULL, /* power */
688 ddi_quiesce_not_needed, /* devo_quiesce */
689 };
690
691 static struct modldrv modldrv = {
692 &mod_driverops, /* Type of module. This one is a driver */
693 "Evtchn driver", /* Name of the module. */
694 &evtchndrv_dev_ops /* driver ops */
695 };
696
697 static struct modlinkage modlinkage = {
698 MODREV_1,
699 { &modldrv, NULL }
700 };
701
702 int
703 _init(void)
704 {
705 int err;
706
707 err = ddi_soft_state_init(&evtchndrv_statep,
708 sizeof (struct evtsoftdata), 1);
709 if (err)
710 return (err);
711
712 err = mod_install(&modlinkage);
713 if (err)
714 ddi_soft_state_fini(&evtchndrv_statep);
715 else
716 evtchndrv_clone_tab = kmem_zalloc(
717 sizeof (int) * evtchndrv_nclones, KM_SLEEP);
718 return (err);
719 }
|