diff options
Diffstat (limited to 'drivers/scsi/hpsa.h')
-rw-r--r-- | drivers/scsi/hpsa.h | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index 44235a27e1b6..24472cec7de3 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h | |||
@@ -57,11 +57,12 @@ struct hpsa_scsi_dev_t { | |||
57 | 57 | ||
58 | }; | 58 | }; |
59 | 59 | ||
60 | struct reply_pool { | 60 | struct reply_queue_buffer { |
61 | u64 *head; | 61 | u64 *head; |
62 | size_t size; | 62 | size_t size; |
63 | u8 wraparound; | 63 | u8 wraparound; |
64 | u32 current_entry; | 64 | u32 current_entry; |
65 | dma_addr_t busaddr; | ||
65 | }; | 66 | }; |
66 | 67 | ||
67 | #pragma pack(1) | 68 | #pragma pack(1) |
@@ -90,6 +91,7 @@ struct bmic_controller_parameters { | |||
90 | u8 automatic_drive_slamming; | 91 | u8 automatic_drive_slamming; |
91 | u8 reserved1; | 92 | u8 reserved1; |
92 | u8 nvram_flags; | 93 | u8 nvram_flags; |
94 | #define HBA_MODE_ENABLED_FLAG (1 << 3) | ||
93 | u8 cache_nvram_flags; | 95 | u8 cache_nvram_flags; |
94 | u8 drive_config_flags; | 96 | u8 drive_config_flags; |
95 | u16 reserved2; | 97 | u16 reserved2; |
@@ -115,11 +117,8 @@ struct ctlr_info { | |||
115 | int nr_cmds; /* Number of commands allowed on this controller */ | 117 | int nr_cmds; /* Number of commands allowed on this controller */ |
116 | struct CfgTable __iomem *cfgtable; | 118 | struct CfgTable __iomem *cfgtable; |
117 | int interrupts_enabled; | 119 | int interrupts_enabled; |
118 | int major; | ||
119 | int max_commands; | 120 | int max_commands; |
120 | int commands_outstanding; | 121 | int commands_outstanding; |
121 | int max_outstanding; /* Debug */ | ||
122 | int usage_count; /* number of opens all all minor devices */ | ||
123 | # define PERF_MODE_INT 0 | 122 | # define PERF_MODE_INT 0 |
124 | # define DOORBELL_INT 1 | 123 | # define DOORBELL_INT 1 |
125 | # define SIMPLE_MODE_INT 2 | 124 | # define SIMPLE_MODE_INT 2 |
@@ -176,11 +175,9 @@ struct ctlr_info { | |||
176 | /* | 175 | /* |
177 | * Performant mode completion buffers | 176 | * Performant mode completion buffers |
178 | */ | 177 | */ |
179 | u64 *reply_pool; | 178 | size_t reply_queue_size; |
180 | size_t reply_pool_size; | 179 | struct reply_queue_buffer reply_queue[MAX_REPLY_QUEUES]; |
181 | struct reply_pool reply_queue[MAX_REPLY_QUEUES]; | ||
182 | u8 nreply_queues; | 180 | u8 nreply_queues; |
183 | dma_addr_t reply_pool_dhandle; | ||
184 | u32 *blockFetchTable; | 181 | u32 *blockFetchTable; |
185 | u32 *ioaccel1_blockFetchTable; | 182 | u32 *ioaccel1_blockFetchTable; |
186 | u32 *ioaccel2_blockFetchTable; | 183 | u32 *ioaccel2_blockFetchTable; |
@@ -195,7 +192,7 @@ struct ctlr_info { | |||
195 | u64 last_heartbeat_timestamp; | 192 | u64 last_heartbeat_timestamp; |
196 | u32 heartbeat_sample_interval; | 193 | u32 heartbeat_sample_interval; |
197 | atomic_t firmware_flash_in_progress; | 194 | atomic_t firmware_flash_in_progress; |
198 | u32 lockup_detected; | 195 | u32 *lockup_detected; |
199 | struct delayed_work monitor_ctlr_work; | 196 | struct delayed_work monitor_ctlr_work; |
200 | int remove_in_progress; | 197 | int remove_in_progress; |
201 | u32 fifo_recently_full; | 198 | u32 fifo_recently_full; |
@@ -232,11 +229,9 @@ struct ctlr_info { | |||
232 | #define CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE (1 << 31) | 229 | #define CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE (1 << 31) |
233 | 230 | ||
234 | #define RESCAN_REQUIRED_EVENT_BITS \ | 231 | #define RESCAN_REQUIRED_EVENT_BITS \ |
235 | (CTLR_STATE_CHANGE_EVENT | \ | 232 | (CTLR_ENCLOSURE_HOT_PLUG_EVENT | \ |
236 | CTLR_ENCLOSURE_HOT_PLUG_EVENT | \ | ||
237 | CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV | \ | 233 | CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV | \ |
238 | CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV | \ | 234 | CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV | \ |
239 | CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \ | ||
240 | CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \ | 235 | CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \ |
241 | CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE) | 236 | CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE) |
242 | spinlock_t offline_device_lock; | 237 | spinlock_t offline_device_lock; |
@@ -345,22 +340,23 @@ struct offline_device_entry { | |||
345 | static void SA5_submit_command(struct ctlr_info *h, | 340 | static void SA5_submit_command(struct ctlr_info *h, |
346 | struct CommandList *c) | 341 | struct CommandList *c) |
347 | { | 342 | { |
348 | dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr, | ||
349 | c->Header.Tag.lower); | ||
350 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); | 343 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); |
351 | (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); | 344 | (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); |
352 | } | 345 | } |
353 | 346 | ||
347 | static void SA5_submit_command_no_read(struct ctlr_info *h, | ||
348 | struct CommandList *c) | ||
349 | { | ||
350 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); | ||
351 | } | ||
352 | |||
354 | static void SA5_submit_command_ioaccel2(struct ctlr_info *h, | 353 | static void SA5_submit_command_ioaccel2(struct ctlr_info *h, |
355 | struct CommandList *c) | 354 | struct CommandList *c) |
356 | { | 355 | { |
357 | dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr, | ||
358 | c->Header.Tag.lower); | ||
359 | if (c->cmd_type == CMD_IOACCEL2) | 356 | if (c->cmd_type == CMD_IOACCEL2) |
360 | writel(c->busaddr, h->vaddr + IOACCEL2_INBOUND_POSTQ_32); | 357 | writel(c->busaddr, h->vaddr + IOACCEL2_INBOUND_POSTQ_32); |
361 | else | 358 | else |
362 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); | 359 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); |
363 | (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); | ||
364 | } | 360 | } |
365 | 361 | ||
366 | /* | 362 | /* |
@@ -398,7 +394,7 @@ static void SA5_performant_intr_mask(struct ctlr_info *h, unsigned long val) | |||
398 | 394 | ||
399 | static unsigned long SA5_performant_completed(struct ctlr_info *h, u8 q) | 395 | static unsigned long SA5_performant_completed(struct ctlr_info *h, u8 q) |
400 | { | 396 | { |
401 | struct reply_pool *rq = &h->reply_queue[q]; | 397 | struct reply_queue_buffer *rq = &h->reply_queue[q]; |
402 | unsigned long flags, register_value = FIFO_EMPTY; | 398 | unsigned long flags, register_value = FIFO_EMPTY; |
403 | 399 | ||
404 | /* msi auto clears the interrupt pending bit. */ | 400 | /* msi auto clears the interrupt pending bit. */ |
@@ -477,7 +473,6 @@ static bool SA5_intr_pending(struct ctlr_info *h) | |||
477 | { | 473 | { |
478 | unsigned long register_value = | 474 | unsigned long register_value = |
479 | readl(h->vaddr + SA5_INTR_STATUS); | 475 | readl(h->vaddr + SA5_INTR_STATUS); |
480 | dev_dbg(&h->pdev->dev, "intr_pending %lx\n", register_value); | ||
481 | return register_value & SA5_INTR_PENDING; | 476 | return register_value & SA5_INTR_PENDING; |
482 | } | 477 | } |
483 | 478 | ||
@@ -514,7 +509,7 @@ static bool SA5_ioaccel_mode1_intr_pending(struct ctlr_info *h) | |||
514 | static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q) | 509 | static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q) |
515 | { | 510 | { |
516 | u64 register_value; | 511 | u64 register_value; |
517 | struct reply_pool *rq = &h->reply_queue[q]; | 512 | struct reply_queue_buffer *rq = &h->reply_queue[q]; |
518 | unsigned long flags; | 513 | unsigned long flags; |
519 | 514 | ||
520 | BUG_ON(q >= h->nreply_queues); | 515 | BUG_ON(q >= h->nreply_queues); |
@@ -572,6 +567,14 @@ static struct access_method SA5_performant_access = { | |||
572 | SA5_performant_completed, | 567 | SA5_performant_completed, |
573 | }; | 568 | }; |
574 | 569 | ||
570 | static struct access_method SA5_performant_access_no_read = { | ||
571 | SA5_submit_command_no_read, | ||
572 | SA5_performant_intr_mask, | ||
573 | SA5_fifo_full, | ||
574 | SA5_performant_intr_pending, | ||
575 | SA5_performant_completed, | ||
576 | }; | ||
577 | |||
575 | struct board_type { | 578 | struct board_type { |
576 | u32 board_id; | 579 | u32 board_id; |
577 | char *product_name; | 580 | char *product_name; |