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