priv->broken_disableport = (firmver == 0x25013) || (firmver >= 0x30000 && firmver <= 0x31000); 
static int determine_firmware(struct net_device *dev){	struct orinoco_private *priv = netdev_priv(dev);	hermes_t *hw = &priv->hw;	int err;	struct comp_id nic_id, sta_id;	unsigned int firmver;	char tmp[SYMBOL_MAX_VER_LEN+1];	/* Get the hardware version */	err = HERMES_READ_RECORD(hw, USER_BAP, HERMES_RID_NICID, &nic_id);	if (err) {		printk(KERN_ERR "%s: Cannot read hardware identity: error %d\n",		       dev->name, err);		return err;	}	le16_to_cpus(&nic_id.id);	le16_to_cpus(&nic_id.variant);	le16_to_cpus(&nic_id.major);	le16_to_cpus(&nic_id.minor);	printk(KERN_DEBUG "%s: Hardware identity %04x:%04x:%04x:%04x\n",	       dev->name, nic_id.id, nic_id.variant,	       nic_id.major, nic_id.minor);	priv->firmware_type = determine_firmware_type(&nic_id);	/* Get the firmware version */	err = HERMES_READ_RECORD(hw, USER_BAP, HERMES_RID_STAID, &sta_id);	if (err) {		printk(KERN_ERR "%s: Cannot read station identity: error %d\n",		       dev->name, err);		return err;	}	le16_to_cpus(&sta_id.id);	le16_to_cpus(&sta_id.variant);	le16_to_cpus(&sta_id.major);	le16_to_cpus(&sta_id.minor);	printk(KERN_DEBUG "%s: Station identity  %04x:%04x:%04x:%04x\n",	       dev->name, sta_id.id, sta_id.variant,	       sta_id.major, sta_id.minor);	switch (sta_id.id) {	case 0x15:		printk(KERN_ERR "%s: Primary firmware is active\n",		       dev->name);		return -ENODEV;	case 0x14b:		printk(KERN_ERR "%s: Tertiary firmware is active\n",		       dev->name);		return -ENODEV;	case 0x1f:	/* Intersil, Agere, Symbol Spectrum24 */	case 0x21:	/* Symbol Spectrum24 Trilogy */		break;	default:		printk(KERN_NOTICE "%s: Unknown station ID, please report\n",		       dev->name);		break;	}	/* Default capabilities */	priv->has_sensitivity = 1;	priv->has_mwo = 0;	priv->has_preamble = 0;	priv->has_port3 = 1;	priv->has_ibss = 1;	priv->has_wep = 0;	priv->has_big_wep = 0;	/* Determine capabilities from the firmware version */	switch (priv->firmware_type) {	case FIRMWARE_TYPE_AGERE:		/* Lucent Wavelan IEEE, Lucent Orinoco, Cabletron RoamAbout,		   ELSA, Melco, HP, IBM, Dell 1150, Compaq 110/210 */		snprintf(priv->fw_name, sizeof(priv->fw_name) - 1,			 "Lucent/Agere %d.%02d", sta_id.major, sta_id.minor);		firmver = ((unsigned long)sta_id.major << 16) | sta_id.minor;		priv->has_ibss = (firmver >= 0x60006);		priv->has_wep = (firmver >= 0x40020);		priv->has_big_wep = 1; /* FIXME: this is wrong - how do we tell					  Gold cards from the others? */		priv->has_mwo = (firmver >= 0x60000);		priv->has_pm = (firmver >= 0x40020); /* Don't work in 7.52 ? */		priv->ibss_port = 1;		/* Tested with Agere firmware :		 *	1.16 ; 4.08 ; 4.52 ; 6.04 ; 6.16 ; 7.28 => Jean II		 * Tested CableTron firmware : 4.32 => Anton */		break;	case FIRMWARE_TYPE_SYMBOL:		/* Symbol , 3Com AirConnect, Intel, Ericsson WLAN */		/* Intel MAC : 00:02:B3:* */		/* 3Com MAC : 00:50:DA:* */		memset(tmp, 0, sizeof(tmp));		/* Get the Symbol firmware version */		err = hermes_read_ltv(hw, USER_BAP,				      HERMES_RID_SECONDARYVERSION_SYMBOL,				      SYMBOL_MAX_VER_LEN, NULL, &tmp);		if (err) {			printk(KERN_WARNING			       "%s: Error %d reading Symbol firmware info. Wildly guessing capabilities...\n",			       dev->name, err);			firmver = 0;			tmp[0] = '\0';		} else {			/* The firmware revision is a string, the format is			 * something like : "V2.20-01".			 * Quick and dirty parsing... - Jean II			 */			firmver = ((tmp[1] - '0') << 16) | ((tmp[3] - '0') << 12)				| ((tmp[4] - '0') << 8) | ((tmp[6] - '0') << 4)				| (tmp[7] - '0');			tmp[SYMBOL_MAX_VER_LEN] = '\0';		}		snprintf(priv->fw_name, sizeof(priv->fw_name) - 1,			 "Symbol %s", tmp);		priv->has_ibss = (firmver >= 0x20000);		priv->has_wep = (firmver >= 0x15012);		priv->has_big_wep = (firmver >= 0x20000);		priv->has_pm = (firmver >= 0x20000 && firmver < 0x22000) || 			       (firmver >= 0x29000 && firmver < 0x30000) ||			       firmver >= 0x31000;		priv->has_preamble = (firmver >= 0x20000);		priv->ibss_port = 4;		/* Tested with Intel firmware : 0x20015 => Jean II */		/* Tested with 3Com firmware : 0x15012 & 0x22001 => Jean II */		break;	case FIRMWARE_TYPE_INTERSIL:		/* D-Link, Linksys, Adtron, ZoomAir, and many others...		 * Samsung, Compaq 100/200 and Proxim are slightly		 * different and less well tested */		/* D-Link MAC : 00:40:05:* */		/* Addtron MAC : 00:90:D1:* */		snprintf(priv->fw_name, sizeof(priv->fw_name) - 1,			 "Intersil %d.%d.%d", sta_id.major, sta_id.minor,			 sta_id.variant);		firmver = ((unsigned long)sta_id.major << 16) |			((unsigned long)sta_id.minor << 8) | sta_id.variant;		priv->has_ibss = (firmver >= 0x000700); /* FIXME */		priv->has_big_wep = priv->has_wep = (firmver >= 0x000800);		priv->has_pm = (firmver >= 0x000700);		if (firmver >= 0x000800)			priv->ibss_port = 0;		else {			printk(KERN_NOTICE "%s: Intersil firmware earlier "			       "than v0.8.x - several features not supported\n",			       dev->name);			priv->ibss_port = 1;		}		break;	}	printk(KERN_DEBUG "%s: Firmware determined as %s\n", dev->name,	       priv->fw_name);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/649e59e6ab7817bf1c556b1898356c1a17aa2650/orinoco.c/clean/drivers/net/wireless/orinoco.c