struct aac_adapter_info * info; 
struct aac_adapter_info *info; struct aac_bus_info *command; struct aac_bus_info_response *bus_info; 
int aac_get_adapter_info(struct aac_dev* dev){	struct fib* fibptr;	int rcode;	u32 tmp;	struct aac_adapter_info * info;	if (!(fibptr = fib_alloc(dev)))		return -ENOMEM;	fib_init(fibptr);	info = (struct aac_adapter_info *) fib_data(fibptr);	memset(info,0,sizeof(*info));	rcode = fib_send(RequestAdapterInfo,			 fibptr, 			 sizeof(*info),			 FsaNormal, 			 1, 1, 			 NULL, 			 NULL);	if (rcode < 0) {		fib_complete(fibptr);		fib_free(fibptr);		return rcode;	}	memcpy(&dev->adapter_info, info, sizeof(*info));	if (dev->adapter_info.options & AAC_OPT_SUPPLEMENT_ADAPTER_INFO) {		struct aac_supplement_adapter_info * info;		fib_init(fibptr);		info = (struct aac_supplement_adapter_info *) fib_data(fibptr);		memset(info,0,sizeof(*info));		rcode = fib_send(RequestSupplementAdapterInfo,				 fibptr,				 sizeof(*info),				 FsaNormal,				 1, 1,				 NULL,				 NULL);		if (rcode >= 0)			memcpy(&dev->supplement_adapter_info, info, sizeof(*info));	}	tmp = le32_to_cpu(dev->adapter_info.kernelrev);	printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d] %.*s\n", 			dev->name, 			dev->id,			tmp>>24,			(tmp>>16)&0xff,			tmp&0xff,			le32_to_cpu(dev->adapter_info.kernelbuild),			(int)sizeof(dev->supplement_adapter_info.BuildDate),			dev->supplement_adapter_info.BuildDate);	tmp = le32_to_cpu(dev->adapter_info.monitorrev);	printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n", 			dev->name, dev->id,			tmp>>24,(tmp>>16)&0xff,tmp&0xff,			le32_to_cpu(dev->adapter_info.monitorbuild));	tmp = le32_to_cpu(dev->adapter_info.biosrev);	printk(KERN_INFO "%s%d: bios %d.%d-%d[%d]\n", 			dev->name, dev->id,			tmp>>24,(tmp>>16)&0xff,tmp&0xff,			le32_to_cpu(dev->adapter_info.biosbuild));	if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0)		printk(KERN_INFO "%s%d: serial %x\n",			dev->name, dev->id,			le32_to_cpu(dev->adapter_info.serial[0]));	dev->nondasd_support = 0;	dev->raid_scsi_mode = 0;	if(dev->adapter_info.options & AAC_OPT_NONDASD){		dev->nondasd_support = 1;	}	/*	 * If the firmware supports ROMB RAID/SCSI mode and we are currently	 * in RAID/SCSI mode, set the flag. For now if in this mode we will	 * force nondasd support on. If we decide to allow the non-dasd flag	 * additional changes changes will have to be made to support	 * RAID/SCSI.  the function aac_scsi_cmd in this module will have to be	 * changed to support the new dev->raid_scsi_mode flag instead of	 * leaching off of the dev->nondasd_support flag. Also in linit.c the	 * function aac_detect will have to be modified where it sets up the	 * max number of channels based on the aac->nondasd_support flag only.	 */	if ((dev->adapter_info.options & AAC_OPT_SCSI_MANAGED) &&	    (dev->adapter_info.options & AAC_OPT_RAID_SCSI_MODE)) {		dev->nondasd_support = 1;		dev->raid_scsi_mode = 1;	}	if (dev->raid_scsi_mode != 0)		printk(KERN_INFO "%s%d: ROMB RAID/SCSI mode enabled\n",				dev->name, dev->id);			if(nondasd != -1) {  		dev->nondasd_support = (nondasd!=0);	}	if(dev->nondasd_support != 0){		printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id);	}	dev->dac_support = 0;	if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){		printk(KERN_INFO "%s%d: 64bit support enabled.\n", dev->name, dev->id);		dev->dac_support = 1;	}	if(dacmode != -1) {		dev->dac_support = (dacmode!=0);	}	if(dev->dac_support != 0) {		if (!pci_set_dma_mask(dev->pdev, 0xFFFFFFFFFFFFFFFFULL) &&			!pci_set_consistent_dma_mask(dev->pdev, 0xFFFFFFFFFFFFFFFFULL)) {			printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n",				dev->name, dev->id);		} else if (!pci_set_dma_mask(dev->pdev, 0xFFFFFFFFULL) &&			!pci_set_consistent_dma_mask(dev->pdev, 0xFFFFFFFFULL)) {			printk(KERN_INFO"%s%d: DMA mask set failed, 64 Bit DAC disabled\n",				dev->name, dev->id);			dev->dac_support = 0;		} else {			printk(KERN_WARNING"%s%d: No suitable DMA available.\n",				dev->name, dev->id);			rcode = -ENOMEM;		}	}	/* 	 * 57 scatter gather elements 	 */	dev->scsi_host_ptr->sg_tablesize = (dev->max_fib_size -		sizeof(struct aac_fibhdr) -		sizeof(struct aac_write) + sizeof(struct sgmap)) /			sizeof(struct sgmap);	if (dev->dac_support) {		/* 		 * 38 scatter gather elements 		 */		dev->scsi_host_ptr->sg_tablesize =			(dev->max_fib_size -			sizeof(struct aac_fibhdr) -			sizeof(struct aac_write64) +			sizeof(struct sgmap64)) /				sizeof(struct sgmap64);	}	dev->scsi_host_ptr->max_sectors = AAC_MAX_32BIT_SGBCOUNT;	if(!(dev->adapter_info.options & AAC_OPT_NEW_COMM)) {		/*		 * Worst case size that could cause sg overflow when		 * we break up SG elements that are larger than 64KB.		 * Would be nice if we could tell the SCSI layer what		 * the maximum SG element size can be. Worst case is		 * (sg_tablesize-1) 4KB elements with one 64KB		 * element.		 *	32bit -> 468 or 238KB	64bit -> 424 or 212KB		 */		dev->scsi_host_ptr->max_sectors =		  (dev->scsi_host_ptr->sg_tablesize * 8) + 112;	}	fib_complete(fibptr);	fib_free(fibptr);	return rcode;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/849717383abc795b8f5efe7b9e0792b2e1f8916a/aachba.c/buggy/drivers/scsi/aacraid/aachba.c