345 asyinfo, /* devo_getinfo */
346 nulldev, /* devo_identify */
347 asyprobe, /* devo_probe */
348 asyattach, /* devo_attach */
349 asydetach, /* devo_detach */
350 nodev, /* devo_reset */
351 &cb_asy_ops, /* devo_cb_ops */
352 NULL, /* devo_bus_ops */
353 NULL, /* power */
354 asyquiesce, /* quiesce */
355 };
356
357 static struct modldrv modldrv = {
358 &mod_driverops, /* Type of module. This one is a driver */
359 "ASY driver",
360 &asy_ops, /* driver ops */
361 };
362
363 static struct modlinkage modlinkage = {
364 MODREV_1,
365 (void *)&modldrv,
366 NULL
367 };
368
369 int
370 _init(void)
371 {
372 int i;
373
374 i = ddi_soft_state_init(&asy_soft_state, sizeof (struct asycom), 2);
375 if (i == 0) {
376 mutex_init(&asy_glob_lock, NULL, MUTEX_DRIVER, NULL);
377 if ((i = mod_install(&modlinkage)) != 0) {
378 mutex_destroy(&asy_glob_lock);
379 ddi_soft_state_fini(&asy_soft_state);
380 } else {
381 DEBUGCONT2(ASY_DEBUG_INIT, "%s, debug = %x\n",
382 modldrv.drv_linkinfo, debug);
383 }
384 }
385 return (i);
386 }
|
345 asyinfo, /* devo_getinfo */
346 nulldev, /* devo_identify */
347 asyprobe, /* devo_probe */
348 asyattach, /* devo_attach */
349 asydetach, /* devo_detach */
350 nodev, /* devo_reset */
351 &cb_asy_ops, /* devo_cb_ops */
352 NULL, /* devo_bus_ops */
353 NULL, /* power */
354 asyquiesce, /* quiesce */
355 };
356
357 static struct modldrv modldrv = {
358 &mod_driverops, /* Type of module. This one is a driver */
359 "ASY driver",
360 &asy_ops, /* driver ops */
361 };
362
363 static struct modlinkage modlinkage = {
364 MODREV_1,
365 { (void *)&modldrv, NULL }
366 };
367
368 int
369 _init(void)
370 {
371 int i;
372
373 i = ddi_soft_state_init(&asy_soft_state, sizeof (struct asycom), 2);
374 if (i == 0) {
375 mutex_init(&asy_glob_lock, NULL, MUTEX_DRIVER, NULL);
376 if ((i = mod_install(&modlinkage)) != 0) {
377 mutex_destroy(&asy_glob_lock);
378 ddi_soft_state_fini(&asy_soft_state);
379 } else {
380 DEBUGCONT2(ASY_DEBUG_INIT, "%s, debug = %x\n",
381 modldrv.drv_linkinfo, debug);
382 }
383 }
384 return (i);
385 }
|