#define HW_POWER_DOWN_DELAY (HZ / 10) 
#define HW_POWER_DOWN_DELAY (msecs_to_jiffies(100)) 
static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv){#define HW_POWER_DOWN_DELAY (HZ / 10)	struct host_command cmd = {		.host_command = HOST_PRE_POWER_DOWN,		.host_command_sequence = 0,		.host_command_length = 0,	};	int err, i;	u32 reg;	if (!(priv->status & STATUS_RUNNING))		return 0;	priv->status |= STATUS_STOPPING;	/* We can only shut down the card if the firmware is operational.  So,	 * if we haven't reset since a fatal_error, then we can not send the	 * shutdown commands. */	if (!priv->fatal_error) {		/* First, make sure the adapter is enabled so that the PHY_OFF		 * command can shut it down */		ipw2100_enable_adapter(priv);		err = ipw2100_hw_phy_off(priv);		if (err)			printk(KERN_WARNING DRV_NAME ": Error disabling radio %d\n", err);		/*		 * If in D0-standby mode going directly to D3 may cause a		 * PCI bus violation.  Therefore we must change out of the D0		 * state.		 *		 * Sending the PREPARE_FOR_POWER_DOWN will restrict the		 * hardware from going into standby mode and will transition		 * out of D0-standy if it is already in that state.		 *		 * STATUS_PREPARE_POWER_DOWN_COMPLETE will be sent by the		 * driver upon completion.  Once received, the driver can		 * proceed to the D3 state.		 *		 * Prepare for power down command to fw.  This command would		 * take HW out of D0-standby and prepare it for D3 state.		 *		 * Currently FW does not support event notification for this		 * event. Therefore, skip waiting for it.  Just wait a fixed		 * 100ms		 */		IPW_DEBUG_HC("HOST_PRE_POWER_DOWN\n");		err = ipw2100_hw_send_command(priv, &cmd);		if (err)			printk(KERN_WARNING DRV_NAME ": "			       "%s: Power down command failed: Error %d\n",			       priv->net_dev->name, err);		else {			set_current_state(TASK_UNINTERRUPTIBLE);			schedule_timeout(HW_POWER_DOWN_DELAY);		}	}	priv->status &= ~STATUS_ENABLED;	/*	 * Set GPIO 3 writable by FW; GPIO 1 writable	 * by driver and enable clock	 */	ipw2100_hw_set_gpio(priv);	/*	 * Power down adapter.  Sequence:	 * 1. Stop master assert (RESET_REG[9]=1)	 * 2. Wait for stop master (RESET_REG[8]==1)	 * 3. S/w reset assert (RESET_REG[7] = 1)	 */	/* Stop master assert */	write_register(priv->net_dev, IPW_REG_RESET_REG,		       IPW_AUX_HOST_RESET_REG_STOP_MASTER);	/* wait stop master not more than 50 usec.	 * Otherwise return error. */	for (i = 5; i > 0; i--) {		udelay(10);		/* Check master stop bit */		read_register(priv->net_dev, IPW_REG_RESET_REG, &reg);		if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED)			break;	}	if (i == 0)		printk(KERN_WARNING DRV_NAME		       ": %s: Could now power down adapter.\n",		       priv->net_dev->name);	/* assert s/w reset */	write_register(priv->net_dev, IPW_REG_RESET_REG,		       IPW_AUX_HOST_RESET_REG_SW_RESET);	priv->status &= ~(STATUS_RUNNING | STATUS_STOPPING);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/3173c8907ffb2c64456142da3df2bd0500bd59e0/ipw2100.c/buggy/drivers/net/wireless/ipw2100.c