static int can_set_drv_name(void);
int set_reset_mode(struct net_device *dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+static struct net_device_stats *can_get_stats(struct net_device *dev)
+{
+ struct can_priv *priv = netdev_priv(dev);
+
+ /* TODO: read statistics from chip */
+ return &priv->stats;
+}
+#endif
+
static int sja1000_probe_chip(unsigned long base)
{
if (base && (hw_readreg(base, 0) == 0xFF)) {
static int can_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct can_priv *priv = netdev_priv(dev);
- struct net_device_stats *stats = dev->get_stats(dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+ struct net_device_stats *stats = can_get_stats(dev);
+#else
+ struct net_device_stats *stats = &dev->stats;
+#endif
struct can_frame *cf = (struct can_frame*)skb->data;
unsigned long base = dev->base_addr;
uint8_t fi;
static void can_tx_timeout(struct net_device *dev)
{
struct can_priv *priv = netdev_priv(dev);
- struct net_device_stats *stats = dev->get_stats(dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+ struct net_device_stats *stats = can_get_stats(dev);
+#else
+ struct net_device_stats *stats = &dev->stats;
+#endif
stats->tx_errors++;
static void can_rx(struct net_device *dev)
{
- struct net_device_stats *stats = dev->get_stats(dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+ struct net_device_stats *stats = can_get_stats(dev);
+#else
+ struct net_device_stats *stats = &dev->stats;
+#endif
unsigned long base = dev->base_addr;
struct can_frame *cf;
struct sk_buff *skb;
stats->rx_bytes += dlc;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
-static struct net_device_stats *can_get_stats(struct net_device *dev)
-{
- struct can_priv *priv = netdev_priv(dev);
-
- /* TODO: read statistics from chip */
- return &priv->stats;
-}
-#endif
-
/*
* SJA1000 interrupt handler
*/
{
struct net_device *dev = (struct net_device*)dev_id;
struct can_priv *priv = netdev_priv(dev);
- struct net_device_stats *stats = dev->get_stats(dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+ struct net_device_stats *stats = can_get_stats(dev);
+#else
+ struct net_device_stats *stats = &dev->stats;
+#endif
unsigned long base = dev->base_addr;
uint8_t isrc, status, ecc, alc;
int n = 0;