Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: yoma sophian <sophian.yoma@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: question about passing physical address to lower level driver in scsi
Date: Sun, 30 Oct 2011 13:28:21 +0100	[thread overview]
Message-ID: <20111030132821.4df33f1e@stein> (raw)
In-Reply-To: <CADUS3okkKEu_Re1FU_AvVk6agFwrmx0mwzbMSmso6pV8HFfWMA@mail.gmail.com>

On Oct 30 yoma sophian wrote:
> in scsi_init_sgtable, we create sgtable, sdb->table.sgl, and get the
> page from blk_rq_map_sg.
> But when the dma_address of sdb->table.sgl will be calclated out
> before send the scsi command down to the lower level driver?

The low level driver, not SCSI core, is responsible to obtain a DMA
address.

dma_map_sg() maps the scatter-gather list into DMA memory.  Then you can
iterate over the list with for_each_sg and obtain DMA handles and lengths
with sg_dma_address() and sg_dma_len().  E.g.:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/firewire/sbp2.c;h=41841a3e3f99c9acd4c4fc72c972626d8dffdcee;hb=02f8c6aee8df3cdc935e9bdd4f2d020306035dbe#l1398
-- 
Stefan Richter
-=====-==-== =-=- ====-
http://arcgraph.de/sr/

  reply	other threads:[~2011-10-30 12:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-30 12:05 question about passing physical address to lower level driver in scsi yoma sophian
2011-10-30 12:28 ` Stefan Richter [this message]
2011-10-31  1:53   ` yoma sophian
2011-10-31  6:11     ` Julian Calaby
2011-10-31 12:22       ` Stefan Richter
2011-10-31 12:28         ` yoma sophian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111030132821.4df33f1e@stein \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sophian.yoma@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox