The Linux SCSI Generic (sg) HOWTO
Prev Chapter 8. Ioctl()s Next

8.16. SG_GET_SCSI_ID

SG_GET_SCSI_ID 0x2276. Assumes 3rd argument is pointing to an object of type Sg_scsi_id (see sg.h) and populates it. That structure contains ints for host_no, channel, scsi_id, lun, scsi_type, allowable commands per lun and queue_depth. Most of this information is available from other sources (e.g. SCSI_IOCTL_GET_IDLUN and SCSI_IOCTL_GET_BUS_NUMBER) but tends to be awkward to collect. Allowable commands per lun and queue_depth give an insight to the command queuing capabilities of the adapters and the device. The latter overrides the former (logically) and the former is only of interest if it is equal to queue_depth which probably indicates the device does not support queuing commands (e.g. most scanners).

typedef struct sg_scsi_id { /* used by SG_GET_SCSI_ID ioctl() */
    int host_no;        /* as in "scsi<n>" where 'n' is one of 0, 1, 2 etc */
    int channel;
    int scsi_id;        /* scsi id of target device */
    int lun;
    int scsi_type;      /* TYPE_... defined in scsi/scsi.h */
    short h_cmd_per_lun;/* host (adapter) maximum commands per lun */
    short d_queue_depth;/* device (or adapter) maximum queue length */
    int unused[2];      /* probably find a good use, set 0 for now */
} sg_scsi_id_t;


Prev Home Next
SG_SCSI_RESET Up SG_GET_SG_TABLESIZE


  • Bookmark
  • Add Resource
  • Modify Resource
  • Get Rated
  • Link to Us
  • Advertise
  • Contact
  • Search Resources

  • Recommended

    • Web Site Templates
    • Ultimate Trading Script
    • The Exterminator
    • Guestbook Script
    • Thumbnail Creator
    • Custom Programming
    • PHP Forums
    • Ajax Tutorial
  • Resource Map

    • Home
    • Expanded Directory
    • New Listings
    • Most Popular
    • Top Rated
    • Email Updates
    • Random Link
    • Advanced Search
    • Bookmark Us
    • Link to Us
    • Advertising Info
    • Webmaster Forum
    • Accessibility Statement
  • General Resources

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • General
    • HTML
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Remotely Hosted
    • Unix Shell
    • Visual Basic
    • XML
  • Scripts & Programs

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Remotely Hosted
    • Unix Shell
    • Visual Basic
    • XML
  • Online Tutorials

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • HTML
    • Howtos
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Unix Shell
    • Visual Basic
    • XML
  • Books

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • HTML
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Unix Shell
    • Visual Basic
    • XML
  • Supporters

    • Bigwebmaster Supporters
    • Ozzu Website Templates
    • Xbox Mod Chip
    • Credit Cards
    • Loans
    • Hollywood News
    • Debt Consolidation
  • Partners

    • Unmelted Templates
    • Web Design Forum