diff -urp ipw2200-1.2.2/ipw2200.c ipw2200-1.2.2-pt/ipw2200.c --- ipw2200-1.2.2/ipw2200.c 2007-07-12 14:01:17.000000000 +0800 +++ ipw2200-1.2.2-pt/ipw2200.c 2007-09-28 14:14:18.000000000 +0800 @@ -10317,19 +10317,28 @@ static void init_sys_config(struct ipw_ static int ipw_net_open(struct net_device *dev) { struct ipw_priv *priv = ieee80211_priv(dev); - IPW_DEBUG_INFO("dev->open\n"); + /* we should be verifying the device is ready to be opened */ mutex_lock(&priv->mutex); + + if (ipw_up(priv)) { + mutex_unlock(&priv->mutex); + return -EIO; + } + if (!(priv->status & STATUS_RF_KILL_MASK) && (priv->status & STATUS_ASSOCIATED)) netif_start_queue(dev); + mutex_unlock(&priv->mutex); return 0; } static int ipw_net_stop(struct net_device *dev) { - IPW_DEBUG_INFO("dev->close\n"); + struct ipw_priv *priv = ieee80211_priv(dev); + + ipw_down(priv); netif_stop_queue(dev); return 0; } @@ -11671,21 +11680,6 @@ static void ipw_bg_down(struct work_stru mutex_unlock(&priv->mutex); } -/* Called by register_netdev() */ -static int ipw_net_init(struct net_device *dev) -{ - struct ipw_priv *priv = ieee80211_priv(dev); - mutex_lock(&priv->mutex); - - if (ipw_up(priv)) { - mutex_unlock(&priv->mutex); - return -EIO; - } - - mutex_unlock(&priv->mutex); - return 0; -} - /* PCI driver stuff */ static struct pci_device_id card_ids[] = { {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2701, 0, 0, 0}, @@ -11955,7 +11949,6 @@ static int ipw_pci_probe(struct pci_dev net_dev->open = ipw_net_open; net_dev->stop = ipw_net_stop; - net_dev->init = ipw_net_init; #if WIRELESS_EXT < 18 net_dev->do_ioctl = ipw_ioctl; #endif