Paul,
Good advice; however, it's an issue I'd like to address at a later time with
the driver.  Simply returning DDI_SUCCESS still causes the machine to
reboot, and this seems like an issue in itself.

-Daniel

On 9/11/07, Paul Durrant <[EMAIL PROTECTED]> wrote:
>
> Sorry, forgot to send to the rest of the list...
>
> ---------- Forwarded message ----------
> From: Paul Durrant <[EMAIL PROTECTED]>
> Date: 11 Sep 2007 15:38
> Subject: Re: [driver-discuss] STREAMS drivers
> To: Daniel Corbe <[EMAIL PROTECTED]>
>
>
> > int testdriver_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void
> *arg,
> > void **resultp)
> > {
> >         dev_t dev = (dev_t)arg;
> >         int instance, ret = DDI_FAILURE;
> >
> >
> >         devstate_t *sp;
> >         static void *statep;
> >         instance = getminor(dev);
> >
> >         switch (infocmd)
> >         {
> >                 case DDI_INFO_DEVT2DEVINFO:
> >                         if ((sp = ddi_get_soft_state(statep,
> > getminor((dev_t) arg))) != NULL)
> >                         {
> >                                 *resultp = sp->devi;
> >                                 ret = DDI_SUCCESS;
> >                         }
> >                         else
> >                         {
> >                                 *resultp = NULL;
> >                         }
> >                         break;
> >                 case DDI_INFO_DEVT2INSTANCE:
> >                         *resultp = (void *)instance;
> >                         ret = DDI_SUCCESS;
> >                         break;
> >                 default:
> >                         break;
> >         }
> >
> >         return (ret);
> > }
>
> You're using the clone driver to create your minor node(s) so your
> clearly aiming to be clonable, yet your DDI_INFO_DEVT2INSTANCE is not
> mapping minor numbers to driver instances; you need to track these.
>
>   Paul
>
> --
> Paul Durrant
> http://www.linkedin.com/in/pdurrant
>
>
> --
> Paul Durrant
> http://www.linkedin.com/in/pdurrant
> _______________________________________________
>
> driver-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/driver-discuss
>
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to