File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -279,6 +279,18 @@ Constants
279279
280280 .. versionadded :: 3.4
281281
282+ .. data :: CAN_RAW_FD_FRAMES
283+
284+ Enables CAN FD support in a CAN_RAW socket. This is disabled by default.
285+ This allows your application to send both CAN and CAN FD frames; however,
286+ you one must accept both CAN and CAN FD frames when reading from the socket.
287+
288+ This constant is documented in the Linux documentation.
289+
290+ Availability: Linux >= 3.6.
291+
292+ .. versionadded :: 3.5
293+
282294.. data :: AF_RDS
283295 PF_RDS
284296 SOL_RDS
Original file line number Diff line number Diff line change @@ -792,6 +792,9 @@ Changes in the Python API
792792 in Python 3.5, all old `.pyo ` files from previous versions of Python are
793793 invalid regardless of this PEP.
794794
795+ * The :mod: `socket ` module now exports the CAN_RAW_FD_FRAMES constant on linux
796+ 3.6 and greater.
797+
795798Changes in the C API
796799--------------------
797800
Original file line number Diff line number Diff line change @@ -664,6 +664,7 @@ Flemming Kjær Jensen
664664Philip H. Jensen
665665Philip Jenvey
666666MunSic Jeong
667+ Joe Jevnik
667668Chris Jerdonek
668669Jim Jewett
669670Pedro Diaz Jimenez
Original file line number Diff line number Diff line change 1- +++++++++++
1+ +++++++++++
22Python News
33+++++++++++
44
@@ -9,6 +9,8 @@ Release date: XXX
99
1010Core and Builtins
1111-----------------
12+ - Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES.
13+ Patch courtesy of Joe Jevnik.
1214
1315- Issue #23731: Implement PEP 488: removal of .pyo files.
1416
Original file line number Diff line number Diff line change @@ -6617,6 +6617,9 @@ PyInit__socket(void)
66176617 PyModule_AddIntMacro (m , CAN_RAW_LOOPBACK );
66186618 PyModule_AddIntMacro (m , CAN_RAW_RECV_OWN_MSGS );
66196619#endif
6620+ #ifdef HAVE_LINUX_CAN_RAW_FD_FRAMES
6621+ PyModule_AddIntMacro (m , CAN_RAW_FD_FRAMES );
6622+ #endif
66206623#ifdef HAVE_LINUX_CAN_BCM_H
66216624 PyModule_AddIntMacro (m , CAN_BCM );
66226625 PyModule_AddIntConstant (m , "CAN_BCM_TX_SETUP" , TX_SETUP );
Original file line number Diff line number Diff line change @@ -10495,6 +10495,36 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
1049510495 fi
1049610496fi
1049710497
10498+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking for CAN_RAW_FD_FRAMES" >&5
10499+ $as_echo_n " checking for CAN_RAW_FD_FRAMES... " >&6 ; }
10500+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
10501+ /* end confdefs.h. */
10502+ /* CAN_RAW_FD_FRAMES available check */
10503+ #include <linux/can/raw.h>
10504+ int
10505+ main ()
10506+ {
10507+ int can_raw_fd_frames = CAN_RAW_FD_FRAMES;
10508+ ;
10509+ return 0;
10510+ }
10511+ _ACEOF
10512+ if ac_fn_c_try_compile " $LINENO " ; then :
10513+
10514+
10515+ $as_echo " #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1" >> confdefs.h
10516+
10517+ { $as_echo " $as_me :${as_lineno-$LINENO } : result: yes" >&5
10518+ $as_echo " yes" >&6 ; }
10519+
10520+ else
10521+
10522+ { $as_echo " $as_me :${as_lineno-$LINENO } : result: no" >&5
10523+ $as_echo " no" >&6 ; }
10524+
10525+ fi
10526+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10527+
1049810528{ $as_echo " $as_me :${as_lineno-$LINENO } : checking for OSX 10.5 SDK or later" >&5
1049910529$as_echo_n " checking for OSX 10.5 SDK or later... " >&6 ; }
1050010530cat confdefs.h - << _ACEOF >conftest.$ac_ext
Original file line number Diff line number Diff line change @@ -2876,6 +2876,16 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
28762876 fi
28772877fi
28782878
2879+ AC_MSG_CHECKING ( for CAN_RAW_FD_FRAMES )
2880+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ /* CAN_RAW_FD_FRAMES available check */
2881+ #include <linux/can/raw.h>] ] ,
2882+ [ [ int can_raw_fd_frames = CAN_RAW_FD_FRAMES;] ] ) ] ,[
2883+ AC_DEFINE ( HAVE_LINUX_CAN_RAW_FD_FRAMES , 1 , [ Define if compiling using Linux 3.6 or later.] )
2884+ AC_MSG_RESULT ( yes )
2885+ ] ,[
2886+ AC_MSG_RESULT ( no )
2887+ ] )
2888+
28792889AC_MSG_CHECKING ( for OSX 10.5 SDK or later )
28802890AC_COMPILE_IFELSE ( [
28812891 AC_LANG_PROGRAM ( [ [ #include <Carbon/Carbon.h>] ] , [ [ FSIORefNum fRef = 0] ] )
Original file line number Diff line number Diff line change 531531/* Define to 1 if you have the <linux/can.h> header file. */
532532#undef HAVE_LINUX_CAN_H
533533
534+ /* Define if compiling using Linux 3.6 or later. */
535+ #undef HAVE_LINUX_CAN_RAW_FD_FRAMES
536+
534537/* Define to 1 if you have the <linux/can/raw.h> header file. */
535538#undef HAVE_LINUX_CAN_RAW_H
536539
You can’t perform that action at this time.
0 commit comments