prism54: convert to internal net_device_stats
[pandora-kernel.git] / drivers / net / wireless / prism54 / islpci_dev.c
index 04c2638..166ed95 100644 (file)
@@ -43,7 +43,6 @@
 
 static int prism54_bring_down(islpci_private *);
 static int islpci_alloc_memory(islpci_private *);
-static struct net_device_stats *islpci_statistics(struct net_device *);
 
 /* Temporary dummy MAC address to use until firmware is loaded.
  * The idea there is that some tools (such as nameif) may query
@@ -388,8 +387,15 @@ islpci_open(struct net_device *ndev)
 
        netif_start_queue(ndev);
 
-       /* Turn off carrier unless we know we have associated */
-       netif_carrier_off(ndev);
+       /* Turn off carrier if in STA or Ad-hoc mode. It will be turned on
+        * once the firmware receives a trap of being associated
+        * (GEN_OID_LINKSTATE). In other modes (AP or WDS or monitor) we
+        * should just leave the carrier on as its expected the firmware
+        * won't send us a trigger. */
+       if (priv->iw_mode == IW_MODE_INFRA || priv->iw_mode == IW_MODE_ADHOC)
+               netif_carrier_off(ndev);
+       else
+               netif_carrier_on(ndev);
 
        return 0;
 }
@@ -607,18 +613,6 @@ islpci_reset(islpci_private *priv, int reload_firmware)
        return rc;
 }
 
-static struct net_device_stats *
-islpci_statistics(struct net_device *ndev)
-{
-       islpci_private *priv = netdev_priv(ndev);
-
-#if VERBOSE > SHOW_ERROR_MESSAGES
-       DEBUG(SHOW_FUNCTION_CALLS, "islpci_statistics\n");
-#endif
-
-       return &priv->statistics;
-}
-
 /******************************************************************************
     Network device configuration functions
 ******************************************************************************/
@@ -797,10 +791,22 @@ static void islpci_ethtool_get_drvinfo(struct net_device *dev,
        strcpy(info->version, DRV_VERSION);
 }
 
-static struct ethtool_ops islpci_ethtool_ops = {
+static const struct ethtool_ops islpci_ethtool_ops = {
        .get_drvinfo = islpci_ethtool_get_drvinfo,
 };
 
+static const struct net_device_ops islpci_netdev_ops = {
+       .ndo_open               = islpci_open,
+       .ndo_stop               = islpci_close,
+       .ndo_do_ioctl           = prism54_ioctl,
+       .ndo_start_xmit         = islpci_eth_transmit,
+       .ndo_tx_timeout         = islpci_eth_tx_timeout,
+       .ndo_set_mac_address    = prism54_set_mac_address,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 struct net_device *
 islpci_setup(struct pci_dev *pdev)
 {
@@ -820,25 +826,16 @@ islpci_setup(struct pci_dev *pdev)
        ndev->irq = pdev->irq;
 
        /* initialize the function pointers */
-       ndev->open = &islpci_open;
-       ndev->stop = &islpci_close;
-       ndev->get_stats = &islpci_statistics;
-       ndev->do_ioctl = &prism54_ioctl;
-       ndev->wireless_handlers =
-           (struct iw_handler_def *) &prism54_handler_def;
+       ndev->netdev_ops = &islpci_netdev_ops;
+       ndev->wireless_handlers = &prism54_handler_def;
        ndev->ethtool_ops = &islpci_ethtool_ops;
 
-       ndev->hard_start_xmit = &islpci_eth_transmit;
        /* ndev->set_multicast_list = &islpci_set_multicast_list; */
        ndev->addr_len = ETH_ALEN;
-       ndev->set_mac_address = &prism54_set_mac_address;
        /* Get a non-zero dummy MAC address for nameif. Jean II */
        memcpy(ndev->dev_addr, dummy_mac, 6);
 
-#ifdef HAVE_TX_TIMEOUT
        ndev->watchdog_timeo = ISLPCI_TX_TIMEOUT;
-       ndev->tx_timeout = &islpci_eth_tx_timeout;
-#endif
 
        /* allocate a private device structure to the network device  */
        priv = netdev_priv(ndev);