]> bbs.cooldavid.org Git - jme.git/blobdiff - jme.c
drivers/net/*.c: Use static const
[jme.git] / jme.c
diff --git a/jme.c b/jme.c
index 0c7720817a5c286f9f8dbf27d0173a9be7d68554..da6ee29db7ede554d12d49972b73487f0102d5d5 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -138,7 +138,7 @@ jme_reset_phy_processor(struct jme_adapter *jme)
 
 static void
 jme_setup_wakeup_frame(struct jme_adapter *jme,
-               u32 *mask, u32 crc, int fnr)
+                      const u32 *mask, u32 crc, int fnr)
 {
        int i;
 
@@ -166,7 +166,7 @@ jme_setup_wakeup_frame(struct jme_adapter *jme,
 static inline void
 jme_reset_mac_processor(struct jme_adapter *jme)
 {
-       u32 mask[WAKEUP_FRAME_MASK_DWNR] = {0, 0, 0, 0};
+       static const u32 mask[WAKEUP_FRAME_MASK_DWNR] = {0, 0, 0, 0};
        u32 crc = 0xCDCDCDCD;
        u32 gpreg0;
        int i;
@@ -2150,21 +2150,13 @@ jme_change_mtu(struct net_device *netdev, int new_mtu)
        }
 
        if (new_mtu > 1900) {
-               netdev->features &= ~(NETIF_F_HW_CSUM |
-                               NETIF_F_TSO
-#ifdef NETIF_F_TSO6
-                               | NETIF_F_TSO6
-#endif
-                               );
+               netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+                               NETIF_F_TSO | NETIF_F_TSO6);
        } else {
                if (test_bit(JME_FLAG_TXCSUM, &jme->flags))
-                       netdev->features |= NETIF_F_HW_CSUM;
+                       netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
                if (test_bit(JME_FLAG_TSO, &jme->flags))
-                       netdev->features |= NETIF_F_TSO
-#ifdef NETIF_F_TSO6
-                               | NETIF_F_TSO6
-#endif
-                               ;
+                       netdev->features |= NETIF_F_TSO | NETIF_F_TSO6;
        }
 
        netdev->mtu = new_mtu;
@@ -2613,10 +2605,12 @@ jme_set_tx_csum(struct net_device *netdev, u32 on)
        if (on) {
                set_bit(JME_FLAG_TXCSUM, &jme->flags);
                if (netdev->mtu <= 1900)
-                       netdev->features |= NETIF_F_HW_CSUM;
+                       netdev->features |=
+                               NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
        } else {
                clear_bit(JME_FLAG_TXCSUM, &jme->flags);
-               netdev->features &= ~NETIF_F_HW_CSUM;
+               netdev->features &=
+                               ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
        }
 
        return 0;
@@ -2630,18 +2624,10 @@ jme_set_tso(struct net_device *netdev, u32 on)
        if (on) {
                set_bit(JME_FLAG_TSO, &jme->flags);
                if (netdev->mtu <= 1900)
-                       netdev->features |= NETIF_F_TSO
-#ifdef NETIF_F_TSO6
-                               | NETIF_F_TSO6
-#endif
-                               ;
+                       netdev->features |= NETIF_F_TSO | NETIF_F_TSO6;
        } else {
                clear_bit(JME_FLAG_TSO, &jme->flags);
-               netdev->features &= ~(NETIF_F_TSO
-#ifdef NETIF_F_TSO6
-                               | NETIF_F_TSO6
-#endif
-                               );
+               netdev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
        }
 
        return 0;
@@ -2949,12 +2935,11 @@ jme_init_one(struct pci_dev *pdev,
 #endif
        netdev->ethtool_ops             = &jme_ethtool_ops;
        netdev->watchdog_timeo          = TX_TIMEOUT;
-       netdev->features                =       NETIF_F_HW_CSUM |
+       netdev->features                =       NETIF_F_IP_CSUM |
+                                               NETIF_F_IPV6_CSUM |
                                                NETIF_F_SG |
                                                NETIF_F_TSO |
-#ifdef NETIF_F_TSO6
                                                NETIF_F_TSO6 |
-#endif
                                                NETIF_F_HW_VLAN_TX |
                                                NETIF_F_HW_VLAN_RX;
        if (using_dac)
@@ -3109,11 +3094,7 @@ jme_init_one(struct pci_dev *pdev,
         * Tell stack that we are not ready to work until open()
         */
        netif_carrier_off(netdev);
-       netif_stop_queue(netdev);
 
-       /*
-        * Register netdev
-        */
        rc = register_netdev(netdev);
        if (rc) {
                pr_err("Cannot register net device\n");