• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/

Lines Matching defs:shpnt

287 	do { if(HOSTDATA(shpnt)->debug & (when)) printk(msgs); } while(0)
568 #define HOSTDATA(shpnt) ((struct aha152x_hostdata *) &shpnt->hostdata)
570 #define HOSTNO ((shpnt)->host_no)
572 #define CURRENT_SC (HOSTDATA(shpnt)->current_SC)
573 #define DONE_SC (HOSTDATA(shpnt)->done_SC)
574 #define ISSUE_SC (HOSTDATA(shpnt)->issue_SC)
575 #define DISCONNECTED_SC (HOSTDATA(shpnt)->disconnected_SC)
576 #define QLOCK (HOSTDATA(shpnt)->lock)
577 #define QLOCKER (HOSTDATA(shpnt)->locker)
578 #define QLOCKERL (HOSTDATA(shpnt)->lockerl)
580 #define STATE (HOSTDATA(shpnt)->state)
581 #define PREVSTATE (HOSTDATA(shpnt)->prevstate)
582 #define LASTSTATE (HOSTDATA(shpnt)->laststate)
584 #define RECONN_TARGET (HOSTDATA(shpnt)->target)
586 #define CMD_I (HOSTDATA(shpnt)->cmd_i)
588 #define MSGO(i) (HOSTDATA(shpnt)->msgo[i])
589 #define MSGO_I (HOSTDATA(shpnt)->msgo_i)
590 #define MSGOLEN (HOSTDATA(shpnt)->msgo_len)
591 #define ADDMSGO(x) (MSGOLEN<256 ? (void)(MSGO(MSGOLEN++)=x) : aha152x_error(shpnt,"MSGO overflow"))
593 #define MSGI(i) (HOSTDATA(shpnt)->msgi[i])
594 #define MSGILEN (HOSTDATA(shpnt)->msgi_len)
595 #define ADDMSGI(x) (MSGILEN<256 ? (void)(MSGI(MSGILEN++)=x) : aha152x_error(shpnt,"MSGI overflow"))
597 #define DATA_LEN (HOSTDATA(shpnt)->data_len)
599 #define SYNCRATE (HOSTDATA(shpnt)->syncrate[CURRENT_SC->device->id])
600 #define SYNCNEG (HOSTDATA(shpnt)->syncneg[CURRENT_SC->device->id])
602 #define DELAY (HOSTDATA(shpnt)->delay)
603 #define EXT_TRANS (HOSTDATA(shpnt)->ext_trans)
604 #define TC1550 (HOSTDATA(shpnt)->tc1550)
605 #define RECONNECT (HOSTDATA(shpnt)->reconnect)
606 #define PARITY (HOSTDATA(shpnt)->parity)
607 #define SYNCHRONOUS (HOSTDATA(shpnt)->synchronous)
609 #define HOSTIOPORT0 (HOSTDATA(shpnt)->io_port0)
610 #define HOSTIOPORT1 (HOSTDATA(shpnt)->io_port1)
619 static void seldi_run(struct Scsi_Host *shpnt);
620 static void seldo_run(struct Scsi_Host *shpnt);
621 static void selto_run(struct Scsi_Host *shpnt);
622 static void busfree_run(struct Scsi_Host *shpnt);
624 static void msgo_init(struct Scsi_Host *shpnt);
625 static void msgo_run(struct Scsi_Host *shpnt);
626 static void msgo_end(struct Scsi_Host *shpnt);
628 static void cmd_init(struct Scsi_Host *shpnt);
629 static void cmd_run(struct Scsi_Host *shpnt);
630 static void cmd_end(struct Scsi_Host *shpnt);
632 static void datai_init(struct Scsi_Host *shpnt);
633 static void datai_run(struct Scsi_Host *shpnt);
634 static void datai_end(struct Scsi_Host *shpnt);
636 static void datao_init(struct Scsi_Host *shpnt);
637 static void datao_run(struct Scsi_Host *shpnt);
638 static void datao_end(struct Scsi_Host *shpnt);
640 static void status_run(struct Scsi_Host *shpnt);
642 static void msgi_run(struct Scsi_Host *shpnt);
643 static void msgi_end(struct Scsi_Host *shpnt);
645 static void parerr_run(struct Scsi_Host *shpnt);
646 static void rsti_run(struct Scsi_Host *shpnt);
648 static void is_complete(struct Scsi_Host *shpnt);
679 static void reset_ports(struct Scsi_Host *shpnt);
680 static void aha152x_error(struct Scsi_Host *shpnt, char *msg);
681 static void done(struct Scsi_Host *shpnt, int error);
684 static void disp_ports(struct Scsi_Host *shpnt);
686 static void show_queues(struct Scsi_Host *shpnt);
687 static void disp_enintr(struct Scsi_Host *shpnt);
764 struct Scsi_Host *shpnt = dev_id;
766 HOSTDATA(shpnt)->swint++;
774 struct Scsi_Host *shpnt;
776 shpnt = scsi_host_alloc(&aha152x_driver_template, sizeof(struct aha152x_hostdata));
777 if (!shpnt) {
782 memset(HOSTDATA(shpnt), 0, sizeof *HOSTDATA(shpnt));
783 INIT_LIST_HEAD(&HOSTDATA(shpnt)->host_list);
786 list_add_tail(&HOSTDATA(shpnt)->host_list, &aha152x_host_list);
788 shpnt->io_port = setup->io_port;
789 shpnt->n_io_port = IO_RANGE;
790 shpnt->irq = setup->irq;
808 HOSTDATA(shpnt)->debug = setup->debug;
812 shpnt->this_id = setup->scsiid;
815 shpnt->can_queue = AHA152X_MAXQUEUE;
824 reset_ports(shpnt);
837 shpnt->host_no, setup->tc1550 ? " (tc1550 mode)" : "",
839 shpnt->io_port, HOSTIOPORT0, HOSTIOPORT1,
840 shpnt->irq,
841 shpnt->this_id,
852 if( request_irq(shpnt->irq, swintr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) {
853 printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq);
857 HOSTDATA(shpnt)->swint = 0;
859 printk(KERN_INFO "aha152x%d: trying software interrupt, ", shpnt->host_no);
864 free_irq(shpnt->irq, shpnt);
866 if (!HOSTDATA(shpnt)->swint) {
876 "Please verify.\n", shpnt->host_no, shpnt->irq);
886 if ( request_irq(shpnt->irq, intr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) {
887 printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq);
891 if( scsi_add_host(shpnt, NULL) ) {
892 free_irq(shpnt->irq, shpnt);
893 printk(KERN_ERR "aha152x%d: failed to add host.\n", shpnt->host_no);
897 scsi_scan_host(shpnt);
899 return shpnt;
902 list_del(&HOSTDATA(shpnt)->host_list);
903 scsi_host_put(shpnt);
908 void aha152x_release(struct Scsi_Host *shpnt)
910 if (!shpnt)
913 scsi_remove_host(shpnt);
914 if (shpnt->irq)
915 free_irq(shpnt->irq, shpnt);
918 if (shpnt->io_port)
919 release_region(shpnt->io_port, IO_RANGE);
923 if (HOSTDATA(shpnt)->pnpdev)
924 pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
927 list_del(&HOSTDATA(shpnt)->host_list);
928 scsi_host_put(shpnt);
937 static int setup_expected_interrupts(struct Scsi_Host *shpnt)
965 if(!HOSTDATA(shpnt)->in_intr)
978 struct Scsi_Host *shpnt = SCpnt->device->host;
982 if (HOSTDATA(shpnt)->debug & debug_queue) {
1037 HOSTDATA(shpnt)->total_commands++;
1041 HOSTDATA(shpnt)->commands++;
1042 if (HOSTDATA(shpnt)->commands==1)
1047 if(!HOSTDATA(shpnt)->in_intr)
1048 setup_expected_interrupts(shpnt);
1085 struct Scsi_Host *shpnt = SCpnt->device->host;
1090 if(HOSTDATA(shpnt)->debug & debug_eh) {
1092 show_queues(shpnt);
1103 HOSTDATA(shpnt)->commands--;
1104 if (!HOSTDATA(shpnt)->commands)
1128 struct Scsi_Host *shpnt = SCpnt->device->host;
1136 if(HOSTDATA(shpnt)->debug & debug_eh) {
1138 show_queues(shpnt);
1169 HOSTDATA(shpnt)->commands--;
1170 if (!HOSTDATA(shpnt)->commands)
1191 static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
1209 HOSTDATA(shpnt)->commands--;
1222 static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
1229 if(HOSTDATA(shpnt)->debug & debug_eh) {
1230 printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no);
1231 show_queues(shpnt);
1235 free_hard_reset_SCs(shpnt, &ISSUE_SC);
1236 free_hard_reset_SCs(shpnt, &DISCONNECTED_SC);
1238 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no);
1245 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no);
1247 setup_expected_interrupts(shpnt);
1248 if(HOSTDATA(shpnt)->commands==0)
1269 static void reset_ports(struct Scsi_Host *shpnt)
1298 setup_expected_interrupts(shpnt);
1306 int aha152x_host_reset_host(struct Scsi_Host *shpnt)
1308 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no);
1310 aha152x_bus_reset_host(shpnt);
1312 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no);
1313 reset_ports(shpnt);
1334 struct Scsi_Host *shpnt = sdev->host;
1382 static void done(struct Scsi_Host *shpnt, int error)
1418 struct Scsi_Host *shpnt = dev_id;
1448 if( HOSTDATA(shpnt)->service==0 ) {
1449 HOSTDATA(shpnt)->service=1;
1465 static void busfree_run(struct Scsi_Host *shpnt)
1485 done(shpnt, (CURRENT_SC->SCp.Status & 0xff) | ((CURRENT_SC->SCp.Message & 0xff) << 8) | (DID_OK << 16));
1489 done(shpnt, (CURRENT_SC->SCp.Status & 0xff) | ((CURRENT_SC->SCp.Message & 0xff) << 8) | (DID_ABORT << 16));
1493 done(shpnt, (CURRENT_SC->SCp.Status & 0xff) | ((CURRENT_SC->SCp.Message & 0xff) << 8) | (DID_RESET << 16));
1502 HOSTDATA(shpnt)->disconnections++;
1509 done(shpnt, DID_ERROR << 16);
1513 HOSTDATA(shpnt)->busfree_without_old_command++;
1525 struct scsi_cmnd *cmd = HOSTDATA(shpnt)->done_SC;
1533 HOSTDATA(shpnt)->commands--;
1534 if (!HOSTDATA(shpnt)->commands)
1538 HOSTDATA(shpnt)->busfree_with_check_condition++;
1567 HOSTDATA(shpnt)->commands--;
1568 if (!HOSTDATA(shpnt)->commands)
1586 HOSTDATA(shpnt)->busfree_without_done_command++;
1606 SETPORT(SCSIID, (shpnt->this_id << OID_) | CURRENT_SC->device->id);
1611 HOSTDATA(shpnt)->busfree_without_new_command++;
1618 HOSTDATA(shpnt)->busfree_without_any_action++;
1627 static void seldo_run(struct Scsi_Host *shpnt)
1639 done(shpnt, DID_NO_CONNECT << 16);
1665 static void selto_run(struct Scsi_Host *shpnt)
1681 done(shpnt, DID_ABORT << 16);
1684 done(shpnt, DID_BUS_BUSY << 16);
1688 done(shpnt, DID_NO_CONNECT << 16);
1699 static void seldi_run(struct Scsi_Host *shpnt)
1730 selid = GETPORT(SELID) & ~(1 << shpnt->this_id);
1746 SETPORT(SCSIID, (shpnt->this_id << OID_) | target);
1749 SETRATE(HOSTDATA(shpnt)->syncrate[target]);
1755 static void msgi_run(struct Scsi_Host *shpnt)
1771 if (HOSTDATA(shpnt)->debug & debug_msgi) {
1794 show_queues(shpnt);
1857 if (!HOSTDATA(shpnt)->synchronous)
1907 HOSTDATA(shpnt)->syncrate[i]=0;
1908 HOSTDATA(shpnt)->syncneg[i]=0;
1928 static void msgi_end(struct Scsi_Host *shpnt)
1943 static void msgo_init(struct Scsi_Host *shpnt)
1955 if(HOSTDATA(shpnt)->debug & debug_msgo) {
1970 static void msgo_run(struct Scsi_Host *shpnt)
2002 static void msgo_end(struct Scsi_Host *shpnt)
2020 static void cmd_init(struct Scsi_Host *shpnt)
2024 done(shpnt, DID_ERROR << 16);
2029 if (HOSTDATA(shpnt)->debug & debug_cmd) {
2042 static void cmd_run(struct Scsi_Host *shpnt)
2046 disp_ports(shpnt);
2061 static void cmd_end(struct Scsi_Host *shpnt)
2073 static void status_run(struct Scsi_Host *shpnt)
2083 if (HOSTDATA(shpnt)->debug & debug_status) {
2095 static void datai_init(struct Scsi_Host *shpnt)
2113 static void datai_run(struct Scsi_Host *shpnt)
2129 disp_ports(shpnt);
2142 disp_ports(shpnt);
2205 disp_ports(shpnt);
2212 disp_ports(shpnt);
2217 static void datai_end(struct Scsi_Host *shpnt)
2234 static void datao_init(struct Scsi_Host *shpnt)
2253 static void datao_run(struct Scsi_Host *shpnt)
2266 disp_ports(shpnt);
2300 disp_ports(shpnt);
2306 static void datao_end(struct Scsi_Host *shpnt)
2349 static int update_state(struct Scsi_Host *shpnt)
2388 disp_ports(shpnt);
2398 static void parerr_run(struct Scsi_Host *shpnt)
2401 done(shpnt, DID_PARITY << 16);
2408 static void rsti_run(struct Scsi_Host *shpnt)
2432 done(shpnt, DID_RESET << 16 );
2440 static void is_complete(struct Scsi_Host *shpnt)
2446 if(!shpnt)
2451 if( HOSTDATA(shpnt)->service==0 ) {
2456 HOSTDATA(shpnt)->service = 0;
2458 if(HOSTDATA(shpnt)->in_intr) {
2461 aha152x_error(shpnt, "bottom-half already running!?");
2463 HOSTDATA(shpnt)->in_intr++;
2473 dataphase=update_state(shpnt);
2482 states[PREVSTATE].end(shpnt);
2523 states[STATE].init(shpnt);
2530 states[STATE].run(shpnt);
2541 pending=setup_expected_interrupts(shpnt);
2543 HOSTDATA(shpnt)->count[STATE]++;
2545 HOSTDATA(shpnt)->count_trans[STATE]++;
2546 HOSTDATA(shpnt)->time[STATE] += jiffies-start;
2556 HOSTDATA(shpnt)->in_intr--;
2565 static void aha152x_error(struct Scsi_Host *shpnt, char *msg)
2568 show_queues(shpnt);
2575 static void disp_ports(struct Scsi_Host *shpnt)
2807 static void disp_enintr(struct Scsi_Host *shpnt)
2887 static void show_queues(struct Scsi_Host *shpnt)
2908 disp_ports(shpnt);
2909 disp_enintr(shpnt);
2951 static int get_ports(struct Scsi_Host *shpnt, char *pos)
3213 static int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt)
3215 if(!shpnt || !buffer || length<8 || strncmp("aha152x ", buffer, 8)!=0)
3220 int debug = HOSTDATA(shpnt)->debug;
3222 HOSTDATA(shpnt)->debug = simple_strtoul(buffer+14, NULL, 0);
3224 printk(KERN_INFO "aha152x%d: debugging options set to 0x%04x (were 0x%04x)\n", HOSTNO, HOSTDATA(shpnt)->debug, debug);
3231 HOSTDATA(shpnt)->total_commands=0;
3232 HOSTDATA(shpnt)->disconnections=0;
3233 HOSTDATA(shpnt)->busfree_without_any_action=0;
3234 HOSTDATA(shpnt)->busfree_without_old_command=0;
3235 HOSTDATA(shpnt)->busfree_without_new_command=0;
3236 HOSTDATA(shpnt)->busfree_without_done_command=0;
3237 HOSTDATA(shpnt)->busfree_with_check_condition=0;
3239 HOSTDATA(shpnt)->count[i]=0;
3240 HOSTDATA(shpnt)->count_trans[i]=0;
3241 HOSTDATA(shpnt)->time[i]=0;
3260 static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start,
3271 buffer, offset, length, shpnt->host_no, inout);
3275 return aha152x_set_info(buffer, length, shpnt);
3280 shpnt->io_port, shpnt->io_port + shpnt->n_io_port - 1);
3281 SPRINTF("interrupt 0x%02x\n", shpnt->irq);
3288 SPRINTF("%d commands currently queued\n", HOSTDATA(shpnt)->commands);
3293 if (HOSTDATA(shpnt)->syncrate[i] & 0x7f)
3296 (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2),
3297 (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2) * 50,
3298 HOSTDATA(shpnt)->syncrate[i] & 0x0f);
3302 if(HOSTDATA(shpnt)->debug & flags) SPRINTF("(%s) ", txt);
3346 pos += get_ports(shpnt, pos);
3361 HOSTDATA(shpnt)->total_commands,
3362 HOSTDATA(shpnt)->disconnections,
3363 HOSTDATA(shpnt)->busfree_with_check_condition,
3364 HOSTDATA(shpnt)->busfree_without_old_command,
3365 HOSTDATA(shpnt)->busfree_without_new_command,
3366 HOSTDATA(shpnt)->busfree_without_done_command,
3367 HOSTDATA(shpnt)->busfree_without_any_action);
3371 HOSTDATA(shpnt)->count_trans[i],
3372 HOSTDATA(shpnt)->count[i],
3373 HOSTDATA(shpnt)->time[i]);
3836 struct Scsi_Host *shpnt = aha152x_probe_one(&setup[i]);
3838 if( !shpnt ) {
3842 HOSTDATA(shpnt)->pnpdev=pnpdev[i];