changeset: 95619:03ff92b26fa9 user: Larry Hastings date: Mon Apr 13 17:48:40 2015 -0400 files: Doc/library/socket.rst Doc/whatsnew/3.5.rst Misc/ACKS Misc/NEWS Modules/socketmodule.c configure configure.ac pyconfig.h.in description: Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. Patch courtesy of Joe Jevnik. diff -r d958c74ddb0c -r 03ff92b26fa9 Doc/library/socket.rst --- a/Doc/library/socket.rst Mon Apr 13 16:44:05 2015 -0500 +++ b/Doc/library/socket.rst Mon Apr 13 17:48:40 2015 -0400 @@ -279,6 +279,18 @@ .. versionadded:: 3.4 +.. data:: CAN_RAW_FD_FRAMES + + Enables CAN FD support in a CAN_RAW socket. This is disabled by default. + This allows your application to send both CAN and CAN FD frames; however, + you one must accept both CAN and CAN FD frames when reading from the socket. + + This constant is documented in the Linux documentation. + + Availability: Linux >= 3.6. + + .. versionadded:: 3.5 + .. data:: AF_RDS PF_RDS SOL_RDS diff -r d958c74ddb0c -r 03ff92b26fa9 Doc/whatsnew/3.5.rst --- a/Doc/whatsnew/3.5.rst Mon Apr 13 16:44:05 2015 -0500 +++ b/Doc/whatsnew/3.5.rst Mon Apr 13 17:48:40 2015 -0400 @@ -792,6 +792,9 @@ in Python 3.5, all old `.pyo` files from previous versions of Python are invalid regardless of this PEP. + * The :mod:`socket` module now exports the CAN_RAW_FD_FRAMES constant on linux + 3.6 and greater. + Changes in the C API -------------------- diff -r d958c74ddb0c -r 03ff92b26fa9 Misc/ACKS --- a/Misc/ACKS Mon Apr 13 16:44:05 2015 -0500 +++ b/Misc/ACKS Mon Apr 13 17:48:40 2015 -0400 @@ -664,6 +664,7 @@ Philip H. Jensen Philip Jenvey MunSic Jeong +Joe Jevnik Chris Jerdonek Jim Jewett Pedro Diaz Jimenez diff -r d958c74ddb0c -r 03ff92b26fa9 Misc/NEWS --- a/Misc/NEWS Mon Apr 13 16:44:05 2015 -0500 +++ b/Misc/NEWS Mon Apr 13 17:48:40 2015 -0400 @@ -1,4 +1,4 @@ -+++++++++++ ++++++++++++ Python News +++++++++++ @@ -9,6 +9,8 @@ Core and Builtins ----------------- +- Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. + Patch courtesy of Joe Jevnik. - Issue #23731: Implement PEP 488: removal of .pyo files. diff -r d958c74ddb0c -r 03ff92b26fa9 Modules/socketmodule.c --- a/Modules/socketmodule.c Mon Apr 13 16:44:05 2015 -0500 +++ b/Modules/socketmodule.c Mon Apr 13 17:48:40 2015 -0400 @@ -6617,6 +6617,9 @@ PyModule_AddIntMacro(m, CAN_RAW_LOOPBACK); PyModule_AddIntMacro(m, CAN_RAW_RECV_OWN_MSGS); #endif +#ifdef HAVE_LINUX_CAN_RAW_FD_FRAMES + PyModule_AddIntMacro(m, CAN_RAW_FD_FRAMES); +#endif #ifdef HAVE_LINUX_CAN_BCM_H PyModule_AddIntMacro(m, CAN_BCM); PyModule_AddIntConstant(m, "CAN_BCM_TX_SETUP", TX_SETUP); diff -r d958c74ddb0c -r 03ff92b26fa9 configure --- a/configure Mon Apr 13 16:44:05 2015 -0500 +++ b/configure Mon Apr 13 17:48:40 2015 -0400 @@ -10495,6 +10495,36 @@ fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_FD_FRAMES" >&5 +$as_echo_n "checking for CAN_RAW_FD_FRAMES... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + /* CAN_RAW_FD_FRAMES available check */ +#include +int +main () +{ +int can_raw_fd_frames = CAN_RAW_FD_FRAMES; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSX 10.5 SDK or later" >&5 $as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff -r d958c74ddb0c -r 03ff92b26fa9 configure.ac --- a/configure.ac Mon Apr 13 16:44:05 2015 -0500 +++ b/configure.ac Mon Apr 13 17:48:40 2015 -0400 @@ -2876,6 +2876,16 @@ fi fi +AC_MSG_CHECKING(for CAN_RAW_FD_FRAMES) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* CAN_RAW_FD_FRAMES available check */ +#include ]], +[[int can_raw_fd_frames = CAN_RAW_FD_FRAMES;]])],[ + AC_DEFINE(HAVE_LINUX_CAN_RAW_FD_FRAMES, 1, [Define if compiling using Linux 3.6 or later.]) + AC_MSG_RESULT(yes) +],[ + AC_MSG_RESULT(no) +]) + AC_MSG_CHECKING(for OSX 10.5 SDK or later) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[FSIORefNum fRef = 0]]) diff -r d958c74ddb0c -r 03ff92b26fa9 pyconfig.h.in --- a/pyconfig.h.in Mon Apr 13 16:44:05 2015 -0500 +++ b/pyconfig.h.in Mon Apr 13 17:48:40 2015 -0400 @@ -531,6 +531,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CAN_H +/* Define if compiling using Linux 3.6 or later. */ +#undef HAVE_LINUX_CAN_RAW_FD_FRAMES + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CAN_RAW_H