diag: Apps only polling command response when modem is up
Respond to the apps only polling command with an error
response when the modem is up.
Change-Id: Ifd9ae10a57339bf405a117cacfd987dec1875cd7
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
diff --git a/drivers/char/diag/diagfwd.c b/drivers/char/diag/diagfwd.c
index e147b0e..7ceae89 100644
--- a/drivers/char/diag/diagfwd.c
+++ b/drivers/char/diag/diagfwd.c
@@ -887,11 +887,12 @@
/* Not required, represents that command isnt sent to modem */
return 0;
}
- /* Check for ID for NO MODEM present */
- else if (!(driver->ch)) {
- /* Respond to polling for Apps only DIAG */
- if ((*buf == 0x4b) && (*(buf+1) == 0x32) &&
- (*(buf+2) == 0x03)) {
+ /* Check for polling for Apps only DIAG */
+ else if ((*buf == 0x4b) && (*(buf+1) == 0x32) &&
+ (*(buf+2) == 0x03)) {
+ /* If there is NO MODEM present */
+ if (!(driver->ch)) {
+ /* Respond to polling for Apps only DIAG */
for (i = 0; i < 3; i++)
driver->apps_rsp_buf[i] = *(buf+i);
for (i = 0; i < 13; i++)
@@ -899,9 +900,15 @@
ENCODE_RSP_AND_SEND(15);
return 0;
+ } else {
+ /* Since Modem is present, send error response */
+ return 1;
}
+ }
+ /* Check for ID for NO MODEM present */
+ else if (!(driver->ch)) {
/* respond to 0x0 command */
- else if (*buf == 0x00) {
+ if (*buf == 0x00) {
for (i = 0; i < 55; i++)
driver->apps_rsp_buf[i] = 0;