kernels/linux-2.4.0/drivers/scsi/ips.c
/****************************************************************************/
/*                                                                          */
/* Routine Name: ips_readwrite_page5                                        */
/*                                                                          */
/* Routine Description:                                                     */
/*                                                                          */
/*   Read nvram page 5 from the adapter                                     */
/*                                                                          */
/****************************************************************************/


Routine Description.

Read nvram page 5 from the adapter
Routine Description . Read nvram page 5 from the adapter
static int
ips_readwrite_page5(ips_ha_t *ha, int write, int intr) {
   ips_scb_t *scb;
   int        ret;
   METHOD_TRACE("ips_readwrite_page5", 1);
   scb = &ha->scbs[ha->max_cmds-1];
   ips_init_scb(ha, scb);
   scb->timeout = ips_cmd_timeout;
   scb->cdb[0] = IPS_CMD_RW_NVRAM_PAGE;
   scb->cmd.nvram.op_code = IPS_CMD_RW_NVRAM_PAGE;
   scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb);
   scb->cmd.nvram.page = 5;
   scb->cmd.nvram.write = write;
   scb->cmd.nvram.buffer_addr = VIRT_TO_BUS(ha->nvram);
   scb->cmd.nvram.reserved = 0;
   scb->cmd.nvram.reserved2 = 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)) {
      memset(ha->nvram, 0, sizeof(IPS_NVRAM_P5));
      return (0);
   }
   return (1);
}
static int ips_readwrite_page5 ( ips_ha_t * ha , int write , 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_RW_NVRAM_PAGE ; scb -> cmd . nvram . op_code = IPS_CMD_RW_NVRAM_PAGE ; scb -> cmd . nvram . command_id = IPS_COMMAND_ID ( ha , scb ) ; scb -> cmd . nvram . page = 5 ; scb -> cmd . nvram . write = write ; scb -> cmd . nvram . buffer_addr = VIRT_TO_BUS ( ha -> nvram ) ; scb -> cmd . nvram . reserved = 0 ; scb -> cmd . nvram . reserved2 = 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 ) ) { memset ( ha -> nvram , 0 , sizeof ( IPS_NVRAM_P5 ) ) ; return ( 0 ) ; } return ( 1 ) ; }
Routine Name: ips_readwrite_page5
Routine Name : ips_readwrite_page5
/* issue the command */