On Thu, 2007-08-16 at 10:20 -0700, Randy Dunlap wrote: > > For DMA transfers ... which is where you give the device a bus physical > > address and a length and tell it to go off and perform the transfer on > > its own, you need to use the dma_map_ functions. > > > > For PIO transfers, which are usually ones where you have to feed the > > data into a special device register, since the kernel needs access to do > > this, it has to be done via kmap_atomic()/kunmap_atomic(). So, if > > everything has to go via pio, you use a sequence like > > Thanks for the confirmation. > > > scsi_for_each_sg(cmd, sg, max, i) { > > offset = sg->offset; > > len = sg->len; > ->length; > > > do { > > coffset = offset; clen =len; > > buf = scsi_kmap_atomic_sg(sg, 1, &coffset, &clen) > > why 1 ? You're mapping a single segment at a time to do the PIO. > > offset -= coffset; clen -= len; > > += ? > > > <feed buf+coffset to/from PIO for clen> > > scsi_kunmap_atomic_sg(buf); > > } while (len > 0); > > } > James - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html