IPW_DEBUG_ERROR("%s: Failed to power on the adapter.\n", 
printk(KERN_ERR DRV_NAME ": %s: Failed to power on the adapter.\n", 
static int ipw2100_start_adapter(struct ipw2100_priv *priv){	int i;	u32 inta, inta_mask, gpio;	IPW_DEBUG_INFO("enter\n");	if (priv->status & STATUS_RUNNING)		return 0;	/*	 * Initialize the hw - drive adapter to DO state by setting	 * init_done bit. Wait for clk_ready bit and Download	 * fw & dino ucode	 */	if (ipw2100_download_firmware(priv)) {		IPW_DEBUG_ERROR("%s: Failed to power on the adapter.\n",		       priv->net_dev->name);		return -EIO;	}	/* Clear the Tx, Rx and Msg queues and the r/w indexes	 * in the firmware RBD and TBD ring queue */	ipw2100_queues_initialize(priv);	ipw2100_hw_set_gpio(priv);	/* TODO -- Look at disabling interrupts here to make sure none	 * get fired during FW initialization */	/* Release ARC - clear reset bit */	write_register(priv->net_dev, IPW_REG_RESET_REG, 0);	/* wait for f/w intialization complete */	IPW_DEBUG_FW("Waiting for f/w initialization to complete...\n");	i = 5000;	do {  		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(40 * HZ / 1000);		/* Todo... wait for sync command ... */		read_register(priv->net_dev, IPW_REG_INTA, &inta);		/* check "init done" bit */		if (inta & IPW2100_INTA_FW_INIT_DONE) {			/* reset "init done" bit */			write_register(priv->net_dev, IPW_REG_INTA,				       IPW2100_INTA_FW_INIT_DONE);			break;		}		/* check error conditions : we check these after the firmware		 * check so that if there is an error, the interrupt handler		 * will see it and the adapter will be reset */		if (inta &		    (IPW2100_INTA_FATAL_ERROR | IPW2100_INTA_PARITY_ERROR)) {			/* clear error conditions */			write_register(priv->net_dev, IPW_REG_INTA,				       IPW2100_INTA_FATAL_ERROR |				       IPW2100_INTA_PARITY_ERROR);		}	} while (i--);	/* Clear out any pending INTAs since we aren't supposed to have	 * interrupts enabled at this point... */	read_register(priv->net_dev, IPW_REG_INTA, &inta);	read_register(priv->net_dev, IPW_REG_INTA_MASK, &inta_mask);	inta &= IPW_INTERRUPT_MASK;	/* Clear out any pending interrupts */	if (inta & inta_mask)		write_register(priv->net_dev, IPW_REG_INTA, inta);	IPW_DEBUG_FW("f/w initialization complete: %s\n",		     i ? "SUCCESS" : "FAILED");	if (!i) {		IPW_DEBUG_WARNING("%s: Firmware did not initialize.\n",		       priv->net_dev->name);		return -EIO;	}	/* allow firmware to write to GPIO1 & GPIO3 */	read_register(priv->net_dev, IPW_REG_GPIO, &gpio);	gpio |= (IPW_BIT_GPIO_GPIO1_MASK | IPW_BIT_GPIO_GPIO3_MASK);	write_register(priv->net_dev, IPW_REG_GPIO, gpio);	/* Ready to receive commands */	priv->status |= STATUS_RUNNING;	/* The adapter has been reset; we are not associated */	priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);	IPW_DEBUG_INFO("exit\n");	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/797b4f7652a4dcf06bdf6a8c870991acdf56c03d/ipw2100.c/buggy/drivers/net/wireless/ipw2100.c