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_alloc.z / scsi_alloc
Encoding:
Text File  |  2001-04-17  |  5.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))                                                ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      scsi_alloc - allocate communication channel to host adapter driver
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssccccssssiiii....hhhh>>>>
  14.  
  15.      iiiinnnntttt
  16.      ((((****ssssccccssssiiii____aaaalllllllloooocccc))))(((( vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _l_u_n__v_h_d_l,,,,
  17.                       iiiinnnntttt _o_p_t_i_o_n,,,,
  18.                       vvvvooooiiiidddd ((((****_c_a_l_l_b_a_c_k__f_u_n_c_t_i_o_n))))((((vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt,,,, cccchhhhaaaarrrr ****))))))));;;;
  19.  
  20. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      A kernel level SCSI device driver calls the host adapter _s_c_s_i__a_l_l_o_c
  22.      function to initialize a communication connection between itself and a
  23.      host adapter driver, in preparation for issuing SCSI commands.
  24.  
  25.      There is no kernel object called scsi_alloc; rather, there is a pointer
  26.      to each host adapter's scsi_alloc function in the sci_alloc field of the
  27.      scsi_ctlr_info structure, which is attached to the vertex corresponding
  28.      to the host adapter.
  29.  
  30.      The _l_u_n__v_h_d_l argument specifies the hwgraph vertex for the device.  The
  31.      _o_p_t_i_o_n argument currently has two fields:
  32.  
  33.      +o   SCSIALLOC_EXCLUSIVE indicates that the driver needs exclusive use
  34.          with the device.
  35.  
  36.      +o   SCSIALLOC_QDEPTH is an 8-bit mask specifying the maximum number of
  37.          commands that the device driver will want to queue.  It is advisory
  38.          only and may be ignored by the host adapter driver.
  39.  
  40.      The _c_a_l_l_b_a_c_k__f_u_n_c_t_i_o_n may be useful for drivers that don't use the
  41.      SCSIALLOC_EXCLUSIVE option.  When _c_a_l_l_b_a_c_k__f_u_n_c_t_i_o_n is NULL, it is
  42.      ignored.  When non-NULL, it specifies a function to call whenever there
  43.      is sense data from device.  It can be useful when more than one device
  44.      driver will talk to a SCSI device, but one of the drivers needs to know
  45.      about things like media removals.  Only one device driver may specify a
  46.      callback_function for a given device.  The callback function is called
  47.      with two arguments, the vertex handle corresponding to the SCSI lun and
  48.      the sense data.  The vertex handle allows a driver to know which device
  49.      the callback pertains to.
  50.  
  51. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  52.      _s_c_s_i__a_l_l_o_c returns 0 if a communication connection could not be
  53.      established, or if the arguments are invalid, or if the device was
  54.      already allocated in exclusive use mode, or if this request was for
  55.      exclusive use and the device is already allocated (including possibly
  56.      earlier requests by the same driver).  Otherwise, it returns a positive
  57.      value.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))                                                ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))
  71.  
  72.  
  73.  
  74. NNNNOOOOTTTTEEEESSSS
  75.      _s_c_s_i__a_l_l_o_c is stored as a function pointer in the scsi_ctlr_info_t
  76.      structure, which is associated with the scsi host adapter vertex in the
  77.      hwgraph.  The information structure in the scsi target vertex also has a
  78.      pointer to the scsi_ctlr_info_t of the host adapter that the target is
  79.      connected to.  Given a _l_u_n__v_h_d_l (vertex handle of the device) the
  80.      _s_c_s_i__a_l_l_o_c function can be called as follows:
  81.  
  82.               scsi_lun_info_t *scsi_lun_info;
  83.             ...
  84.               scsi_lun_info = scsi_lun_info_get(lun_vhdl);
  85.               SLI_ALLOC(scsi_lun_info)(lun_vhdl,option,callback_function);
  86.  
  87.  
  88. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  89.      comments in /usr/include/sys/scsi.h, hwgraph.intro(D4X), scsi_free(D3X),
  90.      scsi_info(D3X), scsi_command(D3X), scsi_ioctl(D3X), scsi_abort(D3X), SCSI
  91.      chapter of the IRIX Device Driver Programmer's Guide.
  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.