Package: zaptel-source Version: 1:1.4.11~dfsg-3 In 2.6.29 net_device does not have the ->priv member anymore. This is a simple patch to "have" a priv* member in the priv part of the net_device struct. It's done like this: - chan->netdev->priv = chan; + ((struct hfc_chan_duplex **)netdev_priv(chan->netdev))[0] = chan; So: we allocate a priv section with the size of a *, and hence get the same functionality back.
Tags: patch -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in email?
Only in modules-2.6.29/zaptel/kernel/vzaphfc/: modules.order diff -ru modules/zaptel/kernel/vzaphfc/vzaphfc_main.c modules-2.6.29/zaptel/kernel/vzaphfc/vzaphfc_main.c --- modules/zaptel/kernel/vzaphfc/vzaphfc_main.c 2008-12-03 10:20:16.000000000 +0000 +++ modules-2.6.29/zaptel/kernel/vzaphfc/vzaphfc_main.c 2009-04-01 17:07:08.000000000 +0000 @@ -566,7 +566,7 @@ static int hfc_open(struct net_device *netdev) { - struct hfc_chan_duplex *chan = netdev->priv; + struct hfc_chan_duplex *chan = ((struct hfc_chan_duplex **)netdev_priv(netdev))[0]; struct hfc_card *card = chan->card; spin_lock(&chan->lock); @@ -593,7 +593,7 @@ static int hfc_close(struct net_device *netdev) { - struct hfc_chan_duplex *chan = netdev->priv; + struct hfc_chan_duplex *chan = ((struct hfc_chan_duplex **)netdev_priv(netdev))[0]; struct hfc_card *card = chan->card; spin_lock(&chan->lock); @@ -619,7 +619,7 @@ static int hfc_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { - struct hfc_chan_duplex *chan = netdev->priv; + struct hfc_chan_duplex *chan = ((struct hfc_chan_duplex **)netdev_priv(netdev))[0]; struct hfc_card *card = chan->card; netdev->trans_start = jiffies; @@ -637,7 +637,7 @@ static struct net_device_stats *hfc_get_stats(struct net_device *netdev) { - struct hfc_chan_duplex *chan = netdev->priv; + struct hfc_chan_duplex *chan = ((struct hfc_chan_duplex **)netdev_priv(netdev))[0]; // struct hfc_card *card = chan->card; return &chan->net_device_stats; @@ -645,7 +645,7 @@ static void hfc_set_multicast_list(struct net_device *netdev) { - struct hfc_chan_duplex *chan = netdev->priv; + struct hfc_chan_duplex *chan = ((struct hfc_chan_duplex **)netdev_priv(netdev))[0]; struct hfc_card *card = chan->card; spin_lock(&card->lock); @@ -1571,7 +1571,7 @@ static void hfc_setup_lapd(struct hfc_chan_duplex *chan) { - chan->netdev->priv = chan; + ((struct hfc_chan_duplex **)netdev_priv(chan->netdev))[0] = chan; chan->netdev->open = hfc_open; chan->netdev->stop = hfc_close; chan->netdev->hard_start_xmit = hfc_xmit_frame; @@ -1734,7 +1734,7 @@ card->chans[D].tx.fifo_size = card->chans[D].tx.z_max - card->chans[D].tx.z_min + 1; card->chans[D].tx.f_num = card->chans[D].tx.f_max - card->chans[D].tx.f_min + 1; - if(!(card->chans[D].netdev = alloc_netdev(0, "isdn%dd", setup_lapd))) { + if(!(card->chans[D].netdev = alloc_netdev(sizeof(struct hfc_chan_duplex *), "isdn%dd", setup_lapd))) { printk(KERN_ERR hfc_DRIVER_PREFIX "net_device alloc failed, abort.\n"); err = -ENOMEM;