IPW_DEBUG_ERROR("%s: Error loading microcode: %d\n", 
printk(KERN_ERR DRV_NAME ": %s: Error loading microcode: %d\n", 
static int ipw2100_download_firmware(struct ipw2100_priv *priv){	u32 address;	int err;#ifndef CONFIG_PM	/* Fetch the firmware and microcode */	struct ipw2100_fw ipw2100_firmware;#endif	if (priv->fatal_error) {		IPW_DEBUG_ERROR("%s: ipw2100_download_firmware called after "		       "fatal error %d.  Interface must be brought down.\n",		       priv->net_dev->name, priv->fatal_error);		return -EINVAL;	}#ifdef CONFIG_PM	if (!ipw2100_firmware.version) {		err = ipw2100_get_firmware(priv, &ipw2100_firmware);		if (err) {			IPW_DEBUG_ERROR("%s: ipw2100_get_firmware failed: %d\n",			       priv->net_dev->name, err);			priv->fatal_error = IPW2100_ERR_FW_LOAD;			goto fail;		}	}#else	err = ipw2100_get_firmware(priv, &ipw2100_firmware);	if (err) {		IPW_DEBUG_ERROR("%s: ipw2100_get_firmware failed: %d\n",		       priv->net_dev->name, err);		priv->fatal_error = IPW2100_ERR_FW_LOAD;		goto fail;	}#endif	priv->firmware_version = ipw2100_firmware.version;	/* s/w reset and clock stabilization */	err = sw_reset_and_clock(priv);	if (err) {		IPW_DEBUG_ERROR("%s: sw_reset_and_clock failed: %d\n",		       priv->net_dev->name, err);		goto fail;	}	err = ipw2100_verify(priv);	if (err) {		IPW_DEBUG_ERROR("%s: ipw2100_verify failed: %d\n",		       priv->net_dev->name, err);		goto fail;	}	/* Hold ARC */	write_nic_dword(priv->net_dev,			IPW_INTERNAL_REGISTER_HALT_AND_RESET,			0x80000000);	/* allow ARC to run */	write_register(priv->net_dev, IPW_REG_RESET_REG, 0);	/* load microcode */	err = ipw2100_ucode_download(priv, &ipw2100_firmware);	if (err) {		IPW_DEBUG_ERROR("%s: Error loading microcode: %d\n",		       priv->net_dev->name, err);		goto fail;	}	/* release ARC */	write_nic_dword(priv->net_dev,			IPW_INTERNAL_REGISTER_HALT_AND_RESET,			0x00000000);	/* s/w reset and clock stabilization (again!!!) */	err = sw_reset_and_clock(priv);	if (err) {		IPW_DEBUG_ERROR("%s: sw_reset_and_clock failed: %d\n",		       priv->net_dev->name, err);		goto fail;	}	/* load f/w */	err = ipw2100_fw_download(priv, &ipw2100_firmware);	if (err) {		IPW_DEBUG_ERROR("%s: Error loading firmware: %d\n",		       priv->net_dev->name, err);		goto fail;	}#ifndef CONFIG_PM	/*	 * When the .resume method of the driver is called, the other	 * part of the system, i.e. the ide driver could still stay in	 * the suspend stage. This prevents us from loading the firmware	 * from the disk.  --YZ	 */	/* free any storage allocated for firmware image */	ipw2100_release_firmware(priv, &ipw2100_firmware);#endif	/* zero out Domain 1 area indirectly (Si requirement) */	for (address = IPW_HOST_FW_SHARED_AREA0;	     address < IPW_HOST_FW_SHARED_AREA0_END; address += 4)		write_nic_dword(priv->net_dev, address, 0);	for (address = IPW_HOST_FW_SHARED_AREA1;	     address < IPW_HOST_FW_SHARED_AREA1_END; address += 4)		write_nic_dword(priv->net_dev, address, 0);	for (address = IPW_HOST_FW_SHARED_AREA2;	     address < IPW_HOST_FW_SHARED_AREA2_END; address += 4)		write_nic_dword(priv->net_dev, address, 0);	for (address = IPW_HOST_FW_SHARED_AREA3;	     address < IPW_HOST_FW_SHARED_AREA3_END; address += 4)		write_nic_dword(priv->net_dev, address, 0);	for (address = IPW_HOST_FW_INTERRUPT_AREA;	     address < IPW_HOST_FW_INTERRUPT_AREA_END; address += 4)		write_nic_dword(priv->net_dev, address, 0);	return 0; fail:	ipw2100_release_firmware(priv, &ipw2100_firmware);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/797b4f7652a4dcf06bdf6a8c870991acdf56c03d/ipw2100.c/buggy/drivers/net/wireless/ipw2100.c