在 2008-3-19,上午2:09, J Duff 写道:

In response to Garrett's reply...

My guess is that you should investigate
the ldi interfaces in sys/sunldi.h, but without more information about
why you think you need the dev_t, its hard to be sure. (dev_t's are
supposed to be mostly a private implementation detail.)

I'm actually trying to open a disk using ldi_open_by_name or ldi_open_by_dev. All I have is the device's path. Both open calls require an dev_indent_t as an input argument. I can get the dev_ident_t using ldi_ident_from_dev provided I have the dev_t which I don't. This is why I'm trying to get the dev_t from the path. See code below:

ldi_ident_from_major(major_t major, ldi_ident_t *lip);

Or consolidation private interfaces:

ldi_ident_from_mod(struct modlinkage *modlp, ldi_ident_t *lip)
ldi_ident_from_anon()


BTW, I was wondering why you cannot get a dev_t or dev_info pointer in your driver ?

-minskey




/* make a handle to be initialized by ldi_open_by_name */
ldi_handle_t raw_handle;

/* get the identity of the raw disk. */
ldi_ident_t raw_ident;
dev_t raw_dev; /* --HOW DO I SPECIFY THIS?-- */
ldi_ident_from_dev(raw_dev, &raw_ident);

/* open the raw disk */
int val = ldi_open_by_name("/dev/dsk/c4t20d0s0", FWRITE|FREAD|FEXCL, kcred, &raw_handle, raw_ident);

I would be very happy to open the disk using just the path, but I don't see how to do this. Is it right in front of me and I don't see it?

Any help would be greatly appreciated.

Duff


This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

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

Reply via email to