#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/raid_class.h>
#include <asm/unaligned.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_tcq.h>
static struct raid_template *myrs_raid_template;
static struct myrs_devstate_name_entry {
enum myrs_devstate state;
} myrs_devstate_name_list[] = {
{ MYRS_DEVICE_UNCONFIGURED, "Unconfigured" },
{ MYRS_DEVICE_ONLINE, "Online" },
{ MYRS_DEVICE_REBUILD, "Rebuild" },
{ MYRS_DEVICE_MISSING, "Missing" },
{ MYRS_DEVICE_SUSPECTED_CRITICAL, "SuspectedCritical" },
{ MYRS_DEVICE_OFFLINE, "Offline" },
{ MYRS_DEVICE_CRITICAL, "Critical" },
{ MYRS_DEVICE_SUSPECTED_DEAD, "SuspectedDead" },
{ MYRS_DEVICE_COMMANDED_OFFLINE, "CommandedOffline" },
{ MYRS_DEVICE_STANDBY, "Standby" },
{ MYRS_DEVICE_INVALID_STATE, "Invalid" },
static char *myrs_devstate_name(enum myrs_devstate state)
struct myrs_devstate_name_entry *entry = myrs_devstate_name_list;
for (i = 0; i < ARRAY_SIZE(myrs_devstate_name_list); i++) {
if (entry[i].state == state)
static struct myrs_raid_level_name_entry {
enum myrs_raid_level level;
} myrs_raid_level_name_list[] = {
{ MYRS_RAID_LEVEL0, "RAID0" },
{ MYRS_RAID_LEVEL1, "RAID1" },
{ MYRS_RAID_LEVEL3, "RAID3 right asymmetric parity" },
{ MYRS_RAID_LEVEL5, "RAID5 right asymmetric parity" },
{ MYRS_RAID_LEVEL6, "RAID6" },
{ MYRS_RAID_JBOD, "JBOD" },
{ MYRS_RAID_NEWSPAN, "New Mylex SPAN" },
{ MYRS_RAID_LEVEL3F, "RAID3 fixed parity" },
{ MYRS_RAID_LEVEL3L, "RAID3 left symmetric parity" },
{ MYRS_RAID_SPAN, "Mylex SPAN" },
{ MYRS_RAID_LEVEL5L, "RAID5 left symmetric parity" },
{ MYRS_RAID_LEVELE, "RAIDE (concatenation)" },
{ MYRS_RAID_PHYSICAL, "Physical device" },
static char *myrs_raid_level_name(enum myrs_raid_level level)
struct myrs_raid_level_name_entry *entry = myrs_raid_level_name_list;
for (i = 0; i < ARRAY_SIZE(myrs_raid_level_name_list); i++) {
if (entry[i].level == level)