kernels/linux-2.4.0/drivers/scsi/ips.c
/****************************************************************************/
/*                                                                          */
/* Routine Name: ips_get_scb                                                */
/*                                                                          */
/* Routine Description:                                                     */
/*                                                                          */
/*   Initialize a CCB to default values                                     */
/*                                                                          */
/* ASSUMED to be callled from within a lock                                 */
/*                                                                          */
/****************************************************************************/


Routine Description.

Initialize a CCB to default values

ASSUMED to be callled from within a lock
Routine Description . Initialize a CCB to default values ASSUMED to be callled from within a lock
static ips_scb_t *
ips_getscb(ips_ha_t *ha) {
   ips_scb_t     *scb;
   u32            cpu_flags;
   METHOD_TRACE("ips_getscb", 1);
   IPS_SCB_LOCK(cpu_flags);
   if ((scb = ha->scb_freelist) == NULL) {
      IPS_SCB_UNLOCK(cpu_flags);
      return (NULL);
   }
   ha->scb_freelist = scb->q_next;
   scb->q_next = NULL;
   IPS_SCB_UNLOCK(cpu_flags);
   ips_init_scb(ha, scb);
   return (scb);
}
static ips_scb_t * ips_getscb ( ips_ha_t * ha ) { ips_scb_t * scb ; u32 cpu_flags ; METHOD_TRACE ( " " , 1 ) ; IPS_SCB_LOCK ( cpu_flags ) ; if ( ( scb = ha -> scb_freelist ) == NULL ) { IPS_SCB_UNLOCK ( cpu_flags ) ; return ( NULL ) ; } ha -> scb_freelist = scb -> q_next ; scb -> q_next = NULL ; IPS_SCB_UNLOCK ( cpu_flags ) ; ips_init_scb ( ha , scb ) ; return ( scb ) ; }
Routine Name: ips_get_scb
Routine Name : ips_get_scb