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