Thread (1 message) 1 message, 1 author, 2007-08-03

Re: dev->priv to netdev_priv(dev)

From: Krzysztof Halasa <khc@pm.waw.pl>
Date: 2007-08-03 23:42:50
Also in: lkml

Yoann Padioleau [off-list ref] writes:
drivers/net/wan/hdlc_fr.c               
hdlc_fr (PVC device) uses dev->priv for N:1 mappings (a single pvc
structure may be referenced as dev->priv by multiple (up to 2
currently) PVC devs).
drivers/net/wan/hdlc_ppp.c              
hdlc_ppp obviously has to do some tricks to use syncppp:
static int ppp_open(struct net_device *dev)
{
        hdlc_device *hdlc = dev_to_hdlc(dev);
        void *old_ioctl;
        int result;

        dev->priv = &state(hdlc)->syncppp_ptr;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        state(hdlc)->syncppp_ptr = &state(hdlc)->pppdev;
        state(hdlc)->pppdev.dev = dev;

        old_ioctl = dev->do_ioctl;
        state(hdlc)->old_change_mtu = dev->change_mtu;
        sppp_attach(&state(hdlc)->pppdev);

Perhaps I should remove that and make a sane interface in syncppp.
-- 
Krzysztof Halasa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help