diag: Fix incorrect parsing of log codes

DIAG maintains mask info in a buffer. This buffer is parsed
using a structure. Recently this structure was modified to add
another member. Now, the parsing code has to change to account
for this new member, otherwise, the parsing is incorrect and
misses certain log codes.

Also updated log codes with the latest on modem.

Change-Id: Iaaf86e4f3342fd73898eb11124b4893ec79aa564
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
diff --git a/drivers/char/diag/diagchar.h b/drivers/char/diag/diagchar.h
index 228c77f..cd32152 100644
--- a/drivers/char/diag/diagchar.h
+++ b/drivers/char/diag/diagchar.h
@@ -50,7 +50,7 @@
 #define EVENT_MASK_SIZE 1000
 #define USER_SPACE_DATA 8000
 #define PKT_SIZE 4096
-#define MAX_EQUIP_ID 12
+#define MAX_EQUIP_ID 15
 #define DIAG_CTRL_MSG_LOG_MASK	9
 #define DIAG_CTRL_MSG_EVENT_MASK	10
 #define DIAG_CTRL_MSG_F3_MASK	11
diff --git a/drivers/char/diag/diagfwd.c b/drivers/char/diag/diagfwd.c
index f16aa0c..4cf6d33 100644
--- a/drivers/char/diag/diagfwd.c
+++ b/drivers/char/diag/diagfwd.c
@@ -522,7 +522,7 @@
 	uint8_t *temp = buf;
 	int i = 0;
 	unsigned char *ptr_data;
-	int offset = 8*MAX_EQUIP_ID;
+	int offset = (sizeof(struct mask_info))*MAX_EQUIP_ID;
 	struct mask_info *ptr = (struct mask_info *)driver->log_masks;
 
 	mutex_lock(&driver->diagchar_mutex);
@@ -661,9 +661,10 @@
 	void *buf = driver->buf_log_mask_update;
 	int header_size = sizeof(struct diag_ctrl_log_mask);
 	struct mask_info *ptr = (struct mask_info *)driver->log_masks;
-	int i, size = (driver->log_mask->num_items+7)/8;
+	int i, size;
 
 	for (i = 0; i < MAX_EQUIP_ID; i++) {
+		size = (ptr->num_items+7)/8;
 		/* reached null entry */
 		if ((ptr->equip_id == 0) && (ptr->index == 0))
 			break;
@@ -1608,7 +1609,7 @@
 	if (driver->log_masks == NULL &&
 	    (driver->log_masks = kzalloc(LOG_MASK_SIZE, GFP_KERNEL)) == NULL)
 		goto err;
-	driver->log_masks_length = 8*MAX_EQUIP_ID;
+	driver->log_masks_length = (sizeof(struct mask_info))*MAX_EQUIP_ID;
 	if (driver->event_masks == NULL &&
 	    (driver->event_masks = kzalloc(EVENT_MASK_SIZE,
 					    GFP_KERNEL)) == NULL)
diff --git a/include/linux/diagchar.h b/include/linux/diagchar.h
index 5d3a6a1..15737d6 100644
--- a/include/linux/diagchar.h
+++ b/include/linux/diagchar.h
@@ -679,7 +679,7 @@
 /* LOG CODES */
 
 #define LOG_0	0x0
-#define LOG_1	0x1520
+#define LOG_1	0x15A7
 #define LOG_2	0x0
 #define LOG_3	0x0
 #define LOG_4	0x4910