History

isci: unify isci_host and scic_sds_controller

Remove the distinction between these two implementations and unify on isci_host (local instances named ihost). Hmmm, we had two 'oem_parameters' instances, one was unused... nice.

Dan Williams committed 15 years ago

Commit d9dcb4b1 parent 78a6f0616 files · +806 −985Browse files

Unified · Split

16 files
  1. drivers/scsi/isci/host.c +489 −511
  2. drivers/scsi/isci/host.h +46 −164
  3. drivers/scsi/isci/init.c +5 −5
  4. drivers/scsi/isci/phy.c +20 −20
  5. drivers/scsi/isci/port.c +40 −49
  6. drivers/scsi/isci/port.h +2 −2
  7. drivers/scsi/isci/port_config.c +30 −52
  8. drivers/scsi/isci/probe_roms.h +1 −1
  9. drivers/scsi/isci/remote_device.c +37 −39
  10. drivers/scsi/isci/remote_device.h +3 −3
  11. drivers/scsi/isci/remote_node_context.c +7 −7
  12. drivers/scsi/isci/request.c +98 −102
  13. drivers/scsi/isci/request.h +2 −2
  14. drivers/scsi/isci/task.c +21 −23
  15. drivers/scsi/isci/unsolicited_frame_control.c +3 −3
  16. drivers/scsi/isci/unsolicited_frame_control.h +2 −2
drivers/scsi/isci/host.c+489−511
@@ -181,35 +181,35 @@ void sci_change_state(struct sci_base_state_machine *sm, u32 next_state) · 180 unmodified lines
181181 }
182182
183183 static bool scic_sds_controller_completion_queue_has_entries(
184− struct scic_sds_controller *scic)
184+ struct isci_host *ihost)
185185 {
186− u32 get_value = scic->completion_queue_get;
186+ u32 get_value = ihost->completion_queue_get;
187187 u32 get_index = get_value & SMU_COMPLETION_QUEUE_GET_POINTER_MASK;
188188
189189 if (NORMALIZE_GET_POINTER_CYCLE_BIT(get_value) ==
190− COMPLETION_QUEUE_CYCLE_BIT(scic->completion_queue[get_index]))
190+ COMPLETION_QUEUE_CYCLE_BIT(ihost->completion_queue[get_index]))
191191 return true;
192192
193193 return false;
194194 }
195195
196−static bool scic_sds_controller_isr(struct scic_sds_controller *scic)
196+static bool scic_sds_controller_isr(struct isci_host *ihost)
197197 {
198− if (scic_sds_controller_completion_queue_has_entries(scic)) {
198+ if (scic_sds_controller_completion_queue_has_entries(ihost)) {
199199 return true;
200200 } else {
201201 /*
202202 * we have a spurious interrupt it could be that we have already
203203 * emptied the completion queue from a previous interrupt */
204− writel(SMU_ISR_COMPLETION, &scic->smu_registers->interrupt_status);
204+ writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status);
205205
206206 /*
207207 * There is a race in the hardware that could cause us not to be notified
208208 * of an interrupt completion if we do not take this step. We will mask
209209 * then unmask the interrupts so if there is another interrupt pending
210210 * the clearing of the interrupt source we get the next interrupt message. */
211− writel(0xFF000000, &scic->smu_registers->interrupt_mask);
212− writel(0, &scic->smu_registers->interrupt_mask);
211+ writel(0xFF000000, &ihost->smu_registers->interrupt_mask);
212+ writel(0, &ihost->smu_registers->interrupt_mask);
213213 }
214214
215215 return false;
@@ -219,18 +219,18 @@ irqreturn_t isci_msix_isr(int vec, void *data) · 3 unmodified lines
219219 {
220220 struct isci_host *ihost = data;
221221
222− if (scic_sds_controller_isr(&ihost->sci))
222+ if (scic_sds_controller_isr(ihost))
223223 tasklet_schedule(&ihost->completion_tasklet);
224224
225225 return IRQ_HANDLED;
226226 }
227227
228−static bool scic_sds_controller_error_isr(struct scic_sds_controller *scic)
228+static bool scic_sds_controller_error_isr(struct isci_host *ihost)
229229 {
230230 u32 interrupt_status;
231231
232232 interrupt_status =
233− readl(&scic->smu_registers->interrupt_status);
233+ readl(&ihost->smu_registers->interrupt_status);
234234 interrupt_status &= (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND);
235235
236236 if (interrupt_status != 0) {
@@ -246,28 +246,27 @@ static bool scic_sds_controller_error_isr(struct scic_sds_controller *scic) · 9 unmodified lines
246246 * then unmask the error interrupts so if there was another interrupt
247247 * pending we will be notified.
248248 * Could we write the value of (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND)? */
249− writel(0xff, &scic->smu_registers->interrupt_mask);
250− writel(0, &scic->smu_registers->interrupt_mask);
249+ writel(0xff, &ihost->smu_registers->interrupt_mask);
250+ writel(0, &ihost->smu_registers->interrupt_mask);
251251
252252 return false;
253253 }
254254
255−static void scic_sds_controller_task_completion(struct scic_sds_controller *scic,
255+static void scic_sds_controller_task_completion(struct isci_host *ihost,
256256 u32 completion_entry)
257257 {
258258 u32 index = SCU_GET_COMPLETION_INDEX(completion_entry);
259− struct isci_host *ihost = scic_to_ihost(scic);
260259 struct isci_request *ireq = ihost->reqs[index];
261260
262261 /* Make sure that we really want to process this IO request */
263262 if (test_bit(IREQ_ACTIVE, &ireq->flags) &&
264263 ireq->io_tag != SCI_CONTROLLER_INVALID_IO_TAG &&
265− ISCI_TAG_SEQ(ireq->io_tag) == scic->io_request_sequence[index])
264+ ISCI_TAG_SEQ(ireq->io_tag) == ihost->io_request_sequence[index])
266265 /* Yep this is a valid io request pass it along to the io request handler */
267266 scic_sds_io_request_tc_completion(ireq, completion_entry);
268267 }
269268
270−static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic,
269+static void scic_sds_controller_sdma_completion(struct isci_host *ihost,
271270 u32 completion_entry)
272271 {
273272 u32 index;
@@ -279,8 +278,8 @@ static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic · 5 unmodified lines
279278 switch (scu_get_command_request_type(completion_entry)) {
280279 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC:
281280 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC:
282− ireq = scic_to_ihost(scic)->reqs[index];
283− dev_warn(scic_to_dev(scic), "%s: %x for io request %p\n",
281+ ireq = ihost->reqs[index];
282+ dev_warn(&ihost->pdev->dev, "%s: %x for io request %p\n",
284283 __func__, completion_entry, ireq);
285284 /* @todo For a post TC operation we need to fail the IO
286285 * request
@@ -289,27 +288,26 @@ static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic · 2 unmodified lines
289288 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC:
290289 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC:
291290 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC:
292− idev = scic->device_table[index];
293− dev_warn(scic_to_dev(scic), "%s: %x for device %p\n",
291+ idev = ihost->device_table[index];
292+ dev_warn(&ihost->pdev->dev, "%s: %x for device %p\n",
294293 __func__, completion_entry, idev);
295294 /* @todo For a port RNC operation we need to fail the
296295 * device
297296 */
298297 break;
299298 default:
300− dev_warn(scic_to_dev(scic), "%s: unknown completion type %x\n",
299+ dev_warn(&ihost->pdev->dev, "%s: unknown completion type %x\n",
301300 __func__, completion_entry);
302301 break;
303302 }
304303 }
305304
306−static void scic_sds_controller_unsolicited_frame(struct scic_sds_controller *scic,
305+static void scic_sds_controller_unsolicited_frame(struct isci_host *ihost,
307306 u32 completion_entry)
308307 {
309308 u32 index;
310309 u32 frame_index;
311310
312− struct isci_host *ihost = scic_to_ihost(scic);
313311 struct scu_unsolicited_frame_header *frame_header;
314312 struct isci_phy *iphy;
315313 struct isci_remote_device *idev;
@@ -318,15 +316,15 @@ static void scic_sds_controller_unsolicited_frame(struct scic_sds_controller *sc · 2 unmodified lines
318316
319317 frame_index = SCU_GET_FRAME_INDEX(completion_entry);
320318
321− frame_header = scic->uf_control.buffers.array[frame_index].header;
322− scic->uf_control.buffers.array[frame_index].state = UNSOLICITED_FRAME_IN_USE;
319+ frame_header = ihost->uf_control.buffers.array[frame_index].header;
320+ ihost->uf_control.buffers.array[frame_index].state = UNSOLICITED_FRAME_IN_USE;
323321
324322 if (SCU_GET_FRAME_ERROR(completion_entry)) {
325323 /*
326324 * / @todo If the IAF frame or SIGNATURE FIS frame has an error will
327325 * / this cause a problem? We expect the phy initialization will
328326 * / fail if there is an error in the frame. */
329− scic_sds_controller_release_frame(scic, frame_index);
327+ scic_sds_controller_release_frame(ihost, frame_index);
330328 return;
331329 }
332330
@@ -347,15 +345,15 @@ static void scic_sds_controller_unsolicited_frame(struct scic_sds_controller *sc · 14 unmodified lines
347345 iphy = &ihost->phys[index];
348346 result = scic_sds_phy_frame_handler(iphy, frame_index);
349347 } else {
350− if (index < scic->remote_node_entries)
351− idev = scic->device_table[index];
348+ if (index < ihost->remote_node_entries)
349+ idev = ihost->device_table[index];
352350 else
353351 idev = NULL;
354352
355353 if (idev != NULL)
356354 result = scic_sds_remote_device_frame_handler(idev, frame_index);
357355 else
358− scic_sds_controller_release_frame(scic, frame_index);
356+ scic_sds_controller_release_frame(ihost, frame_index);
359357 }
360358 }
361359
@@ -366,10 +364,9 @@ static void scic_sds_controller_unsolicited_frame(struct scic_sds_controller *sc · 4 unmodified lines
366364 }
367365 }
368366
369−static void scic_sds_controller_event_completion(struct scic_sds_controller *scic,
367+static void scic_sds_controller_event_completion(struct isci_host *ihost,
370368 u32 completion_entry)
371369 {
372− struct isci_host *ihost = scic_to_ihost(scic);
373370 struct isci_remote_device *idev;
374371 struct isci_request *ireq;
375372 struct isci_phy *iphy;
@@ -380,11 +377,11 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci · 4 unmodified lines
380377 switch (scu_get_event_type(completion_entry)) {
381378 case SCU_EVENT_TYPE_SMU_COMMAND_ERROR:
382379 /* / @todo The driver did something wrong and we need to fix the condtion. */
383− dev_err(scic_to_dev(scic),
380+ dev_err(&ihost->pdev->dev,
384381 "%s: SCIC Controller 0x%p received SMU command error "
385382 "0x%x\n",
386383 __func__,
387− scic,
384+ ihost,
388385 completion_entry);
389386 break;
390387
@@ -394,11 +391,11 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci · 3 unmodified lines
394391 /*
395392 * / @todo This is a hardware failure and its likely that we want to
396393 * / reset the controller. */
397− dev_err(scic_to_dev(scic),
394+ dev_err(&ihost->pdev->dev,
398395 "%s: SCIC Controller 0x%p received fatal controller "
399396 "event 0x%x\n",
400397 __func__,
401− scic,
398+ ihost,
402399 completion_entry);
403400 break;
404401
@@ -415,27 +412,27 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci · 10 unmodified lines
415412 if (ireq != NULL)
416413 scic_sds_io_request_event_handler(ireq, completion_entry);
417414 else
418− dev_warn(scic_to_dev(scic),
415+ dev_warn(&ihost->pdev->dev,
419416 "%s: SCIC Controller 0x%p received "
420417 "event 0x%x for io request object "
421418 "that doesnt exist.\n",
422419 __func__,
423− scic,
420+ ihost,
424421 completion_entry);
425422
426423 break;
427424
428425 case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT:
429− idev = scic->device_table[index];
426+ idev = ihost->device_table[index];
430427 if (idev != NULL)
431428 scic_sds_remote_device_event_handler(idev, completion_entry);
432429 else
433− dev_warn(scic_to_dev(scic),
430+ dev_warn(&ihost->pdev->dev,
434431 "%s: SCIC Controller 0x%p received "
435432 "event 0x%x for remote device object "
436433 "that doesnt exist.\n",
437434 __func__,
438− scic,
435+ ihost,
439436 completion_entry);
440437
441438 break;
@@ -459,25 +456,25 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci · 17 unmodified lines
459456 case SCU_EVENT_TYPE_RNC_SUSPEND_TX:
460457 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX:
461458 case SCU_EVENT_TYPE_RNC_OPS_MISC:
462− if (index < scic->remote_node_entries) {
463− idev = scic->device_table[index];
459+ if (index < ihost->remote_node_entries) {
460+ idev = ihost->device_table[index];
464461
465462 if (idev != NULL)
466463 scic_sds_remote_device_event_handler(idev, completion_entry);
467464 } else
468− dev_err(scic_to_dev(scic),
465+ dev_err(&ihost->pdev->dev,
469466 "%s: SCIC Controller 0x%p received event 0x%x "
470467 "for remote device object 0x%0x that doesnt "
471468 "exist.\n",
472469 __func__,
473− scic,
470+ ihost,
474471 completion_entry,
475472 index);
476473
477474 break;
478475
479476 default:
480− dev_warn(scic_to_dev(scic),
477+ dev_warn(&ihost->pdev->dev,
481478 "%s: SCIC Controller received unknown event code %x\n",
482479 __func__,
483480 completion_entry);
@@ -485,7 +482,7 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci · 1 unmodified line
485482 }
486483 }
487484
488−static void scic_sds_controller_process_completions(struct scic_sds_controller *scic)
485+static void scic_sds_controller_process_completions(struct isci_host *ihost)
489486 {
490487 u32 completion_count = 0;
491488 u32 completion_entry;
@@ -494,47 +491,47 @@ static void scic_sds_controller_process_completions(struct scic_sds_controller * · 2 unmodified lines
494491 u32 event_get;
495492 u32 event_cycle;
496493
497− dev_dbg(scic_to_dev(scic),
494+ dev_dbg(&ihost->pdev->dev,
498495 "%s: completion queue begining get:0x%08x\n",
499496 __func__,
500− scic->completion_queue_get);
497+ ihost->completion_queue_get);
501498
502499 /* Get the component parts of the completion queue */
503− get_index = NORMALIZE_GET_POINTER(scic->completion_queue_get);
504− get_cycle = SMU_CQGR_CYCLE_BIT & scic->completion_queue_get;
500+ get_index = NORMALIZE_GET_POINTER(ihost->completion_queue_get);
501+ get_cycle = SMU_CQGR_CYCLE_BIT & ihost->completion_queue_get;
505502
506− event_get = NORMALIZE_EVENT_POINTER(scic->completion_queue_get);
507− event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & scic->completion_queue_get;
503+ event_get = NORMALIZE_EVENT_POINTER(ihost->completion_queue_get);
504+ event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & ihost->completion_queue_get;
508505
509506 while (
510507 NORMALIZE_GET_POINTER_CYCLE_BIT(get_cycle)
511− == COMPLETION_QUEUE_CYCLE_BIT(scic->completion_queue[get_index])
508+ == COMPLETION_QUEUE_CYCLE_BIT(ihost->completion_queue[get_index])
512509 ) {
513510 completion_count++;
514511
515− completion_entry = scic->completion_queue[get_index];
512+ completion_entry = ihost->completion_queue[get_index];
516513
517514 /* increment the get pointer and check for rollover to toggle the cycle bit */
518515 get_cycle ^= ((get_index+1) & SCU_MAX_COMPLETION_QUEUE_ENTRIES) <<
519516 (SMU_COMPLETION_QUEUE_GET_CYCLE_BIT_SHIFT - SCU_MAX_COMPLETION_QUEUE_SHIFT);
520517 get_index = (get_index+1) & (SCU_MAX_COMPLETION_QUEUE_ENTRIES-1);
521518
522− dev_dbg(scic_to_dev(scic),
519+ dev_dbg(&ihost->pdev->dev,
523520 "%s: completion queue entry:0x%08x\n",
524521 __func__,
525522 completion_entry);
526523
527524 switch (SCU_GET_COMPLETION_TYPE(completion_entry)) {
528525 case SCU_COMPLETION_TYPE_TASK:
529− scic_sds_controller_task_completion(scic, completion_entry);
526+ scic_sds_controller_task_completion(ihost, completion_entry);
530527 break;
531528
532529 case SCU_COMPLETION_TYPE_SDMA:
533− scic_sds_controller_sdma_completion(scic, completion_entry);
530+ scic_sds_controller_sdma_completion(ihost, completion_entry);
534531 break;
535532
536533 case SCU_COMPLETION_TYPE_UFI:
537− scic_sds_controller_unsolicited_frame(scic, completion_entry);
534+ scic_sds_controller_unsolicited_frame(ihost, completion_entry);
538535 break;
539536
540537 case SCU_COMPLETION_TYPE_EVENT:
@@ -543,11 +540,11 @@ static void scic_sds_controller_process_completions(struct scic_sds_controller * · 2 unmodified lines
543540 (SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_SHIFT - SCU_MAX_EVENTS_SHIFT);
544541 event_get = (event_get+1) & (SCU_MAX_EVENTS-1);
545542
546− scic_sds_controller_event_completion(scic, completion_entry);
543+ scic_sds_controller_event_completion(ihost, completion_entry);
547544 break;
548545 }
549546 default:
550− dev_warn(scic_to_dev(scic),
547+ dev_warn(&ihost->pdev->dev,
551548 "%s: SCIC Controller received unknown "
552549 "completion type %x\n",
553550 __func__,
@@ -558,7 +555,7 @@ static void scic_sds_controller_process_completions(struct scic_sds_controller * · 4 unmodified lines
558555
559556 /* Update the get register if we completed one or more entries */
560557 if (completion_count > 0) {
561− scic->completion_queue_get =
558+ ihost->completion_queue_get =
562559 SMU_CQGR_GEN_BIT(ENABLE) |
563560 SMU_CQGR_GEN_BIT(EVENT_ENABLE) |
564561 event_cycle |
@@ -566,35 +563,35 @@ static void scic_sds_controller_process_completions(struct scic_sds_controller * · 1 unmodified line
566563 get_cycle |
567564 SMU_CQGR_GEN_VAL(POINTER, get_index);
568565
569− writel(scic->completion_queue_get,
570− &scic->smu_registers->completion_queue_get);
566+ writel(ihost->completion_queue_get,
567+ &ihost->smu_registers->completion_queue_get);
571568
572569 }
573570
574− dev_dbg(scic_to_dev(scic),
571+ dev_dbg(&ihost->pdev->dev,
575572 "%s: completion queue ending get:0x%08x\n",
576573 __func__,
577− scic->completion_queue_get);
574+ ihost->completion_queue_get);
578575
579576 }
580577
581−static void scic_sds_controller_error_handler(struct scic_sds_controller *scic)
578+static void scic_sds_controller_error_handler(struct isci_host *ihost)
582579 {
583580 u32 interrupt_status;
584581
585582 interrupt_status =
586− readl(&scic->smu_registers->interrupt_status);
583+ readl(&ihost->smu_registers->interrupt_status);
587584
588585 if ((interrupt_status & SMU_ISR_QUEUE_SUSPEND) &&
589− scic_sds_controller_completion_queue_has_entries(scic)) {
586+ scic_sds_controller_completion_queue_has_entries(ihost)) {
590587
591− scic_sds_controller_process_completions(scic);
592− writel(SMU_ISR_QUEUE_SUSPEND, &scic->smu_registers->interrupt_status);
588+ scic_sds_controller_process_completions(ihost);
589+ writel(SMU_ISR_QUEUE_SUSPEND, &ihost->smu_registers->interrupt_status);
593590 } else {
594− dev_err(scic_to_dev(scic), "%s: status: %#x\n", __func__,
591+ dev_err(&ihost->pdev->dev, "%s: status: %#x\n", __func__,
595592 interrupt_status);
596593
597− sci_change_state(&scic->sm, SCIC_FAILED);
594+ sci_change_state(&ihost->sm, SCIC_FAILED);
598595
599596 return;
600597 }
@@ -602,22 +599,21 @@ static void scic_sds_controller_error_handler(struct scic_sds_controller *scic) · 1 unmodified line
602599 /* If we dont process any completions I am not sure that we want to do this.
603600 * We are in the middle of a hardware fault and should probably be reset.
604601 */
605− writel(0, &scic->smu_registers->interrupt_mask);
602+ writel(0, &ihost->smu_registers->interrupt_mask);
606603 }
607604
608605 irqreturn_t isci_intx_isr(int vec, void *data)
609606 {
610607 irqreturn_t ret = IRQ_NONE;
611608 struct isci_host *ihost = data;
612− struct scic_sds_controller *scic = &ihost->sci;
613609
614− if (scic_sds_controller_isr(scic)) {
615− writel(SMU_ISR_COMPLETION, &scic->smu_registers->interrupt_status);
610+ if (scic_sds_controller_isr(ihost)) {
611+ writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status);
616612 tasklet_schedule(&ihost->completion_tasklet);
617613 ret = IRQ_HANDLED;
618− } else if (scic_sds_controller_error_isr(scic)) {
614+ } else if (scic_sds_controller_error_isr(ihost)) {
619615 spin_lock(&ihost->scic_lock);
620− scic_sds_controller_error_handler(scic);
616+ scic_sds_controller_error_handler(ihost);
621617 spin_unlock(&ihost->scic_lock);
622618 ret = IRQ_HANDLED;
623619 }
@@ -629,8 +625,8 @@ irqreturn_t isci_error_isr(int vec, void *data) · 5 unmodified lines
629625 {
630626 struct isci_host *ihost = data;
631627
632− if (scic_sds_controller_error_isr(&ihost->sci))
633− scic_sds_controller_error_handler(&ihost->sci);
628+ if (scic_sds_controller_error_isr(ihost))
629+ scic_sds_controller_error_handler(ihost);
634630
635631 return IRQ_HANDLED;
636632 }
@@ -685,11 +681,10 @@ int isci_host_scan_finished(struct Scsi_Host *shost, unsigned long time) · 48 unmodified lines
685681 * This method returns the number of milliseconds for the suggested start
686682 * operation timeout.
687683 */
688−static u32 scic_controller_get_suggested_start_timeout(
689− struct scic_sds_controller *sc)
684+static u32 scic_controller_get_suggested_start_timeout(struct isci_host *ihost)
690685 {
691686 /* Validate the user supplied parameters. */
692− if (sc == NULL)
687+ if (!ihost)
693688 return 0;
694689
695690 /*
@@ -711,35 +706,32 @@ static u32 scic_controller_get_suggested_start_timeout( · 15 unmodified lines
711706 + ((SCI_MAX_PHYS - 1) * SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL);
712707 }
713708
714−static void scic_controller_enable_interrupts(
715− struct scic_sds_controller *scic)
709+static void scic_controller_enable_interrupts(struct isci_host *ihost)
716710 {
717− BUG_ON(scic->smu_registers == NULL);
718− writel(0, &scic->smu_registers->interrupt_mask);
711+ BUG_ON(ihost->smu_registers == NULL);
712+ writel(0, &ihost->smu_registers->interrupt_mask);
719713 }
720714
721−void scic_controller_disable_interrupts(
722− struct scic_sds_controller *scic)
715+void scic_controller_disable_interrupts(struct isci_host *ihost)
723716 {
724− BUG_ON(scic->smu_registers == NULL);
725− writel(0xffffffff, &scic->smu_registers->interrupt_mask);
717+ BUG_ON(ihost->smu_registers == NULL);
718+ writel(0xffffffff, &ihost->smu_registers->interrupt_mask);
726719 }
727720
728−static void scic_sds_controller_enable_port_task_scheduler(
729− struct scic_sds_controller *scic)
721+static void scic_sds_controller_enable_port_task_scheduler(struct isci_host *ihost)
730722 {
731723 u32 port_task_scheduler_value;
732724
733725 port_task_scheduler_value =
734− readl(&scic->scu_registers->peg0.ptsg.control);
726+ readl(&ihost->scu_registers->peg0.ptsg.control);
735727 port_task_scheduler_value |=
736728 (SCU_PTSGCR_GEN_BIT(ETM_ENABLE) |
737729 SCU_PTSGCR_GEN_BIT(PTSG_ENABLE));
738730 writel(port_task_scheduler_value,
739− &scic->scu_registers->peg0.ptsg.control);
731+ &ihost->scu_registers->peg0.ptsg.control);
740732 }
741733
742−static void scic_sds_controller_assign_task_entries(struct scic_sds_controller *scic)
734+static void scic_sds_controller_assign_task_entries(struct isci_host *ihost)
743735 {
744736 u32 task_assignment;
745737
@@ -749,32 +741,32 @@ static void scic_sds_controller_assign_task_entries(struct scic_sds_controller * · 3 unmodified lines
749741 */
750742
751743 task_assignment =
752− readl(&scic->smu_registers->task_context_assignment[0]);
744+ readl(&ihost->smu_registers->task_context_assignment[0]);
753745
754746 task_assignment |= (SMU_TCA_GEN_VAL(STARTING, 0)) |
755− (SMU_TCA_GEN_VAL(ENDING, scic->task_context_entries - 1)) |
747+ (SMU_TCA_GEN_VAL(ENDING, ihost->task_context_entries - 1)) |
756748 (SMU_TCA_GEN_BIT(RANGE_CHECK_ENABLE));
757749
758750 writel(task_assignment,
759− &scic->smu_registers->task_context_assignment[0]);
751+ &ihost->smu_registers->task_context_assignment[0]);
760752
761753 }
762754
763−static void scic_sds_controller_initialize_completion_queue(struct scic_sds_controller *scic)
755+static void scic_sds_controller_initialize_completion_queue(struct isci_host *ihost)
764756 {
765757 u32 index;
766758 u32 completion_queue_control_value;
767759 u32 completion_queue_get_value;
768760 u32 completion_queue_put_value;
769761
770− scic->completion_queue_get = 0;
762+ ihost->completion_queue_get = 0;
771763
772764 completion_queue_control_value =
773765 (SMU_CQC_QUEUE_LIMIT_SET(SCU_MAX_COMPLETION_QUEUE_ENTRIES - 1) |
774766 SMU_CQC_EVENT_LIMIT_SET(SCU_MAX_EVENTS - 1));
775767
776768 writel(completion_queue_control_value,
777− &scic->smu_registers->completion_queue_control);
769+ &ihost->smu_registers->completion_queue_control);
778770
779771
780772 /* Set the completion queue get pointer and enable the queue */
@@ -786,7 +778,7 @@ static void scic_sds_controller_initialize_completion_queue(struct scic_sds_cont · 5 unmodified lines
786778 );
787779
788780 writel(completion_queue_get_value,
789− &scic->smu_registers->completion_queue_get);
781+ &ihost->smu_registers->completion_queue_get);
790782
791783 /* Set the completion queue put pointer */
792784 completion_queue_put_value = (
@@ -795,7 +787,7 @@ static void scic_sds_controller_initialize_completion_queue(struct scic_sds_cont · 2 unmodified lines
795787 );
796788
797789 writel(completion_queue_put_value,
798− &scic->smu_registers->completion_queue_put);
790+ &ihost->smu_registers->completion_queue_put);
799791
800792 /* Initialize the cycle bit of the completion queue entries */
801793 for (index = 0; index < SCU_MAX_COMPLETION_QUEUE_ENTRIES; index++) {
@@ -803,11 +795,11 @@ static void scic_sds_controller_initialize_completion_queue(struct scic_sds_cont · 1 unmodified line
803795 * If get.cycle_bit != completion_queue.cycle_bit
804796 * its not a valid completion queue entry
805797 * so at system start all entries are invalid */
806− scic->completion_queue[index] = 0x80000000;
798+ ihost->completion_queue[index] = 0x80000000;
807799 }
808800 }
809801
810−static void scic_sds_controller_initialize_unsolicited_frame_queue(struct scic_sds_controller *scic)
802+static void scic_sds_controller_initialize_unsolicited_frame_queue(struct isci_host *ihost)
811803 {
812804 u32 frame_queue_control_value;
813805 u32 frame_queue_get_value;
@@ -818,7 +810,7 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(struct scic_s · 4 unmodified lines
818810 SCU_UFQC_GEN_VAL(QUEUE_SIZE, SCU_MAX_UNSOLICITED_FRAMES);
819811
820812 writel(frame_queue_control_value,
821− &scic->scu_registers->sdma.unsolicited_frame_queue_control);
813+ &ihost->scu_registers->sdma.unsolicited_frame_queue_control);
822814
823815 /* Setup the get pointer for the unsolicited frame queue */
824816 frame_queue_get_value = (
@@ -827,11 +819,11 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(struct scic_s · 2 unmodified lines
827819 );
828820
829821 writel(frame_queue_get_value,
830− &scic->scu_registers->sdma.unsolicited_frame_get_pointer);
822+ &ihost->scu_registers->sdma.unsolicited_frame_get_pointer);
831823 /* Setup the put pointer for the unsolicited frame queue */
832824 frame_queue_put_value = SCU_UFQPP_GEN_VAL(POINTER, 0);
833825 writel(frame_queue_put_value,
834− &scic->scu_registers->sdma.unsolicited_frame_put_pointer);
826+ &ihost->scu_registers->sdma.unsolicited_frame_put_pointer);
835827 }
836828
837829 /**
@@ -846,17 +838,16 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(struct scic_s · 8 unmodified lines
846838 * none.
847839 */
848840 static void scic_sds_controller_transition_to_ready(
849− struct scic_sds_controller *scic,
841+ struct isci_host *ihost,
850842 enum sci_status status)
851843 {
852− struct isci_host *ihost = scic_to_ihost(scic);
853844
854− if (scic->sm.current_state_id == SCIC_STARTING) {
845+ if (ihost->sm.current_state_id == SCIC_STARTING) {
855846 /*
856847 * We move into the ready state, because some of the phys/ports
857848 * may be up and operational.
858849 */
859− sci_change_state(&scic->sm, SCIC_READY);
850+ sci_change_state(&ihost->sm, SCIC_READY);
860851
861852 isci_host_start_complete(ihost, status);
862853 }
@@ -892,19 +883,18 @@ static bool is_phy_starting(struct isci_phy *iphy) · 29 unmodified lines
892883 * controller to the READY state and inform the user
893884 * (scic_cb_controller_start_complete()).
894885 */
895−static enum sci_status scic_sds_controller_start_next_phy(struct scic_sds_controller *scic)
886+static enum sci_status scic_sds_controller_start_next_phy(struct isci_host *ihost)
896887 {
897− struct isci_host *ihost = scic_to_ihost(scic);
898− struct scic_sds_oem_params *oem = &scic->oem_parameters.sds1;
888+ struct scic_sds_oem_params *oem = &ihost->oem_parameters.sds1;
899889 struct isci_phy *iphy;
900890 enum sci_status status;
901891
902892 status = SCI_SUCCESS;
903893
904− if (scic->phy_startup_timer_pending)
894+ if (ihost->phy_startup_timer_pending)
905895 return status;
906896
907− if (scic->next_phy_to_start >= SCI_MAX_PHYS) {
897+ if (ihost->next_phy_to_start >= SCI_MAX_PHYS) {
908898 bool is_controller_start_complete = true;
909899 u32 state;
910900 u8 index;
@@ -934,16 +924,16 @@ static enum sci_status scic_sds_controller_start_next_phy(struct scic_sds_contro · 23 unmodified lines
934924 * The controller has successfully finished the start process.
935925 * Inform the SCI Core user and transition to the READY state. */
936926 if (is_controller_start_complete == true) {
937− scic_sds_controller_transition_to_ready(scic, SCI_SUCCESS);
938− sci_del_timer(&scic->phy_timer);
939− scic->phy_startup_timer_pending = false;
927+ scic_sds_controller_transition_to_ready(ihost, SCI_SUCCESS);
928+ sci_del_timer(&ihost->phy_timer);
929+ ihost->phy_startup_timer_pending = false;
940930 }
941931 } else {
942− iphy = &ihost->phys[scic->next_phy_to_start];
932+ iphy = &ihost->phys[ihost->next_phy_to_start];
943933
944934 if (oem->controller.mode_type == SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
945935 if (phy_get_non_dummy_port(iphy) == NULL) {
946− scic->next_phy_to_start++;
936+ ihost->next_phy_to_start++;
947937
948938 /* Caution recursion ahead be forwarned
949939 *
@@ -954,27 +944,27 @@ static enum sci_status scic_sds_controller_start_next_phy(struct scic_sds_contro · 4 unmodified lines
954944 * incorrectly for the PORT or it was never
955945 * assigned to a PORT
956946 */
957− return scic_sds_controller_start_next_phy(scic);
947+ return scic_sds_controller_start_next_phy(ihost);
958948 }
959949 }
960950
961951 status = scic_sds_phy_start(iphy);
962952
963953 if (status == SCI_SUCCESS) {
964− sci_mod_timer(&scic->phy_timer,
954+ sci_mod_timer(&ihost->phy_timer,
965955 SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT);
966− scic->phy_startup_timer_pending = true;
956+ ihost->phy_startup_timer_pending = true;
967957 } else {
968− dev_warn(scic_to_dev(scic),
958+ dev_warn(&ihost->pdev->dev,
969959 "%s: Controller stop operation failed "
970960 "to stop phy %d because of status "
971961 "%d.\n",
972962 __func__,
973− ihost->phys[scic->next_phy_to_start].phy_index,
963+ ihost->phys[ihost->next_phy_to_start].phy_index,
974964 status);
975965 }
976966
977− scic->next_phy_to_start++;
967+ ihost->next_phy_to_start++;
978968 }
979969
980970 return status;
@@ -983,8 +973,7 @@ static enum sci_status scic_sds_controller_start_next_phy(struct scic_sds_contro · 2 unmodified lines
983973 static void phy_startup_timeout(unsigned long data)
984974 {
985975 struct sci_timer *tmr = (struct sci_timer *)data;
986− struct scic_sds_controller *scic = container_of(tmr, typeof(*scic), phy_timer);
987− struct isci_host *ihost = scic_to_ihost(scic);
976+ struct isci_host *ihost = container_of(tmr, typeof(*ihost), phy_timer);
988977 unsigned long flags;
989978 enum sci_status status;
990979
@@ -993,10 +982,10 @@ static void phy_startup_timeout(unsigned long data) · 2 unmodified lines
993982 if (tmr->cancel)
994983 goto done;
995984
996− scic->phy_startup_timer_pending = false;
985+ ihost->phy_startup_timer_pending = false;
997986
998987 do {
999− status = scic_sds_controller_start_next_phy(scic);
988+ status = scic_sds_controller_start_next_phy(ihost);
1000989 } while (status != SCI_SUCCESS);
1001990
1002991 done:
@@ -1008,15 +997,14 @@ static u16 isci_tci_active(struct isci_host *ihost) · 5 unmodified lines
1008997 return CIRC_CNT(ihost->tci_head, ihost->tci_tail, SCI_MAX_IO_REQUESTS);
1009998 }
1010999
1011−static enum sci_status scic_controller_start(struct scic_sds_controller *scic,
1000+static enum sci_status scic_controller_start(struct isci_host *ihost,
10121001 u32 timeout)
10131002 {
1014− struct isci_host *ihost = scic_to_ihost(scic);
10151003 enum sci_status result;
10161004 u16 index;
10171005
1018− if (scic->sm.current_state_id != SCIC_INITIALIZED) {
1019− dev_warn(scic_to_dev(scic),
1006+ if (ihost->sm.current_state_id != SCIC_INITIALIZED) {
1007+ dev_warn(&ihost->pdev->dev,
10201008 "SCIC Controller start operation requested in "
10211009 "invalid state\n");
10221010 return SCI_FAILURE_INVALID_STATE;
@@ -1026,34 +1014,34 @@ static enum sci_status scic_controller_start(struct scic_sds_controller *scic, · 3 unmodified lines
10261014 BUILD_BUG_ON(SCI_MAX_IO_REQUESTS > 1 << sizeof(ihost->tci_pool[0]) * 8);
10271015 ihost->tci_head = 0;
10281016 ihost->tci_tail = 0;
1029− for (index = 0; index < scic->task_context_entries; index++)
1017+ for (index = 0; index < ihost->task_context_entries; index++)
10301018 isci_tci_free(ihost, index);
10311019
10321020 /* Build the RNi free pool */
10331021 scic_sds_remote_node_table_initialize(
1034− &scic->available_remote_nodes,
1035− scic->remote_node_entries);
1022+ &ihost->available_remote_nodes,
1023+ ihost->remote_node_entries);
10361024
10371025 /*
10381026 * Before anything else lets make sure we will not be
10391027 * interrupted by the hardware.
10401028 */
1041− scic_controller_disable_interrupts(scic);
1029+ scic_controller_disable_interrupts(ihost);
10421030
10431031 /* Enable the port task scheduler */
1044− scic_sds_controller_enable_port_task_scheduler(scic);
1032+ scic_sds_controller_enable_port_task_scheduler(ihost);
10451033
1046− /* Assign all the task entries to scic physical function */
1047− scic_sds_controller_assign_task_entries(scic);
1034+ /* Assign all the task entries to ihost physical function */
1035+ scic_sds_controller_assign_task_entries(ihost);
10481036
10491037 /* Now initialize the completion queue */
1050− scic_sds_controller_initialize_completion_queue(scic);
1038+ scic_sds_controller_initialize_completion_queue(ihost);
10511039
10521040 /* Initialize the unsolicited frame queue for use */
1053− scic_sds_controller_initialize_unsolicited_frame_queue(scic);
1041+ scic_sds_controller_initialize_unsolicited_frame_queue(ihost);
10541042
10551043 /* Start all of the ports on this controller */
1056− for (index = 0; index < scic->logical_port_entries; index++) {
1044+ for (index = 0; index < ihost->logical_port_entries; index++) {
10571045 struct isci_port *iport = &ihost->ports[index];
10581046
10591047 result = scic_sds_port_start(iport);
@@ -1061,11 +1049,11 @@ static enum sci_status scic_controller_start(struct scic_sds_controller *scic, · 1 unmodified line
10611049 return result;
10621050 }
10631051
1064− scic_sds_controller_start_next_phy(scic);
1052+ scic_sds_controller_start_next_phy(ihost);
10651053
1066− sci_mod_timer(&scic->timer, timeout);
1054+ sci_mod_timer(&ihost->timer, timeout);
10671055
1068− sci_change_state(&scic->sm, SCIC_STARTING);
1056+ sci_change_state(&ihost->sm, SCIC_STARTING);
10691057
10701058 return SCI_SUCCESS;
10711059 }
@@ -1073,35 +1061,35 @@ static enum sci_status scic_controller_start(struct scic_sds_controller *scic, · 1 unmodified line
10731061 void isci_host_scan_start(struct Scsi_Host *shost)
10741062 {
10751063 struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha;
1076− unsigned long tmo = scic_controller_get_suggested_start_timeout(&ihost->sci);
1064+ unsigned long tmo = scic_controller_get_suggested_start_timeout(ihost);
10771065
10781066 set_bit(IHOST_START_PENDING, &ihost->flags);
10791067
10801068 spin_lock_irq(&ihost->scic_lock);
1081− scic_controller_start(&ihost->sci, tmo);
1082− scic_controller_enable_interrupts(&ihost->sci);
1069+ scic_controller_start(ihost, tmo);
1070+ scic_controller_enable_interrupts(ihost);
10831071 spin_unlock_irq(&ihost->scic_lock);
10841072 }
10851073
10861074 static void isci_host_stop_complete(struct isci_host *ihost, enum sci_status completion_status)
10871075 {
10881076 isci_host_change_state(ihost, isci_stopped);
1089− scic_controller_disable_interrupts(&ihost->sci);
1077+ scic_controller_disable_interrupts(ihost);
10901078 clear_bit(IHOST_STOP_PENDING, &ihost->flags);
10911079 wake_up(&ihost->eventq);
10921080 }
10931081
1094−static void scic_sds_controller_completion_handler(struct scic_sds_controller *scic)
1082+static void scic_sds_controller_completion_handler(struct isci_host *ihost)
10951083 {
10961084 /* Empty out the completion queue */
1097− if (scic_sds_controller_completion_queue_has_entries(scic))
1098− scic_sds_controller_process_completions(scic);
1085+ if (scic_sds_controller_completion_queue_has_entries(ihost))
1086+ scic_sds_controller_process_completions(ihost);
10991087
11001088 /* Clear the interrupt and enable all interrupts again */
1101− writel(SMU_ISR_COMPLETION, &scic->smu_registers->interrupt_status);
1089+ writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status);
11021090 /* Could we write the value of SMU_ISR_COMPLETION? */
1103− writel(0xFF000000, &scic->smu_registers->interrupt_mask);
1104− writel(0, &scic->smu_registers->interrupt_mask);
1091+ writel(0xFF000000, &ihost->smu_registers->interrupt_mask);
1092+ writel(0, &ihost->smu_registers->interrupt_mask);
11051093 }
11061094
11071095 /**
@@ -1114,7 +1102,7 @@ static void scic_sds_controller_completion_handler(struct scic_sds_controller *s · 6 unmodified lines
11141102 */
11151103 static void isci_host_completion_routine(unsigned long data)
11161104 {
1117− struct isci_host *isci_host = (struct isci_host *)data;
1105+ struct isci_host *ihost = (struct isci_host *)data;
11181106 struct list_head completed_request_list;
11191107 struct list_head errored_request_list;
11201108 struct list_head *current_position;
@@ -1126,20 +1114,20 @@ static void isci_host_completion_routine(unsigned long data) · 5 unmodified lines
11261114 INIT_LIST_HEAD(&completed_request_list);
11271115 INIT_LIST_HEAD(&errored_request_list);
11281116
1129− spin_lock_irq(&isci_host->scic_lock);
1117+ spin_lock_irq(&ihost->scic_lock);
11301118
1131− scic_sds_controller_completion_handler(&isci_host->sci);
1119+ scic_sds_controller_completion_handler(ihost);
11321120
11331121 /* Take the lists of completed I/Os from the host. */
11341122
1135− list_splice_init(&isci_host->requests_to_complete,
1123+ list_splice_init(&ihost->requests_to_complete,
11361124 &completed_request_list);
11371125
11381126 /* Take the list of errored I/Os from the host. */
1139− list_splice_init(&isci_host->requests_to_errorback,
1127+ list_splice_init(&ihost->requests_to_errorback,
11401128 &errored_request_list);
11411129
1142− spin_unlock_irq(&isci_host->scic_lock);
1130+ spin_unlock_irq(&ihost->scic_lock);
11431131
11441132 /* Process any completions in the lists. */
11451133 list_for_each_safe(current_position, next_position,
@@ -1150,7 +1138,7 @@ static void isci_host_completion_routine(unsigned long data) · 4 unmodified lines
11501138 task = isci_request_access_task(request);
11511139
11521140 /* Normal notification (task_done) */
1153− dev_dbg(&isci_host->pdev->dev,
1141+ dev_dbg(&ihost->pdev->dev,
11541142 "%s: Normal - request/task = %p/%p\n",
11551143 __func__,
11561144 request,
@@ -1169,9 +1157,9 @@ static void isci_host_completion_routine(unsigned long data) · 12 unmodified lines
11691157 }
11701158 }
11711159
1172− spin_lock_irq(&isci_host->scic_lock);
1173− isci_free_tag(isci_host, request->io_tag);
1174− spin_unlock_irq(&isci_host->scic_lock);
1160+ spin_lock_irq(&ihost->scic_lock);
1161+ isci_free_tag(ihost, request->io_tag);
1162+ spin_unlock_irq(&ihost->scic_lock);
11751163 }
11761164 list_for_each_entry_safe(request, next_request, &errored_request_list,
11771165 completed_node) {
@@ -1179,7 +1167,7 @@ static void isci_host_completion_routine(unsigned long data) · 1 unmodified line
11791167 task = isci_request_access_task(request);
11801168
11811169 /* Use sas_task_abort */
1182− dev_warn(&isci_host->pdev->dev,
1170+ dev_warn(&ihost->pdev->dev,
11831171 "%s: Error - request/task = %p/%p\n",
11841172 __func__,
11851173 request,
@@ -1202,13 +1190,13 @@ static void isci_host_completion_routine(unsigned long data) · 16 unmodified lines
12021190 * it.
12031191 */
12041192
1205− spin_lock_irq(&isci_host->scic_lock);
1193+ spin_lock_irq(&ihost->scic_lock);
12061194 /* Remove the request from the remote device's list
12071195 * of pending requests.
12081196 */
12091197 list_del_init(&request->dev_node);
1210− isci_free_tag(isci_host, request->io_tag);
1211− spin_unlock_irq(&isci_host->scic_lock);
1198+ isci_free_tag(ihost, request->io_tag);
1199+ spin_unlock_irq(&ihost->scic_lock);
12121200 }
12131201 }
12141202
@@ -1232,18 +1220,18 @@ static void isci_host_completion_routine(unsigned long data) · 17 unmodified lines
12321220 * controller is already in the STOPPED state. SCI_FAILURE_INVALID_STATE if the
12331221 * controller is not either in the STARTED or STOPPED states.
12341222 */
1235−static enum sci_status scic_controller_stop(struct scic_sds_controller *scic,
1223+static enum sci_status scic_controller_stop(struct isci_host *ihost,
12361224 u32 timeout)
12371225 {
1238− if (scic->sm.current_state_id != SCIC_READY) {
1239− dev_warn(scic_to_dev(scic),
1226+ if (ihost->sm.current_state_id != SCIC_READY) {
1227+ dev_warn(&ihost->pdev->dev,
12401228 "SCIC Controller stop operation requested in "
12411229 "invalid state\n");
12421230 return SCI_FAILURE_INVALID_STATE;
12431231 }
12441232
1245− sci_mod_timer(&scic->timer, timeout);
1246− sci_change_state(&scic->sm, SCIC_STOPPING);
1233+ sci_mod_timer(&ihost->timer, timeout);
1234+ sci_change_state(&ihost->sm, SCIC_STOPPING);
12471235 return SCI_SUCCESS;
12481236 }
12491237
@@ -1259,9 +1247,9 @@ static enum sci_status scic_controller_stop(struct scic_sds_controller *scic, · 9 unmodified lines
12591247 * SCI_SUCCESS if the reset operation successfully started. SCI_FATAL_ERROR if
12601248 * the controller reset operation is unable to complete.
12611249 */
1262−static enum sci_status scic_controller_reset(struct scic_sds_controller *scic)
1250+static enum sci_status scic_controller_reset(struct isci_host *ihost)
12631251 {
1264− switch (scic->sm.current_state_id) {
1252+ switch (ihost->sm.current_state_id) {
12651253 case SCIC_RESET:
12661254 case SCIC_READY:
12671255 case SCIC_STOPPED:
@@ -1270,10 +1258,10 @@ static enum sci_status scic_controller_reset(struct scic_sds_controller *scic) · 2 unmodified lines
12701258 * The reset operation is not a graceful cleanup, just
12711259 * perform the state transition.
12721260 */
1273− sci_change_state(&scic->sm, SCIC_RESETTING);
1261+ sci_change_state(&ihost->sm, SCIC_RESETTING);
12741262 return SCI_SUCCESS;
12751263 default:
1276− dev_warn(scic_to_dev(scic),
1264+ dev_warn(&ihost->pdev->dev,
12771265 "SCIC Controller reset operation requested in "
12781266 "invalid state\n");
12791267 return SCI_FAILURE_INVALID_STATE;
@@ -1298,14 +1286,14 @@ void isci_host_deinit(struct isci_host *ihost) · 18 unmodified lines
12981286 set_bit(IHOST_STOP_PENDING, &ihost->flags);
12991287
13001288 spin_lock_irq(&ihost->scic_lock);
1301− scic_controller_stop(&ihost->sci, SCIC_CONTROLLER_STOP_TIMEOUT);
1289+ scic_controller_stop(ihost, SCIC_CONTROLLER_STOP_TIMEOUT);
13021290 spin_unlock_irq(&ihost->scic_lock);
13031291
13041292 wait_for_stop(ihost);
1305− scic_controller_reset(&ihost->sci);
1293+ scic_controller_reset(ihost);
13061294
13071295 /* Cancel any/all outstanding port timers */
1308− for (i = 0; i < ihost->sci.logical_port_entries; i++) {
1296+ for (i = 0; i < ihost->logical_port_entries; i++) {
13091297 struct isci_port *iport = &ihost->ports[i];
13101298 del_timer_sync(&iport->timer.timer);
13111299 }
@@ -1316,13 +1304,13 @@ void isci_host_deinit(struct isci_host *ihost) · 4 unmodified lines
13161304 del_timer_sync(&iphy->sata_timer.timer);
13171305 }
13181306
1319− del_timer_sync(&ihost->sci.port_agent.timer.timer);
1307+ del_timer_sync(&ihost->port_agent.timer.timer);
13201308
1321− del_timer_sync(&ihost->sci.power_control.timer.timer);
1309+ del_timer_sync(&ihost->power_control.timer.timer);
13221310
1323− del_timer_sync(&ihost->sci.timer.timer);
1311+ del_timer_sync(&ihost->timer.timer);
13241312
1325− del_timer_sync(&ihost->sci.phy_timer.timer);
1313+ del_timer_sync(&ihost->phy_timer.timer);
13261314 }
13271315
13281316 static void __iomem *scu_base(struct isci_host *isci_host)
@@ -1369,16 +1357,16 @@ static void isci_user_parameters_get( · 40 unmodified lines
13691357
13701358 static void scic_sds_controller_initial_state_enter(struct sci_base_state_machine *sm)
13711359 {
1372− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1360+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
13731361
1374− sci_change_state(&scic->sm, SCIC_RESET);
1362+ sci_change_state(&ihost->sm, SCIC_RESET);
13751363 }
13761364
13771365 static inline void scic_sds_controller_starting_state_exit(struct sci_base_state_machine *sm)
13781366 {
1379− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1367+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
13801368
1381− sci_del_timer(&scic->timer);
1369+ sci_del_timer(&ihost->timer);
13821370 }
13831371
13841372 #define INTERRUPT_COALESCE_TIMEOUT_BASE_RANGE_LOWER_BOUND_NS 853
@@ -1405,10 +1393,10 @@ static inline void scic_sds_controller_starting_state_exit(struct sci_base_state · 20 unmodified lines
14051393 * SCI_SUCCESS The user successfully updated the interrutp coalescence.
14061394 * SCI_FAILURE_INVALID_PARAMETER_VALUE The user input value is out of range.
14071395 */
1408−static enum sci_status scic_controller_set_interrupt_coalescence(
1409− struct scic_sds_controller *scic_controller,
1410− u32 coalesce_number,
1411− u32 coalesce_timeout)
1396+static enum sci_status
1397+scic_controller_set_interrupt_coalescence(struct isci_host *ihost,
1398+ u32 coalesce_number,
1399+ u32 coalesce_timeout)
14121400 {
14131401 u8 timeout_encode = 0;
14141402 u32 min = 0;
@@ -1491,11 +1479,11 @@ static enum sci_status scic_controller_set_interrupt_coalescence( · 76 unmodified lines
14911479
14921480 writel(SMU_ICC_GEN_VAL(NUMBER, coalesce_number) |
14931481 SMU_ICC_GEN_VAL(TIMER, timeout_encode),
1494− &scic_controller->smu_registers->interrupt_coalesce_control);
1482+ &ihost->smu_registers->interrupt_coalesce_control);
14951483
14961484
1497− scic_controller->interrupt_coalesce_number = (u16)coalesce_number;
1498− scic_controller->interrupt_coalesce_timeout = coalesce_timeout / 100;
1485+ ihost->interrupt_coalesce_number = (u16)coalesce_number;
1486+ ihost->interrupt_coalesce_timeout = coalesce_timeout / 100;
14991487
15001488 return SCI_SUCCESS;
15011489 }
@@ -1503,26 +1491,25 @@ static enum sci_status scic_controller_set_interrupt_coalescence( · 1 unmodified line
15031491
15041492 static void scic_sds_controller_ready_state_enter(struct sci_base_state_machine *sm)
15051493 {
1506− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1494+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
15071495
15081496 /* set the default interrupt coalescence number and timeout value. */
1509− scic_controller_set_interrupt_coalescence(scic, 0x10, 250);
1497+ scic_controller_set_interrupt_coalescence(ihost, 0x10, 250);
15101498 }
15111499
15121500 static void scic_sds_controller_ready_state_exit(struct sci_base_state_machine *sm)
15131501 {
1514− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1502+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
15151503
15161504 /* disable interrupt coalescence. */
1517− scic_controller_set_interrupt_coalescence(scic, 0, 0);
1505+ scic_controller_set_interrupt_coalescence(ihost, 0, 0);
15181506 }
15191507
1520−static enum sci_status scic_sds_controller_stop_phys(struct scic_sds_controller *scic)
1508+static enum sci_status scic_sds_controller_stop_phys(struct isci_host *ihost)
15211509 {
15221510 u32 index;
15231511 enum sci_status status;
15241512 enum sci_status phy_status;
1525− struct isci_host *ihost = scic_to_ihost(scic);
15261513
15271514 status = SCI_SUCCESS;
15281515
@@ -1533,7 +1520,7 @@ static enum sci_status scic_sds_controller_stop_phys(struct scic_sds_controller · 4 unmodified lines
15331520 phy_status != SCI_FAILURE_INVALID_STATE) {
15341521 status = SCI_FAILURE;
15351522
1536− dev_warn(scic_to_dev(scic),
1523+ dev_warn(&ihost->pdev->dev,
15371524 "%s: Controller stop operation failed to stop "
15381525 "phy %d because of status %d.\n",
15391526 __func__,
@@ -1544,14 +1531,13 @@ static enum sci_status scic_sds_controller_stop_phys(struct scic_sds_controller · 4 unmodified lines
15441531 return status;
15451532 }
15461533
1547−static enum sci_status scic_sds_controller_stop_ports(struct scic_sds_controller *scic)
1534+static enum sci_status scic_sds_controller_stop_ports(struct isci_host *ihost)
15481535 {
15491536 u32 index;
15501537 enum sci_status port_status;
15511538 enum sci_status status = SCI_SUCCESS;
1552− struct isci_host *ihost = scic_to_ihost(scic);
15531539
1554− for (index = 0; index < scic->logical_port_entries; index++) {
1540+ for (index = 0; index < ihost->logical_port_entries; index++) {
15551541 struct isci_port *iport = &ihost->ports[index];
15561542
15571543 port_status = scic_sds_port_stop(iport);
@@ -1560,7 +1546,7 @@ static enum sci_status scic_sds_controller_stop_ports(struct scic_sds_controller · 2 unmodified lines
15601546 (port_status != SCI_FAILURE_INVALID_STATE)) {
15611547 status = SCI_FAILURE;
15621548
1563− dev_warn(scic_to_dev(scic),
1549+ dev_warn(&ihost->pdev->dev,
15641550 "%s: Controller stop operation failed to "
15651551 "stop port %d because of status %d.\n",
15661552 __func__,
@@ -1572,7 +1558,7 @@ static enum sci_status scic_sds_controller_stop_ports(struct scic_sds_controller · 5 unmodified lines
15721558 return status;
15731559 }
15741560
1575−static enum sci_status scic_sds_controller_stop_devices(struct scic_sds_controller *scic)
1561+static enum sci_status scic_sds_controller_stop_devices(struct isci_host *ihost)
15761562 {
15771563 u32 index;
15781564 enum sci_status status;
@@ -1580,19 +1566,19 @@ static enum sci_status scic_sds_controller_stop_devices(struct scic_sds_controll · 1 unmodified line
15801566
15811567 status = SCI_SUCCESS;
15821568
1583− for (index = 0; index < scic->remote_node_entries; index++) {
1584− if (scic->device_table[index] != NULL) {
1569+ for (index = 0; index < ihost->remote_node_entries; index++) {
1570+ if (ihost->device_table[index] != NULL) {
15851571 /* / @todo What timeout value do we want to provide to this request? */
1586− device_status = scic_remote_device_stop(scic->device_table[index], 0);
1572+ device_status = scic_remote_device_stop(ihost->device_table[index], 0);
15871573
15881574 if ((device_status != SCI_SUCCESS) &&
15891575 (device_status != SCI_FAILURE_INVALID_STATE)) {
1590− dev_warn(scic_to_dev(scic),
1576+ dev_warn(&ihost->pdev->dev,
15911577 "%s: Controller stop operation failed "
15921578 "to stop device 0x%p because of "
15931579 "status %d.\n",
15941580 __func__,
1595− scic->device_table[index], device_status);
1581+ ihost->device_table[index], device_status);
15961582 }
15971583 }
15981584 }
@@ -1602,19 +1588,19 @@ static enum sci_status scic_sds_controller_stop_devices(struct scic_sds_controll · 3 unmodified lines
16021588
16031589 static void scic_sds_controller_stopping_state_enter(struct sci_base_state_machine *sm)
16041590 {
1605− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1591+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
16061592
16071593 /* Stop all of the components for this controller */
1608− scic_sds_controller_stop_phys(scic);
1609− scic_sds_controller_stop_ports(scic);
1610− scic_sds_controller_stop_devices(scic);
1594+ scic_sds_controller_stop_phys(ihost);
1595+ scic_sds_controller_stop_ports(ihost);
1596+ scic_sds_controller_stop_devices(ihost);
16111597 }
16121598
16131599 static void scic_sds_controller_stopping_state_exit(struct sci_base_state_machine *sm)
16141600 {
1615− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1601+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
16161602
1617− sci_del_timer(&scic->timer);
1603+ sci_del_timer(&ihost->timer);
16181604 }
16191605
16201606
@@ -1623,30 +1609,30 @@ static void scic_sds_controller_stopping_state_exit(struct sci_base_state_machin · 2 unmodified lines
16231609 *
16241610 * This method will reset the controller hardware.
16251611 */
1626−static void scic_sds_controller_reset_hardware(struct scic_sds_controller *scic)
1612+static void scic_sds_controller_reset_hardware(struct isci_host *ihost)
16271613 {
16281614 /* Disable interrupts so we dont take any spurious interrupts */
1629− scic_controller_disable_interrupts(scic);
1615+ scic_controller_disable_interrupts(ihost);
16301616
16311617 /* Reset the SCU */
1632− writel(0xFFFFFFFF, &scic->smu_registers->soft_reset_control);
1618+ writel(0xFFFFFFFF, &ihost->smu_registers->soft_reset_control);
16331619
16341620 /* Delay for 1ms to before clearing the CQP and UFQPR. */
16351621 udelay(1000);
16361622
16371623 /* The write to the CQGR clears the CQP */
1638− writel(0x00000000, &scic->smu_registers->completion_queue_get);
1624+ writel(0x00000000, &ihost->smu_registers->completion_queue_get);
16391625
16401626 /* The write to the UFQGP clears the UFQPR */
1641− writel(0, &scic->scu_registers->sdma.unsolicited_frame_get_pointer);
1627+ writel(0, &ihost->scu_registers->sdma.unsolicited_frame_get_pointer);
16421628 }
16431629
16441630 static void scic_sds_controller_resetting_state_enter(struct sci_base_state_machine *sm)
16451631 {
1646− struct scic_sds_controller *scic = container_of(sm, typeof(*scic), sm);
1632+ struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
16471633
1648− scic_sds_controller_reset_hardware(scic);
1649− sci_change_state(&scic->sm, SCIC_RESET);
1634+ scic_sds_controller_reset_hardware(ihost);
1635+ sci_change_state(&ihost->sm, SCIC_RESET);
16501636 }
16511637
16521638 static const struct sci_base_state scic_sds_controller_state_table[] = {
@@ -1674,58 +1660,56 @@ static const struct sci_base_state scic_sds_controller_state_table[] = { · 21 unmodified lines
16741660 [SCIC_FAILED] = {}
16751661 };
16761662
1677−static void scic_sds_controller_set_default_config_parameters(struct scic_sds_controller *scic)
1663+static void scic_sds_controller_set_default_config_parameters(struct isci_host *ihost)
16781664 {
16791665 /* these defaults are overridden by the platform / firmware */
1680− struct isci_host *ihost = scic_to_ihost(scic);
16811666 u16 index;
16821667
16831668 /* Default to APC mode. */
1684− scic->oem_parameters.sds1.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE;
1669+ ihost->oem_parameters.sds1.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE;
16851670
16861671 /* Default to APC mode. */
1687− scic->oem_parameters.sds1.controller.max_concurrent_dev_spin_up = 1;
1672+ ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up = 1;
16881673
16891674 /* Default to no SSC operation. */
1690− scic->oem_parameters.sds1.controller.do_enable_ssc = false;
1675+ ihost->oem_parameters.sds1.controller.do_enable_ssc = false;
16911676
16921677 /* Initialize all of the port parameter information to narrow ports. */
16931678 for (index = 0; index < SCI_MAX_PORTS; index++) {
1694− scic->oem_parameters.sds1.ports[index].phy_mask = 0;
1679+ ihost->oem_parameters.sds1.ports[index].phy_mask = 0;
16951680 }
16961681
16971682 /* Initialize all of the phy parameter information. */
16981683 for (index = 0; index < SCI_MAX_PHYS; index++) {
16991684 /* Default to 6G (i.e. Gen 3) for now. */
1700− scic->user_parameters.sds1.phys[index].max_speed_generation = 3;
1685+ ihost->user_parameters.sds1.phys[index].max_speed_generation = 3;
17011686
17021687 /* the frequencies cannot be 0 */
1703− scic->user_parameters.sds1.phys[index].align_insertion_frequency = 0x7f;
1704− scic->user_parameters.sds1.phys[index].in_connection_align_insertion_frequency = 0xff;
1705− scic->user_parameters.sds1.phys[index].notify_enable_spin_up_insertion_frequency = 0x33;
1688+ ihost->user_parameters.sds1.phys[index].align_insertion_frequency = 0x7f;
1689+ ihost->user_parameters.sds1.phys[index].in_connection_align_insertion_frequency = 0xff;
1690+ ihost->user_parameters.sds1.phys[index].notify_enable_spin_up_insertion_frequency = 0x33;
17061691
17071692 /*
17081693 * Previous Vitesse based expanders had a arbitration issue that
17091694 * is worked around by having the upper 32-bits of SAS address
17101695 * with a value greater then the Vitesse company identifier.
17111696 * Hence, usage of 0x5FCFFFFF. */
1712− scic->oem_parameters.sds1.phys[index].sas_address.low = 0x1 + ihost->id;
1713− scic->oem_parameters.sds1.phys[index].sas_address.high = 0x5FCFFFFF;
1697+ ihost->oem_parameters.sds1.phys[index].sas_address.low = 0x1 + ihost->id;
1698+ ihost->oem_parameters.sds1.phys[index].sas_address.high = 0x5FCFFFFF;
17141699 }
17151700
1716− scic->user_parameters.sds1.stp_inactivity_timeout = 5;
1717− scic->user_parameters.sds1.ssp_inactivity_timeout = 5;
1718− scic->user_parameters.sds1.stp_max_occupancy_timeout = 5;
1719− scic->user_parameters.sds1.ssp_max_occupancy_timeout = 20;
1720− scic->user_parameters.sds1.no_outbound_task_timeout = 20;
1701+ ihost->user_parameters.sds1.stp_inactivity_timeout = 5;
1702+ ihost->user_parameters.sds1.ssp_inactivity_timeout = 5;
1703+ ihost->user_parameters.sds1.stp_max_occupancy_timeout = 5;
1704+ ihost->user_parameters.sds1.ssp_max_occupancy_timeout = 20;
1705+ ihost->user_parameters.sds1.no_outbound_task_timeout = 20;
17211706 }
17221707
17231708 static void controller_timeout(unsigned long data)
17241709 {
17251710 struct sci_timer *tmr = (struct sci_timer *)data;
1726− struct scic_sds_controller *scic = container_of(tmr, typeof(*scic), timer);
1727− struct isci_host *ihost = scic_to_ihost(scic);
1728− struct sci_base_state_machine *sm = &scic->sm;
1711+ struct isci_host *ihost = container_of(tmr, typeof(*ihost), timer);
1712+ struct sci_base_state_machine *sm = &ihost->sm;
17291713 unsigned long flags;
17301714
17311715 spin_lock_irqsave(&ihost->scic_lock, flags);
@@ -1734,12 +1718,12 @@ static void controller_timeout(unsigned long data) · 2 unmodified lines
17341718 goto done;
17351719
17361720 if (sm->current_state_id == SCIC_STARTING)
1737− scic_sds_controller_transition_to_ready(scic, SCI_FAILURE_TIMEOUT);
1721+ scic_sds_controller_transition_to_ready(ihost, SCI_FAILURE_TIMEOUT);
17381722 else if (sm->current_state_id == SCIC_STOPPING) {
17391723 sci_change_state(sm, SCIC_FAILED);
17401724 isci_host_stop_complete(ihost, SCI_FAILURE_TIMEOUT);
17411725 } else /* / @todo Now what do we want to do in this case? */
1742− dev_err(scic_to_dev(scic),
1726+ dev_err(&ihost->pdev->dev,
17431727 "%s: Controller timer fired when controller was not "
17441728 "in a state being timed.\n",
17451729 __func__);
@@ -1764,24 +1748,23 @@ done: · 18 unmodified lines
17641748 * SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION This value is returned if the
17651749 * controller does not support the supplied initialization data version.
17661750 */
1767−static enum sci_status scic_controller_construct(struct scic_sds_controller *scic,
1751+static enum sci_status scic_controller_construct(struct isci_host *ihost,
17681752 void __iomem *scu_base,
17691753 void __iomem *smu_base)
17701754 {
1771− struct isci_host *ihost = scic_to_ihost(scic);
17721755 u8 i;
17731756
1774− sci_init_sm(&scic->sm, scic_sds_controller_state_table, SCIC_INITIAL);
1757+ sci_init_sm(&ihost->sm, scic_sds_controller_state_table, SCIC_INITIAL);
17751758
1776− scic->scu_registers = scu_base;
1777− scic->smu_registers = smu_base;
1759+ ihost->scu_registers = scu_base;
1760+ ihost->smu_registers = smu_base;
17781761
1779− scic_sds_port_configuration_agent_construct(&scic->port_agent);
1762+ scic_sds_port_configuration_agent_construct(&ihost->port_agent);
17801763
17811764 /* Construct the ports for this controller */
17821765 for (i = 0; i < SCI_MAX_PORTS; i++)
1783− scic_sds_port_construct(&ihost->ports[i], i, scic);
1784− scic_sds_port_construct(&ihost->ports[i], SCIC_SDS_DUMMY_PORT, scic);
1766+ scic_sds_port_construct(&ihost->ports[i], i, ihost);
1767+ scic_sds_port_construct(&ihost->ports[i], SCIC_SDS_DUMMY_PORT, ihost);
17851768
17861769 /* Construct the phys for this controller */
17871770 for (i = 0; i < SCI_MAX_PHYS; i++) {
@@ -1790,14 +1773,14 @@ static enum sci_status scic_controller_construct(struct scic_sds_controller *sci · 2 unmodified lines
17901773 &ihost->ports[SCI_MAX_PORTS], i);
17911774 }
17921775
1793− scic->invalid_phy_mask = 0;
1776+ ihost->invalid_phy_mask = 0;
17941777
1795− sci_init_timer(&scic->timer, controller_timeout);
1778+ sci_init_timer(&ihost->timer, controller_timeout);
17961779
17971780 /* Initialize the User and OEM parameters to default values. */
1798− scic_sds_controller_set_default_config_parameters(scic);
1781+ scic_sds_controller_set_default_config_parameters(ihost);
17991782
1800− return scic_controller_reset(scic);
1783+ return scic_controller_reset(ihost);
18011784 }
18021785
18031786 int scic_oem_parameters_validate(struct scic_sds_oem_params *oem)
@@ -1834,10 +1817,10 @@ int scic_oem_parameters_validate(struct scic_sds_oem_params *oem) · 30 unmodified lines
18341817 return 0;
18351818 }
18361819
1837−static enum sci_status scic_oem_parameters_set(struct scic_sds_controller *scic,
1820+static enum sci_status scic_oem_parameters_set(struct isci_host *ihost,
18381821 union scic_oem_parameters *scic_parms)
18391822 {
1840− u32 state = scic->sm.current_state_id;
1823+ u32 state = ihost->sm.current_state_id;
18411824
18421825 if (state == SCIC_RESET ||
18431826 state == SCIC_INITIALIZING ||
@@ -1845,7 +1828,7 @@ static enum sci_status scic_oem_parameters_set(struct scic_sds_controller *scic, · 1 unmodified line
18451828
18461829 if (scic_oem_parameters_validate(&scic_parms->sds1))
18471830 return SCI_FAILURE_INVALID_PARAMETER_VALUE;
1848− scic->oem_parameters.sds1 = scic_parms->sds1;
1831+ ihost->oem_parameters.sds1 = scic_parms->sds1;
18491832
18501833 return SCI_SUCCESS;
18511834 }
@@ -1854,17 +1837,16 @@ static enum sci_status scic_oem_parameters_set(struct scic_sds_controller *scic, · 2 unmodified lines
18541837 }
18551838
18561839 void scic_oem_parameters_get(
1857− struct scic_sds_controller *scic,
1840+ struct isci_host *ihost,
18581841 union scic_oem_parameters *scic_parms)
18591842 {
1860− memcpy(scic_parms, (&scic->oem_parameters), sizeof(*scic_parms));
1843+ memcpy(scic_parms, (&ihost->oem_parameters), sizeof(*scic_parms));
18611844 }
18621845
18631846 static void power_control_timeout(unsigned long data)
18641847 {
18651848 struct sci_timer *tmr = (struct sci_timer *)data;
1866− struct scic_sds_controller *scic = container_of(tmr, typeof(*scic), power_control.timer);
1867− struct isci_host *ihost = scic_to_ihost(scic);
1849+ struct isci_host *ihost = container_of(tmr, typeof(*ihost), power_control.timer);
18681850 struct isci_phy *iphy;
18691851 unsigned long flags;
18701852 u8 i;
@@ -1874,29 +1856,29 @@ static void power_control_timeout(unsigned long data) · 3 unmodified lines
18741856 if (tmr->cancel)
18751857 goto done;
18761858
1877− scic->power_control.phys_granted_power = 0;
1859+ ihost->power_control.phys_granted_power = 0;
18781860
1879− if (scic->power_control.phys_waiting == 0) {
1880− scic->power_control.timer_started = false;
1861+ if (ihost->power_control.phys_waiting == 0) {
1862+ ihost->power_control.timer_started = false;
18811863 goto done;
18821864 }
18831865
18841866 for (i = 0; i < SCI_MAX_PHYS; i++) {
18851867
1886− if (scic->power_control.phys_waiting == 0)
1868+ if (ihost->power_control.phys_waiting == 0)
18871869 break;
18881870
1889− iphy = scic->power_control.requesters[i];
1871+ iphy = ihost->power_control.requesters[i];
18901872 if (iphy == NULL)
18911873 continue;
18921874
1893− if (scic->power_control.phys_granted_power >=
1894− scic->oem_parameters.sds1.controller.max_concurrent_dev_spin_up)
1875+ if (ihost->power_control.phys_granted_power >=
1876+ ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up)
18951877 break;
18961878
1897− scic->power_control.requesters[i] = NULL;
1898− scic->power_control.phys_waiting--;
1899− scic->power_control.phys_granted_power++;
1879+ ihost->power_control.requesters[i] = NULL;
1880+ ihost->power_control.phys_waiting--;
1881+ ihost->power_control.phys_granted_power++;
19001882 scic_sds_phy_consume_power_handler(iphy);
19011883 }
19021884
@@ -1905,7 +1887,7 @@ static void power_control_timeout(unsigned long data) · 2 unmodified lines
19051887 * timer in case another phy becomes ready.
19061888 */
19071889 sci_mod_timer(tmr, SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL);
1908− scic->power_control.timer_started = true;
1890+ ihost->power_control.timer_started = true;
19091891
19101892 done:
19111893 spin_unlock_irqrestore(&ihost->scic_lock, flags);
@@ -1918,31 +1900,31 @@ done: · 6 unmodified lines
19181900 *
19191901 */
19201902 void scic_sds_controller_power_control_queue_insert(
1921− struct scic_sds_controller *scic,
1903+ struct isci_host *ihost,
19221904 struct isci_phy *iphy)
19231905 {
19241906 BUG_ON(iphy == NULL);
19251907
1926− if (scic->power_control.phys_granted_power <
1927− scic->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) {
1928− scic->power_control.phys_granted_power++;
1908+ if (ihost->power_control.phys_granted_power <
1909+ ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) {
1910+ ihost->power_control.phys_granted_power++;
19291911 scic_sds_phy_consume_power_handler(iphy);
19301912
19311913 /*
19321914 * stop and start the power_control timer. When the timer fires, the
19331915 * no_of_phys_granted_power will be set to 0
19341916 */
1935− if (scic->power_control.timer_started)
1936− sci_del_timer(&scic->power_control.timer);
1917+ if (ihost->power_control.timer_started)
1918+ sci_del_timer(&ihost->power_control.timer);
19371919
1938− sci_mod_timer(&scic->power_control.timer,
1920+ sci_mod_timer(&ihost->power_control.timer,
19391921 SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL);
1940− scic->power_control.timer_started = true;
1922+ ihost->power_control.timer_started = true;
19411923
19421924 } else {
19431925 /* Add the phy in the waiting list */
1944− scic->power_control.requesters[iphy->phy_index] = iphy;
1945− scic->power_control.phys_waiting++;
1926+ ihost->power_control.requesters[iphy->phy_index] = iphy;
1927+ ihost->power_control.phys_waiting++;
19461928 }
19471929 }
19481930
@@ -1953,16 +1935,16 @@ void scic_sds_controller_power_control_queue_insert( · 4 unmodified lines
19531935 *
19541936 */
19551937 void scic_sds_controller_power_control_queue_remove(
1956− struct scic_sds_controller *scic,
1938+ struct isci_host *ihost,
19571939 struct isci_phy *iphy)
19581940 {
19591941 BUG_ON(iphy == NULL);
19601942
1961− if (scic->power_control.requesters[iphy->phy_index] != NULL) {
1962− scic->power_control.phys_waiting--;
1943+ if (ihost->power_control.requesters[iphy->phy_index] != NULL) {
1944+ ihost->power_control.phys_waiting--;
19631945 }
19641946
1965− scic->power_control.requesters[iphy->phy_index] = NULL;
1947+ ihost->power_control.requesters[iphy->phy_index] = NULL;
19661948 }
19671949
19681950 #define AFE_REGISTER_WRITE_DELAY 10
@@ -1970,50 +1952,50 @@ void scic_sds_controller_power_control_queue_remove( · 1 unmodified line
19701952 /* Initialize the AFE for this phy index. We need to read the AFE setup from
19711953 * the OEM parameters
19721954 */
1973−static void scic_sds_controller_afe_initialization(struct scic_sds_controller *scic)
1955+static void scic_sds_controller_afe_initialization(struct isci_host *ihost)
19741956 {
1975− const struct scic_sds_oem_params *oem = &scic->oem_parameters.sds1;
1957+ const struct scic_sds_oem_params *oem = &ihost->oem_parameters.sds1;
19761958 u32 afe_status;
19771959 u32 phy_id;
19781960
19791961 /* Clear DFX Status registers */
1980− writel(0x0081000f, &scic->scu_registers->afe.afe_dfx_master_control0);
1962+ writel(0x0081000f, &ihost->scu_registers->afe.afe_dfx_master_control0);
19811963 udelay(AFE_REGISTER_WRITE_DELAY);
19821964
19831965 if (is_b0()) {
19841966 /* PM Rx Equalization Save, PM SPhy Rx Acknowledgement
19851967 * Timer, PM Stagger Timer */
1986− writel(0x0007BFFF, &scic->scu_registers->afe.afe_pmsn_master_control2);
1968+ writel(0x0007BFFF, &ihost->scu_registers->afe.afe_pmsn_master_control2);
19871969 udelay(AFE_REGISTER_WRITE_DELAY);
19881970 }
19891971
19901972 /* Configure bias currents to normal */
19911973 if (is_a0())
1992− writel(0x00005500, &scic->scu_registers->afe.afe_bias_control);
1974+ writel(0x00005500, &ihost->scu_registers->afe.afe_bias_control);
19931975 else if (is_a2())
1994− writel(0x00005A00, &scic->scu_registers->afe.afe_bias_control);
1976+ writel(0x00005A00, &ihost->scu_registers->afe.afe_bias_control);
19951977 else if (is_b0() || is_c0())
1996− writel(0x00005F00, &scic->scu_registers->afe.afe_bias_control);
1978+ writel(0x00005F00, &ihost->scu_registers->afe.afe_bias_control);
19971979
19981980 udelay(AFE_REGISTER_WRITE_DELAY);
19991981
20001982 /* Enable PLL */
20011983 if (is_b0() || is_c0())
2002− writel(0x80040A08, &scic->scu_registers->afe.afe_pll_control0);
1984+ writel(0x80040A08, &ihost->scu_registers->afe.afe_pll_control0);
20031985 else
2004− writel(0x80040908, &scic->scu_registers->afe.afe_pll_control0);
1986+ writel(0x80040908, &ihost->scu_registers->afe.afe_pll_control0);
20051987
20061988 udelay(AFE_REGISTER_WRITE_DELAY);
20071989
20081990 /* Wait for the PLL to lock */
20091991 do {
2010− afe_status = readl(&scic->scu_registers->afe.afe_common_block_status);
1992+ afe_status = readl(&ihost->scu_registers->afe.afe_common_block_status);
20111993 udelay(AFE_REGISTER_WRITE_DELAY);
20121994 } while ((afe_status & 0x00001000) == 0);
20131995
20141996 if (is_a0() || is_a2()) {
20151997 /* Shorten SAS SNW lock time (RxLock timer value from 76 us to 50 us) */
2016− writel(0x7bcc96ad, &scic->scu_registers->afe.afe_pmsn_master_control0);
1998+ writel(0x7bcc96ad, &ihost->scu_registers->afe.afe_pmsn_master_control0);
20171999 udelay(AFE_REGISTER_WRITE_DELAY);
20182000 }
20192001
@@ -2022,26 +2004,26 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s · 2 unmodified lines
20222004
20232005 if (is_b0()) {
20242006 /* Configure transmitter SSC parameters */
2025− writel(0x00030000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control);
2007+ writel(0x00030000, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control);
20262008 udelay(AFE_REGISTER_WRITE_DELAY);
20272009 } else if (is_c0()) {
20282010 /* Configure transmitter SSC parameters */
2029− writel(0x0003000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control);
2011+ writel(0x0003000, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control);
20302012 udelay(AFE_REGISTER_WRITE_DELAY);
20312013
20322014 /*
20332015 * All defaults, except the Receive Word Alignament/Comma Detect
20342016 * Enable....(0xe800) */
2035− writel(0x00004500, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
2017+ writel(0x00004500, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
20362018 udelay(AFE_REGISTER_WRITE_DELAY);
20372019 } else {
20382020 /*
20392021 * All defaults, except the Receive Word Alignament/Comma Detect
20402022 * Enable....(0xe800) */
2041− writel(0x00004512, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
2023+ writel(0x00004512, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
20422024 udelay(AFE_REGISTER_WRITE_DELAY);
20432025
2044− writel(0x0050100F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control1);
2026+ writel(0x0050100F, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control1);
20452027 udelay(AFE_REGISTER_WRITE_DELAY);
20462028 }
20472029
@@ -2049,106 +2031,105 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s · 1 unmodified line
20492031 * Power up TX and RX out from power down (PWRDNTX and PWRDNRX)
20502032 * & increase TX int & ext bias 20%....(0xe85c) */
20512033 if (is_a0())
2052− writel(0x000003D4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2034+ writel(0x000003D4, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
20532035 else if (is_a2())
2054− writel(0x000003F0, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2036+ writel(0x000003F0, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
20552037 else if (is_b0()) {
20562038 /* Power down TX and RX (PWRDNTX and PWRDNRX) */
2057− writel(0x000003D7, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2039+ writel(0x000003D7, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
20582040 udelay(AFE_REGISTER_WRITE_DELAY);
20592041
20602042 /*
20612043 * Power up TX and RX out from power down (PWRDNTX and PWRDNRX)
20622044 * & increase TX int & ext bias 20%....(0xe85c) */
2063− writel(0x000003D4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2045+ writel(0x000003D4, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
20642046 } else {
2065− writel(0x000001E7, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2047+ writel(0x000001E7, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
20662048 udelay(AFE_REGISTER_WRITE_DELAY);
20672049
20682050 /*
20692051 * Power up TX and RX out from power down (PWRDNTX and PWRDNRX)
20702052 * & increase TX int & ext bias 20%....(0xe85c) */
2071− writel(0x000001E4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2053+ writel(0x000001E4, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
20722054 }
20732055 udelay(AFE_REGISTER_WRITE_DELAY);
20742056
20752057 if (is_a0() || is_a2()) {
20762058 /* Enable TX equalization (0xe824) */
2077− writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
2059+ writel(0x00040000, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
20782060 udelay(AFE_REGISTER_WRITE_DELAY);
20792061 }
20802062
20812063 /*
20822064 * RDPI=0x0(RX Power On), RXOOBDETPDNC=0x0, TPD=0x0(TX Power On),
20832065 * RDD=0x0(RX Detect Enabled) ....(0xe800) */
2084− writel(0x00004100, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
2066+ writel(0x00004100, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
20852067 udelay(AFE_REGISTER_WRITE_DELAY);
20862068
20872069 /* Leave DFE/FFE on */
20882070 if (is_a0())
2089− writel(0x3F09983F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
2071+ writel(0x3F09983F, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
20902072 else if (is_a2())
2091− writel(0x3F11103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
2073+ writel(0x3F11103F, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
20922074 else if (is_b0()) {
2093− writel(0x3F11103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
2075+ writel(0x3F11103F, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
20942076 udelay(AFE_REGISTER_WRITE_DELAY);
20952077 /* Enable TX equalization (0xe824) */
2096− writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
2078+ writel(0x00040000, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
20972079 } else {
2098− writel(0x0140DF0F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control1);
2080+ writel(0x0140DF0F, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control1);
20992081 udelay(AFE_REGISTER_WRITE_DELAY);
21002082
2101− writel(0x3F6F103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
2083+ writel(0x3F6F103F, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
21022084 udelay(AFE_REGISTER_WRITE_DELAY);
21032085
21042086 /* Enable TX equalization (0xe824) */
2105− writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
2087+ writel(0x00040000, &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
21062088 }
21072089
21082090 udelay(AFE_REGISTER_WRITE_DELAY);
21092091
21102092 writel(oem_phy->afe_tx_amp_control0,
2111− &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control0);
2093+ &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control0);
21122094 udelay(AFE_REGISTER_WRITE_DELAY);
21132095
21142096 writel(oem_phy->afe_tx_amp_control1,
2115− &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control1);
2097+ &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control1);
21162098 udelay(AFE_REGISTER_WRITE_DELAY);
21172099
21182100 writel(oem_phy->afe_tx_amp_control2,
2119− &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control2);
2101+ &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control2);
21202102 udelay(AFE_REGISTER_WRITE_DELAY);
21212103
21222104 writel(oem_phy->afe_tx_amp_control3,
2123− &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control3);
2105+ &ihost->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_amp_control3);
21242106 udelay(AFE_REGISTER_WRITE_DELAY);
21252107 }
21262108
21272109 /* Transfer control to the PEs */
2128− writel(0x00010f00, &scic->scu_registers->afe.afe_dfx_master_control0);
2110+ writel(0x00010f00, &ihost->scu_registers->afe.afe_dfx_master_control0);
21292111 udelay(AFE_REGISTER_WRITE_DELAY);
21302112 }
21312113
2132−static void scic_sds_controller_initialize_power_control(struct scic_sds_controller *scic)
2114+static void scic_sds_controller_initialize_power_control(struct isci_host *ihost)
21332115 {
2134− sci_init_timer(&scic->power_control.timer, power_control_timeout);
2116+ sci_init_timer(&ihost->power_control.timer, power_control_timeout);
21352117
2136− memset(scic->power_control.requesters, 0,
2137− sizeof(scic->power_control.requesters));
2118+ memset(ihost->power_control.requesters, 0,
2119+ sizeof(ihost->power_control.requesters));
21382120
2139− scic->power_control.phys_waiting = 0;
2140− scic->power_control.phys_granted_power = 0;
2121+ ihost->power_control.phys_waiting = 0;
2122+ ihost->power_control.phys_granted_power = 0;
21412123 }
21422124
2143−static enum sci_status scic_controller_initialize(struct scic_sds_controller *scic)
2125+static enum sci_status scic_controller_initialize(struct isci_host *ihost)
21442126 {
2145− struct sci_base_state_machine *sm = &scic->sm;
2146− struct isci_host *ihost = scic_to_ihost(scic);
2127+ struct sci_base_state_machine *sm = &ihost->sm;
21472128 enum sci_status result = SCI_FAILURE;
21482129 unsigned long i, state, val;
21492130
2150− if (scic->sm.current_state_id != SCIC_RESET) {
2151− dev_warn(scic_to_dev(scic),
2131+ if (ihost->sm.current_state_id != SCIC_RESET) {
2132+ dev_warn(&ihost->pdev->dev,
21522133 "SCIC Controller initialize operation requested "
21532134 "in invalid state\n");
21542135 return SCI_FAILURE_INVALID_STATE;
@@ -2156,23 +2137,23 @@ static enum sci_status scic_controller_initialize(struct scic_sds_controller *sc · 1 unmodified line
21562137
21572138 sci_change_state(sm, SCIC_INITIALIZING);
21582139
2159− sci_init_timer(&scic->phy_timer, phy_startup_timeout);
2140+ sci_init_timer(&ihost->phy_timer, phy_startup_timeout);
21602141
2161− scic->next_phy_to_start = 0;
2162− scic->phy_startup_timer_pending = false;
2142+ ihost->next_phy_to_start = 0;
2143+ ihost->phy_startup_timer_pending = false;
21632144
2164− scic_sds_controller_initialize_power_control(scic);
2145+ scic_sds_controller_initialize_power_control(ihost);
21652146
21662147 /*
21672148 * There is nothing to do here for B0 since we do not have to
21682149 * program the AFE registers.
21692150 * / @todo The AFE settings are supposed to be correct for the B0 but
21702151 * / presently they seem to be wrong. */
2171− scic_sds_controller_afe_initialization(scic);
2152+ scic_sds_controller_afe_initialization(ihost);
21722153
21732154
21742155 /* Take the hardware out of reset */
2175− writel(0, &scic->smu_registers->soft_reset_control);
2156+ writel(0, &ihost->smu_registers->soft_reset_control);
21762157
21772158 /*
21782159 * / @todo Provide meaningfull error code for hardware failure
@@ -2182,7 +2163,7 @@ static enum sci_status scic_controller_initialize(struct scic_sds_controller *sc · 3 unmodified lines
21822163
21832164 /* Loop until the hardware reports success */
21842165 udelay(SCU_CONTEXT_RAM_INIT_STALL_TIME);
2185− status = readl(&scic->smu_registers->control_status);
2166+ status = readl(&ihost->smu_registers->control_status);
21862167
21872168 if ((status & SCU_RAM_INIT_COMPLETED) == SCU_RAM_INIT_COMPLETED)
21882169 break;
@@ -2193,32 +2174,32 @@ static enum sci_status scic_controller_initialize(struct scic_sds_controller *sc · 4 unmodified lines
21932174 /*
21942175 * Determine what are the actaul device capacities that the
21952176 * hardware will support */
2196− val = readl(&scic->smu_registers->device_context_capacity);
2177+ val = readl(&ihost->smu_registers->device_context_capacity);
21972178
21982179 /* Record the smaller of the two capacity values */
2199− scic->logical_port_entries = min(smu_max_ports(val), SCI_MAX_PORTS);
2200− scic->task_context_entries = min(smu_max_task_contexts(val), SCI_MAX_IO_REQUESTS);
2201− scic->remote_node_entries = min(smu_max_rncs(val), SCI_MAX_REMOTE_DEVICES);
2180+ ihost->logical_port_entries = min(smu_max_ports(val), SCI_MAX_PORTS);
2181+ ihost->task_context_entries = min(smu_max_task_contexts(val), SCI_MAX_IO_REQUESTS);
2182+ ihost->remote_node_entries = min(smu_max_rncs(val), SCI_MAX_REMOTE_DEVICES);
22022183
22032184 /*
22042185 * Make all PEs that are unassigned match up with the
22052186 * logical ports
22062187 */
2207− for (i = 0; i < scic->logical_port_entries; i++) {
2188+ for (i = 0; i < ihost->logical_port_entries; i++) {
22082189 struct scu_port_task_scheduler_group_registers __iomem
2209− *ptsg = &scic->scu_registers->peg0.ptsg;
2190+ *ptsg = &ihost->scu_registers->peg0.ptsg;
22102191
22112192 writel(i, &ptsg->protocol_engine[i]);
22122193 }
22132194
22142195 /* Initialize hardware PCI Relaxed ordering in DMA engines */
2215− val = readl(&scic->scu_registers->sdma.pdma_configuration);
2196+ val = readl(&ihost->scu_registers->sdma.pdma_configuration);
22162197 val |= SCU_PDMACR_GEN_BIT(PCI_RELAXED_ORDERING_ENABLE);
2217− writel(val, &scic->scu_registers->sdma.pdma_configuration);
2198+ writel(val, &ihost->scu_registers->sdma.pdma_configuration);
22182199
2219− val = readl(&scic->scu_registers->sdma.cdma_configuration);
2200+ val = readl(&ihost->scu_registers->sdma.cdma_configuration);
22202201 val |= SCU_CDMACR_GEN_BIT(PCI_RELAXED_ORDERING_ENABLE);
2221− writel(val, &scic->scu_registers->sdma.cdma_configuration);
2202+ writel(val, &ihost->scu_registers->sdma.cdma_configuration);
22222203
22232204 /*
22242205 * Initialize the PHYs before the PORTs because the PHY registers
@@ -2226,23 +2207,23 @@ static enum sci_status scic_controller_initialize(struct scic_sds_controller *sc · 1 unmodified line
22262207 */
22272208 for (i = 0; i < SCI_MAX_PHYS; i++) {
22282209 result = scic_sds_phy_initialize(&ihost->phys[i],
2229− &scic->scu_registers->peg0.pe[i].tl,
2230− &scic->scu_registers->peg0.pe[i].ll);
2210+ &ihost->scu_registers->peg0.pe[i].tl,
2211+ &ihost->scu_registers->peg0.pe[i].ll);
22312212 if (result != SCI_SUCCESS)
22322213 goto out;
22332214 }
22342215
2235− for (i = 0; i < scic->logical_port_entries; i++) {
2216+ for (i = 0; i < ihost->logical_port_entries; i++) {
22362217 result = scic_sds_port_initialize(&ihost->ports[i],
2237− &scic->scu_registers->peg0.ptsg.port[i],
2238− &scic->scu_registers->peg0.ptsg.protocol_engine,
2239− &scic->scu_registers->peg0.viit[i]);
2218+ &ihost->scu_registers->peg0.ptsg.port[i],
2219+ &ihost->scu_registers->peg0.ptsg.protocol_engine,
2220+ &ihost->scu_registers->peg0.viit[i]);
22402221
22412222 if (result != SCI_SUCCESS)
22422223 goto out;
22432224 }
22442225
2245− result = scic_sds_port_configuration_agent_initialize(scic, &scic->port_agent);
2226+ result = scic_sds_port_configuration_agent_initialize(ihost, &ihost->port_agent);
22462227
22472228 out:
22482229 /* Advance the controller state machine */
@@ -2256,10 +2237,10 @@ static enum sci_status scic_controller_initialize(struct scic_sds_controller *sc · 7 unmodified lines
22562237 }
22572238
22582239 static enum sci_status scic_user_parameters_set(
2259− struct scic_sds_controller *scic,
2240+ struct isci_host *ihost,
22602241 union scic_user_parameters *scic_parms)
22612242 {
2262− u32 state = scic->sm.current_state_id;
2243+ u32 state = ihost->sm.current_state_id;
22632244
22642245 if (state == SCIC_RESET ||
22652246 state == SCIC_INITIALIZING ||
@@ -2301,7 +2282,7 @@ static enum sci_status scic_user_parameters_set( · 35 unmodified lines
23012282 (scic_parms->sds1.no_outbound_task_timeout == 0))
23022283 return SCI_FAILURE_INVALID_PARAMETER_VALUE;
23032284
2304− memcpy(&scic->user_parameters, scic_parms, sizeof(*scic_parms));
2285+ memcpy(&ihost->user_parameters, scic_parms, sizeof(*scic_parms));
23052286
23062287 return SCI_SUCCESS;
23072288 }
@@ -2309,40 +2290,40 @@ static enum sci_status scic_user_parameters_set( · 1 unmodified line
23092290 return SCI_FAILURE_INVALID_STATE;
23102291 }
23112292
2312−static int scic_controller_mem_init(struct scic_sds_controller *scic)
2293+static int scic_controller_mem_init(struct isci_host *ihost)
23132294 {
2314− struct device *dev = scic_to_dev(scic);
2295+ struct device *dev = &ihost->pdev->dev;
23152296 dma_addr_t dma;
23162297 size_t size;
23172298 int err;
23182299
23192300 size = SCU_MAX_COMPLETION_QUEUE_ENTRIES * sizeof(u32);
2320− scic->completion_queue = dmam_alloc_coherent(dev, size, &dma, GFP_KERNEL);
2321− if (!scic->completion_queue)
2301+ ihost->completion_queue = dmam_alloc_coherent(dev, size, &dma, GFP_KERNEL);
2302+ if (!ihost->completion_queue)
23222303 return -ENOMEM;
23232304
2324− writel(lower_32_bits(dma), &scic->smu_registers->completion_queue_lower);
2325− writel(upper_32_bits(dma), &scic->smu_registers->completion_queue_upper);
2305+ writel(lower_32_bits(dma), &ihost->smu_registers->completion_queue_lower);
2306+ writel(upper_32_bits(dma), &ihost->smu_registers->completion_queue_upper);
23262307
2327− size = scic->remote_node_entries * sizeof(union scu_remote_node_context);
2328− scic->remote_node_context_table = dmam_alloc_coherent(dev, size, &dma,
2308+ size = ihost->remote_node_entries * sizeof(union scu_remote_node_context);
2309+ ihost->remote_node_context_table = dmam_alloc_coherent(dev, size, &dma,
23292310 GFP_KERNEL);
2330− if (!scic->remote_node_context_table)
2311+ if (!ihost->remote_node_context_table)
23312312 return -ENOMEM;
23322313
2333− writel(lower_32_bits(dma), &scic->smu_registers->remote_node_context_lower);
2334− writel(upper_32_bits(dma), &scic->smu_registers->remote_node_context_upper);
2314+ writel(lower_32_bits(dma), &ihost->smu_registers->remote_node_context_lower);
2315+ writel(upper_32_bits(dma), &ihost->smu_registers->remote_node_context_upper);
23352316
2336− size = scic->task_context_entries * sizeof(struct scu_task_context),
2337− scic->task_context_table = dmam_alloc_coherent(dev, size, &dma, GFP_KERNEL);
2338− if (!scic->task_context_table)
2317+ size = ihost->task_context_entries * sizeof(struct scu_task_context),
2318+ ihost->task_context_table = dmam_alloc_coherent(dev, size, &dma, GFP_KERNEL);
2319+ if (!ihost->task_context_table)
23392320 return -ENOMEM;
23402321
2341− scic->task_context_dma = dma;
2342− writel(lower_32_bits(dma), &scic->smu_registers->host_task_table_lower);
2343− writel(upper_32_bits(dma), &scic->smu_registers->host_task_table_upper);
2322+ ihost->task_context_dma = dma;
2323+ writel(lower_32_bits(dma), &ihost->smu_registers->host_task_table_lower);
2324+ writel(upper_32_bits(dma), &ihost->smu_registers->host_task_table_upper);
23442325
2345− err = scic_sds_unsolicited_frame_control_construct(scic);
2326+ err = scic_sds_unsolicited_frame_control_construct(ihost);
23462327 if (err)
23472328 return err;
23482329
@@ -2350,112 +2331,112 @@ static int scic_controller_mem_init(struct scic_sds_controller *scic) · 1 unmodified line
23502331 * Inform the silicon as to the location of the UF headers and
23512332 * address table.
23522333 */
2353− writel(lower_32_bits(scic->uf_control.headers.physical_address),
2354− &scic->scu_registers->sdma.uf_header_base_address_lower);
2355− writel(upper_32_bits(scic->uf_control.headers.physical_address),
2356− &scic->scu_registers->sdma.uf_header_base_address_upper);
2334+ writel(lower_32_bits(ihost->uf_control.headers.physical_address),
2335+ &ihost->scu_registers->sdma.uf_header_base_address_lower);
2336+ writel(upper_32_bits(ihost->uf_control.headers.physical_address),
2337+ &ihost->scu_registers->sdma.uf_header_base_address_upper);
23572338
2358− writel(lower_32_bits(scic->uf_control.address_table.physical_address),
2359− &scic->scu_registers->sdma.uf_address_table_lower);
2360− writel(upper_32_bits(scic->uf_control.address_table.physical_address),
2361− &scic->scu_registers->sdma.uf_address_table_upper);
2339+ writel(lower_32_bits(ihost->uf_control.address_table.physical_address),
2340+ &ihost->scu_registers->sdma.uf_address_table_lower);
2341+ writel(upper_32_bits(ihost->uf_control.address_table.physical_address),
2342+ &ihost->scu_registers->sdma.uf_address_table_upper);
23622343
23632344 return 0;
23642345 }
23652346
2366−int isci_host_init(struct isci_host *isci_host)
2347+int isci_host_init(struct isci_host *ihost)
23672348 {
23682349 int err = 0, i;
23692350 enum sci_status status;
23702351 union scic_oem_parameters oem;
23712352 union scic_user_parameters scic_user_params;
2372− struct isci_pci_info *pci_info = to_pci_info(isci_host->pdev);
2353+ struct isci_pci_info *pci_info = to_pci_info(ihost->pdev);
23732354
2374− spin_lock_init(&isci_host->state_lock);
2375− spin_lock_init(&isci_host->scic_lock);
2376− init_waitqueue_head(&isci_host->eventq);
2355+ spin_lock_init(&ihost->state_lock);
2356+ spin_lock_init(&ihost->scic_lock);
2357+ init_waitqueue_head(&ihost->eventq);
23772358
2378− isci_host_change_state(isci_host, isci_starting);
2359+ isci_host_change_state(ihost, isci_starting);
23792360
2380− status = scic_controller_construct(&isci_host->sci, scu_base(isci_host),
2381− smu_base(isci_host));
2361+ status = scic_controller_construct(ihost, scu_base(ihost),
2362+ smu_base(ihost));
23822363
23832364 if (status != SCI_SUCCESS) {
2384− dev_err(&isci_host->pdev->dev,
2365+ dev_err(&ihost->pdev->dev,
23852366 "%s: scic_controller_construct failed - status = %x\n",
23862367 __func__,
23872368 status);
23882369 return -ENODEV;
23892370 }
23902371
2391− isci_host->sas_ha.dev = &isci_host->pdev->dev;
2392− isci_host->sas_ha.lldd_ha = isci_host;
2372+ ihost->sas_ha.dev = &ihost->pdev->dev;
2373+ ihost->sas_ha.lldd_ha = ihost;
23932374
23942375 /*
23952376 * grab initial values stored in the controller object for OEM and USER
23962377 * parameters
23972378 */
2398− isci_user_parameters_get(isci_host, &scic_user_params);
2399− status = scic_user_parameters_set(&isci_host->sci,
2379+ isci_user_parameters_get(ihost, &scic_user_params);
2380+ status = scic_user_parameters_set(ihost,
24002381 &scic_user_params);
24012382 if (status != SCI_SUCCESS) {
2402− dev_warn(&isci_host->pdev->dev,
2383+ dev_warn(&ihost->pdev->dev,
24032384 "%s: scic_user_parameters_set failed\n",
24042385 __func__);
24052386 return -ENODEV;
24062387 }
24072388
2408− scic_oem_parameters_get(&isci_host->sci, &oem);
2389+ scic_oem_parameters_get(ihost, &oem);
24092390
24102391 /* grab any OEM parameters specified in orom */
24112392 if (pci_info->orom) {
24122393 status = isci_parse_oem_parameters(&oem,
24132394 pci_info->orom,
2414− isci_host->id);
2395+ ihost->id);
24152396 if (status != SCI_SUCCESS) {
2416− dev_warn(&isci_host->pdev->dev,
2397+ dev_warn(&ihost->pdev->dev,
24172398 "parsing firmware oem parameters failed\n");
24182399 return -EINVAL;
24192400 }
24202401 }
24212402
2422− status = scic_oem_parameters_set(&isci_host->sci, &oem);
2403+ status = scic_oem_parameters_set(ihost, &oem);
24232404 if (status != SCI_SUCCESS) {
2424− dev_warn(&isci_host->pdev->dev,
2405+ dev_warn(&ihost->pdev->dev,
24252406 "%s: scic_oem_parameters_set failed\n",
24262407 __func__);
24272408 return -ENODEV;
24282409 }
24292410
2430− tasklet_init(&isci_host->completion_tasklet,
2431− isci_host_completion_routine, (unsigned long)isci_host);
2411+ tasklet_init(&ihost->completion_tasklet,
2412+ isci_host_completion_routine, (unsigned long)ihost);
24322413
2433− INIT_LIST_HEAD(&isci_host->requests_to_complete);
2434− INIT_LIST_HEAD(&isci_host->requests_to_errorback);
2414+ INIT_LIST_HEAD(&ihost->requests_to_complete);
2415+ INIT_LIST_HEAD(&ihost->requests_to_errorback);
24352416
2436− spin_lock_irq(&isci_host->scic_lock);
2437− status = scic_controller_initialize(&isci_host->sci);
2438− spin_unlock_irq(&isci_host->scic_lock);
2417+ spin_lock_irq(&ihost->scic_lock);
2418+ status = scic_controller_initialize(ihost);
2419+ spin_unlock_irq(&ihost->scic_lock);
24392420 if (status != SCI_SUCCESS) {
2440− dev_warn(&isci_host->pdev->dev,
2421+ dev_warn(&ihost->pdev->dev,
24412422 "%s: scic_controller_initialize failed -"
24422423 " status = 0x%x\n",
24432424 __func__, status);
24442425 return -ENODEV;
24452426 }
24462427
2447− err = scic_controller_mem_init(&isci_host->sci);
2428+ err = scic_controller_mem_init(ihost);
24482429 if (err)
24492430 return err;
24502431
24512432 for (i = 0; i < SCI_MAX_PORTS; i++)
2452− isci_port_init(&isci_host->ports[i], isci_host, i);
2433+ isci_port_init(&ihost->ports[i], ihost, i);
24532434
24542435 for (i = 0; i < SCI_MAX_PHYS; i++)
2455− isci_phy_init(&isci_host->phys[i], isci_host, i);
2436+ isci_phy_init(&ihost->phys[i], ihost, i);
24562437
24572438 for (i = 0; i < SCI_MAX_REMOTE_DEVICES; i++) {
2458− struct isci_remote_device *idev = &isci_host->devices[i];
2439+ struct isci_remote_device *idev = &ihost->devices[i];
24592440
24602441 INIT_LIST_HEAD(&idev->reqs_in_process);
24612442 INIT_LIST_HEAD(&idev->node);
@@ -2465,63 +2446,62 @@ int isci_host_init(struct isci_host *isci_host) · 3 unmodified lines
24652446 struct isci_request *ireq;
24662447 dma_addr_t dma;
24672448
2468− ireq = dmam_alloc_coherent(&isci_host->pdev->dev,
2449+ ireq = dmam_alloc_coherent(&ihost->pdev->dev,
24692450 sizeof(struct isci_request), &dma,
24702451 GFP_KERNEL);
24712452 if (!ireq)
24722453 return -ENOMEM;
24732454
2474− ireq->tc = &isci_host->sci.task_context_table[i];
2475− ireq->owning_controller = &isci_host->sci;
2455+ ireq->tc = &ihost->task_context_table[i];
2456+ ireq->owning_controller = ihost;
24762457 spin_lock_init(&ireq->state_lock);
24772458 ireq->request_daddr = dma;
2478− ireq->isci_host = isci_host;
2479−
2480− isci_host->reqs[i] = ireq;
2459+ ireq->isci_host = ihost;
2460+ ihost->reqs[i] = ireq;
24812461 }
24822462
24832463 return 0;
24842464 }
24852465
2486−void scic_sds_controller_link_up(struct scic_sds_controller *scic,
2466+void scic_sds_controller_link_up(struct isci_host *ihost,
24872467 struct isci_port *iport, struct isci_phy *iphy)
24882468 {
2489− switch (scic->sm.current_state_id) {
2469+ switch (ihost->sm.current_state_id) {
24902470 case SCIC_STARTING:
2491− sci_del_timer(&scic->phy_timer);
2492− scic->phy_startup_timer_pending = false;
2493− scic->port_agent.link_up_handler(scic, &scic->port_agent,
2471+ sci_del_timer(&ihost->phy_timer);
2472+ ihost->phy_startup_timer_pending = false;
2473+ ihost->port_agent.link_up_handler(ihost, &ihost->port_agent,
24942474 iport, iphy);
2495− scic_sds_controller_start_next_phy(scic);
2475+ scic_sds_controller_start_next_phy(ihost);
24962476 break;
24972477 case SCIC_READY:
2498− scic->port_agent.link_up_handler(scic, &scic->port_agent,
2478+ ihost->port_agent.link_up_handler(ihost, &ihost->port_agent,
24992479 iport, iphy);
25002480 break;
25012481 default:
2502− dev_dbg(scic_to_dev(scic),
2482+ dev_dbg(&ihost->pdev->dev,
25032483 "%s: SCIC Controller linkup event from phy %d in "
25042484 "unexpected state %d\n", __func__, iphy->phy_index,
2505− scic->sm.current_state_id);
2485+ ihost->sm.current_state_id);
25062486 }
25072487 }
25082488
2509−void scic_sds_controller_link_down(struct scic_sds_controller *scic,
2489+void scic_sds_controller_link_down(struct isci_host *ihost,
25102490 struct isci_port *iport, struct isci_phy *iphy)
25112491 {
2512− switch (scic->sm.current_state_id) {
2492+ switch (ihost->sm.current_state_id) {
25132493 case SCIC_STARTING:
25142494 case SCIC_READY:
2515− scic->port_agent.link_down_handler(scic, &scic->port_agent,
2495+ ihost->port_agent.link_down_handler(ihost, &ihost->port_agent,
25162496 iport, iphy);
25172497 break;
25182498 default:
2519− dev_dbg(scic_to_dev(scic),
2499+ dev_dbg(&ihost->pdev->dev,
25202500 "%s: SCIC Controller linkdown event from phy %d in "
25212501 "unexpected state %d\n",
25222502 __func__,
25232503 iphy->phy_index,
2524− scic->sm.current_state_id);
2504+ ihost->sm.current_state_id);
25252505 }
25262506 }
25272507
@@ -2530,14 +2510,13 @@ void scic_sds_controller_link_down(struct scic_sds_controller *scic, · 2 unmodified lines
25302510 * controller are still in the stopping state.
25312511 *
25322512 */
2533−static bool scic_sds_controller_has_remote_devices_stopping(
2534− struct scic_sds_controller *controller)
2513+static bool scic_sds_controller_has_remote_devices_stopping(struct isci_host *ihost)
25352514 {
25362515 u32 index;
25372516
2538− for (index = 0; index < controller->remote_node_entries; index++) {
2539− if ((controller->device_table[index] != NULL) &&
2540− (controller->device_table[index]->sm.current_state_id == SCI_DEV_STOPPING))
2517+ for (index = 0; index < ihost->remote_node_entries; index++) {
2518+ if ((ihost->device_table[index] != NULL) &&
2519+ (ihost->device_table[index]->sm.current_state_id == SCI_DEV_STOPPING))
25412520 return true;
25422521 }
25432522
@@ -2548,20 +2527,20 @@ static bool scic_sds_controller_has_remote_devices_stopping( · 4 unmodified lines
25482527 * This method is called by the remote device to inform the controller
25492528 * object that the remote device has stopped.
25502529 */
2551−void scic_sds_controller_remote_device_stopped(struct scic_sds_controller *scic,
2530+void scic_sds_controller_remote_device_stopped(struct isci_host *ihost,
25522531 struct isci_remote_device *idev)
25532532 {
2554− if (scic->sm.current_state_id != SCIC_STOPPING) {
2555− dev_dbg(scic_to_dev(scic),
2533+ if (ihost->sm.current_state_id != SCIC_STOPPING) {
2534+ dev_dbg(&ihost->pdev->dev,
25562535 "SCIC Controller 0x%p remote device stopped event "
25572536 "from device 0x%p in unexpected state %d\n",
2558− scic, idev,
2559− scic->sm.current_state_id);
2537+ ihost, idev,
2538+ ihost->sm.current_state_id);
25602539 return;
25612540 }
25622541
2563− if (!scic_sds_controller_has_remote_devices_stopping(scic)) {
2564− sci_change_state(&scic->sm, SCIC_STOPPED);
2542+ if (!scic_sds_controller_has_remote_devices_stopping(ihost)) {
2543+ sci_change_state(&ihost->sm, SCIC_STOPPED);
25652544 }
25662545 }
25672546
@@ -2573,32 +2552,32 @@ void scic_sds_controller_remote_device_stopped(struct scic_sds_controller *scic, · 5 unmodified lines
25732552 *
25742553 */
25752554 void scic_sds_controller_post_request(
2576− struct scic_sds_controller *scic,
2555+ struct isci_host *ihost,
25772556 u32 request)
25782557 {
2579− dev_dbg(scic_to_dev(scic),
2558+ dev_dbg(&ihost->pdev->dev,
25802559 "%s: SCIC Controller 0x%p post request 0x%08x\n",
25812560 __func__,
2582− scic,
2561+ ihost,
25832562 request);
25842563
2585− writel(request, &scic->smu_registers->post_context_port);
2564+ writel(request, &ihost->smu_registers->post_context_port);
25862565 }
25872566
2588−struct isci_request *scic_request_by_tag(struct scic_sds_controller *scic, u16 io_tag)
2567+struct isci_request *scic_request_by_tag(struct isci_host *ihost, u16 io_tag)
25892568 {
25902569 u16 task_index;
25912570 u16 task_sequence;
25922571
25932572 task_index = ISCI_TAG_TCI(io_tag);
25942573
2595− if (task_index < scic->task_context_entries) {
2596− struct isci_request *ireq = scic_to_ihost(scic)->reqs[task_index];
2574+ if (task_index < ihost->task_context_entries) {
2575+ struct isci_request *ireq = ihost->reqs[task_index];
25972576
25982577 if (test_bit(IREQ_ACTIVE, &ireq->flags)) {
25992578 task_sequence = ISCI_TAG_SEQ(io_tag);
26002579
2601− if (task_sequence == scic->io_request_sequence[task_index])
2580+ if (task_sequence == ihost->io_request_sequence[task_index])
26022581 return ireq;
26032582 }
26042583 }
@@ -2621,7 +2600,7 @@ struct isci_request *scic_request_by_tag(struct scic_sds_controller *scic, u16 i · 16 unmodified lines
26212600 * node index available.
26222601 */
26232602 enum sci_status scic_sds_controller_allocate_remote_node_context(
2624− struct scic_sds_controller *scic,
2603+ struct isci_host *ihost,
26252604 struct isci_remote_device *idev,
26262605 u16 *node_id)
26272606 {
@@ -2629,11 +2608,11 @@ enum sci_status scic_sds_controller_allocate_remote_node_context( · 1 unmodified line
26292608 u32 remote_node_count = scic_sds_remote_device_node_count(idev);
26302609
26312610 node_index = scic_sds_remote_node_table_allocate_remote_node(
2632− &scic->available_remote_nodes, remote_node_count
2611+ &ihost->available_remote_nodes, remote_node_count
26332612 );
26342613
26352614 if (node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
2636− scic->device_table[node_index] = idev;
2615+ ihost->device_table[node_index] = idev;
26372616
26382617 *node_id = node_index;
26392618
@@ -2653,17 +2632,17 @@ enum sci_status scic_sds_controller_allocate_remote_node_context( · 13 unmodified lines
26532632 *
26542633 */
26552634 void scic_sds_controller_free_remote_node_context(
2656− struct scic_sds_controller *scic,
2635+ struct isci_host *ihost,
26572636 struct isci_remote_device *idev,
26582637 u16 node_id)
26592638 {
26602639 u32 remote_node_count = scic_sds_remote_device_node_count(idev);
26612640
2662− if (scic->device_table[node_id] == idev) {
2663− scic->device_table[node_id] = NULL;
2641+ if (ihost->device_table[node_id] == idev) {
2642+ ihost->device_table[node_id] = NULL;
26642643
26652644 scic_sds_remote_node_table_release_remote_node_index(
2666− &scic->available_remote_nodes, remote_node_count, node_id
2645+ &ihost->available_remote_nodes, remote_node_count, node_id
26672646 );
26682647 }
26692648 }
@@ -2677,14 +2656,14 @@ void scic_sds_controller_free_remote_node_context( · 7 unmodified lines
26772656 * union scu_remote_node_context*
26782657 */
26792658 union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
2680− struct scic_sds_controller *scic,
2659+ struct isci_host *ihost,
26812660 u16 node_id
26822661 ) {
26832662 if (
2684− (node_id < scic->remote_node_entries)
2685− && (scic->device_table[node_id] != NULL)
2663+ (node_id < ihost->remote_node_entries)
2664+ && (ihost->device_table[node_id] != NULL)
26862665 ) {
2687− return &scic->remote_node_context_table[node_id];
2666+ return &ihost->remote_node_context_table[node_id];
26882667 }
26892668
26902669 return NULL;
@@ -2722,13 +2701,13 @@ void scic_sds_controller_copy_sata_response( · 31 unmodified lines
27222701 *
27232702 */
27242703 void scic_sds_controller_release_frame(
2725− struct scic_sds_controller *scic,
2704+ struct isci_host *ihost,
27262705 u32 frame_index)
27272706 {
27282707 if (scic_sds_unsolicited_frame_control_release_frame(
2729− &scic->uf_control, frame_index) == true)
2730− writel(scic->uf_control.get,
2731− &scic->scu_registers->sdma.unsolicited_frame_get_pointer);
2708+ &ihost->uf_control, frame_index) == true)
2709+ writel(ihost->uf_control.get,
2710+ &ihost->scu_registers->sdma.unsolicited_frame_get_pointer);
27322711 }
27332712
27342713 void isci_tci_free(struct isci_host *ihost, u16 tci)
@@ -2757,7 +2736,7 @@ u16 isci_alloc_tag(struct isci_host *ihost) · 22 unmodified lines
27572736 {
27582737 if (isci_tci_space(ihost)) {
27592738 u16 tci = isci_tci_alloc(ihost);
2760− u8 seq = ihost->sci.io_request_sequence[tci];
2739+ u8 seq = ihost->io_request_sequence[tci];
27612740
27622741 return ISCI_TAG(seq, tci);
27632742 }
@@ -2767,7 +2746,6 @@ u16 isci_alloc_tag(struct isci_host *ihost) · 3 unmodified lines
27672746
27682747 enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag)
27692748 {
2770− struct scic_sds_controller *scic = &ihost->sci;
27712749 u16 tci = ISCI_TAG_TCI(io_tag);
27722750 u16 seq = ISCI_TAG_SEQ(io_tag);
27732751
@@ -2775,8 +2753,8 @@ enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag) · 1 unmodified line
27752753 if (isci_tci_active(ihost) == 0)
27762754 return SCI_FAILURE_INVALID_IO_TAG;
27772755
2778− if (seq == scic->io_request_sequence[tci]) {
2779− scic->io_request_sequence[tci] = (seq+1) & (SCI_MAX_SEQ-1);
2756+ if (seq == ihost->io_request_sequence[tci]) {
2757+ ihost->io_request_sequence[tci] = (seq+1) & (SCI_MAX_SEQ-1);
27802758
27812759 isci_tci_free(ihost, tci);
27822760
@@ -2797,23 +2775,23 @@ enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag) · 14 unmodified lines
27972775 * @io_tag: This parameter specifies a previously allocated IO tag that the
27982776 * user desires to be utilized for this request.
27992777 */
2800−enum sci_status scic_controller_start_io(struct scic_sds_controller *scic,
2778+enum sci_status scic_controller_start_io(struct isci_host *ihost,
28012779 struct isci_remote_device *idev,
28022780 struct isci_request *ireq)
28032781 {
28042782 enum sci_status status;
28052783
2806− if (scic->sm.current_state_id != SCIC_READY) {
2807− dev_warn(scic_to_dev(scic), "invalid state to start I/O");
2784+ if (ihost->sm.current_state_id != SCIC_READY) {
2785+ dev_warn(&ihost->pdev->dev, "invalid state to start I/O");
28082786 return SCI_FAILURE_INVALID_STATE;
28092787 }
28102788
2811− status = scic_sds_remote_device_start_io(scic, idev, ireq);
2789+ status = scic_sds_remote_device_start_io(ihost, idev, ireq);
28122790 if (status != SCI_SUCCESS)
28132791 return status;
28142792
28152793 set_bit(IREQ_ACTIVE, &ireq->flags);
2816− scic_sds_controller_post_request(scic, scic_sds_request_get_post_context(ireq));
2794+ scic_sds_controller_post_request(ihost, scic_sds_request_get_post_context(ireq));
28172795 return SCI_SUCCESS;
28182796 }
28192797
@@ -2834,14 +2812,14 @@ enum sci_status scic_controller_start_io(struct scic_sds_controller *scic, · 14 unmodified lines
28342812 * for the request. Determine the failure situations and return values.
28352813 */
28362814 enum sci_status scic_controller_terminate_request(
2837− struct scic_sds_controller *scic,
2815+ struct isci_host *ihost,
28382816 struct isci_remote_device *idev,
28392817 struct isci_request *ireq)
28402818 {
28412819 enum sci_status status;
28422820
2843− if (scic->sm.current_state_id != SCIC_READY) {
2844− dev_warn(scic_to_dev(scic),
2821+ if (ihost->sm.current_state_id != SCIC_READY) {
2822+ dev_warn(&ihost->pdev->dev,
28452823 "invalid state to terminate request\n");
28462824 return SCI_FAILURE_INVALID_STATE;
28472825 }
@@ -2854,7 +2832,7 @@ enum sci_status scic_controller_terminate_request( · 6 unmodified lines
28542832 * Utilize the original post context command and or in the POST_TC_ABORT
28552833 * request sub-type.
28562834 */
2857− scic_sds_controller_post_request(scic,
2835+ scic_sds_controller_post_request(ihost,
28582836 scic_sds_request_get_post_context(ireq) |
28592837 SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT);
28602838 return SCI_SUCCESS;
@@ -2872,19 +2850,19 @@ enum sci_status scic_controller_terminate_request( · 11 unmodified lines
28722850 * @io_request: the handle to the io request object to complete.
28732851 */
28742852 enum sci_status scic_controller_complete_io(
2875− struct scic_sds_controller *scic,
2853+ struct isci_host *ihost,
28762854 struct isci_remote_device *idev,
28772855 struct isci_request *ireq)
28782856 {
28792857 enum sci_status status;
28802858 u16 index;
28812859
2882− switch (scic->sm.current_state_id) {
2860+ switch (ihost->sm.current_state_id) {
28832861 case SCIC_STOPPING:
28842862 /* XXX: Implement this function */
28852863 return SCI_FAILURE;
28862864 case SCIC_READY:
2887− status = scic_sds_remote_device_complete_io(scic, idev, ireq);
2865+ status = scic_sds_remote_device_complete_io(ihost, idev, ireq);
28882866 if (status != SCI_SUCCESS)
28892867 return status;
28902868
@@ -2892,7 +2870,7 @@ enum sci_status scic_controller_complete_io( · 1 unmodified line
28922870 clear_bit(IREQ_ACTIVE, &ireq->flags);
28932871 return SCI_SUCCESS;
28942872 default:
2895− dev_warn(scic_to_dev(scic), "invalid state to complete I/O");
2873+ dev_warn(&ihost->pdev->dev, "invalid state to complete I/O");
28962874 return SCI_FAILURE_INVALID_STATE;
28972875 }
28982876
@@ -2900,15 +2878,15 @@ enum sci_status scic_controller_complete_io( · 1 unmodified line
29002878
29012879 enum sci_status scic_controller_continue_io(struct isci_request *ireq)
29022880 {
2903− struct scic_sds_controller *scic = ireq->owning_controller;
2881+ struct isci_host *ihost = ireq->owning_controller;
29042882
2905− if (scic->sm.current_state_id != SCIC_READY) {
2906− dev_warn(scic_to_dev(scic), "invalid state to continue I/O");
2883+ if (ihost->sm.current_state_id != SCIC_READY) {
2884+ dev_warn(&ihost->pdev->dev, "invalid state to continue I/O");
29072885 return SCI_FAILURE_INVALID_STATE;
29082886 }
29092887
29102888 set_bit(IREQ_ACTIVE, &ireq->flags);
2911− scic_sds_controller_post_request(scic, scic_sds_request_get_post_context(ireq));
2889+ scic_sds_controller_post_request(ihost, scic_sds_request_get_post_context(ireq));
29122890 return SCI_SUCCESS;
29132891 }
29142892
@@ -2922,21 +2900,21 @@ enum sci_status scic_controller_continue_io(struct isci_request *ireq) · 7 unmodified lines
29222900 * @task_request: the handle to the task request object to start.
29232901 */
29242902 enum sci_task_status scic_controller_start_task(
2925− struct scic_sds_controller *scic,
2903+ struct isci_host *ihost,
29262904 struct isci_remote_device *idev,
29272905 struct isci_request *ireq)
29282906 {
29292907 enum sci_status status;
29302908
2931− if (scic->sm.current_state_id != SCIC_READY) {
2932− dev_warn(scic_to_dev(scic),
2909+ if (ihost->sm.current_state_id != SCIC_READY) {
2910+ dev_warn(&ihost->pdev->dev,
29332911 "%s: SCIC Controller starting task from invalid "
29342912 "state\n",
29352913 __func__);
29362914 return SCI_TASK_FAILURE_INVALID_STATE;
29372915 }
29382916
2939− status = scic_sds_remote_device_start_task(scic, idev, ireq);
2917+ status = scic_sds_remote_device_start_task(ihost, idev, ireq);
29402918 switch (status) {
29412919 case SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS:
29422920 set_bit(IREQ_ACTIVE, &ireq->flags);
@@ -2950,7 +2928,7 @@ enum sci_task_status scic_controller_start_task( · 7 unmodified lines
29502928 case SCI_SUCCESS:
29512929 set_bit(IREQ_ACTIVE, &ireq->flags);
29522930
2953− scic_sds_controller_post_request(scic,
2931+ scic_sds_controller_post_request(ihost,
29542932 scic_sds_request_get_post_context(ireq));
29552933 break;
29562934 default:
drivers/scsi/isci/host.h+46−164
@@ -106,7 +106,7 @@ struct scic_power_control { · 105 unmodified lines
106106 };
107107
108108 struct scic_sds_port_configuration_agent;
109−typedef void (*port_config_fn)(struct scic_sds_controller *,
109+typedef void (*port_config_fn)(struct isci_host *,
110110 struct scic_sds_port_configuration_agent *,
111111 struct isci_port *, struct isci_phy *);
112112
@@ -124,171 +124,66 @@ struct scic_sds_port_configuration_agent { · 11 unmodified lines
124124 };
125125
126126 /**
127− * struct scic_sds_controller -
128− *
129− * This structure represents the SCU controller object.
127+ * isci_host - primary host/controller object
128+ * @timer: timeout start/stop operations
129+ * @device_table: rni (hw remote node index) to remote device lookup table
130+ * @available_remote_nodes: rni allocator
131+ * @power_control: manage device spin up
132+ * @io_request_sequence: generation number for tci's (task contexts)
133+ * @task_context_table: hw task context table
134+ * @remote_node_context_table: hw remote node context table
135+ * @completion_queue: hw-producer driver-consumer communication ring
136+ * @completion_queue_get: tracks the driver 'head' of the ring to notify hw
137+ * @logical_port_entries: min({driver|silicon}-supported-port-count)
138+ * @remote_node_entries: min({driver|silicon}-supported-node-count)
139+ * @task_context_entries: min({driver|silicon}-supported-task-count)
140+ * @phy_timer: phy startup timer
141+ * @invalid_phy_mask: if an invalid_link_up notification is reported a bit for
142+ * the phy index is set so further notifications are not
143+ * made. Once the phy reports link up and is made part of a
144+ * port then this bit is cleared.
145+
130146 */
131−struct scic_sds_controller {
132− /**
133− * This field contains the information for the base controller state
134− * machine.
135− */
147+struct isci_host {
136148 struct sci_base_state_machine sm;
137−
138− /**
139− * Timer for controller start/stop operations.
140− */
149+ /* XXX can we time this externally */
141150 struct sci_timer timer;
142−
143− /**
144− * This field contains the user parameters to be utilized for this
145− * core controller object.
146− */
151+ /* XXX drop reference module params directly */
147152 union scic_user_parameters user_parameters;
148−
149− /**
150− * This field contains the OEM parameters to be utilized for this
151− * core controller object.
152− */
153+ /* XXX no need to be a union */
153154 union scic_oem_parameters oem_parameters;
154−
155− /**
156− * This field contains the port configuration agent for this controller.
157− */
158155 struct scic_sds_port_configuration_agent port_agent;
159−
160− /**
161− * This field is the array of device objects that are currently constructed
162− * for this controller object. This table is used as a fast lookup of device
163− * objects that need to handle device completion notifications from the
164− * hardware. The table is RNi based.
165− */
166156 struct isci_remote_device *device_table[SCI_MAX_REMOTE_DEVICES];
167−
168− /**
169− * This field is the free RNi data structure
170− */
171157 struct scic_remote_node_table available_remote_nodes;
172−
173− /**
174− * This filed is the struct scic_power_control data used to controll when direct
175− * attached devices can consume power.
176− */
177158 struct scic_power_control power_control;
178−
179− /* sequence number per tci */
180159 u8 io_request_sequence[SCI_MAX_IO_REQUESTS];
181−
182− /**
183− * This field is a pointer to the memory allocated by the driver for the task
184− * context table. This data is shared between the hardware and software.
185− */
186160 struct scu_task_context *task_context_table;
187161 dma_addr_t task_context_dma;
188−
189− /**
190− * This field is a pointer to the memory allocated by the driver for the
191− * remote node context table. This table is shared between the hardware and
192− * software.
193− */
194162 union scu_remote_node_context *remote_node_context_table;
195−
196− /**
197− * This field is a pointer to the completion queue. This memory is
198− * written to by the hardware and read by the software.
199− */
200163 u32 *completion_queue;
201−
202− /**
203− * This field is the software copy of the completion queue get pointer. The
204− * controller object writes this value to the hardware after processing the
205− * completion entries.
206− */
207164 u32 completion_queue_get;
208−
209− /**
210− * This field is the minimum of the number of hardware supported port entries
211− * and the software requested port entries.
212− */
213165 u32 logical_port_entries;
214−
215− /**
216− * This field is the minimum number of devices supported by the hardware and
217− * the number of devices requested by the software.
218− */
219166 u32 remote_node_entries;
220−
221− /**
222− * This field is the minimum number of IO requests supported by the hardware
223− * and the number of IO requests requested by the software.
224− */
225167 u32 task_context_entries;
226−
227− /**
228− * This object contains all of the unsolicited frame specific
229− * data utilized by the core controller.
230− */
231168 struct scic_sds_unsolicited_frame_control uf_control;
232169
233− /* Phy Startup Data */
234− /**
235− * Timer for controller phy request startup. On controller start the
236− * controller will start each PHY individually in order of phy index.
237− */
170+ /* phy startup */
238171 struct sci_timer phy_timer;
239−
240− /**
241− * This field is set when the phy_timer is running and is cleared when
242− * the phy_timer is stopped.
243− */
172+ /* XXX kill */
244173 bool phy_startup_timer_pending;
245−
246− /**
247− * This field is the index of the next phy start. It is initialized to 0 and
248− * increments for each phy index that is started.
249− */
250174 u32 next_phy_to_start;
251−
252− /**
253− * This field controlls the invalid link up notifications to the SCI_USER. If
254− * an invalid_link_up notification is reported a bit for the PHY index is set
255− * so further notifications are not made. Once the PHY object reports link up
256− * and is made part of a port then this bit for the PHY index is cleared.
257− */
258175 u8 invalid_phy_mask;
259176
260− /*
261− * This field saves the current interrupt coalescing number of the controller.
262− */
177+ /* TODO attempt dynamic interrupt coalescing scheme */
263178 u16 interrupt_coalesce_number;
264−
265− /*
266− * This field saves the current interrupt coalescing timeout value in microseconds.
267− */
268179 u32 interrupt_coalesce_timeout;
269−
270− /**
271− * This field is a pointer to the memory mapped register space for the
272− * struct smu_registers.
273− */
274180 struct smu_registers __iomem *smu_registers;
275−
276− /**
277− * This field is a pointer to the memory mapped register space for the
278− * struct scu_registers.
279− */
280181 struct scu_registers __iomem *scu_registers;
281182
282−};
283−
284−struct isci_host {
285− struct scic_sds_controller sci;
286183 u16 tci_head;
287184 u16 tci_tail;
288185 u16 tci_pool[SCI_MAX_IO_REQUESTS];
289186
290− union scic_oem_parameters oem_parameters;
291−
292187 int id; /* unique within a given pci device */
293188 struct isci_phy phys[SCI_MAX_PHYS];
294189 struct isci_port ports[SCI_MAX_PORTS + 1]; /* includes dummy port */
@@ -464,14 +359,6 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev) · 169 unmodified lines
464359 return dev->port->ha->lldd_ha;
465360 }
466361
467−static inline struct isci_host *scic_to_ihost(struct scic_sds_controller *scic)
468−{
469− /* XXX delete after merging scic_sds_contoller and isci_host */
470− struct isci_host *ihost = container_of(scic, typeof(*ihost), sci);
471−
472− return ihost;
473−}
474−
475362 /**
476363 * scic_sds_controller_get_protocol_engine_group() -
477364 *
@@ -518,11 +405,6 @@ static inline int scic_sds_remote_device_node_count(struct isci_remote_device *i · 40 unmodified lines
518405 #define scic_sds_controller_clear_invalid_phy(controller, phy) \
519406 ((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index))
520407
521−static inline struct device *scic_to_dev(struct scic_sds_controller *scic)
522−{
523− return &scic_to_ihost(scic)->pdev->dev;
524−}
525−
526408 static inline struct device *sciphy_to_dev(struct isci_phy *iphy)
527409 {
528410
@@ -578,54 +460,54 @@ static inline bool is_c0(void) · 49 unmodified lines
578460 return isci_si_rev > ISCI_SI_REVB0;
579461 }
580462
581−void scic_sds_controller_post_request(struct scic_sds_controller *scic,
463+void scic_sds_controller_post_request(struct isci_host *ihost,
582464 u32 request);
583−void scic_sds_controller_release_frame(struct scic_sds_controller *scic,
465+void scic_sds_controller_release_frame(struct isci_host *ihost,
584466 u32 frame_index);
585467 void scic_sds_controller_copy_sata_response(void *response_buffer,
586468 void *frame_header,
587469 void *frame_buffer);
588−enum sci_status scic_sds_controller_allocate_remote_node_context(struct scic_sds_controller *scic,
470+enum sci_status scic_sds_controller_allocate_remote_node_context(struct isci_host *ihost,
589471 struct isci_remote_device *idev,
590472 u16 *node_id);
591473 void scic_sds_controller_free_remote_node_context(
592− struct scic_sds_controller *scic,
474+ struct isci_host *ihost,
593475 struct isci_remote_device *idev,
594476 u16 node_id);
595477 union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
596− struct scic_sds_controller *scic,
478+ struct isci_host *ihost,
597479 u16 node_id);
598480
599−struct isci_request *scic_request_by_tag(struct scic_sds_controller *scic,
481+struct isci_request *scic_request_by_tag(struct isci_host *ihost,
600482 u16 io_tag);
601483
602484 void scic_sds_controller_power_control_queue_insert(
603− struct scic_sds_controller *scic,
485+ struct isci_host *ihost,
604486 struct isci_phy *iphy);
605487
606488 void scic_sds_controller_power_control_queue_remove(
607− struct scic_sds_controller *scic,
489+ struct isci_host *ihost,
608490 struct isci_phy *iphy);
609491
610492 void scic_sds_controller_link_up(
611− struct scic_sds_controller *scic,
493+ struct isci_host *ihost,
612494 struct isci_port *iport,
613495 struct isci_phy *iphy);
614496
615497 void scic_sds_controller_link_down(
616− struct scic_sds_controller *scic,
498+ struct isci_host *ihost,
617499 struct isci_port *iport,
618500 struct isci_phy *iphy);
619501
620502 void scic_sds_controller_remote_device_stopped(
621− struct scic_sds_controller *scic,
503+ struct isci_host *ihost,
622504 struct isci_remote_device *idev);
623505
624506 void scic_sds_controller_copy_task_context(
625− struct scic_sds_controller *scic,
507+ struct isci_host *ihost,
626508 struct isci_request *ireq);
627509
628−void scic_sds_controller_register_setup(struct scic_sds_controller *scic);
510+void scic_sds_controller_register_setup(struct isci_host *ihost);
629511
630512 enum sci_status scic_controller_continue_io(struct isci_request *ireq);
631513 int isci_host_scan_finished(struct Scsi_Host *, unsigned long);
@@ -655,25 +537,25 @@ void isci_host_remote_device_start_complete( · 23 unmodified lines
655537 enum sci_status);
656538
657539 void scic_controller_disable_interrupts(
658− struct scic_sds_controller *scic);
540+ struct isci_host *ihost);
659541
660542 enum sci_status scic_controller_start_io(
661− struct scic_sds_controller *scic,
543+ struct isci_host *ihost,
662544 struct isci_remote_device *idev,
663545 struct isci_request *ireq);
664546
665547 enum sci_task_status scic_controller_start_task(
666− struct scic_sds_controller *scic,
548+ struct isci_host *ihost,
667549 struct isci_remote_device *idev,
668550 struct isci_request *ireq);
669551
670552 enum sci_status scic_controller_terminate_request(
671− struct scic_sds_controller *scic,
553+ struct isci_host *ihost,
672554 struct isci_remote_device *idev,
673555 struct isci_request *ireq);
674556
675557 enum sci_status scic_controller_complete_io(
676− struct scic_sds_controller *scic,
558+ struct isci_host *ihost,
677559 struct isci_remote_device *idev,
678560 struct isci_request *ireq);
679561
@@ -681,6 +563,6 @@ void scic_sds_port_configuration_agent_construct( · 1 unmodified line
681563 struct scic_sds_port_configuration_agent *port_agent);
682564
683565 enum sci_status scic_sds_port_configuration_agent_initialize(
684− struct scic_sds_controller *controller,
566+ struct isci_host *ihost,
685567 struct scic_sds_port_configuration_agent *port_agent);
686568 #endif
drivers/scsi/isci/init.c+5−5
@@ -548,13 +548,13 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic · 547 unmodified lines
548548
549549 static void __devexit isci_pci_remove(struct pci_dev *pdev)
550550 {
551− struct isci_host *isci_host;
551+ struct isci_host *ihost;
552552 int i;
553553
554− for_each_isci_host(i, isci_host, pdev) {
555− isci_unregister(isci_host);
556− isci_host_deinit(isci_host);
557− scic_controller_disable_interrupts(&isci_host->sci);
554+ for_each_isci_host(i, ihost, pdev) {
555+ isci_unregister(ihost);
556+ isci_host_deinit(ihost);
557+ scic_controller_disable_interrupts(ihost);
558558 }
559559 }
560560
drivers/scsi/isci/phy.c+20−20
@@ -112,13 +112,13 @@ static enum sci_status · 111 unmodified lines
112112 scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
113113 struct scu_link_layer_registers __iomem *link_layer_registers)
114114 {
115− struct scic_sds_controller *scic =
115+ struct isci_host *ihost =
116116 iphy->owning_port->owning_controller;
117117 int phy_idx = iphy->phy_index;
118118 struct sci_phy_user_params *phy_user =
119− &scic->user_parameters.sds1.phys[phy_idx];
119+ &ihost->user_parameters.sds1.phys[phy_idx];
120120 struct sci_phy_oem_params *phy_oem =
121− &scic->oem_parameters.sds1.phys[phy_idx];
121+ &ihost->oem_parameters.sds1.phys[phy_idx];
122122 u32 phy_configuration;
123123 struct scic_phy_cap phy_cap;
124124 u32 parity_check = 0;
@@ -169,7 +169,7 @@ scic_sds_phy_link_layer_initialization(struct isci_phy *iphy, · 44 unmodified lines
169169 phy_cap.gen3_no_ssc = 1;
170170 phy_cap.gen2_no_ssc = 1;
171171 phy_cap.gen1_no_ssc = 1;
172− if (scic->oem_parameters.sds1.controller.do_enable_ssc == true) {
172+ if (ihost->oem_parameters.sds1.controller.do_enable_ssc == true) {
173173 phy_cap.gen3_ssc = 1;
174174 phy_cap.gen2_ssc = 1;
175175 phy_cap.gen1_ssc = 1;
@@ -216,7 +216,7 @@ scic_sds_phy_link_layer_initialization(struct isci_phy *iphy, · 40 unmodified lines
216216 &iphy->link_layer_registers->afe_lookup_table_control);
217217
218218 llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT,
219− (u8)scic->user_parameters.sds1.no_outbound_task_timeout);
219+ (u8)ihost->user_parameters.sds1.no_outbound_task_timeout);
220220
221221 switch(phy_user->max_speed_generation) {
222222 case SCIC_SDS_PARM_GEN3_SPEED:
@@ -255,7 +255,7 @@ static void phy_sata_timeout(unsigned long data) · 32 unmodified lines
255255 {
256256 struct sci_timer *tmr = (struct sci_timer *)data;
257257 struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer);
258− struct isci_host *ihost = scic_to_ihost(iphy->owning_port->owning_controller);
258+ struct isci_host *ihost = iphy->owning_port->owning_controller;
259259 unsigned long flags;
260260
261261 spin_lock_irqsave(&ihost->scic_lock, flags);
@@ -890,7 +890,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy, · 628 unmodified lines
890890 u32 frame_index)
891891 {
892892 enum scic_sds_phy_states state = iphy->sm.current_state_id;
893− struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
893+ struct isci_host *ihost = iphy->owning_port->owning_controller;
894894 enum sci_status result;
895895 unsigned long flags;
896896
@@ -899,7 +899,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy, · 2 unmodified lines
899899 u32 *frame_words;
900900 struct sas_identify_frame iaf;
901901
902− result = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
902+ result = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
903903 frame_index,
904904 (void **)&frame_words);
905905
@@ -933,7 +933,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy, · 27 unmodified lines
933933 "unexpected frame id %x\n",
934934 __func__, frame_index);
935935
936− scic_sds_controller_release_frame(scic, frame_index);
936+ scic_sds_controller_release_frame(ihost, frame_index);
937937 return result;
938938 }
939939 case SCI_PHY_SUB_AWAIT_SIG_FIS_UF: {
@@ -950,7 +950,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy, · 10 unmodified lines
950950
951951 if ((frame_header->fis_type == FIS_REGD2H) &&
952952 !(frame_header->status & ATA_BUSY)) {
953− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
953+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
954954 frame_index,
955955 (void **)&fis_frame_data);
956956
@@ -971,7 +971,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy, · 14 unmodified lines
971971 __func__, frame_index);
972972
973973 /* Regardless of the result we are done with this frame with it */
974− scic_sds_controller_release_frame(scic, frame_index);
974+ scic_sds_controller_release_frame(ihost, frame_index);
975975
976976 return result;
977977 }
@@ -994,33 +994,33 @@ static void scic_sds_phy_starting_initial_substate_enter(struct sci_base_state_m · 16 unmodified lines
994994 static void scic_sds_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm)
995995 {
996996 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
997− struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
997+ struct isci_host *ihost = iphy->owning_port->owning_controller;
998998
999− scic_sds_controller_power_control_queue_insert(scic, iphy);
999+ scic_sds_controller_power_control_queue_insert(ihost, iphy);
10001000 }
10011001
10021002 static void scic_sds_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm)
10031003 {
10041004 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
1005− struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
1005+ struct isci_host *ihost = iphy->owning_port->owning_controller;
10061006
1007− scic_sds_controller_power_control_queue_remove(scic, iphy);
1007+ scic_sds_controller_power_control_queue_remove(ihost, iphy);
10081008 }
10091009
10101010 static void scic_sds_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm)
10111011 {
10121012 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
1013− struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
1013+ struct isci_host *ihost = iphy->owning_port->owning_controller;
10141014
1015− scic_sds_controller_power_control_queue_insert(scic, iphy);
1015+ scic_sds_controller_power_control_queue_insert(ihost, iphy);
10161016 }
10171017
10181018 static void scic_sds_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm)
10191019 {
10201020 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
1021− struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
1021+ struct isci_host *ihost = iphy->owning_port->owning_controller;
10221022
1023− scic_sds_controller_power_control_queue_remove(scic, iphy);
1023+ scic_sds_controller_power_control_queue_remove(ihost, iphy);
10241024 }
10251025
10261026 static void scic_sds_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm)
@@ -1313,7 +1313,7 @@ void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) · 286 unmodified lines
13131313 u64 sci_sas_addr;
13141314 __be64 sas_addr;
13151315
1316− scic_oem_parameters_get(&ihost->sci, &oem);
1316+ scic_oem_parameters_get(ihost, &oem);
13171317 sci_sas_addr = oem.sds1.phys[index].sas_address.high;
13181318 sci_sas_addr <<= 32;
13191319 sci_sas_addr |= oem.sds1.phys[index].sas_address.low;
drivers/scsi/isci/port.c+40−49
@@ -365,11 +365,11 @@ static void isci_port_not_ready(struct isci_host *isci_host, struct isci_port *i · 364 unmodified lines
365365 "%s: isci_port = %p\n", __func__, isci_port);
366366 }
367367
368−static void isci_port_stop_complete(struct scic_sds_controller *scic,
368+static void isci_port_stop_complete(struct isci_host *ihost,
369369 struct isci_port *iport,
370370 enum sci_status completion_status)
371371 {
372− dev_dbg(&scic_to_ihost(scic)->pdev->dev, "Port stop complete\n");
372+ dev_dbg(&ihost->pdev->dev, "Port stop complete\n");
373373 }
374374
375375 /**
@@ -541,8 +541,7 @@ static enum sci_status scic_sds_port_clear_phy(struct isci_port *iport, · 165 unmodified lines
541541 /* Make sure that this phy is part of this port */
542542 if (iport->phy_table[iphy->phy_index] == iphy &&
543543 phy_get_non_dummy_port(iphy) == iport) {
544− struct scic_sds_controller *scic = iport->owning_controller;
545− struct isci_host *ihost = scic_to_ihost(scic);
544+ struct isci_host *ihost = iport->owning_controller;
546545
547546 /* Yep it is assigned to this port so remove it */
548547 scic_sds_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]);
@@ -654,10 +653,10 @@ static void scic_sds_port_construct_dummy_rnc(struct isci_port *iport, u16 rni) · 105 unmodified lines
654653 */
655654 static void scic_sds_port_construct_dummy_task(struct isci_port *iport, u16 tag)
656655 {
657− struct scic_sds_controller *scic = iport->owning_controller;
656+ struct isci_host *ihost = iport->owning_controller;
658657 struct scu_task_context *task_context;
659658
660− task_context = &scic->task_context_table[ISCI_TAG_TCI(tag)];
659+ task_context = &ihost->task_context_table[ISCI_TAG_TCI(tag)];
661660 memset(task_context, 0, sizeof(struct scu_task_context));
662661
663662 task_context->initiator_request = 1;
@@ -674,13 +673,13 @@ static void scic_sds_port_construct_dummy_task(struct isci_port *iport, u16 tag) · 10 unmodified lines
674673
675674 static void scic_sds_port_destroy_dummy_resources(struct isci_port *iport)
676675 {
677− struct scic_sds_controller *scic = iport->owning_controller;
676+ struct isci_host *ihost = iport->owning_controller;
678677
679678 if (iport->reserved_tag != SCI_CONTROLLER_INVALID_IO_TAG)
680− isci_free_tag(scic_to_ihost(scic), iport->reserved_tag);
679+ isci_free_tag(ihost, iport->reserved_tag);
681680
682681 if (iport->reserved_rni != SCU_DUMMY_INDEX)
683− scic_sds_remote_node_table_release_remote_node_index(&scic->available_remote_nodes,
682+ scic_sds_remote_node_table_release_remote_node_index(&ihost->available_remote_nodes,
684683 1, iport->reserved_rni);
685684
686685 iport->reserved_rni = SCU_DUMMY_INDEX;
@@ -749,15 +748,14 @@ static void scic_sds_port_activate_phy(struct isci_port *iport, · 62 unmodified lines
749748 struct isci_phy *iphy,
750749 bool do_notify_user)
751750 {
752− struct scic_sds_controller *scic = iport->owning_controller;
753− struct isci_host *ihost = scic_to_ihost(scic);
751+ struct isci_host *ihost = iport->owning_controller;
754752
755753 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA)
756754 scic_sds_phy_resume(iphy);
757755
758756 iport->active_phy_mask |= 1 << iphy->phy_index;
759757
760− scic_sds_controller_clear_invalid_phy(scic, iphy);
758+ scic_sds_controller_clear_invalid_phy(ihost, iphy);
761759
762760 if (do_notify_user == true)
763761 isci_port_link_up(ihost, iport, iphy);
@@ -767,8 +765,7 @@ void scic_sds_port_deactivate_phy(struct isci_port *iport, · 3 unmodified lines
767765 struct isci_phy *iphy,
768766 bool do_notify_user)
769767 {
770− struct scic_sds_controller *scic = scic_sds_port_get_controller(iport);
771− struct isci_host *ihost = scic_to_ihost(scic);
768+ struct isci_host *ihost = scic_sds_port_get_controller(iport);
772769
773770 iport->active_phy_mask &= ~(1 << iphy->phy_index);
774771
@@ -793,16 +790,16 @@ void scic_sds_port_deactivate_phy(struct isci_port *iport, · 18 unmodified lines
793790 static void scic_sds_port_invalid_link_up(struct isci_port *iport,
794791 struct isci_phy *iphy)
795792 {
796− struct scic_sds_controller *scic = iport->owning_controller;
793+ struct isci_host *ihost = iport->owning_controller;
797794
798795 /*
799796 * Check to see if we have alreay reported this link as bad and if
800797 * not go ahead and tell the SCI_USER that we have discovered an
801798 * invalid link.
802799 */
803− if ((scic->invalid_phy_mask & (1 << iphy->phy_index)) == 0) {
804− scic_sds_controller_set_invalid_phy(scic, iphy);
805− dev_warn(&scic_to_ihost(scic)->pdev->dev, "Invalid link up!\n");
800+ if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) {
801+ scic_sds_controller_set_invalid_phy(ihost, iphy);
802+ dev_warn(&ihost->pdev->dev, "Invalid link up!\n");
806803 }
807804 }
808805
@@ -931,7 +928,7 @@ static void port_timeout(unsigned long data) · 122 unmodified lines
931928 {
932929 struct sci_timer *tmr = (struct sci_timer *)data;
933930 struct isci_port *iport = container_of(tmr, typeof(*iport), timer);
934− struct isci_host *ihost = scic_to_ihost(iport->owning_controller);
931+ struct isci_host *ihost = iport->owning_controller;
935932 unsigned long flags;
936933 u32 current_state;
937934
@@ -1041,19 +1038,19 @@ static void scic_sds_port_suspend_port_task_scheduler(struct isci_port *iport) · 103 unmodified lines
10411038 */
10421039 static void scic_sds_port_post_dummy_request(struct isci_port *iport)
10431040 {
1044− struct scic_sds_controller *scic = iport->owning_controller;
1041+ struct isci_host *ihost = iport->owning_controller;
10451042 u16 tag = iport->reserved_tag;
10461043 struct scu_task_context *tc;
10471044 u32 command;
10481045
1049− tc = &scic->task_context_table[ISCI_TAG_TCI(tag)];
1046+ tc = &ihost->task_context_table[ISCI_TAG_TCI(tag)];
10501047 tc->abort = 0;
10511048
10521049 command = SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
10531050 iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
10541051 ISCI_TAG_TCI(tag);
10551052
1056− scic_sds_controller_post_request(scic, command);
1053+ scic_sds_controller_post_request(ihost, command);
10571054 }
10581055
10591056 /**
@@ -1065,19 +1062,19 @@ static void scic_sds_port_post_dummy_request(struct isci_port *iport) · 5 unmodified lines
10651062 */
10661063 static void scic_sds_port_abort_dummy_request(struct isci_port *iport)
10671064 {
1068− struct scic_sds_controller *scic = iport->owning_controller;
1065+ struct isci_host *ihost = iport->owning_controller;
10691066 u16 tag = iport->reserved_tag;
10701067 struct scu_task_context *tc;
10711068 u32 command;
10721069
1073− tc = &scic->task_context_table[ISCI_TAG_TCI(tag)];
1070+ tc = &ihost->task_context_table[ISCI_TAG_TCI(tag)];
10741071 tc->abort = 1;
10751072
10761073 command = SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT |
10771074 iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
10781075 ISCI_TAG_TCI(tag);
10791076
1080− scic_sds_controller_post_request(scic, command);
1077+ scic_sds_controller_post_request(ihost, command);
10811078 }
10821079
10831080 /**
@@ -1115,8 +1112,7 @@ static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state · 31 unmodified lines
11151112 {
11161113 u32 index;
11171114 struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1118− struct scic_sds_controller *scic = iport->owning_controller;
1119− struct isci_host *ihost = scic_to_ihost(scic);
1115+ struct isci_host *ihost = iport->owning_controller;
11201116
11211117 isci_port_ready(ihost, iport);
11221118
@@ -1141,13 +1137,13 @@ static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state · 18 unmodified lines
11411137
11421138 static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport)
11431139 {
1144− struct scic_sds_controller *scic = iport->owning_controller;
1140+ struct isci_host *ihost = iport->owning_controller;
11451141 u8 phys_index = iport->physical_port_index;
11461142 union scu_remote_node_context *rnc;
11471143 u16 rni = iport->reserved_rni;
11481144 u32 command;
11491145
1150− rnc = &scic->remote_node_context_table[rni];
1146+ rnc = &ihost->remote_node_context_table[rni];
11511147
11521148 rnc->ssp.is_valid = false;
11531149
@@ -1155,13 +1151,13 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport) · 1 unmodified line
11551151 * controller and give it ample time to act before posting the rnc
11561152 * invalidate
11571153 */
1158− readl(&scic->smu_registers->interrupt_status); /* flush */
1154+ readl(&ihost->smu_registers->interrupt_status); /* flush */
11591155 udelay(10);
11601156
11611157 command = SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE |
11621158 phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni;
11631159
1164− scic_sds_controller_post_request(scic, command);
1160+ scic_sds_controller_post_request(ihost, command);
11651161 }
11661162
11671163 /**
@@ -1175,8 +1171,7 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport) · 7 unmodified lines
11751171 static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_machine *sm)
11761172 {
11771173 struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1178− struct scic_sds_controller *scic = iport->owning_controller;
1179− struct isci_host *ihost = scic_to_ihost(scic);
1174+ struct isci_host *ihost = iport->owning_controller;
11801175
11811176 /*
11821177 * Kill the dummy task for this port if it has not yet posted
@@ -1194,8 +1189,7 @@ static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_ · 11 unmodified lines
11941189 static void scic_sds_port_ready_substate_configuring_enter(struct sci_base_state_machine *sm)
11951190 {
11961191 struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1197− struct scic_sds_controller *scic = iport->owning_controller;
1198− struct isci_host *ihost = scic_to_ihost(scic);
1192+ struct isci_host *ihost = iport->owning_controller;
11991193
12001194 if (iport->active_phy_mask == 0) {
12011195 isci_port_not_ready(ihost, iport);
@@ -1218,7 +1212,7 @@ static void scic_sds_port_ready_substate_configuring_exit(struct sci_base_state_ · 16 unmodified lines
12181212
12191213 enum sci_status scic_sds_port_start(struct isci_port *iport)
12201214 {
1221− struct scic_sds_controller *scic = iport->owning_controller;
1215+ struct isci_host *ihost = iport->owning_controller;
12221216 enum sci_status status = SCI_SUCCESS;
12231217 enum scic_sds_port_states state;
12241218 u32 phy_mask;
@@ -1241,7 +1235,7 @@ enum sci_status scic_sds_port_start(struct isci_port *iport) · 16 unmodified lines
12411235
12421236 if (iport->reserved_rni == SCU_DUMMY_INDEX) {
12431237 u16 rni = scic_sds_remote_node_table_allocate_remote_node(
1244− &scic->available_remote_nodes, 1);
1238+ &ihost->available_remote_nodes, 1);
12451239
12461240 if (rni != SCU_DUMMY_INDEX)
12471241 scic_sds_port_construct_dummy_rnc(iport, rni);
@@ -1251,7 +1245,6 @@ enum sci_status scic_sds_port_start(struct isci_port *iport) · 3 unmodified lines
12511245 }
12521246
12531247 if (iport->reserved_tag == SCI_CONTROLLER_INVALID_IO_TAG) {
1254− struct isci_host *ihost = scic_to_ihost(scic);
12551248 u16 tag;
12561249
12571250 tag = isci_alloc_tag(ihost);
@@ -1634,30 +1627,30 @@ scic_sds_port_disable_port_task_scheduler(struct isci_port *iport) · 376 unmodified lines
16341627
16351628 static void scic_sds_port_post_dummy_remote_node(struct isci_port *iport)
16361629 {
1637− struct scic_sds_controller *scic = iport->owning_controller;
1630+ struct isci_host *ihost = iport->owning_controller;
16381631 u8 phys_index = iport->physical_port_index;
16391632 union scu_remote_node_context *rnc;
16401633 u16 rni = iport->reserved_rni;
16411634 u32 command;
16421635
1643− rnc = &scic->remote_node_context_table[rni];
1636+ rnc = &ihost->remote_node_context_table[rni];
16441637 rnc->ssp.is_valid = true;
16451638
16461639 command = SCU_CONTEXT_COMMAND_POST_RNC_32 |
16471640 phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni;
16481641
1649− scic_sds_controller_post_request(scic, command);
1642+ scic_sds_controller_post_request(ihost, command);
16501643
16511644 /* ensure hardware has seen the post rnc command and give it
16521645 * ample time to act before sending the suspend
16531646 */
1654− readl(&scic->smu_registers->interrupt_status); /* flush */
1647+ readl(&ihost->smu_registers->interrupt_status); /* flush */
16551648 udelay(10);
16561649
16571650 command = SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX |
16581651 phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni;
16591652
1660− scic_sds_controller_post_request(scic, command);
1653+ scic_sds_controller_post_request(ihost, command);
16611654 }
16621655
16631656 static void scic_sds_port_stopped_state_enter(struct sci_base_state_machine *sm)
@@ -1684,8 +1677,7 @@ static void scic_sds_port_stopped_state_exit(struct sci_base_state_machine *sm) · 20 unmodified lines
16841677 static void scic_sds_port_ready_state_enter(struct sci_base_state_machine *sm)
16851678 {
16861679 struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1687− struct scic_sds_controller *scic = iport->owning_controller;
1688− struct isci_host *ihost = scic_to_ihost(scic);
1680+ struct isci_host *ihost = iport->owning_controller;
16891681 u32 prev_state;
16901682
16911683 prev_state = iport->sm.previous_state_id;
@@ -1758,7 +1750,7 @@ static const struct sci_base_state scic_sds_port_state_table[] = { · 66 unmodified lines
17581750 };
17591751
17601752 void scic_sds_port_construct(struct isci_port *iport, u8 index,
1761− struct scic_sds_controller *scic)
1753+ struct isci_host *ihost)
17621754 {
17631755 sci_init_sm(&iport->sm, scic_sds_port_state_table, SCI_PORT_STOPPED);
17641756
@@ -1767,7 +1759,7 @@ void scic_sds_port_construct(struct isci_port *iport, u8 index, · 2 unmodified lines
17671759 iport->active_phy_mask = 0;
17681760 iport->ready_exit = false;
17691761
1770− iport->owning_controller = scic;
1762+ iport->owning_controller = ihost;
17711763
17721764 iport->started_request_count = 0;
17731765 iport->assigned_device_count = 0;
@@ -1810,8 +1802,7 @@ void scic_sds_port_broadcast_change_received( · 36 unmodified lines
18101802 struct isci_port *iport,
18111803 struct isci_phy *iphy)
18121804 {
1813− struct scic_sds_controller *scic = iport->owning_controller;
1814− struct isci_host *ihost = scic_to_ihost(scic);
1805+ struct isci_host *ihost = iport->owning_controller;
18151806
18161807 /* notify the user. */
18171808 isci_port_bc_change_received(ihost, iport, iphy);
drivers/scsi/isci/port.h+2−2
@@ -115,7 +115,7 @@ struct isci_port { · 114 unmodified lines
115115 u32 assigned_device_count;
116116 u32 not_ready_reason;
117117 struct isci_phy *phy_table[SCI_MAX_PHYS];
118− struct scic_sds_controller *owning_controller;
118+ struct isci_host *owning_controller;
119119 struct sci_timer timer;
120120 struct scu_port_task_scheduler_registers __iomem *port_task_scheduler_registers;
121121 /* XXX rework: only one register, no need to replicate per-port */
@@ -243,7 +243,7 @@ static inline void scic_sds_port_decrement_request_count(struct isci_port *iport · 121 unmodified lines
243243 void scic_sds_port_construct(
244244 struct isci_port *iport,
245245 u8 port_index,
246− struct scic_sds_controller *scic);
246+ struct isci_host *ihost);
247247
248248 enum sci_status scic_sds_port_initialize(
249249 struct isci_port *iport,
drivers/scsi/isci/port_config.c+30−52
@@ -113,7 +113,7 @@ static s32 sci_sas_address_compare( · 112 unmodified lines
113113 * NULL if there is no matching port for the phy.
114114 */
115115 static struct isci_port *scic_sds_port_configuration_agent_find_port(
116− struct scic_sds_controller *scic,
116+ struct isci_host *ihost,
117117 struct isci_phy *iphy)
118118 {
119119 u8 i;
@@ -130,8 +130,7 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port( · 10 unmodified lines
130130 scic_sds_phy_get_sas_address(iphy, &phy_sas_address);
131131 scic_sds_phy_get_attached_sas_address(iphy, &phy_attached_device_address);
132132
133− for (i = 0; i < scic->logical_port_entries; i++) {
134− struct isci_host *ihost = scic_to_ihost(scic);
133+ for (i = 0; i < ihost->logical_port_entries; i++) {
135134 struct isci_port *iport = &ihost->ports[i];
136135
137136 scic_sds_port_get_sas_address(iport, &port_sas_address);
@@ -158,10 +157,9 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port( · 20 unmodified lines
158157 * the port configuration is not valid for this port configuration agent.
159158 */
160159 static enum sci_status scic_sds_port_configuration_agent_validate_ports(
161− struct scic_sds_controller *controller,
160+ struct isci_host *ihost,
162161 struct scic_sds_port_configuration_agent *port_agent)
163162 {
164− struct isci_host *ihost = scic_to_ihost(controller);
165163 struct sci_sas_address first_address;
166164 struct sci_sas_address second_address;
167165
@@ -239,17 +237,11 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports( · 71 unmodified lines
239237 * Manual port configuration agent routines
240238 * ****************************************************************************** */
241239
242−/**
243− *
244− *
245− * This routine will verify that all of the phys in the same port are using the
246− * same SAS address.
247− */
248−static enum sci_status scic_sds_mpc_agent_validate_phy_configuration(
249− struct scic_sds_controller *controller,
250− struct scic_sds_port_configuration_agent *port_agent)
240+/* verify all of the phys in the same port are using the same SAS address */
241+static enum sci_status
242+scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
243+ struct scic_sds_port_configuration_agent *port_agent)
251244 {
252− struct isci_host *ihost = scic_to_ihost(controller);
253245 u32 phy_mask;
254246 u32 assigned_phy_mask;
255247 struct sci_sas_address sas_address;
@@ -262,7 +254,7 @@ static enum sci_status scic_sds_mpc_agent_validate_phy_configuration( · 6 unmodified lines
262254 sas_address.low = 0;
263255
264256 for (port_index = 0; port_index < SCI_MAX_PORTS; port_index++) {
265− phy_mask = controller->oem_parameters.sds1.ports[port_index].phy_mask;
257+ phy_mask = ihost->oem_parameters.sds1.ports[port_index].phy_mask;
266258
267259 if (!phy_mask)
268260 continue;
@@ -324,7 +316,7 @@ static enum sci_status scic_sds_mpc_agent_validate_phy_configuration( · 55 unmodified lines
324316 phy_index++;
325317 }
326318
327− return scic_sds_port_configuration_agent_validate_ports(controller, port_agent);
319+ return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent);
328320 }
329321
330322 static void mpc_agent_timeout(unsigned long data)
@@ -332,14 +324,12 @@ static void mpc_agent_timeout(unsigned long data) · 1 unmodified line
332324 u8 index;
333325 struct sci_timer *tmr = (struct sci_timer *)data;
334326 struct scic_sds_port_configuration_agent *port_agent;
335− struct scic_sds_controller *scic;
336327 struct isci_host *ihost;
337328 unsigned long flags;
338329 u16 configure_phy_mask;
339330
340331 port_agent = container_of(tmr, typeof(*port_agent), timer);
341− scic = container_of(port_agent, typeof(*scic), port_agent);
342− ihost = scic_to_ihost(scic);
332+ ihost = container_of(port_agent, typeof(*ihost), port_agent);
343333
344334 spin_lock_irqsave(&ihost->scic_lock, flags);
345335
@@ -355,7 +345,7 @@ static void mpc_agent_timeout(unsigned long data) · 9 unmodified lines
355345 struct isci_phy *iphy = &ihost->phys[index];
356346
357347 if (configure_phy_mask & (1 << index)) {
358− port_agent->link_up_handler(scic, port_agent,
348+ port_agent->link_up_handler(ihost, port_agent,
359349 phy_get_non_dummy_port(iphy),
360350 iphy);
361351 }
@@ -365,7 +355,7 @@ done: · 3 unmodified lines
365355 spin_unlock_irqrestore(&ihost->scic_lock, flags);
366356 }
367357
368−static void scic_sds_mpc_agent_link_up(struct scic_sds_controller *controller,
358+static void scic_sds_mpc_agent_link_up(struct isci_host *ihost,
369359 struct scic_sds_port_configuration_agent *port_agent,
370360 struct isci_port *iport,
371361 struct isci_phy *iphy)
@@ -401,7 +391,7 @@ static void scic_sds_mpc_agent_link_up(struct scic_sds_controller *controller, · 29 unmodified lines
401391 * link down notification from a phy that has no assocoated port?
402392 */
403393 static void scic_sds_mpc_agent_link_down(
404− struct scic_sds_controller *scic,
394+ struct isci_host *ihost,
405395 struct scic_sds_port_configuration_agent *port_agent,
406396 struct isci_port *iport,
407397 struct isci_phy *iphy)
@@ -438,26 +428,17 @@ static void scic_sds_mpc_agent_link_down( · 30 unmodified lines
438428 }
439429 }
440430
441−/*
442− * ******************************************************************************
443− * Automatic port configuration agent routines
444− * ****************************************************************************** */
445−
446−/**
447− *
448− *
449− * This routine will verify that the phys are assigned a valid SAS address for
450− * automatic port configuration mode.
431+/* verify phys are assigned a valid SAS address for automatic port
432+ * configuration mode.
451433 */
452−static enum sci_status scic_sds_apc_agent_validate_phy_configuration(
453− struct scic_sds_controller *controller,
454− struct scic_sds_port_configuration_agent *port_agent)
434+static enum sci_status
435+scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost,
436+ struct scic_sds_port_configuration_agent *port_agent)
455437 {
456438 u8 phy_index;
457439 u8 port_index;
458440 struct sci_sas_address sas_address;
459441 struct sci_sas_address phy_assigned_address;
460− struct isci_host *ihost = scic_to_ihost(controller);
461442
462443 phy_index = 0;
463444
@@ -484,10 +465,10 @@ static enum sci_status scic_sds_apc_agent_validate_phy_configuration( · 20 unmodified lines
484465 }
485466 }
486467
487− return scic_sds_port_configuration_agent_validate_ports(controller, port_agent);
468+ return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent);
488469 }
489470
490−static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *controller,
471+static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
491472 struct scic_sds_port_configuration_agent *port_agent,
492473 struct isci_phy *iphy,
493474 bool start_timer)
@@ -496,9 +477,8 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 2 unmodified lines
496477 enum sci_status status;
497478 struct isci_port *iport;
498479 enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY;
499− struct isci_host *ihost = scic_to_ihost(controller);
500480
501− iport = scic_sds_port_configuration_agent_find_port(controller, iphy);
481+ iport = scic_sds_port_configuration_agent_find_port(ihost, iphy);
502482
503483 if (iport) {
504484 if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index))
@@ -619,7 +599,7 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 114 unmodified lines
619599 * notifications. Is it possible to get a link down notification from a phy
620600 * that has no assocoated port?
621601 */
622−static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic,
602+static void scic_sds_apc_agent_link_up(struct isci_host *ihost,
623603 struct scic_sds_port_configuration_agent *port_agent,
624604 struct isci_port *iport,
625605 struct isci_phy *iphy)
@@ -629,7 +609,7 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic, · 3 unmodified lines
629609 if (!iport) {
630610 /* the phy is not the part of this port */
631611 port_agent->phy_ready_mask |= 1 << phy_index;
632− scic_sds_apc_agent_configure_ports(scic, port_agent, iphy, true);
612+ scic_sds_apc_agent_configure_ports(ihost, port_agent, iphy, true);
633613 } else {
634614 /* the phy is already the part of the port */
635615 u32 port_state = iport->sm.current_state_id;
@@ -658,7 +638,7 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic, · 22 unmodified lines
658638 * port?
659639 */
660640 static void scic_sds_apc_agent_link_down(
661− struct scic_sds_controller *controller,
641+ struct isci_host *ihost,
662642 struct scic_sds_port_configuration_agent *port_agent,
663643 struct isci_port *iport,
664644 struct isci_phy *iphy)
@@ -683,14 +663,12 @@ static void apc_agent_timeout(unsigned long data) · 18 unmodified lines
683663 u32 index;
684664 struct sci_timer *tmr = (struct sci_timer *)data;
685665 struct scic_sds_port_configuration_agent *port_agent;
686− struct scic_sds_controller *scic;
687666 struct isci_host *ihost;
688667 unsigned long flags;
689668 u16 configure_phy_mask;
690669
691670 port_agent = container_of(tmr, typeof(*port_agent), timer);
692− scic = container_of(port_agent, typeof(*scic), port_agent);
693− ihost = scic_to_ihost(scic);
671+ ihost = container_of(port_agent, typeof(*ihost), port_agent);
694672
695673 spin_lock_irqsave(&ihost->scic_lock, flags);
696674
@@ -708,7 +686,7 @@ static void apc_agent_timeout(unsigned long data) · 11 unmodified lines
708686 if ((configure_phy_mask & (1 << index)) == 0)
709687 continue;
710688
711− scic_sds_apc_agent_configure_ports(scic, port_agent,
689+ scic_sds_apc_agent_configure_ports(ihost, port_agent,
712690 &ihost->phys[index], false);
713691 }
714692
@@ -748,17 +726,17 @@ void scic_sds_port_configuration_agent_construct( · 33 unmodified lines
748726 }
749727
750728 enum sci_status scic_sds_port_configuration_agent_initialize(
751− struct scic_sds_controller *scic,
729+ struct isci_host *ihost,
752730 struct scic_sds_port_configuration_agent *port_agent)
753731 {
754732 enum sci_status status;
755733 enum scic_port_configuration_mode mode;
756734
757− mode = scic->oem_parameters.sds1.controller.mode_type;
735+ mode = ihost->oem_parameters.sds1.controller.mode_type;
758736
759737 if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
760738 status = scic_sds_mpc_agent_validate_phy_configuration(
761− scic, port_agent);
739+ ihost, port_agent);
762740
763741 port_agent->link_up_handler = scic_sds_mpc_agent_link_up;
764742 port_agent->link_down_handler = scic_sds_mpc_agent_link_down;
@@ -766,7 +744,7 @@ enum sci_status scic_sds_port_configuration_agent_initialize( · 1 unmodified line
766744 sci_init_timer(&port_agent->timer, mpc_agent_timeout);
767745 } else {
768746 status = scic_sds_apc_agent_validate_phy_configuration(
769− scic, port_agent);
747+ ihost, port_agent);
770748
771749 port_agent->link_up_handler = scic_sds_apc_agent_link_up;
772750 port_agent->link_down_handler = scic_sds_apc_agent_link_down;
drivers/scsi/isci/probe_roms.h+1−1
@@ -165,7 +165,7 @@ struct scic_sds_oem_params; · 164 unmodified lines
165165 int scic_oem_parameters_validate(struct scic_sds_oem_params *oem);
166166
167167 union scic_oem_parameters;
168−void scic_oem_parameters_get(struct scic_sds_controller *scic,
168+void scic_oem_parameters_get(struct isci_host *ihost,
169169 union scic_oem_parameters *oem);
170170
171171 struct isci_orom;
drivers/scsi/isci/remote_device.c+37−39
@@ -62,7 +62,7 @@ · 61 unmodified lines
6262 #include "task.h"
6363
6464 /**
65− * isci_remote_device_not_ready() - This function is called by the scic when
65+ * isci_remote_device_not_ready() - This function is called by the ihost when
6666 * the remote device is not ready. We mark the isci device as ready (not
6767 * "ready_for_io") and signal the waiting proccess.
6868 * @isci_host: This parameter specifies the isci host object.
@@ -92,7 +92,7 @@ static void isci_remote_device_not_ready(struct isci_host *ihost, · 23 unmodified lines
9292 "%s: isci_device = %p request = %p\n",
9393 __func__, idev, ireq);
9494
95− scic_controller_terminate_request(&ihost->sci,
95+ scic_controller_terminate_request(ihost,
9696 idev,
9797 ireq);
9898 }
@@ -104,7 +104,7 @@ static void isci_remote_device_not_ready(struct isci_host *ihost, · 5 unmodified lines
104104 }
105105
106106 /**
107− * isci_remote_device_ready() - This function is called by the scic when the
107+ * isci_remote_device_ready() - This function is called by the ihost when the
108108 * remote device is ready. We mark the isci device as ready and signal the
109109 * waiting proccess.
110110 * @ihost: our valid isci_host
@@ -135,8 +135,7 @@ static void rnc_destruct_done(void *_dev) · 24 unmodified lines
135135
136136 static enum sci_status scic_sds_remote_device_terminate_requests(struct isci_remote_device *idev)
137137 {
138− struct scic_sds_controller *scic = idev->owning_port->owning_controller;
139− struct isci_host *ihost = scic_to_ihost(scic);
138+ struct isci_host *ihost = idev->owning_port->owning_controller;
140139 enum sci_status status = SCI_SUCCESS;
141140 u32 i;
142141
@@ -148,7 +147,7 @@ static enum sci_status scic_sds_remote_device_terminate_requests(struct isci_rem · 5 unmodified lines
148147 ireq->target_device != idev)
149148 continue;
150149
151− s = scic_controller_terminate_request(scic, idev, ireq);
150+ s = scic_controller_terminate_request(ihost, idev, ireq);
152151 if (s != SCI_SUCCESS)
153152 status = s;
154153 }
@@ -276,7 +275,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device * · 121 unmodified lines
276275 {
277276 struct sci_base_state_machine *sm = &idev->sm;
278277 enum scic_sds_remote_device_states state = sm->current_state_id;
279− struct scic_sds_controller *scic = idev->owning_port->owning_controller;
278+ struct isci_host *ihost = idev->owning_port->owning_controller;
280279 enum sci_status status;
281280
282281 switch (state) {
@@ -290,7 +289,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device * · 7 unmodified lines
290289 dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
291290 __func__, state);
292291 /* Return the frame back to the controller */
293− scic_sds_controller_release_frame(scic, frame_index);
292+ scic_sds_controller_release_frame(ihost, frame_index);
294293 return SCI_FAILURE_INVALID_STATE;
295294 case SCI_DEV_READY:
296295 case SCI_STP_DEV_NCQ_ERROR:
@@ -303,7 +302,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device * · 6 unmodified lines
303302 void *frame_header;
304303 ssize_t word_cnt;
305304
306− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
305+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
307306 frame_index,
308307 &frame_header);
309308 if (status != SCI_SUCCESS)
@@ -312,7 +311,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device * · 2 unmodified lines
312311 word_cnt = sizeof(hdr) / sizeof(u32);
313312 sci_swab32_cpy(&hdr, frame_header, word_cnt);
314313
315− ireq = scic_request_by_tag(scic, be16_to_cpu(hdr.tag));
314+ ireq = scic_request_by_tag(ihost, be16_to_cpu(hdr.tag));
316315 if (ireq && ireq->target_device == idev) {
317316 /* The IO request is now in charge of releasing the frame */
318317 status = scic_sds_io_request_frame_handler(ireq, frame_index);
@@ -320,14 +319,14 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device * · 1 unmodified line
320319 /* We could not map this tag to a valid IO
321320 * request Just toss the frame and continue
322321 */
323− scic_sds_controller_release_frame(scic, frame_index);
322+ scic_sds_controller_release_frame(ihost, frame_index);
324323 }
325324 break;
326325 }
327326 case SCI_STP_DEV_NCQ: {
328327 struct dev_to_host_fis *hdr;
329328
330− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
329+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
331330 frame_index,
332331 (void **)&hdr);
333332 if (status != SCI_SUCCESS)
@@ -350,7 +349,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device * · 16 unmodified lines
350349 } else
351350 status = SCI_FAILURE;
352351
353− scic_sds_controller_release_frame(scic, frame_index);
352+ scic_sds_controller_release_frame(ihost, frame_index);
354353 break;
355354 }
356355 case SCI_STP_DEV_CMD:
@@ -461,7 +460,7 @@ static void scic_sds_remote_device_start_request(struct isci_remote_device *idev · 104 unmodified lines
461460 }
462461 }
463462
464−enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic,
463+enum sci_status scic_sds_remote_device_start_io(struct isci_host *ihost,
465464 struct isci_remote_device *idev,
466465 struct isci_request *ireq)
467466 {
@@ -597,7 +596,7 @@ static enum sci_status common_complete_io(struct isci_port *iport, · 129 unmodified lines
597596 return status;
598597 }
599598
600−enum sci_status scic_sds_remote_device_complete_io(struct scic_sds_controller *scic,
599+enum sci_status scic_sds_remote_device_complete_io(struct isci_host *ihost,
601600 struct isci_remote_device *idev,
602601 struct isci_request *ireq)
603602 {
@@ -678,7 +677,7 @@ static void scic_sds_remote_device_continue_request(void *dev) · 74 unmodified lines
678677 scic_controller_continue_io(idev->working_request);
679678 }
680679
681−enum sci_status scic_sds_remote_device_start_task(struct scic_sds_controller *scic,
680+enum sci_status scic_sds_remote_device_start_task(struct isci_host *ihost,
682681 struct isci_remote_device *idev,
683682 struct isci_request *ireq)
684683 {
@@ -802,13 +801,13 @@ static void remote_device_resume_done(void *_dev) · 117 unmodified lines
802801 static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *_dev)
803802 {
804803 struct isci_remote_device *idev = _dev;
805− struct scic_sds_controller *scic = idev->owning_port->owning_controller;
804+ struct isci_host *ihost = idev->owning_port->owning_controller;
806805
807806 /* For NCQ operation we do not issue a isci_remote_device_not_ready().
808807 * As a result, avoid sending the ready notification.
809808 */
810809 if (idev->sm.previous_state_id != SCI_STP_DEV_NCQ)
811− isci_remote_device_ready(scic_to_ihost(scic), idev);
810+ isci_remote_device_ready(ihost, idev);
812811 }
813812
814813 static void scic_sds_remote_device_initial_state_enter(struct sci_base_state_machine *sm)
@@ -836,7 +835,7 @@ static enum sci_status scic_remote_device_destruct(struct isci_remote_device *id · 21 unmodified lines
836835 {
837836 struct sci_base_state_machine *sm = &idev->sm;
838837 enum scic_sds_remote_device_states state = sm->current_state_id;
839− struct scic_sds_controller *scic;
838+ struct isci_host *ihost;
840839
841840 if (state != SCI_DEV_STOPPED) {
842841 dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
@@ -844,8 +843,8 @@ static enum sci_status scic_remote_device_destruct(struct isci_remote_device *id · 1 unmodified line
844843 return SCI_FAILURE_INVALID_STATE;
845844 }
846845
847− scic = idev->owning_port->owning_controller;
848− scic_sds_controller_free_remote_node_context(scic, idev,
846+ ihost = idev->owning_port->owning_controller;
847+ scic_sds_controller_free_remote_node_context(ihost, idev,
849848 idev->rnc.remote_node_index);
850849 idev->rnc.remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
851850 sci_change_state(sm, SCI_DEV_FINAL);
@@ -878,7 +877,7 @@ static void isci_remote_device_deconstruct(struct isci_host *ihost, struct isci_ · 26 unmodified lines
878877 static void scic_sds_remote_device_stopped_state_enter(struct sci_base_state_machine *sm)
879878 {
880879 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
881− struct scic_sds_controller *scic = idev->owning_port->owning_controller;
880+ struct isci_host *ihost = idev->owning_port->owning_controller;
882881 u32 prev_state;
883882
884883 /* If we are entering from the stopping state let the SCI User know that
@@ -886,16 +885,15 @@ static void scic_sds_remote_device_stopped_state_enter(struct sci_base_state_mac · 1 unmodified line
886885 */
887886 prev_state = idev->sm.previous_state_id;
888887 if (prev_state == SCI_DEV_STOPPING)
889− isci_remote_device_deconstruct(scic_to_ihost(scic), idev);
888+ isci_remote_device_deconstruct(ihost, idev);
890889
891− scic_sds_controller_remote_device_stopped(scic, idev);
890+ scic_sds_controller_remote_device_stopped(ihost, idev);
892891 }
893892
894893 static void scic_sds_remote_device_starting_state_enter(struct sci_base_state_machine *sm)
895894 {
896895 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
897− struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
898− struct isci_host *ihost = scic_to_ihost(scic);
896+ struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
899897
900898 isci_remote_device_not_ready(ihost, idev,
901899 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
@@ -904,7 +902,7 @@ static void scic_sds_remote_device_starting_state_enter(struct sci_base_state_ma · 2 unmodified lines
904902 static void scic_sds_remote_device_ready_state_enter(struct sci_base_state_machine *sm)
905903 {
906904 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
907− struct scic_sds_controller *scic = idev->owning_port->owning_controller;
905+ struct isci_host *ihost = idev->owning_port->owning_controller;
908906 struct domain_device *dev = idev->domain_dev;
909907
910908 if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_SATA)) {
@@ -912,7 +910,7 @@ static void scic_sds_remote_device_ready_state_enter(struct sci_base_state_machi · 1 unmodified line
912910 } else if (dev_is_expander(dev)) {
913911 sci_change_state(&idev->sm, SCI_SMP_DEV_IDLE);
914912 } else
915− isci_remote_device_ready(scic_to_ihost(scic), idev);
913+ isci_remote_device_ready(ihost, idev);
916914 }
917915
918916 static void scic_sds_remote_device_ready_state_exit(struct sci_base_state_machine *sm)
@@ -921,9 +919,9 @@ static void scic_sds_remote_device_ready_state_exit(struct sci_base_state_machin · 2 unmodified lines
921919 struct domain_device *dev = idev->domain_dev;
922920
923921 if (dev->dev_type == SAS_END_DEV) {
924− struct scic_sds_controller *scic = idev->owning_port->owning_controller;
922+ struct isci_host *ihost = idev->owning_port->owning_controller;
925923
926− isci_remote_device_not_ready(scic_to_ihost(scic), idev,
924+ isci_remote_device_not_ready(ihost, idev,
927925 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED);
928926 }
929927 }
@@ -963,40 +961,40 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter(struct sci_base · 33 unmodified lines
963961 static void scic_sds_stp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm)
964962 {
965963 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
966− struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
964+ struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
967965
968966 BUG_ON(idev->working_request == NULL);
969967
970− isci_remote_device_not_ready(scic_to_ihost(scic), idev,
968+ isci_remote_device_not_ready(ihost, idev,
971969 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
972970 }
973971
974972 static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci_base_state_machine *sm)
975973 {
976974 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
977− struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
975+ struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
978976
979977 if (idev->not_ready_reason == SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED)
980− isci_remote_device_not_ready(scic_to_ihost(scic), idev,
978+ isci_remote_device_not_ready(ihost, idev,
981979 idev->not_ready_reason);
982980 }
983981
984982 static void scic_sds_smp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm)
985983 {
986984 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
987− struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
985+ struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
988986
989− isci_remote_device_ready(scic_to_ihost(scic), idev);
987+ isci_remote_device_ready(ihost, idev);
990988 }
991989
992990 static void scic_sds_smp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm)
993991 {
994992 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
995− struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
993+ struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
996994
997995 BUG_ON(idev->working_request == NULL);
998996
999− isci_remote_device_not_ready(scic_to_ihost(scic), idev,
997+ isci_remote_device_not_ready(ihost, idev,
1000998 SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
1001999 }
10021000
@@ -1303,7 +1301,7 @@ void isci_remote_device_release(struct kref *kref) · 300 unmodified lines
13031301 * @isci_host: This parameter specifies the isci host object.
13041302 * @isci_device: This parameter specifies the remote device.
13051303 *
1306− * The status of the scic request to stop.
1304+ * The status of the ihost request to stop.
13071305 */
13081306 enum sci_status isci_remote_device_stop(struct isci_host *ihost, struct isci_remote_device *idev)
13091307 {
drivers/scsi/isci/remote_device.h+3−3
@@ -402,17 +402,17 @@ enum sci_status scic_sds_remote_device_event_handler( · 401 unmodified lines
402402 u32 event_code);
403403
404404 enum sci_status scic_sds_remote_device_start_io(
405− struct scic_sds_controller *controller,
405+ struct isci_host *ihost,
406406 struct isci_remote_device *idev,
407407 struct isci_request *ireq);
408408
409409 enum sci_status scic_sds_remote_device_start_task(
410− struct scic_sds_controller *controller,
410+ struct isci_host *ihost,
411411 struct isci_remote_device *idev,
412412 struct isci_request *ireq);
413413
414414 enum sci_status scic_sds_remote_device_complete_io(
415− struct scic_sds_controller *controller,
415+ struct isci_host *ihost,
416416 struct isci_remote_device *idev,
417417 struct isci_request *ireq);
418418
drivers/scsi/isci/remote_node_context.c+7−7
@@ -107,11 +107,11 @@ static void scic_sds_remote_node_context_construct_buffer( · 106 unmodified lines
107107 struct domain_device *dev = idev->domain_dev;
108108 int rni = sci_rnc->remote_node_index;
109109 union scu_remote_node_context *rnc;
110− struct scic_sds_controller *scic;
110+ struct isci_host *ihost;
111111 __le64 sas_addr;
112112
113− scic = scic_sds_remote_device_get_controller(idev);
114− rnc = scic_sds_controller_get_remote_node_context_buffer(scic, rni);
113+ ihost = scic_sds_remote_device_get_controller(idev);
114+ rnc = scic_sds_controller_get_remote_node_context_buffer(ihost, rni);
115115
116116 memset(rnc, 0, sizeof(union scu_remote_node_context)
117117 * scic_sds_remote_device_node_count(idev));
@@ -135,14 +135,14 @@ static void scic_sds_remote_node_context_construct_buffer( · 17 unmodified lines
135135
136136 if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
137137 rnc->ssp.connection_occupancy_timeout =
138− scic->user_parameters.sds1.stp_max_occupancy_timeout;
138+ ihost->user_parameters.sds1.stp_max_occupancy_timeout;
139139 rnc->ssp.connection_inactivity_timeout =
140− scic->user_parameters.sds1.stp_inactivity_timeout;
140+ ihost->user_parameters.sds1.stp_inactivity_timeout;
141141 } else {
142142 rnc->ssp.connection_occupancy_timeout =
143− scic->user_parameters.sds1.ssp_max_occupancy_timeout;
143+ ihost->user_parameters.sds1.ssp_max_occupancy_timeout;
144144 rnc->ssp.connection_inactivity_timeout =
145− scic->user_parameters.sds1.ssp_inactivity_timeout;
145+ ihost->user_parameters.sds1.ssp_inactivity_timeout;
146146 }
147147
148148 rnc->ssp.initial_arbitration_wait_time = 0;
drivers/scsi/isci/request.c+98−102
@@ -74,19 +74,19 @@ static struct scu_sgl_element_pair *to_sgl_element_pair(struct isci_request *ire · 73 unmodified lines
7474 return &ireq->sg_table[idx - 2];
7575 }
7676
77−static dma_addr_t to_sgl_element_pair_dma(struct scic_sds_controller *scic,
77+static dma_addr_t to_sgl_element_pair_dma(struct isci_host *ihost,
7878 struct isci_request *ireq, u32 idx)
7979 {
8080 u32 offset;
8181
8282 if (idx == 0) {
8383 offset = (void *) &ireq->tc->sgl_pair_ab -
84− (void *) &scic->task_context_table[0];
85− return scic->task_context_dma + offset;
84+ (void *) &ihost->task_context_table[0];
85+ return ihost->task_context_dma + offset;
8686 } else if (idx == 1) {
8787 offset = (void *) &ireq->tc->sgl_pair_cd -
88− (void *) &scic->task_context_table[0];
89− return scic->task_context_dma + offset;
88+ (void *) &ihost->task_context_table[0];
89+ return ihost->task_context_dma + offset;
9090 }
9191
9292 return scic_io_request_get_dma_addr(ireq, &ireq->sg_table[idx - 2]);
@@ -102,8 +102,7 @@ static void init_sgl_element(struct scu_sgl_element *e, struct scatterlist *sg) · 9 unmodified lines
102102
103103 static void scic_sds_request_build_sgl(struct isci_request *ireq)
104104 {
105− struct isci_host *isci_host = ireq->isci_host;
106− struct scic_sds_controller *scic = &isci_host->sci;
105+ struct isci_host *ihost = ireq->isci_host;
107106 struct sas_task *task = isci_request_access_task(ireq);
108107 struct scatterlist *sg = NULL;
109108 dma_addr_t dma_addr;
@@ -125,7 +124,7 @@ static void scic_sds_request_build_sgl(struct isci_request *ireq) · 15 unmodified lines
125124 memset(&scu_sg->B, 0, sizeof(scu_sg->B));
126125
127126 if (prev_sg) {
128− dma_addr = to_sgl_element_pair_dma(scic,
127+ dma_addr = to_sgl_element_pair_dma(ihost,
129128 ireq,
130129 sg_idx);
131130
@@ -141,7 +140,7 @@ static void scic_sds_request_build_sgl(struct isci_request *ireq) · 9 unmodified lines
141140 } else { /* handle when no sg */
142141 scu_sg = to_sgl_element_pair(ireq, sg_idx);
143142
144− dma_addr = dma_map_single(&isci_host->pdev->dev,
143+ dma_addr = dma_map_single(&ihost->pdev->dev,
145144 task->scatter,
146145 task->total_xfer_len,
147146 task->data_dir);
@@ -508,7 +507,7 @@ scic_io_request_construct_sata(struct isci_request *ireq, · 360 unmodified lines
508507 scu_stp_raw_request_construct_task_context(ireq);
509508 return SCI_SUCCESS;
510509 } else {
511− dev_err(scic_to_dev(ireq->owning_controller),
510+ dev_err(&ireq->owning_controller->pdev->dev,
512511 "%s: Request 0x%p received un-handled SAT "
513512 "management protocol 0x%x.\n",
514513 __func__, ireq, tmf->tmf_code);
@@ -518,7 +517,7 @@ scic_io_request_construct_sata(struct isci_request *ireq, · 3 unmodified lines
518517 }
519518
520519 if (!sas_protocol_ata(task->task_proto)) {
521− dev_err(scic_to_dev(ireq->owning_controller),
520+ dev_err(&ireq->owning_controller->pdev->dev,
522521 "%s: Non-ATA protocol in SATA path: 0x%x\n",
523522 __func__,
524523 task->task_proto);
@@ -616,7 +615,7 @@ enum sci_status scic_task_request_construct_sata(struct isci_request *ireq) · 91 unmodified lines
616615 tmf->tmf_code == isci_tmf_sata_srst_low) {
617616 scu_stp_raw_request_construct_task_context(ireq);
618617 } else {
619− dev_err(scic_to_dev(ireq->owning_controller),
618+ dev_err(&ireq->owning_controller->pdev->dev,
620619 "%s: Request 0x%p received un-handled SAT "
621620 "Protocol 0x%x.\n",
622621 __func__, ireq, tmf->tmf_code);
@@ -639,11 +638,11 @@ enum sci_status scic_task_request_construct_sata(struct isci_request *ireq) · 16 unmodified lines
639638 #define SCU_TASK_CONTEXT_SRAM 0x200000
640639 static u32 sci_req_tx_bytes(struct isci_request *ireq)
641640 {
642− struct scic_sds_controller *scic = ireq->owning_controller;
641+ struct isci_host *ihost = ireq->owning_controller;
643642 u32 ret_val = 0;
644643
645− if (readl(&scic->smu_registers->address_modifier) == 0) {
646− void __iomem *scu_reg_base = scic->scu_registers;
644+ if (readl(&ihost->smu_registers->address_modifier) == 0) {
645+ void __iomem *scu_reg_base = ihost->scu_registers;
647646
648647 /* get the bytes of data from the Address == BAR1 + 20002Ch + (256*TCi) where
649648 * BAR1 is the scu_registers
@@ -663,11 +662,11 @@ enum sci_status scic_sds_request_start(struct isci_request *ireq) · 13 unmodified lines
663662 {
664663 enum sci_base_request_states state;
665664 struct scu_task_context *tc = ireq->tc;
666− struct scic_sds_controller *scic = ireq->owning_controller;
665+ struct isci_host *ihost = ireq->owning_controller;
667666
668667 state = ireq->sm.current_state_id;
669668 if (state != SCI_REQ_CONSTRUCTED) {
670− dev_warn(scic_to_dev(scic),
669+ dev_warn(&ihost->pdev->dev,
671670 "%s: SCIC IO Request requested to start while in wrong "
672671 "state %d\n", __func__, state);
673672 return SCI_FAILURE_INVALID_STATE;
@@ -749,7 +748,7 @@ scic_sds_io_request_terminate(struct isci_request *ireq) · 75 unmodified lines
749748 return SCI_SUCCESS;
750749 case SCI_REQ_COMPLETED:
751750 default:
752− dev_warn(scic_to_dev(ireq->owning_controller),
751+ dev_warn(&ireq->owning_controller->pdev->dev,
753752 "%s: SCIC IO Request requested to abort while in wrong "
754753 "state %d\n",
755754 __func__,
@@ -763,7 +762,7 @@ scic_sds_io_request_terminate(struct isci_request *ireq) · 7 unmodified lines
763762 enum sci_status scic_sds_request_complete(struct isci_request *ireq)
764763 {
765764 enum sci_base_request_states state;
766− struct scic_sds_controller *scic = ireq->owning_controller;
765+ struct isci_host *ihost = ireq->owning_controller;
767766
768767 state = ireq->sm.current_state_id;
769768 if (WARN_ONCE(state != SCI_REQ_COMPLETED,
@@ -771,7 +770,7 @@ enum sci_status scic_sds_request_complete(struct isci_request *ireq) · 1 unmodified line
771770 return SCI_FAILURE_INVALID_STATE;
772771
773772 if (ireq->saved_rx_frame_index != SCU_INVALID_FRAME_INDEX)
774− scic_sds_controller_release_frame(scic,
773+ scic_sds_controller_release_frame(ihost,
775774 ireq->saved_rx_frame_index);
776775
777776 /* XXX can we just stop the machine and remove the 'final' state? */
@@ -783,12 +782,12 @@ enum sci_status scic_sds_io_request_event_handler(struct isci_request *ireq, · 5 unmodified lines
783782 u32 event_code)
784783 {
785784 enum sci_base_request_states state;
786− struct scic_sds_controller *scic = ireq->owning_controller;
785+ struct isci_host *ihost = ireq->owning_controller;
787786
788787 state = ireq->sm.current_state_id;
789788
790789 if (state != SCI_REQ_STP_PIO_DATA_IN) {
791− dev_warn(scic_to_dev(scic), "%s: (%x) in wrong state %d\n",
790+ dev_warn(&ihost->pdev->dev, "%s: (%x) in wrong state %d\n",
792791 __func__, event_code, state);
793792
794793 return SCI_FAILURE_INVALID_STATE;
@@ -802,7 +801,7 @@ enum sci_status scic_sds_io_request_event_handler(struct isci_request *ireq, · 7 unmodified lines
802801 sci_change_state(&ireq->sm, SCI_REQ_STP_PIO_WAIT_FRAME);
803802 return SCI_SUCCESS;
804803 default:
805− dev_err(scic_to_dev(scic),
804+ dev_err(&ihost->pdev->dev,
806805 "%s: pio request unexpected event %#x\n",
807806 __func__, event_code);
808807
@@ -1024,7 +1023,7 @@ static enum sci_status ssp_task_request_await_tc_event(struct isci_request *ireq · 215 unmodified lines
10241023 * There is a potential for receiving multiple task responses if
10251024 * we decide to send the task IU again.
10261025 */
1027− dev_warn(scic_to_dev(ireq->owning_controller),
1026+ dev_warn(&ireq->owning_controller->pdev->dev,
10281027 "%s: TaskRequest:0x%p CompletionCode:%x - "
10291028 "ACK/NAK timeout\n", __func__, ireq,
10301029 completion_code);
@@ -1073,7 +1072,7 @@ smp_request_await_response_tc_event(struct isci_request *ireq, · 42 unmodified lines
10731072 * response within 2 ms. This causes our hardware break
10741073 * the connection and set TC completion with one of
10751074 * these SMP_XXX_XX_ERR status. For these type of error,
1076− * we ask scic user to retry the request.
1075+ * we ask ihost user to retry the request.
10771076 */
10781077 scic_sds_request_set_status(ireq, SCU_TASK_DONE_SMP_RESP_TO_ERR,
10791078 SCI_FAILURE_RETRY_REQUIRED);
@@ -1451,18 +1450,18 @@ static void scic_sds_stp_request_udma_complete_request( · 371 unmodified lines
14511450 static enum sci_status scic_sds_stp_request_udma_general_frame_handler(struct isci_request *ireq,
14521451 u32 frame_index)
14531452 {
1454− struct scic_sds_controller *scic = ireq->owning_controller;
1453+ struct isci_host *ihost = ireq->owning_controller;
14551454 struct dev_to_host_fis *frame_header;
14561455 enum sci_status status;
14571456 u32 *frame_buffer;
14581457
1459− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1458+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
14601459 frame_index,
14611460 (void **)&frame_header);
14621461
14631462 if ((status == SCI_SUCCESS) &&
14641463 (frame_header->fis_type == FIS_REGD2H)) {
1465− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1464+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
14661465 frame_index,
14671466 (void **)&frame_buffer);
14681467
@@ -1471,7 +1470,7 @@ static enum sci_status scic_sds_stp_request_udma_general_frame_handler(struct is · 2 unmodified lines
14711470 frame_buffer);
14721471 }
14731472
1474− scic_sds_controller_release_frame(scic, frame_index);
1473+ scic_sds_controller_release_frame(ihost, frame_index);
14751474
14761475 return status;
14771476 }
@@ -1480,7 +1479,7 @@ enum sci_status · 2 unmodified lines
14801479 scic_sds_io_request_frame_handler(struct isci_request *ireq,
14811480 u32 frame_index)
14821481 {
1483− struct scic_sds_controller *scic = ireq->owning_controller;
1482+ struct isci_host *ihost = ireq->owning_controller;
14841483 struct isci_stp_request *stp_req = &ireq->stp.req;
14851484 enum sci_base_request_states state;
14861485 enum sci_status status;
@@ -1492,7 +1491,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 5 unmodified lines
14921491 struct ssp_frame_hdr ssp_hdr;
14931492 void *frame_header;
14941493
1495− scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1494+ scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
14961495 frame_index,
14971496 &frame_header);
14981497
@@ -1503,7 +1502,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 4 unmodified lines
15031502 struct ssp_response_iu *resp_iu;
15041503 ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32);
15051504
1506− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1505+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
15071506 frame_index,
15081507 (void **)&resp_iu);
15091508
@@ -1522,7 +1521,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 12 unmodified lines
15221521 SCI_SUCCESS);
15231522 } else {
15241523 /* not a response frame, why did it get forwarded? */
1525− dev_err(scic_to_dev(scic),
1524+ dev_err(&ihost->pdev->dev,
15261525 "%s: SCIC IO Request 0x%p received unexpected "
15271526 "frame %d type 0x%02x\n", __func__, ireq,
15281527 frame_index, ssp_hdr.frame_type);
@@ -1532,7 +1531,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 3 unmodified lines
15321531 * In any case we are done with this frame buffer return it to
15331532 * the controller
15341533 */
1535− scic_sds_controller_release_frame(scic, frame_index);
1534+ scic_sds_controller_release_frame(ihost, frame_index);
15361535
15371536 return SCI_SUCCESS;
15381537 }
@@ -1540,14 +1539,14 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 1 unmodified line
15401539 case SCI_REQ_TASK_WAIT_TC_RESP:
15411540 scic_sds_io_request_copy_response(ireq);
15421541 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
1543− scic_sds_controller_release_frame(scic,frame_index);
1542+ scic_sds_controller_release_frame(ihost,frame_index);
15441543 return SCI_SUCCESS;
15451544
15461545 case SCI_REQ_SMP_WAIT_RESP: {
15471546 struct smp_resp *rsp_hdr = &ireq->smp.rsp;
15481547 void *frame_header;
15491548
1550− scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1549+ scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
15511550 frame_index,
15521551 &frame_header);
15531552
@@ -1558,7 +1557,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 4 unmodified lines
15581557 if (rsp_hdr->frame_type == SMP_RESPONSE) {
15591558 void *smp_resp;
15601559
1561− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1560+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
15621561 frame_index,
15631562 &smp_resp);
15641563
@@ -1577,7 +1576,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 12 unmodified lines
15771576 * This was not a response frame why did it get
15781577 * forwarded?
15791578 */
1580− dev_err(scic_to_dev(scic),
1579+ dev_err(&ihost->pdev->dev,
15811580 "%s: SCIC SMP Request 0x%p received unexpected "
15821581 "frame %d type 0x%02x\n",
15831582 __func__,
@@ -1592,7 +1591,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 8 unmodified lines
15921591 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
15931592 }
15941593
1595− scic_sds_controller_release_frame(scic, frame_index);
1594+ scic_sds_controller_release_frame(ihost, frame_index);
15961595
15971596 return SCI_SUCCESS;
15981597 }
@@ -1619,12 +1618,12 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 20 unmodified lines
16191618 struct dev_to_host_fis *frame_header;
16201619 u32 *frame_buffer;
16211620
1622− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1621+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
16231622 frame_index,
16241623 (void **)&frame_header);
16251624
16261625 if (status != SCI_SUCCESS) {
1627− dev_err(scic_to_dev(scic),
1626+ dev_err(&ihost->pdev->dev,
16281627 "%s: SCIC IO Request 0x%p could not get frame "
16291628 "header for frame index %d, status %x\n",
16301629 __func__,
@@ -1637,7 +1636,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 6 unmodified lines
16371636
16381637 switch (frame_header->fis_type) {
16391638 case FIS_REGD2H:
1640− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1639+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
16411640 frame_index,
16421641 (void **)&frame_buffer);
16431642
@@ -1651,7 +1650,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 7 unmodified lines
16511650 break;
16521651
16531652 default:
1654− dev_warn(scic_to_dev(scic),
1653+ dev_warn(&ihost->pdev->dev,
16551654 "%s: IO Request:0x%p Frame Id:%d protocol "
16561655 "violation occurred\n", __func__, stp_req,
16571656 frame_index);
@@ -1664,7 +1663,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 6 unmodified lines
16641663 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
16651664
16661665 /* Frame has been decoded return it to the controller */
1667− scic_sds_controller_release_frame(scic, frame_index);
1666+ scic_sds_controller_release_frame(ihost, frame_index);
16681667
16691668 return status;
16701669 }
@@ -1674,12 +1673,12 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 3 unmodified lines
16741673 struct dev_to_host_fis *frame_header;
16751674 u32 *frame_buffer;
16761675
1677− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1676+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
16781677 frame_index,
16791678 (void **)&frame_header);
16801679
16811680 if (status != SCI_SUCCESS) {
1682− dev_err(scic_to_dev(scic),
1681+ dev_err(&ihost->pdev->dev,
16831682 "%s: SCIC IO Request 0x%p could not get frame "
16841683 "header for frame index %d, status %x\n",
16851684 __func__, stp_req, frame_index, status);
@@ -1689,7 +1688,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 3 unmodified lines
16891688 switch (frame_header->fis_type) {
16901689 case FIS_PIO_SETUP:
16911690 /* Get from the frame buffer the PIO Setup Data */
1692− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1691+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
16931692 frame_index,
16941693 (void **)&frame_buffer);
16951694
@@ -1736,7 +1735,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 40 unmodified lines
17361735 * FIS when it is still busy? Do nothing since
17371736 * we are still in the right state.
17381737 */
1739− dev_dbg(scic_to_dev(scic),
1738+ dev_dbg(&ihost->pdev->dev,
17401739 "%s: SCIC PIO Request 0x%p received "
17411740 "D2H Register FIS with BSY status "
17421741 "0x%x\n",
@@ -1746,7 +1745,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 3 unmodified lines
17461745 break;
17471746 }
17481747
1749− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1748+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
17501749 frame_index,
17511750 (void **)&frame_buffer);
17521751
@@ -1767,7 +1766,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 14 unmodified lines
17671766 }
17681767
17691768 /* Frame is decoded return it to the controller */
1770− scic_sds_controller_release_frame(scic, frame_index);
1769+ scic_sds_controller_release_frame(ihost, frame_index);
17711770
17721771 return status;
17731772 }
@@ -1776,12 +1775,12 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 2 unmodified lines
17761775 struct dev_to_host_fis *frame_header;
17771776 struct sata_fis_data *frame_buffer;
17781777
1779− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1778+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
17801779 frame_index,
17811780 (void **)&frame_header);
17821781
17831782 if (status != SCI_SUCCESS) {
1784− dev_err(scic_to_dev(scic),
1783+ dev_err(&ihost->pdev->dev,
17851784 "%s: SCIC IO Request 0x%p could not get frame "
17861785 "header for frame index %d, status %x\n",
17871786 __func__,
@@ -1792,7 +1791,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 4 unmodified lines
17921791 }
17931792
17941793 if (frame_header->fis_type != FIS_DATA) {
1795− dev_err(scic_to_dev(scic),
1794+ dev_err(&ihost->pdev->dev,
17961795 "%s: SCIC PIO Request 0x%p received frame %d "
17971796 "with fis type 0x%02x when expecting a data "
17981797 "fis.\n",
@@ -1808,7 +1807,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 9 unmodified lines
18081807 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
18091808
18101809 /* Frame is decoded return it to the controller */
1811− scic_sds_controller_release_frame(scic, frame_index);
1810+ scic_sds_controller_release_frame(ihost, frame_index);
18121811 return status;
18131812 }
18141813
@@ -1816,7 +1815,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 1 unmodified line
18161815 ireq->saved_rx_frame_index = frame_index;
18171816 stp_req->pio_len = 0;
18181817 } else {
1819− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1818+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
18201819 frame_index,
18211820 (void **)&frame_buffer);
18221821
@@ -1824,7 +1823,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 1 unmodified line
18241823 (u8 *)frame_buffer);
18251824
18261825 /* Frame is decoded return it to the controller */
1827− scic_sds_controller_release_frame(scic, frame_index);
1826+ scic_sds_controller_release_frame(ihost, frame_index);
18281827 }
18291828
18301829 /* Check for the end of the transfer, are there more
@@ -1849,11 +1848,11 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 18 unmodified lines
18491848 struct dev_to_host_fis *frame_header;
18501849 u32 *frame_buffer;
18511850
1852− status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
1851+ status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
18531852 frame_index,
18541853 (void **)&frame_header);
18551854 if (status != SCI_SUCCESS) {
1856− dev_err(scic_to_dev(scic),
1855+ dev_err(&ihost->pdev->dev,
18571856 "%s: SCIC IO Request 0x%p could not get frame "
18581857 "header for frame index %d, status %x\n",
18591858 __func__,
@@ -1865,7 +1864,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 5 unmodified lines
18651864
18661865 switch (frame_header->fis_type) {
18671866 case FIS_REGD2H:
1868− scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
1867+ scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
18691868 frame_index,
18701869 (void **)&frame_buffer);
18711870
@@ -1880,7 +1879,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 8 unmodified lines
18801879 break;
18811880
18821881 default:
1883− dev_warn(scic_to_dev(scic),
1882+ dev_warn(&ihost->pdev->dev,
18841883 "%s: IO Request:0x%p Frame Id:%d protocol "
18851884 "violation occurred\n",
18861885 __func__,
@@ -1896,7 +1895,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 9 unmodified lines
18961895 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
18971896
18981897 /* Frame has been decoded return it to the controller */
1899− scic_sds_controller_release_frame(scic, frame_index);
1898+ scic_sds_controller_release_frame(ihost, frame_index);
19001899
19011900 return status;
19021901 }
@@ -1905,18 +1904,18 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq, · 2 unmodified lines
19051904 * TODO: Is it even possible to get an unsolicited frame in the
19061905 * aborting state?
19071906 */
1908− scic_sds_controller_release_frame(scic, frame_index);
1907+ scic_sds_controller_release_frame(ihost, frame_index);
19091908 return SCI_SUCCESS;
19101909
19111910 default:
1912− dev_warn(scic_to_dev(scic),
1911+ dev_warn(&ihost->pdev->dev,
19131912 "%s: SCIC IO Request given unexpected frame %x while "
19141913 "in state %d\n",
19151914 __func__,
19161915 frame_index,
19171916 state);
19181917
1919− scic_sds_controller_release_frame(scic, frame_index);
1918+ scic_sds_controller_release_frame(ihost, frame_index);
19201919 return SCI_FAILURE_INVALID_STATE;
19211920 }
19221921 }
@@ -2042,7 +2041,7 @@ scic_sds_io_request_tc_completion(struct isci_request *ireq, · 119 unmodified lines
20422041 u32 completion_code)
20432042 {
20442043 enum sci_base_request_states state;
2045− struct scic_sds_controller *scic = ireq->owning_controller;
2044+ struct isci_host *ihost = ireq->owning_controller;
20462045
20472046 state = ireq->sm.current_state_id;
20482047
@@ -2089,7 +2088,7 @@ scic_sds_io_request_tc_completion(struct isci_request *ireq, · 40 unmodified lines
20892088 completion_code);
20902089
20912090 default:
2092− dev_warn(scic_to_dev(scic),
2091+ dev_warn(&ihost->pdev->dev,
20932092 "%s: SCIC IO Request given task completion "
20942093 "notification %x while in wrong state %d\n",
20952094 __func__,
@@ -2480,7 +2479,7 @@ static void isci_task_save_for_upper_layer_completion( · 384 unmodified lines
24802479 }
24812480 }
24822481
2483−static void isci_request_io_request_complete(struct isci_host *isci_host,
2482+static void isci_request_io_request_complete(struct isci_host *ihost,
24842483 struct isci_request *request,
24852484 enum sci_io_status completion_status)
24862485 {
@@ -2495,7 +2494,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 8 unmodified lines
24952494 enum isci_completion_selection complete_to_host
24962495 = isci_perform_normal_io_completion;
24972496
2498− dev_dbg(&isci_host->pdev->dev,
2497+ dev_dbg(&ihost->pdev->dev,
24992498 "%s: request = %p, task = %p,\n"
25002499 "task->data_dir = %d completion_status = 0x%x\n",
25012500 __func__,
@@ -2616,7 +2615,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 114 unmodified lines
26162615 switch (completion_status) {
26172616
26182617 case SCI_IO_FAILURE_RESPONSE_VALID:
2619− dev_dbg(&isci_host->pdev->dev,
2618+ dev_dbg(&ihost->pdev->dev,
26202619 "%s: SCI_IO_FAILURE_RESPONSE_VALID (%p/%p)\n",
26212620 __func__,
26222621 request,
@@ -2631,17 +2630,17 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 8 unmodified lines
26312630 /* crack the iu response buffer. */
26322631 resp_iu = &request->ssp.rsp;
26332632 isci_request_process_response_iu(task, resp_iu,
2634− &isci_host->pdev->dev);
2633+ &ihost->pdev->dev);
26352634
26362635 } else if (SAS_PROTOCOL_SMP == task->task_proto) {
26372636
2638− dev_err(&isci_host->pdev->dev,
2637+ dev_err(&ihost->pdev->dev,
26392638 "%s: SCI_IO_FAILURE_RESPONSE_VALID: "
26402639 "SAS_PROTOCOL_SMP protocol\n",
26412640 __func__);
26422641
26432642 } else
2644− dev_err(&isci_host->pdev->dev,
2643+ dev_err(&ihost->pdev->dev,
26452644 "%s: unknown protocol\n", __func__);
26462645
26472646 /* use the task status set in the task struct by the
@@ -2662,7 +2661,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 14 unmodified lines
26622661 if (task->task_proto == SAS_PROTOCOL_SMP) {
26632662 void *rsp = &request->smp.rsp;
26642663
2665− dev_dbg(&isci_host->pdev->dev,
2664+ dev_dbg(&ihost->pdev->dev,
26662665 "%s: SMP protocol completion\n",
26672666 __func__);
26682667
@@ -2687,20 +2686,20 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 18 unmodified lines
26872686 if (task->task_status.residual != 0)
26882687 status = SAS_DATA_UNDERRUN;
26892688
2690− dev_dbg(&isci_host->pdev->dev,
2689+ dev_dbg(&ihost->pdev->dev,
26912690 "%s: SCI_IO_SUCCESS_IO_DONE_EARLY %d\n",
26922691 __func__,
26932692 status);
26942693
26952694 } else
2696− dev_dbg(&isci_host->pdev->dev,
2695+ dev_dbg(&ihost->pdev->dev,
26972696 "%s: SCI_IO_SUCCESS\n",
26982697 __func__);
26992698
27002699 break;
27012700
27022701 case SCI_IO_FAILURE_TERMINATED:
2703− dev_dbg(&isci_host->pdev->dev,
2702+ dev_dbg(&ihost->pdev->dev,
27042703 "%s: SCI_IO_FAILURE_TERMINATED (%p/%p)\n",
27052704 __func__,
27062705 request,
@@ -2768,7 +2767,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 61 unmodified lines
27682767
27692768 default:
27702769 /* Catch any otherwise unhandled error codes here. */
2771− dev_warn(&isci_host->pdev->dev,
2770+ dev_warn(&ihost->pdev->dev,
27722771 "%s: invalid completion code: 0x%x - "
27732772 "isci_request = %p\n",
27742773 __func__, completion_status, request);
@@ -2802,11 +2801,11 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 27 unmodified lines
28022801 break;
28032802 if (task->num_scatter == 0)
28042803 /* 0 indicates a single dma address */
2805− dma_unmap_single(&isci_host->pdev->dev,
2804+ dma_unmap_single(&ihost->pdev->dev,
28062805 request->zero_scatter_daddr,
28072806 task->total_xfer_len, task->data_dir);
28082807 else /* unmap the sgl dma addresses */
2809− dma_unmap_sg(&isci_host->pdev->dev, task->scatter,
2808+ dma_unmap_sg(&ihost->pdev->dev, task->scatter,
28102809 request->num_sg_entries, task->data_dir);
28112810 break;
28122811 case SAS_PROTOCOL_SMP: {
@@ -2814,7 +2813,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 1 unmodified line
28142813 struct smp_req *smp_req;
28152814 void *kaddr;
28162815
2817− dma_unmap_sg(&isci_host->pdev->dev, sg, 1, DMA_TO_DEVICE);
2816+ dma_unmap_sg(&ihost->pdev->dev, sg, 1, DMA_TO_DEVICE);
28182817
28192818 /* need to swab it back in case the command buffer is re-used */
28202819 kaddr = kmap_atomic(sg_page(sg), KM_IRQ0);
@@ -2828,14 +2827,12 @@ static void isci_request_io_request_complete(struct isci_host *isci_host, · 7 unmodified lines
28282827 }
28292828
28302829 /* Put the completed request on the correct list */
2831− isci_task_save_for_upper_layer_completion(isci_host, request, response,
2830+ isci_task_save_for_upper_layer_completion(ihost, request, response,
28322831 status, complete_to_host
28332832 );
28342833
28352834 /* complete the io request to the core. */
2836− scic_controller_complete_io(&isci_host->sci,
2837− request->target_device,
2838− request);
2835+ scic_controller_complete_io(ihost, request->target_device, request);
28392836 isci_put_device(idev);
28402837
28412838 /* set terminated handle so it cannot be completed or
@@ -2885,8 +2882,7 @@ static void scic_sds_request_started_state_enter(struct sci_base_state_machine * · 43 unmodified lines
28852882 static void scic_sds_request_completed_state_enter(struct sci_base_state_machine *sm)
28862883 {
28872884 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm);
2888− struct scic_sds_controller *scic = ireq->owning_controller;
2889− struct isci_host *ihost = scic_to_ihost(scic);
2885+ struct isci_host *ihost = ireq->owning_controller;
28902886
28912887 /* Tell the SCI_USER that the IO request is complete */
28922888 if (!test_bit(IREQ_TMF, &ireq->flags))
@@ -2985,7 +2981,7 @@ static const struct sci_base_state scic_sds_request_state_table[] = { · 92 unmodified lines
29852981 };
29862982
29872983 static void
2988−scic_sds_general_request_construct(struct scic_sds_controller *scic,
2984+scic_sds_general_request_construct(struct isci_host *ihost,
29892985 struct isci_remote_device *idev,
29902986 struct isci_request *ireq)
29912987 {
@@ -3001,7 +2997,7 @@ scic_sds_general_request_construct(struct scic_sds_controller *scic, · 9 unmodified lines
30012997 }
30022998
30032999 static enum sci_status
3004−scic_io_request_construct(struct scic_sds_controller *scic,
3000+scic_io_request_construct(struct isci_host *ihost,
30053001 struct isci_remote_device *idev,
30063002 struct isci_request *ireq)
30073003 {
@@ -3009,7 +3005,7 @@ scic_io_request_construct(struct scic_sds_controller *scic, · 1 unmodified line
30093005 enum sci_status status = SCI_SUCCESS;
30103006
30113007 /* Build the common part of the request */
3012− scic_sds_general_request_construct(scic, idev, ireq);
3008+ scic_sds_general_request_construct(ihost, idev, ireq);
30133009
30143010 if (idev->rnc.remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX)
30153011 return SCI_FAILURE_INVALID_REMOTE_DEVICE;
@@ -3028,7 +3024,7 @@ scic_io_request_construct(struct scic_sds_controller *scic, · 12 unmodified lines
30283024 return status;
30293025 }
30303026
3031−enum sci_status scic_task_request_construct(struct scic_sds_controller *scic,
3027+enum sci_status scic_task_request_construct(struct isci_host *ihost,
30323028 struct isci_remote_device *idev,
30333029 u16 io_tag, struct isci_request *ireq)
30343030 {
@@ -3036,7 +3032,7 @@ enum sci_status scic_task_request_construct(struct scic_sds_controller *scic, · 1 unmodified line
30363032 enum sci_status status = SCI_SUCCESS;
30373033
30383034 /* Build the common part of the request */
3039− scic_sds_general_request_construct(scic, idev, ireq);
3035+ scic_sds_general_request_construct(ihost, idev, ireq);
30403036
30413037 if (dev->dev_type == SAS_END_DEV ||
30423038 dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
@@ -3156,7 +3152,7 @@ scic_io_request_construct_smp(struct device *dev, · 113 unmodified lines
31563152 task_context->initiator_request = 1;
31573153 task_context->connection_rate = idev->connection_rate;
31583154 task_context->protocol_engine_index =
3159− scic_sds_controller_get_protocol_engine_group(scic);
3155+ scic_sds_controller_get_protocol_engine_group(ihost);
31603156 task_context->logical_port_index = scic_sds_port_get_index(iport);
31613157 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SMP;
31623158 task_context->abort = 0;
@@ -3199,7 +3195,7 @@ scic_io_request_construct_smp(struct device *dev, · 36 unmodified lines
31993195 task_context->task_phase = 0;
32003196
32013197 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
3202− (scic_sds_controller_get_protocol_engine_group(scic) <<
3198+ (scic_sds_controller_get_protocol_engine_group(ihost) <<
32033199 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
32043200 (scic_sds_port_get_index(iport) <<
32053201 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
@@ -3245,7 +3241,7 @@ static enum sci_status isci_smp_request_build(struct isci_request *ireq) · 39 unmodified lines
32453241
32463242 /**
32473243 * isci_io_request_build() - This function builds the io request object.
3248− * @isci_host: This parameter specifies the ISCI host object
3244+ * @ihost: This parameter specifies the ISCI host object
32493245 * @request: This parameter points to the isci_request object allocated in the
32503246 * request construct function.
32513247 * @sci_device: This parameter is the handle for the sci core's remote device
@@ -3253,14 +3249,14 @@ static enum sci_status isci_smp_request_build(struct isci_request *ireq) · 1 unmodified line
32533249 *
32543250 * SCI_SUCCESS on successfull completion, or specific failure code.
32553251 */
3256−static enum sci_status isci_io_request_build(struct isci_host *isci_host,
3252+static enum sci_status isci_io_request_build(struct isci_host *ihost,
32573253 struct isci_request *request,
32583254 struct isci_remote_device *idev)
32593255 {
32603256 enum sci_status status = SCI_SUCCESS;
32613257 struct sas_task *task = isci_request_access_task(request);
32623258
3263− dev_dbg(&isci_host->pdev->dev,
3259+ dev_dbg(&ihost->pdev->dev,
32643260 "%s: idev = 0x%p; request = %p, "
32653261 "num_scatter = %d\n",
32663262 __func__,
@@ -3277,7 +3273,7 @@ static enum sci_status isci_io_request_build(struct isci_host *isci_host, · 10 unmodified lines
32773273 !(SAS_PROTOCOL_SMP & task->task_proto)) {
32783274
32793275 request->num_sg_entries = dma_map_sg(
3280− &isci_host->pdev->dev,
3276+ &ihost->pdev->dev,
32813277 task->scatter,
32823278 task->num_scatter,
32833279 task->data_dir
@@ -3287,10 +3283,10 @@ static enum sci_status isci_io_request_build(struct isci_host *isci_host, · 3 unmodified lines
32873283 return SCI_FAILURE_INSUFFICIENT_RESOURCES;
32883284 }
32893285
3290− status = scic_io_request_construct(&isci_host->sci, idev, request);
3286+ status = scic_io_request_construct(ihost, idev, request);
32913287
32923288 if (status != SCI_SUCCESS) {
3293− dev_warn(&isci_host->pdev->dev,
3289+ dev_warn(&ihost->pdev->dev,
32943290 "%s: failed request construct\n",
32953291 __func__);
32963292 return SCI_FAILURE;
@@ -3309,7 +3305,7 @@ static enum sci_status isci_io_request_build(struct isci_host *isci_host, · 12 unmodified lines
33093305 status = isci_request_stp_request_construct(request);
33103306 break;
33113307 default:
3312− dev_warn(&isci_host->pdev->dev,
3308+ dev_warn(&ihost->pdev->dev,
33133309 "%s: unknown protocol\n", __func__);
33143310 return SCI_FAILURE;
33153311 }
@@ -3392,7 +3388,7 @@ int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *ide · 76 unmodified lines
33923388 * request was built that way (ie.
33933389 * ireq->is_task_management_request is false).
33943390 */
3395− status = scic_controller_start_task(&ihost->sci,
3391+ status = scic_controller_start_task(ihost,
33963392 idev,
33973393 ireq);
33983394 } else {
@@ -3400,7 +3396,7 @@ int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *ide · 1 unmodified line
34003396 }
34013397 } else {
34023398 /* send the request, let the core assign the IO TAG. */
3403− status = scic_controller_start_io(&ihost->sci, idev,
3399+ status = scic_controller_start_io(ihost, idev,
34043400 ireq);
34053401 }
34063402
drivers/scsi/isci/request.h+2−2
@@ -145,7 +145,7 @@ struct isci_request { · 144 unmodified lines
145145 */
146146 struct completion *io_request_completion;
147147 struct sci_base_state_machine sm;
148− struct scic_sds_controller *owning_controller;
148+ struct isci_host *owning_controller;
149149 struct isci_remote_device *target_device;
150150 u16 io_tag;
151151 enum sci_request_protocol protocol;
@@ -500,7 +500,7 @@ int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *ide · 348 unmodified lines
500500 void isci_terminate_pending_requests(struct isci_host *ihost,
501501 struct isci_remote_device *idev);
502502 enum sci_status
503−scic_task_request_construct(struct scic_sds_controller *scic,
503+scic_task_request_construct(struct isci_host *ihost,
504504 struct isci_remote_device *idev,
505505 u16 io_tag,
506506 struct isci_request *ireq);
drivers/scsi/isci/task.c+21−23
@@ -257,7 +257,7 @@ static struct isci_request *isci_task_request_build(struct isci_host *ihost, · 256 unmodified lines
257257 return NULL;
258258
259259 /* let the core do it's construct. */
260− status = scic_task_request_construct(&ihost->sci, idev, tag,
260+ status = scic_task_request_construct(ihost, idev, tag,
261261 ireq);
262262
263263 if (status != SCI_SUCCESS) {
@@ -332,7 +332,7 @@ int isci_task_execute_tmf(struct isci_host *ihost, · 68 unmodified lines
332332 spin_lock_irqsave(&ihost->scic_lock, flags);
333333
334334 /* start the TMF io. */
335− status = scic_controller_start_task(&ihost->sci, idev, ireq);
335+ status = scic_controller_start_task(ihost, idev, ireq);
336336
337337 if (status != SCI_TASK_SUCCESS) {
338338 dev_warn(&ihost->pdev->dev,
@@ -364,7 +364,7 @@ int isci_task_execute_tmf(struct isci_host *ihost, · 25 unmodified lines
364364 if (tmf->cb_state_func != NULL)
365365 tmf->cb_state_func(isci_tmf_timed_out, tmf, tmf->cb_data);
366366
367− scic_controller_terminate_request(&ihost->sci,
367+ scic_controller_terminate_request(ihost,
368368 idev,
369369 ireq);
370370
@@ -514,15 +514,14 @@ static void isci_request_cleanup_completed_loiterer( · 143 unmodified lines
514514 * request, and wait for it to complete. This function must only be called
515515 * from a thread that can wait. Note that the request is terminated and
516516 * completed (back to the host, if started there).
517− * @isci_host: This SCU.
517+ * @ihost: This SCU.
518518 * @idev: The target.
519519 * @isci_request: The I/O request to be terminated.
520520 *
521521 */
522−static void isci_terminate_request_core(
523− struct isci_host *isci_host,
524− struct isci_remote_device *idev,
525− struct isci_request *isci_request)
522+static void isci_terminate_request_core(struct isci_host *ihost,
523+ struct isci_remote_device *idev,
524+ struct isci_request *isci_request)
526525 {
527526 enum sci_status status = SCI_SUCCESS;
528527 bool was_terminated = false;
@@ -533,11 +532,11 @@ static void isci_terminate_request_core( · 4 unmodified lines
533532 struct completion *io_request_completion;
534533 struct sas_task *task;
535534
536− dev_dbg(&isci_host->pdev->dev,
535+ dev_dbg(&ihost->pdev->dev,
537536 "%s: device = %p; request = %p\n",
538537 __func__, idev, isci_request);
539538
540− spin_lock_irqsave(&isci_host->scic_lock, flags);
539+ spin_lock_irqsave(&ihost->scic_lock, flags);
541540
542541 io_request_completion = isci_request->io_request_completion;
543542
@@ -557,12 +556,11 @@ static void isci_terminate_request_core( · 13 unmodified lines
557556 if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) {
558557 was_terminated = true;
559558 needs_cleanup_handling = true;
560− status = scic_controller_terminate_request(
561− &isci_host->sci,
562− idev,
563− isci_request);
559+ status = scic_controller_terminate_request(ihost,
560+ idev,
561+ isci_request);
564562 }
565− spin_unlock_irqrestore(&isci_host->scic_lock, flags);
563+ spin_unlock_irqrestore(&ihost->scic_lock, flags);
566564
567565 /*
568566 * The only time the request to terminate will
@@ -570,7 +568,7 @@ static void isci_terminate_request_core( · 1 unmodified line
570568 * being aborted.
571569 */
572570 if (status != SCI_SUCCESS) {
573− dev_err(&isci_host->pdev->dev,
571+ dev_err(&ihost->pdev->dev,
574572 "%s: scic_controller_terminate_request"
575573 " returned = 0x%x\n",
576574 __func__, status);
@@ -579,7 +577,7 @@ static void isci_terminate_request_core( · 2 unmodified lines
579577
580578 } else {
581579 if (was_terminated) {
582− dev_dbg(&isci_host->pdev->dev,
580+ dev_dbg(&ihost->pdev->dev,
583581 "%s: before completion wait (%p/%p)\n",
584582 __func__, isci_request, io_request_completion);
585583
@@ -593,7 +591,7 @@ static void isci_terminate_request_core( · 7 unmodified lines
593591 if (!termination_completed) {
594592
595593 /* The request to terminate has timed out. */
596− spin_lock_irqsave(&isci_host->scic_lock,
594+ spin_lock_irqsave(&ihost->scic_lock,
597595 flags);
598596
599597 /* Check for state changes. */
@@ -623,12 +621,12 @@ static void isci_terminate_request_core( · 23 unmodified lines
623621 } else
624622 termination_completed = 1;
625623
626− spin_unlock_irqrestore(&isci_host->scic_lock,
624+ spin_unlock_irqrestore(&ihost->scic_lock,
627625 flags);
628626
629627 if (!termination_completed) {
630628
631− dev_err(&isci_host->pdev->dev,
629+ dev_err(&ihost->pdev->dev,
632630 "%s: *** Timeout waiting for "
633631 "termination(%p/%p)\n",
634632 __func__, io_request_completion,
@@ -642,7 +640,7 @@ static void isci_terminate_request_core( · 7 unmodified lines
642640 }
643641 }
644642 if (termination_completed)
645− dev_dbg(&isci_host->pdev->dev,
643+ dev_dbg(&ihost->pdev->dev,
646644 "%s: after completion wait (%p/%p)\n",
647645 __func__, isci_request, io_request_completion);
648646 }
@@ -678,7 +676,7 @@ static void isci_terminate_request_core( · 29 unmodified lines
678676 }
679677 if (needs_cleanup_handling)
680678 isci_request_cleanup_completed_loiterer(
681− isci_host, idev, isci_request, task);
679+ ihost, idev, isci_request, task);
682680 }
683681 }
684682
@@ -1253,7 +1251,7 @@ isci_task_request_complete(struct isci_host *ihost, · 568 unmodified lines
12531251 /* PRINT_TMF( ((struct isci_tmf *)request->task)); */
12541252 tmf_complete = tmf->complete;
12551253
1256− scic_controller_complete_io(&ihost->sci, ireq->target_device, ireq);
1254+ scic_controller_complete_io(ihost, ireq->target_device, ireq);
12571255 /* set the 'terminated' flag handle to make sure it cannot be terminated
12581256 * or completed again.
12591257 */
drivers/scsi/isci/unsolicited_frame_control.c+3−3
@@ -57,9 +57,9 @@ · 56 unmodified lines
5757 #include "unsolicited_frame_control.h"
5858 #include "registers.h"
5959
60−int scic_sds_unsolicited_frame_control_construct(struct scic_sds_controller *scic)
60+int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost)
6161 {
62− struct scic_sds_unsolicited_frame_control *uf_control = &scic->uf_control;
62+ struct scic_sds_unsolicited_frame_control *uf_control = &ihost->uf_control;
6363 struct scic_sds_unsolicited_frame *uf;
6464 u32 buf_len, header_len, i;
6565 dma_addr_t dma;
@@ -79,7 +79,7 @@ int scic_sds_unsolicited_frame_control_construct(struct scic_sds_controller *sci · 13 unmodified lines
7979 * memory descriptor entry. The headers and address table will be
8080 * placed after the buffers.
8181 */
82− virt = dmam_alloc_coherent(scic_to_dev(scic), size, &dma, GFP_KERNEL);
82+ virt = dmam_alloc_coherent(&ihost->pdev->dev, size, &dma, GFP_KERNEL);
8383 if (!virt)
8484 return -ENOMEM;
8585
drivers/scsi/isci/unsolicited_frame_control.h+2−2
@@ -214,9 +214,9 @@ struct scic_sds_unsolicited_frame_control { · 213 unmodified lines
214214
215215 };
216216
217−struct scic_sds_controller;
217+struct isci_host;
218218
219−int scic_sds_unsolicited_frame_control_construct(struct scic_sds_controller *scic);
219+int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost);
220220
221221 enum sci_status scic_sds_unsolicited_frame_control_get_header(
222222 struct scic_sds_unsolicited_frame_control *uf_control,