* the new MCL. 
* the new MCL for PCIXCC. 
select_device_type(int *dev_type_p, int bytelength){	static int count = 0;	int PCICA_avail, PCIXCC_MCL3_avail, CEX2C_avail, index_to_use;	struct status *stat;	if ((*dev_type_p != PCICC) && (*dev_type_p != PCICA) &&	    (*dev_type_p != PCIXCC_MCL2) && (*dev_type_p != PCIXCC_MCL3) &&	    (*dev_type_p != CEX2C) && (*dev_type_p != ANYDEV))		return -1;	if (*dev_type_p != ANYDEV) {		stat = &z90crypt.hdware_info->type_mask[*dev_type_p];		if (stat->st_count >		    (stat->disabled_count + stat->user_disabled_count))			return 0;		return -1;	}	/* Assumption: PCICA, PCIXCC_MCL3, and CEX2C are all similar in speed */	stat = &z90crypt.hdware_info->type_mask[PCICA];	PCICA_avail = stat->st_count -			(stat->disabled_count + stat->user_disabled_count);	stat = &z90crypt.hdware_info->type_mask[PCIXCC_MCL3];	PCIXCC_MCL3_avail = stat->st_count -			(stat->disabled_count + stat->user_disabled_count);	stat = &z90crypt.hdware_info->type_mask[CEX2C];	CEX2C_avail = stat->st_count -			(stat->disabled_count + stat->user_disabled_count);	if (PCICA_avail || PCIXCC_MCL3_avail || CEX2C_avail) {		/**		 * bitlength is a factor, PCICA is the most capable, even with		 * the new MCL.		 */		if ((bytelength < PCIXCC_MIN_MOD_SIZE) ||		    (!ext_bitlens && (bytelength < OLD_PCIXCC_MIN_MOD_SIZE))) {			if (!PCICA_avail)				return -1;			else {				*dev_type_p = PCICA;				return 0;			}		}		index_to_use = count % (PCICA_avail + PCIXCC_MCL3_avail +					CEX2C_avail);		if (index_to_use < PCICA_avail)			*dev_type_p = PCICA;		else if (index_to_use < (PCICA_avail + PCIXCC_MCL3_avail))			*dev_type_p = PCIXCC_MCL3;		else			*dev_type_p = CEX2C;		count++;		return 0;	}	/* Less than OLD_PCIXCC_MIN_MOD_SIZE cannot go to a PCIXCC_MCL2 */	if (bytelength < OLD_PCIXCC_MIN_MOD_SIZE)		return -1;	stat = &z90crypt.hdware_info->type_mask[PCIXCC_MCL2];	if (stat->st_count >	    (stat->disabled_count + stat->user_disabled_count)) {		*dev_type_p = PCIXCC_MCL2;		return 0;	}	/**	 * Less than PCICC_MIN_MOD_SIZE or more than OLD_PCICC_MAX_MOD_SIZE	 * (if we don't have the MCL applied and the newer bitlengths enabled)	 * cannot go to a PCICC	 */	if ((bytelength < PCICC_MIN_MOD_SIZE) ||	    (!ext_bitlens && (bytelength > OLD_PCICC_MAX_MOD_SIZE))) {		return -1;	}	stat = &z90crypt.hdware_info->type_mask[PCICC];	if (stat->st_count >	    (stat->disabled_count + stat->user_disabled_count)) {		*dev_type_p = PCICC;		return 0;	}	return -1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2dee702fcb197d80c1a94650fb611539dd8135ce/z90main.c/buggy/drivers/s390/crypto/z90main.c