Lines Matching refs:cp

990 	struct io_accel1_cmd *cp = &h->ioaccel_cmd_pool[c->cmdindex];  in set_ioaccel1_performant_mode()  local
997 cp->ReplyQueue = smp_processor_id() % h->nreply_queues; in set_ioaccel1_performant_mode()
999 cp->ReplyQueue = reply_queue % h->nreply_queues; in set_ioaccel1_performant_mode()
1014 struct hpsa_tmf_struct *cp = (struct hpsa_tmf_struct *) in set_ioaccel2_tmf_performant_mode() local
1021 cp->reply_queue = smp_processor_id() % h->nreply_queues; in set_ioaccel2_tmf_performant_mode()
1023 cp->reply_queue = reply_queue % h->nreply_queues; in set_ioaccel2_tmf_performant_mode()
1036 struct io_accel2_cmd *cp = &h->ioaccel2_cmd_pool[c->cmdindex]; in set_ioaccel2_performant_mode() local
1043 cp->reply_queue = smp_processor_id() % h->nreply_queues; in set_ioaccel2_performant_mode()
1045 cp->reply_queue = reply_queue % h->nreply_queues; in set_ioaccel2_performant_mode()
1052 c->busaddr |= (h->ioaccel2_blockFetchTable[cp->sg_count]); in set_ioaccel2_performant_mode()
2069 struct io_accel2_cmd *cp, struct CommandList *c) in hpsa_map_ioaccel2_sg_chain_block() argument
2076 chain_size = le32_to_cpu(cp->sg[0].length); in hpsa_map_ioaccel2_sg_chain_block()
2081 cp->sg->address = 0; in hpsa_map_ioaccel2_sg_chain_block()
2084 cp->sg->address = cpu_to_le64(temp64); in hpsa_map_ioaccel2_sg_chain_block()
2089 struct io_accel2_cmd *cp) in hpsa_unmap_ioaccel2_sg_chain_block() argument
2095 chain_sg = cp->sg; in hpsa_unmap_ioaccel2_sg_chain_block()
2097 chain_size = le32_to_cpu(cp->sg[0].length); in hpsa_unmap_ioaccel2_sg_chain_block()
2349 struct CommandList *cp) in hpsa_evaluate_tmf_status() argument
2351 u8 tmf_status = cp->err_info->ScsiStatus; in hpsa_evaluate_tmf_status()
2375 static void complete_scsi_command(struct CommandList *cp) in complete_scsi_command() argument
2388 ei = cp->err_info; in complete_scsi_command()
2389 cmd = cp->scsi_cmd; in complete_scsi_command()
2390 h = cp->h; in complete_scsi_command()
2392 c2 = &h->ioaccel2_cmd_pool[cp->cmdindex]; in complete_scsi_command()
2395 if ((cp->cmd_type == CMD_SCSI) && in complete_scsi_command()
2396 (le16_to_cpu(cp->Header.SGTotal) > h->max_cmd_sg_entries)) in complete_scsi_command()
2397 hpsa_unmap_sg_chain_block(h, cp); in complete_scsi_command()
2399 if ((cp->cmd_type == CMD_IOACCEL2) && in complete_scsi_command()
2406 if (cp->cmd_type == CMD_IOACCEL2 || cp->cmd_type == CMD_IOACCEL1) in complete_scsi_command()
2407 atomic_dec(&cp->phys_disk->ioaccel_cmds_out); in complete_scsi_command()
2417 return hpsa_cmd_free_and_done(h, cp, cmd); in complete_scsi_command()
2420 if ((unlikely(hpsa_is_pending_event(cp)))) { in complete_scsi_command()
2421 if (cp->reset_pending) in complete_scsi_command()
2422 return hpsa_cmd_resolve_and_free(h, cp); in complete_scsi_command()
2423 if (cp->abort_pending) in complete_scsi_command()
2424 return hpsa_cmd_abort_and_free(h, cp, cmd); in complete_scsi_command()
2427 if (cp->cmd_type == CMD_IOACCEL2) in complete_scsi_command()
2428 return process_ioaccel2_completion(h, cp, cmd, dev); in complete_scsi_command()
2432 return hpsa_cmd_free_and_done(h, cp, cmd); in complete_scsi_command()
2437 if (cp->cmd_type == CMD_IOACCEL1) { in complete_scsi_command()
2438 struct io_accel1_cmd *c = &h->ioaccel_cmd_pool[cp->cmdindex]; in complete_scsi_command()
2439 cp->Header.SGList = scsi_sg_count(cmd); in complete_scsi_command()
2440 cp->Header.SGTotal = cpu_to_le16(cp->Header.SGList); in complete_scsi_command()
2441 cp->Request.CDBLen = le16_to_cpu(c->io_flags) & in complete_scsi_command()
2443 cp->Header.tag = c->tag; in complete_scsi_command()
2444 memcpy(cp->Header.LUN.LunAddrBytes, c->CISS_LUN, 8); in complete_scsi_command()
2445 memcpy(cp->Request.CDB, c->CDB, cp->Request.CDBLen); in complete_scsi_command()
2454 return hpsa_retry_cmd(h, cp); in complete_scsi_command()
2488 cp, ei->ScsiStatus, in complete_scsi_command()
2493 "Returning no connection.\n", cp), in complete_scsi_command()
2515 "CDB %16phN data overrun\n", cp->Request.CDB); in complete_scsi_command()
2532 cp->Request.CDB); in complete_scsi_command()
2537 cp->Request.CDB); in complete_scsi_command()
2542 cp->Request.CDB); in complete_scsi_command()
2546 return hpsa_cmd_abort_and_free(h, cp, cmd); in complete_scsi_command()
2550 cp->Request.CDB); in complete_scsi_command()
2555 cp->Request.CDB); in complete_scsi_command()
2560 cp->Request.CDB); in complete_scsi_command()
2567 if (hpsa_evaluate_tmf_status(h, cp)) /* TMF failed? */ in complete_scsi_command()
2576 "cp %p had HP SSD Smart Path error\n", cp); in complete_scsi_command()
2581 cp, ei->CommandStatus); in complete_scsi_command()
2584 return hpsa_cmd_free_and_done(h, cp, cmd); in complete_scsi_command()
2599 struct CommandList *cp, in hpsa_map_one() argument
2607 cp->Header.SGList = 0; in hpsa_map_one()
2608 cp->Header.SGTotal = cpu_to_le16(0); in hpsa_map_one()
2615 cp->Header.SGList = 0; in hpsa_map_one()
2616 cp->Header.SGTotal = cpu_to_le16(0); in hpsa_map_one()
2619 cp->SG[0].Addr = cpu_to_le64(addr64); in hpsa_map_one()
2620 cp->SG[0].Len = cpu_to_le32(buflen); in hpsa_map_one()
2621 cp->SG[0].Ext = cpu_to_le32(HPSA_SG_LAST); /* we are not chaining */ in hpsa_map_one()
2622 cp->Header.SGList = 1; /* no. SGs contig in this cmd */ in hpsa_map_one()
2623 cp->Header.SGTotal = cpu_to_le16(1); /* total sgs in cmd list */ in hpsa_map_one()
2716 struct CommandList *cp) in hpsa_scsi_interpret_error() argument
2718 const struct ErrorInfo *ei = cp->err_info; in hpsa_scsi_interpret_error()
2719 struct device *d = &cp->h->pdev->dev; in hpsa_scsi_interpret_error()
2731 hpsa_print_cmd(h, "SCSI status", cp); in hpsa_scsi_interpret_error()
2746 hpsa_print_cmd(h, "overrun condition", cp); in hpsa_scsi_interpret_error()
2752 hpsa_print_cmd(h, "invalid command", cp); in hpsa_scsi_interpret_error()
2757 hpsa_print_cmd(h, "protocol error", cp); in hpsa_scsi_interpret_error()
2760 hpsa_print_cmd(h, "hardware error", cp); in hpsa_scsi_interpret_error()
2763 hpsa_print_cmd(h, "connection lost", cp); in hpsa_scsi_interpret_error()
2766 hpsa_print_cmd(h, "aborted", cp); in hpsa_scsi_interpret_error()
2769 hpsa_print_cmd(h, "abort failed", cp); in hpsa_scsi_interpret_error()
2772 hpsa_print_cmd(h, "unsolicited abort", cp); in hpsa_scsi_interpret_error()
2775 hpsa_print_cmd(h, "timed out", cp); in hpsa_scsi_interpret_error()
2778 hpsa_print_cmd(h, "unabortable", cp); in hpsa_scsi_interpret_error()
2781 hpsa_print_cmd(h, "controller lockup detected", cp); in hpsa_scsi_interpret_error()
2784 hpsa_print_cmd(h, "unknown status", cp); in hpsa_scsi_interpret_error()
4179 struct CommandList *cp, in hpsa_scatter_gather() argument
4202 curr_sg = cp->SG; in hpsa_scatter_gather()
4218 curr_sg = h->cmd_sg_list[cp->cmdindex]; in hpsa_scatter_gather()
4233 cp->Header.SGList = h->max_cmd_sg_entries; in hpsa_scatter_gather()
4234 cp->Header.SGTotal = cpu_to_le16(use_sg + 1); in hpsa_scatter_gather()
4235 if (hpsa_map_sg_chain_block(h, cp)) { in hpsa_scatter_gather()
4244 cp->Header.SGList = (u8) use_sg; /* no. SGs contig in this cmd */ in hpsa_scatter_gather()
4245 cp->Header.SGTotal = cpu_to_le16(use_sg); /* total sgs in cmd list */ in hpsa_scatter_gather()
4297 struct io_accel1_cmd *cp = &h->ioaccel_cmd_pool[c->cmdindex]; in hpsa_scsi_ioaccel1_queue_command() local
4323 (c->cmdindex * sizeof(*cp)); in hpsa_scsi_ioaccel1_queue_command()
4333 curr_sg = cp->SG; in hpsa_scsi_ioaccel1_queue_command()
4367 cp->dev_handle = cpu_to_le16(ioaccel_handle & 0xFFFF); in hpsa_scsi_ioaccel1_queue_command()
4368 cp->transfer_len = cpu_to_le32(total_len); in hpsa_scsi_ioaccel1_queue_command()
4369 cp->io_flags = cpu_to_le16(IOACCEL1_IOFLAGS_IO_REQ | in hpsa_scsi_ioaccel1_queue_command()
4371 cp->control = cpu_to_le32(control); in hpsa_scsi_ioaccel1_queue_command()
4372 memcpy(cp->CDB, cdb, cdb_len); in hpsa_scsi_ioaccel1_queue_command()
4373 memcpy(cp->CISS_LUN, scsi3addr, 8); in hpsa_scsi_ioaccel1_queue_command()
4399 struct CommandList *c, struct io_accel2_cmd *cp) in set_encrypt_ioaccel2() argument
4410 cp->dekindex = map->dekindex; in set_encrypt_ioaccel2()
4413 cp->direction |= IOACCEL2_DIRECTION_ENCRYPT_MASK; in set_encrypt_ioaccel2()
4448 cp->tweak_lower = cpu_to_le32(first_block); in set_encrypt_ioaccel2()
4449 cp->tweak_upper = cpu_to_le32(first_block >> 32); in set_encrypt_ioaccel2()
4457 struct io_accel2_cmd *cp = &h->ioaccel2_cmd_pool[c->cmdindex]; in hpsa_scsi_ioaccel2_queue_command() local
4475 (c->cmdindex * sizeof(*cp)); in hpsa_scsi_ioaccel2_queue_command()
4478 memset(cp, 0, sizeof(*cp)); in hpsa_scsi_ioaccel2_queue_command()
4479 cp->IU_type = IOACCEL2_IU_TYPE; in hpsa_scsi_ioaccel2_queue_command()
4488 curr_sg = cp->sg; in hpsa_scsi_ioaccel2_queue_command()
4516 cp->direction &= ~IOACCEL2_DIRECTION_MASK; in hpsa_scsi_ioaccel2_queue_command()
4517 cp->direction |= IOACCEL2_DIR_DATA_OUT; in hpsa_scsi_ioaccel2_queue_command()
4520 cp->direction &= ~IOACCEL2_DIRECTION_MASK; in hpsa_scsi_ioaccel2_queue_command()
4521 cp->direction |= IOACCEL2_DIR_DATA_IN; in hpsa_scsi_ioaccel2_queue_command()
4524 cp->direction &= ~IOACCEL2_DIRECTION_MASK; in hpsa_scsi_ioaccel2_queue_command()
4525 cp->direction |= IOACCEL2_DIR_NO_DATA; in hpsa_scsi_ioaccel2_queue_command()
4534 cp->direction &= ~IOACCEL2_DIRECTION_MASK; in hpsa_scsi_ioaccel2_queue_command()
4535 cp->direction |= IOACCEL2_DIR_NO_DATA; in hpsa_scsi_ioaccel2_queue_command()
4539 set_encrypt_ioaccel2(h, c, cp); in hpsa_scsi_ioaccel2_queue_command()
4541 cp->scsi_nexus = cpu_to_le32(ioaccel_handle); in hpsa_scsi_ioaccel2_queue_command()
4542 cp->Tag = cpu_to_le32(c->cmdindex << DIRECT_LOOKUP_SHIFT); in hpsa_scsi_ioaccel2_queue_command()
4543 memcpy(cp->cdb, cdb, sizeof(cp->cdb)); in hpsa_scsi_ioaccel2_queue_command()
4545 cp->data_len = cpu_to_le32(total_len); in hpsa_scsi_ioaccel2_queue_command()
4546 cp->err_ptr = cpu_to_le64(c->busaddr + in hpsa_scsi_ioaccel2_queue_command()
4548 cp->err_len = cpu_to_le32(sizeof(cp->error_data)); in hpsa_scsi_ioaccel2_queue_command()
4552 cp->sg_count = 1; in hpsa_scsi_ioaccel2_queue_command()
4553 cp->sg[0].length = cpu_to_le32(use_sg * sizeof(cp->sg[0])); in hpsa_scsi_ioaccel2_queue_command()
4554 if (hpsa_map_ioaccel2_sg_chain_block(h, cp, c)) { in hpsa_scsi_ioaccel2_queue_command()
4560 cp->sg_count = (u8) use_sg; in hpsa_scsi_ioaccel2_queue_command()
6062 u32 cp; in hpsa_ioctl32_passthru() local
6073 err |= get_user(cp, &arg32->buf); in hpsa_ioctl32_passthru()
6074 arg64.buf = compat_ptr(cp); in hpsa_ioctl32_passthru()
6099 u32 cp; in hpsa_ioctl32_big_passthru() local
6111 err |= get_user(cp, &arg32->buf); in hpsa_ioctl32_big_passthru()
6112 arg64.buf = compat_ptr(cp); in hpsa_ioctl32_big_passthru()
8960 struct io_accel1_cmd *cp = &h->ioaccel_cmd_pool[i]; in hpsa_enter_performant_mode() local
8962 cp->function = IOACCEL1_FUNCTION_SCSIIO; in hpsa_enter_performant_mode()
8963 cp->err_info = (u32) (h->errinfo_pool_dhandle + in hpsa_enter_performant_mode()
8965 cp->err_info_len = sizeof(struct ErrorInfo); in hpsa_enter_performant_mode()
8966 cp->sgl_offset = IOACCEL1_SGLOFFSET; in hpsa_enter_performant_mode()
8967 cp->host_context_flags = in hpsa_enter_performant_mode()
8969 cp->timeout_sec = 0; in hpsa_enter_performant_mode()
8970 cp->ReplyQueue = 0; in hpsa_enter_performant_mode()
8971 cp->tag = in hpsa_enter_performant_mode()
8973 cp->host_addr = in hpsa_enter_performant_mode()