down(&priv->sem); if (wrqu->mode == priv->ieee->iw_mode) { up(&priv->sem); return 0; } 
static int ipw_wx_set_mode(struct net_device *dev,			   struct iw_request_info *info,			   union iwreq_data *wrqu, char *extra){	struct ipw_priv *priv = ieee80211_priv(dev);	int err = 0;	IPW_DEBUG_WX("Set MODE: %d\n", wrqu->mode);	down(&priv->sem);	if (wrqu->mode == priv->ieee->iw_mode) {		up(&priv->sem);		return 0;	}	switch (wrqu->mode) {#ifdef CONFIG_IPW_MONITOR	case IW_MODE_MONITOR:#endif	case IW_MODE_ADHOC:	case IW_MODE_INFRA:		break;	case IW_MODE_AUTO:		wrqu->mode = IW_MODE_INFRA;		break;	default:		up(&priv->sem);		return -EINVAL;	}#ifdef CONFIG_IPW_MONITOR	if (priv->ieee->iw_mode == IW_MODE_MONITOR)		priv->net_dev->type = ARPHRD_ETHER;	if (wrqu->mode == IW_MODE_MONITOR)		priv->net_dev->type = ARPHRD_IEEE80211;#endif				/* CONFIG_IPW_MONITOR */#ifdef CONFIG_PM	/* Free the existing firmware and reset the fw_loaded	 * flag so ipw_load() will bring in the new firmawre */	if (fw_loaded)		fw_loaded = 0;	release_firmware(bootfw);	release_firmware(ucode);	release_firmware(firmware);	bootfw = ucode = firmware = NULL;#endif	priv->ieee->iw_mode = wrqu->mode;	queue_work(priv->workqueue, &priv->adapter_restart);	up(&priv->sem);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b095c3819805f87d73d41641a53e4c070360d783/ipw2200.c/buggy/drivers/net/wireless/ipw2200.c