Steve Chang wrote: > > Hi there, > > Here are some questions about SCSI HBA driver. Hopefully some experts > can answer that since > > I’ve got stuck for a week without any progress > > This SCSI HBA driver is for IOP based HBA. The driver will just pass > SCSI command to > > IOP and then get status back from interrupt when it is done. During > debugging I found > > Several issues > > (1) Will DDI_ATTACH get timeout? I found DDI_ATTACH keep coming when > my current DDI_ATTACH > > is still running initialization. How to prevent that? And if I have > multiple HBAs at the > > same time, what will be the behavior? >
I'm not sure I understand your question. But DDI attach can be called for multiple instances of a driver. If you have global state, then you need to use a lock to synchronize accesses to make it safe. > (2) During ddi_tran_tgt_init(), I saw a sequence of calling > target_id=0 .. 15 then again > > Target_id=0 ..15, then target_id=0..7 then target_id=0..7. Is it correct? > It may be correct... I'd have to investigate further. > (3) Since our IOP will handle all commands physically, the HBA just > programs DMA handle for > > every command. In ddi_tran_init_pkt(), HBA does > ddi_dma_alloc_handle(),and > > ddi_dma_buf_bind_handle() to get DMA physical address, dma size. Hence > in ddi_tran_start(), > > will fill in this dma_cookie pointer content to mailbox. Do I process > it correctly? > Your understanding here sounds correct. But you might want to look tran_setup_pkt() -- its a simpler/cleaner API, with some nice performance benefits. > Later the command is done and return “good” status on SCSI Identify > command. But I keep > > seeing kernel send SCSI identify for this target again. This confuses > me and it seems the > > kernel is not receiving the data. > This sounds like a problem for further debug. You might want to have a look at a "virtual" SCSI HBA driver -- http://cr.opensolaris.org/~gdamore/blk2scsa/ - it might not be "perfect", but it definitely should give you an idea. -- Garrett > > Can any expert help? > > Thanks > > Steve Chang > > HighPoint Technologies, Inc. > > 408-240-6115 > > ------------------------------------------------------------------------ > > _______________________________________________ > 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