From eaf8971e7abee6b259a0cb74af94d09eb46d9919 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Thu, 10 Dec 2009 15:53:03 -0800 Subject: [PATCH] Move bluetooth netdev ops backport changes to compat/patches/01-netdev.patch compat/patches/01-netdev.patch already provides all the other netdev op changes so keep adding more of them there. Each compat/patches/*.patch file should be kept as separate as possible to be able to make that stuff comprehensible. Signed-off-by: Luis R. Rodriguez --- compat/patches/01-netdev.patch | 62 +++++++++++++++++++++++++++++++ compat/patches/16-bluetooth.patch | 62 ------------------------------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/compat/patches/01-netdev.patch b/compat/patches/01-netdev.patch index 93f9439c9184..40a265821f7a 100644 --- a/compat/patches/01-netdev.patch +++ b/compat/patches/01-netdev.patch @@ -549,3 +549,65 @@ without creating a headache on maintenance of the pathes. dev->destructor = free_netdev; ether_setup(dev); dev->tx_queue_len = 0; +diff -Nur a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c +--- a/net/bluetooth/bnep/netdev.c 2009-11-25 11:24:43.000000000 +0530 ++++ b/net/bluetooth/bnep/netdev.c 2009-11-27 19:35:33.000000000 +0530 +@@ -165,8 +165,12 @@ + } + #endif + +-static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, +- struct net_device *dev) ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) ++static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) ++#else ++static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) ++#endif ++ + { + struct bnep_session *s = netdev_priv(dev); + struct sock *sk = s->sock->sk; +@@ -207,6 +211,7 @@ + return NETDEV_TX_OK; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)) + static const struct net_device_ops bnep_netdev_ops = { + .ndo_open = bnep_net_open, + .ndo_stop = bnep_net_close, +@@ -218,6 +223,16 @@ + .ndo_change_mtu = eth_change_mtu, + + }; ++#else ++static struct net_device_stats *bnep_net_get_stats(struct net_device *dev) ++{ ++ return &dev->stats; ++} ++static int bnep_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ++{ ++ return -EINVAL; ++} ++#endif + + void bnep_net_setup(struct net_device *dev) + { +@@ -226,7 +241,18 @@ + dev->addr_len = ETH_ALEN; + + ether_setup(dev); ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)) + dev->netdev_ops = &bnep_netdev_ops; ++#else ++ dev->open = bnep_net_open; ++ dev->stop = bnep_net_close; ++ dev->hard_start_xmit = bnep_net_xmit; ++ dev->get_stats = bnep_net_get_stats; ++ dev->do_ioctl = bnep_net_ioctl; ++ dev->set_mac_address = bnep_net_set_mac_addr; ++ dev->set_multicast_list = bnep_net_set_mc_list; ++ dev->tx_timeout = bnep_net_timeout; ++#endif + + dev->watchdog_timeo = HZ * 2; + } diff --git a/compat/patches/16-bluetooth.patch b/compat/patches/16-bluetooth.patch index f2f6e785f31b..8a739ab7ecf4 100644 --- a/compat/patches/16-bluetooth.patch +++ b/compat/patches/16-bluetooth.patch @@ -55,68 +55,6 @@ diff -Nur a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) { -diff -Nur a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c ---- a/net/bluetooth/bnep/netdev.c 2009-11-25 11:24:43.000000000 +0530 -+++ b/net/bluetooth/bnep/netdev.c 2009-11-27 19:35:33.000000000 +0530 -@@ -165,8 +165,12 @@ - } - #endif - --static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, -- struct net_device *dev) -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) -+static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) -+#else -+static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) -+#endif -+ - { - struct bnep_session *s = netdev_priv(dev); - struct sock *sk = s->sock->sk; -@@ -207,6 +211,7 @@ - return NETDEV_TX_OK; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)) - static const struct net_device_ops bnep_netdev_ops = { - .ndo_open = bnep_net_open, - .ndo_stop = bnep_net_close, -@@ -218,6 +223,16 @@ - .ndo_change_mtu = eth_change_mtu, - - }; -+#else -+static struct net_device_stats *bnep_net_get_stats(struct net_device *dev) -+{ -+ return &dev->stats; -+} -+static int bnep_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) -+{ -+ return -EINVAL; -+} -+#endif - - void bnep_net_setup(struct net_device *dev) - { -@@ -226,7 +241,18 @@ - dev->addr_len = ETH_ALEN; - - ether_setup(dev); -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)) - dev->netdev_ops = &bnep_netdev_ops; -+#else -+ dev->open = bnep_net_open; -+ dev->stop = bnep_net_close; -+ dev->hard_start_xmit = bnep_net_xmit; -+ dev->get_stats = bnep_net_get_stats; -+ dev->do_ioctl = bnep_net_ioctl; -+ dev->set_mac_address = bnep_net_set_mac_addr; -+ dev->set_multicast_list = bnep_net_set_mc_list; -+ dev->tx_timeout = bnep_net_timeout; -+#endif - - dev->watchdog_timeo = HZ * 2; - } diff -Nur a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c --- a/net/bluetooth/cmtp/capi.c 2009-11-25 11:24:43.000000000 +0530 +++ b/net/bluetooth/cmtp/capi.c 2009-11-26 16:43:42.000000000 +0530 -- 2.30.2