Message ID | 20090107170842.6ee4eb77@extreme |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
Stephen Hemminger <shemminger@vyatta.com> writes: > Alternatively, how about this: > > --- a/drivers/net/wan/hdlc.c 2009-01-07 17:04:52.002497019 -0800 > +++ b/drivers/net/wan/hdlc.c 2009-01-07 17:07:02.874497531 -0800 > @@ -40,8 +40,6 @@ > > static const char* version = "HDLC support module revision 1.22"; > > -static const struct header_ops hdlc_null_ops; > - > #undef DEBUG_LINK > > static struct hdlc_proto *first_proto; > @@ -100,7 +98,7 @@ static int hdlc_device_event(struct noti > if (dev_net(dev) != &init_net) > return NOTIFY_DONE; > > - if (dev->header_ops != &hdlc_null_ops) > + if (dev->priv_flags & IFF_WAN_HDLC) > return NOTIFY_DONE; /* not an HDLC device */ > > if (event != NETDEV_CHANGE) "dev->netdev_ops->start_hard_xmit != hdlc_xmit" is a dirty hack. IFF_WAN_HDLC is much cleaner though it's an additional bit consumed. Sure, I like it.
From: Krzysztof Halasa <khc@pm.waw.pl> Date: Thu, 08 Jan 2009 02:26:31 +0100 > "dev->netdev_ops->start_hard_xmit != hdlc_xmit" is a dirty hack. > IFF_WAN_HDLC is much cleaner though it's an additional bit consumed. > Sure, I like it. Ok, Stephen please formally resubmit this final version with full commit message etc.. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
>> The changes have to be applied to the 4 synclink drivers and to most >> .c files in drivers/net/wan simultaneously, perhaps it's more practical >> if I do it? Ok, I will do.
--- a/drivers/net/wan/hdlc.c 2009-01-07 17:04:52.002497019 -0800 +++ b/drivers/net/wan/hdlc.c 2009-01-07 17:07:02.874497531 -0800 @@ -40,8 +40,6 @@ static const char* version = "HDLC support module revision 1.22"; -static const struct header_ops hdlc_null_ops; - #undef DEBUG_LINK static struct hdlc_proto *first_proto; @@ -100,7 +98,7 @@ static int hdlc_device_event(struct noti if (dev_net(dev) != &init_net) return NOTIFY_DONE; - if (dev->header_ops != &hdlc_null_ops) + if (dev->priv_flags & IFF_WAN_HDLC) return NOTIFY_DONE; /* not an HDLC device */ if (event != NETDEV_CHANGE) @@ -220,12 +218,15 @@ int hdlc_ioctl(struct net_device *dev, s return -EINVAL; } +static const struct header_ops hdlc_null_ops; + static void hdlc_setup_dev(struct net_device *dev) { /* Re-init all variables changed by HDLC protocol drivers, * including ether_setup() called from hdlc_raw_eth.c. */ dev->flags = IFF_POINTOPOINT | IFF_NOARP; + dev->priv_flags = IFF_WAN_HDLC; dev->mtu = HDLC_MAX_MTU; dev->type = ARPHRD_RAWHDLC; dev->hard_header_len = 16; --- a/include/linux/if.h 2009-01-07 17:03:04.397497564 -0800 +++ b/include/linux/if.h 2009-01-07 17:07:42.499169960 -0800 @@ -66,6 +66,7 @@ #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ #define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */ +#define IFF_WAN_HDLC 0x200 /* WAN HDLC device */ #define IF_GET_IFACE 0x0001 /* for querying only */ #define IF_GET_PROTO 0x0002