• Home
  • Raw
  • Download

Lines Matching refs:request_id

269 static int twl_post_command_packet(TW_Device_Extension *tw_dev, int request_id)  in twl_post_command_packet()  argument
273 command_que_value = tw_dev->command_packet_phys[request_id]; in twl_post_command_packet()
281 tw_dev->state[request_id] = TW_S_POSTED; in twl_post_command_packet()
290 static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, in twl_scsiop_execute_scsi() argument
301 if (tw_dev->srb[request_id]) in twl_scsiop_execute_scsi()
302 srb = tw_dev->srb[request_id]; in twl_scsiop_execute_scsi()
305 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_scsiop_execute_scsi()
323 cpu_to_le16(TW_REQ_LUN_IN(srb->device->lun, request_id)); in twl_scsiop_execute_scsi()
326 cpu_to_le16(TW_REQ_LUN_IN(0, request_id)); in twl_scsiop_execute_scsi()
343 …lunh = cpu_to_le16(TW_REQ_LUN_IN((srb->device->lun >> 4), scsi_sg_count(tw_dev->srb[request_id]))); in twl_scsiop_execute_scsi()
365 retval = twl_post_command_packet(tw_dev, request_id); in twl_scsiop_execute_scsi()
372 static int twl_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) in twl_aen_read_queue() argument
379 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_aen_read_queue()
390 sglist[0].address = tw_dev->generic_buffer_phys[request_id]; in twl_aen_read_queue()
393 tw_dev->srb[request_id] = NULL; in twl_aen_read_queue()
396 if (twl_scsiop_execute_scsi(tw_dev, request_id, cdb, 1, sglist)) { in twl_aen_read_queue()
406 static void twl_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) in twl_aen_sync_time() argument
415 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_aen_sync_time()
419 command_packet->request_id = request_id; in twl_aen_sync_time()
420 …packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]); in twl_aen_sync_time()
426 param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id]; in twl_aen_sync_time()
441 tw_dev->srb[request_id] = NULL; in twl_aen_sync_time()
444 twl_post_command_packet(tw_dev, request_id); in twl_aen_sync_time()
448 static void twl_get_request_id(TW_Device_Extension *tw_dev, int *request_id) in twl_get_request_id() argument
450 *request_id = tw_dev->free_queue[tw_dev->free_head]; in twl_get_request_id()
452 tw_dev->state[*request_id] = TW_S_STARTED; in twl_get_request_id()
456 static void twl_free_request_id(TW_Device_Extension *tw_dev, int request_id) in twl_free_request_id() argument
458 tw_dev->free_queue[tw_dev->free_tail] = request_id; in twl_free_request_id()
459 tw_dev->state[request_id] = TW_S_FINISHED; in twl_free_request_id()
464 static int twl_aen_complete(TW_Device_Extension *tw_dev, int request_id) in twl_aen_complete() argument
472 header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id]; in twl_aen_complete()
475 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_aen_complete()
481 if (twl_aen_read_queue(tw_dev, request_id)) in twl_aen_complete()
494 twl_aen_sync_time(tw_dev, request_id); in twl_aen_complete()
501 if (twl_aen_read_queue(tw_dev, request_id)) in twl_aen_complete()
510 tw_dev->state[request_id] = TW_S_COMPLETED; in twl_aen_complete()
511 twl_free_request_id(tw_dev, request_id); in twl_aen_complete()
518 static int twl_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds) in twl_poll_response() argument
539 if (TW_RESID_OUT(response) == request_id) in twl_poll_response()
555 int request_id = 0; in twl_aen_drain_queue() local
569 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_aen_drain_queue()
580 sglist[0].address = tw_dev->generic_buffer_phys[request_id]; in twl_aen_drain_queue()
583 tw_dev->srb[request_id] = NULL; in twl_aen_drain_queue()
587 if (twl_scsiop_execute_scsi(tw_dev, request_id, cdb, 1, sglist)) { in twl_aen_drain_queue()
593 if (twl_poll_response(tw_dev, request_id, 30)) { in twl_aen_drain_queue()
600 header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id]; in twl_aen_drain_queue()
634 tw_dev->state[request_id] = TW_S_INITIAL; in twl_aen_drain_queue()
676 …TW_Device_Extension *tw_dev, TW_Command_Full *full_command_packet, int request_id, dma_addr_t dma_… in twl_load_sgl() argument
689 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id)); in twl_load_sgl()
698 oldcommand->request_id = request_id; in twl_load_sgl()
718 int request_id = 0; in twl_chrdev_ioctl() local
765 twl_get_request_id(tw_dev, &request_id); in twl_chrdev_ioctl()
768 tw_dev->srb[request_id] = NULL; in twl_chrdev_ioctl()
771 tw_dev->chrdev_request_id = request_id; in twl_chrdev_ioctl()
776 twl_load_sgl(tw_dev, full_command_packet, request_id, dma_handle, data_buffer_length_adjusted); in twl_chrdev_ioctl()
778 …memcpy(tw_dev->command_packet_virt[request_id], &(tw_ioctl->firmware_command), sizeof(TW_Command_F… in twl_chrdev_ioctl()
781 twl_post_command_packet(tw_dev, request_id); in twl_chrdev_ioctl()
801 …memcpy(&(tw_ioctl->firmware_command), tw_dev->command_packet_virt[request_id], sizeof(TW_Command_F… in twl_chrdev_ioctl()
806 tw_dev->state[request_id] = TW_S_COMPLETED; in twl_chrdev_ioctl()
807 twl_free_request_id(tw_dev, request_id); in twl_chrdev_ioctl()
857 static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, int copy_sense, int p… in twl_fill_sense() argument
865 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_fill_sense()
889 memcpy(tw_dev->srb[request_id]->sense_buffer, header->sense_data, TW_SENSE_DATA_LENGTH); in twl_fill_sense()
890 tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1); in twl_fill_sense()
923 static void *twl_get_param(TW_Device_Extension *tw_dev, int request_id, int table_id, int parameter… in twl_get_param() argument
931 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_get_param()
937 command_packet->request_id = request_id; in twl_get_param()
941 param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id]; in twl_get_param()
947 …packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]); in twl_get_param()
951 twl_post_command_packet(tw_dev, request_id); in twl_get_param()
954 if (twl_poll_response(tw_dev, request_id, 30)) in twl_get_param()
960 tw_dev->state[request_id] = TW_S_INITIAL; in twl_get_param()
979 int request_id = 0, retval = 1; in twl_initconnection() local
982 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_initconnection()
988 tw_initconnect->request_id = request_id; in twl_initconnection()
1007 twl_post_command_packet(tw_dev, request_id); in twl_initconnection()
1010 if (twl_poll_response(tw_dev, request_id, 30)) { in twl_initconnection()
1024 tw_dev->state[request_id] = TW_S_INITIAL; in twl_initconnection()
1082 u32 request_id, doorbell; in twl_handle_attention_interrupt() local
1096 twl_get_request_id(tw_dev, &request_id); in twl_handle_attention_interrupt()
1097 if (twl_aen_read_queue(tw_dev, request_id)) { in twl_handle_attention_interrupt()
1098 tw_dev->state[request_id] = TW_S_COMPLETED; in twl_handle_attention_interrupt()
1099 twl_free_request_id(tw_dev, request_id); in twl_handle_attention_interrupt()
1122 u32 reg, regl, regh, response, request_id = 0; in twl_interrupt() local
1165 request_id = le16_to_cpu(tw_dev->sense_buffer_virt[i]->header_desc.request_id); in twl_interrupt()
1166 if (tw_dev->srb[request_id] != NULL) in twl_interrupt()
1167 error = twl_fill_sense(tw_dev, i, request_id, 1, 1); in twl_interrupt()
1170 if (request_id != tw_dev->chrdev_request_id) in twl_interrupt()
1171 error = twl_fill_sense(tw_dev, i, request_id, 0, 1); in twl_interrupt()
1173 …memcpy(tw_dev->command_packet_virt[request_id], tw_dev->sense_buffer_virt[i], sizeof(TW_Command_Ap… in twl_interrupt()
1183 request_id = TW_RESID_OUT(response); in twl_interrupt()
1185 full_command_packet = tw_dev->command_packet_virt[request_id]; in twl_interrupt()
1188 if (tw_dev->state[request_id] != TW_S_POSTED) { in twl_interrupt()
1189 if (tw_dev->srb[request_id] != NULL) { in twl_interrupt()
1197 if (tw_dev->srb[request_id] == NULL) { in twl_interrupt()
1198 if (request_id != tw_dev->chrdev_request_id) { in twl_interrupt()
1199 if (twl_aen_complete(tw_dev, request_id)) in twl_interrupt()
1206 cmd = tw_dev->srb[request_id]; in twl_interrupt()
1213 …(full_command_packet->command.newcommand.sg_list[0].length < scsi_bufflen(tw_dev->srb[request_id])) in twl_interrupt()
1220 tw_dev->state[request_id] = TW_S_COMPLETED; in twl_interrupt()
1221 twl_free_request_id(tw_dev, request_id); in twl_interrupt()
1455 int request_id, retval; in twl_scsi_queue_lck() local
1468 twl_get_request_id(tw_dev, &request_id); in twl_scsi_queue_lck()
1471 tw_dev->srb[request_id] = SCpnt; in twl_scsi_queue_lck()
1473 retval = twl_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL); in twl_scsi_queue_lck()
1475 tw_dev->state[request_id] = TW_S_COMPLETED; in twl_scsi_queue_lck()
1476 twl_free_request_id(tw_dev, request_id); in twl_scsi_queue_lck()