On Thu, Feb 28, 2008 at 5:10 AM, Steven Stallion <[EMAIL PROTECTED]> 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);
>

Steve,

What catches my eye is the 7th argument to the DDI_DEFINE_STREAM_OPS() macro
It should be a xx_getinfo() entry point. Since it is a network driver
and it can get away
without proper getinfo() it should be nodev() or ddi_no_info(). I am
really not sure what
happens if NULL is passed there.

Well, I just checked the kernel source, and it appears that there is
at least one point
where getinfo() provided by the driver is called without checking it
is non-NULL beforehand.
Since it is called from uts/common/os/driver.c::bdev_strategy() I
highly doubt it has something
to do with your problem. Still leaving it as NULL bothers me.

Back to your problem. Have you tried to dtrace the driver loading
process ? We'd see
what was called and in which sequence.

>
>  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?
>
>  TIA,
>
>  Steve
>
>  --
>  Yet magic and hierarchy
>  arise from the same source,
>  and this source has a null pointer.
>
>  Reference the NULL within NULL,
>  it is the gateway to all wizardry.
>  _______________________________________________
>  driver-discuss mailing list
>  [email protected]
>  http://mail.opensolaris.org/mailman/listinfo/driver-discuss
>



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

Reply via email to