ipw_write32(priv, CX2_RX_READ_INDEX, priv->rxq->read); 
ipw_write32(priv, IPW_RX_READ_INDEX, priv->rxq->read); 
static int ipw_load(struct ipw_priv *priv){#ifndef CONFIG_PM	const struct firmware *bootfw = NULL;	const struct firmware *firmware = NULL;	const struct firmware *ucode = NULL;#endif	int rc = 0, retries = 3;#ifdef CONFIG_PM	if (!fw_loaded) {#endif		rc = ipw_get_fw(priv, &bootfw, IPW_FW_NAME("boot"));		if (rc)			goto error;		switch (priv->ieee->iw_mode) {		case IW_MODE_ADHOC:			rc = ipw_get_fw(priv, &ucode,					IPW_FW_NAME("ibss_ucode"));			if (rc)				goto error;			rc = ipw_get_fw(priv, &firmware, IPW_FW_NAME("ibss"));			break;#ifdef CONFIG_IPW_MONITOR		case IW_MODE_MONITOR:			rc = ipw_get_fw(priv, &ucode,					IPW_FW_NAME("sniffer_ucode"));			if (rc)				goto error;			rc = ipw_get_fw(priv, &firmware,					IPW_FW_NAME("sniffer"));			break;#endif		case IW_MODE_INFRA:			rc = ipw_get_fw(priv, &ucode, IPW_FW_NAME("bss_ucode"));			if (rc)				goto error;			rc = ipw_get_fw(priv, &firmware, IPW_FW_NAME("bss"));			break;		default:			rc = -EINVAL;		}		if (rc)			goto error;#ifdef CONFIG_PM		fw_loaded = 1;	}#endif	if (!priv->rxq)		priv->rxq = ipw_rx_queue_alloc(priv);	else		ipw_rx_queue_reset(priv, priv->rxq);	if (!priv->rxq) {		IPW_ERROR("Unable to initialize Rx queue\n");		goto error;	}      retry:	/* Ensure interrupts are disabled */	ipw_write32(priv, CX2_INTA_MASK_R, ~CX2_INTA_MASK_ALL);	priv->status &= ~STATUS_INT_ENABLED;	/* ack pending interrupts */	ipw_write32(priv, CX2_INTA_RW, CX2_INTA_MASK_ALL);	ipw_stop_nic(priv);	rc = ipw_reset_nic(priv);	if (rc) {		IPW_ERROR("Unable to reset NIC\n");		goto error;	}	ipw_zero_memory(priv, CX2_NIC_SRAM_LOWER_BOUND,			CX2_NIC_SRAM_UPPER_BOUND - CX2_NIC_SRAM_LOWER_BOUND);	/* DMA the initial boot firmware into the device */	rc = ipw_load_firmware(priv, bootfw->data + sizeof(struct fw_header),			       bootfw->size - sizeof(struct fw_header));	if (rc < 0) {		IPW_ERROR("Unable to load boot firmware\n");		goto error;	}	/* kick start the device */	ipw_start_nic(priv);	/* wait for the device to finish it's initial startup sequence */	rc = ipw_poll_bit(priv, CX2_INTA_RW,			  CX2_INTA_BIT_FW_INITIALIZATION_DONE, 500);	if (rc < 0) {		IPW_ERROR("device failed to boot initial fw image\n");		goto error;	}	IPW_DEBUG_INFO("initial device response after %dms\n", rc);	/* ack fw init done interrupt */	ipw_write32(priv, CX2_INTA_RW, CX2_INTA_BIT_FW_INITIALIZATION_DONE);	/* DMA the ucode into the device */	rc = ipw_load_ucode(priv, ucode->data + sizeof(struct fw_header),			    ucode->size - sizeof(struct fw_header));	if (rc < 0) {		IPW_ERROR("Unable to load ucode\n");		goto error;	}	/* stop nic */	ipw_stop_nic(priv);	/* DMA bss firmware into the device */	rc = ipw_load_firmware(priv, firmware->data +			       sizeof(struct fw_header),			       firmware->size - sizeof(struct fw_header));	if (rc < 0) {		IPW_ERROR("Unable to load firmware\n");		goto error;	}	ipw_write32(priv, IPW_EEPROM_LOAD_DISABLE, 0);	rc = ipw_queue_reset(priv);	if (rc) {		IPW_ERROR("Unable to initialize queues\n");		goto error;	}	/* Ensure interrupts are disabled */	ipw_write32(priv, CX2_INTA_MASK_R, ~CX2_INTA_MASK_ALL);	/* ack pending interrupts */	ipw_write32(priv, CX2_INTA_RW, CX2_INTA_MASK_ALL);	/* kick start the device */	ipw_start_nic(priv);	if (ipw_read32(priv, CX2_INTA_RW) & CX2_INTA_BIT_PARITY_ERROR) {		if (retries > 0) {			IPW_WARNING("Parity error.  Retrying init.\n");			retries--;			goto retry;		}		IPW_ERROR("TODO: Handle parity error -- schedule restart?\n");		rc = -EIO;		goto error;	}	/* wait for the device */	rc = ipw_poll_bit(priv, CX2_INTA_RW,			  CX2_INTA_BIT_FW_INITIALIZATION_DONE, 500);	if (rc < 0) {		IPW_ERROR("device failed to start after 500ms\n");		goto error;	}	IPW_DEBUG_INFO("device response after %dms\n", rc);	/* ack fw init done interrupt */	ipw_write32(priv, CX2_INTA_RW, CX2_INTA_BIT_FW_INITIALIZATION_DONE);	/* read eeprom data and initialize the eeprom region of sram */	priv->eeprom_delay = 1;	ipw_eeprom_init_sram(priv);	/* enable interrupts */	ipw_enable_interrupts(priv);	/* Ensure our queue has valid packets */	ipw_rx_queue_replenish(priv);	ipw_write32(priv, CX2_RX_READ_INDEX, priv->rxq->read);	/* ack pending interrupts */	ipw_write32(priv, CX2_INTA_RW, CX2_INTA_MASK_ALL);#ifndef CONFIG_PM	release_firmware(bootfw);	release_firmware(ucode);	release_firmware(firmware);#endif	return 0;      error:	if (priv->rxq) {		ipw_rx_queue_free(priv, priv->rxq);		priv->rxq = NULL;	}	ipw_tx_queue_free(priv);	if (bootfw)		release_firmware(bootfw);	if (ucode)		release_firmware(ucode);	if (firmware)		release_firmware(firmware);#ifdef CONFIG_PM	fw_loaded = 0;	bootfw = ucode = firmware = NULL;#endif	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b095c3819805f87d73d41641a53e4c070360d783/ipw2200.c/buggy/drivers/net/wireless/ipw2200.c