From: Luis R. Rodriguez Date: Fri, 6 Apr 2012 21:50:16 +0000 (-0700) Subject: compat-wireless: backport get_ts_info support X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d4f2f52fa77fdf679c7b0c100f06b9bbe27fcca1;p=openwrt%2Fstaging%2Fblogic.git compat-wireless: backport get_ts_info support Linux 3.5 will have get_ts_info to support the Precision Time Protocol. http://linuxptp.sourceforge.net/ http://en.wikipedia.org/wiki/Precision_Time_Protocol We cannot backport this support given that this introduces a data structure change on the ethtool_ops. commit c8f3a8c31069137fe0100e6920558f1a7487ef3c Author: Richard Cochran Date: Tue Apr 3 22:59:17 2012 +0000 ethtool: Introduce a method for getting time stamping capabilities. This commit adds a new ethtool ioctl that exposes the SO_TIMESTAMPING capabilities of a network interface. In addition, user space programs can use this ioctl to discover the PTP Hardware Clock (PHC) device associated with the interface. Since software receive time stamps are handled by the stack, the generic ethtool code can answer the query correctly in case the MAC or PHY drivers lack special time stamping features. Signed-off-by: Richard Cochran Reviewed-by: Ben Hutchings Signed-off-by: David S. Miller mcgrof@flash ~/devel/compat-wireless (git::master)$ time ckmake; time ckmake Trying kernel 3.2.2-030202-generic [OK] Trying kernel 3.1.10-030110-generic [OK] Trying kernel 3.0.18-030018-generic [OK] Trying kernel 2.6.39-02063904-generic [OK] Trying kernel 2.6.38-02063808-generic [OK] Trying kernel 2.6.37-02063706-generic [OK] Trying kernel 2.6.36-02063604-generic [OK] Trying kernel 2.6.35-02063512-generic [OK] Trying kernel 2.6.34-02063410-generic [OK] Trying kernel 2.6.33-02063305-generic [OK] Trying kernel 2.6.32-02063255-generic [OK] Trying kernel 2.6.31-02063113-generic [OK] Trying kernel 2.6.30-02063010-generic [OK] Trying kernel 2.6.29-02062906-generic [OK] Trying kernel 2.6.28-02062810-generic [OK] Trying kernel 2.6.27-020627-generic [OK] Trying kernel 2.6.26-020626-generic [OK] Trying kernel 2.6.25-020625-generic [OK] Trying kernel 2.6.24-020624-generic [OK] real 70m16.460s user 204m37.315s sys 19m56.447s real 15m35.818s user 33m10.020s sys 7m19.779s Signed-off-by: Luis R. Rodriguez --- diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch index ca5b09bc5eea..f9cb6f5ece33 100644 --- a/patches/01-netdev.patch +++ b/patches/01-netdev.patch @@ -23,7 +23,7 @@ without creating a headache on maintenance of the pathes. if (unlikely(retval < 0)) { --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c -@@ -1386,7 +1386,7 @@ usbnet_probe (struct usb_interface *udev +@@ -1387,7 +1387,7 @@ usbnet_probe (struct usb_interface *udev net->features |= NETIF_F_HIGHDMA; #endif @@ -156,7 +156,7 @@ without creating a headache on maintenance of the pathes. static struct nlmsghdr *rtnetlink_ifinfo_prep(struct net_device *dev, struct sk_buff *skb) { -@@ -596,8 +620,13 @@ void wireless_send_event(struct net_devi +@@ -597,8 +621,13 @@ void wireless_send_event(struct net_devi skb_shinfo(skb)->frag_list = compskb; #endif @@ -170,7 +170,7 @@ without creating a headache on maintenance of the pathes. } EXPORT_SYMBOL(wireless_send_event); -@@ -922,8 +951,13 @@ static int wireless_process_ioctl(struct +@@ -923,8 +952,13 @@ static int wireless_process_ioctl(struct return private(dev, iwr, cmd, info, handler); } /* Old driver API : call driver ioctl handler */ @@ -267,7 +267,7 @@ without creating a headache on maintenance of the pathes. #define LBS_DEB_LEAVE 0x00000002 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -1283,7 +1283,7 @@ static const struct net_device_ops hwsim +@@ -1289,7 +1289,7 @@ static const struct net_device_ops hwsim static void hwsim_mon_setup(struct net_device *dev) { diff --git a/patches/04-netns.patch b/patches/04-netns.patch index 7e89d7fdbb7b..8dcb922efc56 100644 --- a/patches/04-netns.patch +++ b/patches/04-netns.patch @@ -6,7 +6,7 @@ files... --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -5223,7 +5223,9 @@ static int nl80211_wiphy_netns(struct sk +@@ -5300,7 +5300,9 @@ static int nl80211_wiphy_netns(struct sk if (!net_eq(wiphy_net(&rdev->wiphy), net)) err = cfg80211_switch_netns(rdev, net); diff --git a/patches/14-device-type.patch b/patches/14-device-type.patch index 8517a2737b0d..6129c394b65e 100644 --- a/patches/14-device-type.patch +++ b/patches/14-device-type.patch @@ -36,7 +36,7 @@ compile warning. { --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c -@@ -1301,13 +1301,17 @@ static const struct net_device_ops usbne +@@ -1302,13 +1302,17 @@ static const struct net_device_ops usbne // precondition: never called in_interrupt diff --git a/patches/30-bridge-port.patch b/patches/30-bridge-port.patch index 6293157cbe5e..c9a410e7afbe 100644 --- a/patches/30-bridge-port.patch +++ b/patches/30-bridge-port.patch @@ -34,7 +34,7 @@ compat-wireless. ntype == NL80211_IFTYPE_P2P_CLIENT)) --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -1599,7 +1599,7 @@ static int nl80211_valid_4addr(struct cf +@@ -1638,7 +1638,7 @@ static int nl80211_valid_4addr(struct cf enum nl80211_iftype iftype) { if (!use_4addr) { diff --git a/patches/42-netlink_seq.patch b/patches/42-netlink_seq.patch index f43df8721774..550bdb27c6b9 100644 --- a/patches/42-netlink_seq.patch +++ b/patches/42-netlink_seq.patch @@ -1,6 +1,6 @@ --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -4226,7 +4226,9 @@ static int nl80211_dump_scan(struct sk_b +@@ -4293,7 +4293,9 @@ static int nl80211_dump_scan(struct sk_b spin_lock_bh(&rdev->bss_lock); cfg80211_bss_expire(rdev); diff --git a/patches/54-get_ts_info.patch b/patches/54-get_ts_info.patch new file mode 100644 index 000000000000..0c8cdefb7324 --- /dev/null +++ b/patches/54-get_ts_info.patch @@ -0,0 +1,39 @@ +Linux 3.5 will have get_ts_info to support the Precision Time Protocol. + +http://linuxptp.sourceforge.net/ +http://en.wikipedia.org/wiki/Precision_Time_Protocol + +We cannot backport this support given that this introduces +a data structure change on the ethtool_ops. + +commit c8f3a8c31069137fe0100e6920558f1a7487ef3c +Author: Richard Cochran +Date: Tue Apr 3 22:59:17 2012 +0000 + + ethtool: Introduce a method for getting time stamping capabilities. + + This commit adds a new ethtool ioctl that exposes the SO_TIMESTAMPING + capabilities of a network interface. In addition, user space programs + can use this ioctl to discover the PTP Hardware Clock (PHC) device + associated with the interface. + + Since software receive time stamps are handled by the stack, the generic + ethtool code can answer the query correctly in case the MAC or PHY + drivers lack special time stamping features. + + Signed-off-by: Richard Cochran + Reviewed-by: Ben Hutchings + Signed-off-by: David S. Miller + +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -884,7 +884,9 @@ static const struct ethtool_ops usbnet_e + .get_drvinfo = usbnet_get_drvinfo, + .get_msglevel = usbnet_get_msglevel, + .set_msglevel = usbnet_set_msglevel, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .get_ts_info = ethtool_op_get_ts_info, ++#endif + }; + + /*-------------------------------------------------------------------------*/