VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / net / pcmcia / pcnet_cs.c
index d073093..2db4baa 100644 (file)
@@ -326,6 +326,9 @@ static void pcnet_detach(dev_link_t *link)
     if (*linkp == NULL)
        return;
 
+    if (link->dev)
+       unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
        pcnet_release(link);
 
@@ -334,8 +337,6 @@ static void pcnet_detach(dev_link_t *link)
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev)
-       unregister_netdev(dev);
     free_netdev(dev);
 } /* pcnet_detach */
 
@@ -806,10 +807,8 @@ static int pcnet_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
        link->state &= ~DEV_PRESENT;
-       if (link->state & DEV_CONFIG) {
+       if (link->state & DEV_CONFIG)
            netif_device_detach(dev);
-           pcnet_release(link);
-       }
        break;
     case CS_EVENT_CARD_INSERTION:
        link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -1281,7 +1280,7 @@ static struct ethtool_ops netdev_ethtool_ops = {
 static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
     pcnet_dev_t *info = PRIV(dev);
-    u16 *data = (u16 *)&rq->ifr_data;
+    u16 *data = (u16 *)&rq->ifr_ifru;
     ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
     switch (cmd) {
     case SIOCGMIIPHY: