Javen, In my driver, I set up struct cb_opt for character device ioctl handling. As you said, if I use uscsi, the sd target driver translates the command and call my driver. It works. But my setting cb_ops for ioctl() never be called.
1. Does it mean I need to handle ioctl, scsi past-through these special commands separately when driver receives the scsi command package from sd target driver? 2. What's the other way to let kernel invoke my cb_opt defined function for ioctl? And what device should I open? Thanks Steve Chang -----Original Message----- From: Javen Wu [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 20, 2008 12:03 AM To: Steve Chang Cc: driver-discuss@opensolaris.org Subject: Re: [driver-discuss] SCSI HBA ioctl question? What's your mean stream ioctl()? storage drivers are not STREAM drivers. Do you mean "character" device ioctl? All links under /dev/rdsk/ are the character devices which can be used to send ioctl(). Javen Steve Chang wrote: >Javen, >If I need to use stream ioctl(), is it the same >way to open device node from "/dev/rdsk/c4t0d0p0"? > >Thanks > >Steve Chang > > >-----Original Message----- >From: Javen Wu [mailto:[EMAIL PROTECTED] >Sent: Wednesday, May 14, 2008 7:01 PM >To: Steve Chang >Cc: driver-discuss@opensolaris.org >Subject: Re: [driver-discuss] SCSI HBA ioctl question? > >Please refer to USCSI(7I) manpage. The ioctl() is not HBA driver's ioctl(). >The ioctl() is for target drivers. NOT for HBA drivers. >You created a minor node(:hptiop) which is node associated to HBA. So >after you open your node and send ioctl(), actually invoke the ioctl() >of your HBA driver, does you hba driver implement new ioctl()? > >uSCSI ioctl() interfaces is to invoke target driver's ioctl(), for >examples, sd(7D), st(7D), sgen(7D) etc. > >I ask you use "/dev/rdsk/c0t0d0p0" to send ioctl(), because you need >open a target device rather than HBA device. > >/dev/rdsk/c0t0d0p0 actually is a link which points to >/devices/pciXXXX/.../[EMAIL PROTECTED],x.. > >Does it help? > >Javen > >Steve Chang wrote: > > > >>Hi Javen, >>I am still confused. Can you explain a little >>why not I can't use the character device name I >>created in driver(shown on device tree "/device/[EMAIL PROTECTED],\ >>0/pci8086,[EMAIL PROTECTED]/pci1103,[EMAIL PROTECTED]:hptiop") but rather need >>to use "/dev/rdsk/c0t0d0p0"? >> >> >>Steve >> >> >>-----Original Message----- >>From: Javen Wu [mailto:[EMAIL PROTECTED] >>Sent: Monday, May 12, 2008 7:39 PM >>To: Steve Chang >>Cc: driver-discuss@opensolaris.org >>Subject: Re: [driver-discuss] SCSI HBA ioctl question? >> >> >> >> >> >> >>>Another question is which slice# should I open and >>> >>> >>> >>> >>> >>> >>It depends on platform and label type. >>If your driver only run on X86, p0(partition 0) is always exist. >> >> >> >> >> >>>why not using character device name? >>> >>> >>> >>> >>> >>> >>/dev/rdsk/c0t0d0p0 is character device. all links under /dev/rdsk are >>character devices. >> >>Javen >> >> >> >> >> >>>Thanks >>>Steve >>> >>> >>>-----Original Message----- >>>From: Javen Wu [mailto:[EMAIL PROTECTED] >>>Sent: Sunday, May 11, 2008 7:42 PM >>>To: Steve Chang >>>Cc: driver-discuss@opensolaris.org >>>Subject: Re: [driver-discuss] SCSI HBA ioctl question? >>> >>>USCSI(7I) is ioctl() of target drivers rather than a ioctl() of >>>HBA/nexus drivers. >>>If you want to use USCSI(7I), please open your disk/tape/enclosure >>>device node and send ioctl(). >>>for example, open /dev/rdsk/c0t1d0s0, then send ioctl(). >>> >>>Don't use HBA node to send USCSI. Detail please refer to manpage of >>>USCSI(7I). >>> >>>Javen >>> >>>Steve Chang wrote: >>> >>> >>> >>> >>> >>> >>> >>>>Here is a ioctl() question, >>>>I use ddi_create_minor_node(fd, "hptiop", instance, DDI_NT_NEXUS,0) >>>>to create a character device for ioctl. And I can find a node listed >>>>in "/device/[EMAIL PROTECTED],0/pci8086,[EMAIL PROTECTED]/pci1103,[EMAIL >>>>PROTECTED]:hptiop". What is the >>>>real device name that I need to submit in my application, so I can >>>>open a channel to communicate with HBA driver through uscsi structure? >>>> >>>> >>>>Thanks >>>>Steve >>>> >>>> >>>>_______________________________________________ >>>>driver-discuss mailing list >>>>driver-discuss@opensolaris.org >>>>http://mail.opensolaris.org/mailman/listinfo/driver-discuss >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>_______________________________________________ >>>driver-discuss mailing list >>>driver-discuss@opensolaris.org >>>http://mail.opensolaris.org/mailman/listinfo/driver-discuss >>> >>> >>> >>> >>> >>> >>_______________________________________________ >>driver-discuss mailing list >>driver-discuss@opensolaris.org >>http://mail.opensolaris.org/mailman/listinfo/driver-discuss >> >> >> >> > >_______________________________________________ >driver-discuss mailing list >driver-discuss@opensolaris.org >http://mail.opensolaris.org/mailman/listinfo/driver-discuss > > _______________________________________________ driver-discuss mailing list driver-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/driver-discuss