From b4f50d691ca525bb5ff80e2b65d41e850e85ee2a Mon Sep 17 00:00:00 2001
From: Oussama Ghorbel <oussama.ghorbel@iopsys.eu>
Date: Wed, 26 Feb 2020 15:37:06 +0100
Subject: [PATCH] update from drv_mei_cpe-1.9.3.1.tar.gz / ugw 8.4.1.50

---
 ChangeLog               |  6 ++++++
 Makefile.in             | 12 +++++------
 aclocal.m4              | 44 ++++++++++++++++++++---------------------
 compile                 |  9 +++++----
 configure               | 20 +++++++++----------
 configure.in            |  2 +-
 depcomp                 |  6 +++---
 doc/doxyconfig          |  2 +-
 install-sh              |  4 ++--
 missing                 |  6 +++---
 src/Makefile.in         |  4 ++--
 src/drv_mei_cpe_linux.c | 42 ++++++++++++++++++++++++++++-----------
 12 files changed, 92 insertions(+), 65 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ceb62e0..c23e266 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 NEXT VERSION
 
+V1.9.3.1 - 2019-12-27
+common:
+- VRX (CURTSYS-2901) Crash on performing actions within context of reboot command
+  + Added reboot notifier to Linux handling of MEI Driver
+- Allow (read-only) access to device information without any special permission
+
 V1.9.3 - 2019-05-20
 common:
 - VRX (DSLCPE_SW-1181) Switching BND->Single via WebUI results in kernel crash
diff --git a/Makefile.in b/Makefile.in
index d34d91f..386ee4c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -600,7 +600,7 @@ distdir: $(DISTFILES)
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -626,7 +626,7 @@ dist-shar: distdir
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 dist-zip: distdir
 	-rm -f $(distdir).zip
@@ -643,7 +643,7 @@ dist dist-all:
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -653,7 +653,7 @@ distcheck: dist
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
diff --git a/aclocal.m4 b/aclocal.m4
index d99276a..c002782 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -647,7 +647,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -697,7 +697,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -736,7 +736,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -765,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -812,7 +812,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -831,7 +831,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -912,7 +912,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -973,7 +973,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1001,7 +1001,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1020,7 +1020,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/compile b/compile
index a85b723..2ab71e4 100755
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -255,7 +255,8 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
-  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
     func_cl_wrapper "$@"      # Doesn't return...
     ;;
 esac
@@ -342,6 +343,6 @@ exit $ret
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/configure b/configure
index d1e74db..6c06aa0 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.in Revision: 1.21 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for IFX MEI CPE Driver 1.9.3.
+# Generated by GNU Autoconf 2.69 for IFX MEI CPE Driver 1.9.3.1.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -578,8 +578,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='IFX MEI CPE Driver'
 PACKAGE_TARNAME='drv_mei_cpe'
-PACKAGE_VERSION='1.9.3'
-PACKAGE_STRING='IFX MEI CPE Driver 1.9.3'
+PACKAGE_VERSION='1.9.3.1'
+PACKAGE_STRING='IFX MEI CPE Driver 1.9.3.1'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1362,7 +1362,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures IFX MEI CPE Driver 1.9.3 to adapt to many kinds of systems.
+\`configure' configures IFX MEI CPE Driver 1.9.3.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1428,7 +1428,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of IFX MEI CPE Driver 1.9.3:";;
+     short | recursive ) echo "Configuration of IFX MEI CPE Driver 1.9.3.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1582,7 +1582,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-IFX MEI CPE Driver configure 1.9.3
+IFX MEI CPE Driver configure 1.9.3.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1880,7 +1880,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by IFX MEI CPE Driver $as_me 1.9.3, which was
+It was created by IFX MEI CPE Driver $as_me 1.9.3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2745,7 +2745,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='drv_mei_cpe'
- VERSION='1.9.3'
+ VERSION='1.9.3.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6470,7 +6470,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by IFX MEI CPE Driver $as_me 1.9.3, which was
+This file was extended by IFX MEI CPE Driver $as_me 1.9.3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6536,7 +6536,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-IFX MEI CPE Driver config.status 1.9.3
+IFX MEI CPE Driver config.status 1.9.3.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.in b/configure.in
index 6a6aba7..6855802 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
 
 AC_REVISION($Revision: 1.21 $)
 
-AC_INIT(IFX MEI CPE Driver, 1.9.3, , drv_mei_cpe)
+AC_INIT(IFX MEI CPE Driver, 1.9.3.1, , drv_mei_cpe)
 AC_CONFIG_SRCDIR(src/Makefile.am)
 AM_INIT_AUTOMAKE([tar-pax])
 
diff --git a/depcomp b/depcomp
index fc98710..b39f98f 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -786,6 +786,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/doc/doxyconfig b/doc/doxyconfig
index e170fa1..a1f45a7 100644
--- a/doc/doxyconfig
+++ b/doc/doxyconfig
@@ -22,7 +22,7 @@ PROJECT_NAME           = "MEI CPE Driver"
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = 1.9.3
+PROJECT_NUMBER         = 1.9.3.1
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
diff --git a/install-sh b/install-sh
index 0b0fdcb..0360b79 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2016-01-11.22; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -496,6 +496,6 @@ done
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/missing b/missing
index f62bbae..c6e3795 100755
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -210,6 +210,6 @@ exit $st
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/src/Makefile.in b/src/Makefile.in
index 344293e..bdfe498 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/src/drv_mei_cpe_linux.c b/src/drv_mei_cpe_linux.c
index f54c0e3..7b26e14 100755
--- a/src/drv_mei_cpe_linux.c
+++ b/src/drv_mei_cpe_linux.c
@@ -71,6 +71,9 @@
 #include <net/sock.h>
 #endif
 
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+
 /* add MEI CPE debug/printout part */
 #include "drv_mei_cpe_dbg.h"
 
@@ -1507,7 +1510,7 @@ static irqreturn_t MEI_InterruptThreadLinux(int irq, void *dev_id)
       for (device = 0; device < MEI_MAX_SUPPORTED_DFE_INSTANCE_PER_ENTITY && !handled; ++device)
       {
          pMeiDev = pMeiXCntrlList->MeiDevice[device];
-         
+
          if(pMeiDev != IFX_NULL && pMeiDev->bHandleCallback == IFX_TRUE)
          {
             MEI_HandleCallback(pMeiDev);
@@ -1564,12 +1567,8 @@ static void MEI_GetVersionProc(struct seq_file *s)
 */
 static void MEI_GetDevInfoProc(struct seq_file *s)
 {
-   if (!capable(CAP_NET_ADMIN))
-   {
-      printk(KERN_ERR "Permission denied" MEI_DRV_CRLF);
-      return;
-   }
-
+/* Device layout information is read-only and is required by several modules
+   within system, hence it will be allowed to read without special permission */
    seq_printf(s, "MaxDeviceNumber=%d\n",MEI_DFEX_ENTITIES);
    seq_printf(s, "LinesPerDevice=%d\n",MEI_DFE_INSTANCE_PER_ENTITY);
    seq_printf(s, "ChannelsPerLine=%d\n",MEI_DEVICE_CFG_VALUE_GET(ChannelsPerLine));
@@ -2266,6 +2265,20 @@ static struct platform_driver ltq_dsl_cpe_mei_driver = {
    .remove = ltq_dsl_cpe_mei_remove,
 };
 
+static int ltq_dsl_cpe_mei_reboot_notifier(struct notifier_block *nb,
+                                           unsigned long action,
+                                           void *data)
+{
+   printk("MEI_DRV: System reboot ongoing..." MEI_DRV_CRLF);
+   MEI_driver_exit();
+   return NOTIFY_DONE;
+}
+
+static struct notifier_block ltq_dsl_cpe_mei_reboot_nb = {
+   .notifier_call = ltq_dsl_cpe_mei_reboot_notifier,
+   .priority = 1,
+};
+
 static int ltq_dsl_cpe_mei_probe(struct platform_device *pdev)
 {
    int ret;
@@ -4351,6 +4364,8 @@ static IFX_void_t MEI_DRVOS_RemoveOwnPciPlatformDevices(void)
 
 static int MEI_module_init (void)
 {
+   int ret = 0;
+
    printk(KERN_INFO "%s, (c) 2007-2016 Lantiq Deutschland GmbH\n", &MEI_WHATVERSION[4]);
 
 #ifdef CONFIG_DEVFS_FS
@@ -4391,15 +4406,20 @@ static int MEI_module_init (void)
    MEI_DEVICE_CFG_VALUE_SET(ChannelsPerLine, 1);
    MEI_DEVICE_CFG_VALUE_SET(DfeChanDevices, dev_registered);
 
-   return platform_driver_register(&ltq_dsl_cpe_mei_driver);
+   ret = platform_driver_register(&ltq_dsl_cpe_mei_driver);
+
+   register_reboot_notifier(&ltq_dsl_cpe_mei_reboot_nb);
+
+   return ret;
 }
 
 
 static void MEI_module_exit(void)
 {
-    MEI_driver_exit();
-    platform_driver_unregister(&ltq_dsl_cpe_mei_driver);
-    MEI_DRVOS_RemoveOwnPciPlatformDevices();
+   unregister_reboot_notifier(&ltq_dsl_cpe_mei_reboot_nb);
+   MEI_driver_exit();
+   platform_driver_unregister(&ltq_dsl_cpe_mei_driver);
+   MEI_DRVOS_RemoveOwnPciPlatformDevices();
 }
 
 
-- 
GitLab