• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/scsi/

Lines Matching refs:shpnt

288 	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 if (shpnt->irq)
914 free_irq(shpnt->irq, shpnt);
917 if (shpnt->io_port)
918 release_region(shpnt->io_port, IO_RANGE);
922 if (HOSTDATA(shpnt)->pnpdev)
923 pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
926 scsi_remove_host(shpnt);
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)
977 struct Scsi_Host *shpnt = SCpnt->device->host;
981 if (HOSTDATA(shpnt)->debug & debug_queue) {
1042 HOSTDATA(shpnt)->total_commands++;
1046 HOSTDATA(shpnt)->commands++;
1047 if (HOSTDATA(shpnt)->commands==1)
1052 if(!HOSTDATA(shpnt)->in_intr)
1053 setup_expected_interrupts(shpnt);
1090 struct Scsi_Host *shpnt = SCpnt->device->host;
1095 if(HOSTDATA(shpnt)->debug & debug_eh) {
1097 show_queues(shpnt);
1108 HOSTDATA(shpnt)->commands--;
1109 if (!HOSTDATA(shpnt)->commands)
1131 struct Scsi_Host *shpnt = SCp->device->host;
1148 struct Scsi_Host *shpnt = SCpnt->device->host;
1159 if(HOSTDATA(shpnt)->debug & debug_eh) {
1161 show_queues(shpnt);
1198 HOSTDATA(shpnt)->commands--;
1199 if (!HOSTDATA(shpnt)->commands)
1220 static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
1238 HOSTDATA(shpnt)->commands--;
1251 static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
1258 if(HOSTDATA(shpnt)->debug & debug_eh) {
1259 printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no);
1260 show_queues(shpnt);
1264 free_hard_reset_SCs(shpnt, &ISSUE_SC);
1265 free_hard_reset_SCs(shpnt, &DISCONNECTED_SC);
1267 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no);
1274 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no);
1276 setup_expected_interrupts(shpnt);
1277 if(HOSTDATA(shpnt)->commands==0)
1298 static void reset_ports(struct Scsi_Host *shpnt)
1327 setup_expected_interrupts(shpnt);
1335 int aha152x_host_reset_host(struct Scsi_Host *shpnt)
1337 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no);
1339 aha152x_bus_reset_host(shpnt);
1341 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no);
1342 reset_ports(shpnt);
1363 struct Scsi_Host *shpnt = sdev->host;
1411 static void done(struct Scsi_Host *shpnt, int error)
1447 struct Scsi_Host *shpnt = (struct Scsi_Host *)dev_id;
1451 if (!shpnt) {
1482 if( HOSTDATA(shpnt)->service==0 ) {
1483 HOSTDATA(shpnt)->service=1;
1499 static void busfree_run(struct Scsi_Host *shpnt)
1519 done(shpnt, (CURRENT_SC->SCp.Status & 0xff) | ((CURRENT_SC->SCp.Message & 0xff) << 8) | (DID_OK << 16));
1523 done(shpnt, (CURRENT_SC->SCp.Status & 0xff) | ((CURRENT_SC->SCp.Message & 0xff) << 8) | (DID_ABORT << 16));
1527 done(shpnt, (CURRENT_SC->SCp.Status & 0xff) | ((CURRENT_SC->SCp.Message & 0xff) << 8) | (DID_RESET << 16));
1536 HOSTDATA(shpnt)->disconnections++;
1543 done(shpnt, DID_ERROR << 16);
1547 HOSTDATA(shpnt)->busfree_without_old_command++;
1559 struct scsi_cmnd *cmd = HOSTDATA(shpnt)->done_SC;
1572 HOSTDATA(shpnt)->commands--;
1573 if (!HOSTDATA(shpnt)->commands)
1577 HOSTDATA(shpnt)->busfree_with_check_condition++;
1611 HOSTDATA(shpnt)->commands--;
1612 if (!HOSTDATA(shpnt)->commands)
1630 HOSTDATA(shpnt)->busfree_without_done_command++;
1650 SETPORT(SCSIID, (shpnt->this_id << OID_) | CURRENT_SC->device->id);
1655 HOSTDATA(shpnt)->busfree_without_new_command++;
1662 HOSTDATA(shpnt)->busfree_without_any_action++;
1671 static void seldo_run(struct Scsi_Host *shpnt)
1683 done(shpnt, DID_NO_CONNECT << 16);
1709 static void selto_run(struct Scsi_Host *shpnt)
1725 done(shpnt, DID_ABORT << 16);
1728 done(shpnt, DID_BUS_BUSY << 16);
1732 done(shpnt, DID_NO_CONNECT << 16);
1743 static void seldi_run(struct Scsi_Host *shpnt)
1774 selid = GETPORT(SELID) & ~(1 << shpnt->this_id);
1790 SETPORT(SCSIID, (shpnt->this_id << OID_) | target);
1793 SETRATE(HOSTDATA(shpnt)->syncrate[target]);
1799 static void msgi_run(struct Scsi_Host *shpnt)
1815 if (HOSTDATA(shpnt)->debug & debug_msgi) {
1838 show_queues(shpnt);
1901 if (!HOSTDATA(shpnt)->synchronous)
1951 HOSTDATA(shpnt)->syncrate[i]=0;
1952 HOSTDATA(shpnt)->syncneg[i]=0;
1972 static void msgi_end(struct Scsi_Host *shpnt)
1987 static void msgo_init(struct Scsi_Host *shpnt)
1999 if(HOSTDATA(shpnt)->debug & debug_msgo) {
2014 static void msgo_run(struct Scsi_Host *shpnt)
2046 static void msgo_end(struct Scsi_Host *shpnt)
2064 static void cmd_init(struct Scsi_Host *shpnt)
2068 done(shpnt, DID_ERROR << 16);
2073 if (HOSTDATA(shpnt)->debug & debug_cmd) {
2086 static void cmd_run(struct Scsi_Host *shpnt)
2090 disp_ports(shpnt);
2105 static void cmd_end(struct Scsi_Host *shpnt)
2117 static void status_run(struct Scsi_Host *shpnt)
2127 if (HOSTDATA(shpnt)->debug & debug_status) {
2139 static void datai_init(struct Scsi_Host *shpnt)
2156 static void datai_run(struct Scsi_Host *shpnt)
2172 disp_ports(shpnt);
2185 disp_ports(shpnt);
2248 disp_ports(shpnt);
2255 disp_ports(shpnt);
2260 static void datai_end(struct Scsi_Host *shpnt)
2276 static void datao_init(struct Scsi_Host *shpnt)
2294 static void datao_run(struct Scsi_Host *shpnt)
2307 disp_ports(shpnt);
2341 disp_ports(shpnt);
2347 static void datao_end(struct Scsi_Host *shpnt)
2391 static int update_state(struct Scsi_Host *shpnt)
2430 disp_ports(shpnt);
2440 static void parerr_run(struct Scsi_Host *shpnt)
2443 done(shpnt, DID_PARITY << 16);
2450 static void rsti_run(struct Scsi_Host *shpnt)
2474 done(shpnt, DID_RESET << 16 );
2482 static void is_complete(struct Scsi_Host *shpnt)
2488 if(!shpnt)
2493 if( HOSTDATA(shpnt)->service==0 ) {
2498 HOSTDATA(shpnt)->service = 0;
2500 if(HOSTDATA(shpnt)->in_intr) {
2503 aha152x_error(shpnt, "bottom-half already running!?");
2505 HOSTDATA(shpnt)->in_intr++;
2515 dataphase=update_state(shpnt);
2524 states[PREVSTATE].end(shpnt);
2565 states[STATE].init(shpnt);
2572 states[STATE].run(shpnt);
2583 pending=setup_expected_interrupts(shpnt);
2585 HOSTDATA(shpnt)->count[STATE]++;
2587 HOSTDATA(shpnt)->count_trans[STATE]++;
2588 HOSTDATA(shpnt)->time[STATE] += jiffies-start;
2598 HOSTDATA(shpnt)->in_intr--;
2607 static void aha152x_error(struct Scsi_Host *shpnt, char *msg)
2610 show_queues(shpnt);
2617 static void disp_ports(struct Scsi_Host *shpnt)
2849 static void disp_enintr(struct Scsi_Host *shpnt)
2929 static void show_queues(struct Scsi_Host *shpnt)
2950 disp_ports(shpnt);
2951 disp_enintr(shpnt);
2992 static int get_ports(struct Scsi_Host *shpnt, char *pos)
3254 static int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt)
3256 if(!shpnt || !buffer || length<8 || strncmp("aha152x ", buffer, 8)!=0)
3261 int debug = HOSTDATA(shpnt)->debug;
3263 HOSTDATA(shpnt)->debug = simple_strtoul(buffer+14, NULL, 0);
3265 printk(KERN_INFO "aha152x%d: debugging options set to 0x%04x (were 0x%04x)\n", HOSTNO, HOSTDATA(shpnt)->debug, debug);
3272 HOSTDATA(shpnt)->total_commands=0;
3273 HOSTDATA(shpnt)->disconnections=0;
3274 HOSTDATA(shpnt)->busfree_without_any_action=0;
3275 HOSTDATA(shpnt)->busfree_without_old_command=0;
3276 HOSTDATA(shpnt)->busfree_without_new_command=0;
3277 HOSTDATA(shpnt)->busfree_without_done_command=0;
3278 HOSTDATA(shpnt)->busfree_with_check_condition=0;
3280 HOSTDATA(shpnt)->count[i]=0;
3281 HOSTDATA(shpnt)->count_trans[i]=0;
3282 HOSTDATA(shpnt)->time[i]=0;
3301 static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start,
3312 buffer, offset, length, shpnt->host_no, inout);
3316 return aha152x_set_info(buffer, length, shpnt);
3321 shpnt->io_port, shpnt->io_port + shpnt->n_io_port - 1);
3322 SPRINTF("interrupt 0x%02x\n", shpnt->irq);
3329 SPRINTF("%d commands currently queued\n", HOSTDATA(shpnt)->commands);
3334 if (HOSTDATA(shpnt)->syncrate[i] & 0x7f)
3337 (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2),
3338 (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2) * 50,
3339 HOSTDATA(shpnt)->syncrate[i] & 0x0f);
3343 if(HOSTDATA(shpnt)->debug & flags) SPRINTF("(%s) ", txt);
3387 pos += get_ports(shpnt, pos);
3402 HOSTDATA(shpnt)->total_commands,
3403 HOSTDATA(shpnt)->disconnections,
3404 HOSTDATA(shpnt)->busfree_with_check_condition,
3405 HOSTDATA(shpnt)->busfree_without_old_command,
3406 HOSTDATA(shpnt)->busfree_without_new_command,
3407 HOSTDATA(shpnt)->busfree_without_done_command,
3408 HOSTDATA(shpnt)->busfree_without_any_action);
3412 HOSTDATA(shpnt)->count_trans[i],
3413 HOSTDATA(shpnt)->count[i],
3414 HOSTDATA(shpnt)->time[i]);
3870 struct Scsi_Host *shpnt = aha152x_probe_one(&setup[i]);
3872 if( !shpnt ) {
3876 HOSTDATA(shpnt)->pnpdev=pnpdev[i];