kernels/linux-2.4.0/drivers/scsi/ips.c
/****************************************************************************/
/*                                                                          */
/* Routine Name: ips_read_adapter_status                                    */
/*                                                                          */
/* Routine Description:                                                     */
/*                                                                          */
/*   Do an Inquiry command to the adapter                                   */
/*                                                                          */
/****************************************************************************/


Routine Description.

Do an Inquiry command to the adapter
Routine Description . Do an Inquiry command to the adapter
static int
ips_read_adapter_status(ips_ha_t *ha, int intr) {
   ips_scb_t *scb;
   int        ret;
   METHOD_TRACE("ips_read_adapter_status", 1);
   scb = &ha->scbs[ha->max_cmds-1];
   ips_init_scb(ha, scb);
   scb->timeout = ips_cmd_timeout;
   scb->cdb[0] = IPS_CMD_ENQUIRY;
   scb->cmd.basic_io.op_code = IPS_CMD_ENQUIRY;
   scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb);
   scb->cmd.basic_io.sg_count = 0;
   scb->cmd.basic_io.sg_addr = VIRT_TO_BUS(ha->enq);
   scb->cmd.basic_io.lba = 0;
   scb->cmd.basic_io.sector_count = 0;
   scb->cmd.basic_io.log_drv = 0;
   scb->cmd.basic_io.reserved = 0;
   if (((ret = ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) ||
       (ret == IPS_SUCCESS_IMM) ||
       ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1))
      return (0);
   return (1);
}
static int ips_read_adapter_status ( ips_ha_t * ha , int intr ) { ips_scb_t * scb ; int ret ; METHOD_TRACE ( " " , 1 ) ; scb = & ha -> scbs [ ha -> max_cmds - 1 ] ; ips_init_scb ( ha , scb ) ; scb -> timeout = ips_cmd_timeout ; scb -> cdb [ 0 ] = IPS_CMD_ENQUIRY ; scb -> cmd . basic_io . op_code = IPS_CMD_ENQUIRY ; scb -> cmd . basic_io . command_id = IPS_COMMAND_ID ( ha , scb ) ; scb -> cmd . basic_io . sg_count = 0 ; scb -> cmd . basic_io . sg_addr = VIRT_TO_BUS ( ha -> enq ) ; scb -> cmd . basic_io . lba = 0 ; scb -> cmd . basic_io . sector_count = 0 ; scb -> cmd . basic_io . log_drv = 0 ; scb -> cmd . basic_io . reserved = 0 ; if ( ( ( ret = ips_send_wait ( ha , scb , ips_cmd_timeout , intr ) ) == IPS_FAILURE ) || ( ret == IPS_SUCCESS_IMM ) || ( ( scb -> basic_status & IPS_GSC_STATUS_MASK ) > 1 ) ) return ( 0 ) ; return ( 1 ) ; }
Routine Name: ips_read_adapter_status
Routine Name : ips_read_adapter_status
/* send command */