public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Miller <mike.miller@hp.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	JensAxboejens.axboe@oracle.com
Cc: LKML <linux-kernel@vger.kernel.org>,
	LKML-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH 2/1] cciss regression: firmware version not displayed in procfs
Date: Wed, 15 Oct 2008 15:44:13 -0500	[thread overview]
Message-ID: <20081015204413.GA19110@roadking.ldev.net> (raw)

Patch 2 of 1

This patch fixes another regression introduced by commit
6ae5ce8e8d4de666f31286808d2285aa6a50fa40. The fiwmware version is no longer
being displayed in procfs. Please consider this for inclusion.

Signed-off-by: Mike Miller <mike.miller@hp.com>

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 1e1f915..09b27d5 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1631,6 +1632,7 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
 	int ctlr = h->ctlr;
 	int num_luns;
 	ReportLunData_struct *ld_buff = NULL;
+	InquiryData_struct *inq_buff = NULL;
 	int return_code;
 	int listlength = 0;
 	int i;
@@ -1651,6 +1653,26 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
 	h->busy_configuring = 1;
 	spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
 
+	inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
+        if (inq_buff == NULL) {
+                printk(KERN_ERR "cciss: out of memory\n");
+                return ENOMEM;
+        }
+
+	/* Get the firmware version */ 
+	return_code = sendcmd_withirq(CISS_INQUIRY, ctlr, inq_buff, 
+		sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD);
+	if (return_code == IO_OK) {
+		h->firm_ver[0] = inq_buff->data_byte[32];
+		h->firm_ver[1] = inq_buff->data_byte[33];
+		h->firm_ver[2] = inq_buff->data_byte[34];
+		h->firm_ver[3] = inq_buff->data_byte[35];
+	} else {	 /* send command failed */
+		printk(KERN_WARNING "cciss: unable to determine firmware"
+			" version of controller\n");
+	}
+
+	/* Get the number of logical volumes */ 
 	ld_buff = kzalloc(sizeof(ReportLunData_struct), GFP_KERNEL);
 	if (ld_buff == NULL)
 		goto mem_msg;

                 reply	other threads:[~2008-10-15 20:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081015204413.GA19110@roadking.ldev.net \
    --to=mike.miller@hp.com \
    --cc=JensAxboejens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox