diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/hpsa.c | 8 | ||||
-rw-r--r-- | drivers/scsi/hpsa.h | 1 | ||||
-rw-r--r-- | drivers/scsi/hpsa_cmd.h | 5 |
3 files changed, 11 insertions, 3 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f661ad1e500c..f3fd9f1711f7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -1734,7 +1734,6 @@ static int add_msa2xxx_enclosure_device(struct ctlr_info *h, | |||
1734 | if (is_scsi_rev_5(h)) | 1734 | if (is_scsi_rev_5(h)) |
1735 | return 0; /* p1210m doesn't need to do this. */ | 1735 | return 0; /* p1210m doesn't need to do this. */ |
1736 | 1736 | ||
1737 | #define MAX_MSA2XXX_ENCLOSURES 32 | ||
1738 | if (*nmsa2xxx_enclosures >= MAX_MSA2XXX_ENCLOSURES) { | 1737 | if (*nmsa2xxx_enclosures >= MAX_MSA2XXX_ENCLOSURES) { |
1739 | dev_warn(&h->pdev->dev, "Maximum number of MSA2XXX " | 1738 | dev_warn(&h->pdev->dev, "Maximum number of MSA2XXX " |
1740 | "enclosures exceeded. Check your hardware " | 1739 | "enclosures exceeded. Check your hardware " |
@@ -1868,6 +1867,13 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno) | |||
1868 | 1867 | ||
1869 | /* Allocate the per device structures */ | 1868 | /* Allocate the per device structures */ |
1870 | for (i = 0; i < ndevs_to_allocate; i++) { | 1869 | for (i = 0; i < ndevs_to_allocate; i++) { |
1870 | if (i >= HPSA_MAX_DEVICES) { | ||
1871 | dev_warn(&h->pdev->dev, "maximum devices (%d) exceeded." | ||
1872 | " %d devices ignored.\n", HPSA_MAX_DEVICES, | ||
1873 | ndevs_to_allocate - HPSA_MAX_DEVICES); | ||
1874 | break; | ||
1875 | } | ||
1876 | |||
1871 | currentsd[i] = kzalloc(sizeof(*currentsd[i]), GFP_KERNEL); | 1877 | currentsd[i] = kzalloc(sizeof(*currentsd[i]), GFP_KERNEL); |
1872 | if (!currentsd[i]) { | 1878 | if (!currentsd[i]) { |
1873 | dev_warn(&h->pdev->dev, "out of memory at %s:%d\n", | 1879 | dev_warn(&h->pdev->dev, "out of memory at %s:%d\n", |
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index 4de9f71d8bff..73858bc22e57 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h | |||
@@ -102,7 +102,6 @@ struct ctlr_info { | |||
102 | struct Scsi_Host *scsi_host; | 102 | struct Scsi_Host *scsi_host; |
103 | spinlock_t devlock; /* to protect hba[ctlr]->dev[]; */ | 103 | spinlock_t devlock; /* to protect hba[ctlr]->dev[]; */ |
104 | int ndevices; /* number of used elements in .dev[] array. */ | 104 | int ndevices; /* number of used elements in .dev[] array. */ |
105 | #define HPSA_MAX_DEVICES 256 | ||
106 | struct hpsa_scsi_dev_t *dev[HPSA_MAX_DEVICES]; | 105 | struct hpsa_scsi_dev_t *dev[HPSA_MAX_DEVICES]; |
107 | /* | 106 | /* |
108 | * Performant mode tables. | 107 | * Performant mode tables. |
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index 55d741b019db..3fd4715935c2 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h | |||
@@ -123,8 +123,11 @@ union u64bit { | |||
123 | 123 | ||
124 | /* FIXME this is a per controller value (barf!) */ | 124 | /* FIXME this is a per controller value (barf!) */ |
125 | #define HPSA_MAX_TARGETS_PER_CTLR 16 | 125 | #define HPSA_MAX_TARGETS_PER_CTLR 16 |
126 | #define HPSA_MAX_LUN 256 | 126 | #define HPSA_MAX_LUN 1024 |
127 | #define HPSA_MAX_PHYS_LUN 1024 | 127 | #define HPSA_MAX_PHYS_LUN 1024 |
128 | #define MAX_MSA2XXX_ENCLOSURES 32 | ||
129 | #define HPSA_MAX_DEVICES (HPSA_MAX_PHYS_LUN + HPSA_MAX_LUN + \ | ||
130 | MAX_MSA2XXX_ENCLOSURES + 1) /* + 1 is for the controller itself */ | ||
128 | 131 | ||
129 | /* SCSI-3 Commands */ | 132 | /* SCSI-3 Commands */ |
130 | #pragma pack(1) | 133 | #pragma pack(1) |