Hi, all

       I face a problem about relaying a scsi_pkt. 
      The following is a simply decribe.

When receiving a scsi_pkt (called it old scsi_pkt) from targt driver, my module 
will init a new scsi_pkt by xx_scsi_pkt method and the params are same as old 
scsi_pkt created.
When my new scsi_pkt is done OK, it will copy the result to the old scsi_pkt.

  step 1,                 (ssd) scsi_pkt  -------->(my module) init a new 
scsi_pkt -------->(HBA)  send it out

 step 2,                  (ssd) scsi_pkt  <--------(my module) copy result to 
old scsi_pkt <--------(HBA)  recive response


      In step 1, I  copy  pkt_private  from old scsi_pkt to new scsi_pkt and 
fill other members of scsi_pkt  
      In setp 2, I copy pkt_private from new scsi_pkt to old scsi_pkt 

    My problem is  the new scsi_pkt is done ok(I know from my log) ,but the old 
scsi_pkt is not OK(because some command is not ok ,such as format). I think i 
ignore some detail.My foucs is on the pkt_private , is right?

      I hope your idea . 
      Thanks.







struct scsi_pkt {
        opaque_t pkt_ha_private;        /* private data for host adapter */
        struct scsi_address pkt_address;        /* destination packet is for */
        opaque_t pkt_private;           /* private data for target driver */
        void    (*pkt_comp)(struct scsi_pkt *); /* completion routine */
        uint_t  pkt_flags;              /* flags */
        int     pkt_time;               /* time allotted to complete command */
        uchar_t *pkt_scbp;              /* pointer to status block */
        uchar_t *pkt_cdbp;              /* pointer to command block */
        ssize_t pkt_resid;              /* data bytes not transferred */
        uint_t  pkt_state;              /* state of command */
        uint_t  pkt_statistics;         /* statistics */
        uchar_t pkt_reason;             /* reason completion called */
        uint_t  pkt_cdblen;
        uint_t  pkt_tgtlen;
        uint_t  pkt_scblen;
        ddi_dma_handle_t pkt_handle;
        uint_t  pkt_numcookies;
        off_t   pkt_dma_offset;
        size_t  pkt_dma_len;
        uint_t  pkt_dma_flags;
        ddi_dma_cookie_t *pkt_cookies;
};
 
 
This message posted from opensolaris.org
_______________________________________________
storage-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/storage-discuss

Reply via email to