Lines Matching refs:request_id
125 static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
127 static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id);
130 static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_ho…
131 static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
132 static void twa_get_request_id(TW_Device_Extension *tw_dev, int *request_id);
143 …TW_Device_Extension *tw_dev, TW_Command_Full *full_command_packet, int request_id, dma_addr_t dma_…
144 static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds);
146 static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id, char internal);
149 static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_…
150 static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id);
152 static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id);
230 static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id) in twa_aen_complete() argument
238 header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id]; in twa_aen_complete()
241 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_aen_complete()
247 if (twa_aen_read_queue(tw_dev, request_id)) in twa_aen_complete()
260 twa_aen_sync_time(tw_dev, request_id); in twa_aen_complete()
267 if (twa_aen_read_queue(tw_dev, request_id)) in twa_aen_complete()
276 tw_dev->state[request_id] = TW_S_COMPLETED; in twa_aen_complete()
277 twa_free_request_id(tw_dev, request_id); in twa_aen_complete()
286 int request_id = 0; in twa_aen_drain_queue() local
300 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_aen_drain_queue()
311 sglist[0].address = tw_dev->generic_buffer_phys[request_id]; in twa_aen_drain_queue()
319 tw_dev->srb[request_id] = NULL; in twa_aen_drain_queue()
323 if (twa_scsiop_execute_scsi(tw_dev, request_id, cdb, 1, sglist)) { in twa_aen_drain_queue()
329 if (twa_poll_response(tw_dev, request_id, 30)) { in twa_aen_drain_queue()
336 header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id]; in twa_aen_drain_queue()
370 tw_dev->state[request_id] = TW_S_INITIAL; in twa_aen_drain_queue()
431 static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) in twa_aen_read_queue() argument
438 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_aen_read_queue()
449 sglist[0].address = tw_dev->generic_buffer_phys[request_id]; in twa_aen_read_queue()
452 tw_dev->srb[request_id] = NULL; in twa_aen_read_queue()
455 if (twa_scsiop_execute_scsi(tw_dev, request_id, cdb, 1, sglist)) { in twa_aen_read_queue()
479 static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) in twa_aen_sync_time() argument
489 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_aen_sync_time()
493 command_packet->request_id = request_id; in twa_aen_sync_time()
494 …packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]); in twa_aen_sync_time()
500 param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id]; in twa_aen_sync_time()
516 tw_dev->srb[request_id] = NULL; in twa_aen_sync_time()
519 twa_post_command_packet(tw_dev, request_id, 1); in twa_aen_sync_time()
647 int request_id = 0; in twa_chrdev_ioctl() local
700 twa_get_request_id(tw_dev, &request_id); in twa_chrdev_ioctl()
703 tw_dev->srb[request_id] = NULL; in twa_chrdev_ioctl()
706 tw_dev->chrdev_request_id = request_id; in twa_chrdev_ioctl()
711 twa_load_sgl(tw_dev, full_command_packet, request_id, dma_handle, data_buffer_length_adjusted); in twa_chrdev_ioctl()
713 …memcpy(tw_dev->command_packet_virt[request_id], &(tw_ioctl->firmware_command), sizeof(TW_Command_F… in twa_chrdev_ioctl()
716 twa_post_command_packet(tw_dev, request_id, 1); in twa_chrdev_ioctl()
736 …memcpy(&(tw_ioctl->firmware_command), tw_dev->command_packet_virt[request_id], sizeof(TW_Command_F… in twa_chrdev_ioctl()
741 tw_dev->state[request_id] = TW_S_COMPLETED; in twa_chrdev_ioctl()
742 twa_free_request_id(tw_dev, request_id); in twa_chrdev_ioctl()
985 static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_ho… in twa_fill_sense() argument
992 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_fill_sense()
1020 …memcpy(tw_dev->srb[request_id]->sense_buffer, full_command_packet->header.sense_data, TW_SENSE_DAT… in twa_fill_sense()
1021 tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1); in twa_fill_sense()
1049 static void twa_free_request_id(TW_Device_Extension *tw_dev, int request_id) in twa_free_request_id() argument
1051 tw_dev->free_queue[tw_dev->free_tail] = request_id; in twa_free_request_id()
1052 tw_dev->state[request_id] = TW_S_FINISHED; in twa_free_request_id()
1057 static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int table_id, int parameter… in twa_get_param() argument
1065 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_get_param()
1071 command_packet->request_id = request_id; in twa_get_param()
1075 param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id]; in twa_get_param()
1081 …packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]); in twa_get_param()
1085 twa_post_command_packet(tw_dev, request_id, 1); in twa_get_param()
1088 if (twa_poll_response(tw_dev, request_id, 30)) in twa_get_param()
1094 tw_dev->state[request_id] = TW_S_INITIAL; in twa_get_param()
1100 static void twa_get_request_id(TW_Device_Extension *tw_dev, int *request_id) in twa_get_request_id() argument
1102 *request_id = tw_dev->free_queue[tw_dev->free_head]; in twa_get_request_id()
1104 tw_dev->state[*request_id] = TW_S_STARTED; in twa_get_request_id()
1121 int request_id = 0, retval = 1; in twa_initconnection() local
1124 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_initconnection()
1130 tw_initconnect->request_id = request_id; in twa_initconnection()
1149 twa_post_command_packet(tw_dev, request_id, 1); in twa_initconnection()
1152 if (twa_poll_response(tw_dev, request_id, 30)) { in twa_initconnection()
1166 tw_dev->state[request_id] = TW_S_INITIAL; in twa_initconnection()
1220 int request_id, error = 0; in twa_interrupt() local
1259 twa_get_request_id(tw_dev, &request_id); in twa_interrupt()
1261 error = twa_aen_read_queue(tw_dev, request_id); in twa_interrupt()
1263 tw_dev->state[request_id] = TW_S_COMPLETED; in twa_interrupt()
1264 twa_free_request_id(tw_dev, request_id); in twa_interrupt()
1275 request_id = tw_dev->pending_queue[tw_dev->pending_head]; in twa_interrupt()
1276 if (tw_dev->state[request_id] != TW_S_PENDING) { in twa_interrupt()
1281 if (twa_post_command_packet(tw_dev, request_id, 1)==0) { in twa_interrupt()
1298 request_id = TW_RESID_OUT(response_que.response_id); in twa_interrupt()
1299 full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_interrupt()
1303 if (tw_dev->srb[request_id] != NULL) { in twa_interrupt()
1304 error = twa_fill_sense(tw_dev, request_id, 1, 1); in twa_interrupt()
1307 if (request_id != tw_dev->chrdev_request_id) { in twa_interrupt()
1308 error = twa_fill_sense(tw_dev, request_id, 0, 1); in twa_interrupt()
1314 if (tw_dev->state[request_id] != TW_S_POSTED) { in twa_interrupt()
1315 if (tw_dev->srb[request_id] != NULL) { in twa_interrupt()
1323 if (tw_dev->srb[request_id] == NULL) { in twa_interrupt()
1324 if (request_id != tw_dev->chrdev_request_id) { in twa_interrupt()
1325 if (twa_aen_complete(tw_dev, request_id)) in twa_interrupt()
1334 cmd = tw_dev->srb[request_id]; in twa_interrupt()
1336 twa_scsiop_execute_scsi_complete(tw_dev, request_id); in twa_interrupt()
1350 …(full_command_packet->command.newcommand.sg_list[0].length < scsi_bufflen(tw_dev->srb[request_id])) in twa_interrupt()
1355 tw_dev->state[request_id] = TW_S_COMPLETED; in twa_interrupt()
1356 twa_free_request_id(tw_dev, request_id); in twa_interrupt()
1358 tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); in twa_interrupt()
1359 twa_unmap_scsi_data(tw_dev, request_id); in twa_interrupt()
1379 …TW_Device_Extension *tw_dev, TW_Command_Full *full_command_packet, int request_id, dma_addr_t dma_… in twa_load_sgl() argument
1392 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id)); in twa_load_sgl()
1401 oldcommand->request_id = request_id; in twa_load_sgl()
1418 static int twa_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id) in twa_map_scsi_sg_data() argument
1421 struct scsi_cmnd *cmd = tw_dev->srb[request_id]; in twa_map_scsi_sg_data()
1438 static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds) in twa_poll_response() argument
1442 TW_Command_Full *full_command_packet = tw_dev->command_packet_virt[request_id]; in twa_poll_response()
1447 if (request_id != response_request_id) { in twa_poll_response()
1454 twa_fill_sense(tw_dev, request_id, 0, 0); in twa_poll_response()
1461 twa_fill_sense(tw_dev, request_id, 0, 0); in twa_poll_response()
1532 static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id, char internal) in twa_post_command_packet() argument
1538 command_que_value = tw_dev->command_packet_phys[request_id]; in twa_post_command_packet()
1552 …if (((tw_dev->pending_request_count > 0) && (tw_dev->state[request_id] != TW_S_PENDING)) || (statu… in twa_post_command_packet()
1561 if (tw_dev->state[request_id] != TW_S_PENDING) { in twa_post_command_packet()
1562 tw_dev->state[request_id] = TW_S_PENDING; in twa_post_command_packet()
1567 tw_dev->pending_queue[tw_dev->pending_tail] = request_id; in twa_post_command_packet()
1586 tw_dev->state[request_id] = TW_S_POSTED; in twa_post_command_packet()
1770 int request_id, retval; in twa_scsi_queue_lck() local
1791 twa_get_request_id(tw_dev, &request_id); in twa_scsi_queue_lck()
1794 tw_dev->srb[request_id] = SCpnt; in twa_scsi_queue_lck()
1799 retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL); in twa_scsi_queue_lck()
1802 twa_free_request_id(tw_dev, request_id); in twa_scsi_queue_lck()
1803 twa_unmap_scsi_data(tw_dev, request_id); in twa_scsi_queue_lck()
1806 tw_dev->state[request_id] = TW_S_COMPLETED; in twa_scsi_queue_lck()
1807 twa_free_request_id(tw_dev, request_id); in twa_scsi_queue_lck()
1808 twa_unmap_scsi_data(tw_dev, request_id); in twa_scsi_queue_lck()
1820 static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_… in DEF_SCSI_QCMD()
1830 if (tw_dev->srb[request_id]) { in DEF_SCSI_QCMD()
1831 srb = tw_dev->srb[request_id]; in DEF_SCSI_QCMD()
1837 full_command_packet = tw_dev->command_packet_virt[request_id]; in DEF_SCSI_QCMD()
1855 cpu_to_le16(TW_REQ_LUN_IN(srb->device->lun, request_id)); in DEF_SCSI_QCMD()
1858 cpu_to_le16(TW_REQ_LUN_IN(0, request_id)); in DEF_SCSI_QCMD()
1873 tw_dev->generic_buffer_virt[request_id], in DEF_SCSI_QCMD()
1875 command_packet->sg_list[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]); in DEF_SCSI_QCMD()
1878 sg_count = twa_map_scsi_sg_data(tw_dev, request_id); in DEF_SCSI_QCMD()
1891 …lunh = cpu_to_le16(TW_REQ_LUN_IN((srb->device->lun >> 4), scsi_sg_count(tw_dev->srb[request_id]))); in DEF_SCSI_QCMD()
1921 tw_dev->sgl_entries = scsi_sg_count(tw_dev->srb[request_id]); in DEF_SCSI_QCMD()
1928 retval = twa_post_command_packet(tw_dev, request_id, 0); in DEF_SCSI_QCMD()
1930 twa_post_command_packet(tw_dev, request_id, 1); in DEF_SCSI_QCMD()
1938 static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id) in twa_scsiop_execute_scsi_complete() argument
1940 struct scsi_cmnd *cmd = tw_dev->srb[request_id]; in twa_scsiop_execute_scsi_complete()
1946 void *buf = tw_dev->generic_buffer_virt[request_id]; in twa_scsiop_execute_scsi_complete()
1995 static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id) in twa_unmap_scsi_data() argument
1997 struct scsi_cmnd *cmd = tw_dev->srb[request_id]; in twa_unmap_scsi_data()