kernels/linux-2.4.0/drivers/scsi/ips.c
/****************************************************************************/
/*                                                                          */
/* Routine Name: ips_read_config                                            */
/*                                                                          */
/* Routine Description:                                                     */
/*                                                                          */
/*   Read the configuration on the adapter                                  */
/*                                                                          */
/****************************************************************************/


Routine Description.

Read the configuration on the adapter
Routine Description . Read the configuration on the adapter
static int
ips_read_config(ips_ha_t *ha, int intr) {
   ips_scb_t *scb;
   int        i;
   int        ret;
   METHOD_TRACE("ips_read_config", 1);
   ha->conf->init_id[0] = IPS_ADAPTER_ID;
   for (i = 1; i < 4; i++)
      ha->conf->init_id[i] = 7;
   scb = &ha->scbs[ha->max_cmds-1];
   ips_init_scb(ha, scb);
   scb->timeout = ips_cmd_timeout;
   scb->cdb[0] = IPS_CMD_READ_CONF;
   scb->cmd.basic_io.op_code = IPS_CMD_READ_CONF;
   scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb);
   scb->cmd.basic_io.sg_addr = VIRT_TO_BUS(ha->conf);
   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)) {
      memset(ha->conf, 0, sizeof(IPS_CONF));
      ha->conf->init_id[0] = IPS_ADAPTER_ID;
      for (i = 1; i < 4; i++)
         ha->conf->init_id[i] = 7;
      return (0);
   }
   return (1);
}
static int ips_read_config ( ips_ha_t * ha , int intr ) { ips_scb_t * scb ; int i ; int ret ; METHOD_TRACE ( " " , 1 ) ; ha -> conf -> init_id [ 0 ] = IPS_ADAPTER_ID ; for ( i = 1 ; i < 4 ; i ++ ) ha -> conf -> init_id [ i ] = 7 ; scb = & ha -> scbs [ ha -> max_cmds - 1 ] ; ips_init_scb ( ha , scb ) ; scb -> timeout = ips_cmd_timeout ; scb -> cdb [ 0 ] = IPS_CMD_READ_CONF ; scb -> cmd . basic_io . op_code = IPS_CMD_READ_CONF ; scb -> cmd . basic_io . command_id = IPS_COMMAND_ID ( ha , scb ) ; scb -> cmd . basic_io . sg_addr = VIRT_TO_BUS ( ha -> conf ) ; 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 ) ) { memset ( ha -> conf , 0 , sizeof ( IPS_CONF ) ) ; ha -> conf -> init_id [ 0 ] = IPS_ADAPTER_ID ; for ( i = 1 ; i < 4 ; i ++ ) ha -> conf -> init_id [ i ] = 7 ; return ( 0 ) ; } return ( 1 ) ; }
Routine Name: ips_read_config
Routine Name : ips_read_config
/* set defaults for initiator IDs */ /* send command */ /* reset initiator IDs */