• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/scsi/

Lines Matching refs:scp

329 	struct scsi_cmnd *scp;
340 scp = hba->reqs[tag].scp;
342 if (HPT_SCP(scp)->mapped) {
343 if (scp->use_sg)
345 (struct scatterlist *)scp->request_buffer,
346 scp->use_sg,
347 scp->sc_data_direction
351 HPT_SCP(scp)->dma_handle,
352 scp->request_bufflen,
353 scp->sc_data_direction
359 scp->result = (DID_OK<<16);
362 scp->result = (DID_BAD_TARGET<<16);
365 scp->result = (DID_BUS_BUSY<<16);
368 scp->result = (DID_RESET<<16);
371 scp->result = (DID_ERROR<<16);
374 scp->result = (DID_ABORT<<16);
377 scp->result = SAM_STAT_CHECK_CONDITION;
378 memset(&scp->sense_buffer,
379 0, sizeof(scp->sense_buffer));
380 memcpy(&scp->sense_buffer,
385 scp->result = ((DRIVER_INVALID|SUGGEST_ABORT)<<24) |
390 dprintk("scsi_done(%p)\n", scp);
391 scp->scsi_done(scp);
447 static int hptiop_buildsgl(struct scsi_cmnd *scp, struct hpt_iopsg *psg)
449 struct Scsi_Host *host = scp->device->host;
451 struct scatterlist *sglist = (struct scatterlist *)scp->request_buffer;
457 if (scp->use_sg) {
460 HPT_SCP(scp)->sgcnt = pci_map_sg(hba->pcidev,
461 sglist, scp->use_sg,
462 scp->sc_data_direction);
463 HPT_SCP(scp)->mapped = 1;
464 BUG_ON(HPT_SCP(scp)->sgcnt > hba->max_sg_descriptors);
466 for (idx = 0; idx < HPT_SCP(scp)->sgcnt; idx++) {
470 psg[idx].eot = (idx == HPT_SCP(scp)->sgcnt - 1) ?
474 return HPT_SCP(scp)->sgcnt;
476 HPT_SCP(scp)->dma_handle = pci_map_single(
478 scp->request_buffer,
479 scp->request_bufflen,
480 scp->sc_data_direction
482 HPT_SCP(scp)->mapped = 1;
483 psg->pci_address = cpu_to_le64(HPT_SCP(scp)->dma_handle);
484 psg->size = cpu_to_le32(scp->request_bufflen);
490 static int hptiop_queuecommand(struct scsi_cmnd *scp,
493 struct Scsi_Host *host = scp->device->host;
500 scp->scsi_done = done;
508 _req->scp = scp;
510 dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%d cdb=(%x-%x-%x) "
512 scp,
513 host->host_no, scp->device->channel,
514 scp->device->id, scp->device->lun,
515 *((u32 *)&scp->cmnd),
516 *((u32 *)&scp->cmnd + 1),
517 *((u32 *)&scp->cmnd + 2),
520 scp->result = 0;
522 if (scp->device->channel || scp->device->lun ||
523 scp->device->id > hba->max_devices) {
524 scp->result = DID_BAD_TARGET << 16;
532 if (scp->request_bufflen)
533 sg_count = hptiop_buildsgl(scp, req->sg_list);
535 HPT_SCP(scp)->mapped = 0;
543 req->dataxfer_length = cpu_to_le32(scp->request_bufflen);
544 req->channel = scp->device->channel;
545 req->target = scp->device->id;
546 req->lun = scp->device->lun;
552 memcpy(req->cdb, scp->cmnd, sizeof(req->cdb));
560 dprintk("scsi_done(scp=%p)\n", scp);
561 scp->scsi_done(scp);
597 static int hptiop_reset(struct scsi_cmnd *scp)
599 struct Scsi_Host * host = scp->device->host;
602 printk(KERN_WARNING "hptiop_reset(%d/%d/%d) scp=%p\n",
603 scp->device->host->host_no, scp->device->channel,
604 scp->device->id, scp);