Merge git://www.linux-watchdog.org/linux-watchdog
[pandora-kernel.git] / drivers / scsi / qla4xxx / ql4_nvram.c
index b4b859b..7851f31 100644 (file)
@@ -156,6 +156,27 @@ u16 rd_nvram_word(struct scsi_qla_host * ha, int offset)
        return val;
 }
 
+u8 rd_nvram_byte(struct scsi_qla_host *ha, int offset)
+{
+       u16 val = 0;
+       u8 rval = 0;
+       int index = 0;
+
+       if (offset & 0x1)
+               index = (offset - 1) / 2;
+       else
+               index = offset / 2;
+
+       val = le16_to_cpu(rd_nvram_word(ha, index));
+
+       if (offset & 0x1)
+               rval = (u8)((val & 0xff00) >> 8);
+       else
+               rval = (u8)((val & 0x00ff));
+
+       return rval;
+}
+
 int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host * ha)
 {
        int status = QLA_ERROR;