It looks like the socal driver code you reference is in socal_attach,
and the 'dip' used is an argument to attach(9E).  In the attach(9E)
context, the dip argument is stabilized by the IO framework by having
an active ndi_devi_enter of the parent of 'dip' across the
attach(9E) operation.

In your code, what is the calling context, how did you obtain 'dip',
and how are you ensuring that 'dip' is stable?

-Chris

?? wrote:
> when i use ddi_prop_op to give WWN property of device , a coredump happens.
> There maybe some problems exist in my code.My  code prototype comes from 
> "socal.c". The corresording source code and my code is following:
> 1) code in socal.c
>       /* Get out Node wwn and calculate port wwns */
>       rval = ddi_prop_op(DDI_DEV_T_ANY, dip,
>               PROP_LEN_AND_VAL_ALLOC, DDI_PROP_DONTPASS |
>               DDI_PROP_CANSLEEP, "wwn", (caddr_t)&wwn, &i);
> 
> 2) my code.  dip is the dev_info node of scsi disk in sdprobe(dev_info_t 
> *dip) 
>       rval = ddi_prop_op(DDI_DEV_T_ANY, dip,
>               PROP_LEN_AND_VAL_ALLOC, DDI_PROP_DONTPASS |
>               DDI_PROP_CANSLEEP, "node-wwn", (caddr_t)&wwn, &i);
>  cmn_err(CE_NOTE, "The node-WWN is:  %s", (wwn == NULL)?"(null)":wwn);
> 
> 
> Is my way getting node-wwn correctly??   if wrong, how to get the WWN, tell 
> me please!
> 
> thanks all!
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> storage-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/storage-discuss

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

Reply via email to