aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/sa.c
diff options
context:
space:
mode:
authorMark Haverkamp <markh@osdl.org>2005-10-24 13:52:22 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-28 12:41:53 -0400
commit8e0c5ebde82b08f6d996e11983890fc4cc085fab (patch)
tree3ba38ff8e7b9203b47d038c215d9c7d623c250ba /drivers/scsi/aacraid/sa.c
parent38a9a621aba953ddb8051547e98c10ec3c741312 (diff)
[SCSI] aacraid: Newer adapter communication iterface support
Received from Mark Salyzyn. This patch adds the 'new comm' interface, which modern AAC based adapters that are less than a year old support in the name of much improved performance. These modern adapters support both the legacy and the 'new comm' interfaces. Signed-off-by: Mark Haverkamp <markh@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/sa.c')
-rw-r--r--drivers/scsi/aacraid/sa.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index 3900abc5850d..8b9596209164 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -237,29 +237,16 @@ static void aac_sa_interrupt_adapter (struct aac_dev *dev)
237 237
238static void aac_sa_start_adapter(struct aac_dev *dev) 238static void aac_sa_start_adapter(struct aac_dev *dev)
239{ 239{
240 u32 ret;
241 struct aac_init *init; 240 struct aac_init *init;
242 /* 241 /*
243 * Fill in the remaining pieces of the init. 242 * Fill in the remaining pieces of the init.
244 */ 243 */
245 init = dev->init; 244 init = dev->init;
246 init->HostElapsedSeconds = cpu_to_le32(get_seconds()); 245 init->HostElapsedSeconds = cpu_to_le32(get_seconds());
247
248 /*
249 * Tell the adapter we are back and up and running so it will scan its command
250 * queues and enable our interrupts
251 */
252 dev->irq_mask = (PrintfReady | DOORBELL_1 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4);
253 /*
254 * First clear out all interrupts. Then enable the one's that
255 * we can handle.
256 */
257 sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff);
258 sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4));
259 /* We can only use a 32 bit address here */ 246 /* We can only use a 32 bit address here */
260 sa_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, 247 sa_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS,
261 (u32)(ulong)dev->init_pa, 0, 0, 0, 0, 0, 248 (u32)(ulong)dev->init_pa, 0, 0, 0, 0, 0,
262 &ret, NULL, NULL, NULL, NULL); 249 NULL, NULL, NULL, NULL, NULL);
263} 250}
264 251
265/** 252/**
@@ -314,15 +301,6 @@ int aac_sa_init(struct aac_dev *dev)
314 name = dev->name; 301 name = dev->name;
315 302
316 /* 303 /*
317 * Map in the registers from the adapter.
318 */
319
320 if((dev->regs.sa = ioremap((unsigned long)dev->scsi_host_ptr->base, 8192))==NULL)
321 {
322 printk(KERN_WARNING "aacraid: unable to map ARM.\n" );
323 goto error_iounmap;
324 }
325 /*
326 * Check to see if the board failed any self tests. 304 * Check to see if the board failed any self tests.
327 */ 305 */
328 if (sa_readl(dev, Mailbox7) & SELF_TEST_FAILED) { 306 if (sa_readl(dev, Mailbox7) & SELF_TEST_FAILED) {
@@ -378,31 +356,17 @@ int aac_sa_init(struct aac_dev *dev)
378 goto error_irq; 356 goto error_irq;
379 357
380 /* 358 /*
381 * Start any kernel threads needed
382 */
383 dev->thread_pid = kernel_thread((int (*)(void *))aac_command_thread, dev, 0);
384 if (dev->thread_pid < 0) {
385 printk(KERN_ERR "aacraid: Unable to create command thread.\n");
386 goto error_kfree;
387 }
388
389 /*
390 * Tell the adapter that all is configure, and it can start 359 * Tell the adapter that all is configure, and it can start
391 * accepting requests 360 * accepting requests
392 */ 361 */
393 aac_sa_start_adapter(dev); 362 aac_sa_start_adapter(dev);
394 return 0; 363 return 0;
395 364
396
397error_kfree:
398 kfree(dev->queues);
399
400error_irq: 365error_irq:
401 sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff); 366 sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff);
402 free_irq(dev->scsi_host_ptr->irq, (void *)dev); 367 free_irq(dev->scsi_host_ptr->irq, (void *)dev);
403 368
404error_iounmap: 369error_iounmap:
405 iounmap(dev->regs.sa);
406 370
407 return -1; 371 return -1;
408} 372}