#endif				/* CONFIG_IEEE80211_WPA */ 
static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,					       void __iomem * base_addr,					       unsigned long mem_start,					       unsigned long mem_len){	struct ipw2100_priv *priv;	struct net_device *dev;	dev = alloc_ieee80211(sizeof(struct ipw2100_priv));	if (!dev)		return NULL;	priv = ieee80211_priv(dev);	priv->ieee = netdev_priv(dev);	priv->pci_dev = pci_dev;	priv->net_dev = dev;	priv->ieee->hard_start_xmit = ipw2100_tx;	priv->ieee->set_security = shim__set_security;	dev->open = ipw2100_open;	dev->stop = ipw2100_close;	dev->init = ipw2100_net_init;	dev->do_ioctl = ipw2100_ioctl;	dev->get_stats = ipw2100_stats;	dev->ethtool_ops = &ipw2100_ethtool_ops;	dev->tx_timeout = ipw2100_tx_timeout;	dev->wireless_handlers = &ipw2100_wx_handler_def;	dev->get_wireless_stats = ipw2100_wx_wireless_stats;	dev->set_mac_address = ipw2100_set_address;	dev->watchdog_timeo = 3 * HZ;	dev->irq = 0;	dev->base_addr = (unsigned long)base_addr;	dev->mem_start = mem_start;	dev->mem_end = dev->mem_start + mem_len - 1;	/* NOTE: We don't use the wireless_handlers hook	 * in dev as the system will start throwing WX requests	 * to us before we're actually initialized and it just	 * ends up causing problems.  So, we just handle	 * the WX extensions through the ipw2100_ioctl interface */	/* memset() puts everything to 0, so we only have explicitely set	 * those values that need to be something else */	/* If power management is turned on, default to AUTO mode */	priv->power_mode = IPW_POWER_AUTO;#ifdef CONFIG_IEEE80211_WPA	priv->ieee->wpa_enabled = 0;	priv->ieee->tkip_countermeasures = 0;	priv->ieee->drop_unencrypted = 0;	priv->ieee->privacy_invoked = 0;	priv->ieee->ieee802_1x = 1;#endif				/* CONFIG_IEEE80211_WPA */	/* Set module parameters */	switch (mode) {	case 1:		priv->ieee->iw_mode = IW_MODE_ADHOC;		break;#ifdef CONFIG_IPW2100_MONITOR	case 2:		priv->ieee->iw_mode = IW_MODE_MONITOR;		break;#endif	default:	case 0:		priv->ieee->iw_mode = IW_MODE_INFRA;		break;	}	if (disable == 1)		priv->status |= STATUS_RF_KILL_SW;	if (channel != 0 &&	    ((channel >= REG_MIN_CHANNEL) && (channel <= REG_MAX_CHANNEL))) {		priv->config |= CFG_STATIC_CHANNEL;		priv->channel = channel;	}	if (associate)		priv->config |= CFG_ASSOCIATE;	priv->beacon_interval = DEFAULT_BEACON_INTERVAL;	priv->short_retry_limit = DEFAULT_SHORT_RETRY_LIMIT;	priv->long_retry_limit = DEFAULT_LONG_RETRY_LIMIT;	priv->rts_threshold = DEFAULT_RTS_THRESHOLD | RTS_DISABLED;	priv->frag_threshold = DEFAULT_FTS | FRAG_DISABLED;	priv->tx_power = IPW_TX_POWER_DEFAULT;	priv->tx_rates = DEFAULT_TX_RATES;	strcpy(priv->nick, "ipw2100");	spin_lock_init(&priv->low_lock);	sema_init(&priv->action_sem, 1);	sema_init(&priv->adapter_sem, 1);	init_waitqueue_head(&priv->wait_command_queue);	netif_carrier_off(dev);	INIT_LIST_HEAD(&priv->msg_free_list);	INIT_LIST_HEAD(&priv->msg_pend_list);	INIT_STAT(&priv->msg_free_stat);	INIT_STAT(&priv->msg_pend_stat);	INIT_LIST_HEAD(&priv->tx_free_list);	INIT_LIST_HEAD(&priv->tx_pend_list);	INIT_STAT(&priv->tx_free_stat);	INIT_STAT(&priv->tx_pend_stat);	INIT_LIST_HEAD(&priv->fw_pend_list);	INIT_STAT(&priv->fw_pend_stat);#ifdef CONFIG_SOFTWARE_SUSPEND2	priv->workqueue = create_workqueue(DRV_NAME, 0);#else	priv->workqueue = create_workqueue(DRV_NAME);#endif	INIT_WORK(&priv->reset_work,		  (void (*)(void *))ipw2100_reset_adapter, priv);	INIT_WORK(&priv->security_work,		  (void (*)(void *))ipw2100_security_work, priv);	INIT_WORK(&priv->wx_event_work,		  (void (*)(void *))ipw2100_wx_event_work, priv);	INIT_WORK(&priv->hang_check, ipw2100_hang_check, priv);	INIT_WORK(&priv->rf_kill, ipw2100_rf_kill, priv);	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))		     ipw2100_irq_tasklet, (unsigned long)priv);	/* NOTE:  We do not start the deferred work for status checks yet */	priv->stop_rf_kill = 1;	priv->stop_hang_check = 1;	return dev;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/823283549da144ff49e65c6e4a670b7784203e0b/ipw2100.c/buggy/drivers/net/wireless/ipw2100.c