range->avg_qual.qual = 50;	/* % */ range->avg_qual.level = 186;	/* -70 dBm */ 
range->avg_qual.qual = 50;		/* % */ range->avg_qual.level = 0x100 - 70;	/* -70 dBm */ 
static int airo_get_range(struct net_device *dev,			  struct iw_request_info *info,			  struct iw_point *dwrq,			  char *extra){	struct airo_info *local = dev->priv;	struct iw_range *range = (struct iw_range *) extra;	CapabilityRid cap_rid;		/* Card capability info */	int		i;	int		k;	readCapabilityRid(local, &cap_rid, 1);	dwrq->length = sizeof(struct iw_range);	memset(range, 0, sizeof(*range));	range->min_nwid = 0x0000;	range->max_nwid = 0x0000;	range->num_channels = 14;	/* Should be based on cap_rid.country to give only	 * what the current card support */	k = 0;	for(i = 0; i < 14; i++) {		range->freq[k].i = i + 1; /* List index */		range->freq[k].m = frequency_list[i] * 100000;		range->freq[k++].e = 1;	/* Values in table in MHz -> * 10^5 * 10 */	}	range->num_frequency = k;	range->sensitivity = 65535;	/* Hum... Should put the right values there */	if (local->rssi)		range->max_qual.qual = 100;	/* % */	else		range->max_qual.qual = airo_get_max_quality(&cap_rid);	range->max_qual.level = 0;	/* 0 means we use dBm  */	range->max_qual.noise = 0;	range->max_qual.updated = 0;	/* Experimental measurements - boundary 11/5.5 Mb/s */	/* Note : with or without the (local->rssi), results	 * are somewhat different. - Jean II */	if (local->rssi) {		range->avg_qual.qual = 50;	/* % */		range->avg_qual.level = 186;	/* -70 dBm */	} else {		range->avg_qual.qual = airo_get_avg_quality(&cap_rid);		range->avg_qual.level = 176;	/* -80 dBm */	}	range->avg_qual.noise = 0;	range->avg_qual.updated = 0;	for(i = 0 ; i < 8 ; i++) {		range->bitrate[i] = cap_rid.supportedRates[i] * 500000;		if(range->bitrate[i] == 0)			break;	}	range->num_bitrates = i;	/* Set an indication of the max TCP throughput	 * in bit/s that we can expect using this interface.	 * May be use for QoS stuff... Jean II */	if(i > 2)		range->throughput = 5000 * 1000;	else		range->throughput = 1500 * 1000;	range->min_rts = 0;	range->max_rts = 2312;	range->min_frag = 256;	range->max_frag = 2312;	if(cap_rid.softCap & 2) {		// WEP: RC4 40 bits		range->encoding_size[0] = 5;		// RC4 ~128 bits		if (cap_rid.softCap & 0x100) {			range->encoding_size[1] = 13;			range->num_encoding_sizes = 2;		} else			range->num_encoding_sizes = 1;		range->max_encoding_tokens = (cap_rid.softCap & 0x80) ? 4 : 1;	} else {		range->num_encoding_sizes = 0;		range->max_encoding_tokens = 0;	}	range->min_pmp = 0;	range->max_pmp = 5000000;	/* 5 secs */	range->min_pmt = 0;	range->max_pmt = 65535 * 1024;	/* ??? */	range->pmp_flags = IW_POWER_PERIOD;	range->pmt_flags = IW_POWER_TIMEOUT;	range->pm_capa = IW_POWER_PERIOD | IW_POWER_TIMEOUT | IW_POWER_ALL_R;	/* Transmit Power - values are in mW */	for(i = 0 ; i < 8 ; i++) {		range->txpower[i] = cap_rid.txPowerLevels[i];		if(range->txpower[i] == 0)			break;	}	range->num_txpower = i;	range->txpower_capa = IW_TXPOW_MWATT;	range->we_version_source = 12;	range->we_version_compiled = WIRELESS_EXT;	range->retry_capa = IW_RETRY_LIMIT | IW_RETRY_LIFETIME;	range->retry_flags = IW_RETRY_LIMIT;	range->r_time_flags = IW_RETRY_LIFETIME;	range->min_retry = 1;	range->max_retry = 65535;	range->min_r_time = 1024;	range->max_r_time = 65535 * 1024;	/* Event capability (kernel + driver) */	range->event_capa[0] = (IW_EVENT_CAPA_K_0 |				IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) |				IW_EVENT_CAPA_MASK(SIOCGIWAP) |				IW_EVENT_CAPA_MASK(SIOCGIWSCAN));	range->event_capa[1] = IW_EVENT_CAPA_K_1;	range->event_capa[4] = IW_EVENT_CAPA_MASK(IWEVTXDROP);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ce6623c3d8f932a15306355a7c9a0cdfdd6a26ec/airo.c/clean/drivers/net/wireless/airo.c