--- dahdi-linux-2.3.0.1-orig/drivers/dahdi/dahdi-base.c 2010-04-20 01:42:53.000000000 +0600 +++ dahdi-linux-2.3.0.1/drivers/dahdi/dahdi-base.c 2010-08-18 14:40:45.000000000 +0600 @@ -1609,6 +1609,13 @@ #endif #ifdef CONFIG_DAHDI_NET +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) +static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) +{ + return &dev->stats; +} +#endif + #ifdef NEW_HDLC_INTERFACE static int dahdi_net_open(struct net_device *dev) { @@ -4057,6 +4064,15 @@ #endif } +#if defined(CONFIG_DAHDI_NET) && defined(HAVE_NET_DEVICE_OPS) +static const struct net_device_ops dahdi_netdev_ops = { + .ndo_open = dahdi_net_open, + .ndo_stop = dahdi_net_stop, + .ndo_do_ioctl = dahdi_net_ioctl, + .ndo_start_xmit = dahdi_xmit, +}; +#endif + static int dahdi_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long data) { /* I/O CTL's for control interface */ @@ -4309,9 +4325,13 @@ #endif chans[ch.chan]->hdlcnetdev->netdev->irq = chans[ch.chan]->span->irq; chans[ch.chan]->hdlcnetdev->netdev->tx_queue_len = 50; +#ifdef HAVE_NET_DEVICE_OPS + chans[ch.chan]->hdlcnetdev->netdev->netdev_ops = &dahdi_netdev_ops; +#else chans[ch.chan]->hdlcnetdev->netdev->do_ioctl = dahdi_net_ioctl; chans[ch.chan]->hdlcnetdev->netdev->open = dahdi_net_open; chans[ch.chan]->hdlcnetdev->netdev->stop = dahdi_net_stop; +#endif dev_to_hdlc(chans[ch.chan]->hdlcnetdev->netdev)->attach = dahdi_net_attach; dev_to_hdlc(chans[ch.chan]->hdlcnetdev->netdev)->xmit = dahdi_xmit; spin_unlock_irqrestore(&chans[ch.chan]->lock, flags); @@ -7560,8 +7580,11 @@ #ifdef CONFIG_DAHDI_PPP if (!ms->do_ppp_error) #endif - skb = dev_alloc_skb(ms->readn[ms->inreadbuf]); + skb = dev_alloc_skb(ms->readn[ms->inreadbuf] + 2); if (skb) { + unsigned char cisco_addr = *(ms->readbuf[ms->inreadbuf]); + if (cisco_addr != 0x0f && cisco_addr != 0x8f) + skb_reserve(skb, 2); /* XXX Get rid of this memcpy XXX */ memcpy(skb->data, ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf]); skb_put(skb, ms->readn[ms->inreadbuf]);