Steven Stallion wrote:
> All,
>
> As a part of the GLDv3 conversion work on dnet, I updated quite a bit of 
> the STREAMS initialization code. After doing a bit of testing this 
> evening, it looks like dnet is having an issue in _info (the _init 
> breakpoint was never reached).
>
> My gut is telling me I botched the STREAMS init which is causing 
> mod_info (and subsequently _info) to return a non 0 condition.
>
> Essentially, I changed this older block of STREAMS init:
>
>   293 /* Standard Streams initialization */
>   294 static struct module_info minfo = {
>   295         DNETIDNUM, "dnet", 0, INFPSZ, DNETHIWAT, DNETLOWAT
>   296 };
>   297
>   298 static struct qinit rinit = {   /* read queues */
>   299         NULL, gld_rsrv, gld_open, gld_close, NULL, &minfo, NULL
>   300 };
>   301
>   302 static struct qinit winit = {   /* write queues */
>   303         gld_wput, gld_wsrv, NULL, NULL, NULL, &minfo, NULL
>   304 };
>   305
>   306 static struct streamtab dnetinfo = {&rinit, &winit, NULL, NULL};
>   ...
>   310
>   311 static struct cb_ops cb_dnetops = {
>   312         nulldev,                /* cb_open */
>   313         nulldev,                /* cb_close */
>   314         nodev,                  /* cb_strategy */
>   315         nodev,                  /* cb_print */
>   316         nodev,                  /* cb_dump */
>   317         nodev,                  /* cb_read */
>   318         nodev,                  /* cb_write */
>   319         nodev,                  /* cb_ioctl */
>   320         nodev,                  /* cb_devmap */
>   321         nodev,                  /* cb_mmap */
>   322         nodev,                  /* cb_segmap */
>   323         nochpoll,               /* cb_chpoll */
>   324         ddi_prop_op,            /* cb_prop_op */
>   325         &dnetinfo,          /* cb_stream */
>   326         (int)(D_MP | D_HOTPLUG) /* cb_flag */
>   327 };
>   328
>   329 static struct dev_ops dnetops = {
>   330         DEVO_REV,               /* devo_rev */
>   331         0,                      /* devo_refcnt */
>   332         gld_getinfo,            /* devo_getinfo */
>   333         nulldev,                /* devo_identify */
>   334         dnetprobe,              /* devo_probe */
>   335         dnetattach,             /* devo_attach */
>   336         dnetdetach,             /* devo_detach */
>   337         nodev,                  /* devo_reset */
>   338         &cb_dnetops,                /* devo_cb_ops */
>   339         (struct bus_ops *)NULL  /* devo_bus_ops */
>   340 };
>
> To (similar to afe):
>
>   293 DDI_DEFINE_STREAM_OPS(dnet_ops, nulldev, dnet_probe, dnet_attach, 
> dnet_detach,
>   294     nodev, NULL, D_MP, NULL);
>
>
> Looking back, cutting 293 - 306 seems wrong, but unfortunately I do not 
> have enough experience with STREAMS to say why, or if there is a more 
> appropriate route to take to remove the gld_getinfo reference in dnetops.
>
> Does anyone have any advice?
>   

First off, _info has nothing to do with the gld_getinfo.   You 
definitely do not a getinfo(9e) entry point with a GLDv2 or v3 driver.  
(GLDv2 should do qassociate on your behalf, obviating the need for a 
non-NULL getinfo(9e) -- note that this is only true for Solaris 9 (?) 
and later -- earlier Solaris 8 still needed a getinfo(9e).)

Your driver is also a GLDv3 driver.  For that, it would be informative 
to post your _init().  My guess is that that this is where the problem lies.

Note that if _init is not getting called, then something is very very 
wrong.  This should be the very first routine called in any kernel module.

    -- Garrett
> TIA,
>
> Steve
>
>   

_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to