old-www/HOWTO/SCSI-Generic-HOWTO/x233.html

201 lines
3.8 KiB
HTML

<HTML
><HEAD
><TITLE
>flags</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="The Linux SCSI Generic (sg) HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="The sg_io_hdr_t structure in detail"
HREF="sg_io_hdr_t.html"><LINK
REL="PREVIOUS"
TITLE="timeout"
HREF="x215.html"><LINK
REL="NEXT"
TITLE="pack_id"
HREF="x249.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux SCSI Generic (sg) HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x215.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 6. The sg_io_hdr_t structure in detail</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x249.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN233">6.11. flags</H1
><P
> These are single or multi-bit values that can be "or-ed" together:
<P
></P
><UL
><LI
><P
> <B
CLASS="COMMAND"
>SG_FLAG_DIRECT_IO</B
>
This is a request for direct IO on the data transfer. If it cannot
be performed then the driver automatically performs indirect IO
instead. If it is important to find out which type of IO was
performed then check the values from the SG_INFO_DIRECT_IO_MASK in
'info' when the request packet is completed (i.e. after read() or
ioctl(,SG_IO,) ). The default action is to do indirect IO.</P
></LI
><LI
><P
> <B
CLASS="COMMAND"
>SG_FLAG_LUN_INHIBIT</B
>
The default action of the sg driver to overwrite internally the top
3 bits of the second SCSI command byte with the LUN associated with
the file descriptor's device. To inhibit this action set this flag.
For SCSI 3 (or later) devices, this internal LUN overwrite does not
occur.</P
></LI
><LI
><P
> <B
CLASS="COMMAND"
>SG_FLAG_MMAP_IO</B
>
When set the driver will attempt to procure the reserved buffer. If
the reserved buffer is occupied (EBUSY) or too small (ENOMEM) then
the operation (write() or ioctl(SG_IO)) fails. No data transfers occur
between the dxferp pointer and the reserved buffer (dxferp is ignored).
In order for a user application to access mmap-ed IO, it must have
successfully executed an appropriate mmap() system call on this sg
file descriptor. This precondition is not checked by write() or
ioctl(SG_IO) when this flag is set. Setting this flag and
SG_FLAG_DIRECT_IO results in a EINVAL error.</P
></LI
><LI
><P
> <B
CLASS="COMMAND"
>SG_FLAG_NO_DXFER</B
>
When set user space data transfers to or from the kernel buffers do
not take place. This only has effect during indirect IO. This flag
is for testing bus speed (e.g. the "sg_rbuf" utility uses it).</P
></LI
></UL
>
The type of flags is unsigned int.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x215.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x249.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>timeout</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="sg_io_hdr_t.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>pack_id</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>