[Define if your kernel has the $1 function])])
])
+dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes])
+AC_DEFUN([AC_CHECK_LINUX_STRUCT],
+ [AS_VAR_PUSHDEF([ac_linux_struct], [ac_cv_linux_struct_$1_has_$2])dnl
+ AC_CACHE_CHECK([for $2 in struct $1], [ac_linux_struct],
+ [AC_TRY_KBUILD([#include <linux/$3>],
+ [struct $1 _test; printk("%x\n", &_test.$2); ],
+ AS_VAR_SET([ac_linux_struct], [yes]),
+ AS_VAR_SET([ac_linux_struct], [no]))
+ ])
+ AS_IF([test AS_VAR_GET([ac_linux_struct]) = yes],
+ [AC_DEFINE(AS_TR_CPP(STRUCT_$1_HAS_$2), 1,
+ [Define if kernel struct $1 has the $2 element])])
+ ])
+