€•öTŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ%/translations/zh_CN/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/zh_TW/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/pt_BR/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/sp_SP/scsi/scsi-generic”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ?/var/lib/git/docbuild/linux/Documentation/scsi/scsi-generic.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒSCSI Generic (sg) driver”h]”hŒSCSI Generic (sg) driver”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ block_quote”“”)”}”(hŒ 20020126 ”h]”hŒ paragraph”“”)”}”(hŒ20020126”h]”hŒ20020126”…””}”(hhåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khhßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hhüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhùh²hh³hÇh´K ubhä)”}”(hXƒThe SCSI Generic driver (sg) is one of the four "high level" SCSI device drivers along with sd, st and sr (disk, tape and CD-ROM respectively). Sg is more generalized (but lower level) than its siblings and tends to be used on SCSI devices that don't fit into the already serviced categories. Thus sg is used for scanners, CD writers and reading audio CDs digitally amongst other things.”h]”hX‰The SCSI Generic driver (sg) is one of the four “high level†SCSI device drivers along with sd, st and sr (disk, tape and CD-ROM respectively). Sg is more generalized (but lower level) than its siblings and tends to be used on SCSI devices that don’t fit into the already serviced categories. Thus sg is used for scanners, CD writers and reading audio CDs digitally amongst other things.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K hhùh²hubhä)”}”(hŒ•Rather than document the driver's interface here, version information is provided plus pointers (i.e. URLs) where to find documentation and examples.”h]”hŒ—Rather than document the driver’s interface here, version information is provided plus pointers (i.e. URLs) where to find documentation and examples.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khhùh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)”}”(hhh]”(hÎ)”}”(hŒMajor versions of the sg driver”h]”hŒMajor versions of the sg driver”…””}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj.h²hh³hÇh´KubhŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hX¤There are three major versions of sg found in the Linux kernel (lk): - sg version 1 (original) from 1992 to early 1999 (lk 2.2.5) . It is based in the sg_header interface structure. - sg version 2 from lk 2.2.6 in the 2.2 series. It is based on an extended version of the sg_header interface structure. - sg version 3 found in the lk 2.4 series (and the lk 2.5 series). It adds the sg_io_hdr interface structure. ”h]”(hŒterm”“”)”}”(hŒDThere are three major versions of sg found in the Linux kernel (lk):”h]”hŒDThere are three major versions of sg found in the Linux kernel (lk):”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jJh³hÇh´K hjFubhŒ definition”“”)”}”(hhh]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒnsg version 1 (original) from 1992 to early 1999 (lk 2.2.5) . It is based in the sg_header interface structure.”h]”hä)”}”(hŒnsg version 1 (original) from 1992 to early 1999 (lk 2.2.5) . It is based in the sg_header interface structure.”h]”hŒnsg version 1 (original) from 1992 to early 1999 (lk 2.2.5) . It is based in the sg_header interface structure.”…””}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjfubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjaubje)”}”(hŒvsg version 2 from lk 2.2.6 in the 2.2 series. It is based on an extended version of the sg_header interface structure.”h]”hä)”}”(hŒvsg version 2 from lk 2.2.6 in the 2.2 series. It is based on an extended version of the sg_header interface structure.”h]”hŒvsg version 2 from lk 2.2.6 in the 2.2 series. It is based on an extended version of the sg_header interface structure.”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj~ubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjaubje)”}”(hŒmsg version 3 found in the lk 2.4 series (and the lk 2.5 series). It adds the sg_io_hdr interface structure. ”h]”hä)”}”(hŒksg version 3 found in the lk 2.4 series (and the lk 2.5 series). It adds the sg_io_hdr interface structure.”h]”hŒksg version 3 found in the lk 2.4 series (and the lk 2.5 series). It adds the sg_io_hdr interface structure.”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjaubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j_h³hÇh´Khj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jZhjFubeh}”(h]”h ]”h"]”h$]”h&]”uh1jDh³hÇh´K hjAubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj.h²hh³Nh´Nubeh}”(h]”Œmajor-versions-of-the-sg-driver”ah ]”h"]”Œmajor versions of the sg driver”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒSg driver documentation”h]”hŒSg driver documentation”…””}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÐh²hh³hÇh´K#ubhä)”}”(hŒ9The most recent documentation of the sg driver is kept at”h]”hŒ9The most recent documentation of the sg driver is kept at”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K$hjÐh²hubj`)”}”(hhh]”je)”}”(hŒhttps://sg.danny.cz/sg/ ”h]”hä)”}”(hŒhttps://sg.danny.cz/sg/”h]”hŒ reference”“”)”}”(hjøh]”hŒhttps://sg.danny.cz/sg/”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jøuh1júhjöubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K&hjòubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjïh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j_h³hÇh´K&hjÐh²hubhä)”}”(hŒBThis describes the sg version 3 driver found in the lk 2.4 series.”h]”hŒBThis describes the sg version 3 driver found in the lk 2.4 series.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K(hjÐh²hubhä)”}”(hŒdDocumentation (large version) for the version 2 sg driver found in the lk 2.2 series can be found at”h]”hŒdDocumentation (large version) for the version 2 sg driver found in the lk 2.2 series can be found at”…””}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K*hjÐh²hubj`)”}”(hhh]”je)”}”(hŒ0https://sg.danny.cz/sg/p/scsi-generic_long.txt. ”h]”hä)”}”(hŒ/https://sg.danny.cz/sg/p/scsi-generic_long.txt.”h]”(jû)”}”(hŒ.https://sg.danny.cz/sg/p/scsi-generic_long.txt”h]”hŒ.https://sg.danny.cz/sg/p/scsi-generic_long.txt”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jEuh1júhj?ubhŒ.”…””}”(hj?h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K-hj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj8h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j_h³hÇh´K-hjÐh²hubhä)”}”(hŒdThe original documentation for the sg driver (prior to lk 2.2.6) can be found in the LDP archives at”h]”hŒdThe original documentation for the sg driver (prior to lk 2.2.6) can be found in the LDP archives at”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K/hjÐh²hubj`)”}”(hhh]”je)”}”(hŒBhttps://tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/index.html ”h]”hä)”}”(hŒAhttps://tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/index.html”h]”jû)”}”(hjh]”hŒAhttps://tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/index.html”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1júhj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K2hjyubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjvh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j_h³hÇh´K2hjÐh²hubhä)”}”(hŒˆA more general description of the Linux SCSI subsystem of which sg is a part can be found at https://www.tldp.org/HOWTO/SCSI-2.4-HOWTO .”h]”(hŒ]A more general description of the Linux SCSI subsystem of which sg is a part can be found at ”…””}”(hj¡h²hh³Nh´Nubjû)”}”(hŒ)https://www.tldp.org/HOWTO/SCSI-2.4-HOWTO”h]”hŒ)https://www.tldp.org/HOWTO/SCSI-2.4-HOWTO”…””}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j«uh1júhj¡ubhŒ .”…””}”(hj¡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K4hjÐh²hubeh}”(h]”Œsg-driver-documentation”ah ]”h"]”Œsg driver documentation”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K#ubhÉ)”}”(hhh]”(hÎ)”}”(hŒExample code and utilities”h]”hŒExample code and utilities”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÊh²hh³hÇh´K9ubhä)”}”(hŒ'There are two packages of sg utilities:”h]”hŒ'There are two packages of sg utilities:”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K:hjÊh²hubhÞ)”}”(hX%========= ========================================================== sg3_utils for the sg version 3 driver found in lk 2.4 sg_utils for the sg version 2 (and original) driver found in lk 2.2 and earlier ========= ========================================================== ”h]”hŒtable”“”)”}”(hhh]”hŒtgroup”“”)”}”(hhh]”(hŒcolspec”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K uh1j÷hjôubjø)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K:uh1j÷hjôubhŒtbody”“”)”}”(hhh]”(hŒrow”“”)”}”(hhh]”(hŒentry”“”)”}”(hhh]”hä)”}”(hŒ sg3_utils”h]”hŒ sg3_utils”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K=hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hhh]”hä)”}”(hŒ+for the sg version 3 driver found in lk 2.4”h]”hŒ+for the sg version 3 driver found in lk 2.4”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K=hj0ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hhh]”(j)”}”(hhh]”hä)”}”(hŒsg_utils”h]”hŒsg_utils”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K>hjPubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjMubj)”}”(hhh]”hä)”}”(hŒFfor the sg version 2 (and original) driver found in lk 2.2 and earlier”h]”hŒFfor the sg version 2 (and original) driver found in lk 2.2 and earlier”…””}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K>hjgubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjMubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjôubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jòhjïubah}”(h]”h ]”h"]”h$]”h&]”uh1jíhjéubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K