home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / scsi_command.z / scsi_command
Encoding:
Text File  |  2001-04-17  |  4.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd((((DDDD3333XXXX))))                                            ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd((((DDDD3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      scsi_command - issue a command to a SCSI device
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssccccssssiiii....hhhh>>>>
  14.  
  15.      vvvvooooiiiidddd
  16.      ((((****ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd))))((((ssssttttrrrruuuucccctttt ssssccccssssiiii____rrrreeeeqqqquuuueeeesssstttt ****_r_e_q))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      The host adapter driver _s_c_s_i__c_o_m_m_a_n_d function issues a command to a SCSI
  20.      device.  The caller (a kernel level SCSI device driver) fills out a
  21.      scsi_request structure and passes a pointer to it.
  22.  
  23.      There is no kernel object called scsi_command; rather, there is a pointer
  24.      to each host adapter's scsi_command function in the sci_command field of
  25.      the scsi_ctlr_info structure, which is attached to the vertex
  26.      corresponding to the host adapter.
  27.  
  28.      The _s_r__l_u_n__v_h_d_l field of the request structure must contain the vertex
  29.      handle of the device.  A kernel panic will result if this is not done.
  30.  
  31.      The _s_r__n_o_t_i_f_y field (address of call back function) must be filled in.
  32.      Calls with NULL in _s_r__n_o_t_i_f_y return with a failure indication in the
  33.      _s_r__s_t_a_t_u_s field.  Earlier versions of IRIX allowed the driver to pass a
  34.      NULL callback address in _s_r__n_o_t_i_f_y as a way of asking _s_c_s_i__c_o_m_m_a_n_d to
  35.      suspend the caller until the command completed.  Now if the driver needs
  36.      to sleep until the command completes, create a semaphore that is posted
  37.      from the callback function.
  38.  
  39.      Other fields of the request structure are also required in order to make
  40.      a successful request; see the SCSI chapter of the _I_R_I_X _D_e_v_i_c_e _D_r_i_v_e_r
  41.      _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e and the comments in the scsi.h header file.
  42.  
  43.      Success or failure of the request is indicated by values returned in
  44.      fields in the request structure.
  45.  
  46. NNNNOOOOTTTTEEEESSSS
  47.      _s_c_s_i__c_o_m_m_a_n_d is stored as a function pointer in the information hanging
  48.      off the vertex handle corresponding to the host adapter in the hwgraph.
  49.      Given a _l_u_n__v_h_d_l (vertex handle of the device) the scsi_command function
  50.      can be called as follows:
  51.  
  52.               scsi_lun_info_t *scsi_lun_info;
  53.             ...
  54.               scsi_lun_info = scsi_lun_info_get(lun_vhdl);
  55.               SLI_COMMAND(scsi_lun_info)(scsi_request);
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd((((DDDD3333XXXX))))                                            ssssccccssssiiii____ccccoooommmmmmmmaaaannnndddd((((DDDD3333XXXX))))
  71.  
  72.  
  73.  
  74. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  75.      comments in /usr/include/sys/scsi.h, hwgraph.intro(D4X), scsi_alloc(D3X),
  76.      scsi_free(D3X), scsi_info(D3X), scsi_ioctl(D3X), scsi_abort(D3X), SCSI
  77.      chapter of the IRIX Device Driver Programmer's Guide
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.