Skip to content
This repository
Browse code

ssc: add and use page variable in ssc_mode_select

Add and use page variable in ssc_mode_select.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Mark Harvey <markh794@gmail.com>
  • Loading branch information...
commit 40c51ba15b295d014356f403767f73c924b2b7ed 1 parent 3cad78f
authored April 02, 2013 markh794 committed April 02, 2013

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  usr/ssc.c
8  usr/ssc.c
@@ -784,6 +784,7 @@ uint8_t ssc_mode_select(struct scsi_cmd *cmd)
784 784
 	int save_pages;
785 785
 	int page_format;
786 786
 	int mselect_6 = 0;
  787
+	int page;
787 788
 
788 789
 	save_pages = cmd->scb[1] & 0x01;
789 790
 	page_format = (cmd->scb[1] & (1 << 4)) ? 1 : 0;
@@ -879,9 +880,12 @@ uint8_t ssc_mode_select(struct scsi_cmd *cmd)
879 880
 			i+24,
880 881
 			buf[i+24], buf[i+25], buf[i+26], buf[i+27],
881 882
 			buf[i+28], buf[i+29], buf[i+30], buf[i+31]);
  883
+
  884
+		page = buf[i];
  885
+		MHVTL_DBG(2, "Page: 0x%02x", page);
882 886
 		/* Default page len is, override if sub-pages */
883 887
 		page_len = buf[i + 1];
884  
-		switch (buf[i]) {
  888
+		switch (page) {
885 889
 		case MODE_DATA_COMPRESSION:
886 890
 			set_mode_compression(cmd, &buf[i]);
887 891
 			break;
@@ -904,7 +908,7 @@ uint8_t ssc_mode_select(struct scsi_cmd *cmd)
904 908
 
905 909
 		default:
906 910
 			MHVTL_DBG_PRT_CDB(1, cmd);
907  
-			MHVTL_DBG(1, "Mode page 0x%02x not handled", buf[i]);
  911
+			MHVTL_DBG(1, "Mode page 0x%02x not handled", page);
908 912
 			break;
909 913
 		}
910 914
 		if (page_len == 0) { /* Something wrong with data structure */

0 notes on commit 40c51ba

Please sign in to comment.
Something went wrong with that request. Please try again.