diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2018-08-02 07:20:56 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2018-08-02 07:20:56 +0800 |
commit | 8bca950b8a89500782148f0fcbeae14ae9ba30fd (patch) | |
tree | 027061dd050d13cac04defbf7723ade22bcdf884 /recipes-bsp/amt/lms/0003-Fix-device-file-referance-to-dev-mei0-remove-select.patch | |
parent | 12acdbe9d83dab15b364d9fab7b56b95a0a47925 (diff) | |
download | meta-intel-8bca950b8a89500782148f0fcbeae14ae9ba30fd.tar.gz |
lms8: remove
Obsolete and not being maintained anymore.
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'recipes-bsp/amt/lms/0003-Fix-device-file-referance-to-dev-mei0-remove-select.patch')
-rw-r--r-- | recipes-bsp/amt/lms/0003-Fix-device-file-referance-to-dev-mei0-remove-select.patch | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/recipes-bsp/amt/lms/0003-Fix-device-file-referance-to-dev-mei0-remove-select.patch b/recipes-bsp/amt/lms/0003-Fix-device-file-referance-to-dev-mei0-remove-select.patch deleted file mode 100644 index 433d3016..00000000 --- a/recipes-bsp/amt/lms/0003-Fix-device-file-referance-to-dev-mei0-remove-select.patch +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | Fix device file referance to /dev/mei0, remove select post write. | ||
2 | |||
3 | LMS uses /dev/mei character device which is absent on current kernel versions causing LMS fail to initialize. LMS sends messages to MEI with a post select timeout. Select timeout causes SendMessage to fail causing LMS to not to communicate properly with MEI. | ||
4 | |||
5 | Adding /dev/mei0 device file reference to check first and then /dev/mei sucessfully initializes LMS. Rely on write return length and remove select with timeout to fix communication with MEI. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Anand Vastrad <anand.vastrad@intel.com> | ||
10 | --- | ||
11 | src/mei/MEILinux.cpp | 43 +++++++------------------------------------ | ||
12 | 1 file changed, 7 insertions(+), 36 deletions(-) | ||
13 | |||
14 | diff --git a/src/mei/MEILinux.cpp b/src/mei/MEILinux.cpp | ||
15 | index 1e9d28f..6d23f54 100755 | ||
16 | --- a/src/mei/MEILinux.cpp | ||
17 | +++ b/src/mei/MEILinux.cpp | ||
18 | @@ -94,13 +94,17 @@ bool MEILinux::Init(unsigned char reqProtocolVersion) | ||
19 | Deinit(); | ||
20 | } | ||
21 | |||
22 | - _fd = open("/dev/mei", O_RDWR); | ||
23 | + _fd = open("/dev/mei0", O_RDWR); | ||
24 | |||
25 | if (_fd == -1 ) { | ||
26 | if (_verbose) { | ||
27 | - fprintf(stderr, "Error: Cannot establish a handle to the MEI driver\n"); | ||
28 | + fprintf(stderr, "Warning: Cannot establish a handle to the MEI driver mei0, retrying with mei \n"); | ||
29 | + } | ||
30 | + _fd = open("/dev/mei", O_RDWR); | ||
31 | + if (_fd == -1 ) { | ||
32 | + fprintf(stderr, "Error: Cannot establish a handle to the MEI driver mei\n"); | ||
33 | + return false; | ||
34 | } | ||
35 | - return false; | ||
36 | } | ||
37 | _initialized = true; | ||
38 | |||
39 | @@ -181,13 +185,7 @@ int MEILinux::ReceiveMessage(unsigned char *buffer, int len, unsigned long timeo | ||
40 | int MEILinux::SendMessage(const unsigned char *buffer, int len, unsigned long timeout) | ||
41 | { | ||
42 | int rv = 0; | ||
43 | - int return_length =0; | ||
44 | int error = 0; | ||
45 | - fd_set set; | ||
46 | - struct timeval tv; | ||
47 | - | ||
48 | - tv.tv_sec = timeout / 1000; | ||
49 | - tv.tv_usec =(timeout % 1000) * 1000000; | ||
50 | |||
51 | if (_verbose) { | ||
52 | fprintf(stdout, "call write length = %d\n", len); | ||
53 | @@ -198,35 +196,8 @@ int MEILinux::SendMessage(const unsigned char *buffer, int len, unsigned long ti | ||
54 | if (_verbose) { | ||
55 | fprintf(stderr,"write failed with status %d %d\n", rv, error); | ||
56 | } | ||
57 | - goto out; | ||
58 | - } | ||
59 | - | ||
60 | - return_length = rv; | ||
61 | - | ||
62 | - FD_ZERO(&set); | ||
63 | - FD_SET(_fd, &set); | ||
64 | - rv = select(_fd+1 ,&set, NULL, NULL, &tv); | ||
65 | - if (rv > 0 && FD_ISSET(_fd, &set)) { | ||
66 | - if (_verbose) { | ||
67 | - fprintf(stderr, "write success\n"); | ||
68 | - } | ||
69 | } | ||
70 | - else if (rv == 0) { | ||
71 | - if (_verbose) { | ||
72 | - fprintf(stderr, "write failed on timeout with status\n"); | ||
73 | - } | ||
74 | - goto out; | ||
75 | - } | ||
76 | - else { //rv<0 | ||
77 | - if (_verbose) { | ||
78 | - fprintf(stderr, "write failed on select with status %d\n", rv); | ||
79 | - } | ||
80 | - goto out; | ||
81 | - } | ||
82 | - | ||
83 | - rv = return_length; | ||
84 | |||
85 | -out: | ||
86 | if (rv < 0) { | ||
87 | Deinit(); | ||
88 | } | ||
89 | -- | ||
90 | 2.7.4 | ||
91 | |||