]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
can: Handle netdev->last_rx and netdev_tx_t properly for 2.6.31
authorwolf <wolf@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 18 Sep 2009 12:01:20 +0000 (12:01 +0000)
committerwolf <wolf@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 18 Sep 2009 12:01:20 +0000 (12:01 +0000)
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1060 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/drivers/net/can/cc770/cc770.c
kernel/2.6/drivers/net/can/dev.c
kernel/2.6/drivers/net/can/ems_usb.c
kernel/2.6/drivers/net/can/esd_pci331.c
kernel/2.6/drivers/net/can/mcp251x.c
kernel/2.6/drivers/net/can/mscan/mscan.c
kernel/2.6/drivers/net/can/sja1000/sja1000.c
kernel/2.6/drivers/net/can/slcan.c
kernel/2.6/drivers/net/can/softing/softing_main.c

index 9fbc000fd355972864f6a7d39aa46d8f199e1c68..e6eee6b403b06650b3185b5e1b0aa8d5ad771a45 100644 (file)
@@ -422,7 +422,11 @@ static int cc770_set_bittiming(struct net_device *dev)
        return 0;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int cc770_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#else
+static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#endif
 {
        struct cc770_priv *priv = netdev_priv(dev);
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
@@ -557,7 +561,9 @@ static void cc770_rx(struct net_device *dev, unsigned int mo, u8 ctrl1)
        }
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 }
@@ -627,7 +633,9 @@ static int cc770_err(struct net_device *dev, u8 status)
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 
index 99dae65eaf36ad43c58ee4d8201ee3506f03fa84..cc13c968c54915f58e483d48511aa74cbc20ff3e 100644 (file)
@@ -404,7 +404,9 @@ void can_restart(unsigned long data)
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 
index c426aaee1896155d2cedf440d367ee75b0156eef..7fb9275a962152b08255552742d457b7f8f79538 100644 (file)
@@ -333,7 +333,9 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->netdev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 }
@@ -418,7 +420,9 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->netdev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 }
@@ -762,7 +766,12 @@ static int ems_usb_open(struct net_device *netdev)
        return 0;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev)
+#else
+static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb,
+                                     struct net_device *netdev)
+#endif
 {
        struct ems_usb *dev = netdev_priv(netdev);
        struct ems_tx_urb_context *context = NULL;
index 258122c9f23fe0fb14b1dc2f36d0c2af66073be5..16aac283e5ef617fbdc43f8344d88d5d81b43814 100644 (file)
@@ -458,7 +458,9 @@ static int esd331_create_err_frame(struct net_device *dev, canid_t idflags,
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 
@@ -509,7 +511,9 @@ static void esd331_irq_rx(struct net_device *dev, struct esd331_can_msg *msg,
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cfrm->can_dlc;
 }
@@ -686,7 +690,12 @@ static int esd331_close(struct net_device *dev)
        return 0;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int esd331_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#else
+static netdev_tx_t esd331_start_xmit(struct sk_buff *skb,
+                                       struct net_device *dev)
+#endif
 {
        struct esd331_priv *priv = netdev_priv(dev);
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
index bde7c53b85ae2ea970e635e1deb3d916f5f8ea76..80e1a33170bce7b7d1ea2f6ae75721dd36392fb6 100644 (file)
@@ -481,7 +481,12 @@ static void mcp251x_hw_wakeup(struct spi_device *spi)
                dev_err(&spi->dev, "MCP251x didn't wake-up\n");
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int mcp251x_hard_start_xmit(struct sk_buff *skb, struct net_device *net)
+#else
+static netdev_tx_t mcp251x_hard_start_xmit(struct sk_buff *skb,
+                       struct net_device *net)
+#endif
 {
        struct mcp251x_priv *priv = netdev_priv(net);
        struct spi_device *spi = priv->spi;
index 247d2e3f5f62af509b23edc6e2f77b04369a5c55..fa5d907b6f486cb3c44f82426f1e46ed7e7777f7 100644 (file)
@@ -224,7 +224,11 @@ static int mscan_start(struct net_device *dev)
        return 0;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#else
+static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#endif
 {
        struct can_frame *frame = (struct can_frame *)skb->data;
        struct mscan_regs *regs = (struct mscan_regs *)dev->base_addr;
@@ -399,7 +403,9 @@ static int mscan_rx_poll(struct net_device *dev, int *budget)
                        }
 
                        out_8(&regs->canrflg, MSCAN_RXF);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
                        dev->last_rx = jiffies;
+#endif
                        stats->rx_packets++;
                        stats->rx_bytes += frame->can_dlc;
                } else if (canrflg & MSCAN_ERR_IF) {
index 74bc1fad8adb21b1f3c4d6080e57842189e4bc6d..54f65e76d5061406ef45326eae6406aa4f712335 100644 (file)
@@ -242,7 +242,12 @@ static void chipset_init(struct net_device *dev)
  * xx xx xx xx  ff      ll   00 11 22 33 44 55 66 77
  * [  can-id ] [flags] [len] [can data (up to 8 bytes]
  */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int sja1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#else
+static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb,
+                                     struct net_device *dev)
+#endif
 {
        struct sja1000_priv *priv = netdev_priv(dev);
        struct can_frame *cf = (struct can_frame *)skb->data;
@@ -345,7 +350,9 @@ static void sja1000_rx(struct net_device *dev)
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += dlc;
 }
@@ -464,7 +471,9 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
 
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf->can_dlc;
 
index b29a0deae648ee9545063f1c81bbb1f393afa72b..0f1aa2dd93d0589aad4e6467fa6582ceb66d64a6 100644 (file)
@@ -301,7 +301,9 @@ static void slc_bump(struct slcan *sl)
               &cf, sizeof(struct can_frame));
        netif_rx(skb);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
        sl->dev->last_rx = jiffies;
+#endif
        stats->rx_packets++;
        stats->rx_bytes += cf.can_dlc;
 }
@@ -468,7 +470,11 @@ out:
  ******************************************/
 
 /* Send a can_frame to a TTY queue. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int slc_xmit(struct sk_buff *skb, struct net_device *dev)
+#else
+static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev)
+#endif
 {
        struct slcan *sl = netdev_priv(dev);
 
index 88fa9f56df36d0f100f7850746d4d4b52515b749..a9a45c37db267f8a7f7187a12ecbd29627c21fb8 100644 (file)
@@ -46,7 +46,12 @@ static inline int canif_is_active(struct net_device *netdev)
 }
 
 /* trigger the tx queue-ing */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 static int netdev_start_xmit(struct sk_buff *skb, struct net_device *dev)
+#else
+static netdev_tx_t netdev_start_xmit(struct sk_buff *skb,
+                       struct net_device *dev)
+#endif
 {
        struct softing_priv *priv = netdev_priv(dev);
        struct softing *card = priv->card;
@@ -330,7 +335,9 @@ static int softing_dev_svc_once(struct softing *card)
                } else {
                        ++stats->rx_packets;
                        stats->rx_bytes += msg.can_dlc;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
                        bus->netdev->last_rx = jiffies;
+#endif
                        softing_rx(bus->netdev, &msg, ktime);
                }
        }