Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (40 commits)
[SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug
[SCSI] aic7xxx: add const
[SCSI] aic7xxx: add static
[SCSI] aic7xxx: Update _shipped files
[SCSI] aic7xxx: teach aicasm to not emit unused debug code/data
[SCSI] qla2xxx: Update version number to 8.02.01-k2.
[SCSI] qla2xxx: Correct regression in relogin code.
[SCSI] qla2xxx: Correct misc. endian and byte-ordering issues.
[SCSI] qla2xxx: make qla2x00_issue_iocb_timeout() static
[SCSI] qla2xxx: qla_os.c, make 2 functions static
[SCSI] qla2xxx: Re-register FDMI information after a LIP.
[SCSI] qla2xxx: Correct SRB usage-after-completion/free issues.
[SCSI] qla2xxx: Correct ISP84XX verify-chip response handling.
[SCSI] qla2xxx: Wakeup DPC thread to process any deferred-work requests.
[SCSI] qla2xxx: Collapse RISC-RAM retrieval code during a firmware-dump.
[SCSI] m68k: new mac_esp scsi driver
[SCSI] zfcp: Add some statistics provided by the FCP adapter to the sysfs
[SCSI] zfcp: Print some messages only during ERP
[SCSI] zfcp: Wait for free SBAL during exchange config
[SCSI] scsi_transport_fc: fc_user_scan correction
...

+4057 -5142
+29 -14
block/bsg.c
··· 699 699 return bd; 700 700 } 701 701 702 + static void bsg_kref_release_function(struct kref *kref) 703 + { 704 + struct bsg_class_device *bcd = 705 + container_of(kref, struct bsg_class_device, ref); 706 + 707 + if (bcd->release) 708 + bcd->release(bcd->parent); 709 + 710 + put_device(bcd->parent); 711 + } 712 + 702 713 static int bsg_put_device(struct bsg_device *bd) 703 714 { 704 - int ret = 0; 705 - struct device *dev = bd->queue->bsg_dev.dev; 715 + int ret = 0, do_free; 716 + struct request_queue *q = bd->queue; 706 717 707 718 mutex_lock(&bsg_mutex); 708 719 709 - if (!atomic_dec_and_test(&bd->ref_count)) 720 + do_free = atomic_dec_and_test(&bd->ref_count); 721 + if (!do_free) 710 722 goto out; 711 723 712 724 dprintk("%s: tearing down\n", bd->name); ··· 735 723 */ 736 724 ret = bsg_complete_all_commands(bd); 737 725 738 - blk_put_queue(bd->queue); 739 726 hlist_del(&bd->dev_list); 740 727 kfree(bd); 741 728 out: 742 729 mutex_unlock(&bsg_mutex); 743 - put_device(dev); 730 + kref_put(&q->bsg_dev.ref, bsg_kref_release_function); 731 + if (do_free) 732 + blk_put_queue(q); 744 733 return ret; 745 734 } 746 735 ··· 809 796 mutex_lock(&bsg_mutex); 810 797 bcd = idr_find(&bsg_minor_idr, iminor(inode)); 811 798 if (bcd) 812 - get_device(bcd->dev); 799 + kref_get(&bcd->ref); 813 800 mutex_unlock(&bsg_mutex); 814 801 815 802 if (!bcd) ··· 821 808 822 809 bd = bsg_add_device(inode, bcd->queue, file); 823 810 if (IS_ERR(bd)) 824 - put_device(bcd->dev); 811 + kref_put(&bcd->ref, bsg_kref_release_function); 825 812 826 813 return bd; 827 814 } ··· 960 947 idr_remove(&bsg_minor_idr, bcd->minor); 961 948 sysfs_remove_link(&q->kobj, "bsg"); 962 949 device_unregister(bcd->class_dev); 963 - put_device(bcd->dev); 964 950 bcd->class_dev = NULL; 951 + kref_put(&bcd->ref, bsg_kref_release_function); 965 952 mutex_unlock(&bsg_mutex); 966 953 } 967 954 EXPORT_SYMBOL_GPL(bsg_unregister_queue); 968 955 969 - int bsg_register_queue(struct request_queue *q, struct device *gdev, 970 - const char *name) 956 + int bsg_register_queue(struct request_queue *q, struct device *parent, 957 + const char *name, void (*release)(struct device *)) 971 958 { 972 959 struct bsg_class_device *bcd; 973 960 dev_t dev; ··· 978 965 if (name) 979 966 devname = name; 980 967 else 981 - devname = gdev->bus_id; 968 + devname = parent->bus_id; 982 969 983 970 /* 984 971 * we need a proper transport to send commands, not a stacked device ··· 1009 996 1010 997 bcd->minor = minor; 1011 998 bcd->queue = q; 1012 - bcd->dev = get_device(gdev); 999 + bcd->parent = get_device(parent); 1000 + bcd->release = release; 1001 + kref_init(&bcd->ref); 1013 1002 dev = MKDEV(bsg_major, bcd->minor); 1014 - class_dev = device_create(bsg_class, gdev, dev, "%s", devname); 1003 + class_dev = device_create(bsg_class, parent, dev, "%s", devname); 1015 1004 if (IS_ERR(class_dev)) { 1016 1005 ret = PTR_ERR(class_dev); 1017 1006 goto put_dev; ··· 1032 1017 unregister_class_dev: 1033 1018 device_unregister(class_dev); 1034 1019 put_dev: 1035 - put_device(gdev); 1020 + put_device(parent); 1036 1021 remove_idr: 1037 1022 idr_remove(&bsg_minor_idr, minor); 1038 1023 unlock:
+71 -29
drivers/misc/enclosure.c
··· 31 31 static LIST_HEAD(container_list); 32 32 static DEFINE_MUTEX(container_list_lock); 33 33 static struct class enclosure_class; 34 - static struct class enclosure_component_class; 35 34 36 35 /** 37 36 * enclosure_find - find an enclosure given a device ··· 165 166 } 166 167 EXPORT_SYMBOL_GPL(enclosure_unregister); 167 168 169 + #define ENCLOSURE_NAME_SIZE 64 170 + 171 + static void enclosure_link_name(struct enclosure_component *cdev, char *name) 172 + { 173 + strcpy(name, "enclosure_device:"); 174 + strcat(name, cdev->cdev.bus_id); 175 + } 176 + 177 + static void enclosure_remove_links(struct enclosure_component *cdev) 178 + { 179 + char name[ENCLOSURE_NAME_SIZE]; 180 + 181 + enclosure_link_name(cdev, name); 182 + sysfs_remove_link(&cdev->dev->kobj, name); 183 + sysfs_remove_link(&cdev->cdev.kobj, "device"); 184 + } 185 + 186 + static int enclosure_add_links(struct enclosure_component *cdev) 187 + { 188 + int error; 189 + char name[ENCLOSURE_NAME_SIZE]; 190 + 191 + error = sysfs_create_link(&cdev->cdev.kobj, &cdev->dev->kobj, "device"); 192 + if (error) 193 + return error; 194 + 195 + enclosure_link_name(cdev, name); 196 + error = sysfs_create_link(&cdev->dev->kobj, &cdev->cdev.kobj, name); 197 + if (error) 198 + sysfs_remove_link(&cdev->cdev.kobj, "device"); 199 + 200 + return error; 201 + } 202 + 168 203 static void enclosure_release(struct device *cdev) 169 204 { 170 205 struct enclosure_device *edev = to_enclosure_device(cdev); ··· 211 178 { 212 179 struct enclosure_component *cdev = to_enclosure_component(dev); 213 180 214 - put_device(cdev->dev); 181 + if (cdev->dev) { 182 + enclosure_remove_links(cdev); 183 + put_device(cdev->dev); 184 + } 215 185 put_device(dev->parent); 216 186 } 187 + 188 + static struct attribute_group *enclosure_groups[]; 217 189 218 190 /** 219 191 * enclosure_component_register - add a particular component to an enclosure ··· 255 217 ecomp->number = number; 256 218 cdev = &ecomp->cdev; 257 219 cdev->parent = get_device(&edev->edev); 258 - cdev->class = &enclosure_component_class; 259 220 if (name) 260 221 snprintf(cdev->bus_id, BUS_ID_SIZE, "%s", name); 261 222 else 262 223 snprintf(cdev->bus_id, BUS_ID_SIZE, "%u", number); 224 + 225 + cdev->release = enclosure_component_release; 226 + cdev->groups = enclosure_groups; 263 227 264 228 err = device_register(cdev); 265 229 if (err) ··· 295 255 296 256 cdev = &edev->component[component]; 297 257 298 - device_del(&cdev->cdev); 258 + if (cdev->dev) 259 + enclosure_remove_links(cdev); 260 + 299 261 put_device(cdev->dev); 300 262 cdev->dev = get_device(dev); 301 - return device_add(&cdev->cdev); 263 + return enclosure_add_links(cdev); 302 264 } 303 265 EXPORT_SYMBOL_GPL(enclosure_add_device); 304 266 ··· 484 442 } 485 443 486 444 487 - static struct device_attribute enclosure_component_attrs[] = { 488 - __ATTR(fault, S_IRUGO | S_IWUSR, get_component_fault, 489 - set_component_fault), 490 - __ATTR(status, S_IRUGO | S_IWUSR, get_component_status, 491 - set_component_status), 492 - __ATTR(active, S_IRUGO | S_IWUSR, get_component_active, 493 - set_component_active), 494 - __ATTR(locate, S_IRUGO | S_IWUSR, get_component_locate, 495 - set_component_locate), 496 - __ATTR(type, S_IRUGO, get_component_type, NULL), 497 - __ATTR_NULL 445 + static DEVICE_ATTR(fault, S_IRUGO | S_IWUSR, get_component_fault, 446 + set_component_fault); 447 + static DEVICE_ATTR(status, S_IRUGO | S_IWUSR, get_component_status, 448 + set_component_status); 449 + static DEVICE_ATTR(active, S_IRUGO | S_IWUSR, get_component_active, 450 + set_component_active); 451 + static DEVICE_ATTR(locate, S_IRUGO | S_IWUSR, get_component_locate, 452 + set_component_locate); 453 + static DEVICE_ATTR(type, S_IRUGO, get_component_type, NULL); 454 + 455 + static struct attribute *enclosure_component_attrs[] = { 456 + &dev_attr_fault.attr, 457 + &dev_attr_status.attr, 458 + &dev_attr_active.attr, 459 + &dev_attr_locate.attr, 460 + &dev_attr_type.attr, 461 + NULL 498 462 }; 499 463 500 - static struct class enclosure_component_class = { 501 - .name = "enclosure_component", 502 - .owner = THIS_MODULE, 503 - .dev_attrs = enclosure_component_attrs, 504 - .dev_release = enclosure_component_release, 464 + static struct attribute_group enclosure_group = { 465 + .attrs = enclosure_component_attrs, 466 + }; 467 + 468 + static struct attribute_group *enclosure_groups[] = { 469 + &enclosure_group, 470 + NULL 505 471 }; 506 472 507 473 static int __init enclosure_init(void) ··· 519 469 err = class_register(&enclosure_class); 520 470 if (err) 521 471 return err; 522 - err = class_register(&enclosure_component_class); 523 - if (err) 524 - goto err_out; 525 472 526 473 return 0; 527 - err_out: 528 - class_unregister(&enclosure_class); 529 - 530 - return err; 531 474 } 532 475 533 476 static void __exit enclosure_exit(void) 534 477 { 535 - class_unregister(&enclosure_component_class); 536 478 class_unregister(&enclosure_class); 537 479 } 538 480
+21 -18
drivers/s390/scsi/zfcp_fsf.c
··· 1927 1927 1928 1928 /* setup new FSF request */ 1929 1929 retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA, 1930 - 0, NULL, &lock_flags, &fsf_req); 1930 + ZFCP_WAIT_FOR_SBAL, NULL, &lock_flags, 1931 + &fsf_req); 1931 1932 if (retval) { 1932 1933 ZFCP_LOG_INFO("error: Could not create exchange configuration " 1933 1934 "data request for adapter %s.\n", ··· 2036 2035 min(FC_SERIAL_NUMBER_SIZE, 17)); 2037 2036 } 2038 2037 2039 - ZFCP_LOG_NORMAL("The adapter %s reported the following " 2040 - "characteristics:\n" 2041 - "WWNN 0x%016Lx, " 2042 - "WWPN 0x%016Lx, " 2043 - "S_ID 0x%06x,\n" 2044 - "adapter version 0x%x, " 2045 - "LIC version 0x%x, " 2046 - "FC link speed %d Gb/s\n", 2047 - zfcp_get_busid_by_adapter(adapter), 2048 - (wwn_t) fc_host_node_name(shost), 2049 - (wwn_t) fc_host_port_name(shost), 2050 - fc_host_port_id(shost), 2051 - adapter->hydra_version, 2052 - adapter->fsf_lic_version, 2053 - fc_host_speed(shost)); 2038 + if (fsf_req->erp_action) 2039 + ZFCP_LOG_NORMAL("The adapter %s reported the following " 2040 + "characteristics:\n" 2041 + "WWNN 0x%016Lx, WWPN 0x%016Lx, " 2042 + "S_ID 0x%06x,\n" 2043 + "adapter version 0x%x, " 2044 + "LIC version 0x%x, " 2045 + "FC link speed %d Gb/s\n", 2046 + zfcp_get_busid_by_adapter(adapter), 2047 + (wwn_t) fc_host_node_name(shost), 2048 + (wwn_t) fc_host_port_name(shost), 2049 + fc_host_port_id(shost), 2050 + adapter->hydra_version, 2051 + adapter->fsf_lic_version, 2052 + fc_host_speed(shost)); 2054 2053 if (ZFCP_QTCB_VERSION < bottom->low_qtcb_version) { 2055 2054 ZFCP_LOG_NORMAL("error: the adapter %s " 2056 2055 "only supports newer control block " ··· 2115 2114 zfcp_erp_adapter_shutdown(adapter, 0, 127, fsf_req); 2116 2115 return -EIO; 2117 2116 case FC_PORTTYPE_NPORT: 2118 - ZFCP_LOG_NORMAL("Switched fabric fibrechannel " 2119 - "network detected at adapter %s.\n", 2117 + if (fsf_req->erp_action) 2118 + ZFCP_LOG_NORMAL("Switched fabric fibrechannel " 2119 + "network detected at adapter " 2120 + "%s.\n", 2120 2121 zfcp_get_busid_by_adapter(adapter)); 2121 2122 break; 2122 2123 default:
+16 -2
drivers/s390/scsi/zfcp_fsf.h
··· 213 213 #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 214 214 #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 215 215 #define FSF_FEATURE_UPDATE_ALERT 0x00000100 216 + #define FSF_FEATURE_MEASUREMENT_DATA 0x00000200 216 217 217 218 /* host connection features */ 218 219 #define FSF_FEATURE_NPIV_MODE 0x00000001 ··· 341 340 u8 res1[20]; 342 341 } __attribute__ ((packed)); 343 342 343 + struct fsf_statistics_info { 344 + u64 input_req; 345 + u64 output_req; 346 + u64 control_req; 347 + u64 input_mb; 348 + u64 output_mb; 349 + u64 seconds_act; 350 + } __attribute__ ((packed)); 351 + 344 352 union fsf_status_qual { 345 353 u8 byte[FSF_STATUS_QUALIFIER_SIZE]; 346 354 u16 halfword[FSF_STATUS_QUALIFIER_SIZE / sizeof (u16)]; ··· 446 436 u32 hardware_version; 447 437 u8 serial_number[32]; 448 438 struct fsf_nport_serv_param plogi_payload; 449 - u8 res4[160]; 439 + struct fsf_statistics_info stat_info; 440 + u8 res4[112]; 450 441 } __attribute__ ((packed)); 451 442 452 443 struct fsf_qtcb_bottom_port { ··· 480 469 u64 control_requests; 481 470 u64 input_mb; /* where 1 MByte == 1.000.000 Bytes */ 482 471 u64 output_mb; /* where 1 MByte == 1.000.000 Bytes */ 483 - u8 res2[256]; 472 + u8 cp_util; 473 + u8 cb_util; 474 + u8 a_util; 475 + u8 res2[253]; 484 476 } __attribute__ ((packed)); 485 477 486 478 union fsf_qtcb_bottom {
+114
drivers/s390/scsi/zfcp_scsi.c
··· 40 40 unsigned int, unsigned int); 41 41 42 42 static struct device_attribute *zfcp_sysfs_sdev_attrs[]; 43 + static struct device_attribute *zfcp_a_stats_attrs[]; 43 44 44 45 struct zfcp_data zfcp_data = { 45 46 .scsi_host_template = { ··· 62 61 .use_clustering = 1, 63 62 .sdev_attrs = zfcp_sysfs_sdev_attrs, 64 63 .max_sectors = ZFCP_MAX_SECTORS, 64 + .shost_attrs = zfcp_a_stats_attrs, 65 65 }, 66 66 .driver_version = ZFCP_VERSION, 67 67 }; ··· 808 806 &dev_attr_fcp_lun, 809 807 &dev_attr_wwpn, 810 808 &dev_attr_hba_id, 809 + NULL 810 + }; 811 + 812 + static ssize_t zfcp_sysfs_adapter_util_show(struct device *dev, 813 + struct device_attribute *attr, 814 + char *buf) 815 + { 816 + struct Scsi_Host *scsi_host = dev_to_shost(dev); 817 + struct fsf_qtcb_bottom_port *qtcb_port; 818 + int retval; 819 + struct zfcp_adapter *adapter; 820 + 821 + adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; 822 + if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) 823 + return -EOPNOTSUPP; 824 + 825 + qtcb_port = kzalloc(sizeof(struct fsf_qtcb_bottom_port), GFP_KERNEL); 826 + if (!qtcb_port) 827 + return -ENOMEM; 828 + 829 + retval = zfcp_fsf_exchange_port_data_sync(adapter, qtcb_port); 830 + if (!retval) 831 + retval = sprintf(buf, "%u %u %u\n", qtcb_port->cp_util, 832 + qtcb_port->cb_util, qtcb_port->a_util); 833 + kfree(qtcb_port); 834 + return retval; 835 + } 836 + 837 + static int zfcp_sysfs_adapter_ex_config(struct device *dev, 838 + struct fsf_statistics_info *stat_inf) 839 + { 840 + int retval; 841 + struct fsf_qtcb_bottom_config *qtcb_config; 842 + struct Scsi_Host *scsi_host = dev_to_shost(dev); 843 + struct zfcp_adapter *adapter; 844 + 845 + adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; 846 + if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) 847 + return -EOPNOTSUPP; 848 + 849 + qtcb_config = kzalloc(sizeof(struct fsf_qtcb_bottom_config), 850 + GFP_KERNEL); 851 + if (!qtcb_config) 852 + return -ENOMEM; 853 + 854 + retval = zfcp_fsf_exchange_config_data_sync(adapter, qtcb_config); 855 + if (!retval) 856 + *stat_inf = qtcb_config->stat_info; 857 + 858 + kfree(qtcb_config); 859 + return retval; 860 + } 861 + 862 + static ssize_t zfcp_sysfs_adapter_request_show(struct device *dev, 863 + struct device_attribute *attr, 864 + char *buf) 865 + { 866 + struct fsf_statistics_info stat_info; 867 + int retval; 868 + 869 + retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info); 870 + if (retval) 871 + return retval; 872 + 873 + return sprintf(buf, "%llu %llu %llu\n", 874 + (unsigned long long) stat_info.input_req, 875 + (unsigned long long) stat_info.output_req, 876 + (unsigned long long) stat_info.control_req); 877 + } 878 + 879 + static ssize_t zfcp_sysfs_adapter_mb_show(struct device *dev, 880 + struct device_attribute *attr, 881 + char *buf) 882 + { 883 + struct fsf_statistics_info stat_info; 884 + int retval; 885 + 886 + retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info); 887 + if (retval) 888 + return retval; 889 + 890 + return sprintf(buf, "%llu %llu\n", 891 + (unsigned long long) stat_info.input_mb, 892 + (unsigned long long) stat_info.output_mb); 893 + } 894 + 895 + static ssize_t zfcp_sysfs_adapter_sec_active_show(struct device *dev, 896 + struct device_attribute *attr, 897 + char *buf) 898 + { 899 + struct fsf_statistics_info stat_info; 900 + int retval; 901 + 902 + retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info); 903 + if (retval) 904 + return retval; 905 + 906 + return sprintf(buf, "%llu\n", 907 + (unsigned long long) stat_info.seconds_act); 908 + } 909 + 910 + static DEVICE_ATTR(utilization, S_IRUGO, zfcp_sysfs_adapter_util_show, NULL); 911 + static DEVICE_ATTR(requests, S_IRUGO, zfcp_sysfs_adapter_request_show, NULL); 912 + static DEVICE_ATTR(megabytes, S_IRUGO, zfcp_sysfs_adapter_mb_show, NULL); 913 + static DEVICE_ATTR(seconds_active, S_IRUGO, 914 + zfcp_sysfs_adapter_sec_active_show, NULL); 915 + 916 + static struct device_attribute *zfcp_a_stats_attrs[] = { 917 + &dev_attr_utilization, 918 + &dev_attr_requests, 919 + &dev_attr_megabytes, 920 + &dev_attr_seconds_active, 811 921 NULL 812 922 }; 813 923
+1 -1
drivers/scsi/FlashPoint.c
··· 1499 1499 thisCard = ((struct sccb_card *)pCurrCard)->cardIndex; 1500 1500 ioport = ((struct sccb_card *)pCurrCard)->ioPort; 1501 1501 1502 - if ((p_Sccb->TargID > MAX_SCSI_TAR) || (p_Sccb->Lun > MAX_LUN)) { 1502 + if ((p_Sccb->TargID >= MAX_SCSI_TAR) || (p_Sccb->Lun >= MAX_LUN)) { 1503 1503 1504 1504 p_Sccb->HostStatus = SCCB_COMPLETE; 1505 1505 p_Sccb->SccbStatus = SCCB_ERROR;
+10
drivers/scsi/Kconfig
··· 1677 1677 SCSI-HOWTO, available from 1678 1678 <http://www.tldp.org/docs.html#howto>. 1679 1679 1680 + config SCSI_MAC_ESP 1681 + tristate "Macintosh NCR53c9[46] SCSI" 1682 + depends on MAC && SCSI 1683 + help 1684 + This is the NCR 53c9x SCSI controller found on most of the 68040 1685 + based Macintoshes. 1686 + 1687 + To compile this driver as a module, choose M here: the module 1688 + will be called mac_esp. 1689 + 1680 1690 config MVME147_SCSI 1681 1691 bool "WD33C93 SCSI driver for MVME147" 1682 1692 depends on MVME147 && SCSI=y
+1
drivers/scsi/Makefile
··· 46 46 obj-$(CONFIG_SGIWD93_SCSI) += sgiwd93.o wd33c93.o 47 47 obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o 48 48 obj-$(CONFIG_MAC_SCSI) += mac_scsi.o 49 + obj-$(CONFIG_SCSI_MAC_ESP) += esp_scsi.o mac_esp.o 49 50 obj-$(CONFIG_SUN3_SCSI) += sun3_scsi.o sun3_scsi_vme.o 50 51 obj-$(CONFIG_MVME16x_SCSI) += 53c700.o mvme16x_scsi.o 51 52 obj-$(CONFIG_BVME6000_SCSI) += 53c700.o bvme6000_scsi.o
+1 -6
drivers/scsi/aha152x.c
··· 1432 1432 */ 1433 1433 static irqreturn_t intr(int irqno, void *dev_id) 1434 1434 { 1435 - struct Scsi_Host *shpnt = (struct Scsi_Host *)dev_id; 1435 + struct Scsi_Host *shpnt = dev_id; 1436 1436 unsigned long flags; 1437 1437 unsigned char rev, dmacntrl0; 1438 - 1439 - if (!shpnt) { 1440 - printk(KERN_ERR "aha152x: catched interrupt %d for unknown controller.\n", irqno); 1441 - return IRQ_NONE; 1442 - } 1443 1438 1444 1439 /* 1445 1440 * Read a couple of registers that are known to not be all 1's. If
+10 -16
drivers/scsi/aha1542.c
··· 153 153 154 154 #define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata) 155 155 156 - static struct Scsi_Host *aha_host[7]; /* One for each IRQ level (9-15) */ 157 - 158 156 static DEFINE_SPINLOCK(aha1542_lock); 159 157 160 158 ··· 161 163 162 164 static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt); 163 165 static int aha1542_restart(struct Scsi_Host *shost); 164 - static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id); 165 - static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id); 166 + static void aha1542_intr_handle(struct Scsi_Host *shost); 166 167 167 168 #define aha1542_intr_reset(base) outb(IRST, CONTROL(base)) 168 169 ··· 401 404 } 402 405 403 406 /* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */ 404 - static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id) 407 + static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id) 405 408 { 406 409 unsigned long flags; 407 - struct Scsi_Host *shost; 408 - 409 - shost = aha_host[irq - 9]; 410 - if (!shost) 411 - panic("Splunge!"); 410 + struct Scsi_Host *shost = dev_id; 412 411 413 412 spin_lock_irqsave(shost->host_lock, flags); 414 - aha1542_intr_handle(shost, dev_id); 413 + aha1542_intr_handle(shost); 415 414 spin_unlock_irqrestore(shost->host_lock, flags); 416 415 return IRQ_HANDLED; 417 416 } 418 417 419 418 /* A "high" level interrupt handler */ 420 - static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id) 419 + static void aha1542_intr_handle(struct Scsi_Host *shost) 421 420 { 422 421 void (*my_done) (Scsi_Cmnd *) = NULL; 423 422 int errstatus, mbi, mbo, mbistatus; ··· 1190 1197 1191 1198 DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level)); 1192 1199 spin_lock_irqsave(&aha1542_lock, flags); 1193 - if (request_irq(irq_level, do_aha1542_intr_handle, 0, "aha1542", NULL)) { 1200 + if (request_irq(irq_level, do_aha1542_intr_handle, 0, 1201 + "aha1542", shpnt)) { 1194 1202 printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n"); 1195 1203 spin_unlock_irqrestore(&aha1542_lock, flags); 1196 1204 goto unregister; ··· 1199 1205 if (dma_chan != 0xFF) { 1200 1206 if (request_dma(dma_chan, "aha1542")) { 1201 1207 printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n"); 1202 - free_irq(irq_level, NULL); 1208 + free_irq(irq_level, shpnt); 1203 1209 spin_unlock_irqrestore(&aha1542_lock, flags); 1204 1210 goto unregister; 1205 1211 } ··· 1208 1214 enable_dma(dma_chan); 1209 1215 } 1210 1216 } 1211 - aha_host[irq_level - 9] = shpnt; 1217 + 1212 1218 shpnt->this_id = scsi_id; 1213 1219 shpnt->unique_id = base_io; 1214 1220 shpnt->io_port = base_io; ··· 1270 1276 static int aha1542_release(struct Scsi_Host *shost) 1271 1277 { 1272 1278 if (shost->irq) 1273 - free_irq(shost->irq, NULL); 1279 + free_irq(shost->irq, shost); 1274 1280 if (shost->dma_channel != 0xff) 1275 1281 free_dma(shost->dma_channel); 1276 1282 if (shost->io_port && shost->n_io_port)
+6 -17
drivers/scsi/aic7xxx/aic79xx.h
··· 815 815 struct ahd_phase_table_entry { 816 816 uint8_t phase; 817 817 uint8_t mesg_out; /* Message response to parity errors */ 818 - char *phasemsg; 818 + const char *phasemsg; 819 819 }; 820 820 821 821 /************************** Serial EEPROM Format ******************************/ ··· 1314 1314 struct ahd_pci_identity { 1315 1315 uint64_t full_id; 1316 1316 uint64_t id_mask; 1317 - char *name; 1317 + const char *name; 1318 1318 ahd_device_setup_t *setup; 1319 1319 }; 1320 1320 ··· 1322 1322 struct aic7770_identity { 1323 1323 uint32_t full_id; 1324 1324 uint32_t id_mask; 1325 - char *name; 1325 + const char *name; 1326 1326 ahd_device_setup_t *setup; 1327 1327 }; 1328 1328 extern struct aic7770_identity aic7770_ident_table []; ··· 1333 1333 1334 1334 /*************************** Function Declarations ****************************/ 1335 1335 /******************************************************************************/ 1336 - void ahd_reset_cmds_pending(struct ahd_softc *ahd); 1337 1336 1338 1337 /***************************** PCI Front End *********************************/ 1339 - struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); 1338 + const struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); 1340 1339 int ahd_pci_config(struct ahd_softc *, 1341 - struct ahd_pci_identity *); 1340 + const struct ahd_pci_identity *); 1342 1341 int ahd_pci_test_register_access(struct ahd_softc *); 1343 1342 #ifdef CONFIG_PM 1344 1343 void ahd_pci_suspend(struct ahd_softc *); ··· 1374 1375 u_int addr, u_int value); 1375 1376 int ahd_read_flexport(struct ahd_softc *ahd, u_int addr, 1376 1377 uint8_t *value); 1377 - 1378 - /*************************** Interrupt Services *******************************/ 1379 - void ahd_run_qoutfifo(struct ahd_softc *ahd); 1380 - #ifdef AHD_TARGET_MODE 1381 - void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); 1382 - #endif 1383 - void ahd_handle_hwerrint(struct ahd_softc *ahd); 1384 - void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); 1385 - void ahd_handle_scsiint(struct ahd_softc *ahd, 1386 - u_int intstat); 1387 1378 1388 1379 /***************************** Error Recovery *********************************/ 1389 1380 typedef enum { ··· 1468 1479 void ahd_print_devinfo(struct ahd_softc *ahd, 1469 1480 struct ahd_devinfo *devinfo); 1470 1481 void ahd_dump_card_state(struct ahd_softc *ahd); 1471 - int ahd_print_register(ahd_reg_parse_entry_t *table, 1482 + int ahd_print_register(const ahd_reg_parse_entry_t *table, 1472 1483 u_int num_entries, 1473 1484 const char *name, 1474 1485 u_int address,
+107 -8
drivers/scsi/aic7xxx/aic79xx.reg
··· 198 198 register CLRINT { 199 199 address 0x003 200 200 access_mode WO 201 + count 19 201 202 field CLRHWERRINT 0x80 /* Rev B or greater */ 202 203 field CLRBRKADRINT 0x40 203 204 field CLRSWTMINT 0x20 ··· 246 245 register HCNTRL { 247 246 address 0x005 248 247 access_mode RW 248 + count 12 249 249 field SEQ_RESET 0x80 /* Rev B or greater */ 250 250 field POWRDN 0x40 251 251 field SWINT 0x10 ··· 264 262 address 0x006 265 263 access_mode RW 266 264 size 2 265 + count 2 267 266 } 268 267 269 268 /* ··· 273 270 register HESCB_QOFF { 274 271 address 0x008 275 272 access_mode RW 273 + count 2 276 274 } 277 275 278 276 /* ··· 291 287 */ 292 288 register SEQINTSTAT { 293 289 address 0x00C 290 + count 1 294 291 access_mode RO 295 292 field SEQ_SWTMRTO 0x10 296 293 field SEQ_SEQINT 0x08 ··· 337 332 */ 338 333 register SESCB_QOFF { 339 334 address 0x012 335 + count 2 340 336 access_mode RW 341 337 modes M_CCHAN 342 338 } ··· 403 397 address 0x019 404 398 access_mode RW 405 399 modes M_DFF0, M_DFF1 400 + count 11 406 401 field PRELOADEN 0x80 407 402 field SCSIENWRDIS 0x40 /* Rev B only. */ 408 403 field SCSIEN 0x20 ··· 422 415 */ 423 416 register DSCOMMAND0 { 424 417 address 0x019 418 + count 1 425 419 access_mode RW 426 420 modes M_CFG 427 421 field CACHETHEN 0x80 /* Cache Threshold enable */ ··· 588 580 address 0x088 589 581 access_mode RW 590 582 modes M_CFG 583 + count 1 591 584 field WR_DFTHRSH 0x70 { 592 585 WR_DFTHRSH_MIN, 593 586 WR_DFTHRSH_25, ··· 809 800 address 0x093 810 801 access_mode RW 811 802 modes M_CFG 803 + count 1 812 804 field SERRPULSE 0x80 813 805 field UNEXPSCIEN 0x20 814 806 field SPLTSMADIS 0x10 ··· 854 844 address 0x096 855 845 access_mode RW 856 846 modes M_DFF0, M_DFF1 847 + count 2 857 848 field STAETERM 0x80 858 849 field SCBCERR 0x40 859 850 field SCADERR 0x20 ··· 906 895 address 0x097 907 896 access_mode RW 908 897 modes M_DFF0, M_DFF1 898 + count 2 909 899 field RXDATABUCKET 0x01 910 900 } 911 901 ··· 1060 1048 address 0x09E 1061 1049 access_mode RW 1062 1050 modes M_DFF0, M_DFF1 1051 + count 2 1063 1052 field STAETERM 0x80 1064 1053 field SCBCERR 0x40 1065 1054 field SCADERR 0x20 ··· 1078 1065 address 0x09F 1079 1066 access_mode RW 1080 1067 modes M_DFF0, M_DFF1 1068 + count 2 1081 1069 field RXDATABUCKET 0x01 1082 1070 } 1083 1071 ··· 1100 1086 address 0x0A0 1101 1087 access_mode RW 1102 1088 modes M_CFG 1089 + count 1 1103 1090 field DPE 0x80 1104 1091 field SSE 0x40 1105 1092 field RMA 0x20 ··· 1199 1184 address 0x0A7 1200 1185 access_mode RW 1201 1186 modes M_CFG 1187 + count 5 1202 1188 field DPE 0x80 1203 1189 field SSE 0x40 1204 1190 field STA 0x08 ··· 1214 1198 address 0x020 1215 1199 access_mode RW 1216 1200 size 20 1201 + count 2 1217 1202 modes M_DFF0, M_DFF1, M_SCSI 1218 1203 } 1219 1204 ··· 1246 1229 address 0x022 1247 1230 access_mode RW 1248 1231 modes M_CFG 1232 + count 2 1249 1233 } 1250 1234 1251 1235 /* ··· 1277 1259 address 0x025 1278 1260 access_mode RW 1279 1261 modes M_CFG 1262 + count 1 1280 1263 } 1281 1264 1282 1265 /* ··· 1289 1270 address 0x026 1290 1271 access_mode RW 1291 1272 modes M_CFG 1273 + count 1 1292 1274 } 1293 1275 1294 1276 /* ··· 1301 1281 address 0x027 1302 1282 access_mode RW 1303 1283 modes M_CFG 1284 + count 1 1304 1285 } 1305 1286 1306 1287 /* ··· 1312 1291 address 0x028 1313 1292 access_mode RW 1314 1293 modes M_CFG 1294 + count 1 1315 1295 } 1316 1296 1317 1297 /* ··· 1323 1301 address 0x029 1324 1302 access_mode RW 1325 1303 modes M_CFG 1304 + count 1 1326 1305 } 1327 1306 1328 1307 /* ··· 1346 1323 address 0x02B 1347 1324 access_mode RW 1348 1325 modes M_CFG 1326 + count 1 1349 1327 } 1350 1328 1351 1329 /* ··· 1357 1333 address 0x02C 1358 1334 access_mode RW 1359 1335 modes M_CFG 1336 + count 1 1360 1337 } 1361 1338 1362 1339 /* ··· 1395 1370 address 0x030 1396 1371 access_mode RW 1397 1372 modes M_CFG 1373 + count 2 1398 1374 mask ILUNLEN 0x0F 1399 1375 mask TLUNLEN 0xF0 1400 1376 } ··· 1409 1383 address 0x031 1410 1384 access_mode RW 1411 1385 modes M_CFG 1386 + count 1 1412 1387 } 1413 1388 1414 1389 /* ··· 1421 1394 address 0x032 1422 1395 access_mode RW 1423 1396 modes M_CFG 1397 + count 9 1424 1398 } 1425 1399 1426 1400 /* ··· 1486 1458 address 0x038 1487 1459 access_mode RW 1488 1460 modes M_DFF0, M_DFF1, M_SCSI 1461 + count 2 1489 1462 field PCI2PCI 0x04 1490 1463 field SINGLECMD 0x02 1491 1464 field ABORTPENDING 0x01 ··· 1499 1470 address 0x039 1500 1471 access_mode RW 1501 1472 modes M_DFF0, M_DFF1, M_SCSI 1473 + count 5 1502 1474 field LQIRETRY 0x80 1503 1475 field LQICONTINUE 0x40 1504 1476 field LQITOIDLE 0x20 ··· 1558 1528 address 0x03B 1559 1529 access_mode RW 1560 1530 modes M_DFF0, M_DFF1, M_SCSI 1531 + count 8 1561 1532 field MANUALCTL 0x40 1562 1533 field ENSELI 0x20 1563 1534 field ENRSELI 0x10 ··· 1698 1667 } 1699 1668 } 1700 1669 1670 + /* 1671 + * SCSI Control Signal In 1672 + */ 1701 1673 register SCSISIGI { 1702 1674 address 0x041 1703 1675 access_mode RO ··· 1737 1703 access_mode RW 1738 1704 modes M_CFG 1739 1705 size 2 1706 + count 2 1740 1707 } 1741 1708 1742 1709 /* ··· 1793 1758 address 0x048 1794 1759 access_mode RO 1795 1760 modes M_DFF0, M_DFF1, M_SCSI 1761 + count 2 1796 1762 field CLKOUT 0x80 1797 1763 field TARGID 0x0F 1798 1764 } ··· 1834 1798 address 0x04A 1835 1799 access_mode RW 1836 1800 modes M_CFG 1801 + count 4 1837 1802 field BIOSCANCTL 0x80 1838 1803 field AUTOACKEN 0x40 1839 1804 field BIASCANCTL 0x20 ··· 1887 1850 address 0x04B 1888 1851 access_mode RW 1889 1852 modes M_CFG 1853 + count 8 1890 1854 field ENSELDO 0x40 1891 1855 field ENSELDI 0x20 1892 1856 field ENSELINGO 0x10 ··· 1983 1945 address 0x04E 1984 1946 access_mode RO 1985 1947 modes M_DFF0, M_DFF1, M_SCSI 1948 + count 3 1986 1949 field HIZERO 0x80 1987 1950 field HIPERR 0x40 1988 1951 field PREVPHASE 0x20 ··· 2001 1962 address 0x04E 2002 1963 access_mode RO 2003 1964 modes M_CFG 1965 + count 6 2004 1966 } 2005 1967 2006 1968 /* ··· 2011 1971 address 0x04F 2012 1972 access_mode RO 2013 1973 modes M_DFF0, M_DFF1, M_SCSI 1974 + count 1 2014 1975 } 2015 1976 2016 1977 /* ··· 2021 1980 address 0x04F 2022 1981 access_mode RO 2023 1982 modes M_CFG 1983 + count 2 2024 1984 } 2025 1985 2026 1986 /* ··· 2031 1989 address 0x050 2032 1990 access_mode RO 2033 1991 modes M_DFF0, M_DFF1, M_SCSI 1992 + count 2 2034 1993 field LQIATNQAS 0x20 2035 1994 field LQICRCT1 0x10 2036 1995 field LQICRCT2 0x08 ··· 2047 2004 address 0x050 2048 2005 access_mode WO 2049 2006 modes M_DFF0, M_DFF1, M_SCSI 2007 + count 1 2050 2008 field CLRLQIATNQAS 0x20 2051 2009 field CLRLQICRCT1 0x10 2052 2010 field CLRLQICRCT2 0x08 ··· 2063 2019 address 0x050 2064 2020 access_mode RW 2065 2021 modes M_CFG 2022 + count 3 2066 2023 field ENLQIATNQASK 0x20 2067 2024 field ENLQICRCT1 0x10 2068 2025 field ENLQICRCT2 0x08 ··· 2079 2034 address 0x051 2080 2035 access_mode RO 2081 2036 modes M_DFF0, M_DFF1, M_SCSI 2037 + count 3 2082 2038 field LQIPHASE_LQ 0x80 2083 2039 field LQIPHASE_NLQ 0x40 2084 2040 field LQIABORT 0x20 ··· 2097 2051 address 0x051 2098 2052 access_mode WO 2099 2053 modes M_DFF0, M_DFF1, M_SCSI 2054 + count 4 2100 2055 field CLRLQIPHASE_LQ 0x80 2101 2056 field CLRLQIPHASE_NLQ 0x40 2102 2057 field CLRLIQABORT 0x20 ··· 2115 2068 address 0x051 2116 2069 access_mode RW 2117 2070 modes M_CFG 2071 + count 4 2118 2072 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */ 2119 2073 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */ 2120 2074 field ENLIQABORT 0x20 ··· 2150 2102 address 0x053 2151 2103 access_mode RO 2152 2104 modes M_DFF0, M_DFF1, M_SCSI 2105 + count 3 2153 2106 field NTRAMPERR 0x02 2154 2107 field OSRAMPERR 0x01 2155 2108 } ··· 2162 2113 address 0x053 2163 2114 access_mode WO 2164 2115 modes M_DFF0, M_DFF1, M_SCSI 2116 + count 3 2165 2117 field CLRNTRAMPERR 0x02 2166 2118 field CLROSRAMPERR 0x01 2167 2119 } ··· 2174 2124 address 0x053 2175 2125 access_mode RW 2176 2126 modes M_CFG 2127 + count 4 2177 2128 field ENNTRAMPERR 0x02 2178 2129 field ENOSRAMPERR 0x01 2179 2130 } ··· 2186 2135 address 0x054 2187 2136 access_mode RO 2188 2137 modes M_DFF0, M_DFF1, M_SCSI 2138 + count 2 2189 2139 field LQOTARGSCBPERR 0x10 2190 2140 field LQOSTOPT2 0x08 2191 2141 field LQOATNLQ 0x04 ··· 2201 2149 address 0x054 2202 2150 access_mode WO 2203 2151 modes M_DFF0, M_DFF1, M_SCSI 2152 + count 3 2204 2153 field CLRLQOTARGSCBPERR 0x10 2205 2154 field CLRLQOSTOPT2 0x08 2206 2155 field CLRLQOATNLQ 0x04 ··· 2216 2163 address 0x054 2217 2164 access_mode RW 2218 2165 modes M_CFG 2166 + count 4 2219 2167 field ENLQOTARGSCBPERR 0x10 2220 2168 field ENLQOSTOPT2 0x08 2221 2169 field ENLQOATNLQ 0x04 ··· 2245 2191 address 0x055 2246 2192 access_mode WO 2247 2193 modes M_DFF0, M_DFF1, M_SCSI 2194 + count 7 2248 2195 field CLRLQOINITSCBPERR 0x10 2249 2196 field CLRLQOSTOPI2 0x08 2250 2197 field CLRLQOBADQAS 0x04 ··· 2260 2205 address 0x055 2261 2206 access_mode RW 2262 2207 modes M_CFG 2208 + count 4 2263 2209 field ENLQOINITSCBPERR 0x10 2264 2210 field ENLQOSTOPI2 0x08 2265 2211 field ENLQOBADQAS 0x04 ··· 2288 2232 address 0x056 2289 2233 access_mode RO 2290 2234 modes M_CFG 2235 + count 2 2291 2236 } 2292 2237 2293 2238 /* ··· 2343 2286 modes M_SCSI 2344 2287 } 2345 2288 2346 - /* Rev B only. */ 2289 + /* 2290 + * LQO SCSI Control 2291 + * (Rev B only.) 2292 + */ 2347 2293 register LQOSCSCTL { 2348 2294 address 0x05A 2349 2295 access_mode RW 2350 2296 size 1 2351 2297 modes M_CFG 2298 + count 1 2352 2299 field LQOH2A_VERSION 0x80 2300 + field LQOBUSETDLY 0x40 2301 + field LQONOHOLDLACK 0x02 2353 2302 field LQONOCHKOVER 0x01 2354 2303 } 2355 2304 ··· 2522 2459 address 0x061 2523 2460 access_mode RW 2524 2461 modes M_SCSI 2462 + count 1 2525 2463 } 2526 2464 2527 2465 /* ··· 2542 2478 address 0x062 2543 2479 access_mode RW 2544 2480 modes M_SCSI 2481 + count 1 2545 2482 } 2546 2483 2547 2484 /* ··· 2552 2487 address 0x063 2553 2488 access_mode RW 2554 2489 modes M_SCSI 2490 + count 1 2555 2491 field PPROPT_PACE 0x08 2556 2492 field PPROPT_QAS 0x04 2557 2493 field PPROPT_DT 0x02 ··· 2582 2516 address 0x065 2583 2517 access_mode RW 2584 2518 modes M_SCSI 2519 + count 7 2585 2520 } 2586 2521 2522 + /* 2523 + * SCSI Check 2524 + * (Rev. B only) 2525 + */ 2587 2526 register SCSCHKN { 2588 2527 address 0x066 2589 2528 access_mode RW 2590 2529 modes M_CFG 2530 + count 1 2531 + field BIDICHKDIS 0x80 2591 2532 field STSELSKIDDIS 0x40 2592 2533 field CURRFIFODEF 0x20 2593 2534 field WIDERESEN 0x10 ··· 2634 2561 address 0x066 2635 2562 access_mode RW 2636 2563 modes M_SCSI 2564 + count 3 2637 2565 } 2638 2566 2639 2567 /* ··· 2670 2596 address 0x069 2671 2597 access_mode RW 2672 2598 modes M_SCSI 2599 + count 2 2673 2600 } 2674 2601 2675 2602 /* ··· 2812 2737 address 0x0AB 2813 2738 access_mode RW 2814 2739 modes M_CFG 2740 + count 1 2815 2741 field AUSCBPTR_EN 0x80 2816 2742 field SCBPTR_ADDR 0x38 2817 2743 field SCBPTR_OFF 0x07 ··· 2957 2881 address 0x0B8 2958 2882 access_mode RW 2959 2883 modes M_SCSI 2884 + count 2 2960 2885 } 2961 2886 2962 2887 /* ··· 2967 2890 address 0x0B9 2968 2891 access_mode RW 2969 2892 modes M_SCSI 2893 + count 7 2970 2894 field FLXARBACK 0x80 2971 2895 field FLXARBREQ 0x40 2972 2896 field BRDADDR 0x38 ··· 2983 2905 address 0x0BA 2984 2906 access_mode RW 2985 2907 modes M_SCSI 2908 + count 4 2986 2909 } 2987 2910 2988 2911 /* ··· 2994 2915 access_mode RW 2995 2916 size 2 2996 2917 modes M_SCSI 2918 + count 4 2997 2919 } 2998 2920 2999 2921 /* ··· 3004 2924 address 0x0BE 3005 2925 access_mode RO 3006 2926 modes M_SCSI 2927 + count 1 3007 2928 field INIT_DONE 0x80 3008 2929 field SEEOPCODE 0x70 3009 2930 field LDALTID_L 0x08 ··· 3020 2939 address 0x0BE 3021 2940 access_mode RW 3022 2941 modes M_SCSI 2942 + count 4 3023 2943 field SEEOPCODE 0x70 { 3024 2944 SEEOP_ERASE 0x70, 3025 2945 SEEOP_READ 0x60, ··· 3082 3000 address 0x0C1 3083 3001 access_mode RW 3084 3002 modes M_CFG 3003 + count 3 3085 3004 field BYPASSENAB 0x80 3086 3005 field DESQDIS 0x10 3087 3006 field RCVROFFSTDIS 0x04 ··· 3141 3058 address 0x0C4 3142 3059 access_mode RW 3143 3060 modes M_CFG 3061 + count 1 3144 3062 field AUTOINCEN 0x80 3145 3063 field DSPSEL 0x1F 3146 3064 } ··· 3155 3071 address 0x0C5 3156 3072 access_mode WO 3157 3073 modes M_CFG 3074 + count 3 3158 3075 field AUTOXBCDIS 0x80 3159 3076 field XMITMANVAL 0x3F 3160 3077 } ··· 3281 3196 */ 3282 3197 register SEQCTL0 { 3283 3198 address 0x0D6 3284 - access_mode RW 3199 + access_mode RW 3200 + count 11 3285 3201 field PERRORDIS 0x80 3286 3202 field PAUSEDIS 0x40 3287 3203 field FAILDIS 0x20 ··· 3312 3226 */ 3313 3227 register FLAGS { 3314 3228 address 0x0D8 3315 - access_mode RO 3229 + access_mode RO 3230 + count 23 3316 3231 field ZERO 0x02 3317 3232 field CARRY 0x01 3318 3233 } ··· 3342 3255 */ 3343 3256 register SEQRAM { 3344 3257 address 0x0DA 3345 - access_mode RW 3258 + access_mode RW 3259 + count 2 3346 3260 } 3347 3261 3348 3262 /* ··· 3354 3266 address 0x0DE 3355 3267 access_mode RW 3356 3268 size 2 3269 + count 5 3357 3270 } 3358 3271 3359 3272 /* ··· 3362 3273 */ 3363 3274 register ACCUM { 3364 3275 address 0x0E0 3365 - access_mode RW 3276 + access_mode RW 3366 3277 accumulator 3367 3278 } 3368 3279 ··· 3490 3401 access_mode RW 3491 3402 size 2 3492 3403 modes M_CFG 3404 + count 1 3493 3405 } 3494 3406 3495 3407 /* ··· 3502 3412 access_mode RW 3503 3413 size 2 3504 3414 modes M_SCSI 3415 + count 2 3505 3416 } 3506 3417 3507 3418 /* ··· 3514 3423 access_mode RW 3515 3424 size 2 3516 3425 modes M_CFG 3426 + count 1 3517 3427 } 3518 3428 3519 3429 /* ··· 3671 3579 /* Parameters for DMA Logic */ 3672 3580 DMAPARAMS { 3673 3581 size 1 3582 + count 8 3674 3583 field PRELOADEN 0x80 3675 3584 field WIDEODD 0x40 3676 3585 field SCSIEN 0x20 ··· 3741 3648 */ 3742 3649 KERNEL_TQINPOS { 3743 3650 size 1 3651 + count 1 3744 3652 } 3745 - TQINPOS { 3653 + TQINPOS { 3746 3654 size 1 3655 + count 8 3747 3656 } 3748 3657 /* 3749 3658 * Base address of our shared data with the kernel driver in host ··· 3776 3681 } 3777 3682 ARG_2 { 3778 3683 size 1 3684 + count 1 3779 3685 alias RETURN_2 3780 3686 } 3781 3687 ··· 3794 3698 */ 3795 3699 SCSISEQ_TEMPLATE { 3796 3700 size 1 3701 + count 7 3797 3702 field MANUALCTL 0x40 3798 3703 field ENSELI 0x20 3799 3704 field ENRSELI 0x10 ··· 3808 3711 */ 3809 3712 INITIATOR_TAG { 3810 3713 size 1 3714 + count 1 3811 3715 } 3812 3716 3813 3717 SEQ_FLAGS2 { ··· 3875 3777 */ 3876 3778 CMDSIZE_TABLE { 3877 3779 size 8 3780 + count 8 3878 3781 } 3879 3782 /* 3880 3783 * When an SCB with the MK_MESSAGE flag is ··· 3902 3803 /************************* Hardware SCB Definition ****************************/ 3903 3804 scb { 3904 3805 address 0x180 3905 - size 64 3906 - modes 0, 1, 2, 3 3806 + size 64 3807 + modes 0, 1, 2, 3 3907 3808 SCB_RESIDUAL_DATACNT { 3908 3809 size 4 3909 3810 alias SCB_CDB_STORE
+809 -26
drivers/scsi/aic7xxx/aic79xx_core.c
··· 52 52 53 53 54 54 /***************************** Lookup Tables **********************************/ 55 - static char *ahd_chip_names[] = 55 + static const char *const ahd_chip_names[] = 56 56 { 57 57 "NONE", 58 58 "aic7901", ··· 66 66 */ 67 67 struct ahd_hard_error_entry { 68 68 uint8_t errno; 69 - char *errmesg; 69 + const char *errmesg; 70 70 }; 71 71 72 - static struct ahd_hard_error_entry ahd_hard_errors[] = { 72 + static const struct ahd_hard_error_entry ahd_hard_errors[] = { 73 73 { DSCTMOUT, "Discard Timer has timed out" }, 74 74 { ILLOPCODE, "Illegal Opcode in sequencer program" }, 75 75 { SQPARERR, "Sequencer Parity Error" }, ··· 79 79 }; 80 80 static const u_int num_errors = ARRAY_SIZE(ahd_hard_errors); 81 81 82 - static struct ahd_phase_table_entry ahd_phase_table[] = 82 + static const struct ahd_phase_table_entry ahd_phase_table[] = 83 83 { 84 84 { P_DATAOUT, MSG_NOOP, "in Data-out phase" }, 85 85 { P_DATAIN, MSG_INITIATOR_DET_ERR, "in Data-in phase" }, ··· 213 213 #endif 214 214 static void ahd_loadseq(struct ahd_softc *ahd); 215 215 static int ahd_check_patch(struct ahd_softc *ahd, 216 - struct patch **start_patch, 216 + const struct patch **start_patch, 217 217 u_int start_instr, u_int *skip_addr); 218 218 static u_int ahd_resolve_seqaddr(struct ahd_softc *ahd, 219 219 u_int address); ··· 254 254 struct scb *scb); 255 255 static void ahd_handle_scb_status(struct ahd_softc *ahd, 256 256 struct scb *scb); 257 - static struct ahd_phase_table_entry* ahd_lookup_phase_entry(int phase); 257 + static const struct ahd_phase_table_entry* ahd_lookup_phase_entry(int phase); 258 258 static void ahd_shutdown(void *arg); 259 259 static void ahd_update_coalescing_values(struct ahd_softc *ahd, 260 260 u_int timer, ··· 266 266 int target, char channel, int lun, 267 267 u_int tag, role_t role); 268 268 269 - /******************************** Private Inlines *****************************/ 269 + static void ahd_reset_cmds_pending(struct ahd_softc *ahd); 270 270 271 + /*************************** Interrupt Services *******************************/ 272 + static void ahd_run_qoutfifo(struct ahd_softc *ahd); 273 + #ifdef AHD_TARGET_MODE 274 + static void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); 275 + #endif 276 + static void ahd_handle_hwerrint(struct ahd_softc *ahd); 277 + static void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); 278 + static void ahd_handle_scsiint(struct ahd_softc *ahd, 279 + u_int intstat); 280 + 281 + /************************ Sequencer Execution Control *************************/ 282 + void 283 + ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) 284 + { 285 + if (ahd->src_mode == src && ahd->dst_mode == dst) 286 + return; 287 + #ifdef AHD_DEBUG 288 + if (ahd->src_mode == AHD_MODE_UNKNOWN 289 + || ahd->dst_mode == AHD_MODE_UNKNOWN) 290 + panic("Setting mode prior to saving it.\n"); 291 + if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) 292 + printf("%s: Setting mode 0x%x\n", ahd_name(ahd), 293 + ahd_build_mode_state(ahd, src, dst)); 294 + #endif 295 + ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, src, dst)); 296 + ahd->src_mode = src; 297 + ahd->dst_mode = dst; 298 + } 299 + 300 + static void 301 + ahd_update_modes(struct ahd_softc *ahd) 302 + { 303 + ahd_mode_state mode_ptr; 304 + ahd_mode src; 305 + ahd_mode dst; 306 + 307 + mode_ptr = ahd_inb(ahd, MODE_PTR); 308 + #ifdef AHD_DEBUG 309 + if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) 310 + printf("Reading mode 0x%x\n", mode_ptr); 311 + #endif 312 + ahd_extract_mode_state(ahd, mode_ptr, &src, &dst); 313 + ahd_known_modes(ahd, src, dst); 314 + } 315 + 316 + static void 317 + ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode, 318 + ahd_mode dstmode, const char *file, int line) 319 + { 320 + #ifdef AHD_DEBUG 321 + if ((srcmode & AHD_MK_MSK(ahd->src_mode)) == 0 322 + || (dstmode & AHD_MK_MSK(ahd->dst_mode)) == 0) { 323 + panic("%s:%s:%d: Mode assertion failed.\n", 324 + ahd_name(ahd), file, line); 325 + } 326 + #endif 327 + } 328 + 329 + #define AHD_ASSERT_MODES(ahd, source, dest) \ 330 + ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__); 331 + 332 + ahd_mode_state 333 + ahd_save_modes(struct ahd_softc *ahd) 334 + { 335 + if (ahd->src_mode == AHD_MODE_UNKNOWN 336 + || ahd->dst_mode == AHD_MODE_UNKNOWN) 337 + ahd_update_modes(ahd); 338 + 339 + return (ahd_build_mode_state(ahd, ahd->src_mode, ahd->dst_mode)); 340 + } 341 + 342 + void 343 + ahd_restore_modes(struct ahd_softc *ahd, ahd_mode_state state) 344 + { 345 + ahd_mode src; 346 + ahd_mode dst; 347 + 348 + ahd_extract_mode_state(ahd, state, &src, &dst); 349 + ahd_set_modes(ahd, src, dst); 350 + } 351 + 352 + /* 353 + * Determine whether the sequencer has halted code execution. 354 + * Returns non-zero status if the sequencer is stopped. 355 + */ 356 + int 357 + ahd_is_paused(struct ahd_softc *ahd) 358 + { 359 + return ((ahd_inb(ahd, HCNTRL) & PAUSE) != 0); 360 + } 361 + 362 + /* 363 + * Request that the sequencer stop and wait, indefinitely, for it 364 + * to stop. The sequencer will only acknowledge that it is paused 365 + * once it has reached an instruction boundary and PAUSEDIS is 366 + * cleared in the SEQCTL register. The sequencer may use PAUSEDIS 367 + * for critical sections. 368 + */ 369 + void 370 + ahd_pause(struct ahd_softc *ahd) 371 + { 372 + ahd_outb(ahd, HCNTRL, ahd->pause); 373 + 374 + /* 375 + * Since the sequencer can disable pausing in a critical section, we 376 + * must loop until it actually stops. 377 + */ 378 + while (ahd_is_paused(ahd) == 0) 379 + ; 380 + } 381 + 382 + /* 383 + * Allow the sequencer to continue program execution. 384 + * We check here to ensure that no additional interrupt 385 + * sources that would cause the sequencer to halt have been 386 + * asserted. If, for example, a SCSI bus reset is detected 387 + * while we are fielding a different, pausing, interrupt type, 388 + * we don't want to release the sequencer before going back 389 + * into our interrupt handler and dealing with this new 390 + * condition. 391 + */ 392 + void 393 + ahd_unpause(struct ahd_softc *ahd) 394 + { 395 + /* 396 + * Automatically restore our modes to those saved 397 + * prior to the first change of the mode. 398 + */ 399 + if (ahd->saved_src_mode != AHD_MODE_UNKNOWN 400 + && ahd->saved_dst_mode != AHD_MODE_UNKNOWN) { 401 + if ((ahd->flags & AHD_UPDATE_PEND_CMDS) != 0) 402 + ahd_reset_cmds_pending(ahd); 403 + ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode); 404 + } 405 + 406 + if ((ahd_inb(ahd, INTSTAT) & ~CMDCMPLT) == 0) 407 + ahd_outb(ahd, HCNTRL, ahd->unpause); 408 + 409 + ahd_known_modes(ahd, AHD_MODE_UNKNOWN, AHD_MODE_UNKNOWN); 410 + } 411 + 412 + /*********************** Scatter Gather List Handling *************************/ 413 + void * 414 + ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, 415 + void *sgptr, dma_addr_t addr, bus_size_t len, int last) 416 + { 417 + scb->sg_count++; 418 + if (sizeof(dma_addr_t) > 4 419 + && (ahd->flags & AHD_64BIT_ADDRESSING) != 0) { 420 + struct ahd_dma64_seg *sg; 421 + 422 + sg = (struct ahd_dma64_seg *)sgptr; 423 + sg->addr = ahd_htole64(addr); 424 + sg->len = ahd_htole32(len | (last ? AHD_DMA_LAST_SEG : 0)); 425 + return (sg + 1); 426 + } else { 427 + struct ahd_dma_seg *sg; 428 + 429 + sg = (struct ahd_dma_seg *)sgptr; 430 + sg->addr = ahd_htole32(addr & 0xFFFFFFFF); 431 + sg->len = ahd_htole32(len | ((addr >> 8) & 0x7F000000) 432 + | (last ? AHD_DMA_LAST_SEG : 0)); 433 + return (sg + 1); 434 + } 435 + } 436 + 437 + static void 438 + ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb) 439 + { 440 + /* XXX Handle target mode SCBs. */ 441 + scb->crc_retry_count = 0; 442 + if ((scb->flags & SCB_PACKETIZED) != 0) { 443 + /* XXX what about ACA?? It is type 4, but TAG_TYPE == 0x3. */ 444 + scb->hscb->task_attribute = scb->hscb->control & SCB_TAG_TYPE; 445 + } else { 446 + if (ahd_get_transfer_length(scb) & 0x01) 447 + scb->hscb->task_attribute = SCB_XFERLEN_ODD; 448 + else 449 + scb->hscb->task_attribute = 0; 450 + } 451 + 452 + if (scb->hscb->cdb_len <= MAX_CDB_LEN_WITH_SENSE_ADDR 453 + || (scb->hscb->cdb_len & SCB_CDB_LEN_PTR) != 0) 454 + scb->hscb->shared_data.idata.cdb_plus_saddr.sense_addr = 455 + ahd_htole32(scb->sense_busaddr); 456 + } 457 + 458 + static void 459 + ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb) 460 + { 461 + /* 462 + * Copy the first SG into the "current" data ponter area. 463 + */ 464 + if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) { 465 + struct ahd_dma64_seg *sg; 466 + 467 + sg = (struct ahd_dma64_seg *)scb->sg_list; 468 + scb->hscb->dataptr = sg->addr; 469 + scb->hscb->datacnt = sg->len; 470 + } else { 471 + struct ahd_dma_seg *sg; 472 + uint32_t *dataptr_words; 473 + 474 + sg = (struct ahd_dma_seg *)scb->sg_list; 475 + dataptr_words = (uint32_t*)&scb->hscb->dataptr; 476 + dataptr_words[0] = sg->addr; 477 + dataptr_words[1] = 0; 478 + if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) { 479 + uint64_t high_addr; 480 + 481 + high_addr = ahd_le32toh(sg->len) & 0x7F000000; 482 + scb->hscb->dataptr |= ahd_htole64(high_addr << 8); 483 + } 484 + scb->hscb->datacnt = sg->len; 485 + } 486 + /* 487 + * Note where to find the SG entries in bus space. 488 + * We also set the full residual flag which the 489 + * sequencer will clear as soon as a data transfer 490 + * occurs. 491 + */ 492 + scb->hscb->sgptr = ahd_htole32(scb->sg_list_busaddr|SG_FULL_RESID); 493 + } 494 + 495 + static void 496 + ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb) 497 + { 498 + scb->hscb->sgptr = ahd_htole32(SG_LIST_NULL); 499 + scb->hscb->dataptr = 0; 500 + scb->hscb->datacnt = 0; 501 + } 502 + 503 + /************************** Memory mapping routines ***************************/ 504 + static void * 505 + ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr) 506 + { 507 + dma_addr_t sg_offset; 508 + 509 + /* sg_list_phys points to entry 1, not 0 */ 510 + sg_offset = sg_busaddr - (scb->sg_list_busaddr - ahd_sg_size(ahd)); 511 + return ((uint8_t *)scb->sg_list + sg_offset); 512 + } 513 + 514 + static uint32_t 515 + ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg) 516 + { 517 + dma_addr_t sg_offset; 518 + 519 + /* sg_list_phys points to entry 1, not 0 */ 520 + sg_offset = ((uint8_t *)sg - (uint8_t *)scb->sg_list) 521 + - ahd_sg_size(ahd); 522 + 523 + return (scb->sg_list_busaddr + sg_offset); 524 + } 525 + 526 + static void 527 + ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op) 528 + { 529 + ahd_dmamap_sync(ahd, ahd->scb_data.hscb_dmat, 530 + scb->hscb_map->dmamap, 531 + /*offset*/(uint8_t*)scb->hscb - scb->hscb_map->vaddr, 532 + /*len*/sizeof(*scb->hscb), op); 533 + } 534 + 535 + void 536 + ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op) 537 + { 538 + if (scb->sg_count == 0) 539 + return; 540 + 541 + ahd_dmamap_sync(ahd, ahd->scb_data.sg_dmat, 542 + scb->sg_map->dmamap, 543 + /*offset*/scb->sg_list_busaddr - ahd_sg_size(ahd), 544 + /*len*/ahd_sg_size(ahd) * scb->sg_count, op); 545 + } 546 + 547 + static void 548 + ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op) 549 + { 550 + ahd_dmamap_sync(ahd, ahd->scb_data.sense_dmat, 551 + scb->sense_map->dmamap, 552 + /*offset*/scb->sense_busaddr, 553 + /*len*/AHD_SENSE_BUFSIZE, op); 554 + } 555 + 556 + #ifdef AHD_TARGET_MODE 557 + static uint32_t 558 + ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index) 559 + { 560 + return (((uint8_t *)&ahd->targetcmds[index]) 561 + - (uint8_t *)ahd->qoutfifo); 562 + } 563 + #endif 564 + 565 + /*********************** Miscelaneous Support Functions ***********************/ 566 + /* 567 + * Return pointers to the transfer negotiation information 568 + * for the specified our_id/remote_id pair. 569 + */ 570 + struct ahd_initiator_tinfo * 571 + ahd_fetch_transinfo(struct ahd_softc *ahd, char channel, u_int our_id, 572 + u_int remote_id, struct ahd_tmode_tstate **tstate) 573 + { 574 + /* 575 + * Transfer data structures are stored from the perspective 576 + * of the target role. Since the parameters for a connection 577 + * in the initiator role to a given target are the same as 578 + * when the roles are reversed, we pretend we are the target. 579 + */ 580 + if (channel == 'B') 581 + our_id += 8; 582 + *tstate = ahd->enabled_targets[our_id]; 583 + return (&(*tstate)->transinfo[remote_id]); 584 + } 585 + 586 + uint16_t 587 + ahd_inw(struct ahd_softc *ahd, u_int port) 588 + { 589 + /* 590 + * Read high byte first as some registers increment 591 + * or have other side effects when the low byte is 592 + * read. 593 + */ 594 + uint16_t r = ahd_inb(ahd, port+1) << 8; 595 + return r | ahd_inb(ahd, port); 596 + } 597 + 598 + void 599 + ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) 600 + { 601 + /* 602 + * Write low byte first to accomodate registers 603 + * such as PRGMCNT where the order maters. 604 + */ 605 + ahd_outb(ahd, port, value & 0xFF); 606 + ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 607 + } 608 + 609 + uint32_t 610 + ahd_inl(struct ahd_softc *ahd, u_int port) 611 + { 612 + return ((ahd_inb(ahd, port)) 613 + | (ahd_inb(ahd, port+1) << 8) 614 + | (ahd_inb(ahd, port+2) << 16) 615 + | (ahd_inb(ahd, port+3) << 24)); 616 + } 617 + 618 + void 619 + ahd_outl(struct ahd_softc *ahd, u_int port, uint32_t value) 620 + { 621 + ahd_outb(ahd, port, (value) & 0xFF); 622 + ahd_outb(ahd, port+1, ((value) >> 8) & 0xFF); 623 + ahd_outb(ahd, port+2, ((value) >> 16) & 0xFF); 624 + ahd_outb(ahd, port+3, ((value) >> 24) & 0xFF); 625 + } 626 + 627 + uint64_t 628 + ahd_inq(struct ahd_softc *ahd, u_int port) 629 + { 630 + return ((ahd_inb(ahd, port)) 631 + | (ahd_inb(ahd, port+1) << 8) 632 + | (ahd_inb(ahd, port+2) << 16) 633 + | (ahd_inb(ahd, port+3) << 24) 634 + | (((uint64_t)ahd_inb(ahd, port+4)) << 32) 635 + | (((uint64_t)ahd_inb(ahd, port+5)) << 40) 636 + | (((uint64_t)ahd_inb(ahd, port+6)) << 48) 637 + | (((uint64_t)ahd_inb(ahd, port+7)) << 56)); 638 + } 639 + 640 + void 641 + ahd_outq(struct ahd_softc *ahd, u_int port, uint64_t value) 642 + { 643 + ahd_outb(ahd, port, value & 0xFF); 644 + ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 645 + ahd_outb(ahd, port+2, (value >> 16) & 0xFF); 646 + ahd_outb(ahd, port+3, (value >> 24) & 0xFF); 647 + ahd_outb(ahd, port+4, (value >> 32) & 0xFF); 648 + ahd_outb(ahd, port+5, (value >> 40) & 0xFF); 649 + ahd_outb(ahd, port+6, (value >> 48) & 0xFF); 650 + ahd_outb(ahd, port+7, (value >> 56) & 0xFF); 651 + } 652 + 653 + u_int 654 + ahd_get_scbptr(struct ahd_softc *ahd) 655 + { 656 + AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK), 657 + ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK)); 658 + return (ahd_inb(ahd, SCBPTR) | (ahd_inb(ahd, SCBPTR + 1) << 8)); 659 + } 660 + 661 + void 662 + ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr) 663 + { 664 + AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK), 665 + ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK)); 666 + ahd_outb(ahd, SCBPTR, scbptr & 0xFF); 667 + ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF); 668 + } 669 + 670 + #if 0 /* unused */ 671 + static u_int 672 + ahd_get_hnscb_qoff(struct ahd_softc *ahd) 673 + { 674 + return (ahd_inw_atomic(ahd, HNSCB_QOFF)); 675 + } 676 + #endif 677 + 678 + static void 679 + ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value) 680 + { 681 + ahd_outw_atomic(ahd, HNSCB_QOFF, value); 682 + } 683 + 684 + #if 0 /* unused */ 685 + static u_int 686 + ahd_get_hescb_qoff(struct ahd_softc *ahd) 687 + { 688 + return (ahd_inb(ahd, HESCB_QOFF)); 689 + } 690 + #endif 691 + 692 + static void 693 + ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value) 694 + { 695 + ahd_outb(ahd, HESCB_QOFF, value); 696 + } 697 + 698 + static u_int 699 + ahd_get_snscb_qoff(struct ahd_softc *ahd) 700 + { 701 + u_int oldvalue; 702 + 703 + AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 704 + oldvalue = ahd_inw(ahd, SNSCB_QOFF); 705 + ahd_outw(ahd, SNSCB_QOFF, oldvalue); 706 + return (oldvalue); 707 + } 708 + 709 + static void 710 + ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value) 711 + { 712 + AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 713 + ahd_outw(ahd, SNSCB_QOFF, value); 714 + } 715 + 716 + #if 0 /* unused */ 717 + static u_int 718 + ahd_get_sescb_qoff(struct ahd_softc *ahd) 719 + { 720 + AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 721 + return (ahd_inb(ahd, SESCB_QOFF)); 722 + } 723 + #endif 724 + 725 + static void 726 + ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value) 727 + { 728 + AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 729 + ahd_outb(ahd, SESCB_QOFF, value); 730 + } 731 + 732 + #if 0 /* unused */ 733 + static u_int 734 + ahd_get_sdscb_qoff(struct ahd_softc *ahd) 735 + { 736 + AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 737 + return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8)); 738 + } 739 + #endif 740 + 741 + static void 742 + ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value) 743 + { 744 + AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 745 + ahd_outb(ahd, SDSCB_QOFF, value & 0xFF); 746 + ahd_outb(ahd, SDSCB_QOFF+1, (value >> 8) & 0xFF); 747 + } 748 + 749 + u_int 750 + ahd_inb_scbram(struct ahd_softc *ahd, u_int offset) 751 + { 752 + u_int value; 753 + 754 + /* 755 + * Workaround PCI-X Rev A. hardware bug. 756 + * After a host read of SCB memory, the chip 757 + * may become confused into thinking prefetch 758 + * was required. This starts the discard timer 759 + * running and can cause an unexpected discard 760 + * timer interrupt. The work around is to read 761 + * a normal register prior to the exhaustion of 762 + * the discard timer. The mode pointer register 763 + * has no side effects and so serves well for 764 + * this purpose. 765 + * 766 + * Razor #528 767 + */ 768 + value = ahd_inb(ahd, offset); 769 + if ((ahd->bugs & AHD_PCIX_SCBRAM_RD_BUG) != 0) 770 + ahd_inb(ahd, MODE_PTR); 771 + return (value); 772 + } 773 + 774 + u_int 775 + ahd_inw_scbram(struct ahd_softc *ahd, u_int offset) 776 + { 777 + return (ahd_inb_scbram(ahd, offset) 778 + | (ahd_inb_scbram(ahd, offset+1) << 8)); 779 + } 780 + 781 + static uint32_t 782 + ahd_inl_scbram(struct ahd_softc *ahd, u_int offset) 783 + { 784 + return (ahd_inw_scbram(ahd, offset) 785 + | (ahd_inw_scbram(ahd, offset+2) << 16)); 786 + } 787 + 788 + static uint64_t 789 + ahd_inq_scbram(struct ahd_softc *ahd, u_int offset) 790 + { 791 + return (ahd_inl_scbram(ahd, offset) 792 + | ((uint64_t)ahd_inl_scbram(ahd, offset+4)) << 32); 793 + } 794 + 795 + struct scb * 796 + ahd_lookup_scb(struct ahd_softc *ahd, u_int tag) 797 + { 798 + struct scb* scb; 799 + 800 + if (tag >= AHD_SCB_MAX) 801 + return (NULL); 802 + scb = ahd->scb_data.scbindex[tag]; 803 + if (scb != NULL) 804 + ahd_sync_scb(ahd, scb, 805 + BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); 806 + return (scb); 807 + } 808 + 809 + static void 810 + ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) 811 + { 812 + struct hardware_scb *q_hscb; 813 + struct map_node *q_hscb_map; 814 + uint32_t saved_hscb_busaddr; 815 + 816 + /* 817 + * Our queuing method is a bit tricky. The card 818 + * knows in advance which HSCB (by address) to download, 819 + * and we can't disappoint it. To achieve this, the next 820 + * HSCB to download is saved off in ahd->next_queued_hscb. 821 + * When we are called to queue "an arbitrary scb", 822 + * we copy the contents of the incoming HSCB to the one 823 + * the sequencer knows about, swap HSCB pointers and 824 + * finally assign the SCB to the tag indexed location 825 + * in the scb_array. This makes sure that we can still 826 + * locate the correct SCB by SCB_TAG. 827 + */ 828 + q_hscb = ahd->next_queued_hscb; 829 + q_hscb_map = ahd->next_queued_hscb_map; 830 + saved_hscb_busaddr = q_hscb->hscb_busaddr; 831 + memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 832 + q_hscb->hscb_busaddr = saved_hscb_busaddr; 833 + q_hscb->next_hscb_busaddr = scb->hscb->hscb_busaddr; 834 + 835 + /* Now swap HSCB pointers. */ 836 + ahd->next_queued_hscb = scb->hscb; 837 + ahd->next_queued_hscb_map = scb->hscb_map; 838 + scb->hscb = q_hscb; 839 + scb->hscb_map = q_hscb_map; 840 + 841 + /* Now define the mapping from tag to SCB in the scbindex */ 842 + ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb; 843 + } 844 + 845 + /* 846 + * Tell the sequencer about a new transaction to execute. 847 + */ 848 + void 849 + ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb) 850 + { 851 + ahd_swap_with_next_hscb(ahd, scb); 852 + 853 + if (SCBID_IS_NULL(SCB_GET_TAG(scb))) 854 + panic("Attempt to queue invalid SCB tag %x\n", 855 + SCB_GET_TAG(scb)); 856 + 857 + /* 858 + * Keep a history of SCBs we've downloaded in the qinfifo. 859 + */ 860 + ahd->qinfifo[AHD_QIN_WRAP(ahd->qinfifonext)] = SCB_GET_TAG(scb); 861 + ahd->qinfifonext++; 862 + 863 + if (scb->sg_count != 0) 864 + ahd_setup_data_scb(ahd, scb); 865 + else 866 + ahd_setup_noxfer_scb(ahd, scb); 867 + ahd_setup_scb_common(ahd, scb); 868 + 869 + /* 870 + * Make sure our data is consistent from the 871 + * perspective of the adapter. 872 + */ 873 + ahd_sync_scb(ahd, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); 874 + 875 + #ifdef AHD_DEBUG 876 + if ((ahd_debug & AHD_SHOW_QUEUE) != 0) { 877 + uint64_t host_dataptr; 878 + 879 + host_dataptr = ahd_le64toh(scb->hscb->dataptr); 880 + printf("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n", 881 + ahd_name(ahd), 882 + SCB_GET_TAG(scb), scb->hscb->scsiid, 883 + ahd_le32toh(scb->hscb->hscb_busaddr), 884 + (u_int)((host_dataptr >> 32) & 0xFFFFFFFF), 885 + (u_int)(host_dataptr & 0xFFFFFFFF), 886 + ahd_le32toh(scb->hscb->datacnt)); 887 + } 888 + #endif 889 + /* Tell the adapter about the newly queued SCB */ 890 + ahd_set_hnscb_qoff(ahd, ahd->qinfifonext); 891 + } 892 + 893 + /************************** Interrupt Processing ******************************/ 894 + static void 895 + ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) 896 + { 897 + ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 898 + /*offset*/0, 899 + /*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op); 900 + } 901 + 902 + static void 903 + ahd_sync_tqinfifo(struct ahd_softc *ahd, int op) 904 + { 905 + #ifdef AHD_TARGET_MODE 906 + if ((ahd->flags & AHD_TARGETROLE) != 0) { 907 + ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 908 + ahd->shared_data_map.dmamap, 909 + ahd_targetcmd_offset(ahd, 0), 910 + sizeof(struct target_cmd) * AHD_TMODE_CMDS, 911 + op); 912 + } 913 + #endif 914 + } 915 + 916 + /* 917 + * See if the firmware has posted any completed commands 918 + * into our in-core command complete fifos. 919 + */ 920 + #define AHD_RUN_QOUTFIFO 0x1 921 + #define AHD_RUN_TQINFIFO 0x2 922 + static u_int 923 + ahd_check_cmdcmpltqueues(struct ahd_softc *ahd) 924 + { 925 + u_int retval; 926 + 927 + retval = 0; 928 + ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 929 + /*offset*/ahd->qoutfifonext * sizeof(*ahd->qoutfifo), 930 + /*len*/sizeof(*ahd->qoutfifo), BUS_DMASYNC_POSTREAD); 931 + if (ahd->qoutfifo[ahd->qoutfifonext].valid_tag 932 + == ahd->qoutfifonext_valid_tag) 933 + retval |= AHD_RUN_QOUTFIFO; 934 + #ifdef AHD_TARGET_MODE 935 + if ((ahd->flags & AHD_TARGETROLE) != 0 936 + && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) { 937 + ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 938 + ahd->shared_data_map.dmamap, 939 + ahd_targetcmd_offset(ahd, ahd->tqinfifofnext), 940 + /*len*/sizeof(struct target_cmd), 941 + BUS_DMASYNC_POSTREAD); 942 + if (ahd->targetcmds[ahd->tqinfifonext].cmd_valid != 0) 943 + retval |= AHD_RUN_TQINFIFO; 944 + } 945 + #endif 946 + return (retval); 947 + } 948 + 949 + /* 950 + * Catch an interrupt from the adapter 951 + */ 952 + int 953 + ahd_intr(struct ahd_softc *ahd) 954 + { 955 + u_int intstat; 956 + 957 + if ((ahd->pause & INTEN) == 0) { 958 + /* 959 + * Our interrupt is not enabled on the chip 960 + * and may be disabled for re-entrancy reasons, 961 + * so just return. This is likely just a shared 962 + * interrupt. 963 + */ 964 + return (0); 965 + } 966 + 967 + /* 968 + * Instead of directly reading the interrupt status register, 969 + * infer the cause of the interrupt by checking our in-core 970 + * completion queues. This avoids a costly PCI bus read in 971 + * most cases. 972 + */ 973 + if ((ahd->flags & AHD_ALL_INTERRUPTS) == 0 974 + && (ahd_check_cmdcmpltqueues(ahd) != 0)) 975 + intstat = CMDCMPLT; 976 + else 977 + intstat = ahd_inb(ahd, INTSTAT); 978 + 979 + if ((intstat & INT_PEND) == 0) 980 + return (0); 981 + 982 + if (intstat & CMDCMPLT) { 983 + ahd_outb(ahd, CLRINT, CLRCMDINT); 984 + 985 + /* 986 + * Ensure that the chip sees that we've cleared 987 + * this interrupt before we walk the output fifo. 988 + * Otherwise, we may, due to posted bus writes, 989 + * clear the interrupt after we finish the scan, 990 + * and after the sequencer has added new entries 991 + * and asserted the interrupt again. 992 + */ 993 + if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { 994 + if (ahd_is_paused(ahd)) { 995 + /* 996 + * Potentially lost SEQINT. 997 + * If SEQINTCODE is non-zero, 998 + * simulate the SEQINT. 999 + */ 1000 + if (ahd_inb(ahd, SEQINTCODE) != NO_SEQINT) 1001 + intstat |= SEQINT; 1002 + } 1003 + } else { 1004 + ahd_flush_device_writes(ahd); 1005 + } 1006 + ahd_run_qoutfifo(ahd); 1007 + ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket]++; 1008 + ahd->cmdcmplt_total++; 1009 + #ifdef AHD_TARGET_MODE 1010 + if ((ahd->flags & AHD_TARGETROLE) != 0) 1011 + ahd_run_tqinfifo(ahd, /*paused*/FALSE); 1012 + #endif 1013 + } 1014 + 1015 + /* 1016 + * Handle statuses that may invalidate our cached 1017 + * copy of INTSTAT separately. 1018 + */ 1019 + if (intstat == 0xFF && (ahd->features & AHD_REMOVABLE) != 0) { 1020 + /* Hot eject. Do nothing */ 1021 + } else if (intstat & HWERRINT) { 1022 + ahd_handle_hwerrint(ahd); 1023 + } else if ((intstat & (PCIINT|SPLTINT)) != 0) { 1024 + ahd->bus_intr(ahd); 1025 + } else { 1026 + 1027 + if ((intstat & SEQINT) != 0) 1028 + ahd_handle_seqint(ahd, intstat); 1029 + 1030 + if ((intstat & SCSIINT) != 0) 1031 + ahd_handle_scsiint(ahd, intstat); 1032 + } 1033 + return (1); 1034 + } 1035 + 1036 + /******************************** Private Inlines *****************************/ 271 1037 static __inline void 272 1038 ahd_assert_atn(struct ahd_softc *ahd) 273 1039 { ··· 1046 280 * are currently in a packetized transfer. We could 1047 281 * just as easily be sending or receiving a message. 1048 282 */ 1049 - static __inline int 283 + static int 1050 284 ahd_currently_packetized(struct ahd_softc *ahd) 1051 285 { 1052 286 ahd_mode_state saved_modes; ··· 1662 896 * a copy of the first byte (little endian) of the sgptr 1663 897 * hscb field. 1664 898 */ 1665 - void 899 + static void 1666 900 ahd_run_qoutfifo(struct ahd_softc *ahd) 1667 901 { 1668 902 struct ahd_completion *completion; ··· 1701 935 } 1702 936 1703 937 /************************* Interrupt Handling *********************************/ 1704 - void 938 + static void 1705 939 ahd_handle_hwerrint(struct ahd_softc *ahd) 1706 940 { 1707 941 /* ··· 1775 1009 } 1776 1010 #endif /* AHD_DEBUG */ 1777 1011 1778 - void 1012 + static void 1779 1013 ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) 1780 1014 { 1781 1015 u_int seqintcode; ··· 2387 1621 ahd_unpause(ahd); 2388 1622 } 2389 1623 2390 - void 1624 + static void 2391 1625 ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) 2392 1626 { 2393 1627 struct scb *scb; ··· 4337 3571 devinfo->target, devinfo->lun); 4338 3572 } 4339 3573 4340 - static struct ahd_phase_table_entry* 3574 + static const struct ahd_phase_table_entry* 4341 3575 ahd_lookup_phase_entry(int phase) 4342 3576 { 4343 - struct ahd_phase_table_entry *entry; 4344 - struct ahd_phase_table_entry *last_entry; 3577 + const struct ahd_phase_table_entry *entry; 3578 + const struct ahd_phase_table_entry *last_entry; 4345 3579 4346 3580 /* 4347 3581 * num_phases doesn't include the default entry which ··· 4707 3941 */ 4708 3942 static void 4709 3943 ahd_handle_message_phase(struct ahd_softc *ahd) 4710 - { 3944 + { 4711 3945 struct ahd_devinfo devinfo; 4712 3946 u_int bus_phase; 4713 3947 int end_session; ··· 6749 5983 */ 6750 5984 void 6751 5985 ahd_free_scb(struct ahd_softc *ahd, struct scb *scb) 6752 - { 6753 - 5986 + { 6754 5987 /* Clean up for the next user */ 6755 5988 scb->flags = SCB_FLAG_NONE; 6756 5989 scb->hscb->control = 0; ··· 7036 6271 "Under Terminated", 7037 6272 "Not Configured" 7038 6273 }; 6274 + 6275 + /***************************** Timer Facilities *******************************/ 6276 + #define ahd_timer_init init_timer 6277 + #define ahd_timer_stop del_timer_sync 6278 + typedef void ahd_linux_callback_t (u_long); 6279 + 6280 + static void 6281 + ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg) 6282 + { 6283 + struct ahd_softc *ahd; 6284 + 6285 + ahd = (struct ahd_softc *)arg; 6286 + del_timer(timer); 6287 + timer->data = (u_long)arg; 6288 + timer->expires = jiffies + (usec * HZ)/1000000; 6289 + timer->function = (ahd_linux_callback_t*)func; 6290 + add_timer(timer); 6291 + } 7039 6292 7040 6293 /* 7041 6294 * Start the board, ready for normal operation ··· 8153 7370 + ARRAY_SIZE(ahd->qinfifo) - wrap_qinpos); 8154 7371 } 8155 7372 8156 - void 7373 + static void 8157 7374 ahd_reset_cmds_pending(struct ahd_softc *ahd) 8158 7375 { 8159 7376 struct scb *scb; ··· 9354 8571 struct cs cs_table[num_critical_sections]; 9355 8572 u_int begin_set[num_critical_sections]; 9356 8573 u_int end_set[num_critical_sections]; 9357 - struct patch *cur_patch; 8574 + const struct patch *cur_patch; 9358 8575 u_int cs_count; 9359 8576 u_int cur_cs; 9360 8577 u_int i; ··· 9509 8726 } 9510 8727 9511 8728 static int 9512 - ahd_check_patch(struct ahd_softc *ahd, struct patch **start_patch, 8729 + ahd_check_patch(struct ahd_softc *ahd, const struct patch **start_patch, 9513 8730 u_int start_instr, u_int *skip_addr) 9514 8731 { 9515 - struct patch *cur_patch; 9516 - struct patch *last_patch; 8732 + const struct patch *cur_patch; 8733 + const struct patch *last_patch; 9517 8734 u_int num_patches; 9518 8735 9519 8736 num_patches = ARRAY_SIZE(patches); ··· 9547 8764 static u_int 9548 8765 ahd_resolve_seqaddr(struct ahd_softc *ahd, u_int address) 9549 8766 { 9550 - struct patch *cur_patch; 8767 + const struct patch *cur_patch; 9551 8768 int address_offset; 9552 8769 u_int skip_addr; 9553 8770 u_int i; ··· 9678 8895 } 9679 8896 9680 8897 int 9681 - ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries, 8898 + ahd_print_register(const ahd_reg_parse_entry_t *table, u_int num_entries, 9682 8899 const char *name, u_int address, u_int value, 9683 8900 u_int *cur_column, u_int wrap_point) 9684 8901 { ··· 10669 9886 #endif 10670 9887 } 10671 9888 10672 - void 9889 + static void 10673 9890 ahd_run_tqinfifo(struct ahd_softc *ahd, int paused) 10674 9891 { 10675 9892 struct target_cmd *cmd;
+42 -817
drivers/scsi/aic7xxx/aic79xx_inline.h
··· 63 63 static __inline void ahd_extract_mode_state(struct ahd_softc *ahd, 64 64 ahd_mode_state state, 65 65 ahd_mode *src, ahd_mode *dst); 66 - static __inline void ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, 67 - ahd_mode dst); 68 - static __inline void ahd_update_modes(struct ahd_softc *ahd); 69 - static __inline void ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode, 70 - ahd_mode dstmode, const char *file, 71 - int line); 72 - static __inline ahd_mode_state ahd_save_modes(struct ahd_softc *ahd); 73 - static __inline void ahd_restore_modes(struct ahd_softc *ahd, 74 - ahd_mode_state state); 75 - static __inline int ahd_is_paused(struct ahd_softc *ahd); 76 - static __inline void ahd_pause(struct ahd_softc *ahd); 77 - static __inline void ahd_unpause(struct ahd_softc *ahd); 66 + 67 + void ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, 68 + ahd_mode dst); 69 + ahd_mode_state ahd_save_modes(struct ahd_softc *ahd); 70 + void ahd_restore_modes(struct ahd_softc *ahd, 71 + ahd_mode_state state); 72 + int ahd_is_paused(struct ahd_softc *ahd); 73 + void ahd_pause(struct ahd_softc *ahd); 74 + void ahd_unpause(struct ahd_softc *ahd); 78 75 79 76 static __inline void 80 77 ahd_known_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) ··· 96 99 *dst = (state & DST_MODE) >> DST_MODE_SHIFT; 97 100 } 98 101 99 - static __inline void 100 - ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) 101 - { 102 - if (ahd->src_mode == src && ahd->dst_mode == dst) 103 - return; 104 - #ifdef AHD_DEBUG 105 - if (ahd->src_mode == AHD_MODE_UNKNOWN 106 - || ahd->dst_mode == AHD_MODE_UNKNOWN) 107 - panic("Setting mode prior to saving it.\n"); 108 - if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) 109 - printf("%s: Setting mode 0x%x\n", ahd_name(ahd), 110 - ahd_build_mode_state(ahd, src, dst)); 111 - #endif 112 - ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, src, dst)); 113 - ahd->src_mode = src; 114 - ahd->dst_mode = dst; 115 - } 116 - 117 - static __inline void 118 - ahd_update_modes(struct ahd_softc *ahd) 119 - { 120 - ahd_mode_state mode_ptr; 121 - ahd_mode src; 122 - ahd_mode dst; 123 - 124 - mode_ptr = ahd_inb(ahd, MODE_PTR); 125 - #ifdef AHD_DEBUG 126 - if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) 127 - printf("Reading mode 0x%x\n", mode_ptr); 128 - #endif 129 - ahd_extract_mode_state(ahd, mode_ptr, &src, &dst); 130 - ahd_known_modes(ahd, src, dst); 131 - } 132 - 133 - static __inline void 134 - ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode, 135 - ahd_mode dstmode, const char *file, int line) 136 - { 137 - #ifdef AHD_DEBUG 138 - if ((srcmode & AHD_MK_MSK(ahd->src_mode)) == 0 139 - || (dstmode & AHD_MK_MSK(ahd->dst_mode)) == 0) { 140 - panic("%s:%s:%d: Mode assertion failed.\n", 141 - ahd_name(ahd), file, line); 142 - } 143 - #endif 144 - } 145 - 146 - static __inline ahd_mode_state 147 - ahd_save_modes(struct ahd_softc *ahd) 148 - { 149 - if (ahd->src_mode == AHD_MODE_UNKNOWN 150 - || ahd->dst_mode == AHD_MODE_UNKNOWN) 151 - ahd_update_modes(ahd); 152 - 153 - return (ahd_build_mode_state(ahd, ahd->src_mode, ahd->dst_mode)); 154 - } 155 - 156 - static __inline void 157 - ahd_restore_modes(struct ahd_softc *ahd, ahd_mode_state state) 158 - { 159 - ahd_mode src; 160 - ahd_mode dst; 161 - 162 - ahd_extract_mode_state(ahd, state, &src, &dst); 163 - ahd_set_modes(ahd, src, dst); 164 - } 165 - 166 - #define AHD_ASSERT_MODES(ahd, source, dest) \ 167 - ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__); 168 - 169 - /* 170 - * Determine whether the sequencer has halted code execution. 171 - * Returns non-zero status if the sequencer is stopped. 172 - */ 173 - static __inline int 174 - ahd_is_paused(struct ahd_softc *ahd) 175 - { 176 - return ((ahd_inb(ahd, HCNTRL) & PAUSE) != 0); 177 - } 178 - 179 - /* 180 - * Request that the sequencer stop and wait, indefinitely, for it 181 - * to stop. The sequencer will only acknowledge that it is paused 182 - * once it has reached an instruction boundary and PAUSEDIS is 183 - * cleared in the SEQCTL register. The sequencer may use PAUSEDIS 184 - * for critical sections. 185 - */ 186 - static __inline void 187 - ahd_pause(struct ahd_softc *ahd) 188 - { 189 - ahd_outb(ahd, HCNTRL, ahd->pause); 190 - 191 - /* 192 - * Since the sequencer can disable pausing in a critical section, we 193 - * must loop until it actually stops. 194 - */ 195 - while (ahd_is_paused(ahd) == 0) 196 - ; 197 - } 198 - 199 - /* 200 - * Allow the sequencer to continue program execution. 201 - * We check here to ensure that no additional interrupt 202 - * sources that would cause the sequencer to halt have been 203 - * asserted. If, for example, a SCSI bus reset is detected 204 - * while we are fielding a different, pausing, interrupt type, 205 - * we don't want to release the sequencer before going back 206 - * into our interrupt handler and dealing with this new 207 - * condition. 208 - */ 209 - static __inline void 210 - ahd_unpause(struct ahd_softc *ahd) 211 - { 212 - /* 213 - * Automatically restore our modes to those saved 214 - * prior to the first change of the mode. 215 - */ 216 - if (ahd->saved_src_mode != AHD_MODE_UNKNOWN 217 - && ahd->saved_dst_mode != AHD_MODE_UNKNOWN) { 218 - if ((ahd->flags & AHD_UPDATE_PEND_CMDS) != 0) 219 - ahd_reset_cmds_pending(ahd); 220 - ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode); 221 - } 222 - 223 - if ((ahd_inb(ahd, INTSTAT) & ~CMDCMPLT) == 0) 224 - ahd_outb(ahd, HCNTRL, ahd->unpause); 225 - 226 - ahd_known_modes(ahd, AHD_MODE_UNKNOWN, AHD_MODE_UNKNOWN); 227 - } 228 - 229 102 /*********************** Scatter Gather List Handling *************************/ 230 - static __inline void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, 231 - void *sgptr, dma_addr_t addr, 232 - bus_size_t len, int last); 233 - static __inline void ahd_setup_scb_common(struct ahd_softc *ahd, 234 - struct scb *scb); 235 - static __inline void ahd_setup_data_scb(struct ahd_softc *ahd, 236 - struct scb *scb); 237 - static __inline void ahd_setup_noxfer_scb(struct ahd_softc *ahd, 238 - struct scb *scb); 239 - 240 - static __inline void * 241 - ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, 242 - void *sgptr, dma_addr_t addr, bus_size_t len, int last) 243 - { 244 - scb->sg_count++; 245 - if (sizeof(dma_addr_t) > 4 246 - && (ahd->flags & AHD_64BIT_ADDRESSING) != 0) { 247 - struct ahd_dma64_seg *sg; 248 - 249 - sg = (struct ahd_dma64_seg *)sgptr; 250 - sg->addr = ahd_htole64(addr); 251 - sg->len = ahd_htole32(len | (last ? AHD_DMA_LAST_SEG : 0)); 252 - return (sg + 1); 253 - } else { 254 - struct ahd_dma_seg *sg; 255 - 256 - sg = (struct ahd_dma_seg *)sgptr; 257 - sg->addr = ahd_htole32(addr & 0xFFFFFFFF); 258 - sg->len = ahd_htole32(len | ((addr >> 8) & 0x7F000000) 259 - | (last ? AHD_DMA_LAST_SEG : 0)); 260 - return (sg + 1); 261 - } 262 - } 263 - 264 - static __inline void 265 - ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb) 266 - { 267 - /* XXX Handle target mode SCBs. */ 268 - scb->crc_retry_count = 0; 269 - if ((scb->flags & SCB_PACKETIZED) != 0) { 270 - /* XXX what about ACA?? It is type 4, but TAG_TYPE == 0x3. */ 271 - scb->hscb->task_attribute = scb->hscb->control & SCB_TAG_TYPE; 272 - } else { 273 - if (ahd_get_transfer_length(scb) & 0x01) 274 - scb->hscb->task_attribute = SCB_XFERLEN_ODD; 275 - else 276 - scb->hscb->task_attribute = 0; 277 - } 278 - 279 - if (scb->hscb->cdb_len <= MAX_CDB_LEN_WITH_SENSE_ADDR 280 - || (scb->hscb->cdb_len & SCB_CDB_LEN_PTR) != 0) 281 - scb->hscb->shared_data.idata.cdb_plus_saddr.sense_addr = 282 - ahd_htole32(scb->sense_busaddr); 283 - } 284 - 285 - static __inline void 286 - ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb) 287 - { 288 - /* 289 - * Copy the first SG into the "current" data ponter area. 290 - */ 291 - if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) { 292 - struct ahd_dma64_seg *sg; 293 - 294 - sg = (struct ahd_dma64_seg *)scb->sg_list; 295 - scb->hscb->dataptr = sg->addr; 296 - scb->hscb->datacnt = sg->len; 297 - } else { 298 - struct ahd_dma_seg *sg; 299 - uint32_t *dataptr_words; 300 - 301 - sg = (struct ahd_dma_seg *)scb->sg_list; 302 - dataptr_words = (uint32_t*)&scb->hscb->dataptr; 303 - dataptr_words[0] = sg->addr; 304 - dataptr_words[1] = 0; 305 - if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) { 306 - uint64_t high_addr; 307 - 308 - high_addr = ahd_le32toh(sg->len) & 0x7F000000; 309 - scb->hscb->dataptr |= ahd_htole64(high_addr << 8); 310 - } 311 - scb->hscb->datacnt = sg->len; 312 - } 313 - /* 314 - * Note where to find the SG entries in bus space. 315 - * We also set the full residual flag which the 316 - * sequencer will clear as soon as a data transfer 317 - * occurs. 318 - */ 319 - scb->hscb->sgptr = ahd_htole32(scb->sg_list_busaddr|SG_FULL_RESID); 320 - } 321 - 322 - static __inline void 323 - ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb) 324 - { 325 - scb->hscb->sgptr = ahd_htole32(SG_LIST_NULL); 326 - scb->hscb->dataptr = 0; 327 - scb->hscb->datacnt = 0; 328 - } 103 + void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, 104 + void *sgptr, dma_addr_t addr, 105 + bus_size_t len, int last); 329 106 330 107 /************************** Memory mapping routines ***************************/ 331 108 static __inline size_t ahd_sg_size(struct ahd_softc *ahd); 332 - static __inline void * 333 - ahd_sg_bus_to_virt(struct ahd_softc *ahd, 334 - struct scb *scb, 335 - uint32_t sg_busaddr); 336 - static __inline uint32_t 337 - ahd_sg_virt_to_bus(struct ahd_softc *ahd, 338 - struct scb *scb, 339 - void *sg); 340 - static __inline void ahd_sync_scb(struct ahd_softc *ahd, 341 - struct scb *scb, int op); 342 - static __inline void ahd_sync_sglist(struct ahd_softc *ahd, 343 - struct scb *scb, int op); 344 - static __inline void ahd_sync_sense(struct ahd_softc *ahd, 345 - struct scb *scb, int op); 346 - static __inline uint32_t 347 - ahd_targetcmd_offset(struct ahd_softc *ahd, 348 - u_int index); 109 + 110 + void ahd_sync_sglist(struct ahd_softc *ahd, 111 + struct scb *scb, int op); 349 112 350 113 static __inline size_t 351 114 ahd_sg_size(struct ahd_softc *ahd) ··· 115 358 return (sizeof(struct ahd_dma_seg)); 116 359 } 117 360 118 - static __inline void * 119 - ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr) 120 - { 121 - dma_addr_t sg_offset; 122 - 123 - /* sg_list_phys points to entry 1, not 0 */ 124 - sg_offset = sg_busaddr - (scb->sg_list_busaddr - ahd_sg_size(ahd)); 125 - return ((uint8_t *)scb->sg_list + sg_offset); 126 - } 127 - 128 - static __inline uint32_t 129 - ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg) 130 - { 131 - dma_addr_t sg_offset; 132 - 133 - /* sg_list_phys points to entry 1, not 0 */ 134 - sg_offset = ((uint8_t *)sg - (uint8_t *)scb->sg_list) 135 - - ahd_sg_size(ahd); 136 - 137 - return (scb->sg_list_busaddr + sg_offset); 138 - } 139 - 140 - static __inline void 141 - ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op) 142 - { 143 - ahd_dmamap_sync(ahd, ahd->scb_data.hscb_dmat, 144 - scb->hscb_map->dmamap, 145 - /*offset*/(uint8_t*)scb->hscb - scb->hscb_map->vaddr, 146 - /*len*/sizeof(*scb->hscb), op); 147 - } 148 - 149 - static __inline void 150 - ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op) 151 - { 152 - if (scb->sg_count == 0) 153 - return; 154 - 155 - ahd_dmamap_sync(ahd, ahd->scb_data.sg_dmat, 156 - scb->sg_map->dmamap, 157 - /*offset*/scb->sg_list_busaddr - ahd_sg_size(ahd), 158 - /*len*/ahd_sg_size(ahd) * scb->sg_count, op); 159 - } 160 - 161 - static __inline void 162 - ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op) 163 - { 164 - ahd_dmamap_sync(ahd, ahd->scb_data.sense_dmat, 165 - scb->sense_map->dmamap, 166 - /*offset*/scb->sense_busaddr, 167 - /*len*/AHD_SENSE_BUFSIZE, op); 168 - } 169 - 170 - static __inline uint32_t 171 - ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index) 172 - { 173 - return (((uint8_t *)&ahd->targetcmds[index]) 174 - - (uint8_t *)ahd->qoutfifo); 175 - } 176 - 177 361 /*********************** Miscellaneous Support Functions ***********************/ 178 - static __inline struct ahd_initiator_tinfo * 179 - ahd_fetch_transinfo(struct ahd_softc *ahd, 180 - char channel, u_int our_id, 181 - u_int remote_id, 182 - struct ahd_tmode_tstate **tstate); 183 - static __inline uint16_t 184 - ahd_inw(struct ahd_softc *ahd, u_int port); 185 - static __inline void ahd_outw(struct ahd_softc *ahd, u_int port, 186 - u_int value); 187 - static __inline uint32_t 188 - ahd_inl(struct ahd_softc *ahd, u_int port); 189 - static __inline void ahd_outl(struct ahd_softc *ahd, u_int port, 190 - uint32_t value); 191 - static __inline uint64_t 192 - ahd_inq(struct ahd_softc *ahd, u_int port); 193 - static __inline void ahd_outq(struct ahd_softc *ahd, u_int port, 194 - uint64_t value); 195 - static __inline u_int ahd_get_scbptr(struct ahd_softc *ahd); 196 - static __inline void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr); 197 - static __inline u_int ahd_get_hnscb_qoff(struct ahd_softc *ahd); 198 - static __inline void ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value); 199 - static __inline u_int ahd_get_hescb_qoff(struct ahd_softc *ahd); 200 - static __inline void ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value); 201 - static __inline u_int ahd_get_snscb_qoff(struct ahd_softc *ahd); 202 - static __inline void ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value); 203 - static __inline u_int ahd_get_sescb_qoff(struct ahd_softc *ahd); 204 - static __inline void ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value); 205 - static __inline u_int ahd_get_sdscb_qoff(struct ahd_softc *ahd); 206 - static __inline void ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value); 207 - static __inline u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset); 208 - static __inline u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset); 209 - static __inline uint32_t 210 - ahd_inl_scbram(struct ahd_softc *ahd, u_int offset); 211 - static __inline uint64_t 212 - ahd_inq_scbram(struct ahd_softc *ahd, u_int offset); 213 - static __inline void ahd_swap_with_next_hscb(struct ahd_softc *ahd, 214 - struct scb *scb); 215 - static __inline void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb); 362 + struct ahd_initiator_tinfo * 363 + ahd_fetch_transinfo(struct ahd_softc *ahd, 364 + char channel, u_int our_id, 365 + u_int remote_id, 366 + struct ahd_tmode_tstate **tstate); 367 + uint16_t 368 + ahd_inw(struct ahd_softc *ahd, u_int port); 369 + void ahd_outw(struct ahd_softc *ahd, u_int port, 370 + u_int value); 371 + uint32_t 372 + ahd_inl(struct ahd_softc *ahd, u_int port); 373 + void ahd_outl(struct ahd_softc *ahd, u_int port, 374 + uint32_t value); 375 + uint64_t 376 + ahd_inq(struct ahd_softc *ahd, u_int port); 377 + void ahd_outq(struct ahd_softc *ahd, u_int port, 378 + uint64_t value); 379 + u_int ahd_get_scbptr(struct ahd_softc *ahd); 380 + void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr); 381 + u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset); 382 + u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset); 383 + struct scb * 384 + ahd_lookup_scb(struct ahd_softc *ahd, u_int tag); 385 + void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb); 386 + 216 387 static __inline uint8_t * 217 388 ahd_get_sense_buf(struct ahd_softc *ahd, 218 389 struct scb *scb); ··· 148 463 ahd_get_sense_bufaddr(struct ahd_softc *ahd, 149 464 struct scb *scb); 150 465 151 - /* 152 - * Return pointers to the transfer negotiation information 153 - * for the specified our_id/remote_id pair. 154 - */ 155 - static __inline struct ahd_initiator_tinfo * 156 - ahd_fetch_transinfo(struct ahd_softc *ahd, char channel, u_int our_id, 157 - u_int remote_id, struct ahd_tmode_tstate **tstate) 158 - { 159 - /* 160 - * Transfer data structures are stored from the perspective 161 - * of the target role. Since the parameters for a connection 162 - * in the initiator role to a given target are the same as 163 - * when the roles are reversed, we pretend we are the target. 164 - */ 165 - if (channel == 'B') 166 - our_id += 8; 167 - *tstate = ahd->enabled_targets[our_id]; 168 - return (&(*tstate)->transinfo[remote_id]); 169 - } 466 + #if 0 /* unused */ 170 467 171 468 #define AHD_COPY_COL_IDX(dst, src) \ 172 469 do { \ ··· 156 489 dst->hscb->lun = src->hscb->lun; \ 157 490 } while (0) 158 491 159 - static __inline uint16_t 160 - ahd_inw(struct ahd_softc *ahd, u_int port) 161 - { 162 - /* 163 - * Read high byte first as some registers increment 164 - * or have other side effects when the low byte is 165 - * read. 166 - */ 167 - uint16_t r = ahd_inb(ahd, port+1) << 8; 168 - return r | ahd_inb(ahd, port); 169 - } 170 - 171 - static __inline void 172 - ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) 173 - { 174 - /* 175 - * Write low byte first to accomodate registers 176 - * such as PRGMCNT where the order maters. 177 - */ 178 - ahd_outb(ahd, port, value & 0xFF); 179 - ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 180 - } 181 - 182 - static __inline uint32_t 183 - ahd_inl(struct ahd_softc *ahd, u_int port) 184 - { 185 - return ((ahd_inb(ahd, port)) 186 - | (ahd_inb(ahd, port+1) << 8) 187 - | (ahd_inb(ahd, port+2) << 16) 188 - | (ahd_inb(ahd, port+3) << 24)); 189 - } 190 - 191 - static __inline void 192 - ahd_outl(struct ahd_softc *ahd, u_int port, uint32_t value) 193 - { 194 - ahd_outb(ahd, port, (value) & 0xFF); 195 - ahd_outb(ahd, port+1, ((value) >> 8) & 0xFF); 196 - ahd_outb(ahd, port+2, ((value) >> 16) & 0xFF); 197 - ahd_outb(ahd, port+3, ((value) >> 24) & 0xFF); 198 - } 199 - 200 - static __inline uint64_t 201 - ahd_inq(struct ahd_softc *ahd, u_int port) 202 - { 203 - return ((ahd_inb(ahd, port)) 204 - | (ahd_inb(ahd, port+1) << 8) 205 - | (ahd_inb(ahd, port+2) << 16) 206 - | (ahd_inb(ahd, port+3) << 24) 207 - | (((uint64_t)ahd_inb(ahd, port+4)) << 32) 208 - | (((uint64_t)ahd_inb(ahd, port+5)) << 40) 209 - | (((uint64_t)ahd_inb(ahd, port+6)) << 48) 210 - | (((uint64_t)ahd_inb(ahd, port+7)) << 56)); 211 - } 212 - 213 - static __inline void 214 - ahd_outq(struct ahd_softc *ahd, u_int port, uint64_t value) 215 - { 216 - ahd_outb(ahd, port, value & 0xFF); 217 - ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 218 - ahd_outb(ahd, port+2, (value >> 16) & 0xFF); 219 - ahd_outb(ahd, port+3, (value >> 24) & 0xFF); 220 - ahd_outb(ahd, port+4, (value >> 32) & 0xFF); 221 - ahd_outb(ahd, port+5, (value >> 40) & 0xFF); 222 - ahd_outb(ahd, port+6, (value >> 48) & 0xFF); 223 - ahd_outb(ahd, port+7, (value >> 56) & 0xFF); 224 - } 225 - 226 - static __inline u_int 227 - ahd_get_scbptr(struct ahd_softc *ahd) 228 - { 229 - AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK), 230 - ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK)); 231 - return (ahd_inb(ahd, SCBPTR) | (ahd_inb(ahd, SCBPTR + 1) << 8)); 232 - } 233 - 234 - static __inline void 235 - ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr) 236 - { 237 - AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK), 238 - ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK)); 239 - ahd_outb(ahd, SCBPTR, scbptr & 0xFF); 240 - ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF); 241 - } 242 - 243 - static __inline u_int 244 - ahd_get_hnscb_qoff(struct ahd_softc *ahd) 245 - { 246 - return (ahd_inw_atomic(ahd, HNSCB_QOFF)); 247 - } 248 - 249 - static __inline void 250 - ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value) 251 - { 252 - ahd_outw_atomic(ahd, HNSCB_QOFF, value); 253 - } 254 - 255 - static __inline u_int 256 - ahd_get_hescb_qoff(struct ahd_softc *ahd) 257 - { 258 - return (ahd_inb(ahd, HESCB_QOFF)); 259 - } 260 - 261 - static __inline void 262 - ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value) 263 - { 264 - ahd_outb(ahd, HESCB_QOFF, value); 265 - } 266 - 267 - static __inline u_int 268 - ahd_get_snscb_qoff(struct ahd_softc *ahd) 269 - { 270 - u_int oldvalue; 271 - 272 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 273 - oldvalue = ahd_inw(ahd, SNSCB_QOFF); 274 - ahd_outw(ahd, SNSCB_QOFF, oldvalue); 275 - return (oldvalue); 276 - } 277 - 278 - static __inline void 279 - ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value) 280 - { 281 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 282 - ahd_outw(ahd, SNSCB_QOFF, value); 283 - } 284 - 285 - static __inline u_int 286 - ahd_get_sescb_qoff(struct ahd_softc *ahd) 287 - { 288 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 289 - return (ahd_inb(ahd, SESCB_QOFF)); 290 - } 291 - 292 - static __inline void 293 - ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value) 294 - { 295 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 296 - ahd_outb(ahd, SESCB_QOFF, value); 297 - } 298 - 299 - static __inline u_int 300 - ahd_get_sdscb_qoff(struct ahd_softc *ahd) 301 - { 302 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 303 - return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8)); 304 - } 305 - 306 - static __inline void 307 - ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value) 308 - { 309 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 310 - ahd_outb(ahd, SDSCB_QOFF, value & 0xFF); 311 - ahd_outb(ahd, SDSCB_QOFF+1, (value >> 8) & 0xFF); 312 - } 313 - 314 - static __inline u_int 315 - ahd_inb_scbram(struct ahd_softc *ahd, u_int offset) 316 - { 317 - u_int value; 318 - 319 - /* 320 - * Workaround PCI-X Rev A. hardware bug. 321 - * After a host read of SCB memory, the chip 322 - * may become confused into thinking prefetch 323 - * was required. This starts the discard timer 324 - * running and can cause an unexpected discard 325 - * timer interrupt. The work around is to read 326 - * a normal register prior to the exhaustion of 327 - * the discard timer. The mode pointer register 328 - * has no side effects and so serves well for 329 - * this purpose. 330 - * 331 - * Razor #528 332 - */ 333 - value = ahd_inb(ahd, offset); 334 - if ((ahd->bugs & AHD_PCIX_SCBRAM_RD_BUG) != 0) 335 - ahd_inb(ahd, MODE_PTR); 336 - return (value); 337 - } 338 - 339 - static __inline u_int 340 - ahd_inw_scbram(struct ahd_softc *ahd, u_int offset) 341 - { 342 - return (ahd_inb_scbram(ahd, offset) 343 - | (ahd_inb_scbram(ahd, offset+1) << 8)); 344 - } 345 - 346 - static __inline uint32_t 347 - ahd_inl_scbram(struct ahd_softc *ahd, u_int offset) 348 - { 349 - return (ahd_inw_scbram(ahd, offset) 350 - | (ahd_inw_scbram(ahd, offset+2) << 16)); 351 - } 352 - 353 - static __inline uint64_t 354 - ahd_inq_scbram(struct ahd_softc *ahd, u_int offset) 355 - { 356 - return (ahd_inl_scbram(ahd, offset) 357 - | ((uint64_t)ahd_inl_scbram(ahd, offset+4)) << 32); 358 - } 359 - 360 - static __inline struct scb * 361 - ahd_lookup_scb(struct ahd_softc *ahd, u_int tag) 362 - { 363 - struct scb* scb; 364 - 365 - if (tag >= AHD_SCB_MAX) 366 - return (NULL); 367 - scb = ahd->scb_data.scbindex[tag]; 368 - if (scb != NULL) 369 - ahd_sync_scb(ahd, scb, 370 - BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); 371 - return (scb); 372 - } 373 - 374 - static __inline void 375 - ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) 376 - { 377 - struct hardware_scb *q_hscb; 378 - struct map_node *q_hscb_map; 379 - uint32_t saved_hscb_busaddr; 380 - 381 - /* 382 - * Our queuing method is a bit tricky. The card 383 - * knows in advance which HSCB (by address) to download, 384 - * and we can't disappoint it. To achieve this, the next 385 - * HSCB to download is saved off in ahd->next_queued_hscb. 386 - * When we are called to queue "an arbitrary scb", 387 - * we copy the contents of the incoming HSCB to the one 388 - * the sequencer knows about, swap HSCB pointers and 389 - * finally assign the SCB to the tag indexed location 390 - * in the scb_array. This makes sure that we can still 391 - * locate the correct SCB by SCB_TAG. 392 - */ 393 - q_hscb = ahd->next_queued_hscb; 394 - q_hscb_map = ahd->next_queued_hscb_map; 395 - saved_hscb_busaddr = q_hscb->hscb_busaddr; 396 - memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 397 - q_hscb->hscb_busaddr = saved_hscb_busaddr; 398 - q_hscb->next_hscb_busaddr = scb->hscb->hscb_busaddr; 399 - 400 - /* Now swap HSCB pointers. */ 401 - ahd->next_queued_hscb = scb->hscb; 402 - ahd->next_queued_hscb_map = scb->hscb_map; 403 - scb->hscb = q_hscb; 404 - scb->hscb_map = q_hscb_map; 405 - 406 - /* Now define the mapping from tag to SCB in the scbindex */ 407 - ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb; 408 - } 409 - 410 - /* 411 - * Tell the sequencer about a new transaction to execute. 412 - */ 413 - static __inline void 414 - ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb) 415 - { 416 - ahd_swap_with_next_hscb(ahd, scb); 417 - 418 - if (SCBID_IS_NULL(SCB_GET_TAG(scb))) 419 - panic("Attempt to queue invalid SCB tag %x\n", 420 - SCB_GET_TAG(scb)); 421 - 422 - /* 423 - * Keep a history of SCBs we've downloaded in the qinfifo. 424 - */ 425 - ahd->qinfifo[AHD_QIN_WRAP(ahd->qinfifonext)] = SCB_GET_TAG(scb); 426 - ahd->qinfifonext++; 427 - 428 - if (scb->sg_count != 0) 429 - ahd_setup_data_scb(ahd, scb); 430 - else 431 - ahd_setup_noxfer_scb(ahd, scb); 432 - ahd_setup_scb_common(ahd, scb); 433 - 434 - /* 435 - * Make sure our data is consistent from the 436 - * perspective of the adapter. 437 - */ 438 - ahd_sync_scb(ahd, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); 439 - 440 - #ifdef AHD_DEBUG 441 - if ((ahd_debug & AHD_SHOW_QUEUE) != 0) { 442 - uint64_t host_dataptr; 443 - 444 - host_dataptr = ahd_le64toh(scb->hscb->dataptr); 445 - printf("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n", 446 - ahd_name(ahd), 447 - SCB_GET_TAG(scb), scb->hscb->scsiid, 448 - ahd_le32toh(scb->hscb->hscb_busaddr), 449 - (u_int)((host_dataptr >> 32) & 0xFFFFFFFF), 450 - (u_int)(host_dataptr & 0xFFFFFFFF), 451 - ahd_le32toh(scb->hscb->datacnt)); 452 - } 453 492 #endif 454 - /* Tell the adapter about the newly queued SCB */ 455 - ahd_set_hnscb_qoff(ahd, ahd->qinfifonext); 456 - } 457 493 458 494 static __inline uint8_t * 459 495 ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb) ··· 171 801 } 172 802 173 803 /************************** Interrupt Processing ******************************/ 174 - static __inline void ahd_sync_qoutfifo(struct ahd_softc *ahd, int op); 175 - static __inline void ahd_sync_tqinfifo(struct ahd_softc *ahd, int op); 176 - static __inline u_int ahd_check_cmdcmpltqueues(struct ahd_softc *ahd); 177 - static __inline int ahd_intr(struct ahd_softc *ahd); 178 - 179 - static __inline void 180 - ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) 181 - { 182 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 183 - /*offset*/0, 184 - /*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op); 185 - } 186 - 187 - static __inline void 188 - ahd_sync_tqinfifo(struct ahd_softc *ahd, int op) 189 - { 190 - #ifdef AHD_TARGET_MODE 191 - if ((ahd->flags & AHD_TARGETROLE) != 0) { 192 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 193 - ahd->shared_data_map.dmamap, 194 - ahd_targetcmd_offset(ahd, 0), 195 - sizeof(struct target_cmd) * AHD_TMODE_CMDS, 196 - op); 197 - } 198 - #endif 199 - } 200 - 201 - /* 202 - * See if the firmware has posted any completed commands 203 - * into our in-core command complete fifos. 204 - */ 205 - #define AHD_RUN_QOUTFIFO 0x1 206 - #define AHD_RUN_TQINFIFO 0x2 207 - static __inline u_int 208 - ahd_check_cmdcmpltqueues(struct ahd_softc *ahd) 209 - { 210 - u_int retval; 211 - 212 - retval = 0; 213 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 214 - /*offset*/ahd->qoutfifonext * sizeof(*ahd->qoutfifo), 215 - /*len*/sizeof(*ahd->qoutfifo), BUS_DMASYNC_POSTREAD); 216 - if (ahd->qoutfifo[ahd->qoutfifonext].valid_tag 217 - == ahd->qoutfifonext_valid_tag) 218 - retval |= AHD_RUN_QOUTFIFO; 219 - #ifdef AHD_TARGET_MODE 220 - if ((ahd->flags & AHD_TARGETROLE) != 0 221 - && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) { 222 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 223 - ahd->shared_data_map.dmamap, 224 - ahd_targetcmd_offset(ahd, ahd->tqinfifofnext), 225 - /*len*/sizeof(struct target_cmd), 226 - BUS_DMASYNC_POSTREAD); 227 - if (ahd->targetcmds[ahd->tqinfifonext].cmd_valid != 0) 228 - retval |= AHD_RUN_TQINFIFO; 229 - } 230 - #endif 231 - return (retval); 232 - } 233 - 234 - /* 235 - * Catch an interrupt from the adapter 236 - */ 237 - static __inline int 238 - ahd_intr(struct ahd_softc *ahd) 239 - { 240 - u_int intstat; 241 - 242 - if ((ahd->pause & INTEN) == 0) { 243 - /* 244 - * Our interrupt is not enabled on the chip 245 - * and may be disabled for re-entrancy reasons, 246 - * so just return. This is likely just a shared 247 - * interrupt. 248 - */ 249 - return (0); 250 - } 251 - 252 - /* 253 - * Instead of directly reading the interrupt status register, 254 - * infer the cause of the interrupt by checking our in-core 255 - * completion queues. This avoids a costly PCI bus read in 256 - * most cases. 257 - */ 258 - if ((ahd->flags & AHD_ALL_INTERRUPTS) == 0 259 - && (ahd_check_cmdcmpltqueues(ahd) != 0)) 260 - intstat = CMDCMPLT; 261 - else 262 - intstat = ahd_inb(ahd, INTSTAT); 263 - 264 - if ((intstat & INT_PEND) == 0) 265 - return (0); 266 - 267 - if (intstat & CMDCMPLT) { 268 - ahd_outb(ahd, CLRINT, CLRCMDINT); 269 - 270 - /* 271 - * Ensure that the chip sees that we've cleared 272 - * this interrupt before we walk the output fifo. 273 - * Otherwise, we may, due to posted bus writes, 274 - * clear the interrupt after we finish the scan, 275 - * and after the sequencer has added new entries 276 - * and asserted the interrupt again. 277 - */ 278 - if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { 279 - if (ahd_is_paused(ahd)) { 280 - /* 281 - * Potentially lost SEQINT. 282 - * If SEQINTCODE is non-zero, 283 - * simulate the SEQINT. 284 - */ 285 - if (ahd_inb(ahd, SEQINTCODE) != NO_SEQINT) 286 - intstat |= SEQINT; 287 - } 288 - } else { 289 - ahd_flush_device_writes(ahd); 290 - } 291 - ahd_run_qoutfifo(ahd); 292 - ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket]++; 293 - ahd->cmdcmplt_total++; 294 - #ifdef AHD_TARGET_MODE 295 - if ((ahd->flags & AHD_TARGETROLE) != 0) 296 - ahd_run_tqinfifo(ahd, /*paused*/FALSE); 297 - #endif 298 - } 299 - 300 - /* 301 - * Handle statuses that may invalidate our cached 302 - * copy of INTSTAT separately. 303 - */ 304 - if (intstat == 0xFF && (ahd->features & AHD_REMOVABLE) != 0) { 305 - /* Hot eject. Do nothing */ 306 - } else if (intstat & HWERRINT) { 307 - ahd_handle_hwerrint(ahd); 308 - } else if ((intstat & (PCIINT|SPLTINT)) != 0) { 309 - ahd->bus_intr(ahd); 310 - } else { 311 - 312 - if ((intstat & SEQINT) != 0) 313 - ahd_handle_seqint(ahd, intstat); 314 - 315 - if ((intstat & SCSIINT) != 0) 316 - ahd_handle_scsiint(ahd, intstat); 317 - } 318 - return (1); 319 - } 804 + int ahd_intr(struct ahd_softc *ahd); 320 805 321 806 #endif /* _AIC79XX_INLINE_H_ */
+169 -14
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 193 193 #define AIC79XX_PRECOMP_INDEX 0 194 194 #define AIC79XX_SLEWRATE_INDEX 1 195 195 #define AIC79XX_AMPLITUDE_INDEX 2 196 - static struct ahd_linux_iocell_opts aic79xx_iocell_info[] = 196 + static const struct ahd_linux_iocell_opts aic79xx_iocell_info[] = 197 197 { 198 198 AIC79XX_DEFAULT_IOOPTS, 199 199 AIC79XX_DEFAULT_IOOPTS, ··· 369 369 static int ahd_linux_unit; 370 370 371 371 372 - /****************************** Inlines ***************************************/ 373 - static __inline void ahd_linux_unmap_scb(struct ahd_softc*, struct scb*); 372 + /************************** OS Utility Wrappers *******************************/ 373 + void ahd_delay(long); 374 + void 375 + ahd_delay(long usec) 376 + { 377 + /* 378 + * udelay on Linux can have problems for 379 + * multi-millisecond waits. Wait at most 380 + * 1024us per call. 381 + */ 382 + while (usec > 0) { 383 + udelay(usec % 1024); 384 + usec -= 1024; 385 + } 386 + } 374 387 375 - static __inline void 388 + 389 + /***************************** Low Level I/O **********************************/ 390 + uint8_t ahd_inb(struct ahd_softc * ahd, long port); 391 + void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); 392 + void ahd_outw_atomic(struct ahd_softc * ahd, 393 + long port, uint16_t val); 394 + void ahd_outsb(struct ahd_softc * ahd, long port, 395 + uint8_t *, int count); 396 + void ahd_insb(struct ahd_softc * ahd, long port, 397 + uint8_t *, int count); 398 + 399 + uint8_t 400 + ahd_inb(struct ahd_softc * ahd, long port) 401 + { 402 + uint8_t x; 403 + 404 + if (ahd->tags[0] == BUS_SPACE_MEMIO) { 405 + x = readb(ahd->bshs[0].maddr + port); 406 + } else { 407 + x = inb(ahd->bshs[(port) >> 8].ioport + ((port) & 0xFF)); 408 + } 409 + mb(); 410 + return (x); 411 + } 412 + 413 + #if 0 /* unused */ 414 + static uint16_t 415 + ahd_inw_atomic(struct ahd_softc * ahd, long port) 416 + { 417 + uint8_t x; 418 + 419 + if (ahd->tags[0] == BUS_SPACE_MEMIO) { 420 + x = readw(ahd->bshs[0].maddr + port); 421 + } else { 422 + x = inw(ahd->bshs[(port) >> 8].ioport + ((port) & 0xFF)); 423 + } 424 + mb(); 425 + return (x); 426 + } 427 + #endif 428 + 429 + void 430 + ahd_outb(struct ahd_softc * ahd, long port, uint8_t val) 431 + { 432 + if (ahd->tags[0] == BUS_SPACE_MEMIO) { 433 + writeb(val, ahd->bshs[0].maddr + port); 434 + } else { 435 + outb(val, ahd->bshs[(port) >> 8].ioport + (port & 0xFF)); 436 + } 437 + mb(); 438 + } 439 + 440 + void 441 + ahd_outw_atomic(struct ahd_softc * ahd, long port, uint16_t val) 442 + { 443 + if (ahd->tags[0] == BUS_SPACE_MEMIO) { 444 + writew(val, ahd->bshs[0].maddr + port); 445 + } else { 446 + outw(val, ahd->bshs[(port) >> 8].ioport + (port & 0xFF)); 447 + } 448 + mb(); 449 + } 450 + 451 + void 452 + ahd_outsb(struct ahd_softc * ahd, long port, uint8_t *array, int count) 453 + { 454 + int i; 455 + 456 + /* 457 + * There is probably a more efficient way to do this on Linux 458 + * but we don't use this for anything speed critical and this 459 + * should work. 460 + */ 461 + for (i = 0; i < count; i++) 462 + ahd_outb(ahd, port, *array++); 463 + } 464 + 465 + void 466 + ahd_insb(struct ahd_softc * ahd, long port, uint8_t *array, int count) 467 + { 468 + int i; 469 + 470 + /* 471 + * There is probably a more efficient way to do this on Linux 472 + * but we don't use this for anything speed critical and this 473 + * should work. 474 + */ 475 + for (i = 0; i < count; i++) 476 + *array++ = ahd_inb(ahd, port); 477 + } 478 + 479 + /******************************* PCI Routines *********************************/ 480 + uint32_t 481 + ahd_pci_read_config(ahd_dev_softc_t pci, int reg, int width) 482 + { 483 + switch (width) { 484 + case 1: 485 + { 486 + uint8_t retval; 487 + 488 + pci_read_config_byte(pci, reg, &retval); 489 + return (retval); 490 + } 491 + case 2: 492 + { 493 + uint16_t retval; 494 + pci_read_config_word(pci, reg, &retval); 495 + return (retval); 496 + } 497 + case 4: 498 + { 499 + uint32_t retval; 500 + pci_read_config_dword(pci, reg, &retval); 501 + return (retval); 502 + } 503 + default: 504 + panic("ahd_pci_read_config: Read size too big"); 505 + /* NOTREACHED */ 506 + return (0); 507 + } 508 + } 509 + 510 + void 511 + ahd_pci_write_config(ahd_dev_softc_t pci, int reg, uint32_t value, int width) 512 + { 513 + switch (width) { 514 + case 1: 515 + pci_write_config_byte(pci, reg, value); 516 + break; 517 + case 2: 518 + pci_write_config_word(pci, reg, value); 519 + break; 520 + case 4: 521 + pci_write_config_dword(pci, reg, value); 522 + break; 523 + default: 524 + panic("ahd_pci_write_config: Write size too big"); 525 + /* NOTREACHED */ 526 + } 527 + } 528 + 529 + /****************************** Inlines ***************************************/ 530 + static void ahd_linux_unmap_scb(struct ahd_softc*, struct scb*); 531 + 532 + static void 376 533 ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb) 377 534 { 378 535 struct scsi_cmnd *cmd; ··· 557 400 bp = &buffer[0]; 558 401 ahd = *(struct ahd_softc **)host->hostdata; 559 402 memset(bp, 0, sizeof(buffer)); 560 - strcpy(bp, "Adaptec AIC79XX PCI-X SCSI HBA DRIVER, Rev "); 561 - strcat(bp, AIC79XX_DRIVER_VERSION); 562 - strcat(bp, "\n"); 563 - strcat(bp, " <"); 403 + strcpy(bp, "Adaptec AIC79XX PCI-X SCSI HBA DRIVER, Rev " AIC79XX_DRIVER_VERSION "\n" 404 + " <"); 564 405 strcat(bp, ahd->description); 565 - strcat(bp, ">\n"); 566 - strcat(bp, " "); 406 + strcat(bp, ">\n" 407 + " "); 567 408 ahd_controller_info(ahd, ahd_info); 568 409 strcat(bp, ahd_info); 569 410 ··· 587 432 return rtn; 588 433 } 589 434 590 - static inline struct scsi_target ** 435 + static struct scsi_target ** 591 436 ahd_linux_target_in_softc(struct scsi_target *starget) 592 437 { 593 438 struct ahd_softc *ahd = ··· 1146 991 char *p; 1147 992 char *end; 1148 993 1149 - static struct { 994 + static const struct { 1150 995 const char *name; 1151 996 uint32_t *flag; 1152 997 } options[] = { ··· 1378 1223 * Lookup and commit any modified IO Cell options. 1379 1224 */ 1380 1225 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) { 1381 - struct ahd_linux_iocell_opts *iocell_opts; 1226 + const struct ahd_linux_iocell_opts *iocell_opts; 1382 1227 1383 1228 iocell_opts = &aic79xx_iocell_info[ahd->unit]; 1384 1229 if (iocell_opts->precomp != AIC79XX_DEFAULT_PRECOMP) ··· 2768 2613 uint8_t precomp; 2769 2614 2770 2615 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) { 2771 - struct ahd_linux_iocell_opts *iocell_opts; 2616 + const struct ahd_linux_iocell_opts *iocell_opts; 2772 2617 2773 2618 iocell_opts = &aic79xx_iocell_info[ahd->unit]; 2774 2619 precomp = iocell_opts->precomp;
+9 -168
drivers/scsi/aic7xxx/aic79xx_osm.h
··· 222 222 /***************************** Timer Facilities *******************************/ 223 223 #define ahd_timer_init init_timer 224 224 #define ahd_timer_stop del_timer_sync 225 - typedef void ahd_linux_callback_t (u_long); 226 - static __inline void ahd_timer_reset(ahd_timer_t *timer, int usec, 227 - ahd_callback_t *func, void *arg); 228 - 229 - static __inline void 230 - ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg) 231 - { 232 - struct ahd_softc *ahd; 233 - 234 - ahd = (struct ahd_softc *)arg; 235 - del_timer(timer); 236 - timer->data = (u_long)arg; 237 - timer->expires = jiffies + (usec * HZ)/1000000; 238 - timer->function = (ahd_linux_callback_t*)func; 239 - add_timer(timer); 240 - } 241 225 242 226 /***************************** SMP support ************************************/ 243 227 #include <linux/spinlock.h> ··· 360 376 #define AHD_LINUX_NOIRQ ((uint32_t)~0) 361 377 uint32_t irq; /* IRQ for this adapter */ 362 378 uint32_t bios_address; 363 - uint32_t mem_busaddr; /* Mem Base Addr */ 379 + resource_size_t mem_busaddr; /* Mem Base Addr */ 364 380 }; 365 381 366 382 /************************** OS Utility Wrappers *******************************/ ··· 370 386 #define malloc(size, type, flags) kmalloc(size, flags) 371 387 #define free(ptr, type) kfree(ptr) 372 388 373 - static __inline void ahd_delay(long); 374 - static __inline void 375 - ahd_delay(long usec) 376 - { 377 - /* 378 - * udelay on Linux can have problems for 379 - * multi-millisecond waits. Wait at most 380 - * 1024us per call. 381 - */ 382 - while (usec > 0) { 383 - udelay(usec % 1024); 384 - usec -= 1024; 385 - } 386 - } 387 - 389 + void ahd_delay(long); 388 390 389 391 /***************************** Low Level I/O **********************************/ 390 - static __inline uint8_t ahd_inb(struct ahd_softc * ahd, long port); 391 - static __inline uint16_t ahd_inw_atomic(struct ahd_softc * ahd, long port); 392 - static __inline void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); 393 - static __inline void ahd_outw_atomic(struct ahd_softc * ahd, 392 + uint8_t ahd_inb(struct ahd_softc * ahd, long port); 393 + void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); 394 + void ahd_outw_atomic(struct ahd_softc * ahd, 394 395 long port, uint16_t val); 395 - static __inline void ahd_outsb(struct ahd_softc * ahd, long port, 396 + void ahd_outsb(struct ahd_softc * ahd, long port, 396 397 uint8_t *, int count); 397 - static __inline void ahd_insb(struct ahd_softc * ahd, long port, 398 + void ahd_insb(struct ahd_softc * ahd, long port, 398 399 uint8_t *, int count); 399 - 400 - static __inline uint8_t 401 - ahd_inb(struct ahd_softc * ahd, long port) 402 - { 403 - uint8_t x; 404 - 405 - if (ahd->tags[0] == BUS_SPACE_MEMIO) { 406 - x = readb(ahd->bshs[0].maddr + port); 407 - } else { 408 - x = inb(ahd->bshs[(port) >> 8].ioport + ((port) & 0xFF)); 409 - } 410 - mb(); 411 - return (x); 412 - } 413 - 414 - static __inline uint16_t 415 - ahd_inw_atomic(struct ahd_softc * ahd, long port) 416 - { 417 - uint8_t x; 418 - 419 - if (ahd->tags[0] == BUS_SPACE_MEMIO) { 420 - x = readw(ahd->bshs[0].maddr + port); 421 - } else { 422 - x = inw(ahd->bshs[(port) >> 8].ioport + ((port) & 0xFF)); 423 - } 424 - mb(); 425 - return (x); 426 - } 427 - 428 - static __inline void 429 - ahd_outb(struct ahd_softc * ahd, long port, uint8_t val) 430 - { 431 - if (ahd->tags[0] == BUS_SPACE_MEMIO) { 432 - writeb(val, ahd->bshs[0].maddr + port); 433 - } else { 434 - outb(val, ahd->bshs[(port) >> 8].ioport + (port & 0xFF)); 435 - } 436 - mb(); 437 - } 438 - 439 - static __inline void 440 - ahd_outw_atomic(struct ahd_softc * ahd, long port, uint16_t val) 441 - { 442 - if (ahd->tags[0] == BUS_SPACE_MEMIO) { 443 - writew(val, ahd->bshs[0].maddr + port); 444 - } else { 445 - outw(val, ahd->bshs[(port) >> 8].ioport + (port & 0xFF)); 446 - } 447 - mb(); 448 - } 449 - 450 - static __inline void 451 - ahd_outsb(struct ahd_softc * ahd, long port, uint8_t *array, int count) 452 - { 453 - int i; 454 - 455 - /* 456 - * There is probably a more efficient way to do this on Linux 457 - * but we don't use this for anything speed critical and this 458 - * should work. 459 - */ 460 - for (i = 0; i < count; i++) 461 - ahd_outb(ahd, port, *array++); 462 - } 463 - 464 - static __inline void 465 - ahd_insb(struct ahd_softc * ahd, long port, uint8_t *array, int count) 466 - { 467 - int i; 468 - 469 - /* 470 - * There is probably a more efficient way to do this on Linux 471 - * but we don't use this for anything speed critical and this 472 - * should work. 473 - */ 474 - for (i = 0; i < count; i++) 475 - *array++ = ahd_inb(ahd, port); 476 - } 477 400 478 401 /**************************** Initialization **********************************/ 479 402 int ahd_linux_register_host(struct ahd_softc *, ··· 484 593 int ahd_pci_map_registers(struct ahd_softc *ahd); 485 594 int ahd_pci_map_int(struct ahd_softc *ahd); 486 595 487 - static __inline uint32_t ahd_pci_read_config(ahd_dev_softc_t pci, 596 + uint32_t ahd_pci_read_config(ahd_dev_softc_t pci, 488 597 int reg, int width); 489 - 490 - static __inline uint32_t 491 - ahd_pci_read_config(ahd_dev_softc_t pci, int reg, int width) 492 - { 493 - switch (width) { 494 - case 1: 495 - { 496 - uint8_t retval; 497 - 498 - pci_read_config_byte(pci, reg, &retval); 499 - return (retval); 500 - } 501 - case 2: 502 - { 503 - uint16_t retval; 504 - pci_read_config_word(pci, reg, &retval); 505 - return (retval); 506 - } 507 - case 4: 508 - { 509 - uint32_t retval; 510 - pci_read_config_dword(pci, reg, &retval); 511 - return (retval); 512 - } 513 - default: 514 - panic("ahd_pci_read_config: Read size too big"); 515 - /* NOTREACHED */ 516 - return (0); 517 - } 518 - } 519 - 520 - static __inline void ahd_pci_write_config(ahd_dev_softc_t pci, 598 + void ahd_pci_write_config(ahd_dev_softc_t pci, 521 599 int reg, uint32_t value, 522 600 int width); 523 - 524 - static __inline void 525 - ahd_pci_write_config(ahd_dev_softc_t pci, int reg, uint32_t value, int width) 526 - { 527 - switch (width) { 528 - case 1: 529 - pci_write_config_byte(pci, reg, value); 530 - break; 531 - case 2: 532 - pci_write_config_word(pci, reg, value); 533 - break; 534 - case 4: 535 - pci_write_config_dword(pci, reg, value); 536 - break; 537 - default: 538 - panic("ahd_pci_write_config: Write size too big"); 539 - /* NOTREACHED */ 540 - } 541 - } 542 601 543 602 static __inline int ahd_get_pci_function(ahd_dev_softc_t); 544 603 static __inline int
+17 -16
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
··· 49 49 ID2C(x), \ 50 50 ID2C(IDIROC(x)) 51 51 52 - static struct pci_device_id ahd_linux_pci_id_table[] = { 52 + static const struct pci_device_id ahd_linux_pci_id_table[] = { 53 53 /* aic7901 based controllers */ 54 54 ID(ID_AHA_29320A), 55 55 ID(ID_AHA_29320ALP), ··· 159 159 char buf[80]; 160 160 struct ahd_softc *ahd; 161 161 ahd_dev_softc_t pci; 162 - struct ahd_pci_identity *entry; 162 + const struct ahd_pci_identity *entry; 163 163 char *name; 164 164 int error; 165 165 struct device *dev = &pdev->dev; ··· 249 249 } 250 250 251 251 static int 252 - ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, u_long *base, 253 - u_long *base2) 252 + ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, resource_size_t *base, 253 + resource_size_t *base2) 254 254 { 255 255 *base = pci_resource_start(ahd->dev_softc, 0); 256 256 /* ··· 272 272 273 273 static int 274 274 ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd, 275 - u_long *bus_addr, 275 + resource_size_t *bus_addr, 276 276 uint8_t __iomem **maddr) 277 277 { 278 - u_long start; 279 - u_long base_page; 278 + resource_size_t start; 279 + resource_size_t base_page; 280 280 u_long base_offset; 281 281 int error = 0; 282 282 ··· 310 310 ahd_pci_map_registers(struct ahd_softc *ahd) 311 311 { 312 312 uint32_t command; 313 - u_long base; 313 + resource_size_t base; 314 314 uint8_t __iomem *maddr; 315 315 int error; 316 316 ··· 346 346 } else 347 347 command |= PCIM_CMD_MEMEN; 348 348 } else if (bootverbose) { 349 - printf("aic79xx: PCI%d:%d:%d MEM region 0x%lx " 349 + printf("aic79xx: PCI%d:%d:%d MEM region 0x%llx " 350 350 "unavailable. Cannot memory map device.\n", 351 351 ahd_get_pci_bus(ahd->dev_softc), 352 352 ahd_get_pci_slot(ahd->dev_softc), 353 353 ahd_get_pci_function(ahd->dev_softc), 354 - base); 354 + (unsigned long long)base); 355 355 } 356 356 357 357 if (maddr == NULL) { 358 - u_long base2; 358 + resource_size_t base2; 359 359 360 360 error = ahd_linux_pci_reserve_io_regions(ahd, &base, &base2); 361 361 if (error == 0) { 362 362 ahd->tags[0] = BUS_SPACE_PIO; 363 363 ahd->tags[1] = BUS_SPACE_PIO; 364 - ahd->bshs[0].ioport = base; 365 - ahd->bshs[1].ioport = base2; 364 + ahd->bshs[0].ioport = (u_long)base; 365 + ahd->bshs[1].ioport = (u_long)base2; 366 366 command |= PCIM_CMD_PORTEN; 367 367 } else { 368 - printf("aic79xx: PCI%d:%d:%d IO regions 0x%lx and 0x%lx" 369 - "unavailable. Cannot map device.\n", 368 + printf("aic79xx: PCI%d:%d:%d IO regions 0x%llx and " 369 + "0x%llx unavailable. Cannot map device.\n", 370 370 ahd_get_pci_bus(ahd->dev_softc), 371 371 ahd_get_pci_slot(ahd->dev_softc), 372 372 ahd_get_pci_function(ahd->dev_softc), 373 - base, base2); 373 + (unsigned long long)base, 374 + (unsigned long long)base2); 374 375 } 375 376 } 376 377 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, command, 4);
+4 -4
drivers/scsi/aic7xxx/aic79xx_pci.c
··· 97 97 static ahd_device_setup_t ahd_aic7902_setup; 98 98 static ahd_device_setup_t ahd_aic790X_setup; 99 99 100 - static struct ahd_pci_identity ahd_pci_ident_table [] = 100 + static const struct ahd_pci_identity ahd_pci_ident_table[] = 101 101 { 102 102 /* aic7901 based controllers */ 103 103 { ··· 253 253 static void ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat); 254 254 static void ahd_pci_intr(struct ahd_softc *ahd); 255 255 256 - struct ahd_pci_identity * 256 + const struct ahd_pci_identity * 257 257 ahd_find_pci_device(ahd_dev_softc_t pci) 258 258 { 259 259 uint64_t full_id; ··· 261 261 uint16_t vendor; 262 262 uint16_t subdevice; 263 263 uint16_t subvendor; 264 - struct ahd_pci_identity *entry; 264 + const struct ahd_pci_identity *entry; 265 265 u_int i; 266 266 267 267 vendor = ahd_pci_read_config(pci, PCIR_DEVVENDOR, /*bytes*/2); ··· 292 292 } 293 293 294 294 int 295 - ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry) 295 + ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry) 296 296 { 297 297 struct scb_data *shared_scb_data; 298 298 u_int command;
+1 -1
drivers/scsi/aic7xxx/aic79xx_proc.c
··· 57 57 * Table of syncrates that don't follow the "divisible by 4" 58 58 * rule. This table will be expanded in future SCSI specs. 59 59 */ 60 - static struct { 60 + static const struct { 61 61 u_int period_factor; 62 62 u_int period; /* in 100ths of ns */ 63 63 } scsi_syncrates[] = {
+165 -1002
drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
··· 48 48 #endif 49 49 50 50 #if AIC_DEBUG_REGISTERS 51 - ahd_reg_print_t ahd_clrerr_print; 52 - #else 53 - #define ahd_clrerr_print(regvalue, cur_col, wrap) \ 54 - ahd_print_register(NULL, 0, "CLRERR", 0x04, regvalue, cur_col, wrap) 55 - #endif 56 - 57 - #if AIC_DEBUG_REGISTERS 58 51 ahd_reg_print_t ahd_hcntrl_print; 59 52 #else 60 53 #define ahd_hcntrl_print(regvalue, cur_col, wrap) \ ··· 160 167 #endif 161 168 162 169 #if AIC_DEBUG_REGISTERS 163 - ahd_reg_print_t ahd_arbctl_print; 164 - #else 165 - #define ahd_arbctl_print(regvalue, cur_col, wrap) \ 166 - ahd_print_register(NULL, 0, "ARBCTL", 0x1b, regvalue, cur_col, wrap) 167 - #endif 168 - 169 - #if AIC_DEBUG_REGISTERS 170 170 ahd_reg_print_t ahd_sg_cache_pre_print; 171 171 #else 172 172 #define ahd_sg_cache_pre_print(regvalue, cur_col, wrap) \ ··· 174 188 #endif 175 189 176 190 #if AIC_DEBUG_REGISTERS 177 - ahd_reg_print_t ahd_typeptr_print; 178 - #else 179 - #define ahd_typeptr_print(regvalue, cur_col, wrap) \ 180 - ahd_print_register(NULL, 0, "TYPEPTR", 0x20, regvalue, cur_col, wrap) 181 - #endif 182 - 183 - #if AIC_DEBUG_REGISTERS 184 - ahd_reg_print_t ahd_tagptr_print; 185 - #else 186 - #define ahd_tagptr_print(regvalue, cur_col, wrap) \ 187 - ahd_print_register(NULL, 0, "TAGPTR", 0x21, regvalue, cur_col, wrap) 188 - #endif 189 - 190 - #if AIC_DEBUG_REGISTERS 191 191 ahd_reg_print_t ahd_lunptr_print; 192 192 #else 193 193 #define ahd_lunptr_print(regvalue, cur_col, wrap) \ 194 194 ahd_print_register(NULL, 0, "LUNPTR", 0x22, regvalue, cur_col, wrap) 195 - #endif 196 - 197 - #if AIC_DEBUG_REGISTERS 198 - ahd_reg_print_t ahd_datalenptr_print; 199 - #else 200 - #define ahd_datalenptr_print(regvalue, cur_col, wrap) \ 201 - ahd_print_register(NULL, 0, "DATALENPTR", 0x23, regvalue, cur_col, wrap) 202 - #endif 203 - 204 - #if AIC_DEBUG_REGISTERS 205 - ahd_reg_print_t ahd_statlenptr_print; 206 - #else 207 - #define ahd_statlenptr_print(regvalue, cur_col, wrap) \ 208 - ahd_print_register(NULL, 0, "STATLENPTR", 0x24, regvalue, cur_col, wrap) 209 195 #endif 210 196 211 197 #if AIC_DEBUG_REGISTERS ··· 216 258 #endif 217 259 218 260 #if AIC_DEBUG_REGISTERS 219 - ahd_reg_print_t ahd_idptr_print; 220 - #else 221 - #define ahd_idptr_print(regvalue, cur_col, wrap) \ 222 - ahd_print_register(NULL, 0, "IDPTR", 0x2a, regvalue, cur_col, wrap) 223 - #endif 224 - 225 - #if AIC_DEBUG_REGISTERS 226 261 ahd_reg_print_t ahd_abrtbyteptr_print; 227 262 #else 228 263 #define ahd_abrtbyteptr_print(regvalue, cur_col, wrap) \ ··· 227 276 #else 228 277 #define ahd_abrtbitptr_print(regvalue, cur_col, wrap) \ 229 278 ahd_print_register(NULL, 0, "ABRTBITPTR", 0x2c, regvalue, cur_col, wrap) 230 - #endif 231 - 232 - #if AIC_DEBUG_REGISTERS 233 - ahd_reg_print_t ahd_maxcmdbytes_print; 234 - #else 235 - #define ahd_maxcmdbytes_print(regvalue, cur_col, wrap) \ 236 - ahd_print_register(NULL, 0, "MAXCMDBYTES", 0x2d, regvalue, cur_col, wrap) 237 - #endif 238 - 239 - #if AIC_DEBUG_REGISTERS 240 - ahd_reg_print_t ahd_maxcmd2rcv_print; 241 - #else 242 - #define ahd_maxcmd2rcv_print(regvalue, cur_col, wrap) \ 243 - ahd_print_register(NULL, 0, "MAXCMD2RCV", 0x2e, regvalue, cur_col, wrap) 244 - #endif 245 - 246 - #if AIC_DEBUG_REGISTERS 247 - ahd_reg_print_t ahd_shortthresh_print; 248 - #else 249 - #define ahd_shortthresh_print(regvalue, cur_col, wrap) \ 250 - ahd_print_register(NULL, 0, "SHORTTHRESH", 0x2f, regvalue, cur_col, wrap) 251 279 #endif 252 280 253 281 #if AIC_DEBUG_REGISTERS ··· 258 328 #endif 259 329 260 330 #if AIC_DEBUG_REGISTERS 261 - ahd_reg_print_t ahd_lqrsvd01_print; 262 - #else 263 - #define ahd_lqrsvd01_print(regvalue, cur_col, wrap) \ 264 - ahd_print_register(NULL, 0, "LQRSVD01", 0x34, regvalue, cur_col, wrap) 265 - #endif 266 - 267 - #if AIC_DEBUG_REGISTERS 268 - ahd_reg_print_t ahd_lqrsvd16_print; 269 - #else 270 - #define ahd_lqrsvd16_print(regvalue, cur_col, wrap) \ 271 - ahd_print_register(NULL, 0, "LQRSVD16", 0x35, regvalue, cur_col, wrap) 272 - #endif 273 - 274 - #if AIC_DEBUG_REGISTERS 275 - ahd_reg_print_t ahd_lqrsvd17_print; 276 - #else 277 - #define ahd_lqrsvd17_print(regvalue, cur_col, wrap) \ 278 - ahd_print_register(NULL, 0, "LQRSVD17", 0x36, regvalue, cur_col, wrap) 279 - #endif 280 - 281 - #if AIC_DEBUG_REGISTERS 282 - ahd_reg_print_t ahd_cmdrsvd0_print; 283 - #else 284 - #define ahd_cmdrsvd0_print(regvalue, cur_col, wrap) \ 285 - ahd_print_register(NULL, 0, "CMDRSVD0", 0x37, regvalue, cur_col, wrap) 286 - #endif 287 - 288 - #if AIC_DEBUG_REGISTERS 289 - ahd_reg_print_t ahd_lqctl0_print; 290 - #else 291 - #define ahd_lqctl0_print(regvalue, cur_col, wrap) \ 292 - ahd_print_register(NULL, 0, "LQCTL0", 0x38, regvalue, cur_col, wrap) 293 - #endif 294 - 295 - #if AIC_DEBUG_REGISTERS 296 331 ahd_reg_print_t ahd_lqctl1_print; 297 332 #else 298 333 #define ahd_lqctl1_print(regvalue, cur_col, wrap) \ ··· 265 370 #endif 266 371 267 372 #if AIC_DEBUG_REGISTERS 268 - ahd_reg_print_t ahd_scsbist0_print; 269 - #else 270 - #define ahd_scsbist0_print(regvalue, cur_col, wrap) \ 271 - ahd_print_register(NULL, 0, "SCSBIST0", 0x39, regvalue, cur_col, wrap) 272 - #endif 273 - 274 - #if AIC_DEBUG_REGISTERS 275 373 ahd_reg_print_t ahd_lqctl2_print; 276 374 #else 277 375 #define ahd_lqctl2_print(regvalue, cur_col, wrap) \ 278 376 ahd_print_register(NULL, 0, "LQCTL2", 0x39, regvalue, cur_col, wrap) 279 - #endif 280 - 281 - #if AIC_DEBUG_REGISTERS 282 - ahd_reg_print_t ahd_scsbist1_print; 283 - #else 284 - #define ahd_scsbist1_print(regvalue, cur_col, wrap) \ 285 - ahd_print_register(NULL, 0, "SCSBIST1", 0x3a, regvalue, cur_col, wrap) 286 377 #endif 287 378 288 379 #if AIC_DEBUG_REGISTERS ··· 293 412 #endif 294 413 295 414 #if AIC_DEBUG_REGISTERS 296 - ahd_reg_print_t ahd_dlcount_print; 297 - #else 298 - #define ahd_dlcount_print(regvalue, cur_col, wrap) \ 299 - ahd_print_register(NULL, 0, "DLCOUNT", 0x3c, regvalue, cur_col, wrap) 300 - #endif 301 - 302 - #if AIC_DEBUG_REGISTERS 303 - ahd_reg_print_t ahd_businitid_print; 304 - #else 305 - #define ahd_businitid_print(regvalue, cur_col, wrap) \ 306 - ahd_print_register(NULL, 0, "BUSINITID", 0x3c, regvalue, cur_col, wrap) 307 - #endif 308 - 309 - #if AIC_DEBUG_REGISTERS 310 415 ahd_reg_print_t ahd_sxfrctl1_print; 311 416 #else 312 417 #define ahd_sxfrctl1_print(regvalue, cur_col, wrap) \ 313 418 ahd_print_register(NULL, 0, "SXFRCTL1", 0x3d, regvalue, cur_col, wrap) 314 - #endif 315 - 316 - #if AIC_DEBUG_REGISTERS 317 - ahd_reg_print_t ahd_bustargid_print; 318 - #else 319 - #define ahd_bustargid_print(regvalue, cur_col, wrap) \ 320 - ahd_print_register(NULL, 0, "BUSTARGID", 0x3e, regvalue, cur_col, wrap) 321 - #endif 322 - 323 - #if AIC_DEBUG_REGISTERS 324 - ahd_reg_print_t ahd_sxfrctl2_print; 325 - #else 326 - #define ahd_sxfrctl2_print(regvalue, cur_col, wrap) \ 327 - ahd_print_register(NULL, 0, "SXFRCTL2", 0x3e, regvalue, cur_col, wrap) 328 419 #endif 329 420 330 421 #if AIC_DEBUG_REGISTERS ··· 307 454 #endif 308 455 309 456 #if AIC_DEBUG_REGISTERS 310 - ahd_reg_print_t ahd_scsisigo_print; 311 - #else 312 - #define ahd_scsisigo_print(regvalue, cur_col, wrap) \ 313 - ahd_print_register(NULL, 0, "SCSISIGO", 0x40, regvalue, cur_col, wrap) 314 - #endif 315 - 316 - #if AIC_DEBUG_REGISTERS 317 457 ahd_reg_print_t ahd_multargid_print; 318 458 #else 319 459 #define ahd_multargid_print(regvalue, cur_col, wrap) \ 320 460 ahd_print_register(NULL, 0, "MULTARGID", 0x40, regvalue, cur_col, wrap) 461 + #endif 462 + 463 + #if AIC_DEBUG_REGISTERS 464 + ahd_reg_print_t ahd_scsisigo_print; 465 + #else 466 + #define ahd_scsisigo_print(regvalue, cur_col, wrap) \ 467 + ahd_print_register(NULL, 0, "SCSISIGO", 0x40, regvalue, cur_col, wrap) 321 468 #endif 322 469 323 470 #if AIC_DEBUG_REGISTERS ··· 332 479 #else 333 480 #define ahd_scsiphase_print(regvalue, cur_col, wrap) \ 334 481 ahd_print_register(NULL, 0, "SCSIPHASE", 0x42, regvalue, cur_col, wrap) 335 - #endif 336 - 337 - #if AIC_DEBUG_REGISTERS 338 - ahd_reg_print_t ahd_scsidat0_img_print; 339 - #else 340 - #define ahd_scsidat0_img_print(regvalue, cur_col, wrap) \ 341 - ahd_print_register(NULL, 0, "SCSIDAT0_IMG", 0x43, regvalue, cur_col, wrap) 342 482 #endif 343 483 344 484 #if AIC_DEBUG_REGISTERS ··· 377 531 #endif 378 532 379 533 #if AIC_DEBUG_REGISTERS 380 - ahd_reg_print_t ahd_clrsint0_print; 381 - #else 382 - #define ahd_clrsint0_print(regvalue, cur_col, wrap) \ 383 - ahd_print_register(NULL, 0, "CLRSINT0", 0x4b, regvalue, cur_col, wrap) 384 - #endif 385 - 386 - #if AIC_DEBUG_REGISTERS 387 534 ahd_reg_print_t ahd_sstat0_print; 388 535 #else 389 536 #define ahd_sstat0_print(regvalue, cur_col, wrap) \ ··· 391 552 #endif 392 553 393 554 #if AIC_DEBUG_REGISTERS 394 - ahd_reg_print_t ahd_clrsint1_print; 555 + ahd_reg_print_t ahd_clrsint0_print; 395 556 #else 396 - #define ahd_clrsint1_print(regvalue, cur_col, wrap) \ 397 - ahd_print_register(NULL, 0, "CLRSINT1", 0x4c, regvalue, cur_col, wrap) 557 + #define ahd_clrsint0_print(regvalue, cur_col, wrap) \ 558 + ahd_print_register(NULL, 0, "CLRSINT0", 0x4b, regvalue, cur_col, wrap) 398 559 #endif 399 560 400 561 #if AIC_DEBUG_REGISTERS ··· 405 566 #endif 406 567 407 568 #if AIC_DEBUG_REGISTERS 569 + ahd_reg_print_t ahd_clrsint1_print; 570 + #else 571 + #define ahd_clrsint1_print(regvalue, cur_col, wrap) \ 572 + ahd_print_register(NULL, 0, "CLRSINT1", 0x4c, regvalue, cur_col, wrap) 573 + #endif 574 + 575 + #if AIC_DEBUG_REGISTERS 408 576 ahd_reg_print_t ahd_sstat2_print; 409 577 #else 410 578 #define ahd_sstat2_print(regvalue, cur_col, wrap) \ 411 579 ahd_print_register(NULL, 0, "SSTAT2", 0x4d, regvalue, cur_col, wrap) 412 - #endif 413 - 414 - #if AIC_DEBUG_REGISTERS 415 - ahd_reg_print_t ahd_simode2_print; 416 - #else 417 - #define ahd_simode2_print(regvalue, cur_col, wrap) \ 418 - ahd_print_register(NULL, 0, "SIMODE2", 0x4d, regvalue, cur_col, wrap) 419 580 #endif 420 581 421 582 #if AIC_DEBUG_REGISTERS ··· 461 622 #endif 462 623 463 624 #if AIC_DEBUG_REGISTERS 464 - ahd_reg_print_t ahd_clrlqiint0_print; 465 - #else 466 - #define ahd_clrlqiint0_print(regvalue, cur_col, wrap) \ 467 - ahd_print_register(NULL, 0, "CLRLQIINT0", 0x50, regvalue, cur_col, wrap) 468 - #endif 469 - 470 - #if AIC_DEBUG_REGISTERS 471 625 ahd_reg_print_t ahd_lqimode0_print; 472 626 #else 473 627 #define ahd_lqimode0_print(regvalue, cur_col, wrap) \ 474 628 ahd_print_register(NULL, 0, "LQIMODE0", 0x50, regvalue, cur_col, wrap) 629 + #endif 630 + 631 + #if AIC_DEBUG_REGISTERS 632 + ahd_reg_print_t ahd_clrlqiint0_print; 633 + #else 634 + #define ahd_clrlqiint0_print(regvalue, cur_col, wrap) \ 635 + ahd_print_register(NULL, 0, "CLRLQIINT0", 0x50, regvalue, cur_col, wrap) 475 636 #endif 476 637 477 638 #if AIC_DEBUG_REGISTERS ··· 629 790 #endif 630 791 631 792 #if AIC_DEBUG_REGISTERS 632 - ahd_reg_print_t ahd_currscb_print; 633 - #else 634 - #define ahd_currscb_print(regvalue, cur_col, wrap) \ 635 - ahd_print_register(NULL, 0, "CURRSCB", 0x5c, regvalue, cur_col, wrap) 636 - #endif 637 - 638 - #if AIC_DEBUG_REGISTERS 639 793 ahd_reg_print_t ahd_seqimode_print; 640 794 #else 641 795 #define ahd_seqimode_print(regvalue, cur_col, wrap) \ 642 796 ahd_print_register(NULL, 0, "SEQIMODE", 0x5c, regvalue, cur_col, wrap) 797 + #endif 798 + 799 + #if AIC_DEBUG_REGISTERS 800 + ahd_reg_print_t ahd_currscb_print; 801 + #else 802 + #define ahd_currscb_print(regvalue, cur_col, wrap) \ 803 + ahd_print_register(NULL, 0, "CURRSCB", 0x5c, regvalue, cur_col, wrap) 643 804 #endif 644 805 645 806 #if AIC_DEBUG_REGISTERS ··· 650 811 #endif 651 812 652 813 #if AIC_DEBUG_REGISTERS 653 - ahd_reg_print_t ahd_crccontrol_print; 654 - #else 655 - #define ahd_crccontrol_print(regvalue, cur_col, wrap) \ 656 - ahd_print_register(NULL, 0, "CRCCONTROL", 0x5d, regvalue, cur_col, wrap) 657 - #endif 658 - 659 - #if AIC_DEBUG_REGISTERS 660 - ahd_reg_print_t ahd_dfftag_print; 661 - #else 662 - #define ahd_dfftag_print(regvalue, cur_col, wrap) \ 663 - ahd_print_register(NULL, 0, "DFFTAG", 0x5e, regvalue, cur_col, wrap) 664 - #endif 665 - 666 - #if AIC_DEBUG_REGISTERS 667 814 ahd_reg_print_t ahd_lastscb_print; 668 815 #else 669 816 #define ahd_lastscb_print(regvalue, cur_col, wrap) \ 670 817 ahd_print_register(NULL, 0, "LASTSCB", 0x5e, regvalue, cur_col, wrap) 671 - #endif 672 - 673 - #if AIC_DEBUG_REGISTERS 674 - ahd_reg_print_t ahd_scsitest_print; 675 - #else 676 - #define ahd_scsitest_print(regvalue, cur_col, wrap) \ 677 - ahd_print_register(NULL, 0, "SCSITEST", 0x5e, regvalue, cur_col, wrap) 678 - #endif 679 - 680 - #if AIC_DEBUG_REGISTERS 681 - ahd_reg_print_t ahd_iopdnctl_print; 682 - #else 683 - #define ahd_iopdnctl_print(regvalue, cur_col, wrap) \ 684 - ahd_print_register(NULL, 0, "IOPDNCTL", 0x5f, regvalue, cur_col, wrap) 685 818 #endif 686 819 687 820 #if AIC_DEBUG_REGISTERS ··· 671 860 #endif 672 861 673 862 #if AIC_DEBUG_REGISTERS 674 - ahd_reg_print_t ahd_dgrpcrci_print; 675 - #else 676 - #define ahd_dgrpcrci_print(regvalue, cur_col, wrap) \ 677 - ahd_print_register(NULL, 0, "DGRPCRCI", 0x60, regvalue, cur_col, wrap) 678 - #endif 679 - 680 - #if AIC_DEBUG_REGISTERS 681 863 ahd_reg_print_t ahd_negperiod_print; 682 864 #else 683 865 #define ahd_negperiod_print(regvalue, cur_col, wrap) \ 684 866 ahd_print_register(NULL, 0, "NEGPERIOD", 0x61, regvalue, cur_col, wrap) 685 - #endif 686 - 687 - #if AIC_DEBUG_REGISTERS 688 - ahd_reg_print_t ahd_packcrci_print; 689 - #else 690 - #define ahd_packcrci_print(regvalue, cur_col, wrap) \ 691 - ahd_print_register(NULL, 0, "PACKCRCI", 0x62, regvalue, cur_col, wrap) 692 867 #endif 693 868 694 869 #if AIC_DEBUG_REGISTERS ··· 727 930 #endif 728 931 729 932 #if AIC_DEBUG_REGISTERS 730 - ahd_reg_print_t ahd_pll960ctl0_print; 731 - #else 732 - #define ahd_pll960ctl0_print(regvalue, cur_col, wrap) \ 733 - ahd_print_register(NULL, 0, "PLL960CTL0", 0x68, regvalue, cur_col, wrap) 734 - #endif 735 - 736 - #if AIC_DEBUG_REGISTERS 737 933 ahd_reg_print_t ahd_shcnt_print; 738 934 #else 739 935 #define ahd_shcnt_print(regvalue, cur_col, wrap) \ ··· 741 951 #endif 742 952 743 953 #if AIC_DEBUG_REGISTERS 744 - ahd_reg_print_t ahd_pll960ctl1_print; 745 - #else 746 - #define ahd_pll960ctl1_print(regvalue, cur_col, wrap) \ 747 - ahd_print_register(NULL, 0, "PLL960CTL1", 0x69, regvalue, cur_col, wrap) 748 - #endif 749 - 750 - #if AIC_DEBUG_REGISTERS 751 - ahd_reg_print_t ahd_pll960cnt0_print; 752 - #else 753 - #define ahd_pll960cnt0_print(regvalue, cur_col, wrap) \ 754 - ahd_print_register(NULL, 0, "PLL960CNT0", 0x6a, regvalue, cur_col, wrap) 755 - #endif 756 - 757 - #if AIC_DEBUG_REGISTERS 758 - ahd_reg_print_t ahd_xsig_print; 759 - #else 760 - #define ahd_xsig_print(regvalue, cur_col, wrap) \ 761 - ahd_print_register(NULL, 0, "XSIG", 0x6a, regvalue, cur_col, wrap) 762 - #endif 763 - 764 - #if AIC_DEBUG_REGISTERS 765 954 ahd_reg_print_t ahd_seloid_print; 766 955 #else 767 956 #define ahd_seloid_print(regvalue, cur_col, wrap) \ 768 957 ahd_print_register(NULL, 0, "SELOID", 0x6b, regvalue, cur_col, wrap) 769 - #endif 770 - 771 - #if AIC_DEBUG_REGISTERS 772 - ahd_reg_print_t ahd_pll400ctl0_print; 773 - #else 774 - #define ahd_pll400ctl0_print(regvalue, cur_col, wrap) \ 775 - ahd_print_register(NULL, 0, "PLL400CTL0", 0x6c, regvalue, cur_col, wrap) 776 - #endif 777 - 778 - #if AIC_DEBUG_REGISTERS 779 - ahd_reg_print_t ahd_fairness_print; 780 - #else 781 - #define ahd_fairness_print(regvalue, cur_col, wrap) \ 782 - ahd_print_register(NULL, 0, "FAIRNESS", 0x6c, regvalue, cur_col, wrap) 783 - #endif 784 - 785 - #if AIC_DEBUG_REGISTERS 786 - ahd_reg_print_t ahd_pll400ctl1_print; 787 - #else 788 - #define ahd_pll400ctl1_print(regvalue, cur_col, wrap) \ 789 - ahd_print_register(NULL, 0, "PLL400CTL1", 0x6d, regvalue, cur_col, wrap) 790 - #endif 791 - 792 - #if AIC_DEBUG_REGISTERS 793 - ahd_reg_print_t ahd_unfairness_print; 794 - #else 795 - #define ahd_unfairness_print(regvalue, cur_col, wrap) \ 796 - ahd_print_register(NULL, 0, "UNFAIRNESS", 0x6e, regvalue, cur_col, wrap) 797 - #endif 798 - 799 - #if AIC_DEBUG_REGISTERS 800 - ahd_reg_print_t ahd_pll400cnt0_print; 801 - #else 802 - #define ahd_pll400cnt0_print(regvalue, cur_col, wrap) \ 803 - ahd_print_register(NULL, 0, "PLL400CNT0", 0x6e, regvalue, cur_col, wrap) 804 958 #endif 805 959 806 960 #if AIC_DEBUG_REGISTERS ··· 755 1021 #endif 756 1022 757 1023 #if AIC_DEBUG_REGISTERS 758 - ahd_reg_print_t ahd_plldelay_print; 759 - #else 760 - #define ahd_plldelay_print(regvalue, cur_col, wrap) \ 761 - ahd_print_register(NULL, 0, "PLLDELAY", 0x70, regvalue, cur_col, wrap) 762 - #endif 763 - 764 - #if AIC_DEBUG_REGISTERS 765 - ahd_reg_print_t ahd_hodmaadr_print; 766 - #else 767 - #define ahd_hodmaadr_print(regvalue, cur_col, wrap) \ 768 - ahd_print_register(NULL, 0, "HODMAADR", 0x70, regvalue, cur_col, wrap) 769 - #endif 770 - 771 - #if AIC_DEBUG_REGISTERS 772 - ahd_reg_print_t ahd_hodmacnt_print; 773 - #else 774 - #define ahd_hodmacnt_print(regvalue, cur_col, wrap) \ 775 - ahd_print_register(NULL, 0, "HODMACNT", 0x78, regvalue, cur_col, wrap) 776 - #endif 777 - 778 - #if AIC_DEBUG_REGISTERS 779 1024 ahd_reg_print_t ahd_hcnt_print; 780 1025 #else 781 1026 #define ahd_hcnt_print(regvalue, cur_col, wrap) \ 782 1027 ahd_print_register(NULL, 0, "HCNT", 0x78, regvalue, cur_col, wrap) 783 - #endif 784 - 785 - #if AIC_DEBUG_REGISTERS 786 - ahd_reg_print_t ahd_hodmaen_print; 787 - #else 788 - #define ahd_hodmaen_print(regvalue, cur_col, wrap) \ 789 - ahd_print_register(NULL, 0, "HODMAEN", 0x7a, regvalue, cur_col, wrap) 790 - #endif 791 - 792 - #if AIC_DEBUG_REGISTERS 793 - ahd_reg_print_t ahd_scbhaddr_print; 794 - #else 795 - #define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ 796 - ahd_print_register(NULL, 0, "SCBHADDR", 0x7c, regvalue, cur_col, wrap) 797 1028 #endif 798 1029 799 1030 #if AIC_DEBUG_REGISTERS ··· 769 1070 #endif 770 1071 771 1072 #if AIC_DEBUG_REGISTERS 772 - ahd_reg_print_t ahd_scbhcnt_print; 1073 + ahd_reg_print_t ahd_scbhaddr_print; 773 1074 #else 774 - #define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ 775 - ahd_print_register(NULL, 0, "SCBHCNT", 0x84, regvalue, cur_col, wrap) 1075 + #define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ 1076 + ahd_print_register(NULL, 0, "SCBHADDR", 0x7c, regvalue, cur_col, wrap) 776 1077 #endif 777 1078 778 1079 #if AIC_DEBUG_REGISTERS ··· 783 1084 #endif 784 1085 785 1086 #if AIC_DEBUG_REGISTERS 1087 + ahd_reg_print_t ahd_scbhcnt_print; 1088 + #else 1089 + #define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ 1090 + ahd_print_register(NULL, 0, "SCBHCNT", 0x84, regvalue, cur_col, wrap) 1091 + #endif 1092 + 1093 + #if AIC_DEBUG_REGISTERS 786 1094 ahd_reg_print_t ahd_dff_thrsh_print; 787 1095 #else 788 1096 #define ahd_dff_thrsh_print(regvalue, cur_col, wrap) \ 789 1097 ahd_print_register(NULL, 0, "DFF_THRSH", 0x88, regvalue, cur_col, wrap) 790 - #endif 791 - 792 - #if AIC_DEBUG_REGISTERS 793 - ahd_reg_print_t ahd_romaddr_print; 794 - #else 795 - #define ahd_romaddr_print(regvalue, cur_col, wrap) \ 796 - ahd_print_register(NULL, 0, "ROMADDR", 0x8a, regvalue, cur_col, wrap) 797 - #endif 798 - 799 - #if AIC_DEBUG_REGISTERS 800 - ahd_reg_print_t ahd_romcntrl_print; 801 - #else 802 - #define ahd_romcntrl_print(regvalue, cur_col, wrap) \ 803 - ahd_print_register(NULL, 0, "ROMCNTRL", 0x8d, regvalue, cur_col, wrap) 804 - #endif 805 - 806 - #if AIC_DEBUG_REGISTERS 807 - ahd_reg_print_t ahd_romdata_print; 808 - #else 809 - #define ahd_romdata_print(regvalue, cur_col, wrap) \ 810 - ahd_print_register(NULL, 0, "ROMDATA", 0x8e, regvalue, cur_col, wrap) 811 - #endif 812 - 813 - #if AIC_DEBUG_REGISTERS 814 - ahd_reg_print_t ahd_cmcrxmsg0_print; 815 - #else 816 - #define ahd_cmcrxmsg0_print(regvalue, cur_col, wrap) \ 817 - ahd_print_register(NULL, 0, "CMCRXMSG0", 0x90, regvalue, cur_col, wrap) 818 - #endif 819 - 820 - #if AIC_DEBUG_REGISTERS 821 - ahd_reg_print_t ahd_roenable_print; 822 - #else 823 - #define ahd_roenable_print(regvalue, cur_col, wrap) \ 824 - ahd_print_register(NULL, 0, "ROENABLE", 0x90, regvalue, cur_col, wrap) 825 - #endif 826 - 827 - #if AIC_DEBUG_REGISTERS 828 - ahd_reg_print_t ahd_ovlyrxmsg0_print; 829 - #else 830 - #define ahd_ovlyrxmsg0_print(regvalue, cur_col, wrap) \ 831 - ahd_print_register(NULL, 0, "OVLYRXMSG0", 0x90, regvalue, cur_col, wrap) 832 - #endif 833 - 834 - #if AIC_DEBUG_REGISTERS 835 - ahd_reg_print_t ahd_dchrxmsg0_print; 836 - #else 837 - #define ahd_dchrxmsg0_print(regvalue, cur_col, wrap) \ 838 - ahd_print_register(NULL, 0, "DCHRXMSG0", 0x90, regvalue, cur_col, wrap) 839 - #endif 840 - 841 - #if AIC_DEBUG_REGISTERS 842 - ahd_reg_print_t ahd_ovlyrxmsg1_print; 843 - #else 844 - #define ahd_ovlyrxmsg1_print(regvalue, cur_col, wrap) \ 845 - ahd_print_register(NULL, 0, "OVLYRXMSG1", 0x91, regvalue, cur_col, wrap) 846 - #endif 847 - 848 - #if AIC_DEBUG_REGISTERS 849 - ahd_reg_print_t ahd_nsenable_print; 850 - #else 851 - #define ahd_nsenable_print(regvalue, cur_col, wrap) \ 852 - ahd_print_register(NULL, 0, "NSENABLE", 0x91, regvalue, cur_col, wrap) 853 - #endif 854 - 855 - #if AIC_DEBUG_REGISTERS 856 - ahd_reg_print_t ahd_cmcrxmsg1_print; 857 - #else 858 - #define ahd_cmcrxmsg1_print(regvalue, cur_col, wrap) \ 859 - ahd_print_register(NULL, 0, "CMCRXMSG1", 0x91, regvalue, cur_col, wrap) 860 - #endif 861 - 862 - #if AIC_DEBUG_REGISTERS 863 - ahd_reg_print_t ahd_dchrxmsg1_print; 864 - #else 865 - #define ahd_dchrxmsg1_print(regvalue, cur_col, wrap) \ 866 - ahd_print_register(NULL, 0, "DCHRXMSG1", 0x91, regvalue, cur_col, wrap) 867 - #endif 868 - 869 - #if AIC_DEBUG_REGISTERS 870 - ahd_reg_print_t ahd_dchrxmsg2_print; 871 - #else 872 - #define ahd_dchrxmsg2_print(regvalue, cur_col, wrap) \ 873 - ahd_print_register(NULL, 0, "DCHRXMSG2", 0x92, regvalue, cur_col, wrap) 874 - #endif 875 - 876 - #if AIC_DEBUG_REGISTERS 877 - ahd_reg_print_t ahd_cmcrxmsg2_print; 878 - #else 879 - #define ahd_cmcrxmsg2_print(regvalue, cur_col, wrap) \ 880 - ahd_print_register(NULL, 0, "CMCRXMSG2", 0x92, regvalue, cur_col, wrap) 881 - #endif 882 - 883 - #if AIC_DEBUG_REGISTERS 884 - ahd_reg_print_t ahd_ost_print; 885 - #else 886 - #define ahd_ost_print(regvalue, cur_col, wrap) \ 887 - ahd_print_register(NULL, 0, "OST", 0x92, regvalue, cur_col, wrap) 888 - #endif 889 - 890 - #if AIC_DEBUG_REGISTERS 891 - ahd_reg_print_t ahd_ovlyrxmsg2_print; 892 - #else 893 - #define ahd_ovlyrxmsg2_print(regvalue, cur_col, wrap) \ 894 - ahd_print_register(NULL, 0, "OVLYRXMSG2", 0x92, regvalue, cur_col, wrap) 895 - #endif 896 - 897 - #if AIC_DEBUG_REGISTERS 898 - ahd_reg_print_t ahd_dchrxmsg3_print; 899 - #else 900 - #define ahd_dchrxmsg3_print(regvalue, cur_col, wrap) \ 901 - ahd_print_register(NULL, 0, "DCHRXMSG3", 0x93, regvalue, cur_col, wrap) 902 - #endif 903 - 904 - #if AIC_DEBUG_REGISTERS 905 - ahd_reg_print_t ahd_ovlyrxmsg3_print; 906 - #else 907 - #define ahd_ovlyrxmsg3_print(regvalue, cur_col, wrap) \ 908 - ahd_print_register(NULL, 0, "OVLYRXMSG3", 0x93, regvalue, cur_col, wrap) 909 - #endif 910 - 911 - #if AIC_DEBUG_REGISTERS 912 - ahd_reg_print_t ahd_cmcrxmsg3_print; 913 - #else 914 - #define ahd_cmcrxmsg3_print(regvalue, cur_col, wrap) \ 915 - ahd_print_register(NULL, 0, "CMCRXMSG3", 0x93, regvalue, cur_col, wrap) 916 1098 #endif 917 1099 918 1100 #if AIC_DEBUG_REGISTERS ··· 804 1224 #endif 805 1225 806 1226 #if AIC_DEBUG_REGISTERS 807 - ahd_reg_print_t ahd_ovlyseqbcnt_print; 808 - #else 809 - #define ahd_ovlyseqbcnt_print(regvalue, cur_col, wrap) \ 810 - ahd_print_register(NULL, 0, "OVLYSEQBCNT", 0x94, regvalue, cur_col, wrap) 811 - #endif 812 - 813 - #if AIC_DEBUG_REGISTERS 814 - ahd_reg_print_t ahd_dchseqbcnt_print; 815 - #else 816 - #define ahd_dchseqbcnt_print(regvalue, cur_col, wrap) \ 817 - ahd_print_register(NULL, 0, "DCHSEQBCNT", 0x94, regvalue, cur_col, wrap) 818 - #endif 819 - 820 - #if AIC_DEBUG_REGISTERS 821 - ahd_reg_print_t ahd_cmcseqbcnt_print; 822 - #else 823 - #define ahd_cmcseqbcnt_print(regvalue, cur_col, wrap) \ 824 - ahd_print_register(NULL, 0, "CMCSEQBCNT", 0x94, regvalue, cur_col, wrap) 825 - #endif 826 - 827 - #if AIC_DEBUG_REGISTERS 828 - ahd_reg_print_t ahd_cmcspltstat0_print; 829 - #else 830 - #define ahd_cmcspltstat0_print(regvalue, cur_col, wrap) \ 831 - ahd_print_register(NULL, 0, "CMCSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 832 - #endif 833 - 834 - #if AIC_DEBUG_REGISTERS 835 1227 ahd_reg_print_t ahd_dchspltstat0_print; 836 1228 #else 837 1229 #define ahd_dchspltstat0_print(regvalue, cur_col, wrap) \ ··· 811 1259 #endif 812 1260 813 1261 #if AIC_DEBUG_REGISTERS 814 - ahd_reg_print_t ahd_ovlyspltstat0_print; 815 - #else 816 - #define ahd_ovlyspltstat0_print(regvalue, cur_col, wrap) \ 817 - ahd_print_register(NULL, 0, "OVLYSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 818 - #endif 819 - 820 - #if AIC_DEBUG_REGISTERS 821 - ahd_reg_print_t ahd_cmcspltstat1_print; 822 - #else 823 - #define ahd_cmcspltstat1_print(regvalue, cur_col, wrap) \ 824 - ahd_print_register(NULL, 0, "CMCSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 825 - #endif 826 - 827 - #if AIC_DEBUG_REGISTERS 828 - ahd_reg_print_t ahd_ovlyspltstat1_print; 829 - #else 830 - #define ahd_ovlyspltstat1_print(regvalue, cur_col, wrap) \ 831 - ahd_print_register(NULL, 0, "OVLYSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 832 - #endif 833 - 834 - #if AIC_DEBUG_REGISTERS 835 1262 ahd_reg_print_t ahd_dchspltstat1_print; 836 1263 #else 837 1264 #define ahd_dchspltstat1_print(regvalue, cur_col, wrap) \ 838 1265 ahd_print_register(NULL, 0, "DCHSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 839 - #endif 840 - 841 - #if AIC_DEBUG_REGISTERS 842 - ahd_reg_print_t ahd_sgrxmsg0_print; 843 - #else 844 - #define ahd_sgrxmsg0_print(regvalue, cur_col, wrap) \ 845 - ahd_print_register(NULL, 0, "SGRXMSG0", 0x98, regvalue, cur_col, wrap) 846 - #endif 847 - 848 - #if AIC_DEBUG_REGISTERS 849 - ahd_reg_print_t ahd_slvspltoutadr0_print; 850 - #else 851 - #define ahd_slvspltoutadr0_print(regvalue, cur_col, wrap) \ 852 - ahd_print_register(NULL, 0, "SLVSPLTOUTADR0", 0x98, regvalue, cur_col, wrap) 853 - #endif 854 - 855 - #if AIC_DEBUG_REGISTERS 856 - ahd_reg_print_t ahd_sgrxmsg1_print; 857 - #else 858 - #define ahd_sgrxmsg1_print(regvalue, cur_col, wrap) \ 859 - ahd_print_register(NULL, 0, "SGRXMSG1", 0x99, regvalue, cur_col, wrap) 860 - #endif 861 - 862 - #if AIC_DEBUG_REGISTERS 863 - ahd_reg_print_t ahd_slvspltoutadr1_print; 864 - #else 865 - #define ahd_slvspltoutadr1_print(regvalue, cur_col, wrap) \ 866 - ahd_print_register(NULL, 0, "SLVSPLTOUTADR1", 0x99, regvalue, cur_col, wrap) 867 - #endif 868 - 869 - #if AIC_DEBUG_REGISTERS 870 - ahd_reg_print_t ahd_sgrxmsg2_print; 871 - #else 872 - #define ahd_sgrxmsg2_print(regvalue, cur_col, wrap) \ 873 - ahd_print_register(NULL, 0, "SGRXMSG2", 0x9a, regvalue, cur_col, wrap) 874 - #endif 875 - 876 - #if AIC_DEBUG_REGISTERS 877 - ahd_reg_print_t ahd_slvspltoutadr2_print; 878 - #else 879 - #define ahd_slvspltoutadr2_print(regvalue, cur_col, wrap) \ 880 - ahd_print_register(NULL, 0, "SLVSPLTOUTADR2", 0x9a, regvalue, cur_col, wrap) 881 - #endif 882 - 883 - #if AIC_DEBUG_REGISTERS 884 - ahd_reg_print_t ahd_sgrxmsg3_print; 885 - #else 886 - #define ahd_sgrxmsg3_print(regvalue, cur_col, wrap) \ 887 - ahd_print_register(NULL, 0, "SGRXMSG3", 0x9b, regvalue, cur_col, wrap) 888 - #endif 889 - 890 - #if AIC_DEBUG_REGISTERS 891 - ahd_reg_print_t ahd_slvspltoutadr3_print; 892 - #else 893 - #define ahd_slvspltoutadr3_print(regvalue, cur_col, wrap) \ 894 - ahd_print_register(NULL, 0, "SLVSPLTOUTADR3", 0x9b, regvalue, cur_col, wrap) 895 - #endif 896 - 897 - #if AIC_DEBUG_REGISTERS 898 - ahd_reg_print_t ahd_sgseqbcnt_print; 899 - #else 900 - #define ahd_sgseqbcnt_print(regvalue, cur_col, wrap) \ 901 - ahd_print_register(NULL, 0, "SGSEQBCNT", 0x9c, regvalue, cur_col, wrap) 902 - #endif 903 - 904 - #if AIC_DEBUG_REGISTERS 905 - ahd_reg_print_t ahd_slvspltoutattr0_print; 906 - #else 907 - #define ahd_slvspltoutattr0_print(regvalue, cur_col, wrap) \ 908 - ahd_print_register(NULL, 0, "SLVSPLTOUTATTR0", 0x9c, regvalue, cur_col, wrap) 909 - #endif 910 - 911 - #if AIC_DEBUG_REGISTERS 912 - ahd_reg_print_t ahd_slvspltoutattr1_print; 913 - #else 914 - #define ahd_slvspltoutattr1_print(regvalue, cur_col, wrap) \ 915 - ahd_print_register(NULL, 0, "SLVSPLTOUTATTR1", 0x9d, regvalue, cur_col, wrap) 916 - #endif 917 - 918 - #if AIC_DEBUG_REGISTERS 919 - ahd_reg_print_t ahd_slvspltoutattr2_print; 920 - #else 921 - #define ahd_slvspltoutattr2_print(regvalue, cur_col, wrap) \ 922 - ahd_print_register(NULL, 0, "SLVSPLTOUTATTR2", 0x9e, regvalue, cur_col, wrap) 923 1266 #endif 924 1267 925 1268 #if AIC_DEBUG_REGISTERS ··· 832 1385 #endif 833 1386 834 1387 #if AIC_DEBUG_REGISTERS 835 - ahd_reg_print_t ahd_sfunct_print; 836 - #else 837 - #define ahd_sfunct_print(regvalue, cur_col, wrap) \ 838 - ahd_print_register(NULL, 0, "SFUNCT", 0x9f, regvalue, cur_col, wrap) 839 - #endif 840 - 841 - #if AIC_DEBUG_REGISTERS 842 1388 ahd_reg_print_t ahd_df0pcistat_print; 843 1389 #else 844 1390 #define ahd_df0pcistat_print(regvalue, cur_col, wrap) \ ··· 843 1403 #else 844 1404 #define ahd_reg0_print(regvalue, cur_col, wrap) \ 845 1405 ahd_print_register(NULL, 0, "REG0", 0xa0, regvalue, cur_col, wrap) 846 - #endif 847 - 848 - #if AIC_DEBUG_REGISTERS 849 - ahd_reg_print_t ahd_df1pcistat_print; 850 - #else 851 - #define ahd_df1pcistat_print(regvalue, cur_col, wrap) \ 852 - ahd_print_register(NULL, 0, "DF1PCISTAT", 0xa1, regvalue, cur_col, wrap) 853 - #endif 854 - 855 - #if AIC_DEBUG_REGISTERS 856 - ahd_reg_print_t ahd_sgpcistat_print; 857 - #else 858 - #define ahd_sgpcistat_print(regvalue, cur_col, wrap) \ 859 - ahd_print_register(NULL, 0, "SGPCISTAT", 0xa2, regvalue, cur_col, wrap) 860 - #endif 861 - 862 - #if AIC_DEBUG_REGISTERS 863 - ahd_reg_print_t ahd_reg1_print; 864 - #else 865 - #define ahd_reg1_print(regvalue, cur_col, wrap) \ 866 - ahd_print_register(NULL, 0, "REG1", 0xa2, regvalue, cur_col, wrap) 867 - #endif 868 - 869 - #if AIC_DEBUG_REGISTERS 870 - ahd_reg_print_t ahd_cmcpcistat_print; 871 - #else 872 - #define ahd_cmcpcistat_print(regvalue, cur_col, wrap) \ 873 - ahd_print_register(NULL, 0, "CMCPCISTAT", 0xa3, regvalue, cur_col, wrap) 874 - #endif 875 - 876 - #if AIC_DEBUG_REGISTERS 877 - ahd_reg_print_t ahd_ovlypcistat_print; 878 - #else 879 - #define ahd_ovlypcistat_print(regvalue, cur_col, wrap) \ 880 - ahd_print_register(NULL, 0, "OVLYPCISTAT", 0xa4, regvalue, cur_col, wrap) 881 1406 #endif 882 1407 883 1408 #if AIC_DEBUG_REGISTERS ··· 860 1455 #endif 861 1456 862 1457 #if AIC_DEBUG_REGISTERS 863 - ahd_reg_print_t ahd_msipcistat_print; 864 - #else 865 - #define ahd_msipcistat_print(regvalue, cur_col, wrap) \ 866 - ahd_print_register(NULL, 0, "MSIPCISTAT", 0xa6, regvalue, cur_col, wrap) 867 - #endif 868 - 869 - #if AIC_DEBUG_REGISTERS 870 1458 ahd_reg_print_t ahd_targpcistat_print; 871 1459 #else 872 1460 #define ahd_targpcistat_print(regvalue, cur_col, wrap) \ ··· 867 1469 #endif 868 1470 869 1471 #if AIC_DEBUG_REGISTERS 870 - ahd_reg_print_t ahd_data_count_odd_print; 871 - #else 872 - #define ahd_data_count_odd_print(regvalue, cur_col, wrap) \ 873 - ahd_print_register(NULL, 0, "DATA_COUNT_ODD", 0xa7, regvalue, cur_col, wrap) 874 - #endif 875 - 876 - #if AIC_DEBUG_REGISTERS 877 1472 ahd_reg_print_t ahd_scbptr_print; 878 1473 #else 879 1474 #define ahd_scbptr_print(regvalue, cur_col, wrap) \ 880 1475 ahd_print_register(NULL, 0, "SCBPTR", 0xa8, regvalue, cur_col, wrap) 881 - #endif 882 - 883 - #if AIC_DEBUG_REGISTERS 884 - ahd_reg_print_t ahd_ccscbacnt_print; 885 - #else 886 - #define ahd_ccscbacnt_print(regvalue, cur_col, wrap) \ 887 - ahd_print_register(NULL, 0, "CCSCBACNT", 0xab, regvalue, cur_col, wrap) 888 1476 #endif 889 1477 890 1478 #if AIC_DEBUG_REGISTERS ··· 888 1504 #endif 889 1505 890 1506 #if AIC_DEBUG_REGISTERS 891 - ahd_reg_print_t ahd_ccscbadr_bk_print; 892 - #else 893 - #define ahd_ccscbadr_bk_print(regvalue, cur_col, wrap) \ 894 - ahd_print_register(NULL, 0, "CCSCBADR_BK", 0xac, regvalue, cur_col, wrap) 895 - #endif 896 - 897 - #if AIC_DEBUG_REGISTERS 898 1507 ahd_reg_print_t ahd_ccscbaddr_print; 899 1508 #else 900 1509 #define ahd_ccscbaddr_print(regvalue, cur_col, wrap) \ 901 1510 ahd_print_register(NULL, 0, "CCSCBADDR", 0xac, regvalue, cur_col, wrap) 902 - #endif 903 - 904 - #if AIC_DEBUG_REGISTERS 905 - ahd_reg_print_t ahd_cmc_rambist_print; 906 - #else 907 - #define ahd_cmc_rambist_print(regvalue, cur_col, wrap) \ 908 - ahd_print_register(NULL, 0, "CMC_RAMBIST", 0xad, regvalue, cur_col, wrap) 909 1511 #endif 910 1512 911 1513 #if AIC_DEBUG_REGISTERS ··· 916 1546 #endif 917 1547 918 1548 #if AIC_DEBUG_REGISTERS 919 - ahd_reg_print_t ahd_flexadr_print; 920 - #else 921 - #define ahd_flexadr_print(regvalue, cur_col, wrap) \ 922 - ahd_print_register(NULL, 0, "FLEXADR", 0xb0, regvalue, cur_col, wrap) 923 - #endif 924 - 925 - #if AIC_DEBUG_REGISTERS 926 1549 ahd_reg_print_t ahd_ccscbram_print; 927 1550 #else 928 1551 #define ahd_ccscbram_print(regvalue, cur_col, wrap) \ 929 1552 ahd_print_register(NULL, 0, "CCSCBRAM", 0xb0, regvalue, cur_col, wrap) 930 - #endif 931 - 932 - #if AIC_DEBUG_REGISTERS 933 - ahd_reg_print_t ahd_flexcnt_print; 934 - #else 935 - #define ahd_flexcnt_print(regvalue, cur_col, wrap) \ 936 - ahd_print_register(NULL, 0, "FLEXCNT", 0xb3, regvalue, cur_col, wrap) 937 - #endif 938 - 939 - #if AIC_DEBUG_REGISTERS 940 - ahd_reg_print_t ahd_flexdmastat_print; 941 - #else 942 - #define ahd_flexdmastat_print(regvalue, cur_col, wrap) \ 943 - ahd_print_register(NULL, 0, "FLEXDMASTAT", 0xb5, regvalue, cur_col, wrap) 944 - #endif 945 - 946 - #if AIC_DEBUG_REGISTERS 947 - ahd_reg_print_t ahd_flexdata_print; 948 - #else 949 - #define ahd_flexdata_print(regvalue, cur_col, wrap) \ 950 - ahd_print_register(NULL, 0, "FLEXDATA", 0xb6, regvalue, cur_col, wrap) 951 1553 #endif 952 1554 953 1555 #if AIC_DEBUG_REGISTERS ··· 965 1623 #endif 966 1624 967 1625 #if AIC_DEBUG_REGISTERS 968 - ahd_reg_print_t ahd_scbcnt_print; 969 - #else 970 - #define ahd_scbcnt_print(regvalue, cur_col, wrap) \ 971 - ahd_print_register(NULL, 0, "SCBCNT", 0xbf, regvalue, cur_col, wrap) 972 - #endif 973 - 974 - #if AIC_DEBUG_REGISTERS 975 - ahd_reg_print_t ahd_dfwaddr_print; 976 - #else 977 - #define ahd_dfwaddr_print(regvalue, cur_col, wrap) \ 978 - ahd_print_register(NULL, 0, "DFWADDR", 0xc0, regvalue, cur_col, wrap) 979 - #endif 980 - 981 - #if AIC_DEBUG_REGISTERS 982 - ahd_reg_print_t ahd_dspfltrctl_print; 983 - #else 984 - #define ahd_dspfltrctl_print(regvalue, cur_col, wrap) \ 985 - ahd_print_register(NULL, 0, "DSPFLTRCTL", 0xc0, regvalue, cur_col, wrap) 986 - #endif 987 - 988 - #if AIC_DEBUG_REGISTERS 989 1626 ahd_reg_print_t ahd_dspdatactl_print; 990 1627 #else 991 1628 #define ahd_dspdatactl_print(regvalue, cur_col, wrap) \ 992 1629 ahd_print_register(NULL, 0, "DSPDATACTL", 0xc1, regvalue, cur_col, wrap) 993 - #endif 994 - 995 - #if AIC_DEBUG_REGISTERS 996 - ahd_reg_print_t ahd_dfraddr_print; 997 - #else 998 - #define ahd_dfraddr_print(regvalue, cur_col, wrap) \ 999 - ahd_print_register(NULL, 0, "DFRADDR", 0xc2, regvalue, cur_col, wrap) 1000 - #endif 1001 - 1002 - #if AIC_DEBUG_REGISTERS 1003 - ahd_reg_print_t ahd_dspreqctl_print; 1004 - #else 1005 - #define ahd_dspreqctl_print(regvalue, cur_col, wrap) \ 1006 - ahd_print_register(NULL, 0, "DSPREQCTL", 0xc2, regvalue, cur_col, wrap) 1007 - #endif 1008 - 1009 - #if AIC_DEBUG_REGISTERS 1010 - ahd_reg_print_t ahd_dspackctl_print; 1011 - #else 1012 - #define ahd_dspackctl_print(regvalue, cur_col, wrap) \ 1013 - ahd_print_register(NULL, 0, "DSPACKCTL", 0xc3, regvalue, cur_col, wrap) 1014 1630 #endif 1015 1631 1016 1632 #if AIC_DEBUG_REGISTERS ··· 993 1693 #endif 994 1694 995 1695 #if AIC_DEBUG_REGISTERS 996 - ahd_reg_print_t ahd_rcvrbiosctl_print; 997 - #else 998 - #define ahd_rcvrbiosctl_print(regvalue, cur_col, wrap) \ 999 - ahd_print_register(NULL, 0, "RCVRBIOSCTL", 0xc6, regvalue, cur_col, wrap) 1000 - #endif 1001 - 1002 - #if AIC_DEBUG_REGISTERS 1003 - ahd_reg_print_t ahd_wrtbiascalc_print; 1004 - #else 1005 - #define ahd_wrtbiascalc_print(regvalue, cur_col, wrap) \ 1006 - ahd_print_register(NULL, 0, "WRTBIASCALC", 0xc7, regvalue, cur_col, wrap) 1007 - #endif 1008 - 1009 - #if AIC_DEBUG_REGISTERS 1010 - ahd_reg_print_t ahd_rcvrbiascalc_print; 1011 - #else 1012 - #define ahd_rcvrbiascalc_print(regvalue, cur_col, wrap) \ 1013 - ahd_print_register(NULL, 0, "RCVRBIASCALC", 0xc8, regvalue, cur_col, wrap) 1014 - #endif 1015 - 1016 - #if AIC_DEBUG_REGISTERS 1017 - ahd_reg_print_t ahd_dfptrs_print; 1018 - #else 1019 - #define ahd_dfptrs_print(regvalue, cur_col, wrap) \ 1020 - ahd_print_register(NULL, 0, "DFPTRS", 0xc8, regvalue, cur_col, wrap) 1021 - #endif 1022 - 1023 - #if AIC_DEBUG_REGISTERS 1024 - ahd_reg_print_t ahd_skewcalc_print; 1025 - #else 1026 - #define ahd_skewcalc_print(regvalue, cur_col, wrap) \ 1027 - ahd_print_register(NULL, 0, "SKEWCALC", 0xc9, regvalue, cur_col, wrap) 1028 - #endif 1029 - 1030 - #if AIC_DEBUG_REGISTERS 1031 - ahd_reg_print_t ahd_dfbkptr_print; 1032 - #else 1033 - #define ahd_dfbkptr_print(regvalue, cur_col, wrap) \ 1034 - ahd_print_register(NULL, 0, "DFBKPTR", 0xc9, regvalue, cur_col, wrap) 1035 - #endif 1036 - 1037 - #if AIC_DEBUG_REGISTERS 1038 - ahd_reg_print_t ahd_dfdbctl_print; 1039 - #else 1040 - #define ahd_dfdbctl_print(regvalue, cur_col, wrap) \ 1041 - ahd_print_register(NULL, 0, "DFDBCTL", 0xcb, regvalue, cur_col, wrap) 1042 - #endif 1043 - 1044 - #if AIC_DEBUG_REGISTERS 1045 - ahd_reg_print_t ahd_dfscnt_print; 1046 - #else 1047 - #define ahd_dfscnt_print(regvalue, cur_col, wrap) \ 1048 - ahd_print_register(NULL, 0, "DFSCNT", 0xcc, regvalue, cur_col, wrap) 1049 - #endif 1050 - 1051 - #if AIC_DEBUG_REGISTERS 1052 - ahd_reg_print_t ahd_dfbcnt_print; 1053 - #else 1054 - #define ahd_dfbcnt_print(regvalue, cur_col, wrap) \ 1055 - ahd_print_register(NULL, 0, "DFBCNT", 0xce, regvalue, cur_col, wrap) 1056 - #endif 1057 - 1058 - #if AIC_DEBUG_REGISTERS 1059 - ahd_reg_print_t ahd_ovlyaddr_print; 1060 - #else 1061 - #define ahd_ovlyaddr_print(regvalue, cur_col, wrap) \ 1062 - ahd_print_register(NULL, 0, "OVLYADDR", 0xd4, regvalue, cur_col, wrap) 1063 - #endif 1064 - 1065 - #if AIC_DEBUG_REGISTERS 1066 1696 ahd_reg_print_t ahd_seqctl0_print; 1067 1697 #else 1068 1698 #define ahd_seqctl0_print(regvalue, cur_col, wrap) \ 1069 1699 ahd_print_register(NULL, 0, "SEQCTL0", 0xd6, regvalue, cur_col, wrap) 1070 - #endif 1071 - 1072 - #if AIC_DEBUG_REGISTERS 1073 - ahd_reg_print_t ahd_seqctl1_print; 1074 - #else 1075 - #define ahd_seqctl1_print(regvalue, cur_col, wrap) \ 1076 - ahd_print_register(NULL, 0, "SEQCTL1", 0xd7, regvalue, cur_col, wrap) 1077 1700 #endif 1078 1701 1079 1702 #if AIC_DEBUG_REGISTERS ··· 1049 1826 #endif 1050 1827 1051 1828 #if AIC_DEBUG_REGISTERS 1052 - ahd_reg_print_t ahd_brkaddr0_print; 1053 - #else 1054 - #define ahd_brkaddr0_print(regvalue, cur_col, wrap) \ 1055 - ahd_print_register(NULL, 0, "BRKADDR0", 0xe6, regvalue, cur_col, wrap) 1056 - #endif 1057 - 1058 - #if AIC_DEBUG_REGISTERS 1059 - ahd_reg_print_t ahd_brkaddr1_print; 1060 - #else 1061 - #define ahd_brkaddr1_print(regvalue, cur_col, wrap) \ 1062 - ahd_print_register(NULL, 0, "BRKADDR1", 0xe6, regvalue, cur_col, wrap) 1063 - #endif 1064 - 1065 - #if AIC_DEBUG_REGISTERS 1066 1829 ahd_reg_print_t ahd_allones_print; 1067 1830 #else 1068 1831 #define ahd_allones_print(regvalue, cur_col, wrap) \ ··· 1084 1875 #endif 1085 1876 1086 1877 #if AIC_DEBUG_REGISTERS 1087 - ahd_reg_print_t ahd_function1_print; 1088 - #else 1089 - #define ahd_function1_print(regvalue, cur_col, wrap) \ 1090 - ahd_print_register(NULL, 0, "FUNCTION1", 0xf0, regvalue, cur_col, wrap) 1091 - #endif 1092 - 1093 - #if AIC_DEBUG_REGISTERS 1094 1878 ahd_reg_print_t ahd_stack_print; 1095 1879 #else 1096 1880 #define ahd_stack_print(regvalue, cur_col, wrap) \ ··· 1102 1900 #else 1103 1901 #define ahd_curaddr_print(regvalue, cur_col, wrap) \ 1104 1902 ahd_print_register(NULL, 0, "CURADDR", 0xf4, regvalue, cur_col, wrap) 1105 - #endif 1106 - 1107 - #if AIC_DEBUG_REGISTERS 1108 - ahd_reg_print_t ahd_lastaddr_print; 1109 - #else 1110 - #define ahd_lastaddr_print(regvalue, cur_col, wrap) \ 1111 - ahd_print_register(NULL, 0, "LASTADDR", 0xf6, regvalue, cur_col, wrap) 1112 1903 #endif 1113 1904 1114 1905 #if AIC_DEBUG_REGISTERS ··· 1126 1931 #endif 1127 1932 1128 1933 #if AIC_DEBUG_REGISTERS 1129 - ahd_reg_print_t ahd_waiting_scb_tails_print; 1130 - #else 1131 - #define ahd_waiting_scb_tails_print(regvalue, cur_col, wrap) \ 1132 - ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", 0x100, regvalue, cur_col, wrap) 1133 - #endif 1134 - 1135 - #if AIC_DEBUG_REGISTERS 1136 - ahd_reg_print_t ahd_ahd_pci_config_base_print; 1137 - #else 1138 - #define ahd_ahd_pci_config_base_print(regvalue, cur_col, wrap) \ 1139 - ahd_print_register(NULL, 0, "AHD_PCI_CONFIG_BASE", 0x100, regvalue, cur_col, wrap) 1140 - #endif 1141 - 1142 - #if AIC_DEBUG_REGISTERS 1143 1934 ahd_reg_print_t ahd_sram_base_print; 1144 1935 #else 1145 1936 #define ahd_sram_base_print(regvalue, cur_col, wrap) \ 1146 1937 ahd_print_register(NULL, 0, "SRAM_BASE", 0x100, regvalue, cur_col, wrap) 1938 + #endif 1939 + 1940 + #if AIC_DEBUG_REGISTERS 1941 + ahd_reg_print_t ahd_waiting_scb_tails_print; 1942 + #else 1943 + #define ahd_waiting_scb_tails_print(regvalue, cur_col, wrap) \ 1944 + ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", 0x100, regvalue, cur_col, wrap) 1147 1945 #endif 1148 1946 1149 1947 #if AIC_DEBUG_REGISTERS ··· 1406 2218 #endif 1407 2219 1408 2220 #if AIC_DEBUG_REGISTERS 1409 - ahd_reg_print_t ahd_scb_base_print; 1410 - #else 1411 - #define ahd_scb_base_print(regvalue, cur_col, wrap) \ 1412 - ahd_print_register(NULL, 0, "SCB_BASE", 0x180, regvalue, cur_col, wrap) 1413 - #endif 1414 - 1415 - #if AIC_DEBUG_REGISTERS 1416 2221 ahd_reg_print_t ahd_scb_residual_datacnt_print; 1417 2222 #else 1418 2223 #define ahd_scb_residual_datacnt_print(regvalue, cur_col, wrap) \ 1419 2224 ahd_print_register(NULL, 0, "SCB_RESIDUAL_DATACNT", 0x180, regvalue, cur_col, wrap) 2225 + #endif 2226 + 2227 + #if AIC_DEBUG_REGISTERS 2228 + ahd_reg_print_t ahd_scb_base_print; 2229 + #else 2230 + #define ahd_scb_base_print(regvalue, cur_col, wrap) \ 2231 + ahd_print_register(NULL, 0, "SCB_BASE", 0x180, regvalue, cur_col, wrap) 1420 2232 #endif 1421 2233 1422 2234 #if AIC_DEBUG_REGISTERS ··· 1431 2243 #else 1432 2244 #define ahd_scb_scsi_status_print(regvalue, cur_col, wrap) \ 1433 2245 ahd_print_register(NULL, 0, "SCB_SCSI_STATUS", 0x188, regvalue, cur_col, wrap) 1434 - #endif 1435 - 1436 - #if AIC_DEBUG_REGISTERS 1437 - ahd_reg_print_t ahd_scb_target_phases_print; 1438 - #else 1439 - #define ahd_scb_target_phases_print(regvalue, cur_col, wrap) \ 1440 - ahd_print_register(NULL, 0, "SCB_TARGET_PHASES", 0x189, regvalue, cur_col, wrap) 1441 - #endif 1442 - 1443 - #if AIC_DEBUG_REGISTERS 1444 - ahd_reg_print_t ahd_scb_target_data_dir_print; 1445 - #else 1446 - #define ahd_scb_target_data_dir_print(regvalue, cur_col, wrap) \ 1447 - ahd_print_register(NULL, 0, "SCB_TARGET_DATA_DIR", 0x18a, regvalue, cur_col, wrap) 1448 - #endif 1449 - 1450 - #if AIC_DEBUG_REGISTERS 1451 - ahd_reg_print_t ahd_scb_target_itag_print; 1452 - #else 1453 - #define ahd_scb_target_itag_print(regvalue, cur_col, wrap) \ 1454 - ahd_print_register(NULL, 0, "SCB_TARGET_ITAG", 0x18b, regvalue, cur_col, wrap) 1455 2246 #endif 1456 2247 1457 2248 #if AIC_DEBUG_REGISTERS ··· 1529 2362 #else 1530 2363 #define ahd_scb_next2_print(regvalue, cur_col, wrap) \ 1531 2364 ahd_print_register(NULL, 0, "SCB_NEXT2", 0x1ae, regvalue, cur_col, wrap) 1532 - #endif 1533 - 1534 - #if AIC_DEBUG_REGISTERS 1535 - ahd_reg_print_t ahd_scb_spare_print; 1536 - #else 1537 - #define ahd_scb_spare_print(regvalue, cur_col, wrap) \ 1538 - ahd_print_register(NULL, 0, "SCB_SPARE", 0x1b0, regvalue, cur_col, wrap) 1539 2365 #endif 1540 2366 1541 2367 #if AIC_DEBUG_REGISTERS ··· 1717 2557 1718 2558 #define SG_CACHE_PRE 0x1b 1719 2559 1720 - #define LQIN 0x20 1721 - 1722 2560 #define TYPEPTR 0x20 2561 + 2562 + #define LQIN 0x20 1723 2563 1724 2564 #define TAGPTR 0x21 1725 2565 ··· 1780 2620 #define SINGLECMD 0x02 1781 2621 #define ABORTPENDING 0x01 1782 2622 1783 - #define SCSBIST0 0x39 1784 - #define GSBISTERR 0x40 1785 - #define GSBISTDONE 0x20 1786 - #define GSBISTRUN 0x10 1787 - #define OSBISTERR 0x04 1788 - #define OSBISTDONE 0x02 1789 - #define OSBISTRUN 0x01 1790 - 1791 2623 #define LQCTL2 0x39 1792 2624 #define LQIRETRY 0x80 1793 2625 #define LQICONTINUE 0x40 ··· 1790 2638 #define LQOTOIDLE 0x02 1791 2639 #define LQOPAUSE 0x01 1792 2640 1793 - #define SCSBIST1 0x3a 1794 - #define NTBISTERR 0x04 1795 - #define NTBISTDONE 0x02 1796 - #define NTBISTRUN 0x01 2641 + #define SCSBIST0 0x39 2642 + #define GSBISTERR 0x40 2643 + #define GSBISTDONE 0x20 2644 + #define GSBISTRUN 0x10 2645 + #define OSBISTERR 0x04 2646 + #define OSBISTDONE 0x02 2647 + #define OSBISTRUN 0x01 1797 2648 1798 2649 #define SCSISEQ0 0x3a 1799 2650 #define TEMODEO 0x80 ··· 1805 2650 #define FORCEBUSFREE 0x10 1806 2651 #define SCSIRSTO 0x01 1807 2652 2653 + #define SCSBIST1 0x3a 2654 + #define NTBISTERR 0x04 2655 + #define NTBISTDONE 0x02 2656 + #define NTBISTRUN 0x01 2657 + 1808 2658 #define SCSISEQ1 0x3b 2659 + 2660 + #define BUSINITID 0x3c 1809 2661 1810 2662 #define SXFRCTL0 0x3c 1811 2663 #define DFON 0x80 ··· 1821 2659 #define SPIOEN 0x08 1822 2660 1823 2661 #define DLCOUNT 0x3c 1824 - 1825 - #define BUSINITID 0x3c 1826 2662 1827 2663 #define SXFRCTL1 0x3d 1828 2664 #define BITBUCKET 0x80 ··· 1846 2686 #define CURRFIFO_1 0x01 1847 2687 #define CURRFIFO_0 0x00 1848 2688 2689 + #define MULTARGID 0x40 2690 + 1849 2691 #define SCSISIGO 0x40 1850 2692 #define CDO 0x80 1851 2693 #define IOO 0x40 ··· 1857 2695 #define BSYO 0x04 1858 2696 #define REQO 0x02 1859 2697 #define ACKO 0x01 1860 - 1861 - #define MULTARGID 0x40 1862 2698 1863 2699 #define SCSISIGI 0x41 1864 2700 #define ATNI 0x10 ··· 1904 2744 #define ENAB20 0x04 1905 2745 #define SELWIDE 0x02 1906 2746 1907 - #define CLRSINT0 0x4b 1908 - #define CLRSELDO 0x40 1909 - #define CLRSELDI 0x20 1910 - #define CLRSELINGO 0x10 1911 - #define CLRIOERR 0x08 1912 - #define CLROVERRUN 0x04 1913 - #define CLRSPIORDY 0x02 1914 - #define CLRARBDO 0x01 1915 - 1916 2747 #define SSTAT0 0x4b 1917 2748 #define TARGET 0x80 1918 2749 #define SELDO 0x40 ··· 1923 2772 #define ENSPIORDY 0x02 1924 2773 #define ENARBDO 0x01 1925 2774 1926 - #define CLRSINT1 0x4c 1927 - #define CLRSELTIMEO 0x80 1928 - #define CLRATNO 0x40 1929 - #define CLRSCSIRSTI 0x20 1930 - #define CLRBUSFREE 0x08 1931 - #define CLRSCSIPERR 0x04 1932 - #define CLRSTRB2FAST 0x02 1933 - #define CLRREQINIT 0x01 2775 + #define CLRSINT0 0x4b 2776 + #define CLRSELDO 0x40 2777 + #define CLRSELDI 0x20 2778 + #define CLRSELINGO 0x10 2779 + #define CLRIOERR 0x08 2780 + #define CLROVERRUN 0x04 2781 + #define CLRSPIORDY 0x02 2782 + #define CLRARBDO 0x01 1934 2783 1935 2784 #define SSTAT1 0x4c 1936 2785 #define SELTO 0x80 ··· 1941 2790 #define SCSIPERR 0x04 1942 2791 #define STRB2FAST 0x02 1943 2792 #define REQINIT 0x01 2793 + 2794 + #define CLRSINT1 0x4c 2795 + #define CLRSELTIMEO 0x80 2796 + #define CLRATNO 0x40 2797 + #define CLRSCSIRSTI 0x20 2798 + #define CLRBUSFREE 0x08 2799 + #define CLRSCSIPERR 0x04 2800 + #define CLRSTRB2FAST 0x02 2801 + #define CLRREQINIT 0x01 1944 2802 1945 2803 #define SSTAT2 0x4d 1946 2804 #define BUSFREETIME 0xc0 ··· 1998 2838 #define LQIATNLQ 0x02 1999 2839 #define LQIATNCMD 0x01 2000 2840 2001 - #define CLRLQIINT0 0x50 2002 - #define CLRLQIATNQAS 0x20 2003 - #define CLRLQICRCT1 0x10 2004 - #define CLRLQICRCT2 0x08 2005 - #define CLRLQIBADLQT 0x04 2006 - #define CLRLQIATNLQ 0x02 2007 - #define CLRLQIATNCMD 0x01 2008 - 2009 2841 #define LQIMODE0 0x50 2010 2842 #define ENLQIATNQASK 0x20 2011 2843 #define ENLQICRCT1 0x10 ··· 2005 2853 #define ENLQIBADLQT 0x04 2006 2854 #define ENLQIATNLQ 0x02 2007 2855 #define ENLQIATNCMD 0x01 2856 + 2857 + #define CLRLQIINT0 0x50 2858 + #define CLRLQIATNQAS 0x20 2859 + #define CLRLQICRCT1 0x10 2860 + #define CLRLQICRCT2 0x08 2861 + #define CLRLQIBADLQT 0x04 2862 + #define CLRLQIATNLQ 0x02 2863 + #define CLRLQIATNCMD 0x01 2008 2864 2009 2865 #define LQIMODE1 0x51 2010 2866 #define ENLQIPHASE_LQ 0x80 ··· 2136 2976 2137 2977 #define LQOSCSCTL 0x5a 2138 2978 #define LQOH2A_VERSION 0x80 2979 + #define LQOBUSETDLY 0x40 2980 + #define LQONOHOLDLACK 0x02 2139 2981 #define LQONOCHKOVER 0x01 2140 2982 2141 2983 #define NEXTSCB 0x5a ··· 2160 2998 #define CFG4ICMD 0x02 2161 2999 #define CFG4TCMD 0x01 2162 3000 2163 - #define CURRSCB 0x5c 2164 - 2165 3001 #define SEQIMODE 0x5c 2166 3002 #define ENCTXTDONE 0x40 2167 3003 #define ENSAVEPTRS 0x20 ··· 2168 3008 #define ENCFG4TSTAT 0x04 2169 3009 #define ENCFG4ICMD 0x02 2170 3010 #define ENCFG4TCMD 0x01 3011 + 3012 + #define CURRSCB 0x5c 2171 3013 2172 3014 #define MDFFSTAT 0x5d 2173 3015 #define SHCNTNEGATIVE 0x40 ··· 2185 3023 2186 3024 #define DFFTAG 0x5e 2187 3025 2188 - #define LASTSCB 0x5e 2189 - 2190 3026 #define SCSITEST 0x5e 2191 3027 #define CNTRTEST 0x08 2192 3028 #define SEL_TXPLL_DEBUG 0x04 3029 + 3030 + #define LASTSCB 0x5e 2193 3031 2194 3032 #define IOPDNCTL 0x5f 2195 3033 #define DISABLE_OE 0x80 2196 3034 #define PDN_IDIST 0x04 2197 3035 #define PDN_DIFFSENSE 0x01 2198 3036 3037 + #define DGRPCRCI 0x60 3038 + 2199 3039 #define SHADDR 0x60 2200 3040 2201 3041 #define NEGOADDR 0x60 2202 3042 2203 - #define DGRPCRCI 0x60 2204 - 2205 3043 #define NEGPERIOD 0x61 2206 3044 2207 - #define PACKCRCI 0x62 2208 - 2209 3045 #define NEGOFFSET 0x62 3046 + 3047 + #define PACKCRCI 0x62 2210 3048 2211 3049 #define NEGPPROPTS 0x63 2212 3050 #define PPROPT_PACE 0x08 ··· 2228 3066 #define ANNEXDAT 0x66 2229 3067 2230 3068 #define SCSCHKN 0x66 3069 + #define BIDICHKDIS 0x80 2231 3070 #define STSELSKIDDIS 0x40 2232 3071 #define CURRFIFODEF 0x20 2233 3072 #define WIDERESEN 0x10 ··· 2253 3090 2254 3091 #define SELOID 0x6b 2255 3092 3093 + #define FAIRNESS 0x6c 3094 + 2256 3095 #define PLL400CTL0 0x6c 2257 3096 #define PLL_VCOSEL 0x80 2258 3097 #define PLL_PWDN 0x40 ··· 2263 3098 #define PLL_ENLPF 0x04 2264 3099 #define PLL_DLPF 0x02 2265 3100 #define PLL_ENFBM 0x01 2266 - 2267 - #define FAIRNESS 0x6c 2268 3101 2269 3102 #define PLL400CTL1 0x6d 2270 3103 #define PLL_CNTEN 0x80 ··· 2275 3112 2276 3113 #define HADDR 0x70 2277 3114 3115 + #define HODMAADR 0x70 3116 + 2278 3117 #define PLLDELAY 0x70 2279 3118 #define SPLIT_DROP_REQ 0x80 2280 3119 2281 - #define HODMAADR 0x70 3120 + #define HCNT 0x78 2282 3121 2283 3122 #define HODMACNT 0x78 2284 3123 2285 - #define HCNT 0x78 2286 - 2287 3124 #define HODMAEN 0x7a 2288 - 2289 - #define SCBHADDR 0x7c 2290 3125 2291 3126 #define SGHADDR 0x7c 2292 3127 2293 - #define SCBHCNT 0x84 3128 + #define SCBHADDR 0x7c 2294 3129 2295 3130 #define SGHCNT 0x84 3131 + 3132 + #define SCBHCNT 0x84 2296 3133 2297 3134 #define DFF_THRSH 0x88 2298 3135 #define WR_DFTHRSH 0x70 ··· 2326 3163 2327 3164 #define CMCRXMSG0 0x90 2328 3165 3166 + #define OVLYRXMSG0 0x90 3167 + 3168 + #define DCHRXMSG0 0x90 3169 + 2329 3170 #define ROENABLE 0x90 2330 3171 #define MSIROEN 0x20 2331 3172 #define OVLYROEN 0x10 ··· 2338 3171 #define DCH1ROEN 0x02 2339 3172 #define DCH0ROEN 0x01 2340 3173 2341 - #define OVLYRXMSG0 0x90 2342 - 2343 - #define DCHRXMSG0 0x90 2344 - 2345 3174 #define OVLYRXMSG1 0x91 3175 + 3176 + #define CMCRXMSG1 0x91 3177 + 3178 + #define DCHRXMSG1 0x91 2346 3179 2347 3180 #define NSENABLE 0x91 2348 3181 #define MSINSEN 0x20 ··· 2351 3184 #define SGNSEN 0x04 2352 3185 #define DCH1NSEN 0x02 2353 3186 #define DCH0NSEN 0x01 2354 - 2355 - #define CMCRXMSG1 0x91 2356 - 2357 - #define DCHRXMSG1 0x91 2358 3187 2359 3188 #define DCHRXMSG2 0x92 2360 3189 ··· 2375 3212 #define TSCSERREN 0x02 2376 3213 #define CMPABCDIS 0x01 2377 3214 3215 + #define CMCSEQBCNT 0x94 3216 + 2378 3217 #define OVLYSEQBCNT 0x94 2379 3218 2380 3219 #define DCHSEQBCNT 0x94 2381 - 2382 - #define CMCSEQBCNT 0x94 2383 - 2384 - #define CMCSPLTSTAT0 0x96 2385 3220 2386 3221 #define DCHSPLTSTAT0 0x96 2387 3222 2388 3223 #define OVLYSPLTSTAT0 0x96 2389 3224 2390 - #define CMCSPLTSTAT1 0x97 3225 + #define CMCSPLTSTAT0 0x96 2391 3226 2392 3227 #define OVLYSPLTSTAT1 0x97 2393 3228 2394 3229 #define DCHSPLTSTAT1 0x97 3230 + 3231 + #define CMCSPLTSTAT1 0x97 2395 3232 2396 3233 #define SGRXMSG0 0x98 2397 3234 #define CDNUM 0xf8 ··· 2420 3257 #define TAG_NUM 0x1f 2421 3258 #define RLXORD 0x10 2422 3259 2423 - #define SGSEQBCNT 0x9c 2424 - 2425 3260 #define SLVSPLTOUTATTR0 0x9c 2426 3261 #define LOWER_BCNT 0xff 3262 + 3263 + #define SGSEQBCNT 0x9c 2427 3264 2428 3265 #define SLVSPLTOUTATTR1 0x9d 2429 3266 #define CMPLT_DNUM 0xf8 2430 3267 #define CMPLT_FNUM 0x07 2431 - 2432 - #define SLVSPLTOUTATTR2 0x9e 2433 - #define CMPLT_BNUM 0xff 2434 3268 2435 3269 #define SGSPLTSTAT0 0x9e 2436 3270 #define STAETERM 0x80 ··· 2438 3278 #define RXOVRUN 0x04 2439 3279 #define RXSCEMSG 0x02 2440 3280 #define RXSPLTRSP 0x01 3281 + 3282 + #define SLVSPLTOUTATTR2 0x9e 3283 + #define CMPLT_BNUM 0xff 2441 3284 2442 3285 #define SGSPLTSTAT1 0x9f 2443 3286 #define RXDATABUCKET 0x01 ··· 2497 3334 2498 3335 #define CCSGADDR 0xac 2499 3336 2500 - #define CCSCBADR_BK 0xac 2501 - 2502 3337 #define CCSCBADDR 0xac 3338 + 3339 + #define CCSCBADR_BK 0xac 2503 3340 2504 3341 #define CMC_RAMBIST 0xad 2505 3342 #define SG_ELEMENT_SIZE 0x80 ··· 2554 3391 #define SEEDAT 0xbc 2555 3392 2556 3393 #define SEECTL 0xbe 3394 + #define SEEOP_EWDS 0x40 2557 3395 #define SEEOP_WALL 0x40 2558 3396 #define SEEOP_EWEN 0x40 2559 - #define SEEOP_EWDS 0x40 2560 3397 #define SEEOPCODE 0x70 2561 3398 #define SEERST 0x02 2562 3399 #define SEESTART 0x01 ··· 2573 3410 2574 3411 #define SCBCNT 0xbf 2575 3412 2576 - #define DFWADDR 0xc0 2577 - 2578 3413 #define DSPFLTRCTL 0xc0 2579 3414 #define FLTRDISABLE 0x20 2580 3415 #define EDGESENSE 0x10 2581 3416 #define DSPFCNTSEL 0x0f 3417 + 3418 + #define DFWADDR 0xc0 2582 3419 2583 3420 #define DSPDATACTL 0xc1 2584 3421 #define BYPASSENAB 0x80 ··· 2586 3423 #define RCVROFFSTDIS 0x04 2587 3424 #define XMITOFFSTDIS 0x02 2588 3425 2589 - #define DFRADDR 0xc2 2590 - 2591 3426 #define DSPREQCTL 0xc2 2592 3427 #define MANREQCTL 0xc0 2593 3428 #define MANREQDLY 0x3f 3429 + 3430 + #define DFRADDR 0xc2 2594 3431 2595 3432 #define DSPACKCTL 0xc3 2596 3433 #define MANACKCTL 0xc0 ··· 2612 3449 2613 3450 #define WRTBIASCALC 0xc7 2614 3451 2615 - #define RCVRBIASCALC 0xc8 2616 - 2617 3452 #define DFPTRS 0xc8 2618 3453 2619 - #define SKEWCALC 0xc9 3454 + #define RCVRBIASCALC 0xc8 2620 3455 2621 3456 #define DFBKPTR 0xc9 3457 + 3458 + #define SKEWCALC 0xc9 2622 3459 2623 3460 #define DFDBCTL 0xcb 2624 3461 #define DFF_CIO_WR_RDY 0x20 ··· 2704 3541 2705 3542 #define ACCUM_SAVE 0xfa 2706 3543 2707 - #define WAITING_SCB_TAILS 0x100 2708 - 2709 3544 #define AHD_PCI_CONFIG_BASE 0x100 2710 3545 2711 3546 #define SRAM_BASE 0x100 3547 + 3548 + #define WAITING_SCB_TAILS 0x100 2712 3549 2713 3550 #define WAITING_TID_HEAD 0x120 2714 3551 ··· 2738 3575 #define PRELOADEN 0x80 2739 3576 #define WIDEODD 0x40 2740 3577 #define SCSIEN 0x20 2741 - #define SDMAEN 0x10 2742 3578 #define SDMAENACK 0x10 3579 + #define SDMAEN 0x10 2743 3580 #define HDMAEN 0x08 2744 3581 #define HDMAENACK 0x08 2745 3582 #define DIRECTION 0x04 ··· 2837 3674 2838 3675 #define MK_MESSAGE_SCSIID 0x162 2839 3676 2840 - #define SCB_BASE 0x180 2841 - 2842 3677 #define SCB_RESIDUAL_DATACNT 0x180 2843 3678 #define SCB_CDB_STORE 0x180 2844 3679 #define SCB_HOST_CDB_PTR 0x180 3680 + 3681 + #define SCB_BASE 0x180 2845 3682 2846 3683 #define SCB_RESIDUAL_SGPTR 0x184 2847 3684 #define SG_ADDR_MASK 0xf8 ··· 2910 3747 #define SCB_DISCONNECTED_LISTS 0x1b8 2911 3748 2912 3749 3750 + #define CMD_GROUP_CODE_SHIFT 0x05 3751 + #define STIMESEL_MIN 0x18 3752 + #define STIMESEL_SHIFT 0x03 3753 + #define INVALID_ADDR 0x80 3754 + #define AHD_PRECOMP_MASK 0x07 3755 + #define TARGET_DATA_IN 0x01 3756 + #define CCSCBADDR_MAX 0x80 3757 + #define NUMDSPS 0x14 3758 + #define SEEOP_EWEN_ADDR 0xc0 3759 + #define AHD_ANNEXCOL_PER_DEV0 0x04 3760 + #define DST_MODE_SHIFT 0x04 2913 3761 #define AHD_TIMER_MAX_US 0x18ffe7 2914 3762 #define AHD_TIMER_MAX_TICKS 0xffff 2915 3763 #define AHD_SENSE_BUFSIZE 0x100 ··· 2955 3781 #define LUNLEN_SINGLE_LEVEL_LUN 0x0f 2956 3782 #define NVRAM_SCB_OFFSET 0x2c 2957 3783 #define STATUS_PKT_SENSE 0xff 2958 - #define CMD_GROUP_CODE_SHIFT 0x05 2959 3784 #define MAX_OFFSET_PACED_BUG 0x7f 2960 3785 #define STIMESEL_BUG_ADJ 0x08 2961 - #define STIMESEL_MIN 0x18 2962 - #define STIMESEL_SHIFT 0x03 2963 3786 #define CCSGRAM_MAXSEGS 0x10 2964 - #define INVALID_ADDR 0x80 2965 3787 #define SEEOP_ERAL_ADDR 0x80 2966 3788 #define AHD_SLEWRATE_DEF_REVB 0x08 2967 3789 #define AHD_PRECOMP_CUTBACK_17 0x04 2968 - #define AHD_PRECOMP_MASK 0x07 2969 3790 #define SRC_MODE_SHIFT 0x00 2970 3791 #define PKT_OVERRUN_BUFSIZE 0x200 2971 3792 #define SCB_TRANSFER_SIZE_1BYTE_LUN 0x30 2972 - #define TARGET_DATA_IN 0x01 2973 3793 #define HOST_MSG 0xff 2974 3794 #define MAX_OFFSET 0xfe 2975 3795 #define BUS_16_BIT 0x01 2976 - #define CCSCBADDR_MAX 0x80 2977 - #define NUMDSPS 0x14 2978 - #define SEEOP_EWEN_ADDR 0xc0 2979 - #define AHD_ANNEXCOL_PER_DEV0 0x04 2980 - #define DST_MODE_SHIFT 0x04 2981 3796 2982 3797 2983 3798 /* Downloaded Constant Definitions */ 3799 + #define SG_SIZEOF 0x04 3800 + #define SG_PREFETCH_ALIGN_MASK 0x02 3801 + #define SG_PREFETCH_CNT_LIMIT 0x01 2984 3802 #define CACHELINE_MASK 0x07 2985 3803 #define SCB_TRANSFER_SIZE 0x06 2986 3804 #define PKT_OVERRUN_BUFOFFSET 0x05 2987 - #define SG_SIZEOF 0x04 2988 3805 #define SG_PREFETCH_ADDR_MASK 0x03 2989 - #define SG_PREFETCH_ALIGN_MASK 0x02 2990 - #define SG_PREFETCH_CNT_LIMIT 0x01 2991 3806 #define SG_PREFETCH_CNT 0x00 2992 3807 #define DOWNLOAD_CONST_COUNT 0x08 2993 3808 2994 3809 2995 3810 /* Exported Labels */ 2996 - #define LABEL_seq_isr 0x28f 2997 3811 #define LABEL_timer_isr 0x28b 3812 + #define LABEL_seq_isr 0x28f
+182 -1385
drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped
··· 8 8 9 9 #include "aic79xx_osm.h" 10 10 11 - static ahd_reg_parse_entry_t MODE_PTR_parse_table[] = { 11 + static const ahd_reg_parse_entry_t MODE_PTR_parse_table[] = { 12 12 { "SRC_MODE", 0x07, 0x07 }, 13 13 { "DST_MODE", 0x70, 0x70 } 14 14 }; ··· 20 20 0x00, regvalue, cur_col, wrap)); 21 21 } 22 22 23 - static ahd_reg_parse_entry_t INTSTAT_parse_table[] = { 23 + static const ahd_reg_parse_entry_t INTSTAT_parse_table[] = { 24 24 { "SPLTINT", 0x01, 0x01 }, 25 25 { "CMDCMPLT", 0x02, 0x02 }, 26 26 { "SEQINT", 0x04, 0x04 }, ··· 39 39 0x01, regvalue, cur_col, wrap)); 40 40 } 41 41 42 - static ahd_reg_parse_entry_t SEQINTCODE_parse_table[] = { 42 + static const ahd_reg_parse_entry_t SEQINTCODE_parse_table[] = { 43 43 { "NO_SEQINT", 0x00, 0xff }, 44 44 { "BAD_PHASE", 0x01, 0xff }, 45 45 { "SEND_REJECT", 0x02, 0xff }, ··· 76 76 0x02, regvalue, cur_col, wrap)); 77 77 } 78 78 79 - static ahd_reg_parse_entry_t CLRINT_parse_table[] = { 79 + static const ahd_reg_parse_entry_t CLRINT_parse_table[] = { 80 80 { "CLRSPLTINT", 0x01, 0x01 }, 81 81 { "CLRCMDINT", 0x02, 0x02 }, 82 82 { "CLRSEQINT", 0x04, 0x04 }, ··· 94 94 0x03, regvalue, cur_col, wrap)); 95 95 } 96 96 97 - static ahd_reg_parse_entry_t ERROR_parse_table[] = { 97 + static const ahd_reg_parse_entry_t ERROR_parse_table[] = { 98 98 { "DSCTMOUT", 0x02, 0x02 }, 99 99 { "ILLOPCODE", 0x04, 0x04 }, 100 100 { "SQPARERR", 0x08, 0x08 }, ··· 111 111 0x04, regvalue, cur_col, wrap)); 112 112 } 113 113 114 - static ahd_reg_parse_entry_t CLRERR_parse_table[] = { 115 - { "CLRDSCTMOUT", 0x02, 0x02 }, 116 - { "CLRILLOPCODE", 0x04, 0x04 }, 117 - { "CLRSQPARERR", 0x08, 0x08 }, 118 - { "CLRDPARERR", 0x10, 0x10 }, 119 - { "CLRMPARERR", 0x20, 0x20 }, 120 - { "CLRCIOACCESFAIL", 0x40, 0x40 }, 121 - { "CLRCIOPARERR", 0x80, 0x80 } 122 - }; 123 - 124 - int 125 - ahd_clrerr_print(u_int regvalue, u_int *cur_col, u_int wrap) 126 - { 127 - return (ahd_print_register(CLRERR_parse_table, 7, "CLRERR", 128 - 0x04, regvalue, cur_col, wrap)); 129 - } 130 - 131 - static ahd_reg_parse_entry_t HCNTRL_parse_table[] = { 114 + static const ahd_reg_parse_entry_t HCNTRL_parse_table[] = { 132 115 { "CHIPRST", 0x01, 0x01 }, 133 116 { "CHIPRSTACK", 0x01, 0x01 }, 134 117 { "INTEN", 0x02, 0x02 }, ··· 143 160 0x08, regvalue, cur_col, wrap)); 144 161 } 145 162 146 - static ahd_reg_parse_entry_t HS_MAILBOX_parse_table[] = { 163 + static const ahd_reg_parse_entry_t HS_MAILBOX_parse_table[] = { 147 164 { "ENINT_COALESCE", 0x40, 0x40 }, 148 165 { "HOST_TQINPOS", 0x80, 0x80 } 149 166 }; ··· 155 172 0x0b, regvalue, cur_col, wrap)); 156 173 } 157 174 158 - static ahd_reg_parse_entry_t SEQINTSTAT_parse_table[] = { 175 + static const ahd_reg_parse_entry_t SEQINTSTAT_parse_table[] = { 159 176 { "SEQ_SPLTINT", 0x01, 0x01 }, 160 177 { "SEQ_PCIINT", 0x02, 0x02 }, 161 178 { "SEQ_SCSIINT", 0x04, 0x04 }, ··· 170 187 0x0c, regvalue, cur_col, wrap)); 171 188 } 172 189 173 - static ahd_reg_parse_entry_t CLRSEQINTSTAT_parse_table[] = { 190 + static const ahd_reg_parse_entry_t CLRSEQINTSTAT_parse_table[] = { 174 191 { "CLRSEQ_SPLTINT", 0x01, 0x01 }, 175 192 { "CLRSEQ_PCIINT", 0x02, 0x02 }, 176 193 { "CLRSEQ_SCSIINT", 0x04, 0x04 }, ··· 213 230 0x14, regvalue, cur_col, wrap)); 214 231 } 215 232 216 - static ahd_reg_parse_entry_t QOFF_CTLSTA_parse_table[] = { 233 + static const ahd_reg_parse_entry_t QOFF_CTLSTA_parse_table[] = { 217 234 { "SCB_QSIZE_4", 0x00, 0x0f }, 218 235 { "SCB_QSIZE_8", 0x01, 0x0f }, 219 236 { "SCB_QSIZE_16", 0x02, 0x0f }, ··· 241 258 0x16, regvalue, cur_col, wrap)); 242 259 } 243 260 244 - static ahd_reg_parse_entry_t INTCTL_parse_table[] = { 261 + static const ahd_reg_parse_entry_t INTCTL_parse_table[] = { 245 262 { "SPLTINTEN", 0x01, 0x01 }, 246 263 { "SEQINTEN", 0x02, 0x02 }, 247 264 { "SCSIINTEN", 0x04, 0x04 }, ··· 259 276 0x18, regvalue, cur_col, wrap)); 260 277 } 261 278 262 - static ahd_reg_parse_entry_t DFCNTRL_parse_table[] = { 279 + static const ahd_reg_parse_entry_t DFCNTRL_parse_table[] = { 263 280 { "DIRECTIONEN", 0x01, 0x01 }, 264 281 { "FIFOFLUSH", 0x02, 0x02 }, 265 282 { "FIFOFLUSHACK", 0x02, 0x02 }, ··· 280 297 0x19, regvalue, cur_col, wrap)); 281 298 } 282 299 283 - static ahd_reg_parse_entry_t DSCOMMAND0_parse_table[] = { 300 + static const ahd_reg_parse_entry_t DSCOMMAND0_parse_table[] = { 284 301 { "CIOPARCKEN", 0x01, 0x01 }, 285 302 { "DISABLE_TWATE", 0x02, 0x02 }, 286 303 { "EXTREQLCK", 0x10, 0x10 }, ··· 296 313 0x19, regvalue, cur_col, wrap)); 297 314 } 298 315 299 - static ahd_reg_parse_entry_t DFSTATUS_parse_table[] = { 316 + static const ahd_reg_parse_entry_t DFSTATUS_parse_table[] = { 300 317 { "FIFOEMP", 0x01, 0x01 }, 301 318 { "FIFOFULL", 0x02, 0x02 }, 302 319 { "DFTHRESH", 0x04, 0x04 }, ··· 313 330 0x1a, regvalue, cur_col, wrap)); 314 331 } 315 332 316 - static ahd_reg_parse_entry_t SG_CACHE_SHADOW_parse_table[] = { 333 + static const ahd_reg_parse_entry_t SG_CACHE_SHADOW_parse_table[] = { 317 334 { "LAST_SEG_DONE", 0x01, 0x01 }, 318 335 { "LAST_SEG", 0x02, 0x02 }, 319 336 { "ODD_SEG", 0x04, 0x04 }, ··· 327 344 0x1b, regvalue, cur_col, wrap)); 328 345 } 329 346 330 - static ahd_reg_parse_entry_t ARBCTL_parse_table[] = { 331 - { "USE_TIME", 0x07, 0x07 }, 332 - { "RETRY_SWEN", 0x08, 0x08 }, 333 - { "RESET_HARB", 0x80, 0x80 } 334 - }; 335 - 336 - int 337 - ahd_arbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 338 - { 339 - return (ahd_print_register(ARBCTL_parse_table, 3, "ARBCTL", 340 - 0x1b, regvalue, cur_col, wrap)); 341 - } 342 - 343 - static ahd_reg_parse_entry_t SG_CACHE_PRE_parse_table[] = { 347 + static const ahd_reg_parse_entry_t SG_CACHE_PRE_parse_table[] = { 344 348 { "LAST_SEG", 0x02, 0x02 }, 345 349 { "ODD_SEG", 0x04, 0x04 }, 346 350 { "SG_ADDR_MASK", 0xf8, 0xf8 } ··· 348 378 } 349 379 350 380 int 351 - ahd_typeptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 352 - { 353 - return (ahd_print_register(NULL, 0, "TYPEPTR", 354 - 0x20, regvalue, cur_col, wrap)); 355 - } 356 - 357 - int 358 - ahd_tagptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 359 - { 360 - return (ahd_print_register(NULL, 0, "TAGPTR", 361 - 0x21, regvalue, cur_col, wrap)); 362 - } 363 - 364 - int 365 381 ahd_lunptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 366 382 { 367 383 return (ahd_print_register(NULL, 0, "LUNPTR", 368 384 0x22, regvalue, cur_col, wrap)); 369 - } 370 - 371 - int 372 - ahd_datalenptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 373 - { 374 - return (ahd_print_register(NULL, 0, "DATALENPTR", 375 - 0x23, regvalue, cur_col, wrap)); 376 - } 377 - 378 - int 379 - ahd_statlenptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 380 - { 381 - return (ahd_print_register(NULL, 0, "STATLENPTR", 382 - 0x24, regvalue, cur_col, wrap)); 383 385 } 384 386 385 387 int ··· 390 448 } 391 449 392 450 int 393 - ahd_idptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 394 - { 395 - return (ahd_print_register(NULL, 0, "IDPTR", 396 - 0x2a, regvalue, cur_col, wrap)); 397 - } 398 - 399 - int 400 451 ahd_abrtbyteptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 401 452 { 402 453 return (ahd_print_register(NULL, 0, "ABRTBYTEPTR", ··· 403 468 0x2c, regvalue, cur_col, wrap)); 404 469 } 405 470 406 - int 407 - ahd_maxcmdbytes_print(u_int regvalue, u_int *cur_col, u_int wrap) 408 - { 409 - return (ahd_print_register(NULL, 0, "MAXCMDBYTES", 410 - 0x2d, regvalue, cur_col, wrap)); 411 - } 412 - 413 - int 414 - ahd_maxcmd2rcv_print(u_int regvalue, u_int *cur_col, u_int wrap) 415 - { 416 - return (ahd_print_register(NULL, 0, "MAXCMD2RCV", 417 - 0x2e, regvalue, cur_col, wrap)); 418 - } 419 - 420 - int 421 - ahd_shortthresh_print(u_int regvalue, u_int *cur_col, u_int wrap) 422 - { 423 - return (ahd_print_register(NULL, 0, "SHORTTHRESH", 424 - 0x2f, regvalue, cur_col, wrap)); 425 - } 426 - 427 - static ahd_reg_parse_entry_t LUNLEN_parse_table[] = { 471 + static const ahd_reg_parse_entry_t LUNLEN_parse_table[] = { 428 472 { "ILUNLEN", 0x0f, 0x0f }, 429 473 { "TLUNLEN", 0xf0, 0xf0 } 430 474 }; ··· 436 522 0x33, regvalue, cur_col, wrap)); 437 523 } 438 524 439 - int 440 - ahd_lqrsvd01_print(u_int regvalue, u_int *cur_col, u_int wrap) 441 - { 442 - return (ahd_print_register(NULL, 0, "LQRSVD01", 443 - 0x34, regvalue, cur_col, wrap)); 444 - } 445 - 446 - int 447 - ahd_lqrsvd16_print(u_int regvalue, u_int *cur_col, u_int wrap) 448 - { 449 - return (ahd_print_register(NULL, 0, "LQRSVD16", 450 - 0x35, regvalue, cur_col, wrap)); 451 - } 452 - 453 - int 454 - ahd_lqrsvd17_print(u_int regvalue, u_int *cur_col, u_int wrap) 455 - { 456 - return (ahd_print_register(NULL, 0, "LQRSVD17", 457 - 0x36, regvalue, cur_col, wrap)); 458 - } 459 - 460 - int 461 - ahd_cmdrsvd0_print(u_int regvalue, u_int *cur_col, u_int wrap) 462 - { 463 - return (ahd_print_register(NULL, 0, "CMDRSVD0", 464 - 0x37, regvalue, cur_col, wrap)); 465 - } 466 - 467 - static ahd_reg_parse_entry_t LQCTL0_parse_table[] = { 468 - { "LQ0INITGCLT", 0x03, 0x03 }, 469 - { "LQ0TARGCLT", 0x0c, 0x0c }, 470 - { "LQIINITGCLT", 0x30, 0x30 }, 471 - { "LQITARGCLT", 0xc0, 0xc0 } 472 - }; 473 - 474 - int 475 - ahd_lqctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) 476 - { 477 - return (ahd_print_register(LQCTL0_parse_table, 4, "LQCTL0", 478 - 0x38, regvalue, cur_col, wrap)); 479 - } 480 - 481 - static ahd_reg_parse_entry_t LQCTL1_parse_table[] = { 525 + static const ahd_reg_parse_entry_t LQCTL1_parse_table[] = { 482 526 { "ABORTPENDING", 0x01, 0x01 }, 483 527 { "SINGLECMD", 0x02, 0x02 }, 484 528 { "PCI2PCI", 0x04, 0x04 } ··· 449 577 0x38, regvalue, cur_col, wrap)); 450 578 } 451 579 452 - static ahd_reg_parse_entry_t SCSBIST0_parse_table[] = { 453 - { "OSBISTRUN", 0x01, 0x01 }, 454 - { "OSBISTDONE", 0x02, 0x02 }, 455 - { "OSBISTERR", 0x04, 0x04 }, 456 - { "GSBISTRUN", 0x10, 0x10 }, 457 - { "GSBISTDONE", 0x20, 0x20 }, 458 - { "GSBISTERR", 0x40, 0x40 } 459 - }; 460 - 461 - int 462 - ahd_scsbist0_print(u_int regvalue, u_int *cur_col, u_int wrap) 463 - { 464 - return (ahd_print_register(SCSBIST0_parse_table, 6, "SCSBIST0", 465 - 0x39, regvalue, cur_col, wrap)); 466 - } 467 - 468 - static ahd_reg_parse_entry_t LQCTL2_parse_table[] = { 580 + static const ahd_reg_parse_entry_t LQCTL2_parse_table[] = { 469 581 { "LQOPAUSE", 0x01, 0x01 }, 470 582 { "LQOTOIDLE", 0x02, 0x02 }, 471 583 { "LQOCONTINUE", 0x04, 0x04 }, ··· 467 611 0x39, regvalue, cur_col, wrap)); 468 612 } 469 613 470 - static ahd_reg_parse_entry_t SCSBIST1_parse_table[] = { 471 - { "NTBISTRUN", 0x01, 0x01 }, 472 - { "NTBISTDONE", 0x02, 0x02 }, 473 - { "NTBISTERR", 0x04, 0x04 } 474 - }; 475 - 476 - int 477 - ahd_scsbist1_print(u_int regvalue, u_int *cur_col, u_int wrap) 478 - { 479 - return (ahd_print_register(SCSBIST1_parse_table, 3, "SCSBIST1", 480 - 0x3a, regvalue, cur_col, wrap)); 481 - } 482 - 483 - static ahd_reg_parse_entry_t SCSISEQ0_parse_table[] = { 614 + static const ahd_reg_parse_entry_t SCSISEQ0_parse_table[] = { 484 615 { "SCSIRSTO", 0x01, 0x01 }, 485 616 { "FORCEBUSFREE", 0x10, 0x10 }, 486 617 { "ENARBO", 0x20, 0x20 }, ··· 482 639 0x3a, regvalue, cur_col, wrap)); 483 640 } 484 641 485 - static ahd_reg_parse_entry_t SCSISEQ1_parse_table[] = { 642 + static const ahd_reg_parse_entry_t SCSISEQ1_parse_table[] = { 486 643 { "ALTSTIM", 0x01, 0x01 }, 487 644 { "ENAUTOATNP", 0x02, 0x02 }, 488 645 { "MANUALP", 0x0c, 0x0c }, ··· 498 655 0x3b, regvalue, cur_col, wrap)); 499 656 } 500 657 501 - static ahd_reg_parse_entry_t SXFRCTL0_parse_table[] = { 658 + static const ahd_reg_parse_entry_t SXFRCTL0_parse_table[] = { 502 659 { "SPIOEN", 0x08, 0x08 }, 503 660 { "BIOSCANCELEN", 0x10, 0x10 }, 504 661 { "DFPEXP", 0x40, 0x40 }, ··· 512 669 0x3c, regvalue, cur_col, wrap)); 513 670 } 514 671 515 - int 516 - ahd_dlcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 517 - { 518 - return (ahd_print_register(NULL, 0, "DLCOUNT", 519 - 0x3c, regvalue, cur_col, wrap)); 520 - } 521 - 522 - int 523 - ahd_businitid_print(u_int regvalue, u_int *cur_col, u_int wrap) 524 - { 525 - return (ahd_print_register(NULL, 0, "BUSINITID", 526 - 0x3c, regvalue, cur_col, wrap)); 527 - } 528 - 529 - static ahd_reg_parse_entry_t SXFRCTL1_parse_table[] = { 672 + static const ahd_reg_parse_entry_t SXFRCTL1_parse_table[] = { 530 673 { "STPWEN", 0x01, 0x01 }, 531 674 { "ACTNEGEN", 0x02, 0x02 }, 532 675 { "ENSTIMER", 0x04, 0x04 }, ··· 529 700 0x3d, regvalue, cur_col, wrap)); 530 701 } 531 702 532 - int 533 - ahd_bustargid_print(u_int regvalue, u_int *cur_col, u_int wrap) 534 - { 535 - return (ahd_print_register(NULL, 0, "BUSTARGID", 536 - 0x3e, regvalue, cur_col, wrap)); 537 - } 538 - 539 - static ahd_reg_parse_entry_t SXFRCTL2_parse_table[] = { 540 - { "ASU", 0x07, 0x07 }, 541 - { "CMDDMAEN", 0x08, 0x08 }, 542 - { "AUTORSTDIS", 0x10, 0x10 } 543 - }; 544 - 545 - int 546 - ahd_sxfrctl2_print(u_int regvalue, u_int *cur_col, u_int wrap) 547 - { 548 - return (ahd_print_register(SXFRCTL2_parse_table, 3, "SXFRCTL2", 549 - 0x3e, regvalue, cur_col, wrap)); 550 - } 551 - 552 - static ahd_reg_parse_entry_t DFFSTAT_parse_table[] = { 703 + static const ahd_reg_parse_entry_t DFFSTAT_parse_table[] = { 553 704 { "CURRFIFO_0", 0x00, 0x03 }, 554 705 { "CURRFIFO_1", 0x01, 0x03 }, 555 706 { "CURRFIFO_NONE", 0x03, 0x03 }, ··· 545 736 0x3f, regvalue, cur_col, wrap)); 546 737 } 547 738 548 - static ahd_reg_parse_entry_t SCSISIGO_parse_table[] = { 739 + int 740 + ahd_multargid_print(u_int regvalue, u_int *cur_col, u_int wrap) 741 + { 742 + return (ahd_print_register(NULL, 0, "MULTARGID", 743 + 0x40, regvalue, cur_col, wrap)); 744 + } 745 + 746 + static const ahd_reg_parse_entry_t SCSISIGO_parse_table[] = { 549 747 { "P_DATAOUT", 0x00, 0xe0 }, 550 748 { "P_DATAOUT_DT", 0x20, 0xe0 }, 551 749 { "P_DATAIN", 0x40, 0xe0 }, ··· 579 763 0x40, regvalue, cur_col, wrap)); 580 764 } 581 765 582 - int 583 - ahd_multargid_print(u_int regvalue, u_int *cur_col, u_int wrap) 584 - { 585 - return (ahd_print_register(NULL, 0, "MULTARGID", 586 - 0x40, regvalue, cur_col, wrap)); 587 - } 588 - 589 - static ahd_reg_parse_entry_t SCSISIGI_parse_table[] = { 766 + static const ahd_reg_parse_entry_t SCSISIGI_parse_table[] = { 590 767 { "P_DATAOUT", 0x00, 0xe0 }, 591 768 { "P_DATAOUT_DT", 0x20, 0xe0 }, 592 769 { "P_DATAIN", 0x40, 0xe0 }, ··· 606 797 0x41, regvalue, cur_col, wrap)); 607 798 } 608 799 609 - static ahd_reg_parse_entry_t SCSIPHASE_parse_table[] = { 800 + static const ahd_reg_parse_entry_t SCSIPHASE_parse_table[] = { 610 801 { "DATA_OUT_PHASE", 0x01, 0x03 }, 611 802 { "DATA_IN_PHASE", 0x02, 0x03 }, 612 803 { "DATA_PHASE_MASK", 0x03, 0x03 }, ··· 624 815 } 625 816 626 817 int 627 - ahd_scsidat0_img_print(u_int regvalue, u_int *cur_col, u_int wrap) 628 - { 629 - return (ahd_print_register(NULL, 0, "SCSIDAT0_IMG", 630 - 0x43, regvalue, cur_col, wrap)); 631 - } 632 - 633 - int 634 818 ahd_scsidat_print(u_int regvalue, u_int *cur_col, u_int wrap) 635 819 { 636 820 return (ahd_print_register(NULL, 0, "SCSIDAT", ··· 637 835 0x46, regvalue, cur_col, wrap)); 638 836 } 639 837 640 - static ahd_reg_parse_entry_t TARGIDIN_parse_table[] = { 838 + static const ahd_reg_parse_entry_t TARGIDIN_parse_table[] = { 641 839 { "TARGID", 0x0f, 0x0f }, 642 840 { "CLKOUT", 0x80, 0x80 } 643 841 }; ··· 649 847 0x48, regvalue, cur_col, wrap)); 650 848 } 651 849 652 - static ahd_reg_parse_entry_t SELID_parse_table[] = { 850 + static const ahd_reg_parse_entry_t SELID_parse_table[] = { 653 851 { "ONEBIT", 0x08, 0x08 }, 654 852 { "SELID_MASK", 0xf0, 0xf0 } 655 853 }; ··· 661 859 0x49, regvalue, cur_col, wrap)); 662 860 } 663 861 664 - static ahd_reg_parse_entry_t OPTIONMODE_parse_table[] = { 862 + static const ahd_reg_parse_entry_t OPTIONMODE_parse_table[] = { 665 863 { "AUTO_MSGOUT_DE", 0x02, 0x02 }, 666 864 { "ENDGFORMCHK", 0x04, 0x04 }, 667 865 { "BUSFREEREV", 0x10, 0x10 }, ··· 678 876 0x4a, regvalue, cur_col, wrap)); 679 877 } 680 878 681 - static ahd_reg_parse_entry_t SBLKCTL_parse_table[] = { 879 + static const ahd_reg_parse_entry_t SBLKCTL_parse_table[] = { 682 880 { "SELWIDE", 0x02, 0x02 }, 683 881 { "ENAB20", 0x04, 0x04 }, 684 882 { "ENAB40", 0x08, 0x08 }, ··· 693 891 0x4a, regvalue, cur_col, wrap)); 694 892 } 695 893 696 - static ahd_reg_parse_entry_t CLRSINT0_parse_table[] = { 697 - { "CLRARBDO", 0x01, 0x01 }, 698 - { "CLRSPIORDY", 0x02, 0x02 }, 699 - { "CLROVERRUN", 0x04, 0x04 }, 700 - { "CLRIOERR", 0x08, 0x08 }, 701 - { "CLRSELINGO", 0x10, 0x10 }, 702 - { "CLRSELDI", 0x20, 0x20 }, 703 - { "CLRSELDO", 0x40, 0x40 } 704 - }; 705 - 706 - int 707 - ahd_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 708 - { 709 - return (ahd_print_register(CLRSINT0_parse_table, 7, "CLRSINT0", 710 - 0x4b, regvalue, cur_col, wrap)); 711 - } 712 - 713 - static ahd_reg_parse_entry_t SSTAT0_parse_table[] = { 894 + static const ahd_reg_parse_entry_t SSTAT0_parse_table[] = { 714 895 { "ARBDO", 0x01, 0x01 }, 715 896 { "SPIORDY", 0x02, 0x02 }, 716 897 { "OVERRUN", 0x04, 0x04 }, ··· 711 926 0x4b, regvalue, cur_col, wrap)); 712 927 } 713 928 714 - static ahd_reg_parse_entry_t SIMODE0_parse_table[] = { 929 + static const ahd_reg_parse_entry_t SIMODE0_parse_table[] = { 715 930 { "ENARBDO", 0x01, 0x01 }, 716 931 { "ENSPIORDY", 0x02, 0x02 }, 717 932 { "ENOVERRUN", 0x04, 0x04 }, ··· 728 943 0x4b, regvalue, cur_col, wrap)); 729 944 } 730 945 731 - static ahd_reg_parse_entry_t CLRSINT1_parse_table[] = { 732 - { "CLRREQINIT", 0x01, 0x01 }, 733 - { "CLRSTRB2FAST", 0x02, 0x02 }, 734 - { "CLRSCSIPERR", 0x04, 0x04 }, 735 - { "CLRBUSFREE", 0x08, 0x08 }, 736 - { "CLRSCSIRSTI", 0x20, 0x20 }, 737 - { "CLRATNO", 0x40, 0x40 }, 738 - { "CLRSELTIMEO", 0x80, 0x80 } 946 + static const ahd_reg_parse_entry_t CLRSINT0_parse_table[] = { 947 + { "CLRARBDO", 0x01, 0x01 }, 948 + { "CLRSPIORDY", 0x02, 0x02 }, 949 + { "CLROVERRUN", 0x04, 0x04 }, 950 + { "CLRIOERR", 0x08, 0x08 }, 951 + { "CLRSELINGO", 0x10, 0x10 }, 952 + { "CLRSELDI", 0x20, 0x20 }, 953 + { "CLRSELDO", 0x40, 0x40 } 739 954 }; 740 955 741 956 int 742 - ahd_clrsint1_print(u_int regvalue, u_int *cur_col, u_int wrap) 957 + ahd_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 743 958 { 744 - return (ahd_print_register(CLRSINT1_parse_table, 7, "CLRSINT1", 745 - 0x4c, regvalue, cur_col, wrap)); 959 + return (ahd_print_register(CLRSINT0_parse_table, 7, "CLRSINT0", 960 + 0x4b, regvalue, cur_col, wrap)); 746 961 } 747 962 748 - static ahd_reg_parse_entry_t SSTAT1_parse_table[] = { 963 + static const ahd_reg_parse_entry_t SSTAT1_parse_table[] = { 749 964 { "REQINIT", 0x01, 0x01 }, 750 965 { "STRB2FAST", 0x02, 0x02 }, 751 966 { "SCSIPERR", 0x04, 0x04 }, ··· 763 978 0x4c, regvalue, cur_col, wrap)); 764 979 } 765 980 766 - static ahd_reg_parse_entry_t SSTAT2_parse_table[] = { 981 + static const ahd_reg_parse_entry_t CLRSINT1_parse_table[] = { 982 + { "CLRREQINIT", 0x01, 0x01 }, 983 + { "CLRSTRB2FAST", 0x02, 0x02 }, 984 + { "CLRSCSIPERR", 0x04, 0x04 }, 985 + { "CLRBUSFREE", 0x08, 0x08 }, 986 + { "CLRSCSIRSTI", 0x20, 0x20 }, 987 + { "CLRATNO", 0x40, 0x40 }, 988 + { "CLRSELTIMEO", 0x80, 0x80 } 989 + }; 990 + 991 + int 992 + ahd_clrsint1_print(u_int regvalue, u_int *cur_col, u_int wrap) 993 + { 994 + return (ahd_print_register(CLRSINT1_parse_table, 7, "CLRSINT1", 995 + 0x4c, regvalue, cur_col, wrap)); 996 + } 997 + 998 + static const ahd_reg_parse_entry_t SSTAT2_parse_table[] = { 767 999 { "BUSFREE_LQO", 0x40, 0xc0 }, 768 1000 { "BUSFREE_DFF0", 0x80, 0xc0 }, 769 1001 { "BUSFREE_DFF1", 0xc0, 0xc0 }, ··· 800 998 0x4d, regvalue, cur_col, wrap)); 801 999 } 802 1000 803 - static ahd_reg_parse_entry_t SIMODE2_parse_table[] = { 804 - { "ENDMADONE", 0x01, 0x01 }, 805 - { "ENSDONE", 0x02, 0x02 }, 806 - { "ENWIDE_RES", 0x04, 0x04 } 807 - }; 808 - 809 - int 810 - ahd_simode2_print(u_int regvalue, u_int *cur_col, u_int wrap) 811 - { 812 - return (ahd_print_register(SIMODE2_parse_table, 3, "SIMODE2", 813 - 0x4d, regvalue, cur_col, wrap)); 814 - } 815 - 816 - static ahd_reg_parse_entry_t CLRSINT2_parse_table[] = { 1001 + static const ahd_reg_parse_entry_t CLRSINT2_parse_table[] = { 817 1002 { "CLRDMADONE", 0x01, 0x01 }, 818 1003 { "CLRSDONE", 0x02, 0x02 }, 819 1004 { "CLRWIDE_RES", 0x04, 0x04 }, ··· 814 1025 0x4d, regvalue, cur_col, wrap)); 815 1026 } 816 1027 817 - static ahd_reg_parse_entry_t PERRDIAG_parse_table[] = { 1028 + static const ahd_reg_parse_entry_t PERRDIAG_parse_table[] = { 818 1029 { "DTERR", 0x01, 0x01 }, 819 1030 { "DGFORMERR", 0x02, 0x02 }, 820 1031 { "CRCERR", 0x04, 0x04 }, ··· 853 1064 0x4f, regvalue, cur_col, wrap)); 854 1065 } 855 1066 856 - static ahd_reg_parse_entry_t LQISTAT0_parse_table[] = { 1067 + static const ahd_reg_parse_entry_t LQISTAT0_parse_table[] = { 857 1068 { "LQIATNCMD", 0x01, 0x01 }, 858 1069 { "LQIATNLQ", 0x02, 0x02 }, 859 1070 { "LQIBADLQT", 0x04, 0x04 }, ··· 869 1080 0x50, regvalue, cur_col, wrap)); 870 1081 } 871 1082 872 - static ahd_reg_parse_entry_t CLRLQIINT0_parse_table[] = { 873 - { "CLRLQIATNCMD", 0x01, 0x01 }, 874 - { "CLRLQIATNLQ", 0x02, 0x02 }, 875 - { "CLRLQIBADLQT", 0x04, 0x04 }, 876 - { "CLRLQICRCT2", 0x08, 0x08 }, 877 - { "CLRLQICRCT1", 0x10, 0x10 }, 878 - { "CLRLQIATNQAS", 0x20, 0x20 } 879 - }; 880 - 881 - int 882 - ahd_clrlqiint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 883 - { 884 - return (ahd_print_register(CLRLQIINT0_parse_table, 6, "CLRLQIINT0", 885 - 0x50, regvalue, cur_col, wrap)); 886 - } 887 - 888 - static ahd_reg_parse_entry_t LQIMODE0_parse_table[] = { 1083 + static const ahd_reg_parse_entry_t LQIMODE0_parse_table[] = { 889 1084 { "ENLQIATNCMD", 0x01, 0x01 }, 890 1085 { "ENLQIATNLQ", 0x02, 0x02 }, 891 1086 { "ENLQIBADLQT", 0x04, 0x04 }, ··· 885 1112 0x50, regvalue, cur_col, wrap)); 886 1113 } 887 1114 888 - static ahd_reg_parse_entry_t LQIMODE1_parse_table[] = { 1115 + static const ahd_reg_parse_entry_t CLRLQIINT0_parse_table[] = { 1116 + { "CLRLQIATNCMD", 0x01, 0x01 }, 1117 + { "CLRLQIATNLQ", 0x02, 0x02 }, 1118 + { "CLRLQIBADLQT", 0x04, 0x04 }, 1119 + { "CLRLQICRCT2", 0x08, 0x08 }, 1120 + { "CLRLQICRCT1", 0x10, 0x10 }, 1121 + { "CLRLQIATNQAS", 0x20, 0x20 } 1122 + }; 1123 + 1124 + int 1125 + ahd_clrlqiint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1126 + { 1127 + return (ahd_print_register(CLRLQIINT0_parse_table, 6, "CLRLQIINT0", 1128 + 0x50, regvalue, cur_col, wrap)); 1129 + } 1130 + 1131 + static const ahd_reg_parse_entry_t LQIMODE1_parse_table[] = { 889 1132 { "ENLQIOVERI_NLQ", 0x01, 0x01 }, 890 1133 { "ENLQIOVERI_LQ", 0x02, 0x02 }, 891 1134 { "ENLQIBADLQI", 0x04, 0x04 }, ··· 919 1130 0x51, regvalue, cur_col, wrap)); 920 1131 } 921 1132 922 - static ahd_reg_parse_entry_t LQISTAT1_parse_table[] = { 1133 + static const ahd_reg_parse_entry_t LQISTAT1_parse_table[] = { 923 1134 { "LQIOVERI_NLQ", 0x01, 0x01 }, 924 1135 { "LQIOVERI_LQ", 0x02, 0x02 }, 925 1136 { "LQIBADLQI", 0x04, 0x04 }, ··· 937 1148 0x51, regvalue, cur_col, wrap)); 938 1149 } 939 1150 940 - static ahd_reg_parse_entry_t CLRLQIINT1_parse_table[] = { 1151 + static const ahd_reg_parse_entry_t CLRLQIINT1_parse_table[] = { 941 1152 { "CLRLQIOVERI_NLQ", 0x01, 0x01 }, 942 1153 { "CLRLQIOVERI_LQ", 0x02, 0x02 }, 943 1154 { "CLRLQIBADLQI", 0x04, 0x04 }, ··· 955 1166 0x51, regvalue, cur_col, wrap)); 956 1167 } 957 1168 958 - static ahd_reg_parse_entry_t LQISTAT2_parse_table[] = { 1169 + static const ahd_reg_parse_entry_t LQISTAT2_parse_table[] = { 959 1170 { "LQIGSAVAIL", 0x01, 0x01 }, 960 1171 { "LQISTOPCMD", 0x02, 0x02 }, 961 1172 { "LQISTOPLQ", 0x04, 0x04 }, ··· 973 1184 0x52, regvalue, cur_col, wrap)); 974 1185 } 975 1186 976 - static ahd_reg_parse_entry_t SSTAT3_parse_table[] = { 1187 + static const ahd_reg_parse_entry_t SSTAT3_parse_table[] = { 977 1188 { "OSRAMPERR", 0x01, 0x01 }, 978 1189 { "NTRAMPERR", 0x02, 0x02 } 979 1190 }; ··· 985 1196 0x53, regvalue, cur_col, wrap)); 986 1197 } 987 1198 988 - static ahd_reg_parse_entry_t SIMODE3_parse_table[] = { 1199 + static const ahd_reg_parse_entry_t SIMODE3_parse_table[] = { 989 1200 { "ENOSRAMPERR", 0x01, 0x01 }, 990 1201 { "ENNTRAMPERR", 0x02, 0x02 } 991 1202 }; ··· 997 1208 0x53, regvalue, cur_col, wrap)); 998 1209 } 999 1210 1000 - static ahd_reg_parse_entry_t CLRSINT3_parse_table[] = { 1211 + static const ahd_reg_parse_entry_t CLRSINT3_parse_table[] = { 1001 1212 { "CLROSRAMPERR", 0x01, 0x01 }, 1002 1213 { "CLRNTRAMPERR", 0x02, 0x02 } 1003 1214 }; ··· 1009 1220 0x53, regvalue, cur_col, wrap)); 1010 1221 } 1011 1222 1012 - static ahd_reg_parse_entry_t LQOSTAT0_parse_table[] = { 1223 + static const ahd_reg_parse_entry_t LQOSTAT0_parse_table[] = { 1013 1224 { "LQOTCRC", 0x01, 0x01 }, 1014 1225 { "LQOATNPKT", 0x02, 0x02 }, 1015 1226 { "LQOATNLQ", 0x04, 0x04 }, ··· 1024 1235 0x54, regvalue, cur_col, wrap)); 1025 1236 } 1026 1237 1027 - static ahd_reg_parse_entry_t CLRLQOINT0_parse_table[] = { 1238 + static const ahd_reg_parse_entry_t CLRLQOINT0_parse_table[] = { 1028 1239 { "CLRLQOTCRC", 0x01, 0x01 }, 1029 1240 { "CLRLQOATNPKT", 0x02, 0x02 }, 1030 1241 { "CLRLQOATNLQ", 0x04, 0x04 }, ··· 1039 1250 0x54, regvalue, cur_col, wrap)); 1040 1251 } 1041 1252 1042 - static ahd_reg_parse_entry_t LQOMODE0_parse_table[] = { 1253 + static const ahd_reg_parse_entry_t LQOMODE0_parse_table[] = { 1043 1254 { "ENLQOTCRC", 0x01, 0x01 }, 1044 1255 { "ENLQOATNPKT", 0x02, 0x02 }, 1045 1256 { "ENLQOATNLQ", 0x04, 0x04 }, ··· 1054 1265 0x54, regvalue, cur_col, wrap)); 1055 1266 } 1056 1267 1057 - static ahd_reg_parse_entry_t LQOMODE1_parse_table[] = { 1268 + static const ahd_reg_parse_entry_t LQOMODE1_parse_table[] = { 1058 1269 { "ENLQOPHACHGINPKT", 0x01, 0x01 }, 1059 1270 { "ENLQOBUSFREE", 0x02, 0x02 }, 1060 1271 { "ENLQOBADQAS", 0x04, 0x04 }, ··· 1069 1280 0x55, regvalue, cur_col, wrap)); 1070 1281 } 1071 1282 1072 - static ahd_reg_parse_entry_t LQOSTAT1_parse_table[] = { 1283 + static const ahd_reg_parse_entry_t LQOSTAT1_parse_table[] = { 1073 1284 { "LQOPHACHGINPKT", 0x01, 0x01 }, 1074 1285 { "LQOBUSFREE", 0x02, 0x02 }, 1075 1286 { "LQOBADQAS", 0x04, 0x04 }, ··· 1084 1295 0x55, regvalue, cur_col, wrap)); 1085 1296 } 1086 1297 1087 - static ahd_reg_parse_entry_t CLRLQOINT1_parse_table[] = { 1298 + static const ahd_reg_parse_entry_t CLRLQOINT1_parse_table[] = { 1088 1299 { "CLRLQOPHACHGINPKT", 0x01, 0x01 }, 1089 1300 { "CLRLQOBUSFREE", 0x02, 0x02 }, 1090 1301 { "CLRLQOBADQAS", 0x04, 0x04 }, ··· 1099 1310 0x55, regvalue, cur_col, wrap)); 1100 1311 } 1101 1312 1102 - static ahd_reg_parse_entry_t LQOSTAT2_parse_table[] = { 1313 + static const ahd_reg_parse_entry_t LQOSTAT2_parse_table[] = { 1103 1314 { "LQOSTOP0", 0x01, 0x01 }, 1104 1315 { "LQOPHACHGOUTPKT", 0x02, 0x02 }, 1105 1316 { "LQOWAITFIFO", 0x10, 0x10 }, ··· 1120 1331 0x56, regvalue, cur_col, wrap)); 1121 1332 } 1122 1333 1123 - static ahd_reg_parse_entry_t SIMODE1_parse_table[] = { 1334 + static const ahd_reg_parse_entry_t SIMODE1_parse_table[] = { 1124 1335 { "ENREQINIT", 0x01, 0x01 }, 1125 1336 { "ENSTRB2FAST", 0x02, 0x02 }, 1126 1337 { "ENSCSIPERR", 0x04, 0x04 }, ··· 1145 1356 0x58, regvalue, cur_col, wrap)); 1146 1357 } 1147 1358 1148 - static ahd_reg_parse_entry_t DFFSXFRCTL_parse_table[] = { 1359 + static const ahd_reg_parse_entry_t DFFSXFRCTL_parse_table[] = { 1149 1360 { "RSTCHN", 0x01, 0x01 }, 1150 1361 { "CLRCHN", 0x02, 0x02 }, 1151 1362 { "CLRSHCNT", 0x04, 0x04 }, ··· 1159 1370 0x5a, regvalue, cur_col, wrap)); 1160 1371 } 1161 1372 1162 - static ahd_reg_parse_entry_t LQOSCSCTL_parse_table[] = { 1373 + static const ahd_reg_parse_entry_t LQOSCSCTL_parse_table[] = { 1163 1374 { "LQONOCHKOVER", 0x01, 0x01 }, 1375 + { "LQONOHOLDLACK", 0x02, 0x02 }, 1376 + { "LQOBUSETDLY", 0x40, 0x40 }, 1164 1377 { "LQOH2A_VERSION", 0x80, 0x80 } 1165 1378 }; 1166 1379 1167 1380 int 1168 1381 ahd_lqoscsctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1169 1382 { 1170 - return (ahd_print_register(LQOSCSCTL_parse_table, 2, "LQOSCSCTL", 1383 + return (ahd_print_register(LQOSCSCTL_parse_table, 4, "LQOSCSCTL", 1171 1384 0x5a, regvalue, cur_col, wrap)); 1172 1385 } 1173 1386 ··· 1180 1389 0x5a, regvalue, cur_col, wrap)); 1181 1390 } 1182 1391 1183 - static ahd_reg_parse_entry_t CLRSEQINTSRC_parse_table[] = { 1392 + static const ahd_reg_parse_entry_t CLRSEQINTSRC_parse_table[] = { 1184 1393 { "CLRCFG4TCMD", 0x01, 0x01 }, 1185 1394 { "CLRCFG4ICMD", 0x02, 0x02 }, 1186 1395 { "CLRCFG4TSTAT", 0x04, 0x04 }, ··· 1197 1406 0x5b, regvalue, cur_col, wrap)); 1198 1407 } 1199 1408 1200 - static ahd_reg_parse_entry_t SEQINTSRC_parse_table[] = { 1409 + static const ahd_reg_parse_entry_t SEQINTSRC_parse_table[] = { 1201 1410 { "CFG4TCMD", 0x01, 0x01 }, 1202 1411 { "CFG4ICMD", 0x02, 0x02 }, 1203 1412 { "CFG4TSTAT", 0x04, 0x04 }, ··· 1214 1423 0x5b, regvalue, cur_col, wrap)); 1215 1424 } 1216 1425 1217 - int 1218 - ahd_currscb_print(u_int regvalue, u_int *cur_col, u_int wrap) 1219 - { 1220 - return (ahd_print_register(NULL, 0, "CURRSCB", 1221 - 0x5c, regvalue, cur_col, wrap)); 1222 - } 1223 - 1224 - static ahd_reg_parse_entry_t SEQIMODE_parse_table[] = { 1426 + static const ahd_reg_parse_entry_t SEQIMODE_parse_table[] = { 1225 1427 { "ENCFG4TCMD", 0x01, 0x01 }, 1226 1428 { "ENCFG4ICMD", 0x02, 0x02 }, 1227 1429 { "ENCFG4TSTAT", 0x04, 0x04 }, ··· 1231 1447 0x5c, regvalue, cur_col, wrap)); 1232 1448 } 1233 1449 1234 - static ahd_reg_parse_entry_t MDFFSTAT_parse_table[] = { 1450 + int 1451 + ahd_currscb_print(u_int regvalue, u_int *cur_col, u_int wrap) 1452 + { 1453 + return (ahd_print_register(NULL, 0, "CURRSCB", 1454 + 0x5c, regvalue, cur_col, wrap)); 1455 + } 1456 + 1457 + static const ahd_reg_parse_entry_t MDFFSTAT_parse_table[] = { 1235 1458 { "FIFOFREE", 0x01, 0x01 }, 1236 1459 { "DATAINFIFO", 0x02, 0x02 }, 1237 1460 { "DLZERO", 0x04, 0x04 }, ··· 1255 1464 0x5d, regvalue, cur_col, wrap)); 1256 1465 } 1257 1466 1258 - static ahd_reg_parse_entry_t CRCCONTROL_parse_table[] = { 1259 - { "CRCVALCHKEN", 0x40, 0x40 } 1260 - }; 1261 - 1262 - int 1263 - ahd_crccontrol_print(u_int regvalue, u_int *cur_col, u_int wrap) 1264 - { 1265 - return (ahd_print_register(CRCCONTROL_parse_table, 1, "CRCCONTROL", 1266 - 0x5d, regvalue, cur_col, wrap)); 1267 - } 1268 - 1269 - int 1270 - ahd_dfftag_print(u_int regvalue, u_int *cur_col, u_int wrap) 1271 - { 1272 - return (ahd_print_register(NULL, 0, "DFFTAG", 1273 - 0x5e, regvalue, cur_col, wrap)); 1274 - } 1275 - 1276 1467 int 1277 1468 ahd_lastscb_print(u_int regvalue, u_int *cur_col, u_int wrap) 1278 1469 { 1279 1470 return (ahd_print_register(NULL, 0, "LASTSCB", 1280 1471 0x5e, regvalue, cur_col, wrap)); 1281 - } 1282 - 1283 - static ahd_reg_parse_entry_t SCSITEST_parse_table[] = { 1284 - { "SEL_TXPLL_DEBUG", 0x04, 0x04 }, 1285 - { "CNTRTEST", 0x08, 0x08 } 1286 - }; 1287 - 1288 - int 1289 - ahd_scsitest_print(u_int regvalue, u_int *cur_col, u_int wrap) 1290 - { 1291 - return (ahd_print_register(SCSITEST_parse_table, 2, "SCSITEST", 1292 - 0x5e, regvalue, cur_col, wrap)); 1293 - } 1294 - 1295 - static ahd_reg_parse_entry_t IOPDNCTL_parse_table[] = { 1296 - { "PDN_DIFFSENSE", 0x01, 0x01 }, 1297 - { "PDN_IDIST", 0x04, 0x04 }, 1298 - { "DISABLE_OE", 0x80, 0x80 } 1299 - }; 1300 - 1301 - int 1302 - ahd_iopdnctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1303 - { 1304 - return (ahd_print_register(IOPDNCTL_parse_table, 3, "IOPDNCTL", 1305 - 0x5f, regvalue, cur_col, wrap)); 1306 1472 } 1307 1473 1308 1474 int ··· 1277 1529 } 1278 1530 1279 1531 int 1280 - ahd_dgrpcrci_print(u_int regvalue, u_int *cur_col, u_int wrap) 1281 - { 1282 - return (ahd_print_register(NULL, 0, "DGRPCRCI", 1283 - 0x60, regvalue, cur_col, wrap)); 1284 - } 1285 - 1286 - int 1287 1532 ahd_negperiod_print(u_int regvalue, u_int *cur_col, u_int wrap) 1288 1533 { 1289 1534 return (ahd_print_register(NULL, 0, "NEGPERIOD", 1290 1535 0x61, regvalue, cur_col, wrap)); 1291 - } 1292 - 1293 - int 1294 - ahd_packcrci_print(u_int regvalue, u_int *cur_col, u_int wrap) 1295 - { 1296 - return (ahd_print_register(NULL, 0, "PACKCRCI", 1297 - 0x62, regvalue, cur_col, wrap)); 1298 1536 } 1299 1537 1300 1538 int ··· 1290 1556 0x62, regvalue, cur_col, wrap)); 1291 1557 } 1292 1558 1293 - static ahd_reg_parse_entry_t NEGPPROPTS_parse_table[] = { 1559 + static const ahd_reg_parse_entry_t NEGPPROPTS_parse_table[] = { 1294 1560 { "PPROPT_IUT", 0x01, 0x01 }, 1295 1561 { "PPROPT_DT", 0x02, 0x02 }, 1296 1562 { "PPROPT_QAS", 0x04, 0x04 }, ··· 1304 1570 0x63, regvalue, cur_col, wrap)); 1305 1571 } 1306 1572 1307 - static ahd_reg_parse_entry_t NEGCONOPTS_parse_table[] = { 1573 + static const ahd_reg_parse_entry_t NEGCONOPTS_parse_table[] = { 1308 1574 { "WIDEXFER", 0x01, 0x01 }, 1309 1575 { "ENAUTOATNO", 0x02, 0x02 }, 1310 1576 { "ENAUTOATNI", 0x04, 0x04 }, ··· 1335 1601 0x66, regvalue, cur_col, wrap)); 1336 1602 } 1337 1603 1338 - static ahd_reg_parse_entry_t SCSCHKN_parse_table[] = { 1604 + static const ahd_reg_parse_entry_t SCSCHKN_parse_table[] = { 1339 1605 { "LSTSGCLRDIS", 0x01, 0x01 }, 1340 1606 { "SHVALIDSTDIS", 0x02, 0x02 }, 1341 1607 { "DFFACTCLR", 0x04, 0x04 }, 1342 1608 { "SDONEMSKDIS", 0x08, 0x08 }, 1343 1609 { "WIDERESEN", 0x10, 0x10 }, 1344 1610 { "CURRFIFODEF", 0x20, 0x20 }, 1345 - { "STSELSKIDDIS", 0x40, 0x40 } 1611 + { "STSELSKIDDIS", 0x40, 0x40 }, 1612 + { "BIDICHKDIS", 0x80, 0x80 } 1346 1613 }; 1347 1614 1348 1615 int 1349 1616 ahd_scschkn_print(u_int regvalue, u_int *cur_col, u_int wrap) 1350 1617 { 1351 - return (ahd_print_register(SCSCHKN_parse_table, 7, "SCSCHKN", 1618 + return (ahd_print_register(SCSCHKN_parse_table, 8, "SCSCHKN", 1352 1619 0x66, regvalue, cur_col, wrap)); 1353 1620 } 1354 1621 ··· 1358 1623 { 1359 1624 return (ahd_print_register(NULL, 0, "IOWNID", 1360 1625 0x67, regvalue, cur_col, wrap)); 1361 - } 1362 - 1363 - static ahd_reg_parse_entry_t PLL960CTL0_parse_table[] = { 1364 - { "PLL_ENFBM", 0x01, 0x01 }, 1365 - { "PLL_DLPF", 0x02, 0x02 }, 1366 - { "PLL_ENLPF", 0x04, 0x04 }, 1367 - { "PLL_ENLUD", 0x08, 0x08 }, 1368 - { "PLL_NS", 0x30, 0x30 }, 1369 - { "PLL_PWDN", 0x40, 0x40 }, 1370 - { "PLL_VCOSEL", 0x80, 0x80 } 1371 - }; 1372 - 1373 - int 1374 - ahd_pll960ctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1375 - { 1376 - return (ahd_print_register(PLL960CTL0_parse_table, 7, "PLL960CTL0", 1377 - 0x68, regvalue, cur_col, wrap)); 1378 1626 } 1379 1627 1380 1628 int ··· 1374 1656 0x69, regvalue, cur_col, wrap)); 1375 1657 } 1376 1658 1377 - static ahd_reg_parse_entry_t PLL960CTL1_parse_table[] = { 1378 - { "PLL_RST", 0x01, 0x01 }, 1379 - { "PLL_CNTCLR", 0x40, 0x40 }, 1380 - { "PLL_CNTEN", 0x80, 0x80 } 1381 - }; 1382 - 1383 - int 1384 - ahd_pll960ctl1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1385 - { 1386 - return (ahd_print_register(PLL960CTL1_parse_table, 3, "PLL960CTL1", 1387 - 0x69, regvalue, cur_col, wrap)); 1388 - } 1389 - 1390 - int 1391 - ahd_pll960cnt0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1392 - { 1393 - return (ahd_print_register(NULL, 0, "PLL960CNT0", 1394 - 0x6a, regvalue, cur_col, wrap)); 1395 - } 1396 - 1397 - int 1398 - ahd_xsig_print(u_int regvalue, u_int *cur_col, u_int wrap) 1399 - { 1400 - return (ahd_print_register(NULL, 0, "XSIG", 1401 - 0x6a, regvalue, cur_col, wrap)); 1402 - } 1403 - 1404 1659 int 1405 1660 ahd_seloid_print(u_int regvalue, u_int *cur_col, u_int wrap) 1406 1661 { ··· 1381 1690 0x6b, regvalue, cur_col, wrap)); 1382 1691 } 1383 1692 1384 - static ahd_reg_parse_entry_t PLL400CTL0_parse_table[] = { 1385 - { "PLL_ENFBM", 0x01, 0x01 }, 1386 - { "PLL_DLPF", 0x02, 0x02 }, 1387 - { "PLL_ENLPF", 0x04, 0x04 }, 1388 - { "PLL_ENLUD", 0x08, 0x08 }, 1389 - { "PLL_NS", 0x30, 0x30 }, 1390 - { "PLL_PWDN", 0x40, 0x40 }, 1391 - { "PLL_VCOSEL", 0x80, 0x80 } 1392 - }; 1393 - 1394 - int 1395 - ahd_pll400ctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1396 - { 1397 - return (ahd_print_register(PLL400CTL0_parse_table, 7, "PLL400CTL0", 1398 - 0x6c, regvalue, cur_col, wrap)); 1399 - } 1400 - 1401 - int 1402 - ahd_fairness_print(u_int regvalue, u_int *cur_col, u_int wrap) 1403 - { 1404 - return (ahd_print_register(NULL, 0, "FAIRNESS", 1405 - 0x6c, regvalue, cur_col, wrap)); 1406 - } 1407 - 1408 - static ahd_reg_parse_entry_t PLL400CTL1_parse_table[] = { 1409 - { "PLL_RST", 0x01, 0x01 }, 1410 - { "PLL_CNTCLR", 0x40, 0x40 }, 1411 - { "PLL_CNTEN", 0x80, 0x80 } 1412 - }; 1413 - 1414 - int 1415 - ahd_pll400ctl1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1416 - { 1417 - return (ahd_print_register(PLL400CTL1_parse_table, 3, "PLL400CTL1", 1418 - 0x6d, regvalue, cur_col, wrap)); 1419 - } 1420 - 1421 - int 1422 - ahd_unfairness_print(u_int regvalue, u_int *cur_col, u_int wrap) 1423 - { 1424 - return (ahd_print_register(NULL, 0, "UNFAIRNESS", 1425 - 0x6e, regvalue, cur_col, wrap)); 1426 - } 1427 - 1428 - int 1429 - ahd_pll400cnt0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1430 - { 1431 - return (ahd_print_register(NULL, 0, "PLL400CNT0", 1432 - 0x6e, regvalue, cur_col, wrap)); 1433 - } 1434 - 1435 1693 int 1436 1694 ahd_haddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1437 1695 { 1438 1696 return (ahd_print_register(NULL, 0, "HADDR", 1439 1697 0x70, regvalue, cur_col, wrap)); 1440 - } 1441 - 1442 - static ahd_reg_parse_entry_t PLLDELAY_parse_table[] = { 1443 - { "SPLIT_DROP_REQ", 0x80, 0x80 } 1444 - }; 1445 - 1446 - int 1447 - ahd_plldelay_print(u_int regvalue, u_int *cur_col, u_int wrap) 1448 - { 1449 - return (ahd_print_register(PLLDELAY_parse_table, 1, "PLLDELAY", 1450 - 0x70, regvalue, cur_col, wrap)); 1451 - } 1452 - 1453 - int 1454 - ahd_hodmaadr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1455 - { 1456 - return (ahd_print_register(NULL, 0, "HODMAADR", 1457 - 0x70, regvalue, cur_col, wrap)); 1458 - } 1459 - 1460 - int 1461 - ahd_hodmacnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1462 - { 1463 - return (ahd_print_register(NULL, 0, "HODMACNT", 1464 - 0x78, regvalue, cur_col, wrap)); 1465 1698 } 1466 1699 1467 1700 int ··· 1396 1781 } 1397 1782 1398 1783 int 1399 - ahd_hodmaen_print(u_int regvalue, u_int *cur_col, u_int wrap) 1784 + ahd_sghaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1400 1785 { 1401 - return (ahd_print_register(NULL, 0, "HODMAEN", 1402 - 0x7a, regvalue, cur_col, wrap)); 1786 + return (ahd_print_register(NULL, 0, "SGHADDR", 1787 + 0x7c, regvalue, cur_col, wrap)); 1403 1788 } 1404 1789 1405 1790 int ··· 1410 1795 } 1411 1796 1412 1797 int 1413 - ahd_sghaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1798 + ahd_sghcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1414 1799 { 1415 - return (ahd_print_register(NULL, 0, "SGHADDR", 1416 - 0x7c, regvalue, cur_col, wrap)); 1800 + return (ahd_print_register(NULL, 0, "SGHCNT", 1801 + 0x84, regvalue, cur_col, wrap)); 1417 1802 } 1418 1803 1419 1804 int ··· 1423 1808 0x84, regvalue, cur_col, wrap)); 1424 1809 } 1425 1810 1426 - int 1427 - ahd_sghcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1428 - { 1429 - return (ahd_print_register(NULL, 0, "SGHCNT", 1430 - 0x84, regvalue, cur_col, wrap)); 1431 - } 1432 - 1433 - static ahd_reg_parse_entry_t DFF_THRSH_parse_table[] = { 1811 + static const ahd_reg_parse_entry_t DFF_THRSH_parse_table[] = { 1434 1812 { "WR_DFTHRSH_MIN", 0x00, 0x70 }, 1435 1813 { "RD_DFTHRSH_MIN", 0x00, 0x07 }, 1436 1814 { "RD_DFTHRSH_25", 0x01, 0x07 }, ··· 1451 1843 0x88, regvalue, cur_col, wrap)); 1452 1844 } 1453 1845 1454 - int 1455 - ahd_romaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1456 - { 1457 - return (ahd_print_register(NULL, 0, "ROMADDR", 1458 - 0x8a, regvalue, cur_col, wrap)); 1459 - } 1460 - 1461 - static ahd_reg_parse_entry_t ROMCNTRL_parse_table[] = { 1462 - { "RDY", 0x01, 0x01 }, 1463 - { "REPEAT", 0x02, 0x02 }, 1464 - { "ROMSPD", 0x18, 0x18 }, 1465 - { "ROMOP", 0xe0, 0xe0 } 1466 - }; 1467 - 1468 - int 1469 - ahd_romcntrl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1470 - { 1471 - return (ahd_print_register(ROMCNTRL_parse_table, 4, "ROMCNTRL", 1472 - 0x8d, regvalue, cur_col, wrap)); 1473 - } 1474 - 1475 - int 1476 - ahd_romdata_print(u_int regvalue, u_int *cur_col, u_int wrap) 1477 - { 1478 - return (ahd_print_register(NULL, 0, "ROMDATA", 1479 - 0x8e, regvalue, cur_col, wrap)); 1480 - } 1481 - 1482 - static ahd_reg_parse_entry_t CMCRXMSG0_parse_table[] = { 1483 - { "CFNUM", 0x07, 0x07 }, 1484 - { "CDNUM", 0xf8, 0xf8 } 1485 - }; 1486 - 1487 - int 1488 - ahd_cmcrxmsg0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1489 - { 1490 - return (ahd_print_register(CMCRXMSG0_parse_table, 2, "CMCRXMSG0", 1491 - 0x90, regvalue, cur_col, wrap)); 1492 - } 1493 - 1494 - static ahd_reg_parse_entry_t ROENABLE_parse_table[] = { 1495 - { "DCH0ROEN", 0x01, 0x01 }, 1496 - { "DCH1ROEN", 0x02, 0x02 }, 1497 - { "SGROEN", 0x04, 0x04 }, 1498 - { "CMCROEN", 0x08, 0x08 }, 1499 - { "OVLYROEN", 0x10, 0x10 }, 1500 - { "MSIROEN", 0x20, 0x20 } 1501 - }; 1502 - 1503 - int 1504 - ahd_roenable_print(u_int regvalue, u_int *cur_col, u_int wrap) 1505 - { 1506 - return (ahd_print_register(ROENABLE_parse_table, 6, "ROENABLE", 1507 - 0x90, regvalue, cur_col, wrap)); 1508 - } 1509 - 1510 - static ahd_reg_parse_entry_t OVLYRXMSG0_parse_table[] = { 1511 - { "CFNUM", 0x07, 0x07 }, 1512 - { "CDNUM", 0xf8, 0xf8 } 1513 - }; 1514 - 1515 - int 1516 - ahd_ovlyrxmsg0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1517 - { 1518 - return (ahd_print_register(OVLYRXMSG0_parse_table, 2, "OVLYRXMSG0", 1519 - 0x90, regvalue, cur_col, wrap)); 1520 - } 1521 - 1522 - static ahd_reg_parse_entry_t DCHRXMSG0_parse_table[] = { 1523 - { "CFNUM", 0x07, 0x07 }, 1524 - { "CDNUM", 0xf8, 0xf8 } 1525 - }; 1526 - 1527 - int 1528 - ahd_dchrxmsg0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1529 - { 1530 - return (ahd_print_register(DCHRXMSG0_parse_table, 2, "DCHRXMSG0", 1531 - 0x90, regvalue, cur_col, wrap)); 1532 - } 1533 - 1534 - static ahd_reg_parse_entry_t OVLYRXMSG1_parse_table[] = { 1535 - { "CBNUM", 0xff, 0xff } 1536 - }; 1537 - 1538 - int 1539 - ahd_ovlyrxmsg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1540 - { 1541 - return (ahd_print_register(OVLYRXMSG1_parse_table, 1, "OVLYRXMSG1", 1542 - 0x91, regvalue, cur_col, wrap)); 1543 - } 1544 - 1545 - static ahd_reg_parse_entry_t NSENABLE_parse_table[] = { 1546 - { "DCH0NSEN", 0x01, 0x01 }, 1547 - { "DCH1NSEN", 0x02, 0x02 }, 1548 - { "SGNSEN", 0x04, 0x04 }, 1549 - { "CMCNSEN", 0x08, 0x08 }, 1550 - { "OVLYNSEN", 0x10, 0x10 }, 1551 - { "MSINSEN", 0x20, 0x20 } 1552 - }; 1553 - 1554 - int 1555 - ahd_nsenable_print(u_int regvalue, u_int *cur_col, u_int wrap) 1556 - { 1557 - return (ahd_print_register(NSENABLE_parse_table, 6, "NSENABLE", 1558 - 0x91, regvalue, cur_col, wrap)); 1559 - } 1560 - 1561 - static ahd_reg_parse_entry_t CMCRXMSG1_parse_table[] = { 1562 - { "CBNUM", 0xff, 0xff } 1563 - }; 1564 - 1565 - int 1566 - ahd_cmcrxmsg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1567 - { 1568 - return (ahd_print_register(CMCRXMSG1_parse_table, 1, "CMCRXMSG1", 1569 - 0x91, regvalue, cur_col, wrap)); 1570 - } 1571 - 1572 - static ahd_reg_parse_entry_t DCHRXMSG1_parse_table[] = { 1573 - { "CBNUM", 0xff, 0xff } 1574 - }; 1575 - 1576 - int 1577 - ahd_dchrxmsg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1578 - { 1579 - return (ahd_print_register(DCHRXMSG1_parse_table, 1, "DCHRXMSG1", 1580 - 0x91, regvalue, cur_col, wrap)); 1581 - } 1582 - 1583 - static ahd_reg_parse_entry_t DCHRXMSG2_parse_table[] = { 1584 - { "MINDEX", 0xff, 0xff } 1585 - }; 1586 - 1587 - int 1588 - ahd_dchrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1589 - { 1590 - return (ahd_print_register(DCHRXMSG2_parse_table, 1, "DCHRXMSG2", 1591 - 0x92, regvalue, cur_col, wrap)); 1592 - } 1593 - 1594 - static ahd_reg_parse_entry_t CMCRXMSG2_parse_table[] = { 1595 - { "MINDEX", 0xff, 0xff } 1596 - }; 1597 - 1598 - int 1599 - ahd_cmcrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1600 - { 1601 - return (ahd_print_register(CMCRXMSG2_parse_table, 1, "CMCRXMSG2", 1602 - 0x92, regvalue, cur_col, wrap)); 1603 - } 1604 - 1605 - int 1606 - ahd_ost_print(u_int regvalue, u_int *cur_col, u_int wrap) 1607 - { 1608 - return (ahd_print_register(NULL, 0, "OST", 1609 - 0x92, regvalue, cur_col, wrap)); 1610 - } 1611 - 1612 - static ahd_reg_parse_entry_t OVLYRXMSG2_parse_table[] = { 1613 - { "MINDEX", 0xff, 0xff } 1614 - }; 1615 - 1616 - int 1617 - ahd_ovlyrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1618 - { 1619 - return (ahd_print_register(OVLYRXMSG2_parse_table, 1, "OVLYRXMSG2", 1620 - 0x92, regvalue, cur_col, wrap)); 1621 - } 1622 - 1623 - static ahd_reg_parse_entry_t DCHRXMSG3_parse_table[] = { 1624 - { "MCLASS", 0x0f, 0x0f } 1625 - }; 1626 - 1627 - int 1628 - ahd_dchrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 1629 - { 1630 - return (ahd_print_register(DCHRXMSG3_parse_table, 1, "DCHRXMSG3", 1631 - 0x93, regvalue, cur_col, wrap)); 1632 - } 1633 - 1634 - static ahd_reg_parse_entry_t OVLYRXMSG3_parse_table[] = { 1635 - { "MCLASS", 0x0f, 0x0f } 1636 - }; 1637 - 1638 - int 1639 - ahd_ovlyrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 1640 - { 1641 - return (ahd_print_register(OVLYRXMSG3_parse_table, 1, "OVLYRXMSG3", 1642 - 0x93, regvalue, cur_col, wrap)); 1643 - } 1644 - 1645 - static ahd_reg_parse_entry_t CMCRXMSG3_parse_table[] = { 1646 - { "MCLASS", 0x0f, 0x0f } 1647 - }; 1648 - 1649 - int 1650 - ahd_cmcrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 1651 - { 1652 - return (ahd_print_register(CMCRXMSG3_parse_table, 1, "CMCRXMSG3", 1653 - 0x93, regvalue, cur_col, wrap)); 1654 - } 1655 - 1656 - static ahd_reg_parse_entry_t PCIXCTL_parse_table[] = { 1846 + static const ahd_reg_parse_entry_t PCIXCTL_parse_table[] = { 1657 1847 { "CMPABCDIS", 0x01, 0x01 }, 1658 1848 { "TSCSERREN", 0x02, 0x02 }, 1659 1849 { "SRSPDPEEN", 0x04, 0x04 }, ··· 1468 2062 0x93, regvalue, cur_col, wrap)); 1469 2063 } 1470 2064 1471 - int 1472 - ahd_ovlyseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1473 - { 1474 - return (ahd_print_register(NULL, 0, "OVLYSEQBCNT", 1475 - 0x94, regvalue, cur_col, wrap)); 1476 - } 1477 - 1478 - int 1479 - ahd_dchseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1480 - { 1481 - return (ahd_print_register(NULL, 0, "DCHSEQBCNT", 1482 - 0x94, regvalue, cur_col, wrap)); 1483 - } 1484 - 1485 - int 1486 - ahd_cmcseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1487 - { 1488 - return (ahd_print_register(NULL, 0, "CMCSEQBCNT", 1489 - 0x94, regvalue, cur_col, wrap)); 1490 - } 1491 - 1492 - static ahd_reg_parse_entry_t CMCSPLTSTAT0_parse_table[] = { 1493 - { "RXSPLTRSP", 0x01, 0x01 }, 1494 - { "RXSCEMSG", 0x02, 0x02 }, 1495 - { "RXOVRUN", 0x04, 0x04 }, 1496 - { "CNTNOTCMPLT", 0x08, 0x08 }, 1497 - { "SCDATBUCKET", 0x10, 0x10 }, 1498 - { "SCADERR", 0x20, 0x20 }, 1499 - { "SCBCERR", 0x40, 0x40 }, 1500 - { "STAETERM", 0x80, 0x80 } 1501 - }; 1502 - 1503 - int 1504 - ahd_cmcspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1505 - { 1506 - return (ahd_print_register(CMCSPLTSTAT0_parse_table, 8, "CMCSPLTSTAT0", 1507 - 0x96, regvalue, cur_col, wrap)); 1508 - } 1509 - 1510 - static ahd_reg_parse_entry_t DCHSPLTSTAT0_parse_table[] = { 2065 + static const ahd_reg_parse_entry_t DCHSPLTSTAT0_parse_table[] = { 1511 2066 { "RXSPLTRSP", 0x01, 0x01 }, 1512 2067 { "RXSCEMSG", 0x02, 0x02 }, 1513 2068 { "RXOVRUN", 0x04, 0x04 }, ··· 1486 2119 0x96, regvalue, cur_col, wrap)); 1487 2120 } 1488 2121 1489 - static ahd_reg_parse_entry_t OVLYSPLTSTAT0_parse_table[] = { 1490 - { "RXSPLTRSP", 0x01, 0x01 }, 1491 - { "RXSCEMSG", 0x02, 0x02 }, 1492 - { "RXOVRUN", 0x04, 0x04 }, 1493 - { "CNTNOTCMPLT", 0x08, 0x08 }, 1494 - { "SCDATBUCKET", 0x10, 0x10 }, 1495 - { "SCADERR", 0x20, 0x20 }, 1496 - { "SCBCERR", 0x40, 0x40 }, 1497 - { "STAETERM", 0x80, 0x80 } 1498 - }; 1499 - 1500 - int 1501 - ahd_ovlyspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1502 - { 1503 - return (ahd_print_register(OVLYSPLTSTAT0_parse_table, 8, "OVLYSPLTSTAT0", 1504 - 0x96, regvalue, cur_col, wrap)); 1505 - } 1506 - 1507 - static ahd_reg_parse_entry_t CMCSPLTSTAT1_parse_table[] = { 1508 - { "RXDATABUCKET", 0x01, 0x01 } 1509 - }; 1510 - 1511 - int 1512 - ahd_cmcspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1513 - { 1514 - return (ahd_print_register(CMCSPLTSTAT1_parse_table, 1, "CMCSPLTSTAT1", 1515 - 0x97, regvalue, cur_col, wrap)); 1516 - } 1517 - 1518 - static ahd_reg_parse_entry_t OVLYSPLTSTAT1_parse_table[] = { 1519 - { "RXDATABUCKET", 0x01, 0x01 } 1520 - }; 1521 - 1522 - int 1523 - ahd_ovlyspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1524 - { 1525 - return (ahd_print_register(OVLYSPLTSTAT1_parse_table, 1, "OVLYSPLTSTAT1", 1526 - 0x97, regvalue, cur_col, wrap)); 1527 - } 1528 - 1529 - static ahd_reg_parse_entry_t DCHSPLTSTAT1_parse_table[] = { 2122 + static const ahd_reg_parse_entry_t DCHSPLTSTAT1_parse_table[] = { 1530 2123 { "RXDATABUCKET", 0x01, 0x01 } 1531 2124 }; 1532 2125 ··· 1497 2170 0x97, regvalue, cur_col, wrap)); 1498 2171 } 1499 2172 1500 - static ahd_reg_parse_entry_t SGRXMSG0_parse_table[] = { 1501 - { "CFNUM", 0x07, 0x07 }, 1502 - { "CDNUM", 0xf8, 0xf8 } 1503 - }; 1504 - 1505 - int 1506 - ahd_sgrxmsg0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1507 - { 1508 - return (ahd_print_register(SGRXMSG0_parse_table, 2, "SGRXMSG0", 1509 - 0x98, regvalue, cur_col, wrap)); 1510 - } 1511 - 1512 - static ahd_reg_parse_entry_t SLVSPLTOUTADR0_parse_table[] = { 1513 - { "LOWER_ADDR", 0x7f, 0x7f } 1514 - }; 1515 - 1516 - int 1517 - ahd_slvspltoutadr0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1518 - { 1519 - return (ahd_print_register(SLVSPLTOUTADR0_parse_table, 1, "SLVSPLTOUTADR0", 1520 - 0x98, regvalue, cur_col, wrap)); 1521 - } 1522 - 1523 - static ahd_reg_parse_entry_t SGRXMSG1_parse_table[] = { 1524 - { "CBNUM", 0xff, 0xff } 1525 - }; 1526 - 1527 - int 1528 - ahd_sgrxmsg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1529 - { 1530 - return (ahd_print_register(SGRXMSG1_parse_table, 1, "SGRXMSG1", 1531 - 0x99, regvalue, cur_col, wrap)); 1532 - } 1533 - 1534 - static ahd_reg_parse_entry_t SLVSPLTOUTADR1_parse_table[] = { 1535 - { "REQ_FNUM", 0x07, 0x07 }, 1536 - { "REQ_DNUM", 0xf8, 0xf8 } 1537 - }; 1538 - 1539 - int 1540 - ahd_slvspltoutadr1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1541 - { 1542 - return (ahd_print_register(SLVSPLTOUTADR1_parse_table, 2, "SLVSPLTOUTADR1", 1543 - 0x99, regvalue, cur_col, wrap)); 1544 - } 1545 - 1546 - static ahd_reg_parse_entry_t SGRXMSG2_parse_table[] = { 1547 - { "MINDEX", 0xff, 0xff } 1548 - }; 1549 - 1550 - int 1551 - ahd_sgrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1552 - { 1553 - return (ahd_print_register(SGRXMSG2_parse_table, 1, "SGRXMSG2", 1554 - 0x9a, regvalue, cur_col, wrap)); 1555 - } 1556 - 1557 - static ahd_reg_parse_entry_t SLVSPLTOUTADR2_parse_table[] = { 1558 - { "REQ_BNUM", 0xff, 0xff } 1559 - }; 1560 - 1561 - int 1562 - ahd_slvspltoutadr2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1563 - { 1564 - return (ahd_print_register(SLVSPLTOUTADR2_parse_table, 1, "SLVSPLTOUTADR2", 1565 - 0x9a, regvalue, cur_col, wrap)); 1566 - } 1567 - 1568 - static ahd_reg_parse_entry_t SGRXMSG3_parse_table[] = { 1569 - { "MCLASS", 0x0f, 0x0f } 1570 - }; 1571 - 1572 - int 1573 - ahd_sgrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 1574 - { 1575 - return (ahd_print_register(SGRXMSG3_parse_table, 1, "SGRXMSG3", 1576 - 0x9b, regvalue, cur_col, wrap)); 1577 - } 1578 - 1579 - static ahd_reg_parse_entry_t SLVSPLTOUTADR3_parse_table[] = { 1580 - { "RLXORD", 0x10, 0x10 }, 1581 - { "TAG_NUM", 0x1f, 0x1f } 1582 - }; 1583 - 1584 - int 1585 - ahd_slvspltoutadr3_print(u_int regvalue, u_int *cur_col, u_int wrap) 1586 - { 1587 - return (ahd_print_register(SLVSPLTOUTADR3_parse_table, 2, "SLVSPLTOUTADR3", 1588 - 0x9b, regvalue, cur_col, wrap)); 1589 - } 1590 - 1591 - int 1592 - ahd_sgseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1593 - { 1594 - return (ahd_print_register(NULL, 0, "SGSEQBCNT", 1595 - 0x9c, regvalue, cur_col, wrap)); 1596 - } 1597 - 1598 - static ahd_reg_parse_entry_t SLVSPLTOUTATTR0_parse_table[] = { 1599 - { "LOWER_BCNT", 0xff, 0xff } 1600 - }; 1601 - 1602 - int 1603 - ahd_slvspltoutattr0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1604 - { 1605 - return (ahd_print_register(SLVSPLTOUTATTR0_parse_table, 1, "SLVSPLTOUTATTR0", 1606 - 0x9c, regvalue, cur_col, wrap)); 1607 - } 1608 - 1609 - static ahd_reg_parse_entry_t SLVSPLTOUTATTR1_parse_table[] = { 1610 - { "CMPLT_FNUM", 0x07, 0x07 }, 1611 - { "CMPLT_DNUM", 0xf8, 0xf8 } 1612 - }; 1613 - 1614 - int 1615 - ahd_slvspltoutattr1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1616 - { 1617 - return (ahd_print_register(SLVSPLTOUTATTR1_parse_table, 2, "SLVSPLTOUTATTR1", 1618 - 0x9d, regvalue, cur_col, wrap)); 1619 - } 1620 - 1621 - static ahd_reg_parse_entry_t SLVSPLTOUTATTR2_parse_table[] = { 1622 - { "CMPLT_BNUM", 0xff, 0xff } 1623 - }; 1624 - 1625 - int 1626 - ahd_slvspltoutattr2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1627 - { 1628 - return (ahd_print_register(SLVSPLTOUTATTR2_parse_table, 1, "SLVSPLTOUTATTR2", 1629 - 0x9e, regvalue, cur_col, wrap)); 1630 - } 1631 - 1632 - static ahd_reg_parse_entry_t SGSPLTSTAT0_parse_table[] = { 2173 + static const ahd_reg_parse_entry_t SGSPLTSTAT0_parse_table[] = { 1633 2174 { "RXSPLTRSP", 0x01, 0x01 }, 1634 2175 { "RXSCEMSG", 0x02, 0x02 }, 1635 2176 { "RXOVRUN", 0x04, 0x04 }, ··· 1515 2320 0x9e, regvalue, cur_col, wrap)); 1516 2321 } 1517 2322 1518 - static ahd_reg_parse_entry_t SGSPLTSTAT1_parse_table[] = { 2323 + static const ahd_reg_parse_entry_t SGSPLTSTAT1_parse_table[] = { 1519 2324 { "RXDATABUCKET", 0x01, 0x01 } 1520 2325 }; 1521 2326 ··· 1526 2331 0x9f, regvalue, cur_col, wrap)); 1527 2332 } 1528 2333 1529 - static ahd_reg_parse_entry_t SFUNCT_parse_table[] = { 1530 - { "TEST_NUM", 0x0f, 0x0f }, 1531 - { "TEST_GROUP", 0xf0, 0xf0 } 1532 - }; 1533 - 1534 - int 1535 - ahd_sfunct_print(u_int regvalue, u_int *cur_col, u_int wrap) 1536 - { 1537 - return (ahd_print_register(SFUNCT_parse_table, 2, "SFUNCT", 1538 - 0x9f, regvalue, cur_col, wrap)); 1539 - } 1540 - 1541 - static ahd_reg_parse_entry_t DF0PCISTAT_parse_table[] = { 2334 + static const ahd_reg_parse_entry_t DF0PCISTAT_parse_table[] = { 1542 2335 { "DPR", 0x01, 0x01 }, 1543 2336 { "TWATERR", 0x02, 0x02 }, 1544 2337 { "RDPERR", 0x04, 0x04 }, ··· 1551 2368 0xa0, regvalue, cur_col, wrap)); 1552 2369 } 1553 2370 1554 - static ahd_reg_parse_entry_t DF1PCISTAT_parse_table[] = { 1555 - { "DPR", 0x01, 0x01 }, 1556 - { "TWATERR", 0x02, 0x02 }, 1557 - { "RDPERR", 0x04, 0x04 }, 1558 - { "SCAAPERR", 0x08, 0x08 }, 1559 - { "RTA", 0x10, 0x10 }, 1560 - { "RMA", 0x20, 0x20 }, 1561 - { "SSE", 0x40, 0x40 }, 1562 - { "DPE", 0x80, 0x80 } 1563 - }; 1564 - 1565 - int 1566 - ahd_df1pcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1567 - { 1568 - return (ahd_print_register(DF1PCISTAT_parse_table, 8, "DF1PCISTAT", 1569 - 0xa1, regvalue, cur_col, wrap)); 1570 - } 1571 - 1572 - static ahd_reg_parse_entry_t SGPCISTAT_parse_table[] = { 1573 - { "DPR", 0x01, 0x01 }, 1574 - { "RDPERR", 0x04, 0x04 }, 1575 - { "SCAAPERR", 0x08, 0x08 }, 1576 - { "RTA", 0x10, 0x10 }, 1577 - { "RMA", 0x20, 0x20 }, 1578 - { "SSE", 0x40, 0x40 }, 1579 - { "DPE", 0x80, 0x80 } 1580 - }; 1581 - 1582 - int 1583 - ahd_sgpcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1584 - { 1585 - return (ahd_print_register(SGPCISTAT_parse_table, 7, "SGPCISTAT", 1586 - 0xa2, regvalue, cur_col, wrap)); 1587 - } 1588 - 1589 - int 1590 - ahd_reg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1591 - { 1592 - return (ahd_print_register(NULL, 0, "REG1", 1593 - 0xa2, regvalue, cur_col, wrap)); 1594 - } 1595 - 1596 - static ahd_reg_parse_entry_t CMCPCISTAT_parse_table[] = { 1597 - { "DPR", 0x01, 0x01 }, 1598 - { "TWATERR", 0x02, 0x02 }, 1599 - { "RDPERR", 0x04, 0x04 }, 1600 - { "SCAAPERR", 0x08, 0x08 }, 1601 - { "RTA", 0x10, 0x10 }, 1602 - { "RMA", 0x20, 0x20 }, 1603 - { "SSE", 0x40, 0x40 }, 1604 - { "DPE", 0x80, 0x80 } 1605 - }; 1606 - 1607 - int 1608 - ahd_cmcpcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1609 - { 1610 - return (ahd_print_register(CMCPCISTAT_parse_table, 8, "CMCPCISTAT", 1611 - 0xa3, regvalue, cur_col, wrap)); 1612 - } 1613 - 1614 - static ahd_reg_parse_entry_t OVLYPCISTAT_parse_table[] = { 1615 - { "DPR", 0x01, 0x01 }, 1616 - { "RDPERR", 0x04, 0x04 }, 1617 - { "SCAAPERR", 0x08, 0x08 }, 1618 - { "RTA", 0x10, 0x10 }, 1619 - { "RMA", 0x20, 0x20 }, 1620 - { "SSE", 0x40, 0x40 }, 1621 - { "DPE", 0x80, 0x80 } 1622 - }; 1623 - 1624 - int 1625 - ahd_ovlypcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1626 - { 1627 - return (ahd_print_register(OVLYPCISTAT_parse_table, 7, "OVLYPCISTAT", 1628 - 0xa4, regvalue, cur_col, wrap)); 1629 - } 1630 - 1631 2371 int 1632 2372 ahd_reg_isr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1633 2373 { ··· 1558 2452 0xa4, regvalue, cur_col, wrap)); 1559 2453 } 1560 2454 1561 - static ahd_reg_parse_entry_t SG_STATE_parse_table[] = { 2455 + static const ahd_reg_parse_entry_t SG_STATE_parse_table[] = { 1562 2456 { "SEGS_AVAIL", 0x01, 0x01 }, 1563 2457 { "LOADING_NEEDED", 0x02, 0x02 }, 1564 2458 { "FETCH_INPROG", 0x04, 0x04 } ··· 1571 2465 0xa6, regvalue, cur_col, wrap)); 1572 2466 } 1573 2467 1574 - static ahd_reg_parse_entry_t MSIPCISTAT_parse_table[] = { 1575 - { "DPR", 0x01, 0x01 }, 1576 - { "TWATERR", 0x02, 0x02 }, 1577 - { "CLRPENDMSI", 0x08, 0x08 }, 1578 - { "RTA", 0x10, 0x10 }, 1579 - { "RMA", 0x20, 0x20 }, 1580 - { "SSE", 0x40, 0x40 } 1581 - }; 1582 - 1583 - int 1584 - ahd_msipcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1585 - { 1586 - return (ahd_print_register(MSIPCISTAT_parse_table, 6, "MSIPCISTAT", 1587 - 0xa6, regvalue, cur_col, wrap)); 1588 - } 1589 - 1590 - static ahd_reg_parse_entry_t TARGPCISTAT_parse_table[] = { 2468 + static const ahd_reg_parse_entry_t TARGPCISTAT_parse_table[] = { 1591 2469 { "TWATERR", 0x02, 0x02 }, 1592 2470 { "STA", 0x08, 0x08 }, 1593 2471 { "SSE", 0x40, 0x40 }, ··· 1586 2496 } 1587 2497 1588 2498 int 1589 - ahd_data_count_odd_print(u_int regvalue, u_int *cur_col, u_int wrap) 1590 - { 1591 - return (ahd_print_register(NULL, 0, "DATA_COUNT_ODD", 1592 - 0xa7, regvalue, cur_col, wrap)); 1593 - } 1594 - 1595 - int 1596 2499 ahd_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1597 2500 { 1598 2501 return (ahd_print_register(NULL, 0, "SCBPTR", 1599 2502 0xa8, regvalue, cur_col, wrap)); 1600 2503 } 1601 2504 1602 - int 1603 - ahd_ccscbacnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1604 - { 1605 - return (ahd_print_register(NULL, 0, "CCSCBACNT", 1606 - 0xab, regvalue, cur_col, wrap)); 1607 - } 1608 - 1609 - static ahd_reg_parse_entry_t SCBAUTOPTR_parse_table[] = { 2505 + static const ahd_reg_parse_entry_t SCBAUTOPTR_parse_table[] = { 1610 2506 { "SCBPTR_OFF", 0x07, 0x07 }, 1611 2507 { "SCBPTR_ADDR", 0x38, 0x38 }, 1612 2508 { "AUSCBPTR_EN", 0x80, 0x80 } ··· 1613 2537 } 1614 2538 1615 2539 int 1616 - ahd_ccscbadr_bk_print(u_int regvalue, u_int *cur_col, u_int wrap) 1617 - { 1618 - return (ahd_print_register(NULL, 0, "CCSCBADR_BK", 1619 - 0xac, regvalue, cur_col, wrap)); 1620 - } 1621 - 1622 - int 1623 2540 ahd_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1624 2541 { 1625 2542 return (ahd_print_register(NULL, 0, "CCSCBADDR", 1626 2543 0xac, regvalue, cur_col, wrap)); 1627 2544 } 1628 2545 1629 - static ahd_reg_parse_entry_t CMC_RAMBIST_parse_table[] = { 1630 - { "CMC_BUFFER_BIST_EN", 0x01, 0x01 }, 1631 - { "CMC_BUFFER_BIST_FAIL",0x02, 0x02 }, 1632 - { "SG_BIST_EN", 0x10, 0x10 }, 1633 - { "SG_BIST_FAIL", 0x20, 0x20 }, 1634 - { "SCBRAMBIST_FAIL", 0x40, 0x40 }, 1635 - { "SG_ELEMENT_SIZE", 0x80, 0x80 } 1636 - }; 1637 - 1638 - int 1639 - ahd_cmc_rambist_print(u_int regvalue, u_int *cur_col, u_int wrap) 1640 - { 1641 - return (ahd_print_register(CMC_RAMBIST_parse_table, 6, "CMC_RAMBIST", 1642 - 0xad, regvalue, cur_col, wrap)); 1643 - } 1644 - 1645 - static ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { 2546 + static const ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { 1646 2547 { "CCSCBRESET", 0x01, 0x01 }, 1647 2548 { "CCSCBDIR", 0x04, 0x04 }, 1648 2549 { "CCSCBEN", 0x08, 0x08 }, ··· 1635 2582 0xad, regvalue, cur_col, wrap)); 1636 2583 } 1637 2584 1638 - static ahd_reg_parse_entry_t CCSGCTL_parse_table[] = { 2585 + static const ahd_reg_parse_entry_t CCSGCTL_parse_table[] = { 1639 2586 { "CCSGRESET", 0x01, 0x01 }, 1640 2587 { "SG_FETCH_REQ", 0x02, 0x02 }, 1641 2588 { "CCSGENACK", 0x08, 0x08 }, ··· 1659 2606 } 1660 2607 1661 2608 int 1662 - ahd_flexadr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1663 - { 1664 - return (ahd_print_register(NULL, 0, "FLEXADR", 1665 - 0xb0, regvalue, cur_col, wrap)); 1666 - } 1667 - 1668 - int 1669 2609 ahd_ccscbram_print(u_int regvalue, u_int *cur_col, u_int wrap) 1670 2610 { 1671 2611 return (ahd_print_register(NULL, 0, "CCSCBRAM", 1672 2612 0xb0, regvalue, cur_col, wrap)); 1673 - } 1674 - 1675 - int 1676 - ahd_flexcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1677 - { 1678 - return (ahd_print_register(NULL, 0, "FLEXCNT", 1679 - 0xb3, regvalue, cur_col, wrap)); 1680 - } 1681 - 1682 - static ahd_reg_parse_entry_t FLEXDMASTAT_parse_table[] = { 1683 - { "FLEXDMADONE", 0x01, 0x01 }, 1684 - { "FLEXDMAERR", 0x02, 0x02 } 1685 - }; 1686 - 1687 - int 1688 - ahd_flexdmastat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1689 - { 1690 - return (ahd_print_register(FLEXDMASTAT_parse_table, 2, "FLEXDMASTAT", 1691 - 0xb5, regvalue, cur_col, wrap)); 1692 - } 1693 - 1694 - int 1695 - ahd_flexdata_print(u_int regvalue, u_int *cur_col, u_int wrap) 1696 - { 1697 - return (ahd_print_register(NULL, 0, "FLEXDATA", 1698 - 0xb6, regvalue, cur_col, wrap)); 1699 2613 } 1700 2614 1701 2615 int ··· 1672 2652 0xb8, regvalue, cur_col, wrap)); 1673 2653 } 1674 2654 1675 - static ahd_reg_parse_entry_t BRDCTL_parse_table[] = { 2655 + static const ahd_reg_parse_entry_t BRDCTL_parse_table[] = { 1676 2656 { "BRDSTB", 0x01, 0x01 }, 1677 2657 { "BRDRW", 0x02, 0x02 }, 1678 2658 { "BRDEN", 0x04, 0x04 }, ··· 1702 2682 0xbc, regvalue, cur_col, wrap)); 1703 2683 } 1704 2684 1705 - static ahd_reg_parse_entry_t SEECTL_parse_table[] = { 2685 + static const ahd_reg_parse_entry_t SEECTL_parse_table[] = { 1706 2686 { "SEEOP_ERAL", 0x40, 0x70 }, 1707 2687 { "SEEOP_WRITE", 0x50, 0x70 }, 1708 2688 { "SEEOP_READ", 0x60, 0x70 }, ··· 1722 2702 0xbe, regvalue, cur_col, wrap)); 1723 2703 } 1724 2704 1725 - static ahd_reg_parse_entry_t SEESTAT_parse_table[] = { 2705 + static const ahd_reg_parse_entry_t SEESTAT_parse_table[] = { 1726 2706 { "SEESTART", 0x01, 0x01 }, 1727 2707 { "SEEBUSY", 0x02, 0x02 }, 1728 2708 { "SEEARBACK", 0x04, 0x04 }, ··· 1738 2718 0xbe, regvalue, cur_col, wrap)); 1739 2719 } 1740 2720 1741 - int 1742 - ahd_scbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1743 - { 1744 - return (ahd_print_register(NULL, 0, "SCBCNT", 1745 - 0xbf, regvalue, cur_col, wrap)); 1746 - } 1747 - 1748 - int 1749 - ahd_dfwaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1750 - { 1751 - return (ahd_print_register(NULL, 0, "DFWADDR", 1752 - 0xc0, regvalue, cur_col, wrap)); 1753 - } 1754 - 1755 - static ahd_reg_parse_entry_t DSPFLTRCTL_parse_table[] = { 1756 - { "DSPFCNTSEL", 0x0f, 0x0f }, 1757 - { "EDGESENSE", 0x10, 0x10 }, 1758 - { "FLTRDISABLE", 0x20, 0x20 } 1759 - }; 1760 - 1761 - int 1762 - ahd_dspfltrctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1763 - { 1764 - return (ahd_print_register(DSPFLTRCTL_parse_table, 3, "DSPFLTRCTL", 1765 - 0xc0, regvalue, cur_col, wrap)); 1766 - } 1767 - 1768 - static ahd_reg_parse_entry_t DSPDATACTL_parse_table[] = { 2721 + static const ahd_reg_parse_entry_t DSPDATACTL_parse_table[] = { 1769 2722 { "XMITOFFSTDIS", 0x02, 0x02 }, 1770 2723 { "RCVROFFSTDIS", 0x04, 0x04 }, 1771 2724 { "DESQDIS", 0x10, 0x10 }, ··· 1753 2760 } 1754 2761 1755 2762 int 1756 - ahd_dfraddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1757 - { 1758 - return (ahd_print_register(NULL, 0, "DFRADDR", 1759 - 0xc2, regvalue, cur_col, wrap)); 1760 - } 1761 - 1762 - static ahd_reg_parse_entry_t DSPREQCTL_parse_table[] = { 1763 - { "MANREQDLY", 0x3f, 0x3f }, 1764 - { "MANREQCTL", 0xc0, 0xc0 } 1765 - }; 1766 - 1767 - int 1768 - ahd_dspreqctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1769 - { 1770 - return (ahd_print_register(DSPREQCTL_parse_table, 2, "DSPREQCTL", 1771 - 0xc2, regvalue, cur_col, wrap)); 1772 - } 1773 - 1774 - static ahd_reg_parse_entry_t DSPACKCTL_parse_table[] = { 1775 - { "MANACKDLY", 0x3f, 0x3f }, 1776 - { "MANACKCTL", 0xc0, 0xc0 } 1777 - }; 1778 - 1779 - int 1780 - ahd_dspackctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1781 - { 1782 - return (ahd_print_register(DSPACKCTL_parse_table, 2, "DSPACKCTL", 1783 - 0xc3, regvalue, cur_col, wrap)); 1784 - } 1785 - 1786 - int 1787 2763 ahd_dfdat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1788 2764 { 1789 2765 return (ahd_print_register(NULL, 0, "DFDAT", 1790 2766 0xc4, regvalue, cur_col, wrap)); 1791 2767 } 1792 2768 1793 - static ahd_reg_parse_entry_t DSPSELECT_parse_table[] = { 2769 + static const ahd_reg_parse_entry_t DSPSELECT_parse_table[] = { 1794 2770 { "DSPSEL", 0x1f, 0x1f }, 1795 2771 { "AUTOINCEN", 0x80, 0x80 } 1796 2772 }; ··· 1771 2809 0xc4, regvalue, cur_col, wrap)); 1772 2810 } 1773 2811 1774 - static ahd_reg_parse_entry_t WRTBIASCTL_parse_table[] = { 2812 + static const ahd_reg_parse_entry_t WRTBIASCTL_parse_table[] = { 1775 2813 { "XMITMANVAL", 0x3f, 0x3f }, 1776 2814 { "AUTOXBCDIS", 0x80, 0x80 } 1777 2815 }; ··· 1783 2821 0xc5, regvalue, cur_col, wrap)); 1784 2822 } 1785 2823 1786 - static ahd_reg_parse_entry_t RCVRBIOSCTL_parse_table[] = { 1787 - { "RCVRMANVAL", 0x3f, 0x3f }, 1788 - { "AUTORBCDIS", 0x80, 0x80 } 1789 - }; 1790 - 1791 - int 1792 - ahd_rcvrbiosctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1793 - { 1794 - return (ahd_print_register(RCVRBIOSCTL_parse_table, 2, "RCVRBIOSCTL", 1795 - 0xc6, regvalue, cur_col, wrap)); 1796 - } 1797 - 1798 - int 1799 - ahd_wrtbiascalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 1800 - { 1801 - return (ahd_print_register(NULL, 0, "WRTBIASCALC", 1802 - 0xc7, regvalue, cur_col, wrap)); 1803 - } 1804 - 1805 - int 1806 - ahd_rcvrbiascalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 1807 - { 1808 - return (ahd_print_register(NULL, 0, "RCVRBIASCALC", 1809 - 0xc8, regvalue, cur_col, wrap)); 1810 - } 1811 - 1812 - int 1813 - ahd_dfptrs_print(u_int regvalue, u_int *cur_col, u_int wrap) 1814 - { 1815 - return (ahd_print_register(NULL, 0, "DFPTRS", 1816 - 0xc8, regvalue, cur_col, wrap)); 1817 - } 1818 - 1819 - int 1820 - ahd_skewcalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 1821 - { 1822 - return (ahd_print_register(NULL, 0, "SKEWCALC", 1823 - 0xc9, regvalue, cur_col, wrap)); 1824 - } 1825 - 1826 - int 1827 - ahd_dfbkptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1828 - { 1829 - return (ahd_print_register(NULL, 0, "DFBKPTR", 1830 - 0xc9, regvalue, cur_col, wrap)); 1831 - } 1832 - 1833 - static ahd_reg_parse_entry_t DFDBCTL_parse_table[] = { 1834 - { "DFF_RAMBIST_EN", 0x01, 0x01 }, 1835 - { "DFF_RAMBIST_DONE", 0x02, 0x02 }, 1836 - { "DFF_RAMBIST_FAIL", 0x04, 0x04 }, 1837 - { "DFF_DIR_ERR", 0x08, 0x08 }, 1838 - { "DFF_CIO_RD_RDY", 0x10, 0x10 }, 1839 - { "DFF_CIO_WR_RDY", 0x20, 0x20 } 1840 - }; 1841 - 1842 - int 1843 - ahd_dfdbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 1844 - { 1845 - return (ahd_print_register(DFDBCTL_parse_table, 6, "DFDBCTL", 1846 - 0xcb, regvalue, cur_col, wrap)); 1847 - } 1848 - 1849 - int 1850 - ahd_dfscnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1851 - { 1852 - return (ahd_print_register(NULL, 0, "DFSCNT", 1853 - 0xcc, regvalue, cur_col, wrap)); 1854 - } 1855 - 1856 - int 1857 - ahd_dfbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1858 - { 1859 - return (ahd_print_register(NULL, 0, "DFBCNT", 1860 - 0xce, regvalue, cur_col, wrap)); 1861 - } 1862 - 1863 - int 1864 - ahd_ovlyaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1865 - { 1866 - return (ahd_print_register(NULL, 0, "OVLYADDR", 1867 - 0xd4, regvalue, cur_col, wrap)); 1868 - } 1869 - 1870 - static ahd_reg_parse_entry_t SEQCTL0_parse_table[] = { 2824 + static const ahd_reg_parse_entry_t SEQCTL0_parse_table[] = { 1871 2825 { "LOADRAM", 0x01, 0x01 }, 1872 2826 { "SEQRESET", 0x02, 0x02 }, 1873 2827 { "STEP", 0x04, 0x04 }, ··· 1801 2923 0xd6, regvalue, cur_col, wrap)); 1802 2924 } 1803 2925 1804 - static ahd_reg_parse_entry_t SEQCTL1_parse_table[] = { 1805 - { "RAMBIST_EN", 0x01, 0x01 }, 1806 - { "RAMBIST_FAIL", 0x02, 0x02 }, 1807 - { "RAMBIST_DONE", 0x04, 0x04 }, 1808 - { "OVRLAY_DATA_CHK", 0x08, 0x08 } 1809 - }; 1810 - 1811 - int 1812 - ahd_seqctl1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1813 - { 1814 - return (ahd_print_register(SEQCTL1_parse_table, 4, "SEQCTL1", 1815 - 0xd7, regvalue, cur_col, wrap)); 1816 - } 1817 - 1818 - static ahd_reg_parse_entry_t FLAGS_parse_table[] = { 2926 + static const ahd_reg_parse_entry_t FLAGS_parse_table[] = { 1819 2927 { "CARRY", 0x01, 0x01 }, 1820 2928 { "ZERO", 0x02, 0x02 } 1821 2929 }; ··· 1813 2949 0xd8, regvalue, cur_col, wrap)); 1814 2950 } 1815 2951 1816 - static ahd_reg_parse_entry_t SEQINTCTL_parse_table[] = { 2952 + static const ahd_reg_parse_entry_t SEQINTCTL_parse_table[] = { 1817 2953 { "IRET", 0x01, 0x01 }, 1818 2954 { "INTMASK1", 0x02, 0x02 }, 1819 2955 { "INTMASK2", 0x04, 0x04 }, ··· 1866 3002 } 1867 3003 1868 3004 int 1869 - ahd_brkaddr0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1870 - { 1871 - return (ahd_print_register(NULL, 0, "BRKADDR0", 1872 - 0xe6, regvalue, cur_col, wrap)); 1873 - } 1874 - 1875 - static ahd_reg_parse_entry_t BRKADDR1_parse_table[] = { 1876 - { "BRKDIS", 0x80, 0x80 } 1877 - }; 1878 - 1879 - int 1880 - ahd_brkaddr1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1881 - { 1882 - return (ahd_print_register(BRKADDR1_parse_table, 1, "BRKADDR1", 1883 - 0xe6, regvalue, cur_col, wrap)); 1884 - } 1885 - 1886 - int 1887 3005 ahd_allones_print(u_int regvalue, u_int *cur_col, u_int wrap) 1888 3006 { 1889 3007 return (ahd_print_register(NULL, 0, "ALLONES", ··· 1901 3055 } 1902 3056 1903 3057 int 1904 - ahd_function1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1905 - { 1906 - return (ahd_print_register(NULL, 0, "FUNCTION1", 1907 - 0xf0, regvalue, cur_col, wrap)); 1908 - } 1909 - 1910 - int 1911 3058 ahd_stack_print(u_int regvalue, u_int *cur_col, u_int wrap) 1912 3059 { 1913 3060 return (ahd_print_register(NULL, 0, "STACK", ··· 1919 3080 { 1920 3081 return (ahd_print_register(NULL, 0, "CURADDR", 1921 3082 0xf4, regvalue, cur_col, wrap)); 1922 - } 1923 - 1924 - int 1925 - ahd_lastaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1926 - { 1927 - return (ahd_print_register(NULL, 0, "LASTADDR", 1928 - 0xf6, regvalue, cur_col, wrap)); 1929 3083 } 1930 3084 1931 3085 int ··· 1943 3111 } 1944 3112 1945 3113 int 1946 - ahd_waiting_scb_tails_print(u_int regvalue, u_int *cur_col, u_int wrap) 1947 - { 1948 - return (ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", 1949 - 0x100, regvalue, cur_col, wrap)); 1950 - } 1951 - 1952 - int 1953 - ahd_ahd_pci_config_base_print(u_int regvalue, u_int *cur_col, u_int wrap) 1954 - { 1955 - return (ahd_print_register(NULL, 0, "AHD_PCI_CONFIG_BASE", 1956 - 0x100, regvalue, cur_col, wrap)); 1957 - } 1958 - 1959 - int 1960 3114 ahd_sram_base_print(u_int regvalue, u_int *cur_col, u_int wrap) 1961 3115 { 1962 3116 return (ahd_print_register(NULL, 0, "SRAM_BASE", 3117 + 0x100, regvalue, cur_col, wrap)); 3118 + } 3119 + 3120 + int 3121 + ahd_waiting_scb_tails_print(u_int regvalue, u_int *cur_col, u_int wrap) 3122 + { 3123 + return (ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", 1963 3124 0x100, regvalue, cur_col, wrap)); 1964 3125 } 1965 3126 ··· 2040 3215 0x137, regvalue, cur_col, wrap)); 2041 3216 } 2042 3217 2043 - static ahd_reg_parse_entry_t DMAPARAMS_parse_table[] = { 3218 + static const ahd_reg_parse_entry_t DMAPARAMS_parse_table[] = { 2044 3219 { "FIFORESET", 0x01, 0x01 }, 2045 3220 { "FIFOFLUSH", 0x02, 0x02 }, 2046 3221 { "DIRECTION", 0x04, 0x04 }, ··· 2060 3235 0x138, regvalue, cur_col, wrap)); 2061 3236 } 2062 3237 2063 - static ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { 3238 + static const ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { 2064 3239 { "NO_DISCONNECT", 0x01, 0x01 }, 2065 3240 { "SPHASE_PENDING", 0x02, 0x02 }, 2066 3241 { "DPHASE_PENDING", 0x04, 0x04 }, ··· 2093 3268 0x13b, regvalue, cur_col, wrap)); 2094 3269 } 2095 3270 2096 - static ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { 3271 + static const ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { 2097 3272 { "P_DATAOUT", 0x00, 0xe0 }, 2098 3273 { "P_DATAOUT_DT", 0x20, 0xe0 }, 2099 3274 { "P_DATAIN", 0x40, 0xe0 }, ··· 2151 3326 0x144, regvalue, cur_col, wrap)); 2152 3327 } 2153 3328 2154 - static ahd_reg_parse_entry_t ARG_1_parse_table[] = { 3329 + static const ahd_reg_parse_entry_t ARG_1_parse_table[] = { 2155 3330 { "CONT_MSG_LOOP_TARG", 0x02, 0x02 }, 2156 3331 { "CONT_MSG_LOOP_READ", 0x03, 0x03 }, 2157 3332 { "CONT_MSG_LOOP_WRITE",0x04, 0x04 }, ··· 2183 3358 0x14a, regvalue, cur_col, wrap)); 2184 3359 } 2185 3360 2186 - static ahd_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { 3361 + static const ahd_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { 2187 3362 { "ALTSTIM", 0x01, 0x01 }, 2188 3363 { "ENAUTOATNP", 0x02, 0x02 }, 2189 3364 { "MANUALP", 0x0c, 0x0c }, ··· 2206 3381 0x14c, regvalue, cur_col, wrap)); 2207 3382 } 2208 3383 2209 - static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { 3384 + static const ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { 2210 3385 { "PENDING_MK_MESSAGE", 0x01, 0x01 }, 2211 3386 { "TARGET_MSG_PENDING", 0x02, 0x02 }, 2212 3387 { "SELECTOUT_QFROZEN", 0x04, 0x04 } ··· 2290 3465 } 2291 3466 2292 3467 int 2293 - ahd_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) 2294 - { 2295 - return (ahd_print_register(NULL, 0, "SCB_BASE", 2296 - 0x180, regvalue, cur_col, wrap)); 2297 - } 2298 - 2299 - int 2300 3468 ahd_scb_residual_datacnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2301 3469 { 2302 3470 return (ahd_print_register(NULL, 0, "SCB_RESIDUAL_DATACNT", 2303 3471 0x180, regvalue, cur_col, wrap)); 2304 3472 } 2305 3473 2306 - static ahd_reg_parse_entry_t SCB_RESIDUAL_SGPTR_parse_table[] = { 3474 + int 3475 + ahd_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) 3476 + { 3477 + return (ahd_print_register(NULL, 0, "SCB_BASE", 3478 + 0x180, regvalue, cur_col, wrap)); 3479 + } 3480 + 3481 + static const ahd_reg_parse_entry_t SCB_RESIDUAL_SGPTR_parse_table[] = { 2307 3482 { "SG_LIST_NULL", 0x01, 0x01 }, 2308 3483 { "SG_OVERRUN_RESID", 0x02, 0x02 }, 2309 3484 { "SG_ADDR_MASK", 0xf8, 0xf8 } ··· 2324 3499 } 2325 3500 2326 3501 int 2327 - ahd_scb_target_phases_print(u_int regvalue, u_int *cur_col, u_int wrap) 2328 - { 2329 - return (ahd_print_register(NULL, 0, "SCB_TARGET_PHASES", 2330 - 0x189, regvalue, cur_col, wrap)); 2331 - } 2332 - 2333 - int 2334 - ahd_scb_target_data_dir_print(u_int regvalue, u_int *cur_col, u_int wrap) 2335 - { 2336 - return (ahd_print_register(NULL, 0, "SCB_TARGET_DATA_DIR", 2337 - 0x18a, regvalue, cur_col, wrap)); 2338 - } 2339 - 2340 - int 2341 - ahd_scb_target_itag_print(u_int regvalue, u_int *cur_col, u_int wrap) 2342 - { 2343 - return (ahd_print_register(NULL, 0, "SCB_TARGET_ITAG", 2344 - 0x18b, regvalue, cur_col, wrap)); 2345 - } 2346 - 2347 - int 2348 3502 ahd_scb_sense_busaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2349 3503 { 2350 3504 return (ahd_print_register(NULL, 0, "SCB_SENSE_BUSADDR", ··· 2337 3533 0x190, regvalue, cur_col, wrap)); 2338 3534 } 2339 3535 2340 - static ahd_reg_parse_entry_t SCB_CONTROL_parse_table[] = { 3536 + static const ahd_reg_parse_entry_t SCB_CONTROL_parse_table[] = { 2341 3537 { "SCB_TAG_TYPE", 0x03, 0x03 }, 2342 3538 { "DISCONNECTED", 0x04, 0x04 }, 2343 3539 { "STATUS_RCVD", 0x08, 0x08 }, ··· 2354 3550 0x192, regvalue, cur_col, wrap)); 2355 3551 } 2356 3552 2357 - static ahd_reg_parse_entry_t SCB_SCSIID_parse_table[] = { 3553 + static const ahd_reg_parse_entry_t SCB_SCSIID_parse_table[] = { 2358 3554 { "OID", 0x0f, 0x0f }, 2359 3555 { "TID", 0xf0, 0xf0 } 2360 3556 }; ··· 2366 3562 0x193, regvalue, cur_col, wrap)); 2367 3563 } 2368 3564 2369 - static ahd_reg_parse_entry_t SCB_LUN_parse_table[] = { 3565 + static const ahd_reg_parse_entry_t SCB_LUN_parse_table[] = { 2370 3566 { "LID", 0xff, 0xff } 2371 3567 }; 2372 3568 ··· 2377 3573 0x194, regvalue, cur_col, wrap)); 2378 3574 } 2379 3575 2380 - static ahd_reg_parse_entry_t SCB_TASK_ATTRIBUTE_parse_table[] = { 3576 + static const ahd_reg_parse_entry_t SCB_TASK_ATTRIBUTE_parse_table[] = { 2381 3577 { "SCB_XFERLEN_ODD", 0x01, 0x01 } 2382 3578 }; 2383 3579 ··· 2388 3584 0x195, regvalue, cur_col, wrap)); 2389 3585 } 2390 3586 2391 - static ahd_reg_parse_entry_t SCB_CDB_LEN_parse_table[] = { 3587 + static const ahd_reg_parse_entry_t SCB_CDB_LEN_parse_table[] = { 2392 3588 { "SCB_CDB_LEN_PTR", 0x80, 0x80 } 2393 3589 }; 2394 3590 ··· 2413 3609 0x198, regvalue, cur_col, wrap)); 2414 3610 } 2415 3611 2416 - static ahd_reg_parse_entry_t SCB_DATACNT_parse_table[] = { 3612 + static const ahd_reg_parse_entry_t SCB_DATACNT_parse_table[] = { 2417 3613 { "SG_HIGH_ADDR_BITS", 0x7f, 0x7f }, 2418 3614 { "SG_LAST_SEG", 0x80, 0x80 } 2419 3615 }; ··· 2425 3621 0x1a0, regvalue, cur_col, wrap)); 2426 3622 } 2427 3623 2428 - static ahd_reg_parse_entry_t SCB_SGPTR_parse_table[] = { 3624 + static const ahd_reg_parse_entry_t SCB_SGPTR_parse_table[] = { 2429 3625 { "SG_LIST_NULL", 0x01, 0x01 }, 2430 3626 { "SG_FULL_RESID", 0x02, 0x02 }, 2431 3627 { "SG_STATUS_VALID", 0x04, 0x04 } ··· 2457 3653 { 2458 3654 return (ahd_print_register(NULL, 0, "SCB_NEXT2", 2459 3655 0x1ae, regvalue, cur_col, wrap)); 2460 - } 2461 - 2462 - int 2463 - ahd_scb_spare_print(u_int regvalue, u_int *cur_col, u_int wrap) 2464 - { 2465 - return (ahd_print_register(NULL, 0, "SCB_SPARE", 2466 - 0x1b0, regvalue, cur_col, wrap)); 2467 3656 } 2468 3657 2469 3658 int
+3 -3
drivers/scsi/aic7xxx/aic79xx_seq.h_shipped
··· 5 5 * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $ 6 6 * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $ 7 7 */ 8 - static uint8_t seqprog[] = { 8 + static const uint8_t seqprog[] = { 9 9 0xff, 0x02, 0x06, 0x78, 10 10 0x00, 0xea, 0x6e, 0x59, 11 11 0x01, 0xea, 0x04, 0x30, ··· 1027 1027 return (0); 1028 1028 } 1029 1029 1030 - static struct patch { 1030 + static const struct patch { 1031 1031 ahd_patch_func_t *patch_func; 1032 1032 uint32_t begin :10, 1033 1033 skip_instr :10, ··· 1166 1166 { ahd_patch23_func, 815, 11, 1 } 1167 1167 }; 1168 1168 1169 - static struct cs { 1169 + static const struct cs { 1170 1170 uint16_t begin; 1171 1171 uint16_t end; 1172 1172 } critical_sections[] = {
+8 -47
drivers/scsi/aic7xxx/aic7xxx.h
··· 736 736 #define ST_SXFR 0x010 /* Rate Single Transition Only */ 737 737 #define DT_SXFR 0x040 /* Rate Double Transition Only */ 738 738 uint8_t period; /* Period to send to SCSI target */ 739 - char *rate; 739 + const char *rate; 740 740 }; 741 741 742 742 /* Safe and valid period for async negotiations. */ ··· 1114 1114 struct ahc_pci_identity { 1115 1115 uint64_t full_id; 1116 1116 uint64_t id_mask; 1117 - char *name; 1117 + const char *name; 1118 1118 ahc_device_setup_t *setup; 1119 1119 }; 1120 1120 ··· 1133 1133 1134 1134 /*************************** Function Declarations ****************************/ 1135 1135 /******************************************************************************/ 1136 - u_int ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl); 1137 - void ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl); 1138 - void ahc_busy_tcl(struct ahc_softc *ahc, 1139 - u_int tcl, u_int busyid); 1140 1136 1141 1137 /***************************** PCI Front End *********************************/ 1142 - struct ahc_pci_identity *ahc_find_pci_device(ahc_dev_softc_t); 1138 + const struct ahc_pci_identity *ahc_find_pci_device(ahc_dev_softc_t); 1143 1139 int ahc_pci_config(struct ahc_softc *, 1144 - struct ahc_pci_identity *); 1140 + const struct ahc_pci_identity *); 1145 1141 int ahc_pci_test_register_access(struct ahc_softc *); 1146 1142 #ifdef CONFIG_PM 1147 1143 void ahc_pci_resume(struct ahc_softc *ahc); ··· 1151 1155 1152 1156 /************************** SCB and SCB queue management **********************/ 1153 1157 int ahc_probe_scbs(struct ahc_softc *); 1154 - void ahc_run_untagged_queues(struct ahc_softc *ahc); 1155 - void ahc_run_untagged_queue(struct ahc_softc *ahc, 1156 - struct scb_tailq *queue); 1157 1158 void ahc_qinfifo_requeue_tail(struct ahc_softc *ahc, 1158 1159 struct scb *scb); 1159 1160 int ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, ··· 1171 1178 #endif 1172 1179 void ahc_set_unit(struct ahc_softc *, int); 1173 1180 void ahc_set_name(struct ahc_softc *, char *); 1174 - void ahc_alloc_scbs(struct ahc_softc *ahc); 1175 1181 void ahc_free(struct ahc_softc *ahc); 1176 1182 int ahc_reset(struct ahc_softc *ahc, int reinit); 1177 - void ahc_shutdown(void *arg); 1178 - 1179 - /*************************** Interrupt Services *******************************/ 1180 - void ahc_clear_intstat(struct ahc_softc *ahc); 1181 - void ahc_run_qoutfifo(struct ahc_softc *ahc); 1182 - #ifdef AHC_TARGET_MODE 1183 - void ahc_run_tqinfifo(struct ahc_softc *ahc, int paused); 1184 - #endif 1185 - void ahc_handle_brkadrint(struct ahc_softc *ahc); 1186 - void ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat); 1187 - void ahc_handle_scsiint(struct ahc_softc *ahc, 1188 - u_int intstat); 1189 - void ahc_clear_critical_section(struct ahc_softc *ahc); 1190 1183 1191 1184 /***************************** Error Recovery *********************************/ 1192 1185 typedef enum { ··· 1193 1214 char channel, int lun, u_int tag, 1194 1215 int stop_on_first, int remove, 1195 1216 int save_state); 1196 - void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb); 1197 1217 int ahc_reset_channel(struct ahc_softc *ahc, char channel, 1198 1218 int initiate_reset); 1199 - int ahc_abort_scbs(struct ahc_softc *ahc, int target, 1200 - char channel, int lun, u_int tag, 1201 - role_t role, uint32_t status); 1202 - void ahc_restart(struct ahc_softc *ahc); 1203 - void ahc_calc_residual(struct ahc_softc *ahc, 1204 - struct scb *scb); 1219 + 1205 1220 /*************************** Utility Functions ********************************/ 1206 - struct ahc_phase_table_entry* 1207 - ahc_lookup_phase_entry(int phase); 1208 1221 void ahc_compile_devinfo(struct ahc_devinfo *devinfo, 1209 1222 u_int our_id, u_int target, 1210 1223 u_int lun, char channel, 1211 1224 role_t role); 1212 1225 /************************** Transfer Negotiation ******************************/ 1213 - struct ahc_syncrate* ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, 1226 + const struct ahc_syncrate* ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, 1214 1227 u_int *ppr_options, u_int maxsync); 1215 1228 u_int ahc_find_period(struct ahc_softc *ahc, 1216 1229 u_int scsirate, u_int maxsync); 1217 - void ahc_validate_offset(struct ahc_softc *ahc, 1218 - struct ahc_initiator_tinfo *tinfo, 1219 - struct ahc_syncrate *syncrate, 1220 - u_int *offset, int wide, 1221 - role_t role); 1222 - void ahc_validate_width(struct ahc_softc *ahc, 1223 - struct ahc_initiator_tinfo *tinfo, 1224 - u_int *bus_width, 1225 - role_t role); 1226 1230 /* 1227 1231 * Negotiation types. These are used to qualify if we should renegotiate 1228 1232 * even if our goal and current transport parameters are identical. ··· 1225 1263 u_int width, u_int type, int paused); 1226 1264 void ahc_set_syncrate(struct ahc_softc *ahc, 1227 1265 struct ahc_devinfo *devinfo, 1228 - struct ahc_syncrate *syncrate, 1266 + const struct ahc_syncrate *syncrate, 1229 1267 u_int period, u_int offset, 1230 1268 u_int ppr_options, 1231 1269 u_int type, int paused); ··· 1267 1305 #define AHC_SHOW_MASKED_ERRORS 0x1000 1268 1306 #define AHC_DEBUG_SEQUENCER 0x2000 1269 1307 #endif 1270 - void ahc_print_scb(struct scb *scb); 1271 1308 void ahc_print_devinfo(struct ahc_softc *ahc, 1272 1309 struct ahc_devinfo *dev); 1273 1310 void ahc_dump_card_state(struct ahc_softc *ahc); 1274 - int ahc_print_register(ahc_reg_parse_entry_t *table, 1311 + int ahc_print_register(const ahc_reg_parse_entry_t *table, 1275 1312 u_int num_entries, 1276 1313 const char *name, 1277 1314 u_int address,
+44 -1
drivers/scsi/aic7xxx/aic7xxx.reg
··· 238 238 register OPTIONMODE { 239 239 address 0x008 240 240 access_mode RW 241 + count 2 241 242 field AUTORATEEN 0x80 242 243 field AUTOACKEN 0x40 243 244 field ATNMGMNTEN 0x20 ··· 255 254 address 0x00a 256 255 size 2 257 256 access_mode RW 257 + count 2 258 258 } 259 259 260 260 /* ··· 346 344 register SSTAT3 { 347 345 address 0x00e 348 346 access_mode RO 347 + count 2 349 348 mask SCSICNT 0xf0 350 349 mask OFFCNT 0x0f 351 350 mask U2OFFCNT 0x7f ··· 370 367 register SIMODE0 { 371 368 address 0x010 372 369 access_mode RW 370 + count 2 373 371 field ENSELDO 0x40 374 372 field ENSELDI 0x20 375 373 field ENSELINGO 0x10 ··· 433 429 register SELTIMER { 434 430 address 0x018 435 431 access_mode RW 432 + count 1 436 433 field STAGE6 0x20 437 434 field STAGE5 0x10 438 435 field STAGE4 0x08 ··· 472 467 address 0x01b 473 468 size 2 474 469 access_mode RW 470 + count 14 475 471 } 476 472 477 473 /* ··· 486 480 register SPIOCAP { 487 481 address 0x01b 488 482 access_mode RW 483 + count 10 489 484 field SOFT1 0x80 490 485 field SOFT0 0x40 491 486 field SOFTCMDEN 0x20 ··· 499 492 500 493 register BRDCTL { 501 494 address 0x01d 495 + count 11 502 496 field BRDDAT7 0x80 503 497 field BRDDAT6 0x40 504 498 field BRDDAT5 0x20 ··· 542 534 */ 543 535 register SEECTL { 544 536 address 0x01e 537 + count 11 545 538 field EXTARBACK 0x80 546 539 field EXTARBREQ 0x40 547 540 field SEEMS 0x20 ··· 579 570 register SEQCTL { 580 571 address 0x060 581 572 access_mode RW 573 + count 15 582 574 field PERRORDIS 0x80 583 575 field PAUSEDIS 0x40 584 576 field FAILDIS 0x20 ··· 600 590 register SEQRAM { 601 591 address 0x061 602 592 access_mode RW 593 + count 2 603 594 } 604 595 605 596 /* ··· 615 604 register SEQADDR1 { 616 605 address 0x063 617 606 access_mode RW 607 + count 8 618 608 mask SEQADDR1_MASK 0x01 619 609 } 620 610 ··· 661 649 register FLAGS { 662 650 address 0x06b 663 651 access_mode RO 652 + count 18 664 653 field ZERO 0x02 665 654 field CARRY 0x01 666 655 } ··· 684 671 register STACK { 685 672 address 0x06f 686 673 access_mode RO 674 + count 5 687 675 } 688 676 689 677 const STACK_SIZE 4 ··· 706 692 register DSCOMMAND0 { 707 693 address 0x084 708 694 access_mode RW 695 + count 7 709 696 field CACHETHEN 0x80 /* Cache Threshold enable */ 710 697 field DPARCKEN 0x40 /* Data Parity Check Enable */ 711 698 field MPARCKEN 0x20 /* Memory Parity Check Enable */ ··· 732 717 register BUSTIME { 733 718 address 0x085 734 719 access_mode RW 720 + count 2 735 721 mask BOFF 0xf0 736 722 mask BON 0x0f 737 723 } ··· 743 727 register BUSSPD { 744 728 address 0x086 745 729 access_mode RW 730 + count 2 746 731 mask DFTHRSH 0xc0 747 732 mask STBOFF 0x38 748 733 mask STBON 0x07 ··· 754 737 /* aic7850/55/60/70/80/95 only */ 755 738 register DSPCISTATUS { 756 739 address 0x086 740 + count 4 757 741 mask DFTHRSH_100 0xc0 758 742 } 759 743 ··· 776 758 register HCNTRL { 777 759 address 0x087 778 760 access_mode RW 761 + count 14 779 762 field POWRDN 0x40 780 763 field SWINT 0x10 781 764 field IRQMS 0x08 ··· 888 869 register ERROR { 889 870 address 0x092 890 871 access_mode RO 872 + count 26 891 873 field CIOPARERR 0x80 /* Ultra2 only */ 892 874 field PCIERRSTAT 0x40 /* PCI only */ 893 875 field MPARERR 0x20 /* PCI only */ ··· 905 885 register CLRINT { 906 886 address 0x092 907 887 access_mode WO 888 + count 24 908 889 field CLRPARERR 0x10 /* PCI only */ 909 890 field CLRBRKADRINT 0x08 910 891 field CLRSCSIINT 0x04 ··· 964 943 register SCBCNT { 965 944 address 0x09a 966 945 access_mode RW 946 + count 1 967 947 field SCBAUTO 0x80 968 948 mask SCBCNT_MASK 0x1f 969 949 } ··· 976 954 register QINFIFO { 977 955 address 0x09b 978 956 access_mode RW 957 + count 12 979 958 } 980 959 981 960 /* ··· 995 972 register QOUTFIFO { 996 973 address 0x09d 997 974 access_mode WO 975 + count 7 998 976 } 999 977 1000 978 register CRCCONTROL1 { 1001 979 address 0x09d 1002 980 access_mode RW 981 + count 3 1003 982 field CRCONSEEN 0x80 1004 983 field CRCVALCHKEN 0x40 1005 984 field CRCENDCHKEN 0x20 ··· 1038 1013 register SFUNCT { 1039 1014 address 0x09f 1040 1015 access_mode RW 1016 + count 4 1041 1017 field ALT_MODE 0x80 1042 1018 } 1043 1019 ··· 1121 1095 } 1122 1096 SCB_SCSIOFFSET { 1123 1097 size 1 1098 + count 1 1124 1099 } 1125 1100 SCB_NEXT { 1126 1101 size 1 ··· 1145 1118 register SEECTL_2840 { 1146 1119 address 0x0c0 1147 1120 access_mode RW 1121 + count 2 1148 1122 field CS_2840 0x04 1149 1123 field CK_2840 0x02 1150 1124 field DO_2840 0x01 ··· 1154 1126 register STATUS_2840 { 1155 1127 address 0x0c1 1156 1128 access_mode RW 1129 + count 4 1157 1130 field EEPROM_TF 0x80 1158 1131 mask BIOS_SEL 0x60 1159 1132 mask ADSEL 0x1e ··· 1190 1161 1191 1162 register CCSCBCNT { 1192 1163 address 0xEF 1164 + count 1 1193 1165 } 1194 1166 1195 1167 register CCSCBCTL { ··· 1217 1187 register SCBBADDR { 1218 1188 address 0x0F0 1219 1189 access_mode RW 1190 + count 3 1220 1191 } 1221 1192 1222 1193 register CCSCBPTR { ··· 1226 1195 1227 1196 register HNSCB_QOFF { 1228 1197 address 0x0F4 1198 + count 4 1229 1199 } 1230 1200 1231 1201 register SNSCB_QOFF { ··· 1266 1234 mask WR_DFTHRSH_85 0x50 1267 1235 mask WR_DFTHRSH_90 0x60 1268 1236 mask WR_DFTHRSH_MAX 0x70 1237 + count 4 1269 1238 } 1270 1239 1271 1240 register SG_CACHE_PRE { ··· 1320 1287 ULTRA_ENB { 1321 1288 alias CMDSIZE_TABLE 1322 1289 size 2 1290 + count 2 1323 1291 } 1324 1292 /* 1325 1293 * Bit vector of targets that have disconnection disabled as set by ··· 1330 1296 */ 1331 1297 DISC_DSB { 1332 1298 size 2 1299 + count 6 1333 1300 } 1334 1301 CMDSIZE_TABLE_TAIL { 1335 1302 size 4 ··· 1358 1323 /* Parameters for DMA Logic */ 1359 1324 DMAPARAMS { 1360 1325 size 1 1326 + count 12 1361 1327 field PRELOADEN 0x80 1362 1328 field WIDEODD 0x40 1363 1329 field SCSIEN 0x20 ··· 1472 1436 KERNEL_TQINPOS { 1473 1437 size 1 1474 1438 } 1475 - TQINPOS { 1439 + TQINPOS { 1476 1440 size 1 1477 1441 } 1478 1442 ARG_1 { 1479 1443 size 1 1444 + count 1 1480 1445 mask SEND_MSG 0x80 1481 1446 mask SEND_SENSE 0x40 1482 1447 mask SEND_REJ 0x20 ··· 1532 1495 size 1 1533 1496 field HA_274_EXTENDED_TRANS 0x01 1534 1497 alias INITIATOR_TAG 1498 + count 1 1535 1499 } 1536 1500 1537 1501 SEQ_FLAGS2 { ··· 1556 1518 */ 1557 1519 SCSICONF { 1558 1520 size 1 1521 + count 12 1559 1522 field TERM_ENB 0x80 1560 1523 field RESET_SCSI 0x40 1561 1524 field ENSPCHK 0x20 ··· 1566 1527 INTDEF { 1567 1528 address 0x05c 1568 1529 size 1 1530 + count 1 1569 1531 field EDGE_TRIG 0x80 1570 1532 mask VECTOR 0x0f 1571 1533 } 1572 1534 HOSTCONF { 1573 1535 address 0x05d 1574 1536 size 1 1537 + count 1 1575 1538 } 1576 1539 HA_274_BIOSCTRL { 1577 1540 address 0x05f 1578 1541 size 1 1542 + count 1 1579 1543 mask BIOSMODE 0x30 1580 1544 mask BIOSDISABLED 0x30 1581 1545 field CHANNEL_B_PRIMARY 0x08 ··· 1594 1552 */ 1595 1553 TARG_OFFSET { 1596 1554 size 16 1555 + count 1 1597 1556 } 1598 1557 } 1599 1558
+8 -8
drivers/scsi/aic7xxx/aic7xxx_93cx6.c
··· 84 84 }; 85 85 86 86 /* Short opcodes for the c46 */ 87 - static struct seeprom_cmd seeprom_ewen = {9, {1, 0, 0, 1, 1, 0, 0, 0, 0}}; 88 - static struct seeprom_cmd seeprom_ewds = {9, {1, 0, 0, 0, 0, 0, 0, 0, 0}}; 87 + static const struct seeprom_cmd seeprom_ewen = {9, {1, 0, 0, 1, 1, 0, 0, 0, 0}}; 88 + static const struct seeprom_cmd seeprom_ewds = {9, {1, 0, 0, 0, 0, 0, 0, 0, 0}}; 89 89 90 90 /* Long opcodes for the C56/C66 */ 91 - static struct seeprom_cmd seeprom_long_ewen = {11, {1, 0, 0, 1, 1, 0, 0, 0, 0}}; 92 - static struct seeprom_cmd seeprom_long_ewds = {11, {1, 0, 0, 0, 0, 0, 0, 0, 0}}; 91 + static const struct seeprom_cmd seeprom_long_ewen = {11, {1, 0, 0, 1, 1, 0, 0, 0, 0}}; 92 + static const struct seeprom_cmd seeprom_long_ewds = {11, {1, 0, 0, 0, 0, 0, 0, 0, 0}}; 93 93 94 94 /* Common opcodes */ 95 - static struct seeprom_cmd seeprom_write = {3, {1, 0, 1}}; 96 - static struct seeprom_cmd seeprom_read = {3, {1, 1, 0}}; 95 + static const struct seeprom_cmd seeprom_write = {3, {1, 0, 1}}; 96 + static const struct seeprom_cmd seeprom_read = {3, {1, 1, 0}}; 97 97 98 98 /* 99 99 * Wait for the SEERDY to go high; about 800 ns. ··· 108 108 * Send a START condition and the given command 109 109 */ 110 110 static void 111 - send_seeprom_cmd(struct seeprom_descriptor *sd, struct seeprom_cmd *cmd) 111 + send_seeprom_cmd(struct seeprom_descriptor *sd, const struct seeprom_cmd *cmd) 112 112 { 113 113 uint8_t temp; 114 114 int i = 0; ··· 227 227 ahc_write_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, 228 228 u_int start_addr, u_int count) 229 229 { 230 - struct seeprom_cmd *ewen, *ewds; 230 + const struct seeprom_cmd *ewen, *ewds; 231 231 uint16_t v; 232 232 uint8_t temp; 233 233 int i, k;
+624 -52
drivers/scsi/aic7xxx/aic7xxx_core.c
··· 51 51 #endif 52 52 53 53 /***************************** Lookup Tables **********************************/ 54 - char *ahc_chip_names[] = 55 - { 54 + static const char *const ahc_chip_names[] = { 56 55 "NONE", 57 56 "aic7770", 58 57 "aic7850", ··· 74 75 */ 75 76 struct ahc_hard_error_entry { 76 77 uint8_t errno; 77 - char *errmesg; 78 + const char *errmesg; 78 79 }; 79 80 80 - static struct ahc_hard_error_entry ahc_hard_errors[] = { 81 + static const struct ahc_hard_error_entry ahc_hard_errors[] = { 81 82 { ILLHADDR, "Illegal Host Access" }, 82 83 { ILLSADDR, "Illegal Sequencer Address referrenced" }, 83 84 { ILLOPCODE, "Illegal Opcode in sequencer program" }, ··· 89 90 }; 90 91 static const u_int num_errors = ARRAY_SIZE(ahc_hard_errors); 91 92 92 - static struct ahc_phase_table_entry ahc_phase_table[] = 93 + static const struct ahc_phase_table_entry ahc_phase_table[] = 93 94 { 94 95 { P_DATAOUT, MSG_NOOP, "in Data-out phase" }, 95 96 { P_DATAIN, MSG_INITIATOR_DET_ERR, "in Data-in phase" }, ··· 114 115 * Provides a mapping of tranfer periods in ns to the proper value to 115 116 * stick in the scsixfer reg. 116 117 */ 117 - static struct ahc_syncrate ahc_syncrates[] = 118 + static const struct ahc_syncrate ahc_syncrates[] = 118 119 { 119 120 /* ultra2 fast/ultra period rate */ 120 121 { 0x42, 0x000, 9, "80.0" }, ··· 147 148 static void ahc_free_tstate(struct ahc_softc *ahc, 148 149 u_int scsi_id, char channel, int force); 149 150 #endif 150 - static struct ahc_syncrate* 151 + static const struct ahc_syncrate* 151 152 ahc_devlimited_syncrate(struct ahc_softc *ahc, 152 153 struct ahc_initiator_tinfo *, 153 154 u_int *period, ··· 203 204 #endif 204 205 205 206 static bus_dmamap_callback_t ahc_dmamap_cb; 206 - static void ahc_build_free_scb_list(struct ahc_softc *ahc); 207 - static int ahc_init_scbdata(struct ahc_softc *ahc); 208 - static void ahc_fini_scbdata(struct ahc_softc *ahc); 207 + static void ahc_build_free_scb_list(struct ahc_softc *ahc); 208 + static int ahc_init_scbdata(struct ahc_softc *ahc); 209 + static void ahc_fini_scbdata(struct ahc_softc *ahc); 209 210 static void ahc_qinfifo_requeue(struct ahc_softc *ahc, 210 211 struct scb *prev_scb, 211 212 struct scb *scb); ··· 221 222 #endif 222 223 static int ahc_loadseq(struct ahc_softc *ahc); 223 224 static int ahc_check_patch(struct ahc_softc *ahc, 224 - struct patch **start_patch, 225 + const struct patch **start_patch, 225 226 u_int start_instr, u_int *skip_addr); 226 227 static void ahc_download_instr(struct ahc_softc *ahc, 227 228 u_int instrptr, uint8_t *dconsts); ··· 236 237 static int ahc_handle_target_cmd(struct ahc_softc *ahc, 237 238 struct target_cmd *cmd); 238 239 #endif 240 + 241 + static u_int ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl); 242 + static void ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl); 243 + static void ahc_busy_tcl(struct ahc_softc *ahc, 244 + u_int tcl, u_int busyid); 245 + 246 + /************************** SCB and SCB queue management **********************/ 247 + static void ahc_run_untagged_queues(struct ahc_softc *ahc); 248 + static void ahc_run_untagged_queue(struct ahc_softc *ahc, 249 + struct scb_tailq *queue); 250 + 251 + /****************************** Initialization ********************************/ 252 + static void ahc_alloc_scbs(struct ahc_softc *ahc); 253 + static void ahc_shutdown(void *arg); 254 + 255 + /*************************** Interrupt Services *******************************/ 256 + static void ahc_clear_intstat(struct ahc_softc *ahc); 257 + static void ahc_run_qoutfifo(struct ahc_softc *ahc); 258 + #ifdef AHC_TARGET_MODE 259 + static void ahc_run_tqinfifo(struct ahc_softc *ahc, int paused); 260 + #endif 261 + static void ahc_handle_brkadrint(struct ahc_softc *ahc); 262 + static void ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat); 263 + static void ahc_handle_scsiint(struct ahc_softc *ahc, 264 + u_int intstat); 265 + static void ahc_clear_critical_section(struct ahc_softc *ahc); 266 + 267 + /***************************** Error Recovery *********************************/ 268 + static void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb); 269 + static int ahc_abort_scbs(struct ahc_softc *ahc, int target, 270 + char channel, int lun, u_int tag, 271 + role_t role, uint32_t status); 272 + static void ahc_calc_residual(struct ahc_softc *ahc, 273 + struct scb *scb); 274 + 275 + /*********************** Untagged Transaction Routines ************************/ 276 + static inline void ahc_freeze_untagged_queues(struct ahc_softc *ahc); 277 + static inline void ahc_release_untagged_queues(struct ahc_softc *ahc); 278 + 279 + /* 280 + * Block our completion routine from starting the next untagged 281 + * transaction for this target or target lun. 282 + */ 283 + static inline void 284 + ahc_freeze_untagged_queues(struct ahc_softc *ahc) 285 + { 286 + if ((ahc->flags & AHC_SCB_BTT) == 0) 287 + ahc->untagged_queue_lock++; 288 + } 289 + 290 + /* 291 + * Allow the next untagged transaction for this target or target lun 292 + * to be executed. We use a counting semaphore to allow the lock 293 + * to be acquired recursively. Once the count drops to zero, the 294 + * transaction queues will be run. 295 + */ 296 + static inline void 297 + ahc_release_untagged_queues(struct ahc_softc *ahc) 298 + { 299 + if ((ahc->flags & AHC_SCB_BTT) == 0) { 300 + ahc->untagged_queue_lock--; 301 + if (ahc->untagged_queue_lock == 0) 302 + ahc_run_untagged_queues(ahc); 303 + } 304 + } 305 + 306 + /************************* Sequencer Execution Control ************************/ 307 + /* 308 + * Work around any chip bugs related to halting sequencer execution. 309 + * On Ultra2 controllers, we must clear the CIOBUS stretch signal by 310 + * reading a register that will set this signal and deassert it. 311 + * Without this workaround, if the chip is paused, by an interrupt or 312 + * manual pause while accessing scb ram, accesses to certain registers 313 + * will hang the system (infinite pci retries). 314 + */ 315 + static void 316 + ahc_pause_bug_fix(struct ahc_softc *ahc) 317 + { 318 + if ((ahc->features & AHC_ULTRA2) != 0) 319 + (void)ahc_inb(ahc, CCSCBCTL); 320 + } 321 + 322 + /* 323 + * Determine whether the sequencer has halted code execution. 324 + * Returns non-zero status if the sequencer is stopped. 325 + */ 326 + int 327 + ahc_is_paused(struct ahc_softc *ahc) 328 + { 329 + return ((ahc_inb(ahc, HCNTRL) & PAUSE) != 0); 330 + } 331 + 332 + /* 333 + * Request that the sequencer stop and wait, indefinitely, for it 334 + * to stop. The sequencer will only acknowledge that it is paused 335 + * once it has reached an instruction boundary and PAUSEDIS is 336 + * cleared in the SEQCTL register. The sequencer may use PAUSEDIS 337 + * for critical sections. 338 + */ 339 + void 340 + ahc_pause(struct ahc_softc *ahc) 341 + { 342 + ahc_outb(ahc, HCNTRL, ahc->pause); 343 + 344 + /* 345 + * Since the sequencer can disable pausing in a critical section, we 346 + * must loop until it actually stops. 347 + */ 348 + while (ahc_is_paused(ahc) == 0) 349 + ; 350 + 351 + ahc_pause_bug_fix(ahc); 352 + } 353 + 354 + /* 355 + * Allow the sequencer to continue program execution. 356 + * We check here to ensure that no additional interrupt 357 + * sources that would cause the sequencer to halt have been 358 + * asserted. If, for example, a SCSI bus reset is detected 359 + * while we are fielding a different, pausing, interrupt type, 360 + * we don't want to release the sequencer before going back 361 + * into our interrupt handler and dealing with this new 362 + * condition. 363 + */ 364 + void 365 + ahc_unpause(struct ahc_softc *ahc) 366 + { 367 + if ((ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0) 368 + ahc_outb(ahc, HCNTRL, ahc->unpause); 369 + } 370 + 371 + /************************** Memory mapping routines ***************************/ 372 + static struct ahc_dma_seg * 373 + ahc_sg_bus_to_virt(struct scb *scb, uint32_t sg_busaddr) 374 + { 375 + int sg_index; 376 + 377 + sg_index = (sg_busaddr - scb->sg_list_phys)/sizeof(struct ahc_dma_seg); 378 + /* sg_list_phys points to entry 1, not 0 */ 379 + sg_index++; 380 + 381 + return (&scb->sg_list[sg_index]); 382 + } 383 + 384 + static uint32_t 385 + ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg) 386 + { 387 + int sg_index; 388 + 389 + /* sg_list_phys points to entry 1, not 0 */ 390 + sg_index = sg - &scb->sg_list[1]; 391 + 392 + return (scb->sg_list_phys + (sg_index * sizeof(*scb->sg_list))); 393 + } 394 + 395 + static uint32_t 396 + ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index) 397 + { 398 + return (ahc->scb_data->hscb_busaddr 399 + + (sizeof(struct hardware_scb) * index)); 400 + } 401 + 402 + static void 403 + ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op) 404 + { 405 + ahc_dmamap_sync(ahc, ahc->scb_data->hscb_dmat, 406 + ahc->scb_data->hscb_dmamap, 407 + /*offset*/(scb->hscb - ahc->hscbs) * sizeof(*scb->hscb), 408 + /*len*/sizeof(*scb->hscb), op); 409 + } 410 + 411 + void 412 + ahc_sync_sglist(struct ahc_softc *ahc, struct scb *scb, int op) 413 + { 414 + if (scb->sg_count == 0) 415 + return; 416 + 417 + ahc_dmamap_sync(ahc, ahc->scb_data->sg_dmat, scb->sg_map->sg_dmamap, 418 + /*offset*/(scb->sg_list - scb->sg_map->sg_vaddr) 419 + * sizeof(struct ahc_dma_seg), 420 + /*len*/sizeof(struct ahc_dma_seg) * scb->sg_count, op); 421 + } 422 + 423 + #ifdef AHC_TARGET_MODE 424 + static uint32_t 425 + ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index) 426 + { 427 + return (((uint8_t *)&ahc->targetcmds[index]) - ahc->qoutfifo); 428 + } 429 + #endif 430 + 431 + /*********************** Miscelaneous Support Functions ***********************/ 432 + /* 433 + * Determine whether the sequencer reported a residual 434 + * for this SCB/transaction. 435 + */ 436 + static void 437 + ahc_update_residual(struct ahc_softc *ahc, struct scb *scb) 438 + { 439 + uint32_t sgptr; 440 + 441 + sgptr = ahc_le32toh(scb->hscb->sgptr); 442 + if ((sgptr & SG_RESID_VALID) != 0) 443 + ahc_calc_residual(ahc, scb); 444 + } 445 + 446 + /* 447 + * Return pointers to the transfer negotiation information 448 + * for the specified our_id/remote_id pair. 449 + */ 450 + struct ahc_initiator_tinfo * 451 + ahc_fetch_transinfo(struct ahc_softc *ahc, char channel, u_int our_id, 452 + u_int remote_id, struct ahc_tmode_tstate **tstate) 453 + { 454 + /* 455 + * Transfer data structures are stored from the perspective 456 + * of the target role. Since the parameters for a connection 457 + * in the initiator role to a given target are the same as 458 + * when the roles are reversed, we pretend we are the target. 459 + */ 460 + if (channel == 'B') 461 + our_id += 8; 462 + *tstate = ahc->enabled_targets[our_id]; 463 + return (&(*tstate)->transinfo[remote_id]); 464 + } 465 + 466 + uint16_t 467 + ahc_inw(struct ahc_softc *ahc, u_int port) 468 + { 469 + uint16_t r = ahc_inb(ahc, port+1) << 8; 470 + return r | ahc_inb(ahc, port); 471 + } 472 + 473 + void 474 + ahc_outw(struct ahc_softc *ahc, u_int port, u_int value) 475 + { 476 + ahc_outb(ahc, port, value & 0xFF); 477 + ahc_outb(ahc, port+1, (value >> 8) & 0xFF); 478 + } 479 + 480 + uint32_t 481 + ahc_inl(struct ahc_softc *ahc, u_int port) 482 + { 483 + return ((ahc_inb(ahc, port)) 484 + | (ahc_inb(ahc, port+1) << 8) 485 + | (ahc_inb(ahc, port+2) << 16) 486 + | (ahc_inb(ahc, port+3) << 24)); 487 + } 488 + 489 + void 490 + ahc_outl(struct ahc_softc *ahc, u_int port, uint32_t value) 491 + { 492 + ahc_outb(ahc, port, (value) & 0xFF); 493 + ahc_outb(ahc, port+1, ((value) >> 8) & 0xFF); 494 + ahc_outb(ahc, port+2, ((value) >> 16) & 0xFF); 495 + ahc_outb(ahc, port+3, ((value) >> 24) & 0xFF); 496 + } 497 + 498 + uint64_t 499 + ahc_inq(struct ahc_softc *ahc, u_int port) 500 + { 501 + return ((ahc_inb(ahc, port)) 502 + | (ahc_inb(ahc, port+1) << 8) 503 + | (ahc_inb(ahc, port+2) << 16) 504 + | (ahc_inb(ahc, port+3) << 24) 505 + | (((uint64_t)ahc_inb(ahc, port+4)) << 32) 506 + | (((uint64_t)ahc_inb(ahc, port+5)) << 40) 507 + | (((uint64_t)ahc_inb(ahc, port+6)) << 48) 508 + | (((uint64_t)ahc_inb(ahc, port+7)) << 56)); 509 + } 510 + 511 + void 512 + ahc_outq(struct ahc_softc *ahc, u_int port, uint64_t value) 513 + { 514 + ahc_outb(ahc, port, value & 0xFF); 515 + ahc_outb(ahc, port+1, (value >> 8) & 0xFF); 516 + ahc_outb(ahc, port+2, (value >> 16) & 0xFF); 517 + ahc_outb(ahc, port+3, (value >> 24) & 0xFF); 518 + ahc_outb(ahc, port+4, (value >> 32) & 0xFF); 519 + ahc_outb(ahc, port+5, (value >> 40) & 0xFF); 520 + ahc_outb(ahc, port+6, (value >> 48) & 0xFF); 521 + ahc_outb(ahc, port+7, (value >> 56) & 0xFF); 522 + } 523 + 524 + /* 525 + * Get a free scb. If there are none, see if we can allocate a new SCB. 526 + */ 527 + struct scb * 528 + ahc_get_scb(struct ahc_softc *ahc) 529 + { 530 + struct scb *scb; 531 + 532 + if ((scb = SLIST_FIRST(&ahc->scb_data->free_scbs)) == NULL) { 533 + ahc_alloc_scbs(ahc); 534 + scb = SLIST_FIRST(&ahc->scb_data->free_scbs); 535 + if (scb == NULL) 536 + return (NULL); 537 + } 538 + SLIST_REMOVE_HEAD(&ahc->scb_data->free_scbs, links.sle); 539 + return (scb); 540 + } 541 + 542 + /* 543 + * Return an SCB resource to the free list. 544 + */ 545 + void 546 + ahc_free_scb(struct ahc_softc *ahc, struct scb *scb) 547 + { 548 + struct hardware_scb *hscb; 549 + 550 + hscb = scb->hscb; 551 + /* Clean up for the next user */ 552 + ahc->scb_data->scbindex[hscb->tag] = NULL; 553 + scb->flags = SCB_FREE; 554 + hscb->control = 0; 555 + 556 + SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links.sle); 557 + 558 + /* Notify the OSM that a resource is now available. */ 559 + ahc_platform_scb_free(ahc, scb); 560 + } 561 + 562 + struct scb * 563 + ahc_lookup_scb(struct ahc_softc *ahc, u_int tag) 564 + { 565 + struct scb* scb; 566 + 567 + scb = ahc->scb_data->scbindex[tag]; 568 + if (scb != NULL) 569 + ahc_sync_scb(ahc, scb, 570 + BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); 571 + return (scb); 572 + } 573 + 574 + static void 575 + ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb) 576 + { 577 + struct hardware_scb *q_hscb; 578 + u_int saved_tag; 579 + 580 + /* 581 + * Our queuing method is a bit tricky. The card 582 + * knows in advance which HSCB to download, and we 583 + * can't disappoint it. To achieve this, the next 584 + * SCB to download is saved off in ahc->next_queued_scb. 585 + * When we are called to queue "an arbitrary scb", 586 + * we copy the contents of the incoming HSCB to the one 587 + * the sequencer knows about, swap HSCB pointers and 588 + * finally assign the SCB to the tag indexed location 589 + * in the scb_array. This makes sure that we can still 590 + * locate the correct SCB by SCB_TAG. 591 + */ 592 + q_hscb = ahc->next_queued_scb->hscb; 593 + saved_tag = q_hscb->tag; 594 + memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 595 + if ((scb->flags & SCB_CDB32_PTR) != 0) { 596 + q_hscb->shared_data.cdb_ptr = 597 + ahc_htole32(ahc_hscb_busaddr(ahc, q_hscb->tag) 598 + + offsetof(struct hardware_scb, cdb32)); 599 + } 600 + q_hscb->tag = saved_tag; 601 + q_hscb->next = scb->hscb->tag; 602 + 603 + /* Now swap HSCB pointers. */ 604 + ahc->next_queued_scb->hscb = scb->hscb; 605 + scb->hscb = q_hscb; 606 + 607 + /* Now define the mapping from tag to SCB in the scbindex */ 608 + ahc->scb_data->scbindex[scb->hscb->tag] = scb; 609 + } 610 + 611 + /* 612 + * Tell the sequencer about a new transaction to execute. 613 + */ 614 + void 615 + ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb) 616 + { 617 + ahc_swap_with_next_hscb(ahc, scb); 618 + 619 + if (scb->hscb->tag == SCB_LIST_NULL 620 + || scb->hscb->next == SCB_LIST_NULL) 621 + panic("Attempt to queue invalid SCB tag %x:%x\n", 622 + scb->hscb->tag, scb->hscb->next); 623 + 624 + /* 625 + * Setup data "oddness". 626 + */ 627 + scb->hscb->lun &= LID; 628 + if (ahc_get_transfer_length(scb) & 0x1) 629 + scb->hscb->lun |= SCB_XFERLEN_ODD; 630 + 631 + /* 632 + * Keep a history of SCBs we've downloaded in the qinfifo. 633 + */ 634 + ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag; 635 + 636 + /* 637 + * Make sure our data is consistent from the 638 + * perspective of the adapter. 639 + */ 640 + ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); 641 + 642 + /* Tell the adapter about the newly queued SCB */ 643 + if ((ahc->features & AHC_QUEUE_REGS) != 0) { 644 + ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext); 645 + } else { 646 + if ((ahc->features & AHC_AUTOPAUSE) == 0) 647 + ahc_pause(ahc); 648 + ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext); 649 + if ((ahc->features & AHC_AUTOPAUSE) == 0) 650 + ahc_unpause(ahc); 651 + } 652 + } 653 + 654 + struct scsi_sense_data * 655 + ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb) 656 + { 657 + int offset; 658 + 659 + offset = scb - ahc->scb_data->scbarray; 660 + return (&ahc->scb_data->sense[offset]); 661 + } 662 + 663 + static uint32_t 664 + ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb) 665 + { 666 + int offset; 667 + 668 + offset = scb - ahc->scb_data->scbarray; 669 + return (ahc->scb_data->sense_busaddr 670 + + (offset * sizeof(struct scsi_sense_data))); 671 + } 672 + 673 + /************************** Interrupt Processing ******************************/ 674 + static void 675 + ahc_sync_qoutfifo(struct ahc_softc *ahc, int op) 676 + { 677 + ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap, 678 + /*offset*/0, /*len*/256, op); 679 + } 680 + 681 + static void 682 + ahc_sync_tqinfifo(struct ahc_softc *ahc, int op) 683 + { 684 + #ifdef AHC_TARGET_MODE 685 + if ((ahc->flags & AHC_TARGETROLE) != 0) { 686 + ahc_dmamap_sync(ahc, ahc->shared_data_dmat, 687 + ahc->shared_data_dmamap, 688 + ahc_targetcmd_offset(ahc, 0), 689 + sizeof(struct target_cmd) * AHC_TMODE_CMDS, 690 + op); 691 + } 692 + #endif 693 + } 694 + 695 + /* 696 + * See if the firmware has posted any completed commands 697 + * into our in-core command complete fifos. 698 + */ 699 + #define AHC_RUN_QOUTFIFO 0x1 700 + #define AHC_RUN_TQINFIFO 0x2 701 + static u_int 702 + ahc_check_cmdcmpltqueues(struct ahc_softc *ahc) 703 + { 704 + u_int retval; 705 + 706 + retval = 0; 707 + ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap, 708 + /*offset*/ahc->qoutfifonext, /*len*/1, 709 + BUS_DMASYNC_POSTREAD); 710 + if (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL) 711 + retval |= AHC_RUN_QOUTFIFO; 712 + #ifdef AHC_TARGET_MODE 713 + if ((ahc->flags & AHC_TARGETROLE) != 0 714 + && (ahc->flags & AHC_TQINFIFO_BLOCKED) == 0) { 715 + ahc_dmamap_sync(ahc, ahc->shared_data_dmat, 716 + ahc->shared_data_dmamap, 717 + ahc_targetcmd_offset(ahc, ahc->tqinfifofnext), 718 + /*len*/sizeof(struct target_cmd), 719 + BUS_DMASYNC_POSTREAD); 720 + if (ahc->targetcmds[ahc->tqinfifonext].cmd_valid != 0) 721 + retval |= AHC_RUN_TQINFIFO; 722 + } 723 + #endif 724 + return (retval); 725 + } 726 + 727 + /* 728 + * Catch an interrupt from the adapter 729 + */ 730 + int 731 + ahc_intr(struct ahc_softc *ahc) 732 + { 733 + u_int intstat; 734 + 735 + if ((ahc->pause & INTEN) == 0) { 736 + /* 737 + * Our interrupt is not enabled on the chip 738 + * and may be disabled for re-entrancy reasons, 739 + * so just return. This is likely just a shared 740 + * interrupt. 741 + */ 742 + return (0); 743 + } 744 + /* 745 + * Instead of directly reading the interrupt status register, 746 + * infer the cause of the interrupt by checking our in-core 747 + * completion queues. This avoids a costly PCI bus read in 748 + * most cases. 749 + */ 750 + if ((ahc->flags & (AHC_ALL_INTERRUPTS|AHC_EDGE_INTERRUPT)) == 0 751 + && (ahc_check_cmdcmpltqueues(ahc) != 0)) 752 + intstat = CMDCMPLT; 753 + else { 754 + intstat = ahc_inb(ahc, INTSTAT); 755 + } 756 + 757 + if ((intstat & INT_PEND) == 0) { 758 + #if AHC_PCI_CONFIG > 0 759 + if (ahc->unsolicited_ints > 500) { 760 + ahc->unsolicited_ints = 0; 761 + if ((ahc->chip & AHC_PCI) != 0 762 + && (ahc_inb(ahc, ERROR) & PCIERRSTAT) != 0) 763 + ahc->bus_intr(ahc); 764 + } 765 + #endif 766 + ahc->unsolicited_ints++; 767 + return (0); 768 + } 769 + ahc->unsolicited_ints = 0; 770 + 771 + if (intstat & CMDCMPLT) { 772 + ahc_outb(ahc, CLRINT, CLRCMDINT); 773 + 774 + /* 775 + * Ensure that the chip sees that we've cleared 776 + * this interrupt before we walk the output fifo. 777 + * Otherwise, we may, due to posted bus writes, 778 + * clear the interrupt after we finish the scan, 779 + * and after the sequencer has added new entries 780 + * and asserted the interrupt again. 781 + */ 782 + ahc_flush_device_writes(ahc); 783 + ahc_run_qoutfifo(ahc); 784 + #ifdef AHC_TARGET_MODE 785 + if ((ahc->flags & AHC_TARGETROLE) != 0) 786 + ahc_run_tqinfifo(ahc, /*paused*/FALSE); 787 + #endif 788 + } 789 + 790 + /* 791 + * Handle statuses that may invalidate our cached 792 + * copy of INTSTAT separately. 793 + */ 794 + if (intstat == 0xFF && (ahc->features & AHC_REMOVABLE) != 0) { 795 + /* Hot eject. Do nothing */ 796 + } else if (intstat & BRKADRINT) { 797 + ahc_handle_brkadrint(ahc); 798 + } else if ((intstat & (SEQINT|SCSIINT)) != 0) { 799 + 800 + ahc_pause_bug_fix(ahc); 801 + 802 + if ((intstat & SEQINT) != 0) 803 + ahc_handle_seqint(ahc, intstat); 804 + 805 + if ((intstat & SCSIINT) != 0) 806 + ahc_handle_scsiint(ahc, intstat); 807 + } 808 + return (1); 809 + } 810 + 239 811 /************************* Sequencer Execution Control ************************/ 240 812 /* 241 813 * Restart the sequencer program from address zero 242 814 */ 243 - void 815 + static void 244 816 ahc_restart(struct ahc_softc *ahc) 245 817 { 246 818 ··· 872 302 } 873 303 874 304 /************************* Input/Output Queues ********************************/ 875 - void 305 + static void 876 306 ahc_run_qoutfifo(struct ahc_softc *ahc) 877 307 { 878 308 struct scb *scb; ··· 919 349 } 920 350 } 921 351 922 - void 352 + static void 923 353 ahc_run_untagged_queues(struct ahc_softc *ahc) 924 354 { 925 355 int i; ··· 928 358 ahc_run_untagged_queue(ahc, &ahc->untagged_queues[i]); 929 359 } 930 360 931 - void 361 + static void 932 362 ahc_run_untagged_queue(struct ahc_softc *ahc, struct scb_tailq *queue) 933 363 { 934 364 struct scb *scb; ··· 944 374 } 945 375 946 376 /************************* Interrupt Handling *********************************/ 947 - void 377 + static void 948 378 ahc_handle_brkadrint(struct ahc_softc *ahc) 949 379 { 950 380 /* ··· 973 403 ahc_shutdown(ahc); 974 404 } 975 405 976 - void 406 + static void 977 407 ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) 978 408 { 979 409 struct scb *scb; ··· 1524 954 ahc_unpause(ahc); 1525 955 } 1526 956 1527 - void 957 + static void 1528 958 ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) 1529 959 { 1530 960 u_int scb_index; ··· 1977 1407 } 1978 1408 1979 1409 #define AHC_MAX_STEPS 2000 1980 - void 1410 + static void 1981 1411 ahc_clear_critical_section(struct ahc_softc *ahc) 1982 1412 { 1983 1413 int stepping; ··· 2070 1500 /* 2071 1501 * Clear any pending interrupt status. 2072 1502 */ 2073 - void 1503 + static void 2074 1504 ahc_clear_intstat(struct ahc_softc *ahc) 2075 1505 { 2076 1506 /* Clear any interrupt conditions this may have caused */ ··· 2089 1519 uint32_t ahc_debug = AHC_DEBUG_OPTS; 2090 1520 #endif 2091 1521 2092 - void 1522 + #if 0 /* unused */ 1523 + static void 2093 1524 ahc_print_scb(struct scb *scb) 2094 1525 { 2095 1526 int i; ··· 2122 1551 } 2123 1552 } 2124 1553 } 1554 + #endif 2125 1555 2126 1556 /************************* Transfer Negotiation *******************************/ 2127 1557 /* ··· 2206 1634 * by the capabilities of the bus connectivity of and sync settings for 2207 1635 * the target. 2208 1636 */ 2209 - struct ahc_syncrate * 1637 + const struct ahc_syncrate * 2210 1638 ahc_devlimited_syncrate(struct ahc_softc *ahc, 2211 1639 struct ahc_initiator_tinfo *tinfo, 2212 1640 u_int *period, u_int *ppr_options, role_t role) ··· 2261 1689 * Return the period and offset that should be sent to the target 2262 1690 * if this was the beginning of an SDTR. 2263 1691 */ 2264 - struct ahc_syncrate * 1692 + const struct ahc_syncrate * 2265 1693 ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, 2266 1694 u_int *ppr_options, u_int maxsync) 2267 1695 { 2268 - struct ahc_syncrate *syncrate; 1696 + const struct ahc_syncrate *syncrate; 2269 1697 2270 1698 if ((ahc->features & AHC_DT) == 0) 2271 1699 *ppr_options &= ~MSG_EXT_PPR_DT_REQ; ··· 2340 1768 u_int 2341 1769 ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync) 2342 1770 { 2343 - struct ahc_syncrate *syncrate; 1771 + const struct ahc_syncrate *syncrate; 2344 1772 2345 1773 if ((ahc->features & AHC_ULTRA2) != 0) 2346 1774 scsirate &= SXFR_ULTRA2; ··· 2378 1806 * Truncate the given synchronous offset to a value the 2379 1807 * current adapter type and syncrate are capable of. 2380 1808 */ 2381 - void 1809 + static void 2382 1810 ahc_validate_offset(struct ahc_softc *ahc, 2383 1811 struct ahc_initiator_tinfo *tinfo, 2384 - struct ahc_syncrate *syncrate, 1812 + const struct ahc_syncrate *syncrate, 2385 1813 u_int *offset, int wide, role_t role) 2386 1814 { 2387 1815 u_int maxoffset; ··· 2410 1838 * Truncate the given transfer width parameter to a value the 2411 1839 * current adapter type is capable of. 2412 1840 */ 2413 - void 1841 + static void 2414 1842 ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo, 2415 1843 u_int *bus_width, role_t role) 2416 1844 { ··· 2485 1913 */ 2486 1914 void 2487 1915 ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, 2488 - struct ahc_syncrate *syncrate, u_int period, 1916 + const struct ahc_syncrate *syncrate, u_int period, 2489 1917 u_int offset, u_int ppr_options, u_int type, int paused) 2490 1918 { 2491 1919 struct ahc_initiator_tinfo *tinfo; ··· 2792 2220 role); 2793 2221 } 2794 2222 2795 - struct ahc_phase_table_entry* 2223 + static const struct ahc_phase_table_entry* 2796 2224 ahc_lookup_phase_entry(int phase) 2797 2225 { 2798 - struct ahc_phase_table_entry *entry; 2799 - struct ahc_phase_table_entry *last_entry; 2226 + const struct ahc_phase_table_entry *entry; 2227 + const struct ahc_phase_table_entry *last_entry; 2800 2228 2801 2229 /* 2802 2230 * num_phases doesn't include the default entry which ··· 2962 2390 */ 2963 2391 struct ahc_initiator_tinfo *tinfo; 2964 2392 struct ahc_tmode_tstate *tstate; 2965 - struct ahc_syncrate *rate; 2393 + const struct ahc_syncrate *rate; 2966 2394 int dowide; 2967 2395 int dosync; 2968 2396 int doppr; ··· 3227 2655 */ 3228 2656 static void 3229 2657 ahc_handle_message_phase(struct ahc_softc *ahc) 3230 - { 2658 + { 3231 2659 struct ahc_devinfo devinfo; 3232 2660 u_int bus_phase; 3233 2661 int end_session; ··· 3628 3056 switch (ahc->msgin_buf[2]) { 3629 3057 case MSG_EXT_SDTR: 3630 3058 { 3631 - struct ahc_syncrate *syncrate; 3059 + const struct ahc_syncrate *syncrate; 3632 3060 u_int period; 3633 3061 u_int ppr_options; 3634 3062 u_int offset; ··· 3803 3231 } 3804 3232 case MSG_EXT_PPR: 3805 3233 { 3806 - struct ahc_syncrate *syncrate; 3234 + const struct ahc_syncrate *syncrate; 3807 3235 u_int period; 3808 3236 u_int offset; 3809 3237 u_int bus_width; ··· 4556 3984 return; 4557 3985 } 4558 3986 4559 - void 3987 + static void 4560 3988 ahc_shutdown(void *arg) 4561 3989 { 4562 3990 struct ahc_softc *ahc; ··· 4960 4388 free(scb_data->scbarray, M_DEVBUF); 4961 4389 } 4962 4390 4963 - void 4391 + static void 4964 4392 ahc_alloc_scbs(struct ahc_softc *ahc) 4965 4393 { 4966 4394 struct scb_data *scb_data; ··· 5693 5121 * Return the untagged transaction id for a given target/channel lun. 5694 5122 * Optionally, clear the entry. 5695 5123 */ 5696 - u_int 5124 + static u_int 5697 5125 ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl) 5698 5126 { 5699 5127 u_int scbid; ··· 5714 5142 return (scbid); 5715 5143 } 5716 5144 5717 - void 5145 + static void 5718 5146 ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl) 5719 5147 { 5720 5148 u_int target_offset; ··· 5732 5160 } 5733 5161 } 5734 5162 5735 - void 5163 + static void 5736 5164 ahc_busy_tcl(struct ahc_softc *ahc, u_int tcl, u_int scbid) 5737 5165 { 5738 5166 u_int target_offset; ··· 5787 5215 return match; 5788 5216 } 5789 5217 5790 - void 5218 + static void 5791 5219 ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb) 5792 5220 { 5793 5221 int target; ··· 6279 5707 */ 6280 5708 static u_int 6281 5709 ahc_rem_wscb(struct ahc_softc *ahc, u_int scbpos, u_int prev) 6282 - { 5710 + { 6283 5711 u_int curscb, next; 6284 5712 6285 5713 /* ··· 6328 5756 * been modified from CAM_REQ_INPROG. This routine assumes that the sequencer 6329 5757 * is paused before it is called. 6330 5758 */ 6331 - int 5759 + static int 6332 5760 ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel, 6333 5761 int lun, u_int tag, role_t role, uint32_t status) 6334 5762 { ··· 6650 6078 /* 6651 6079 * Calculate the residual for a just completed SCB. 6652 6080 */ 6653 - void 6081 + static void 6654 6082 ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb) 6655 6083 { 6656 6084 struct hardware_scb *hscb; ··· 6851 6279 struct cs cs_table[num_critical_sections]; 6852 6280 u_int begin_set[num_critical_sections]; 6853 6281 u_int end_set[num_critical_sections]; 6854 - struct patch *cur_patch; 6282 + const struct patch *cur_patch; 6855 6283 u_int cs_count; 6856 6284 u_int cur_cs; 6857 6285 u_int i; ··· 6956 6384 } 6957 6385 6958 6386 static int 6959 - ahc_check_patch(struct ahc_softc *ahc, struct patch **start_patch, 6387 + ahc_check_patch(struct ahc_softc *ahc, const struct patch **start_patch, 6960 6388 u_int start_instr, u_int *skip_addr) 6961 6389 { 6962 - struct patch *cur_patch; 6963 - struct patch *last_patch; 6390 + const struct patch *cur_patch; 6391 + const struct patch *last_patch; 6964 6392 u_int num_patches; 6965 6393 6966 6394 num_patches = ARRAY_SIZE(patches); ··· 7019 6447 case AIC_OP_JE: 7020 6448 case AIC_OP_JZ: 7021 6449 { 7022 - struct patch *cur_patch; 6450 + const struct patch *cur_patch; 7023 6451 int address_offset; 7024 6452 u_int address; 7025 6453 u_int skip_addr; ··· 7117 6545 } 7118 6546 7119 6547 int 7120 - ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries, 6548 + ahc_print_register(const ahc_reg_parse_entry_t *table, u_int num_entries, 7121 6549 const char *name, u_int address, u_int value, 7122 6550 u_int *cur_column, u_int wrap_point) 7123 6551 { ··· 7801 7229 ahc_outb(ahc, SCSIID, scsiid); 7802 7230 } 7803 7231 7804 - void 7232 + static void 7805 7233 ahc_run_tqinfifo(struct ahc_softc *ahc, int paused) 7806 7234 { 7807 7235 struct target_cmd *cmd;
+32 -584
drivers/scsi/aic7xxx/aic7xxx_inline.h
··· 46 46 #define _AIC7XXX_INLINE_H_ 47 47 48 48 /************************* Sequencer Execution Control ************************/ 49 - static __inline void ahc_pause_bug_fix(struct ahc_softc *ahc); 50 - static __inline int ahc_is_paused(struct ahc_softc *ahc); 51 - static __inline void ahc_pause(struct ahc_softc *ahc); 52 - static __inline void ahc_unpause(struct ahc_softc *ahc); 53 - 54 - /* 55 - * Work around any chip bugs related to halting sequencer execution. 56 - * On Ultra2 controllers, we must clear the CIOBUS stretch signal by 57 - * reading a register that will set this signal and deassert it. 58 - * Without this workaround, if the chip is paused, by an interrupt or 59 - * manual pause while accessing scb ram, accesses to certain registers 60 - * will hang the system (infinite pci retries). 61 - */ 62 - static __inline void 63 - ahc_pause_bug_fix(struct ahc_softc *ahc) 64 - { 65 - if ((ahc->features & AHC_ULTRA2) != 0) 66 - (void)ahc_inb(ahc, CCSCBCTL); 67 - } 68 - 69 - /* 70 - * Determine whether the sequencer has halted code execution. 71 - * Returns non-zero status if the sequencer is stopped. 72 - */ 73 - static __inline int 74 - ahc_is_paused(struct ahc_softc *ahc) 75 - { 76 - return ((ahc_inb(ahc, HCNTRL) & PAUSE) != 0); 77 - } 78 - 79 - /* 80 - * Request that the sequencer stop and wait, indefinitely, for it 81 - * to stop. The sequencer will only acknowledge that it is paused 82 - * once it has reached an instruction boundary and PAUSEDIS is 83 - * cleared in the SEQCTL register. The sequencer may use PAUSEDIS 84 - * for critical sections. 85 - */ 86 - static __inline void 87 - ahc_pause(struct ahc_softc *ahc) 88 - { 89 - ahc_outb(ahc, HCNTRL, ahc->pause); 90 - 91 - /* 92 - * Since the sequencer can disable pausing in a critical section, we 93 - * must loop until it actually stops. 94 - */ 95 - while (ahc_is_paused(ahc) == 0) 96 - ; 97 - 98 - ahc_pause_bug_fix(ahc); 99 - } 100 - 101 - /* 102 - * Allow the sequencer to continue program execution. 103 - * We check here to ensure that no additional interrupt 104 - * sources that would cause the sequencer to halt have been 105 - * asserted. If, for example, a SCSI bus reset is detected 106 - * while we are fielding a different, pausing, interrupt type, 107 - * we don't want to release the sequencer before going back 108 - * into our interrupt handler and dealing with this new 109 - * condition. 110 - */ 111 - static __inline void 112 - ahc_unpause(struct ahc_softc *ahc) 113 - { 114 - if ((ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0) 115 - ahc_outb(ahc, HCNTRL, ahc->unpause); 116 - } 117 - 118 - /*********************** Untagged Transaction Routines ************************/ 119 - static __inline void ahc_freeze_untagged_queues(struct ahc_softc *ahc); 120 - static __inline void ahc_release_untagged_queues(struct ahc_softc *ahc); 121 - 122 - /* 123 - * Block our completion routine from starting the next untagged 124 - * transaction for this target or target lun. 125 - */ 126 - static __inline void 127 - ahc_freeze_untagged_queues(struct ahc_softc *ahc) 128 - { 129 - if ((ahc->flags & AHC_SCB_BTT) == 0) 130 - ahc->untagged_queue_lock++; 131 - } 132 - 133 - /* 134 - * Allow the next untagged transaction for this target or target lun 135 - * to be executed. We use a counting semaphore to allow the lock 136 - * to be acquired recursively. Once the count drops to zero, the 137 - * transaction queues will be run. 138 - */ 139 - static __inline void 140 - ahc_release_untagged_queues(struct ahc_softc *ahc) 141 - { 142 - if ((ahc->flags & AHC_SCB_BTT) == 0) { 143 - ahc->untagged_queue_lock--; 144 - if (ahc->untagged_queue_lock == 0) 145 - ahc_run_untagged_queues(ahc); 146 - } 147 - } 49 + int ahc_is_paused(struct ahc_softc *ahc); 50 + void ahc_pause(struct ahc_softc *ahc); 51 + void ahc_unpause(struct ahc_softc *ahc); 148 52 149 53 /************************** Memory mapping routines ***************************/ 150 - static __inline struct ahc_dma_seg * 151 - ahc_sg_bus_to_virt(struct scb *scb, 152 - uint32_t sg_busaddr); 153 - static __inline uint32_t 154 - ahc_sg_virt_to_bus(struct scb *scb, 155 - struct ahc_dma_seg *sg); 156 - static __inline uint32_t 157 - ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index); 158 - static __inline void ahc_sync_scb(struct ahc_softc *ahc, 159 - struct scb *scb, int op); 160 - static __inline void ahc_sync_sglist(struct ahc_softc *ahc, 161 - struct scb *scb, int op); 162 - static __inline uint32_t 163 - ahc_targetcmd_offset(struct ahc_softc *ahc, 164 - u_int index); 165 - 166 - static __inline struct ahc_dma_seg * 167 - ahc_sg_bus_to_virt(struct scb *scb, uint32_t sg_busaddr) 168 - { 169 - int sg_index; 170 - 171 - sg_index = (sg_busaddr - scb->sg_list_phys)/sizeof(struct ahc_dma_seg); 172 - /* sg_list_phys points to entry 1, not 0 */ 173 - sg_index++; 174 - 175 - return (&scb->sg_list[sg_index]); 176 - } 177 - 178 - static __inline uint32_t 179 - ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg) 180 - { 181 - int sg_index; 182 - 183 - /* sg_list_phys points to entry 1, not 0 */ 184 - sg_index = sg - &scb->sg_list[1]; 185 - 186 - return (scb->sg_list_phys + (sg_index * sizeof(*scb->sg_list))); 187 - } 188 - 189 - static __inline uint32_t 190 - ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index) 191 - { 192 - return (ahc->scb_data->hscb_busaddr 193 - + (sizeof(struct hardware_scb) * index)); 194 - } 195 - 196 - static __inline void 197 - ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op) 198 - { 199 - ahc_dmamap_sync(ahc, ahc->scb_data->hscb_dmat, 200 - ahc->scb_data->hscb_dmamap, 201 - /*offset*/(scb->hscb - ahc->hscbs) * sizeof(*scb->hscb), 202 - /*len*/sizeof(*scb->hscb), op); 203 - } 204 - 205 - static __inline void 206 - ahc_sync_sglist(struct ahc_softc *ahc, struct scb *scb, int op) 207 - { 208 - if (scb->sg_count == 0) 209 - return; 210 - 211 - ahc_dmamap_sync(ahc, ahc->scb_data->sg_dmat, scb->sg_map->sg_dmamap, 212 - /*offset*/(scb->sg_list - scb->sg_map->sg_vaddr) 213 - * sizeof(struct ahc_dma_seg), 214 - /*len*/sizeof(struct ahc_dma_seg) * scb->sg_count, op); 215 - } 216 - 217 - static __inline uint32_t 218 - ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index) 219 - { 220 - return (((uint8_t *)&ahc->targetcmds[index]) - ahc->qoutfifo); 221 - } 54 + void ahc_sync_sglist(struct ahc_softc *ahc, 55 + struct scb *scb, int op); 222 56 223 57 /******************************** Debugging ***********************************/ 224 58 static __inline char *ahc_name(struct ahc_softc *ahc); ··· 65 231 66 232 /*********************** Miscellaneous Support Functions ***********************/ 67 233 68 - static __inline void ahc_update_residual(struct ahc_softc *ahc, 69 - struct scb *scb); 70 - static __inline struct ahc_initiator_tinfo * 71 - ahc_fetch_transinfo(struct ahc_softc *ahc, 72 - char channel, u_int our_id, 73 - u_int remote_id, 74 - struct ahc_tmode_tstate **tstate); 75 - static __inline uint16_t 76 - ahc_inw(struct ahc_softc *ahc, u_int port); 77 - static __inline void ahc_outw(struct ahc_softc *ahc, u_int port, 78 - u_int value); 79 - static __inline uint32_t 80 - ahc_inl(struct ahc_softc *ahc, u_int port); 81 - static __inline void ahc_outl(struct ahc_softc *ahc, u_int port, 82 - uint32_t value); 83 - static __inline uint64_t 84 - ahc_inq(struct ahc_softc *ahc, u_int port); 85 - static __inline void ahc_outq(struct ahc_softc *ahc, u_int port, 86 - uint64_t value); 87 - static __inline struct scb* 88 - ahc_get_scb(struct ahc_softc *ahc); 89 - static __inline void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb); 90 - static __inline void ahc_swap_with_next_hscb(struct ahc_softc *ahc, 91 - struct scb *scb); 92 - static __inline void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb); 93 - static __inline struct scsi_sense_data * 94 - ahc_get_sense_buf(struct ahc_softc *ahc, 95 - struct scb *scb); 96 - static __inline uint32_t 97 - ahc_get_sense_bufaddr(struct ahc_softc *ahc, 98 - struct scb *scb); 99 - 100 - /* 101 - * Determine whether the sequencer reported a residual 102 - * for this SCB/transaction. 103 - */ 104 - static __inline void 105 - ahc_update_residual(struct ahc_softc *ahc, struct scb *scb) 106 - { 107 - uint32_t sgptr; 108 - 109 - sgptr = ahc_le32toh(scb->hscb->sgptr); 110 - if ((sgptr & SG_RESID_VALID) != 0) 111 - ahc_calc_residual(ahc, scb); 112 - } 113 - 114 - /* 115 - * Return pointers to the transfer negotiation information 116 - * for the specified our_id/remote_id pair. 117 - */ 118 - static __inline struct ahc_initiator_tinfo * 119 - ahc_fetch_transinfo(struct ahc_softc *ahc, char channel, u_int our_id, 120 - u_int remote_id, struct ahc_tmode_tstate **tstate) 121 - { 122 - /* 123 - * Transfer data structures are stored from the perspective 124 - * of the target role. Since the parameters for a connection 125 - * in the initiator role to a given target are the same as 126 - * when the roles are reversed, we pretend we are the target. 127 - */ 128 - if (channel == 'B') 129 - our_id += 8; 130 - *tstate = ahc->enabled_targets[our_id]; 131 - return (&(*tstate)->transinfo[remote_id]); 132 - } 133 - 134 - static __inline uint16_t 135 - ahc_inw(struct ahc_softc *ahc, u_int port) 136 - { 137 - uint16_t r = ahc_inb(ahc, port+1) << 8; 138 - return r | ahc_inb(ahc, port); 139 - } 140 - 141 - static __inline void 142 - ahc_outw(struct ahc_softc *ahc, u_int port, u_int value) 143 - { 144 - ahc_outb(ahc, port, value & 0xFF); 145 - ahc_outb(ahc, port+1, (value >> 8) & 0xFF); 146 - } 147 - 148 - static __inline uint32_t 149 - ahc_inl(struct ahc_softc *ahc, u_int port) 150 - { 151 - return ((ahc_inb(ahc, port)) 152 - | (ahc_inb(ahc, port+1) << 8) 153 - | (ahc_inb(ahc, port+2) << 16) 154 - | (ahc_inb(ahc, port+3) << 24)); 155 - } 156 - 157 - static __inline void 158 - ahc_outl(struct ahc_softc *ahc, u_int port, uint32_t value) 159 - { 160 - ahc_outb(ahc, port, (value) & 0xFF); 161 - ahc_outb(ahc, port+1, ((value) >> 8) & 0xFF); 162 - ahc_outb(ahc, port+2, ((value) >> 16) & 0xFF); 163 - ahc_outb(ahc, port+3, ((value) >> 24) & 0xFF); 164 - } 165 - 166 - static __inline uint64_t 167 - ahc_inq(struct ahc_softc *ahc, u_int port) 168 - { 169 - return ((ahc_inb(ahc, port)) 170 - | (ahc_inb(ahc, port+1) << 8) 171 - | (ahc_inb(ahc, port+2) << 16) 172 - | (ahc_inb(ahc, port+3) << 24) 173 - | (((uint64_t)ahc_inb(ahc, port+4)) << 32) 174 - | (((uint64_t)ahc_inb(ahc, port+5)) << 40) 175 - | (((uint64_t)ahc_inb(ahc, port+6)) << 48) 176 - | (((uint64_t)ahc_inb(ahc, port+7)) << 56)); 177 - } 178 - 179 - static __inline void 180 - ahc_outq(struct ahc_softc *ahc, u_int port, uint64_t value) 181 - { 182 - ahc_outb(ahc, port, value & 0xFF); 183 - ahc_outb(ahc, port+1, (value >> 8) & 0xFF); 184 - ahc_outb(ahc, port+2, (value >> 16) & 0xFF); 185 - ahc_outb(ahc, port+3, (value >> 24) & 0xFF); 186 - ahc_outb(ahc, port+4, (value >> 32) & 0xFF); 187 - ahc_outb(ahc, port+5, (value >> 40) & 0xFF); 188 - ahc_outb(ahc, port+6, (value >> 48) & 0xFF); 189 - ahc_outb(ahc, port+7, (value >> 56) & 0xFF); 190 - } 191 - 192 - /* 193 - * Get a free scb. If there are none, see if we can allocate a new SCB. 194 - */ 195 - static __inline struct scb * 196 - ahc_get_scb(struct ahc_softc *ahc) 197 - { 198 - struct scb *scb; 199 - 200 - if ((scb = SLIST_FIRST(&ahc->scb_data->free_scbs)) == NULL) { 201 - ahc_alloc_scbs(ahc); 202 - scb = SLIST_FIRST(&ahc->scb_data->free_scbs); 203 - if (scb == NULL) 204 - return (NULL); 205 - } 206 - SLIST_REMOVE_HEAD(&ahc->scb_data->free_scbs, links.sle); 207 - return (scb); 208 - } 209 - 210 - /* 211 - * Return an SCB resource to the free list. 212 - */ 213 - static __inline void 214 - ahc_free_scb(struct ahc_softc *ahc, struct scb *scb) 215 - { 216 - struct hardware_scb *hscb; 217 - 218 - hscb = scb->hscb; 219 - /* Clean up for the next user */ 220 - ahc->scb_data->scbindex[hscb->tag] = NULL; 221 - scb->flags = SCB_FREE; 222 - hscb->control = 0; 223 - 224 - SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links.sle); 225 - 226 - /* Notify the OSM that a resource is now available. */ 227 - ahc_platform_scb_free(ahc, scb); 228 - } 229 - 230 - static __inline struct scb * 231 - ahc_lookup_scb(struct ahc_softc *ahc, u_int tag) 232 - { 233 - struct scb* scb; 234 - 235 - scb = ahc->scb_data->scbindex[tag]; 236 - if (scb != NULL) 237 - ahc_sync_scb(ahc, scb, 238 - BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); 239 - return (scb); 240 - } 241 - 242 - static __inline void 243 - ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb) 244 - { 245 - struct hardware_scb *q_hscb; 246 - u_int saved_tag; 247 - 248 - /* 249 - * Our queuing method is a bit tricky. The card 250 - * knows in advance which HSCB to download, and we 251 - * can't disappoint it. To achieve this, the next 252 - * SCB to download is saved off in ahc->next_queued_scb. 253 - * When we are called to queue "an arbitrary scb", 254 - * we copy the contents of the incoming HSCB to the one 255 - * the sequencer knows about, swap HSCB pointers and 256 - * finally assign the SCB to the tag indexed location 257 - * in the scb_array. This makes sure that we can still 258 - * locate the correct SCB by SCB_TAG. 259 - */ 260 - q_hscb = ahc->next_queued_scb->hscb; 261 - saved_tag = q_hscb->tag; 262 - memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 263 - if ((scb->flags & SCB_CDB32_PTR) != 0) { 264 - q_hscb->shared_data.cdb_ptr = 265 - ahc_htole32(ahc_hscb_busaddr(ahc, q_hscb->tag) 266 - + offsetof(struct hardware_scb, cdb32)); 267 - } 268 - q_hscb->tag = saved_tag; 269 - q_hscb->next = scb->hscb->tag; 270 - 271 - /* Now swap HSCB pointers. */ 272 - ahc->next_queued_scb->hscb = scb->hscb; 273 - scb->hscb = q_hscb; 274 - 275 - /* Now define the mapping from tag to SCB in the scbindex */ 276 - ahc->scb_data->scbindex[scb->hscb->tag] = scb; 277 - } 278 - 279 - /* 280 - * Tell the sequencer about a new transaction to execute. 281 - */ 282 - static __inline void 283 - ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb) 284 - { 285 - ahc_swap_with_next_hscb(ahc, scb); 286 - 287 - if (scb->hscb->tag == SCB_LIST_NULL 288 - || scb->hscb->next == SCB_LIST_NULL) 289 - panic("Attempt to queue invalid SCB tag %x:%x\n", 290 - scb->hscb->tag, scb->hscb->next); 291 - 292 - /* 293 - * Setup data "oddness". 294 - */ 295 - scb->hscb->lun &= LID; 296 - if (ahc_get_transfer_length(scb) & 0x1) 297 - scb->hscb->lun |= SCB_XFERLEN_ODD; 298 - 299 - /* 300 - * Keep a history of SCBs we've downloaded in the qinfifo. 301 - */ 302 - ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag; 303 - 304 - /* 305 - * Make sure our data is consistent from the 306 - * perspective of the adapter. 307 - */ 308 - ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); 309 - 310 - /* Tell the adapter about the newly queued SCB */ 311 - if ((ahc->features & AHC_QUEUE_REGS) != 0) { 312 - ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext); 313 - } else { 314 - if ((ahc->features & AHC_AUTOPAUSE) == 0) 315 - ahc_pause(ahc); 316 - ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext); 317 - if ((ahc->features & AHC_AUTOPAUSE) == 0) 318 - ahc_unpause(ahc); 319 - } 320 - } 321 - 322 - static __inline struct scsi_sense_data * 323 - ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb) 324 - { 325 - int offset; 326 - 327 - offset = scb - ahc->scb_data->scbarray; 328 - return (&ahc->scb_data->sense[offset]); 329 - } 330 - 331 - static __inline uint32_t 332 - ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb) 333 - { 334 - int offset; 335 - 336 - offset = scb - ahc->scb_data->scbarray; 337 - return (ahc->scb_data->sense_busaddr 338 - + (offset * sizeof(struct scsi_sense_data))); 339 - } 234 + struct ahc_initiator_tinfo * 235 + ahc_fetch_transinfo(struct ahc_softc *ahc, 236 + char channel, u_int our_id, 237 + u_int remote_id, 238 + struct ahc_tmode_tstate **tstate); 239 + uint16_t 240 + ahc_inw(struct ahc_softc *ahc, u_int port); 241 + void ahc_outw(struct ahc_softc *ahc, u_int port, 242 + u_int value); 243 + uint32_t 244 + ahc_inl(struct ahc_softc *ahc, u_int port); 245 + void ahc_outl(struct ahc_softc *ahc, u_int port, 246 + uint32_t value); 247 + uint64_t 248 + ahc_inq(struct ahc_softc *ahc, u_int port); 249 + void ahc_outq(struct ahc_softc *ahc, u_int port, 250 + uint64_t value); 251 + struct scb* 252 + ahc_get_scb(struct ahc_softc *ahc); 253 + void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb); 254 + struct scb * 255 + ahc_lookup_scb(struct ahc_softc *ahc, u_int tag); 256 + void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb); 257 + struct scsi_sense_data * 258 + ahc_get_sense_buf(struct ahc_softc *ahc, 259 + struct scb *scb); 340 260 341 261 /************************** Interrupt Processing ******************************/ 342 - static __inline void ahc_sync_qoutfifo(struct ahc_softc *ahc, int op); 343 - static __inline void ahc_sync_tqinfifo(struct ahc_softc *ahc, int op); 344 - static __inline u_int ahc_check_cmdcmpltqueues(struct ahc_softc *ahc); 345 - static __inline int ahc_intr(struct ahc_softc *ahc); 346 - 347 - static __inline void 348 - ahc_sync_qoutfifo(struct ahc_softc *ahc, int op) 349 - { 350 - ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap, 351 - /*offset*/0, /*len*/256, op); 352 - } 353 - 354 - static __inline void 355 - ahc_sync_tqinfifo(struct ahc_softc *ahc, int op) 356 - { 357 - #ifdef AHC_TARGET_MODE 358 - if ((ahc->flags & AHC_TARGETROLE) != 0) { 359 - ahc_dmamap_sync(ahc, ahc->shared_data_dmat, 360 - ahc->shared_data_dmamap, 361 - ahc_targetcmd_offset(ahc, 0), 362 - sizeof(struct target_cmd) * AHC_TMODE_CMDS, 363 - op); 364 - } 365 - #endif 366 - } 367 - 368 - /* 369 - * See if the firmware has posted any completed commands 370 - * into our in-core command complete fifos. 371 - */ 372 - #define AHC_RUN_QOUTFIFO 0x1 373 - #define AHC_RUN_TQINFIFO 0x2 374 - static __inline u_int 375 - ahc_check_cmdcmpltqueues(struct ahc_softc *ahc) 376 - { 377 - u_int retval; 378 - 379 - retval = 0; 380 - ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap, 381 - /*offset*/ahc->qoutfifonext, /*len*/1, 382 - BUS_DMASYNC_POSTREAD); 383 - if (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL) 384 - retval |= AHC_RUN_QOUTFIFO; 385 - #ifdef AHC_TARGET_MODE 386 - if ((ahc->flags & AHC_TARGETROLE) != 0 387 - && (ahc->flags & AHC_TQINFIFO_BLOCKED) == 0) { 388 - ahc_dmamap_sync(ahc, ahc->shared_data_dmat, 389 - ahc->shared_data_dmamap, 390 - ahc_targetcmd_offset(ahc, ahc->tqinfifofnext), 391 - /*len*/sizeof(struct target_cmd), 392 - BUS_DMASYNC_POSTREAD); 393 - if (ahc->targetcmds[ahc->tqinfifonext].cmd_valid != 0) 394 - retval |= AHC_RUN_TQINFIFO; 395 - } 396 - #endif 397 - return (retval); 398 - } 399 - 400 - /* 401 - * Catch an interrupt from the adapter 402 - */ 403 - static __inline int 404 - ahc_intr(struct ahc_softc *ahc) 405 - { 406 - u_int intstat; 407 - 408 - if ((ahc->pause & INTEN) == 0) { 409 - /* 410 - * Our interrupt is not enabled on the chip 411 - * and may be disabled for re-entrancy reasons, 412 - * so just return. This is likely just a shared 413 - * interrupt. 414 - */ 415 - return (0); 416 - } 417 - /* 418 - * Instead of directly reading the interrupt status register, 419 - * infer the cause of the interrupt by checking our in-core 420 - * completion queues. This avoids a costly PCI bus read in 421 - * most cases. 422 - */ 423 - if ((ahc->flags & (AHC_ALL_INTERRUPTS|AHC_EDGE_INTERRUPT)) == 0 424 - && (ahc_check_cmdcmpltqueues(ahc) != 0)) 425 - intstat = CMDCMPLT; 426 - else { 427 - intstat = ahc_inb(ahc, INTSTAT); 428 - } 429 - 430 - if ((intstat & INT_PEND) == 0) { 431 - #if AHC_PCI_CONFIG > 0 432 - if (ahc->unsolicited_ints > 500) { 433 - ahc->unsolicited_ints = 0; 434 - if ((ahc->chip & AHC_PCI) != 0 435 - && (ahc_inb(ahc, ERROR) & PCIERRSTAT) != 0) 436 - ahc->bus_intr(ahc); 437 - } 438 - #endif 439 - ahc->unsolicited_ints++; 440 - return (0); 441 - } 442 - ahc->unsolicited_ints = 0; 443 - 444 - if (intstat & CMDCMPLT) { 445 - ahc_outb(ahc, CLRINT, CLRCMDINT); 446 - 447 - /* 448 - * Ensure that the chip sees that we've cleared 449 - * this interrupt before we walk the output fifo. 450 - * Otherwise, we may, due to posted bus writes, 451 - * clear the interrupt after we finish the scan, 452 - * and after the sequencer has added new entries 453 - * and asserted the interrupt again. 454 - */ 455 - ahc_flush_device_writes(ahc); 456 - ahc_run_qoutfifo(ahc); 457 - #ifdef AHC_TARGET_MODE 458 - if ((ahc->flags & AHC_TARGETROLE) != 0) 459 - ahc_run_tqinfifo(ahc, /*paused*/FALSE); 460 - #endif 461 - } 462 - 463 - /* 464 - * Handle statuses that may invalidate our cached 465 - * copy of INTSTAT separately. 466 - */ 467 - if (intstat == 0xFF && (ahc->features & AHC_REMOVABLE) != 0) { 468 - /* Hot eject. Do nothing */ 469 - } else if (intstat & BRKADRINT) { 470 - ahc_handle_brkadrint(ahc); 471 - } else if ((intstat & (SEQINT|SCSIINT)) != 0) { 472 - 473 - ahc_pause_bug_fix(ahc); 474 - 475 - if ((intstat & SEQINT) != 0) 476 - ahc_handle_seqint(ahc, intstat); 477 - 478 - if ((intstat & SCSIINT) != 0) 479 - ahc_handle_scsiint(ahc, intstat); 480 - } 481 - return (1); 482 - } 262 + int ahc_intr(struct ahc_softc *ahc); 483 263 484 264 #endif /* _AIC7XXX_INLINE_H_ */
+82 -15
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 388 388 static int ahc_linux_unit; 389 389 390 390 391 - /********************************* Inlines ************************************/ 392 - static __inline void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*); 391 + /************************** OS Utility Wrappers *******************************/ 392 + void 393 + ahc_delay(long usec) 394 + { 395 + /* 396 + * udelay on Linux can have problems for 397 + * multi-millisecond waits. Wait at most 398 + * 1024us per call. 399 + */ 400 + while (usec > 0) { 401 + udelay(usec % 1024); 402 + usec -= 1024; 403 + } 404 + } 393 405 394 - static __inline int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, 406 + /***************************** Low Level I/O **********************************/ 407 + uint8_t 408 + ahc_inb(struct ahc_softc * ahc, long port) 409 + { 410 + uint8_t x; 411 + 412 + if (ahc->tag == BUS_SPACE_MEMIO) { 413 + x = readb(ahc->bsh.maddr + port); 414 + } else { 415 + x = inb(ahc->bsh.ioport + port); 416 + } 417 + mb(); 418 + return (x); 419 + } 420 + 421 + void 422 + ahc_outb(struct ahc_softc * ahc, long port, uint8_t val) 423 + { 424 + if (ahc->tag == BUS_SPACE_MEMIO) { 425 + writeb(val, ahc->bsh.maddr + port); 426 + } else { 427 + outb(val, ahc->bsh.ioport + port); 428 + } 429 + mb(); 430 + } 431 + 432 + void 433 + ahc_outsb(struct ahc_softc * ahc, long port, uint8_t *array, int count) 434 + { 435 + int i; 436 + 437 + /* 438 + * There is probably a more efficient way to do this on Linux 439 + * but we don't use this for anything speed critical and this 440 + * should work. 441 + */ 442 + for (i = 0; i < count; i++) 443 + ahc_outb(ahc, port, *array++); 444 + } 445 + 446 + void 447 + ahc_insb(struct ahc_softc * ahc, long port, uint8_t *array, int count) 448 + { 449 + int i; 450 + 451 + /* 452 + * There is probably a more efficient way to do this on Linux 453 + * but we don't use this for anything speed critical and this 454 + * should work. 455 + */ 456 + for (i = 0; i < count; i++) 457 + *array++ = ahc_inb(ahc, port); 458 + } 459 + 460 + /********************************* Inlines ************************************/ 461 + static void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*); 462 + 463 + static int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, 395 464 struct ahc_dma_seg *sg, 396 465 dma_addr_t addr, bus_size_t len); 397 466 398 - static __inline void 467 + static void 399 468 ahc_linux_unmap_scb(struct ahc_softc *ahc, struct scb *scb) 400 469 { 401 470 struct scsi_cmnd *cmd; ··· 475 406 scsi_dma_unmap(cmd); 476 407 } 477 408 478 - static __inline int 409 + static int 479 410 ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, 480 411 struct ahc_dma_seg *sg, dma_addr_t addr, bus_size_t len) 481 412 { ··· 511 442 bp = &buffer[0]; 512 443 ahc = *(struct ahc_softc **)host->hostdata; 513 444 memset(bp, 0, sizeof(buffer)); 514 - strcpy(bp, "Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev "); 515 - strcat(bp, AIC7XXX_DRIVER_VERSION); 516 - strcat(bp, "\n"); 517 - strcat(bp, " <"); 445 + strcpy(bp, "Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev " AIC7XXX_DRIVER_VERSION "\n" 446 + " <"); 518 447 strcat(bp, ahc->description); 519 - strcat(bp, ">\n"); 520 - strcat(bp, " "); 448 + strcat(bp, ">\n" 449 + " "); 521 450 ahc_controller_info(ahc, ahc_info); 522 451 strcat(bp, ahc_info); 523 452 strcat(bp, "\n"); ··· 1031 964 char *p; 1032 965 char *end; 1033 966 1034 - static struct { 967 + static const struct { 1035 968 const char *name; 1036 969 uint32_t *flag; 1037 970 } options[] = { ··· 2384 2317 unsigned int ppr_options = tinfo->goal.ppr_options; 2385 2318 unsigned long flags; 2386 2319 unsigned long offset = tinfo->goal.offset; 2387 - struct ahc_syncrate *syncrate; 2320 + const struct ahc_syncrate *syncrate; 2388 2321 2389 2322 if (offset == 0) 2390 2323 offset = MAX_OFFSET; ··· 2428 2361 unsigned int ppr_options = 0; 2429 2362 unsigned int period = 0; 2430 2363 unsigned long flags; 2431 - struct ahc_syncrate *syncrate = NULL; 2364 + const struct ahc_syncrate *syncrate = NULL; 2432 2365 2433 2366 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, 2434 2367 starget->channel + 'A', ROLE_INITIATOR); ··· 2458 2391 unsigned int period = tinfo->goal.period; 2459 2392 unsigned int width = tinfo->goal.width; 2460 2393 unsigned long flags; 2461 - struct ahc_syncrate *syncrate; 2394 + const struct ahc_syncrate *syncrate; 2462 2395 2463 2396 if (dt && spi_max_width(starget)) { 2464 2397 ppr_options |= MSG_EXT_PPR_DT_REQ;
+12 -130
drivers/scsi/aic7xxx/aic7xxx_osm.h
··· 365 365 #define AHC_LINUX_NOIRQ ((uint32_t)~0) 366 366 uint32_t irq; /* IRQ for this adapter */ 367 367 uint32_t bios_address; 368 - uint32_t mem_busaddr; /* Mem Base Addr */ 368 + resource_size_t mem_busaddr; /* Mem Base Addr */ 369 369 }; 370 370 371 371 /************************** OS Utility Wrappers *******************************/ ··· 375 375 #define malloc(size, type, flags) kmalloc(size, flags) 376 376 #define free(ptr, type) kfree(ptr) 377 377 378 - static __inline void ahc_delay(long); 379 - static __inline void 380 - ahc_delay(long usec) 381 - { 382 - /* 383 - * udelay on Linux can have problems for 384 - * multi-millisecond waits. Wait at most 385 - * 1024us per call. 386 - */ 387 - while (usec > 0) { 388 - udelay(usec % 1024); 389 - usec -= 1024; 390 - } 391 - } 378 + void ahc_delay(long); 392 379 393 380 394 381 /***************************** Low Level I/O **********************************/ 395 - static __inline uint8_t ahc_inb(struct ahc_softc * ahc, long port); 396 - static __inline void ahc_outb(struct ahc_softc * ahc, long port, uint8_t val); 397 - static __inline void ahc_outsb(struct ahc_softc * ahc, long port, 398 - uint8_t *, int count); 399 - static __inline void ahc_insb(struct ahc_softc * ahc, long port, 400 - uint8_t *, int count); 401 - 402 - static __inline uint8_t 403 - ahc_inb(struct ahc_softc * ahc, long port) 404 - { 405 - uint8_t x; 406 - 407 - if (ahc->tag == BUS_SPACE_MEMIO) { 408 - x = readb(ahc->bsh.maddr + port); 409 - } else { 410 - x = inb(ahc->bsh.ioport + port); 411 - } 412 - mb(); 413 - return (x); 414 - } 415 - 416 - static __inline void 417 - ahc_outb(struct ahc_softc * ahc, long port, uint8_t val) 418 - { 419 - if (ahc->tag == BUS_SPACE_MEMIO) { 420 - writeb(val, ahc->bsh.maddr + port); 421 - } else { 422 - outb(val, ahc->bsh.ioport + port); 423 - } 424 - mb(); 425 - } 426 - 427 - static __inline void 428 - ahc_outsb(struct ahc_softc * ahc, long port, uint8_t *array, int count) 429 - { 430 - int i; 431 - 432 - /* 433 - * There is probably a more efficient way to do this on Linux 434 - * but we don't use this for anything speed critical and this 435 - * should work. 436 - */ 437 - for (i = 0; i < count; i++) 438 - ahc_outb(ahc, port, *array++); 439 - } 440 - 441 - static __inline void 442 - ahc_insb(struct ahc_softc * ahc, long port, uint8_t *array, int count) 443 - { 444 - int i; 445 - 446 - /* 447 - * There is probably a more efficient way to do this on Linux 448 - * but we don't use this for anything speed critical and this 449 - * should work. 450 - */ 451 - for (i = 0; i < count; i++) 452 - *array++ = ahc_inb(ahc, port); 453 - } 382 + uint8_t ahc_inb(struct ahc_softc * ahc, long port); 383 + void ahc_outb(struct ahc_softc * ahc, long port, uint8_t val); 384 + void ahc_outsb(struct ahc_softc * ahc, long port, 385 + uint8_t *, int count); 386 + void ahc_insb(struct ahc_softc * ahc, long port, 387 + uint8_t *, int count); 454 388 455 389 /**************************** Initialization **********************************/ 456 390 int ahc_linux_register_host(struct ahc_softc *, ··· 397 463 off_t offset; 398 464 int pos; 399 465 }; 400 - 401 - void ahc_format_transinfo(struct info_str *info, 402 - struct ahc_transinfo *tinfo); 403 466 404 467 /******************************** Locking *************************************/ 405 468 /* Lock protecting internal data structures */ ··· 486 555 int ahc_pci_map_registers(struct ahc_softc *ahc); 487 556 int ahc_pci_map_int(struct ahc_softc *ahc); 488 557 489 - static __inline uint32_t ahc_pci_read_config(ahc_dev_softc_t pci, 558 + uint32_t ahc_pci_read_config(ahc_dev_softc_t pci, 490 559 int reg, int width); 491 560 492 - static __inline uint32_t 493 - ahc_pci_read_config(ahc_dev_softc_t pci, int reg, int width) 494 - { 495 - switch (width) { 496 - case 1: 497 - { 498 - uint8_t retval; 499 - 500 - pci_read_config_byte(pci, reg, &retval); 501 - return (retval); 502 - } 503 - case 2: 504 - { 505 - uint16_t retval; 506 - pci_read_config_word(pci, reg, &retval); 507 - return (retval); 508 - } 509 - case 4: 510 - { 511 - uint32_t retval; 512 - pci_read_config_dword(pci, reg, &retval); 513 - return (retval); 514 - } 515 - default: 516 - panic("ahc_pci_read_config: Read size too big"); 517 - /* NOTREACHED */ 518 - return (0); 519 - } 520 - } 521 - 522 - static __inline void ahc_pci_write_config(ahc_dev_softc_t pci, 523 - int reg, uint32_t value, 524 - int width); 525 - 526 - static __inline void 527 - ahc_pci_write_config(ahc_dev_softc_t pci, int reg, uint32_t value, int width) 528 - { 529 - switch (width) { 530 - case 1: 531 - pci_write_config_byte(pci, reg, value); 532 - break; 533 - case 2: 534 - pci_write_config_word(pci, reg, value); 535 - break; 536 - case 4: 537 - pci_write_config_dword(pci, reg, value); 538 - break; 539 - default: 540 - panic("ahc_pci_write_config: Write size too big"); 541 - /* NOTREACHED */ 542 - } 543 - } 561 + void ahc_pci_write_config(ahc_dev_softc_t pci, 562 + int reg, uint32_t value, 563 + int width); 544 564 545 565 static __inline int ahc_get_pci_function(ahc_dev_softc_t); 546 566 static __inline int
+62 -11
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
··· 46 46 */ 47 47 #define ID(x) ID_C(x, PCI_CLASS_STORAGE_SCSI) 48 48 49 - static struct pci_device_id ahc_linux_pci_id_table[] = { 49 + static const struct pci_device_id ahc_linux_pci_id_table[] = { 50 50 /* aic7850 based controllers */ 51 51 ID(ID_AHA_2902_04_10_15_20C_30C), 52 52 /* aic7860 based controllers */ ··· 206 206 const uint64_t mask_39bit = 0x7FFFFFFFFFULL; 207 207 struct ahc_softc *ahc; 208 208 ahc_dev_softc_t pci; 209 - struct ahc_pci_identity *entry; 209 + const struct ahc_pci_identity *entry; 210 210 char *name; 211 211 int error; 212 212 struct device *dev = &pdev->dev; ··· 269 269 return (0); 270 270 } 271 271 272 + /******************************* PCI Routines *********************************/ 273 + uint32_t 274 + ahc_pci_read_config(ahc_dev_softc_t pci, int reg, int width) 275 + { 276 + switch (width) { 277 + case 1: 278 + { 279 + uint8_t retval; 280 + 281 + pci_read_config_byte(pci, reg, &retval); 282 + return (retval); 283 + } 284 + case 2: 285 + { 286 + uint16_t retval; 287 + pci_read_config_word(pci, reg, &retval); 288 + return (retval); 289 + } 290 + case 4: 291 + { 292 + uint32_t retval; 293 + pci_read_config_dword(pci, reg, &retval); 294 + return (retval); 295 + } 296 + default: 297 + panic("ahc_pci_read_config: Read size too big"); 298 + /* NOTREACHED */ 299 + return (0); 300 + } 301 + } 302 + 303 + void 304 + ahc_pci_write_config(ahc_dev_softc_t pci, int reg, uint32_t value, int width) 305 + { 306 + switch (width) { 307 + case 1: 308 + pci_write_config_byte(pci, reg, value); 309 + break; 310 + case 2: 311 + pci_write_config_word(pci, reg, value); 312 + break; 313 + case 4: 314 + pci_write_config_dword(pci, reg, value); 315 + break; 316 + default: 317 + panic("ahc_pci_write_config: Write size too big"); 318 + /* NOTREACHED */ 319 + } 320 + } 321 + 322 + 272 323 static struct pci_driver aic7xxx_pci_driver = { 273 324 .name = "aic7xxx", 274 325 .probe = ahc_linux_pci_dev_probe, ··· 344 293 } 345 294 346 295 static int 347 - ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base) 296 + ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, resource_size_t *base) 348 297 { 349 298 if (aic7xxx_allow_memio == 0) 350 299 return (ENOMEM); ··· 359 308 360 309 static int 361 310 ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc, 362 - u_long *bus_addr, 311 + resource_size_t *bus_addr, 363 312 uint8_t __iomem **maddr) 364 313 { 365 - u_long start; 314 + resource_size_t start; 366 315 int error; 367 316 368 317 error = 0; ··· 387 336 ahc_pci_map_registers(struct ahc_softc *ahc) 388 337 { 389 338 uint32_t command; 390 - u_long base; 339 + resource_size_t base; 391 340 uint8_t __iomem *maddr; 392 341 int error; 393 342 ··· 425 374 } else 426 375 command |= PCIM_CMD_MEMEN; 427 376 } else { 428 - printf("aic7xxx: PCI%d:%d:%d MEM region 0x%lx " 377 + printf("aic7xxx: PCI%d:%d:%d MEM region 0x%llx " 429 378 "unavailable. Cannot memory map device.\n", 430 379 ahc_get_pci_bus(ahc->dev_softc), 431 380 ahc_get_pci_slot(ahc->dev_softc), 432 381 ahc_get_pci_function(ahc->dev_softc), 433 - base); 382 + (unsigned long long)base); 434 383 } 435 384 436 385 /* ··· 441 390 error = ahc_linux_pci_reserve_io_region(ahc, &base); 442 391 if (error == 0) { 443 392 ahc->tag = BUS_SPACE_PIO; 444 - ahc->bsh.ioport = base; 393 + ahc->bsh.ioport = (u_long)base; 445 394 command |= PCIM_CMD_PORTEN; 446 395 } else { 447 - printf("aic7xxx: PCI%d:%d:%d IO region 0x%lx[0..255] " 396 + printf("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] " 448 397 "unavailable. Cannot map device.\n", 449 398 ahc_get_pci_bus(ahc->dev_softc), 450 399 ahc_get_pci_slot(ahc->dev_softc), 451 400 ahc_get_pci_function(ahc->dev_softc), 452 - base); 401 + (unsigned long long)base); 453 402 } 454 403 } 455 404 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4);
+4 -5
drivers/scsi/aic7xxx/aic7xxx_pci.c
··· 168 168 static ahc_device_setup_t ahc_aha494XX_setup; 169 169 static ahc_device_setup_t ahc_aha398XX_setup; 170 170 171 - static struct ahc_pci_identity ahc_pci_ident_table [] = 172 - { 171 + static const struct ahc_pci_identity ahc_pci_ident_table[] = { 173 172 /* aic7850 based controllers */ 174 173 { 175 174 ID_AHA_2902_04_10_15_20C_30C, ··· 667 668 return (result); 668 669 } 669 670 670 - struct ahc_pci_identity * 671 + const struct ahc_pci_identity * 671 672 ahc_find_pci_device(ahc_dev_softc_t pci) 672 673 { 673 674 uint64_t full_id; ··· 675 676 uint16_t vendor; 676 677 uint16_t subdevice; 677 678 uint16_t subvendor; 678 - struct ahc_pci_identity *entry; 679 + const struct ahc_pci_identity *entry; 679 680 u_int i; 680 681 681 682 vendor = ahc_pci_read_config(pci, PCIR_DEVVENDOR, /*bytes*/2); ··· 709 710 } 710 711 711 712 int 712 - ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry) 713 + ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) 713 714 { 714 715 u_int command; 715 716 u_int our_id;
+2 -2
drivers/scsi/aic7xxx/aic7xxx_proc.c
··· 58 58 * Table of syncrates that don't follow the "divisible by 4" 59 59 * rule. This table will be expanded in future SCSI specs. 60 60 */ 61 - static struct { 61 + static const struct { 62 62 u_int period_factor; 63 63 u_int period; /* in 100ths of ns */ 64 64 } scsi_syncrates[] = { ··· 137 137 return (len); 138 138 } 139 139 140 - void 140 + static void 141 141 ahc_format_transinfo(struct info_str *info, struct ahc_transinfo *tinfo) 142 142 { 143 143 u_int speed;
+65 -168
drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped
··· 8 8 9 9 #include "aic7xxx_osm.h" 10 10 11 - static ahc_reg_parse_entry_t SCSISEQ_parse_table[] = { 11 + static const ahc_reg_parse_entry_t SCSISEQ_parse_table[] = { 12 12 { "SCSIRSTO", 0x01, 0x01 }, 13 13 { "ENAUTOATNP", 0x02, 0x02 }, 14 14 { "ENAUTOATNI", 0x04, 0x04 }, ··· 26 26 0x00, regvalue, cur_col, wrap)); 27 27 } 28 28 29 - static ahc_reg_parse_entry_t SXFRCTL0_parse_table[] = { 29 + static const ahc_reg_parse_entry_t SXFRCTL0_parse_table[] = { 30 30 { "CLRCHN", 0x02, 0x02 }, 31 31 { "SCAMEN", 0x04, 0x04 }, 32 32 { "SPIOEN", 0x08, 0x08 }, ··· 43 43 0x01, regvalue, cur_col, wrap)); 44 44 } 45 45 46 - static ahc_reg_parse_entry_t SXFRCTL1_parse_table[] = { 46 + static const ahc_reg_parse_entry_t SXFRCTL1_parse_table[] = { 47 47 { "STPWEN", 0x01, 0x01 }, 48 48 { "ACTNEGEN", 0x02, 0x02 }, 49 49 { "ENSTIMER", 0x04, 0x04 }, ··· 60 60 0x02, regvalue, cur_col, wrap)); 61 61 } 62 62 63 - static ahc_reg_parse_entry_t SCSISIGO_parse_table[] = { 63 + static const ahc_reg_parse_entry_t SCSISIGO_parse_table[] = { 64 64 { "ACKO", 0x01, 0x01 }, 65 65 { "REQO", 0x02, 0x02 }, 66 66 { "BSYO", 0x04, 0x04 }, ··· 85 85 0x03, regvalue, cur_col, wrap)); 86 86 } 87 87 88 - static ahc_reg_parse_entry_t SCSISIGI_parse_table[] = { 88 + static const ahc_reg_parse_entry_t SCSISIGI_parse_table[] = { 89 89 { "ACKI", 0x01, 0x01 }, 90 90 { "REQI", 0x02, 0x02 }, 91 91 { "BSYI", 0x04, 0x04 }, ··· 112 112 0x03, regvalue, cur_col, wrap)); 113 113 } 114 114 115 - static ahc_reg_parse_entry_t SCSIRATE_parse_table[] = { 115 + static const ahc_reg_parse_entry_t SCSIRATE_parse_table[] = { 116 116 { "SINGLE_EDGE", 0x10, 0x10 }, 117 117 { "ENABLE_CRC", 0x40, 0x40 }, 118 118 { "WIDEXFER", 0x80, 0x80 }, ··· 128 128 0x04, regvalue, cur_col, wrap)); 129 129 } 130 130 131 - static ahc_reg_parse_entry_t SCSIID_parse_table[] = { 131 + static const ahc_reg_parse_entry_t SCSIID_parse_table[] = { 132 132 { "TWIN_CHNLB", 0x80, 0x80 }, 133 133 { "OID", 0x0f, 0x0f }, 134 134 { "TWIN_TID", 0x70, 0x70 }, ··· 151 151 } 152 152 153 153 int 154 - ahc_scsidath_print(u_int regvalue, u_int *cur_col, u_int wrap) 155 - { 156 - return (ahc_print_register(NULL, 0, "SCSIDATH", 157 - 0x07, regvalue, cur_col, wrap)); 158 - } 159 - 160 - int 161 154 ahc_stcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 162 155 { 163 156 return (ahc_print_register(NULL, 0, "STCNT", 164 157 0x08, regvalue, cur_col, wrap)); 165 158 } 166 159 167 - static ahc_reg_parse_entry_t OPTIONMODE_parse_table[] = { 160 + static const ahc_reg_parse_entry_t OPTIONMODE_parse_table[] = { 168 161 { "DIS_MSGIN_DUALEDGE", 0x01, 0x01 }, 169 162 { "AUTO_MSGOUT_DE", 0x02, 0x02 }, 170 163 { "SCSIDATL_IMGEN", 0x04, 0x04 }, ··· 183 190 0x0a, regvalue, cur_col, wrap)); 184 191 } 185 192 186 - static ahc_reg_parse_entry_t CLRSINT0_parse_table[] = { 193 + static const ahc_reg_parse_entry_t CLRSINT0_parse_table[] = { 187 194 { "CLRSPIORDY", 0x02, 0x02 }, 188 195 { "CLRSWRAP", 0x08, 0x08 }, 189 196 { "CLRIOERR", 0x08, 0x08 }, ··· 199 206 0x0b, regvalue, cur_col, wrap)); 200 207 } 201 208 202 - static ahc_reg_parse_entry_t SSTAT0_parse_table[] = { 209 + static const ahc_reg_parse_entry_t SSTAT0_parse_table[] = { 203 210 { "DMADONE", 0x01, 0x01 }, 204 211 { "SPIORDY", 0x02, 0x02 }, 205 212 { "SDONE", 0x04, 0x04 }, ··· 218 225 0x0b, regvalue, cur_col, wrap)); 219 226 } 220 227 221 - static ahc_reg_parse_entry_t CLRSINT1_parse_table[] = { 228 + static const ahc_reg_parse_entry_t CLRSINT1_parse_table[] = { 222 229 { "CLRREQINIT", 0x01, 0x01 }, 223 230 { "CLRPHASECHG", 0x02, 0x02 }, 224 231 { "CLRSCSIPERR", 0x04, 0x04 }, ··· 235 242 0x0c, regvalue, cur_col, wrap)); 236 243 } 237 244 238 - static ahc_reg_parse_entry_t SSTAT1_parse_table[] = { 245 + static const ahc_reg_parse_entry_t SSTAT1_parse_table[] = { 239 246 { "REQINIT", 0x01, 0x01 }, 240 247 { "PHASECHG", 0x02, 0x02 }, 241 248 { "SCSIPERR", 0x04, 0x04 }, ··· 253 260 0x0c, regvalue, cur_col, wrap)); 254 261 } 255 262 256 - static ahc_reg_parse_entry_t SSTAT2_parse_table[] = { 263 + static const ahc_reg_parse_entry_t SSTAT2_parse_table[] = { 257 264 { "DUAL_EDGE_ERR", 0x01, 0x01 }, 258 265 { "CRCREQERR", 0x02, 0x02 }, 259 266 { "CRCENDERR", 0x04, 0x04 }, ··· 271 278 0x0d, regvalue, cur_col, wrap)); 272 279 } 273 280 274 - static ahc_reg_parse_entry_t SSTAT3_parse_table[] = { 281 + static const ahc_reg_parse_entry_t SSTAT3_parse_table[] = { 275 282 { "OFFCNT", 0x0f, 0x0f }, 276 283 { "U2OFFCNT", 0x7f, 0x7f }, 277 284 { "SCSICNT", 0xf0, 0xf0 } ··· 284 291 0x0e, regvalue, cur_col, wrap)); 285 292 } 286 293 287 - static ahc_reg_parse_entry_t SCSIID_ULTRA2_parse_table[] = { 294 + static const ahc_reg_parse_entry_t SCSIID_ULTRA2_parse_table[] = { 288 295 { "OID", 0x0f, 0x0f }, 289 296 { "TID", 0xf0, 0xf0 } 290 297 }; ··· 296 303 0x0f, regvalue, cur_col, wrap)); 297 304 } 298 305 299 - static ahc_reg_parse_entry_t SIMODE0_parse_table[] = { 306 + static const ahc_reg_parse_entry_t SIMODE0_parse_table[] = { 300 307 { "ENDMADONE", 0x01, 0x01 }, 301 308 { "ENSPIORDY", 0x02, 0x02 }, 302 309 { "ENSDONE", 0x04, 0x04 }, ··· 314 321 0x10, regvalue, cur_col, wrap)); 315 322 } 316 323 317 - static ahc_reg_parse_entry_t SIMODE1_parse_table[] = { 324 + static const ahc_reg_parse_entry_t SIMODE1_parse_table[] = { 318 325 { "ENREQINIT", 0x01, 0x01 }, 319 326 { "ENPHASECHG", 0x02, 0x02 }, 320 327 { "ENSCSIPERR", 0x04, 0x04 }, ··· 340 347 } 341 348 342 349 int 343 - ahc_scsibush_print(u_int regvalue, u_int *cur_col, u_int wrap) 344 - { 345 - return (ahc_print_register(NULL, 0, "SCSIBUSH", 346 - 0x13, regvalue, cur_col, wrap)); 347 - } 348 - 349 - static ahc_reg_parse_entry_t SXFRCTL2_parse_table[] = { 350 - { "CMDDMAEN", 0x08, 0x08 }, 351 - { "AUTORSTDIS", 0x10, 0x10 }, 352 - { "ASYNC_SETUP", 0x07, 0x07 } 353 - }; 354 - 355 - int 356 - ahc_sxfrctl2_print(u_int regvalue, u_int *cur_col, u_int wrap) 357 - { 358 - return (ahc_print_register(SXFRCTL2_parse_table, 3, "SXFRCTL2", 359 - 0x13, regvalue, cur_col, wrap)); 360 - } 361 - 362 - int 363 350 ahc_shaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 364 351 { 365 352 return (ahc_print_register(NULL, 0, "SHADDR", 366 353 0x14, regvalue, cur_col, wrap)); 367 354 } 368 355 369 - static ahc_reg_parse_entry_t SELTIMER_parse_table[] = { 356 + static const ahc_reg_parse_entry_t SELTIMER_parse_table[] = { 370 357 { "STAGE1", 0x01, 0x01 }, 371 358 { "STAGE2", 0x02, 0x02 }, 372 359 { "STAGE3", 0x04, 0x04 }, ··· 362 389 0x18, regvalue, cur_col, wrap)); 363 390 } 364 391 365 - static ahc_reg_parse_entry_t SELID_parse_table[] = { 392 + static const ahc_reg_parse_entry_t SELID_parse_table[] = { 366 393 { "ONEBIT", 0x08, 0x08 }, 367 394 { "SELID_MASK", 0xf0, 0xf0 } 368 395 }; ··· 374 401 0x19, regvalue, cur_col, wrap)); 375 402 } 376 403 377 - static ahc_reg_parse_entry_t SCAMCTL_parse_table[] = { 378 - { "DFLTTID", 0x10, 0x10 }, 379 - { "ALTSTIM", 0x20, 0x20 }, 380 - { "CLRSCAMSELID", 0x40, 0x40 }, 381 - { "ENSCAMSELO", 0x80, 0x80 }, 382 - { "SCAMLVL", 0x03, 0x03 } 383 - }; 384 - 385 - int 386 - ahc_scamctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 387 - { 388 - return (ahc_print_register(SCAMCTL_parse_table, 5, "SCAMCTL", 389 - 0x1a, regvalue, cur_col, wrap)); 390 - } 391 - 392 404 int 393 405 ahc_targid_print(u_int regvalue, u_int *cur_col, u_int wrap) 394 406 { ··· 381 423 0x1b, regvalue, cur_col, wrap)); 382 424 } 383 425 384 - static ahc_reg_parse_entry_t SPIOCAP_parse_table[] = { 426 + static const ahc_reg_parse_entry_t SPIOCAP_parse_table[] = { 385 427 { "SSPIOCPS", 0x01, 0x01 }, 386 428 { "ROM", 0x02, 0x02 }, 387 429 { "EEPROM", 0x04, 0x04 }, ··· 399 441 0x1b, regvalue, cur_col, wrap)); 400 442 } 401 443 402 - static ahc_reg_parse_entry_t BRDCTL_parse_table[] = { 444 + static const ahc_reg_parse_entry_t BRDCTL_parse_table[] = { 403 445 { "BRDCTL0", 0x01, 0x01 }, 404 446 { "BRDSTB_ULTRA2", 0x01, 0x01 }, 405 447 { "BRDCTL1", 0x02, 0x02 }, ··· 422 464 0x1d, regvalue, cur_col, wrap)); 423 465 } 424 466 425 - static ahc_reg_parse_entry_t SEECTL_parse_table[] = { 467 + static const ahc_reg_parse_entry_t SEECTL_parse_table[] = { 426 468 { "SEEDI", 0x01, 0x01 }, 427 469 { "SEEDO", 0x02, 0x02 }, 428 470 { "SEECK", 0x04, 0x04 }, ··· 440 482 0x1e, regvalue, cur_col, wrap)); 441 483 } 442 484 443 - static ahc_reg_parse_entry_t SBLKCTL_parse_table[] = { 485 + static const ahc_reg_parse_entry_t SBLKCTL_parse_table[] = { 444 486 { "XCVR", 0x01, 0x01 }, 445 487 { "SELWIDE", 0x02, 0x02 }, 446 488 { "ENAB20", 0x04, 0x04 }, ··· 480 522 } 481 523 482 524 int 483 - ahc_cmdsize_table_tail_print(u_int regvalue, u_int *cur_col, u_int wrap) 484 - { 485 - return (ahc_print_register(NULL, 0, "CMDSIZE_TABLE_TAIL", 486 - 0x34, regvalue, cur_col, wrap)); 487 - } 488 - 489 - int 490 525 ahc_mwi_residual_print(u_int regvalue, u_int *cur_col, u_int wrap) 491 526 { 492 527 return (ahc_print_register(NULL, 0, "MWI_RESIDUAL", ··· 500 549 0x3a, regvalue, cur_col, wrap)); 501 550 } 502 551 503 - static ahc_reg_parse_entry_t DMAPARAMS_parse_table[] = { 552 + static const ahc_reg_parse_entry_t DMAPARAMS_parse_table[] = { 504 553 { "FIFORESET", 0x01, 0x01 }, 505 554 { "FIFOFLUSH", 0x02, 0x02 }, 506 555 { "DIRECTION", 0x04, 0x04 }, ··· 520 569 0x3b, regvalue, cur_col, wrap)); 521 570 } 522 571 523 - static ahc_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { 572 + static const ahc_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { 524 573 { "NO_DISCONNECT", 0x01, 0x01 }, 525 574 { "SPHASE_PENDING", 0x02, 0x02 }, 526 575 { "DPHASE_PENDING", 0x04, 0x04 }, ··· 553 602 0x3e, regvalue, cur_col, wrap)); 554 603 } 555 604 556 - static ahc_reg_parse_entry_t LASTPHASE_parse_table[] = { 605 + static const ahc_reg_parse_entry_t LASTPHASE_parse_table[] = { 557 606 { "MSGI", 0x20, 0x20 }, 558 607 { "IOI", 0x40, 0x40 }, 559 608 { "CDI", 0x80, 0x80 }, ··· 593 642 { 594 643 return (ahc_print_register(NULL, 0, "FREE_SCBH", 595 644 0x42, regvalue, cur_col, wrap)); 596 - } 597 - 598 - int 599 - ahc_complete_scbh_print(u_int regvalue, u_int *cur_col, u_int wrap) 600 - { 601 - return (ahc_print_register(NULL, 0, "COMPLETE_SCBH", 602 - 0x43, regvalue, cur_col, wrap)); 603 645 } 604 646 605 647 int ··· 644 700 0x50, regvalue, cur_col, wrap)); 645 701 } 646 702 647 - static ahc_reg_parse_entry_t ARG_1_parse_table[] = { 703 + static const ahc_reg_parse_entry_t ARG_1_parse_table[] = { 648 704 { "CONT_TARG_SESSION", 0x02, 0x02 }, 649 705 { "CONT_MSG_LOOP", 0x04, 0x04 }, 650 706 { "EXIT_MSG_LOOP", 0x08, 0x08 }, ··· 675 731 0x53, regvalue, cur_col, wrap)); 676 732 } 677 733 678 - static ahc_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { 734 + static const ahc_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { 679 735 { "ENAUTOATNP", 0x02, 0x02 }, 680 736 { "ENAUTOATNI", 0x04, 0x04 }, 681 737 { "ENAUTOATNO", 0x08, 0x08 }, ··· 691 747 0x54, regvalue, cur_col, wrap)); 692 748 } 693 749 694 - static ahc_reg_parse_entry_t HA_274_BIOSGLOBAL_parse_table[] = { 750 + static const ahc_reg_parse_entry_t HA_274_BIOSGLOBAL_parse_table[] = { 695 751 { "HA_274_EXTENDED_TRANS",0x01, 0x01 } 696 752 }; 697 753 ··· 702 758 0x56, regvalue, cur_col, wrap)); 703 759 } 704 760 705 - static ahc_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { 761 + static const ahc_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { 706 762 { "SCB_DMA", 0x01, 0x01 }, 707 763 { "TARGET_MSG_PENDING", 0x02, 0x02 } 708 764 }; ··· 714 770 0x57, regvalue, cur_col, wrap)); 715 771 } 716 772 717 - static ahc_reg_parse_entry_t SCSICONF_parse_table[] = { 773 + static const ahc_reg_parse_entry_t SCSICONF_parse_table[] = { 718 774 { "ENSPCHK", 0x20, 0x20 }, 719 775 { "RESET_SCSI", 0x40, 0x40 }, 720 776 { "TERM_ENB", 0x80, 0x80 }, ··· 729 785 0x5a, regvalue, cur_col, wrap)); 730 786 } 731 787 732 - static ahc_reg_parse_entry_t INTDEF_parse_table[] = { 788 + static const ahc_reg_parse_entry_t INTDEF_parse_table[] = { 733 789 { "EDGE_TRIG", 0x80, 0x80 }, 734 790 { "VECTOR", 0x0f, 0x0f } 735 791 }; ··· 748 804 0x5d, regvalue, cur_col, wrap)); 749 805 } 750 806 751 - static ahc_reg_parse_entry_t HA_274_BIOSCTRL_parse_table[] = { 807 + static const ahc_reg_parse_entry_t HA_274_BIOSCTRL_parse_table[] = { 752 808 { "CHANNEL_B_PRIMARY", 0x08, 0x08 }, 753 809 { "BIOSMODE", 0x30, 0x30 }, 754 810 { "BIOSDISABLED", 0x30, 0x30 } ··· 761 817 0x5f, regvalue, cur_col, wrap)); 762 818 } 763 819 764 - static ahc_reg_parse_entry_t SEQCTL_parse_table[] = { 820 + static const ahc_reg_parse_entry_t SEQCTL_parse_table[] = { 765 821 { "LOADRAM", 0x01, 0x01 }, 766 822 { "SEQRESET", 0x02, 0x02 }, 767 823 { "STEP", 0x04, 0x04 }, ··· 793 849 0x62, regvalue, cur_col, wrap)); 794 850 } 795 851 796 - static ahc_reg_parse_entry_t SEQADDR1_parse_table[] = { 852 + static const ahc_reg_parse_entry_t SEQADDR1_parse_table[] = { 797 853 { "SEQADDR1_MASK", 0x01, 0x01 } 798 854 }; 799 855 ··· 846 902 0x6a, regvalue, cur_col, wrap)); 847 903 } 848 904 849 - static ahc_reg_parse_entry_t FLAGS_parse_table[] = { 905 + static const ahc_reg_parse_entry_t FLAGS_parse_table[] = { 850 906 { "CARRY", 0x01, 0x01 }, 851 907 { "ZERO", 0x02, 0x02 } 852 908 }; ··· 873 929 } 874 930 875 931 int 876 - ahc_function1_print(u_int regvalue, u_int *cur_col, u_int wrap) 877 - { 878 - return (ahc_print_register(NULL, 0, "FUNCTION1", 879 - 0x6e, regvalue, cur_col, wrap)); 880 - } 881 - 882 - int 883 932 ahc_stack_print(u_int regvalue, u_int *cur_col, u_int wrap) 884 933 { 885 934 return (ahc_print_register(NULL, 0, "STACK", ··· 893 956 0x70, regvalue, cur_col, wrap)); 894 957 } 895 958 896 - static ahc_reg_parse_entry_t BCTL_parse_table[] = { 897 - { "ENABLE", 0x01, 0x01 }, 898 - { "ACE", 0x08, 0x08 } 899 - }; 900 - 901 - int 902 - ahc_bctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 903 - { 904 - return (ahc_print_register(BCTL_parse_table, 2, "BCTL", 905 - 0x84, regvalue, cur_col, wrap)); 906 - } 907 - 908 - static ahc_reg_parse_entry_t DSCOMMAND0_parse_table[] = { 959 + static const ahc_reg_parse_entry_t DSCOMMAND0_parse_table[] = { 909 960 { "CIOPARCKEN", 0x01, 0x01 }, 910 961 { "USCBSIZE32", 0x02, 0x02 }, 911 962 { "RAMPS", 0x04, 0x04 }, ··· 911 986 0x84, regvalue, cur_col, wrap)); 912 987 } 913 988 914 - static ahc_reg_parse_entry_t BUSTIME_parse_table[] = { 989 + static const ahc_reg_parse_entry_t BUSTIME_parse_table[] = { 915 990 { "BON", 0x0f, 0x0f }, 916 991 { "BOFF", 0xf0, 0xf0 } 917 992 }; ··· 923 998 0x85, regvalue, cur_col, wrap)); 924 999 } 925 1000 926 - static ahc_reg_parse_entry_t DSCOMMAND1_parse_table[] = { 1001 + static const ahc_reg_parse_entry_t DSCOMMAND1_parse_table[] = { 927 1002 { "HADDLDSEL0", 0x01, 0x01 }, 928 1003 { "HADDLDSEL1", 0x02, 0x02 }, 929 1004 { "DSLATT", 0xfc, 0xfc } ··· 936 1011 0x85, regvalue, cur_col, wrap)); 937 1012 } 938 1013 939 - static ahc_reg_parse_entry_t BUSSPD_parse_table[] = { 1014 + static const ahc_reg_parse_entry_t BUSSPD_parse_table[] = { 940 1015 { "STBON", 0x07, 0x07 }, 941 1016 { "STBOFF", 0x38, 0x38 }, 942 1017 { "DFTHRSH_75", 0x80, 0x80 }, ··· 951 1026 0x86, regvalue, cur_col, wrap)); 952 1027 } 953 1028 954 - static ahc_reg_parse_entry_t HS_MAILBOX_parse_table[] = { 1029 + static const ahc_reg_parse_entry_t HS_MAILBOX_parse_table[] = { 955 1030 { "SEQ_MAILBOX", 0x0f, 0x0f }, 956 1031 { "HOST_TQINPOS", 0x80, 0x80 }, 957 1032 { "HOST_MAILBOX", 0xf0, 0xf0 } ··· 964 1039 0x86, regvalue, cur_col, wrap)); 965 1040 } 966 1041 967 - static ahc_reg_parse_entry_t DSPCISTATUS_parse_table[] = { 1042 + static const ahc_reg_parse_entry_t DSPCISTATUS_parse_table[] = { 968 1043 { "DFTHRSH_100", 0xc0, 0xc0 } 969 1044 }; 970 1045 ··· 975 1050 0x86, regvalue, cur_col, wrap)); 976 1051 } 977 1052 978 - static ahc_reg_parse_entry_t HCNTRL_parse_table[] = { 1053 + static const ahc_reg_parse_entry_t HCNTRL_parse_table[] = { 979 1054 { "CHIPRST", 0x01, 0x01 }, 980 1055 { "CHIPRSTACK", 0x01, 0x01 }, 981 1056 { "INTEN", 0x02, 0x02 }, ··· 1013 1088 0x90, regvalue, cur_col, wrap)); 1014 1089 } 1015 1090 1016 - static ahc_reg_parse_entry_t INTSTAT_parse_table[] = { 1091 + static const ahc_reg_parse_entry_t INTSTAT_parse_table[] = { 1017 1092 { "SEQINT", 0x01, 0x01 }, 1018 1093 { "CMDCMPLT", 0x02, 0x02 }, 1019 1094 { "SCSIINT", 0x04, 0x04 }, ··· 1044 1119 0x91, regvalue, cur_col, wrap)); 1045 1120 } 1046 1121 1047 - static ahc_reg_parse_entry_t CLRINT_parse_table[] = { 1122 + static const ahc_reg_parse_entry_t CLRINT_parse_table[] = { 1048 1123 { "CLRSEQINT", 0x01, 0x01 }, 1049 1124 { "CLRCMDINT", 0x02, 0x02 }, 1050 1125 { "CLRSCSIINT", 0x04, 0x04 }, ··· 1059 1134 0x92, regvalue, cur_col, wrap)); 1060 1135 } 1061 1136 1062 - static ahc_reg_parse_entry_t ERROR_parse_table[] = { 1137 + static const ahc_reg_parse_entry_t ERROR_parse_table[] = { 1063 1138 { "ILLHADDR", 0x01, 0x01 }, 1064 1139 { "ILLSADDR", 0x02, 0x02 }, 1065 1140 { "ILLOPCODE", 0x04, 0x04 }, ··· 1077 1152 0x92, regvalue, cur_col, wrap)); 1078 1153 } 1079 1154 1080 - static ahc_reg_parse_entry_t DFCNTRL_parse_table[] = { 1155 + static const ahc_reg_parse_entry_t DFCNTRL_parse_table[] = { 1081 1156 { "FIFORESET", 0x01, 0x01 }, 1082 1157 { "FIFOFLUSH", 0x02, 0x02 }, 1083 1158 { "DIRECTION", 0x04, 0x04 }, ··· 1097 1172 0x93, regvalue, cur_col, wrap)); 1098 1173 } 1099 1174 1100 - static ahc_reg_parse_entry_t DFSTATUS_parse_table[] = { 1175 + static const ahc_reg_parse_entry_t DFSTATUS_parse_table[] = { 1101 1176 { "FIFOEMP", 0x01, 0x01 }, 1102 1177 { "FIFOFULL", 0x02, 0x02 }, 1103 1178 { "DFTHRESH", 0x04, 0x04 }, ··· 1123 1198 } 1124 1199 1125 1200 int 1126 - ahc_dfraddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1127 - { 1128 - return (ahc_print_register(NULL, 0, "DFRADDR", 1129 - 0x97, regvalue, cur_col, wrap)); 1130 - } 1131 - 1132 - int 1133 1201 ahc_dfdat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1134 1202 { 1135 1203 return (ahc_print_register(NULL, 0, "DFDAT", 1136 1204 0x99, regvalue, cur_col, wrap)); 1137 1205 } 1138 1206 1139 - static ahc_reg_parse_entry_t SCBCNT_parse_table[] = { 1207 + static const ahc_reg_parse_entry_t SCBCNT_parse_table[] = { 1140 1208 { "SCBAUTO", 0x80, 0x80 }, 1141 1209 { "SCBCNT_MASK", 0x1f, 0x1f } 1142 1210 }; ··· 1149 1231 } 1150 1232 1151 1233 int 1152 - ahc_qincnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1153 - { 1154 - return (ahc_print_register(NULL, 0, "QINCNT", 1155 - 0x9c, regvalue, cur_col, wrap)); 1156 - } 1157 - 1158 - int 1159 1234 ahc_qoutfifo_print(u_int regvalue, u_int *cur_col, u_int wrap) 1160 1235 { 1161 1236 return (ahc_print_register(NULL, 0, "QOUTFIFO", 1162 1237 0x9d, regvalue, cur_col, wrap)); 1163 1238 } 1164 1239 1165 - static ahc_reg_parse_entry_t CRCCONTROL1_parse_table[] = { 1240 + static const ahc_reg_parse_entry_t CRCCONTROL1_parse_table[] = { 1166 1241 { "TARGCRCCNTEN", 0x04, 0x04 }, 1167 1242 { "TARGCRCENDEN", 0x08, 0x08 }, 1168 1243 { "CRCREQCHKEN", 0x10, 0x10 }, ··· 1171 1260 0x9d, regvalue, cur_col, wrap)); 1172 1261 } 1173 1262 1174 - int 1175 - ahc_qoutcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1176 - { 1177 - return (ahc_print_register(NULL, 0, "QOUTCNT", 1178 - 0x9e, regvalue, cur_col, wrap)); 1179 - } 1180 - 1181 - static ahc_reg_parse_entry_t SCSIPHASE_parse_table[] = { 1263 + static const ahc_reg_parse_entry_t SCSIPHASE_parse_table[] = { 1182 1264 { "DATA_OUT_PHASE", 0x01, 0x01 }, 1183 1265 { "DATA_IN_PHASE", 0x02, 0x02 }, 1184 1266 { "MSG_OUT_PHASE", 0x04, 0x04 }, ··· 1188 1284 0x9e, regvalue, cur_col, wrap)); 1189 1285 } 1190 1286 1191 - static ahc_reg_parse_entry_t SFUNCT_parse_table[] = { 1287 + static const ahc_reg_parse_entry_t SFUNCT_parse_table[] = { 1192 1288 { "ALT_MODE", 0x80, 0x80 } 1193 1289 }; 1194 1290 ··· 1255 1351 0xac, regvalue, cur_col, wrap)); 1256 1352 } 1257 1353 1258 - static ahc_reg_parse_entry_t SCB_DATACNT_parse_table[] = { 1354 + static const ahc_reg_parse_entry_t SCB_DATACNT_parse_table[] = { 1259 1355 { "SG_LAST_SEG", 0x80, 0x80 }, 1260 1356 { "SG_HIGH_ADDR_BITS", 0x7f, 0x7f } 1261 1357 }; ··· 1267 1363 0xb0, regvalue, cur_col, wrap)); 1268 1364 } 1269 1365 1270 - static ahc_reg_parse_entry_t SCB_SGPTR_parse_table[] = { 1366 + static const ahc_reg_parse_entry_t SCB_SGPTR_parse_table[] = { 1271 1367 { "SG_LIST_NULL", 0x01, 0x01 }, 1272 1368 { "SG_FULL_RESID", 0x02, 0x02 }, 1273 1369 { "SG_RESID_VALID", 0x04, 0x04 } ··· 1280 1376 0xb4, regvalue, cur_col, wrap)); 1281 1377 } 1282 1378 1283 - static ahc_reg_parse_entry_t SCB_CONTROL_parse_table[] = { 1379 + static const ahc_reg_parse_entry_t SCB_CONTROL_parse_table[] = { 1284 1380 { "DISCONNECTED", 0x04, 0x04 }, 1285 1381 { "ULTRAENB", 0x08, 0x08 }, 1286 1382 { "MK_MESSAGE", 0x10, 0x10 }, ··· 1298 1394 0xb8, regvalue, cur_col, wrap)); 1299 1395 } 1300 1396 1301 - static ahc_reg_parse_entry_t SCB_SCSIID_parse_table[] = { 1397 + static const ahc_reg_parse_entry_t SCB_SCSIID_parse_table[] = { 1302 1398 { "TWIN_CHNLB", 0x80, 0x80 }, 1303 1399 { "OID", 0x0f, 0x0f }, 1304 1400 { "TWIN_TID", 0x70, 0x70 }, ··· 1312 1408 0xb9, regvalue, cur_col, wrap)); 1313 1409 } 1314 1410 1315 - static ahc_reg_parse_entry_t SCB_LUN_parse_table[] = { 1411 + static const ahc_reg_parse_entry_t SCB_LUN_parse_table[] = { 1316 1412 { "SCB_XFERLEN_ODD", 0x80, 0x80 }, 1317 1413 { "LID", 0x3f, 0x3f } 1318 1414 }; ··· 1359 1455 0xbf, regvalue, cur_col, wrap)); 1360 1456 } 1361 1457 1362 - int 1363 - ahc_scb_64_spare_print(u_int regvalue, u_int *cur_col, u_int wrap) 1364 - { 1365 - return (ahc_print_register(NULL, 0, "SCB_64_SPARE", 1366 - 0xc0, regvalue, cur_col, wrap)); 1367 - } 1368 - 1369 - static ahc_reg_parse_entry_t SEECTL_2840_parse_table[] = { 1458 + static const ahc_reg_parse_entry_t SEECTL_2840_parse_table[] = { 1370 1459 { "DO_2840", 0x01, 0x01 }, 1371 1460 { "CK_2840", 0x02, 0x02 }, 1372 1461 { "CS_2840", 0x04, 0x04 } ··· 1372 1475 0xc0, regvalue, cur_col, wrap)); 1373 1476 } 1374 1477 1375 - static ahc_reg_parse_entry_t STATUS_2840_parse_table[] = { 1478 + static const ahc_reg_parse_entry_t STATUS_2840_parse_table[] = { 1376 1479 { "DI_2840", 0x01, 0x01 }, 1377 1480 { "EEPROM_TF", 0x80, 0x80 }, 1378 1481 { "ADSEL", 0x1e, 0x1e }, ··· 1421 1524 0xea, regvalue, cur_col, wrap)); 1422 1525 } 1423 1526 1424 - static ahc_reg_parse_entry_t CCSGCTL_parse_table[] = { 1527 + static const ahc_reg_parse_entry_t CCSGCTL_parse_table[] = { 1425 1528 { "CCSGRESET", 0x01, 0x01 }, 1426 1529 { "SG_FETCH_NEEDED", 0x02, 0x02 }, 1427 1530 { "CCSGEN", 0x08, 0x08 }, ··· 1449 1552 0xed, regvalue, cur_col, wrap)); 1450 1553 } 1451 1554 1452 - static ahc_reg_parse_entry_t CCSCBCTL_parse_table[] = { 1555 + static const ahc_reg_parse_entry_t CCSCBCTL_parse_table[] = { 1453 1556 { "CCSCBRESET", 0x01, 0x01 }, 1454 1557 { "CCSCBDIR", 0x04, 0x04 }, 1455 1558 { "CCSCBEN", 0x08, 0x08 }, ··· 1507 1610 0xf8, regvalue, cur_col, wrap)); 1508 1611 } 1509 1612 1510 - static ahc_reg_parse_entry_t QOFF_CTLSTA_parse_table[] = { 1613 + static const ahc_reg_parse_entry_t QOFF_CTLSTA_parse_table[] = { 1511 1614 { "SDSCB_ROLLOVER", 0x10, 0x10 }, 1512 1615 { "SNSCB_ROLLOVER", 0x20, 0x20 }, 1513 1616 { "SCB_AVAIL", 0x40, 0x40 }, ··· 1522 1625 0xfa, regvalue, cur_col, wrap)); 1523 1626 } 1524 1627 1525 - static ahc_reg_parse_entry_t DFF_THRSH_parse_table[] = { 1628 + static const ahc_reg_parse_entry_t DFF_THRSH_parse_table[] = { 1526 1629 { "RD_DFTHRSH_MIN", 0x00, 0x00 }, 1527 1630 { "WR_DFTHRSH_MIN", 0x00, 0x00 }, 1528 1631 { "RD_DFTHRSH_25", 0x01, 0x01 }, ··· 1550 1653 0xfb, regvalue, cur_col, wrap)); 1551 1654 } 1552 1655 1553 - static ahc_reg_parse_entry_t SG_CACHE_SHADOW_parse_table[] = { 1656 + static const ahc_reg_parse_entry_t SG_CACHE_SHADOW_parse_table[] = { 1554 1657 { "LAST_SEG_DONE", 0x01, 0x01 }, 1555 1658 { "LAST_SEG", 0x02, 0x02 }, 1556 1659 { "SG_ADDR_MASK", 0xf8, 0xf8 } ··· 1563 1666 0xfc, regvalue, cur_col, wrap)); 1564 1667 } 1565 1668 1566 - static ahc_reg_parse_entry_t SG_CACHE_PRE_parse_table[] = { 1669 + static const ahc_reg_parse_entry_t SG_CACHE_PRE_parse_table[] = { 1567 1670 { "LAST_SEG_DONE", 0x01, 0x01 }, 1568 1671 { "LAST_SEG", 0x02, 0x02 }, 1569 1672 { "SG_ADDR_MASK", 0xf8, 0xf8 }
+3 -3
drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped
··· 5 5 * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#58 $ 6 6 * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#40 $ 7 7 */ 8 - static uint8_t seqprog[] = { 8 + static const uint8_t seqprog[] = { 9 9 0xb2, 0x00, 0x00, 0x08, 10 10 0xf7, 0x11, 0x22, 0x08, 11 11 0x00, 0x65, 0xee, 0x59, ··· 1081 1081 return (0); 1082 1082 } 1083 1083 1084 - static struct patch { 1084 + static const struct patch { 1085 1085 ahc_patch_func_t *patch_func; 1086 1086 uint32_t begin :10, 1087 1087 skip_instr :10, ··· 1291 1291 { ahc_patch4_func, 865, 12, 1 } 1292 1292 }; 1293 1293 1294 - static struct cs { 1294 + static const struct cs { 1295 1295 uint16_t begin; 1296 1296 uint16_t end; 1297 1297 } critical_sections[] = {
+3 -3
drivers/scsi/aic7xxx/aicasm/aicasm.c
··· 362 362 " *\n" 363 363 "%s */\n", versions); 364 364 365 - fprintf(ofile, "static uint8_t seqprog[] = {\n"); 365 + fprintf(ofile, "static const uint8_t seqprog[] = {\n"); 366 366 for (cur_instr = STAILQ_FIRST(&seq_program); 367 367 cur_instr != NULL; 368 368 cur_instr = STAILQ_NEXT(cur_instr, links)) { ··· 415 415 } 416 416 417 417 fprintf(ofile, 418 - "static struct patch {\n" 418 + "static const struct patch {\n" 419 419 " %spatch_func_t *patch_func;\n" 420 420 " uint32_t begin :10,\n" 421 421 " skip_instr :10,\n" ··· 435 435 fprintf(ofile, "\n};\n\n"); 436 436 437 437 fprintf(ofile, 438 - "static struct cs {\n" 438 + "static const struct cs {\n" 439 439 " uint16_t begin;\n" 440 440 " uint16_t end;\n" 441 441 "} critical_sections[] = {\n");
+69 -36
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
··· 101 101 expression_t *immed, symbol_ref_t *address); 102 102 static void test_readable_symbol(symbol_t *symbol); 103 103 static void test_writable_symbol(symbol_t *symbol); 104 - static void type_check(symbol_t *symbol, expression_t *expression, int and_op); 104 + static void type_check(symbol_ref_t *sym, expression_t *expression, int and_op); 105 105 static void make_expression(expression_t *immed, int value); 106 106 static void add_conditional(symbol_t *symbol); 107 107 static void add_version(const char *verstring); 108 108 static int is_download_const(expression_t *immed); 109 + static int is_location_address(symbol_t *symbol); 109 110 void yyerror(const char *string); 110 111 111 112 #define SRAM_SYMNAME "SRAM_BASE" ··· 142 141 %token T_EXPR_RSHIFT 143 142 144 143 %token <value> T_ADDRESS 144 + 145 + %token T_COUNT 145 146 146 147 %token T_ACCESS_MODE 147 148 ··· 195 192 196 193 %token <value> T_OR 197 194 198 - /* 16 bit extensions */ 199 - %token <value> T_OR16 T_AND16 T_XOR16 T_ADD16 200 - %token <value> T_ADC16 T_MVI16 T_TEST16 T_CMP16 T_CMPXCHG 201 - 195 + /* 16 bit extensions, not implemented 196 + * %token <value> T_OR16 T_AND16 T_XOR16 T_ADD16 197 + * %token <value> T_ADC16 T_MVI16 T_TEST16 T_CMP16 T_CMPXCHG 198 + */ 202 199 %token T_RET 203 200 204 201 %token T_NOP ··· 217 214 218 215 %type <expression> expression immediate immediate_or_a 219 216 220 - %type <value> export ret f1_opcode f2_opcode f4_opcode jmp_jc_jnc_call jz_jnz je_jne 217 + %type <value> export ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne 221 218 222 219 %type <value> mode_value mode_list macro_arglist 223 220 ··· 316 313 stop("Register multiply defined", EX_DATAERR); 317 314 /* NOTREACHED */ 318 315 } 319 - cur_symbol = $1; 316 + cur_symbol = $1; 320 317 cur_symbol->type = cur_symtype; 321 318 initialize_symbol(cur_symbol); 322 319 } 323 320 reg_attribute_list 324 321 '}' 325 - { 322 + { 326 323 /* 327 324 * Default to allowing everything in for registers 328 325 * with no bit or mask definitions. ··· 352 349 | reg_attribute_list reg_attribute 353 350 ; 354 351 355 - reg_attribute: 352 + reg_attribute: 356 353 reg_address 357 354 | size 355 + | count 358 356 | access_mode 359 357 | modes 360 358 | field_defn ··· 393 389 if (sym_max_addr > max_addr) 394 390 stop("SCB or SRAM space exhausted", EX_DATAERR); 395 391 } 392 + } 393 + ; 394 + 395 + count: 396 + T_COUNT T_NUMBER 397 + { 398 + cur_symbol->count += $2; 396 399 } 397 400 ; 398 401 ··· 652 641 &($1.referenced_syms), 653 642 &($3.referenced_syms)); 654 643 } 655 - | expression T_EXPR_LSHIFT expression 644 + | expression T_EXPR_LSHIFT expression 656 645 { 657 646 $$.value = $1.value << $3.value; 658 647 symlist_merge(&$$.referenced_syms, 659 648 &$1.referenced_syms, 660 649 &$3.referenced_syms); 661 650 } 662 - | expression T_EXPR_RSHIFT expression 651 + | expression T_EXPR_RSHIFT expression 663 652 { 664 653 $$.value = $1.value >> $3.value; 665 654 symlist_merge(&$$.referenced_syms, ··· 725 714 ; 726 715 727 716 constant: 728 - T_CONST T_SYMBOL expression 717 + T_CONST T_SYMBOL expression 729 718 { 730 719 if ($2->type != UNINITIALIZED) { 731 720 stop("Re-definition of symbol as a constant", ··· 811 800 cur_symtype = SRAMLOC; 812 801 cur_symbol->type = SRAMLOC; 813 802 initialize_symbol(cur_symbol); 803 + cur_symbol->count += 1; 814 804 } 815 805 reg_address 816 806 { ··· 843 831 initialize_symbol(cur_symbol); 844 832 /* 64 bytes of SCB space */ 845 833 cur_symbol->info.rinfo->size = 64; 834 + cur_symbol->count += 1; 846 835 } 847 836 reg_address 848 837 { ··· 1324 1311 | T_ROR { $$ = AIC_OP_ROR; } 1325 1312 ; 1326 1313 1327 - f4_opcode: 1328 - T_OR16 { $$ = AIC_OP_OR16; } 1329 - | T_AND16 { $$ = AIC_OP_AND16; } 1330 - | T_XOR16 { $$ = AIC_OP_XOR16; } 1331 - | T_ADD16 { $$ = AIC_OP_ADD16; } 1332 - | T_ADC16 { $$ = AIC_OP_ADC16; } 1333 - | T_MVI16 { $$ = AIC_OP_MVI16; } 1334 - ; 1314 + /* 1315 + * 16bit opcodes, not used 1316 + * 1317 + *f4_opcode: 1318 + * T_OR16 { $$ = AIC_OP_OR16; } 1319 + *| T_AND16 { $$ = AIC_OP_AND16; } 1320 + *| T_XOR16 { $$ = AIC_OP_XOR16; } 1321 + *| T_ADD16 { $$ = AIC_OP_ADD16; } 1322 + *| T_ADC16 { $$ = AIC_OP_ADC16; } 1323 + *| T_MVI16 { $$ = AIC_OP_MVI16; } 1324 + *; 1325 + */ 1335 1326 1336 1327 code: 1337 1328 f2_opcode destination ',' expression opt_source ret ';' ··· 1374 1357 code: 1375 1358 T_OR reg_symbol ',' immediate jmp_jc_jnc_call address ';' 1376 1359 { 1360 + type_check(&$2, &$4, AIC_OP_OR); 1377 1361 format_3_instr($5, &$2, &$4, &$6); 1378 1362 } 1379 1363 ; ··· 1546 1528 sizeof(struct cond_info)); 1547 1529 break; 1548 1530 case MACRO: 1549 - symbol->info.macroinfo = 1531 + symbol->info.macroinfo = 1550 1532 (struct macro_info *)malloc(sizeof(struct macro_info)); 1551 1533 if (symbol->info.macroinfo == NULL) { 1552 1534 stop("Can't create macro info", EX_SOFTWARE); ··· 1570 1552 struct macro_arg *marg; 1571 1553 int i; 1572 1554 int retval; 1573 - 1574 1555 1575 1556 if (cur_symbol == NULL || cur_symbol->type != MACRO) { 1576 1557 stop("Invalid current symbol for adding macro arg", ··· 1650 1633 test_writable_symbol(dest->symbol); 1651 1634 test_readable_symbol(src->symbol); 1652 1635 1653 - /* Ensure that immediate makes sense for this destination */ 1654 - type_check(dest->symbol, immed, opcode); 1636 + if (!is_location_address(dest->symbol)) { 1637 + /* Ensure that immediate makes sense for this destination */ 1638 + type_check(dest, immed, opcode); 1639 + } 1655 1640 1656 1641 /* Allocate sequencer space for the instruction and fill it out */ 1657 1642 instr = seq_alloc(); ··· 1785 1766 /* Test register permissions */ 1786 1767 test_readable_symbol(src->symbol); 1787 1768 1788 - /* Ensure that immediate makes sense for this source */ 1789 - type_check(src->symbol, immed, opcode); 1790 - 1791 1769 /* Allocate sequencer space for the instruction and fill it out */ 1792 1770 instr = seq_alloc(); 1793 1771 f3_instr = &instr->format.format3; ··· 1813 1797 static void 1814 1798 test_readable_symbol(symbol_t *symbol) 1815 1799 { 1816 - 1817 1800 if ((symbol->info.rinfo->modes & (0x1 << src_mode)) == 0) { 1818 1801 snprintf(errbuf, sizeof(errbuf), 1819 1802 "Register %s unavailable in source reg mode %d", ··· 1830 1815 static void 1831 1816 test_writable_symbol(symbol_t *symbol) 1832 1817 { 1833 - 1834 1818 if ((symbol->info.rinfo->modes & (0x1 << dst_mode)) == 0) { 1835 1819 snprintf(errbuf, sizeof(errbuf), 1836 1820 "Register %s unavailable in destination reg mode %d", ··· 1845 1831 } 1846 1832 1847 1833 static void 1848 - type_check(symbol_t *symbol, expression_t *expression, int opcode) 1834 + type_check(symbol_ref_t *sym, expression_t *expression, int opcode) 1849 1835 { 1836 + symbol_t *symbol = sym->symbol; 1850 1837 symbol_node_t *node; 1851 1838 int and_op; 1839 + int8_t value, mask; 1852 1840 1853 1841 and_op = FALSE; 1854 - if (opcode == AIC_OP_AND || opcode == AIC_OP_JNZ || opcode == AIC_OP_JZ) 1855 - and_op = TRUE; 1856 - 1857 1842 /* 1858 1843 * Make sure that we aren't attempting to write something 1859 1844 * that hasn't been defined. If this is an and operation, 1860 1845 * this is a mask, so "undefined" bits are okay. 1861 1846 */ 1862 - if (and_op == FALSE 1863 - && (expression->value & ~symbol->info.rinfo->valid_bitmask) != 0) { 1847 + if (opcode == AIC_OP_AND || opcode == AIC_OP_JNZ || 1848 + opcode == AIC_OP_JZ || opcode == AIC_OP_JNE || 1849 + opcode == AIC_OP_BMOV) 1850 + and_op = TRUE; 1851 + 1852 + /* 1853 + * Defaulting to 8 bit logic 1854 + */ 1855 + mask = (int8_t)~symbol->info.rinfo->valid_bitmask; 1856 + value = (int8_t)expression->value; 1857 + 1858 + if (and_op == FALSE && (mask & value) != 0 ) { 1864 1859 snprintf(errbuf, sizeof(errbuf), 1865 1860 "Invalid bit(s) 0x%x in immediate written to %s", 1866 - expression->value & ~symbol->info.rinfo->valid_bitmask, 1861 + (mask & value), 1867 1862 symbol->name); 1868 1863 stop(errbuf, EX_DATAERR); 1869 1864 /* NOTREACHED */ ··· 1982 1959 1983 1960 return (FALSE); 1984 1961 } 1962 + 1963 + static int 1964 + is_location_address(symbol_t *sym) 1965 + { 1966 + if (sym->type == SCBLOC || 1967 + sym->type == SRAMLOC) 1968 + return (TRUE); 1969 + return (FALSE); 1970 + } 1971 +
+10 -9
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
··· 162 162 const { yylval.value = FALSE; return T_CONST; } 163 163 download { return T_DOWNLOAD; } 164 164 address { return T_ADDRESS; } 165 + count { return T_COUNT; } 165 166 access_mode { return T_ACCESS_MODE; } 166 167 modes { return T_MODES; } 167 168 RW|RO|WO { ··· 229 228 nop { return T_NOP; } 230 229 231 230 /* ARP2 16bit extensions */ 232 - or16 { return T_OR16; } 233 - and16 { return T_AND16; } 234 - xor16 { return T_XOR16; } 235 - add16 { return T_ADD16; } 236 - adc16 { return T_ADC16; } 237 - mvi16 { return T_MVI16; } 238 - test16 { return T_TEST16; } 239 - cmp16 { return T_CMP16; } 240 - cmpxchg { return T_CMPXCHG; } 231 + /* or16 { return T_OR16; } */ 232 + /* and16 { return T_AND16; }*/ 233 + /* xor16 { return T_XOR16; }*/ 234 + /* add16 { return T_ADD16; }*/ 235 + /* adc16 { return T_ADC16; }*/ 236 + /* mvi16 { return T_MVI16; }*/ 237 + /* test16 { return T_TEST16; }*/ 238 + /* cmp16 { return T_CMP16; }*/ 239 + /* cmpxchg { return T_CMPXCHG; }*/ 241 240 242 241 /* Allowed Symbols */ 243 242 \<\< { return T_EXPR_LSHIFT; }
+19 -6
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
··· 77 77 if (new_symbol->name == NULL) 78 78 stop("Unable to strdup symbol name", EX_SOFTWARE); 79 79 new_symbol->type = UNINITIALIZED; 80 + new_symbol->count = 1; 80 81 return (new_symbol); 81 82 } 82 83 ··· 199 198 } 200 199 } 201 200 memcpy(&stored_ptr, data.data, sizeof(stored_ptr)); 201 + stored_ptr->count++; 202 + data.data = &stored_ptr; 203 + if (symtable->put(symtable, &key, &data, /*flags*/0) !=0) { 204 + perror("Symtable put failed"); 205 + exit(EX_SOFTWARE); 206 + } 202 207 return (stored_ptr); 203 208 } 204 209 ··· 263 256 && (curnode->symbol->info.finfo->value > 264 257 newnode->symbol->info.finfo->value)))) 265 258 || (!field && (curnode->symbol->info.rinfo->address > 266 - newnode->symbol->info.rinfo->address))) { 259 + newnode->symbol->info.rinfo->address))) { 267 260 SLIST_INSERT_HEAD(symlist, newnode, links); 268 261 return; 269 262 } ··· 278 271 279 272 cursymbol = SLIST_NEXT(curnode, links)->symbol; 280 273 if ((field 281 - && (cursymbol->type > symbol->type 274 + && (cursymbol->type > symbol->type 282 275 || (cursymbol->type == symbol->type 283 276 && (cursymbol->info.finfo->value > 284 277 symbol->info.finfo->value)))) ··· 358 351 { 359 352 if (ofile == NULL) 360 353 return; 361 - 354 + 362 355 fprintf(ofile, 363 356 "typedef int (%sreg_print_t)(u_int, u_int *, u_int);\n" 364 357 "typedef struct %sreg_parse_entry {\n" ··· 377 370 return; 378 371 379 372 fprintf(dfile, 380 - "static %sreg_parse_entry_t %s_parse_table[] = {\n", 373 + "static const %sreg_parse_entry_t %s_parse_table[] = {\n", 381 374 prefix, 382 375 regnode->symbol->name); 383 376 } ··· 392 385 lower_name = strdup(regnode->symbol->name); 393 386 if (lower_name == NULL) 394 387 stop("Unable to strdup symbol name", EX_SOFTWARE); 395 - 388 + 396 389 for (letter = lower_name; *letter != '\0'; letter++) 397 390 *letter = tolower(*letter); 398 391 ··· 479 472 DBT key; 480 473 DBT data; 481 474 int flag; 475 + int reg_count = 0, reg_used = 0; 482 476 u_int i; 483 477 484 478 if (symtable == NULL) ··· 549 541 int num_entries; 550 542 551 543 num_entries = 0; 544 + reg_count++; 545 + if (curnode->symbol->count == 1) 546 + break; 552 547 fields = &curnode->symbol->info.rinfo->fields; 553 548 SLIST_FOREACH(fieldnode, fields, links) { 554 549 if (num_entries == 0) ··· 564 553 } 565 554 aic_print_reg_dump_end(ofile, dfile, 566 555 curnode, num_entries); 556 + reg_used++; 567 557 } 568 558 default: 569 559 break; 570 560 } 571 561 } 562 + fprintf(stderr, "%s: %d of %d register definitions used\n", appname, 563 + reg_used, reg_count); 572 564 573 565 /* Fold in the masks and bits */ 574 566 while (SLIST_FIRST(&masks) != NULL) { ··· 660 646 free(curnode); 661 647 } 662 648 663 - 664 649 fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); 665 650 666 651 for (i = 0; SLIST_FIRST(&download_constants) != NULL; i++) {
+1
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h
··· 128 128 typedef struct symbol { 129 129 char *name; 130 130 symtype type; 131 + int count; 131 132 union { 132 133 struct reg_info *rinfo; 133 134 struct field_info *finfo;
+4 -7
drivers/scsi/eata.c
··· 2286 2286 } 2287 2287 } 2288 2288 2289 - static irqreturn_t ihdlr(int irq, struct Scsi_Host *shost) 2289 + static irqreturn_t ihdlr(struct Scsi_Host *shost) 2290 2290 { 2291 2291 struct scsi_cmnd *SCpnt; 2292 2292 unsigned int i, k, c, status, tstatus, reg; 2293 2293 struct mssp *spp; 2294 2294 struct mscp *cpp; 2295 2295 struct hostdata *ha = (struct hostdata *)shost->hostdata; 2296 - 2297 - if (shost->irq != irq) 2298 - panic("%s: ihdlr, irq %d, shost->irq %d.\n", ha->board_name, irq, 2299 - shost->irq); 2296 + int irq = shost->irq; 2300 2297 2301 2298 /* Check if this board need to be serviced */ 2302 2299 if (!(inb(shost->io_port + REG_AUX_STATUS) & IRQ_ASSERTED)) ··· 2532 2535 return IRQ_NONE; 2533 2536 } 2534 2537 2535 - static irqreturn_t do_interrupt_handler(int irq, void *shap) 2538 + static irqreturn_t do_interrupt_handler(int dummy, void *shap) 2536 2539 { 2537 2540 struct Scsi_Host *shost; 2538 2541 unsigned int j; ··· 2545 2548 shost = sh[j]; 2546 2549 2547 2550 spin_lock_irqsave(shost->host_lock, spin_flags); 2548 - ret = ihdlr(irq, shost); 2551 + ret = ihdlr(shost); 2549 2552 spin_unlock_irqrestore(shost->host_lock, spin_flags); 2550 2553 return ret; 2551 2554 }
+24 -11
drivers/scsi/esp_scsi.c
··· 978 978 */ 979 979 if (!esp->ops->dma_error(esp)) { 980 980 printk(KERN_ERR PFX "esp%d: Spurious irq, " 981 - "sreg=%x.\n", 981 + "sreg=%02x.\n", 982 982 esp->host->unique_id, esp->sreg); 983 983 return -1; 984 984 } ··· 1447 1447 if (offset > 15) 1448 1448 goto do_reject; 1449 1449 1450 + if (esp->flags & ESP_FLAG_DISABLE_SYNC) 1451 + offset = 0; 1452 + 1450 1453 if (offset) { 1451 1454 int rounded_up, one_clock; 1452 1455 ··· 1700 1697 else 1701 1698 ent->flags &= ~ESP_CMD_FLAG_WRITE; 1702 1699 1703 - dma_len = esp_dma_length_limit(esp, dma_addr, dma_len); 1700 + if (esp->ops->dma_length_limit) 1701 + dma_len = esp->ops->dma_length_limit(esp, dma_addr, 1702 + dma_len); 1703 + else 1704 + dma_len = esp_dma_length_limit(esp, dma_addr, dma_len); 1705 + 1704 1706 esp->data_dma_len = dma_len; 1705 1707 1706 1708 if (!dma_len) { ··· 1769 1761 esp_advance_dma(esp, ent, cmd, bytes_sent); 1770 1762 esp_event(esp, ESP_EVENT_CHECK_PHASE); 1771 1763 goto again; 1772 - break; 1773 1764 } 1774 1765 1775 1766 case ESP_EVENT_STATUS: { ··· 2242 2235 2243 2236 static void esp_set_clock_params(struct esp *esp) 2244 2237 { 2245 - int fmhz; 2238 + int fhz; 2246 2239 u8 ccf; 2247 2240 2248 2241 /* This is getting messy but it has to be done correctly or else ··· 2277 2270 * This entails the smallest and largest sync period we could ever 2278 2271 * handle on this ESP. 2279 2272 */ 2280 - fmhz = esp->cfreq; 2273 + fhz = esp->cfreq; 2281 2274 2282 - ccf = ((fmhz / 1000000) + 4) / 5; 2275 + ccf = ((fhz / 1000000) + 4) / 5; 2283 2276 if (ccf == 1) 2284 2277 ccf = 2; 2285 2278 ··· 2288 2281 * been unable to find the clock-frequency PROM property. All 2289 2282 * other machines provide useful values it seems. 2290 2283 */ 2291 - if (fmhz <= 5000000 || ccf < 1 || ccf > 8) { 2292 - fmhz = 20000000; 2284 + if (fhz <= 5000000 || ccf < 1 || ccf > 8) { 2285 + fhz = 20000000; 2293 2286 ccf = 4; 2294 2287 } 2295 2288 2296 2289 esp->cfact = (ccf == 8 ? 0 : ccf); 2297 - esp->cfreq = fmhz; 2298 - esp->ccycle = ESP_MHZ_TO_CYCLE(fmhz); 2290 + esp->cfreq = fhz; 2291 + esp->ccycle = ESP_HZ_TO_CYCLE(fhz); 2299 2292 esp->ctick = ESP_TICK(ccf, esp->ccycle); 2300 - esp->neg_defp = ESP_NEG_DEFP(fmhz, ccf); 2293 + esp->neg_defp = ESP_NEG_DEFP(fhz, ccf); 2301 2294 esp->sync_defp = SYNC_DEFP_SLOW; 2302 2295 } 2303 2296 ··· 2388 2381 struct esp *esp = shost_priv(dev->host); 2389 2382 struct esp_target_data *tp = &esp->target[dev->id]; 2390 2383 int goal_tags, queue_depth; 2384 + 2385 + if (esp->flags & ESP_FLAG_DISABLE_SYNC) { 2386 + /* Bypass async domain validation */ 2387 + dev->ppr = 0; 2388 + dev->sdtr = 0; 2389 + } 2391 2390 2392 2391 goal_tags = 0; 2393 2392
+10 -3
drivers/scsi/esp_scsi.h
··· 224 224 #define ESP_TIMEO_CONST 8192 225 225 #define ESP_NEG_DEFP(mhz, cfact) \ 226 226 ((ESP_BUS_TIMEOUT * ((mhz) / 1000)) / (8192 * (cfact))) 227 - #define ESP_MHZ_TO_CYCLE(mhertz) ((1000000000) / ((mhertz) / 1000)) 227 + #define ESP_HZ_TO_CYCLE(hertz) ((1000000000) / ((hertz) / 1000)) 228 228 #define ESP_TICK(ccf, cycle) ((7682 * (ccf) * (cycle) / 1000)) 229 229 230 230 /* For slow to medium speed input clock rates we shoot for 5mb/s, but for high ··· 240 240 int num_sg; 241 241 } u; 242 242 243 - unsigned int cur_residue; 243 + int cur_residue; 244 244 struct scatterlist *cur_sg; 245 - unsigned int tot_residue; 245 + int tot_residue; 246 246 }; 247 247 #define ESP_CMD_PRIV(CMD) ((struct esp_cmd_priv *)(&(CMD)->SCp)) 248 248 ··· 368 368 */ 369 369 int (*irq_pending)(struct esp *esp); 370 370 371 + /* Return the maximum allowable size of a DMA transfer for a 372 + * given buffer. 373 + */ 374 + u32 (*dma_length_limit)(struct esp *esp, u32 dma_addr, 375 + u32 dma_len); 376 + 371 377 /* Reset the DMA engine entirely. On return, ESP interrupts 372 378 * should be enabled. Often the interrupt enabling is 373 379 * controlled in the DMA engine. ··· 477 471 #define ESP_FLAG_DOING_SLOWCMD 0x00000004 478 472 #define ESP_FLAG_WIDE_CAPABLE 0x00000008 479 473 #define ESP_FLAG_QUICKIRQ_CHECK 0x00000010 474 + #define ESP_FLAG_DISABLE_SYNC 0x00000020 480 475 481 476 u8 select_state; 482 477 #define ESP_SELECT_NONE 0x00 /* Not selecting */
+19 -10
drivers/scsi/hosts.c
··· 199 199 if (!shost->can_queue) { 200 200 printk(KERN_ERR "%s: can_queue = 0 no longer supported\n", 201 201 sht->name); 202 - goto out; 202 + goto fail; 203 203 } 204 + 205 + error = scsi_setup_command_freelist(shost); 206 + if (error) 207 + goto fail; 204 208 205 209 if (!shost->shost_gendev.parent) 206 210 shost->shost_gendev.parent = dev ? dev : &platform_bus; ··· 259 255 out_del_gendev: 260 256 device_del(&shost->shost_gendev); 261 257 out: 258 + scsi_destroy_command_freelist(shost); 259 + fail: 262 260 return error; 263 261 } 264 262 EXPORT_SYMBOL(scsi_add_host); ··· 289 283 put_device(parent); 290 284 kfree(shost); 291 285 } 286 + 287 + struct device_type scsi_host_type = { 288 + .name = "scsi_host", 289 + .release = scsi_host_dev_release, 290 + }; 292 291 293 292 /** 294 293 * scsi_host_alloc - register a scsi host adapter instance. ··· 387 376 else 388 377 shost->dma_boundary = 0xffffffff; 389 378 390 - rval = scsi_setup_command_freelist(shost); 391 - if (rval) 392 - goto fail_kfree; 393 - 394 379 device_initialize(&shost->shost_gendev); 395 380 snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", 396 381 shost->host_no); 397 - shost->shost_gendev.release = scsi_host_dev_release; 382 + #ifndef CONFIG_SYSFS_DEPRECATED 383 + shost->shost_gendev.bus = &scsi_bus_type; 384 + #endif 385 + shost->shost_gendev.type = &scsi_host_type; 398 386 399 387 device_initialize(&shost->shost_dev); 400 388 shost->shost_dev.parent = &shost->shost_gendev; 401 389 shost->shost_dev.class = &shost_class; 402 390 snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d", 403 391 shost->host_no); 392 + shost->shost_dev.groups = scsi_sysfs_shost_attr_groups; 404 393 405 394 shost->ehandler = kthread_run(scsi_error_handler, shost, 406 395 "scsi_eh_%d", shost->host_no); 407 396 if (IS_ERR(shost->ehandler)) { 408 397 rval = PTR_ERR(shost->ehandler); 409 - goto fail_destroy_freelist; 398 + goto fail_kfree; 410 399 } 411 400 412 401 scsi_proc_hostdir_add(shost->hostt); 413 402 return shost; 414 403 415 - fail_destroy_freelist: 416 - scsi_destroy_command_freelist(shost); 417 404 fail_kfree: 418 405 kfree(shost); 419 406 return NULL; ··· 505 496 506 497 int scsi_is_host_device(const struct device *dev) 507 498 { 508 - return dev->release == scsi_host_dev_release; 499 + return dev->type == &scsi_host_type; 509 500 } 510 501 EXPORT_SYMBOL(scsi_is_host_device); 511 502
+4
drivers/scsi/jazz_esp.c
··· 217 217 return 0; 218 218 } 219 219 220 + /* work with hotplug and coldplug */ 221 + MODULE_ALIAS("platform:jazz_esp"); 222 + 220 223 static struct platform_driver esp_jazz_driver = { 221 224 .probe = esp_jazz_probe, 222 225 .remove = __devexit_p(esp_jazz_remove), 223 226 .driver = { 224 227 .name = "jazz_esp", 228 + .owner = THIS_MODULE, 225 229 }, 226 230 }; 227 231
+5 -5
drivers/scsi/lpfc/lpfc_attr.c
··· 182 182 return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion); 183 183 } 184 184 static ssize_t 185 - lpfc_state_show(struct device *dev, struct device_attribute *attr, 186 - char *buf) 185 + lpfc_link_state_show(struct device *dev, struct device_attribute *attr, 186 + char *buf) 187 187 { 188 188 struct Scsi_Host *shost = class_to_shost(dev); 189 189 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; ··· 936 936 static DEVICE_ATTR(portnum, S_IRUGO, lpfc_vportnum_show, NULL); 937 937 static DEVICE_ATTR(fwrev, S_IRUGO, lpfc_fwrev_show, NULL); 938 938 static DEVICE_ATTR(hdw, S_IRUGO, lpfc_hdw_show, NULL); 939 - static DEVICE_ATTR(state, S_IRUGO, lpfc_state_show, NULL); 939 + static DEVICE_ATTR(link_state, S_IRUGO, lpfc_link_state_show, NULL); 940 940 static DEVICE_ATTR(option_rom_version, S_IRUGO, 941 941 lpfc_option_rom_version_show, NULL); 942 942 static DEVICE_ATTR(num_discovered_ports, S_IRUGO, ··· 1666 1666 &dev_attr_fwrev, 1667 1667 &dev_attr_hdw, 1668 1668 &dev_attr_option_rom_version, 1669 - &dev_attr_state, 1669 + &dev_attr_link_state, 1670 1670 &dev_attr_num_discovered_ports, 1671 1671 &dev_attr_lpfc_drvr_version, 1672 1672 &dev_attr_lpfc_temp_sensor, ··· 1714 1714 1715 1715 struct device_attribute *lpfc_vport_attrs[] = { 1716 1716 &dev_attr_info, 1717 - &dev_attr_state, 1717 + &dev_attr_link_state, 1718 1718 &dev_attr_num_discovered_ports, 1719 1719 &dev_attr_lpfc_drvr_version, 1720 1720 &dev_attr_lpfc_log_verbose,
+657
drivers/scsi/mac_esp.c
··· 1 + /* mac_esp.c: ESP front-end for Macintosh Quadra systems. 2 + * 3 + * Adapted from jazz_esp.c and the old mac_esp.c. 4 + * 5 + * The pseudo DMA algorithm is based on the one used in NetBSD. 6 + * See sys/arch/mac68k/obio/esp.c for some background information. 7 + * 8 + * Copyright (C) 2007-2008 Finn Thain 9 + */ 10 + 11 + #include <linux/kernel.h> 12 + #include <linux/types.h> 13 + #include <linux/module.h> 14 + #include <linux/init.h> 15 + #include <linux/interrupt.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/dma-mapping.h> 18 + #include <linux/scatterlist.h> 19 + #include <linux/delay.h> 20 + #include <linux/io.h> 21 + #include <linux/nubus.h> 22 + 23 + #include <asm/irq.h> 24 + #include <asm/dma.h> 25 + 26 + #include <asm/macints.h> 27 + #include <asm/macintosh.h> 28 + 29 + #include <scsi/scsi_host.h> 30 + 31 + #include "esp_scsi.h" 32 + 33 + #define DRV_MODULE_NAME "mac_esp" 34 + #define PFX DRV_MODULE_NAME ": " 35 + #define DRV_VERSION "1.000" 36 + #define DRV_MODULE_RELDATE "Sept 15, 2007" 37 + 38 + #define MAC_ESP_IO_BASE 0x50F00000 39 + #define MAC_ESP_REGS_QUADRA (MAC_ESP_IO_BASE + 0x10000) 40 + #define MAC_ESP_REGS_QUADRA2 (MAC_ESP_IO_BASE + 0xF000) 41 + #define MAC_ESP_REGS_QUADRA3 (MAC_ESP_IO_BASE + 0x18000) 42 + #define MAC_ESP_REGS_SPACING 0x402 43 + #define MAC_ESP_PDMA_REG 0xF9800024 44 + #define MAC_ESP_PDMA_REG_SPACING 0x4 45 + #define MAC_ESP_PDMA_IO_OFFSET 0x100 46 + 47 + #define esp_read8(REG) mac_esp_read8(esp, REG) 48 + #define esp_write8(VAL, REG) mac_esp_write8(esp, VAL, REG) 49 + 50 + struct mac_esp_priv { 51 + struct esp *esp; 52 + void __iomem *pdma_regs; 53 + void __iomem *pdma_io; 54 + int error; 55 + }; 56 + static struct platform_device *internal_esp, *external_esp; 57 + 58 + #define MAC_ESP_GET_PRIV(esp) ((struct mac_esp_priv *) \ 59 + platform_get_drvdata((struct platform_device *) \ 60 + (esp->dev))) 61 + 62 + static inline void mac_esp_write8(struct esp *esp, u8 val, unsigned long reg) 63 + { 64 + nubus_writeb(val, esp->regs + reg * 16); 65 + } 66 + 67 + static inline u8 mac_esp_read8(struct esp *esp, unsigned long reg) 68 + { 69 + return nubus_readb(esp->regs + reg * 16); 70 + } 71 + 72 + /* For pseudo DMA and PIO we need the virtual address 73 + * so this address mapping is the identity mapping. 74 + */ 75 + 76 + static dma_addr_t mac_esp_map_single(struct esp *esp, void *buf, 77 + size_t sz, int dir) 78 + { 79 + return (dma_addr_t)buf; 80 + } 81 + 82 + static int mac_esp_map_sg(struct esp *esp, struct scatterlist *sg, 83 + int num_sg, int dir) 84 + { 85 + int i; 86 + 87 + for (i = 0; i < num_sg; i++) 88 + sg[i].dma_address = (u32)sg_virt(&sg[i]); 89 + return num_sg; 90 + } 91 + 92 + static void mac_esp_unmap_single(struct esp *esp, dma_addr_t addr, 93 + size_t sz, int dir) 94 + { 95 + /* Nothing to do. */ 96 + } 97 + 98 + static void mac_esp_unmap_sg(struct esp *esp, struct scatterlist *sg, 99 + int num_sg, int dir) 100 + { 101 + /* Nothing to do. */ 102 + } 103 + 104 + static void mac_esp_reset_dma(struct esp *esp) 105 + { 106 + /* Nothing to do. */ 107 + } 108 + 109 + static void mac_esp_dma_drain(struct esp *esp) 110 + { 111 + /* Nothing to do. */ 112 + } 113 + 114 + static void mac_esp_dma_invalidate(struct esp *esp) 115 + { 116 + /* Nothing to do. */ 117 + } 118 + 119 + static int mac_esp_dma_error(struct esp *esp) 120 + { 121 + return MAC_ESP_GET_PRIV(esp)->error; 122 + } 123 + 124 + static inline int mac_esp_wait_for_empty_fifo(struct esp *esp) 125 + { 126 + struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp); 127 + int i = 500000; 128 + 129 + do { 130 + if (!(esp_read8(ESP_FFLAGS) & ESP_FF_FBYTES)) 131 + return 0; 132 + 133 + if (esp_read8(ESP_STATUS) & ESP_STAT_INTR) 134 + return 1; 135 + 136 + udelay(2); 137 + } while (--i); 138 + 139 + printk(KERN_ERR PFX "FIFO is not empty (sreg %02x)\n", 140 + esp_read8(ESP_STATUS)); 141 + mep->error = 1; 142 + return 1; 143 + } 144 + 145 + static inline int mac_esp_wait_for_dreq(struct esp *esp) 146 + { 147 + struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp); 148 + int i = 500000; 149 + 150 + do { 151 + if (mep->pdma_regs == NULL) { 152 + if (mac_irq_pending(IRQ_MAC_SCSIDRQ)) 153 + return 0; 154 + } else { 155 + if (nubus_readl(mep->pdma_regs) & 0x200) 156 + return 0; 157 + } 158 + 159 + if (esp_read8(ESP_STATUS) & ESP_STAT_INTR) 160 + return 1; 161 + 162 + udelay(2); 163 + } while (--i); 164 + 165 + printk(KERN_ERR PFX "PDMA timeout (sreg %02x)\n", 166 + esp_read8(ESP_STATUS)); 167 + mep->error = 1; 168 + return 1; 169 + } 170 + 171 + #define MAC_ESP_PDMA_LOOP(operands) \ 172 + asm volatile ( \ 173 + " tstw %2 \n" \ 174 + " jbeq 20f \n" \ 175 + "1: movew " operands " \n" \ 176 + "2: movew " operands " \n" \ 177 + "3: movew " operands " \n" \ 178 + "4: movew " operands " \n" \ 179 + "5: movew " operands " \n" \ 180 + "6: movew " operands " \n" \ 181 + "7: movew " operands " \n" \ 182 + "8: movew " operands " \n" \ 183 + "9: movew " operands " \n" \ 184 + "10: movew " operands " \n" \ 185 + "11: movew " operands " \n" \ 186 + "12: movew " operands " \n" \ 187 + "13: movew " operands " \n" \ 188 + "14: movew " operands " \n" \ 189 + "15: movew " operands " \n" \ 190 + "16: movew " operands " \n" \ 191 + " subqw #1,%2 \n" \ 192 + " jbne 1b \n" \ 193 + "20: tstw %3 \n" \ 194 + " jbeq 30f \n" \ 195 + "21: movew " operands " \n" \ 196 + " subqw #1,%3 \n" \ 197 + " jbne 21b \n" \ 198 + "30: tstw %4 \n" \ 199 + " jbeq 40f \n" \ 200 + "31: moveb " operands " \n" \ 201 + "32: nop \n" \ 202 + "40: \n" \ 203 + " \n" \ 204 + " .section __ex_table,\"a\" \n" \ 205 + " .align 4 \n" \ 206 + " .long 1b,40b \n" \ 207 + " .long 2b,40b \n" \ 208 + " .long 3b,40b \n" \ 209 + " .long 4b,40b \n" \ 210 + " .long 5b,40b \n" \ 211 + " .long 6b,40b \n" \ 212 + " .long 7b,40b \n" \ 213 + " .long 8b,40b \n" \ 214 + " .long 9b,40b \n" \ 215 + " .long 10b,40b \n" \ 216 + " .long 11b,40b \n" \ 217 + " .long 12b,40b \n" \ 218 + " .long 13b,40b \n" \ 219 + " .long 14b,40b \n" \ 220 + " .long 15b,40b \n" \ 221 + " .long 16b,40b \n" \ 222 + " .long 21b,40b \n" \ 223 + " .long 31b,40b \n" \ 224 + " .long 32b,40b \n" \ 225 + " .previous \n" \ 226 + : "+a" (addr) \ 227 + : "a" (mep->pdma_io), "r" (count32), "r" (count2), "g" (esp_count)) 228 + 229 + static void mac_esp_send_pdma_cmd(struct esp *esp, u32 addr, u32 esp_count, 230 + u32 dma_count, int write, u8 cmd) 231 + { 232 + struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp); 233 + unsigned long flags; 234 + 235 + local_irq_save(flags); 236 + 237 + mep->error = 0; 238 + 239 + if (!write) 240 + scsi_esp_cmd(esp, ESP_CMD_FLUSH); 241 + 242 + esp_write8((esp_count >> 0) & 0xFF, ESP_TCLOW); 243 + esp_write8((esp_count >> 8) & 0xFF, ESP_TCMED); 244 + 245 + scsi_esp_cmd(esp, cmd); 246 + 247 + do { 248 + unsigned int count32 = esp_count >> 5; 249 + unsigned int count2 = (esp_count & 0x1F) >> 1; 250 + unsigned int start_addr = addr; 251 + 252 + if (mac_esp_wait_for_dreq(esp)) 253 + break; 254 + 255 + if (write) { 256 + MAC_ESP_PDMA_LOOP("%1@,%0@+"); 257 + 258 + esp_count -= addr - start_addr; 259 + } else { 260 + unsigned int n; 261 + 262 + MAC_ESP_PDMA_LOOP("%0@+,%1@"); 263 + 264 + if (mac_esp_wait_for_empty_fifo(esp)) 265 + break; 266 + 267 + n = (esp_read8(ESP_TCMED) << 8) + esp_read8(ESP_TCLOW); 268 + addr = start_addr + esp_count - n; 269 + esp_count = n; 270 + } 271 + } while (esp_count); 272 + 273 + local_irq_restore(flags); 274 + } 275 + 276 + /* 277 + * Programmed IO routines follow. 278 + */ 279 + 280 + static inline int mac_esp_wait_for_fifo(struct esp *esp) 281 + { 282 + int i = 500000; 283 + 284 + do { 285 + if (esp_read8(ESP_FFLAGS) & ESP_FF_FBYTES) 286 + return 0; 287 + 288 + udelay(2); 289 + } while (--i); 290 + 291 + printk(KERN_ERR PFX "FIFO is empty (sreg %02x)\n", 292 + esp_read8(ESP_STATUS)); 293 + return 1; 294 + } 295 + 296 + static inline int mac_esp_wait_for_intr(struct esp *esp) 297 + { 298 + int i = 500000; 299 + 300 + do { 301 + esp->sreg = esp_read8(ESP_STATUS); 302 + if (esp->sreg & ESP_STAT_INTR) 303 + return 0; 304 + 305 + udelay(2); 306 + } while (--i); 307 + 308 + printk(KERN_ERR PFX "IRQ timeout (sreg %02x)\n", esp->sreg); 309 + return 1; 310 + } 311 + 312 + #define MAC_ESP_PIO_LOOP(operands, reg1) \ 313 + asm volatile ( \ 314 + "1: moveb " operands " \n" \ 315 + " subqw #1,%1 \n" \ 316 + " jbne 1b \n" \ 317 + : "+a" (addr), "+r" (reg1) \ 318 + : "a" (fifo)) 319 + 320 + #define MAC_ESP_PIO_FILL(operands, reg1) \ 321 + asm volatile ( \ 322 + " moveb " operands " \n" \ 323 + " moveb " operands " \n" \ 324 + " moveb " operands " \n" \ 325 + " moveb " operands " \n" \ 326 + " moveb " operands " \n" \ 327 + " moveb " operands " \n" \ 328 + " moveb " operands " \n" \ 329 + " moveb " operands " \n" \ 330 + " moveb " operands " \n" \ 331 + " moveb " operands " \n" \ 332 + " moveb " operands " \n" \ 333 + " moveb " operands " \n" \ 334 + " moveb " operands " \n" \ 335 + " moveb " operands " \n" \ 336 + " moveb " operands " \n" \ 337 + " moveb " operands " \n" \ 338 + " subqw #8,%1 \n" \ 339 + " subqw #8,%1 \n" \ 340 + : "+a" (addr), "+r" (reg1) \ 341 + : "a" (fifo)) 342 + 343 + #define MAC_ESP_FIFO_SIZE 16 344 + 345 + static void mac_esp_send_pio_cmd(struct esp *esp, u32 addr, u32 esp_count, 346 + u32 dma_count, int write, u8 cmd) 347 + { 348 + unsigned long flags; 349 + struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp); 350 + u8 *fifo = esp->regs + ESP_FDATA * 16; 351 + 352 + local_irq_save(flags); 353 + 354 + cmd &= ~ESP_CMD_DMA; 355 + mep->error = 0; 356 + 357 + if (write) { 358 + scsi_esp_cmd(esp, cmd); 359 + 360 + if (!mac_esp_wait_for_intr(esp)) { 361 + if (mac_esp_wait_for_fifo(esp)) 362 + esp_count = 0; 363 + } else { 364 + esp_count = 0; 365 + } 366 + } else { 367 + scsi_esp_cmd(esp, ESP_CMD_FLUSH); 368 + 369 + if (esp_count >= MAC_ESP_FIFO_SIZE) 370 + MAC_ESP_PIO_FILL("%0@+,%2@", esp_count); 371 + else 372 + MAC_ESP_PIO_LOOP("%0@+,%2@", esp_count); 373 + 374 + scsi_esp_cmd(esp, cmd); 375 + } 376 + 377 + while (esp_count) { 378 + unsigned int n; 379 + 380 + if (mac_esp_wait_for_intr(esp)) { 381 + mep->error = 1; 382 + break; 383 + } 384 + 385 + if (esp->sreg & ESP_STAT_SPAM) { 386 + printk(KERN_ERR PFX "gross error\n"); 387 + mep->error = 1; 388 + break; 389 + } 390 + 391 + n = esp_read8(ESP_FFLAGS) & ESP_FF_FBYTES; 392 + 393 + if (write) { 394 + if (n > esp_count) 395 + n = esp_count; 396 + esp_count -= n; 397 + 398 + MAC_ESP_PIO_LOOP("%2@,%0@+", n); 399 + 400 + if ((esp->sreg & ESP_STAT_PMASK) == ESP_STATP) 401 + break; 402 + 403 + if (esp_count) { 404 + esp->ireg = esp_read8(ESP_INTRPT); 405 + if (esp->ireg & ESP_INTR_DC) 406 + break; 407 + 408 + scsi_esp_cmd(esp, ESP_CMD_TI); 409 + } 410 + } else { 411 + esp->ireg = esp_read8(ESP_INTRPT); 412 + if (esp->ireg & ESP_INTR_DC) 413 + break; 414 + 415 + n = MAC_ESP_FIFO_SIZE - n; 416 + if (n > esp_count) 417 + n = esp_count; 418 + 419 + if (n == MAC_ESP_FIFO_SIZE) { 420 + MAC_ESP_PIO_FILL("%0@+,%2@", esp_count); 421 + } else { 422 + esp_count -= n; 423 + MAC_ESP_PIO_LOOP("%0@+,%2@", n); 424 + } 425 + 426 + scsi_esp_cmd(esp, ESP_CMD_TI); 427 + } 428 + } 429 + 430 + local_irq_restore(flags); 431 + } 432 + 433 + static int mac_esp_irq_pending(struct esp *esp) 434 + { 435 + if (esp_read8(ESP_STATUS) & ESP_STAT_INTR) 436 + return 1; 437 + return 0; 438 + } 439 + 440 + static u32 mac_esp_dma_length_limit(struct esp *esp, u32 dma_addr, u32 dma_len) 441 + { 442 + return dma_len > 0xFFFF ? 0xFFFF : dma_len; 443 + } 444 + 445 + static struct esp_driver_ops mac_esp_ops = { 446 + .esp_write8 = mac_esp_write8, 447 + .esp_read8 = mac_esp_read8, 448 + .map_single = mac_esp_map_single, 449 + .map_sg = mac_esp_map_sg, 450 + .unmap_single = mac_esp_unmap_single, 451 + .unmap_sg = mac_esp_unmap_sg, 452 + .irq_pending = mac_esp_irq_pending, 453 + .dma_length_limit = mac_esp_dma_length_limit, 454 + .reset_dma = mac_esp_reset_dma, 455 + .dma_drain = mac_esp_dma_drain, 456 + .dma_invalidate = mac_esp_dma_invalidate, 457 + .send_dma_cmd = mac_esp_send_pdma_cmd, 458 + .dma_error = mac_esp_dma_error, 459 + }; 460 + 461 + static int __devinit esp_mac_probe(struct platform_device *dev) 462 + { 463 + struct scsi_host_template *tpnt = &scsi_esp_template; 464 + struct Scsi_Host *host; 465 + struct esp *esp; 466 + int err; 467 + int chips_present; 468 + struct mac_esp_priv *mep; 469 + 470 + if (!MACH_IS_MAC) 471 + return -ENODEV; 472 + 473 + switch (macintosh_config->scsi_type) { 474 + case MAC_SCSI_QUADRA: 475 + case MAC_SCSI_QUADRA3: 476 + chips_present = 1; 477 + break; 478 + case MAC_SCSI_QUADRA2: 479 + if ((macintosh_config->ident == MAC_MODEL_Q900) || 480 + (macintosh_config->ident == MAC_MODEL_Q950)) 481 + chips_present = 2; 482 + else 483 + chips_present = 1; 484 + break; 485 + default: 486 + chips_present = 0; 487 + } 488 + 489 + if (dev->id + 1 > chips_present) 490 + return -ENODEV; 491 + 492 + host = scsi_host_alloc(tpnt, sizeof(struct esp)); 493 + 494 + err = -ENOMEM; 495 + if (!host) 496 + goto fail; 497 + 498 + host->max_id = 8; 499 + host->use_clustering = DISABLE_CLUSTERING; 500 + esp = shost_priv(host); 501 + 502 + esp->host = host; 503 + esp->dev = dev; 504 + 505 + esp->command_block = kzalloc(16, GFP_KERNEL); 506 + if (!esp->command_block) 507 + goto fail_unlink; 508 + esp->command_block_dma = (dma_addr_t)esp->command_block; 509 + 510 + esp->scsi_id = 7; 511 + host->this_id = esp->scsi_id; 512 + esp->scsi_id_mask = 1 << esp->scsi_id; 513 + 514 + mep = kzalloc(sizeof(struct mac_esp_priv), GFP_KERNEL); 515 + if (!mep) 516 + goto fail_free_command_block; 517 + mep->esp = esp; 518 + platform_set_drvdata(dev, mep); 519 + 520 + switch (macintosh_config->scsi_type) { 521 + case MAC_SCSI_QUADRA: 522 + esp->cfreq = 16500000; 523 + esp->regs = (void __iomem *)MAC_ESP_REGS_QUADRA; 524 + mep->pdma_io = esp->regs + MAC_ESP_PDMA_IO_OFFSET; 525 + mep->pdma_regs = NULL; 526 + break; 527 + case MAC_SCSI_QUADRA2: 528 + esp->cfreq = 25000000; 529 + esp->regs = (void __iomem *)(MAC_ESP_REGS_QUADRA2 + 530 + dev->id * MAC_ESP_REGS_SPACING); 531 + mep->pdma_io = esp->regs + MAC_ESP_PDMA_IO_OFFSET; 532 + mep->pdma_regs = (void __iomem *)(MAC_ESP_PDMA_REG + 533 + dev->id * MAC_ESP_PDMA_REG_SPACING); 534 + nubus_writel(0x1d1, mep->pdma_regs); 535 + break; 536 + case MAC_SCSI_QUADRA3: 537 + /* These quadras have a real DMA controller (the PSC) but we 538 + * don't know how to drive it so we must use PIO instead. 539 + */ 540 + esp->cfreq = 25000000; 541 + esp->regs = (void __iomem *)MAC_ESP_REGS_QUADRA3; 542 + mep->pdma_io = NULL; 543 + mep->pdma_regs = NULL; 544 + break; 545 + } 546 + 547 + esp->ops = &mac_esp_ops; 548 + if (mep->pdma_io == NULL) { 549 + printk(KERN_INFO PFX "using PIO for controller %d\n", dev->id); 550 + esp_write8(0, ESP_TCLOW); 551 + esp_write8(0, ESP_TCMED); 552 + esp->flags = ESP_FLAG_DISABLE_SYNC; 553 + mac_esp_ops.send_dma_cmd = mac_esp_send_pio_cmd; 554 + } else { 555 + printk(KERN_INFO PFX "using PDMA for controller %d\n", dev->id); 556 + } 557 + 558 + host->irq = IRQ_MAC_SCSI; 559 + err = request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "Mac ESP", 560 + esp); 561 + if (err < 0) 562 + goto fail_free_priv; 563 + 564 + err = scsi_esp_register(esp, &dev->dev); 565 + if (err) 566 + goto fail_free_irq; 567 + 568 + return 0; 569 + 570 + fail_free_irq: 571 + free_irq(host->irq, esp); 572 + fail_free_priv: 573 + kfree(mep); 574 + fail_free_command_block: 575 + kfree(esp->command_block); 576 + fail_unlink: 577 + scsi_host_put(host); 578 + fail: 579 + return err; 580 + } 581 + 582 + static int __devexit esp_mac_remove(struct platform_device *dev) 583 + { 584 + struct mac_esp_priv *mep = platform_get_drvdata(dev); 585 + struct esp *esp = mep->esp; 586 + unsigned int irq = esp->host->irq; 587 + 588 + scsi_esp_unregister(esp); 589 + 590 + free_irq(irq, esp); 591 + 592 + kfree(mep); 593 + 594 + kfree(esp->command_block); 595 + 596 + scsi_host_put(esp->host); 597 + 598 + return 0; 599 + } 600 + 601 + static struct platform_driver esp_mac_driver = { 602 + .probe = esp_mac_probe, 603 + .remove = __devexit_p(esp_mac_remove), 604 + .driver = { 605 + .name = DRV_MODULE_NAME, 606 + }, 607 + }; 608 + 609 + static int __init mac_esp_init(void) 610 + { 611 + int err; 612 + 613 + err = platform_driver_register(&esp_mac_driver); 614 + if (err) 615 + return err; 616 + 617 + internal_esp = platform_device_alloc(DRV_MODULE_NAME, 0); 618 + if (internal_esp && platform_device_add(internal_esp)) { 619 + platform_device_put(internal_esp); 620 + internal_esp = NULL; 621 + } 622 + 623 + external_esp = platform_device_alloc(DRV_MODULE_NAME, 1); 624 + if (external_esp && platform_device_add(external_esp)) { 625 + platform_device_put(external_esp); 626 + external_esp = NULL; 627 + } 628 + 629 + if (internal_esp || external_esp) { 630 + return 0; 631 + } else { 632 + platform_driver_unregister(&esp_mac_driver); 633 + return -ENOMEM; 634 + } 635 + } 636 + 637 + static void __exit mac_esp_exit(void) 638 + { 639 + platform_driver_unregister(&esp_mac_driver); 640 + 641 + if (internal_esp) { 642 + platform_device_unregister(internal_esp); 643 + internal_esp = NULL; 644 + } 645 + if (external_esp) { 646 + platform_device_unregister(external_esp); 647 + external_esp = NULL; 648 + } 649 + } 650 + 651 + MODULE_DESCRIPTION("Mac ESP SCSI driver"); 652 + MODULE_AUTHOR("Finn Thain <fthain@telegraphics.com.au>"); 653 + MODULE_LICENSE("GPLv2"); 654 + MODULE_VERSION(DRV_VERSION); 655 + 656 + module_init(mac_esp_init); 657 + module_exit(mac_esp_exit);
+4 -4
drivers/scsi/qla2xxx/qla_attr.c
··· 609 609 } 610 610 611 611 static ssize_t 612 - qla2x00_state_show(struct device *dev, struct device_attribute *attr, 613 - char *buf) 612 + qla2x00_link_state_show(struct device *dev, struct device_attribute *attr, 613 + char *buf) 614 614 { 615 615 scsi_qla_host_t *ha = shost_priv(class_to_shost(dev)); 616 616 int len = 0; ··· 814 814 static DEVICE_ATTR(model_name, S_IRUGO, qla2x00_model_name_show, NULL); 815 815 static DEVICE_ATTR(model_desc, S_IRUGO, qla2x00_model_desc_show, NULL); 816 816 static DEVICE_ATTR(pci_info, S_IRUGO, qla2x00_pci_info_show, NULL); 817 - static DEVICE_ATTR(state, S_IRUGO, qla2x00_state_show, NULL); 817 + static DEVICE_ATTR(link_state, S_IRUGO, qla2x00_link_state_show, NULL); 818 818 static DEVICE_ATTR(zio, S_IRUGO | S_IWUSR, qla2x00_zio_show, qla2x00_zio_store); 819 819 static DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show, 820 820 qla2x00_zio_timer_store); ··· 838 838 &dev_attr_model_name, 839 839 &dev_attr_model_desc, 840 840 &dev_attr_pci_info, 841 - &dev_attr_state, 841 + &dev_attr_link_state, 842 842 &dev_attr_zio, 843 843 &dev_attr_zio_timer, 844 844 &dev_attr_beacon,
+146 -254
drivers/scsi/qla2xxx/qla_dbg.c
··· 38 38 } 39 39 40 40 static int 41 - qla24xx_dump_memory(scsi_qla_host_t *ha, uint32_t *code_ram, 42 - uint32_t cram_size, uint32_t *ext_mem, void **nxt) 41 + qla24xx_dump_ram(scsi_qla_host_t *ha, uint32_t addr, uint32_t *ram, 42 + uint32_t ram_dwords, void **nxt) 43 43 { 44 44 int rval; 45 - uint32_t cnt, stat, timer, risc_address, ext_mem_cnt; 46 - uint16_t mb[4]; 45 + uint32_t cnt, stat, timer, dwords, idx; 46 + uint16_t mb0; 47 47 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 48 + dma_addr_t dump_dma = ha->gid_list_dma; 49 + uint32_t *dump = (uint32_t *)ha->gid_list; 48 50 49 51 rval = QLA_SUCCESS; 50 - risc_address = ext_mem_cnt = 0; 51 - memset(mb, 0, sizeof(mb)); 52 + mb0 = 0; 52 53 53 - /* Code RAM. */ 54 - risc_address = 0x20000; 55 - WRT_REG_WORD(&reg->mailbox0, MBC_READ_RAM_EXTENDED); 54 + WRT_REG_WORD(&reg->mailbox0, MBC_DUMP_RISC_RAM_EXTENDED); 56 55 clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 57 56 58 - for (cnt = 0; cnt < cram_size / 4 && rval == QLA_SUCCESS; 59 - cnt++, risc_address++) { 60 - WRT_REG_WORD(&reg->mailbox1, LSW(risc_address)); 61 - WRT_REG_WORD(&reg->mailbox8, MSW(risc_address)); 62 - RD_REG_WORD(&reg->mailbox8); 57 + dwords = GID_LIST_SIZE / 4; 58 + for (cnt = 0; cnt < ram_dwords && rval == QLA_SUCCESS; 59 + cnt += dwords, addr += dwords) { 60 + if (cnt + dwords > ram_dwords) 61 + dwords = ram_dwords - cnt; 62 + 63 + WRT_REG_WORD(&reg->mailbox1, LSW(addr)); 64 + WRT_REG_WORD(&reg->mailbox8, MSW(addr)); 65 + 66 + WRT_REG_WORD(&reg->mailbox2, MSW(dump_dma)); 67 + WRT_REG_WORD(&reg->mailbox3, LSW(dump_dma)); 68 + WRT_REG_WORD(&reg->mailbox6, MSW(MSD(dump_dma))); 69 + WRT_REG_WORD(&reg->mailbox7, LSW(MSD(dump_dma))); 70 + 71 + WRT_REG_WORD(&reg->mailbox4, MSW(dwords)); 72 + WRT_REG_WORD(&reg->mailbox5, LSW(dwords)); 63 73 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_HOST_INT); 64 74 65 75 for (timer = 6000000; timer; timer--) { ··· 83 73 set_bit(MBX_INTERRUPT, 84 74 &ha->mbx_cmd_flags); 85 75 86 - mb[0] = RD_REG_WORD(&reg->mailbox0); 87 - mb[2] = RD_REG_WORD(&reg->mailbox2); 88 - mb[3] = RD_REG_WORD(&reg->mailbox3); 76 + mb0 = RD_REG_WORD(&reg->mailbox0); 89 77 90 78 WRT_REG_DWORD(&reg->hccr, 91 79 HCCRX_CLR_RISC_INT); ··· 99 91 } 100 92 101 93 if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { 102 - rval = mb[0] & MBS_MASK; 103 - code_ram[cnt] = htonl((mb[3] << 16) | mb[2]); 94 + rval = mb0 & MBS_MASK; 95 + for (idx = 0; idx < dwords; idx++) 96 + ram[cnt + idx] = swab32(dump[idx]); 104 97 } else { 105 98 rval = QLA_FUNCTION_FAILED; 106 99 } 107 100 } 108 101 109 - if (rval == QLA_SUCCESS) { 110 - /* External Memory. */ 111 - risc_address = 0x100000; 112 - ext_mem_cnt = ha->fw_memory_size - 0x100000 + 1; 113 - WRT_REG_WORD(&reg->mailbox0, MBC_READ_RAM_EXTENDED); 114 - clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 115 - } 116 - for (cnt = 0; cnt < ext_mem_cnt && rval == QLA_SUCCESS; 117 - cnt++, risc_address++) { 118 - WRT_REG_WORD(&reg->mailbox1, LSW(risc_address)); 119 - WRT_REG_WORD(&reg->mailbox8, MSW(risc_address)); 120 - RD_REG_WORD(&reg->mailbox8); 121 - WRT_REG_DWORD(&reg->hccr, HCCRX_SET_HOST_INT); 122 - 123 - for (timer = 6000000; timer; timer--) { 124 - /* Check for pending interrupts. */ 125 - stat = RD_REG_DWORD(&reg->host_status); 126 - if (stat & HSRX_RISC_INT) { 127 - stat &= 0xff; 128 - 129 - if (stat == 0x1 || stat == 0x2 || 130 - stat == 0x10 || stat == 0x11) { 131 - set_bit(MBX_INTERRUPT, 132 - &ha->mbx_cmd_flags); 133 - 134 - mb[0] = RD_REG_WORD(&reg->mailbox0); 135 - mb[2] = RD_REG_WORD(&reg->mailbox2); 136 - mb[3] = RD_REG_WORD(&reg->mailbox3); 137 - 138 - WRT_REG_DWORD(&reg->hccr, 139 - HCCRX_CLR_RISC_INT); 140 - RD_REG_DWORD(&reg->hccr); 141 - break; 142 - } 143 - 144 - /* Clear this intr; it wasn't a mailbox intr */ 145 - WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 146 - RD_REG_DWORD(&reg->hccr); 147 - } 148 - udelay(5); 149 - } 150 - 151 - if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { 152 - rval = mb[0] & MBS_MASK; 153 - ext_mem[cnt] = htonl((mb[3] << 16) | mb[2]); 154 - } else { 155 - rval = QLA_FUNCTION_FAILED; 156 - } 157 - } 158 - 159 - *nxt = rval == QLA_SUCCESS ? &ext_mem[cnt]: NULL; 102 + *nxt = rval == QLA_SUCCESS ? &ram[cnt]: NULL; 160 103 return rval; 104 + } 105 + 106 + static int 107 + qla24xx_dump_memory(scsi_qla_host_t *ha, uint32_t *code_ram, 108 + uint32_t cram_size, void **nxt) 109 + { 110 + int rval; 111 + 112 + /* Code RAM. */ 113 + rval = qla24xx_dump_ram(ha, 0x20000, code_ram, cram_size / 4, nxt); 114 + if (rval != QLA_SUCCESS) 115 + return rval; 116 + 117 + /* External Memory. */ 118 + return qla24xx_dump_ram(ha, 0x100000, *nxt, 119 + ha->fw_memory_size - 0x100000 + 1, nxt); 161 120 } 162 121 163 122 static uint32_t * ··· 214 239 return rval; 215 240 } 216 241 242 + static int 243 + qla2xxx_dump_ram(scsi_qla_host_t *ha, uint32_t addr, uint16_t *ram, 244 + uint16_t ram_words, void **nxt) 245 + { 246 + int rval; 247 + uint32_t cnt, stat, timer, words, idx; 248 + uint16_t mb0; 249 + struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 250 + dma_addr_t dump_dma = ha->gid_list_dma; 251 + uint16_t *dump = (uint16_t *)ha->gid_list; 252 + 253 + rval = QLA_SUCCESS; 254 + mb0 = 0; 255 + 256 + WRT_MAILBOX_REG(ha, reg, 0, MBC_DUMP_RISC_RAM_EXTENDED); 257 + clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 258 + 259 + words = GID_LIST_SIZE / 2; 260 + for (cnt = 0; cnt < ram_words && rval == QLA_SUCCESS; 261 + cnt += words, addr += words) { 262 + if (cnt + words > ram_words) 263 + words = ram_words - cnt; 264 + 265 + WRT_MAILBOX_REG(ha, reg, 1, LSW(addr)); 266 + WRT_MAILBOX_REG(ha, reg, 8, MSW(addr)); 267 + 268 + WRT_MAILBOX_REG(ha, reg, 2, MSW(dump_dma)); 269 + WRT_MAILBOX_REG(ha, reg, 3, LSW(dump_dma)); 270 + WRT_MAILBOX_REG(ha, reg, 6, MSW(MSD(dump_dma))); 271 + WRT_MAILBOX_REG(ha, reg, 7, LSW(MSD(dump_dma))); 272 + 273 + WRT_MAILBOX_REG(ha, reg, 4, words); 274 + WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT); 275 + 276 + for (timer = 6000000; timer; timer--) { 277 + /* Check for pending interrupts. */ 278 + stat = RD_REG_DWORD(&reg->u.isp2300.host_status); 279 + if (stat & HSR_RISC_INT) { 280 + stat &= 0xff; 281 + 282 + if (stat == 0x1 || stat == 0x2) { 283 + set_bit(MBX_INTERRUPT, 284 + &ha->mbx_cmd_flags); 285 + 286 + mb0 = RD_MAILBOX_REG(ha, reg, 0); 287 + 288 + /* Release mailbox registers. */ 289 + WRT_REG_WORD(&reg->semaphore, 0); 290 + WRT_REG_WORD(&reg->hccr, 291 + HCCR_CLR_RISC_INT); 292 + RD_REG_WORD(&reg->hccr); 293 + break; 294 + } else if (stat == 0x10 || stat == 0x11) { 295 + set_bit(MBX_INTERRUPT, 296 + &ha->mbx_cmd_flags); 297 + 298 + mb0 = RD_MAILBOX_REG(ha, reg, 0); 299 + 300 + WRT_REG_WORD(&reg->hccr, 301 + HCCR_CLR_RISC_INT); 302 + RD_REG_WORD(&reg->hccr); 303 + break; 304 + } 305 + 306 + /* clear this intr; it wasn't a mailbox intr */ 307 + WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 308 + RD_REG_WORD(&reg->hccr); 309 + } 310 + udelay(5); 311 + } 312 + 313 + if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { 314 + rval = mb0 & MBS_MASK; 315 + for (idx = 0; idx < words; idx++) 316 + ram[cnt + idx] = swab16(dump[idx]); 317 + } else { 318 + rval = QLA_FUNCTION_FAILED; 319 + } 320 + } 321 + 322 + *nxt = rval == QLA_SUCCESS ? &ram[cnt]: NULL; 323 + return rval; 324 + } 325 + 217 326 static inline void 218 327 qla2xxx_read_window(struct device_reg_2xxx __iomem *reg, uint32_t count, 219 328 uint16_t *buf) ··· 317 258 qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) 318 259 { 319 260 int rval; 320 - uint32_t cnt, timer; 321 - uint32_t risc_address; 322 - uint16_t mb0, mb2; 261 + uint32_t cnt; 323 262 324 - uint32_t stat; 325 263 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 326 264 uint16_t __iomem *dmp_reg; 327 265 unsigned long flags; 328 266 struct qla2300_fw_dump *fw; 329 - uint32_t data_ram_cnt; 267 + void *nxt; 330 268 331 - risc_address = data_ram_cnt = 0; 332 - mb0 = mb2 = 0; 333 269 flags = 0; 334 270 335 271 if (!hardware_locked) ··· 442 388 } 443 389 } 444 390 445 - if (rval == QLA_SUCCESS) { 446 - /* Get RISC SRAM. */ 447 - risc_address = 0x800; 448 - WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_WORD); 449 - clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 450 - } 451 - for (cnt = 0; cnt < sizeof(fw->risc_ram) / 2 && rval == QLA_SUCCESS; 452 - cnt++, risc_address++) { 453 - WRT_MAILBOX_REG(ha, reg, 1, (uint16_t)risc_address); 454 - WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT); 391 + /* Get RISC SRAM. */ 392 + if (rval == QLA_SUCCESS) 393 + rval = qla2xxx_dump_ram(ha, 0x800, fw->risc_ram, 394 + sizeof(fw->risc_ram) / 2, &nxt); 455 395 456 - for (timer = 6000000; timer; timer--) { 457 - /* Check for pending interrupts. */ 458 - stat = RD_REG_DWORD(&reg->u.isp2300.host_status); 459 - if (stat & HSR_RISC_INT) { 460 - stat &= 0xff; 396 + /* Get stack SRAM. */ 397 + if (rval == QLA_SUCCESS) 398 + rval = qla2xxx_dump_ram(ha, 0x10000, fw->stack_ram, 399 + sizeof(fw->stack_ram) / 2, &nxt); 461 400 462 - if (stat == 0x1 || stat == 0x2) { 463 - set_bit(MBX_INTERRUPT, 464 - &ha->mbx_cmd_flags); 465 - 466 - mb0 = RD_MAILBOX_REG(ha, reg, 0); 467 - mb2 = RD_MAILBOX_REG(ha, reg, 2); 468 - 469 - /* Release mailbox registers. */ 470 - WRT_REG_WORD(&reg->semaphore, 0); 471 - WRT_REG_WORD(&reg->hccr, 472 - HCCR_CLR_RISC_INT); 473 - RD_REG_WORD(&reg->hccr); 474 - break; 475 - } else if (stat == 0x10 || stat == 0x11) { 476 - set_bit(MBX_INTERRUPT, 477 - &ha->mbx_cmd_flags); 478 - 479 - mb0 = RD_MAILBOX_REG(ha, reg, 0); 480 - mb2 = RD_MAILBOX_REG(ha, reg, 2); 481 - 482 - WRT_REG_WORD(&reg->hccr, 483 - HCCR_CLR_RISC_INT); 484 - RD_REG_WORD(&reg->hccr); 485 - break; 486 - } 487 - 488 - /* clear this intr; it wasn't a mailbox intr */ 489 - WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 490 - RD_REG_WORD(&reg->hccr); 491 - } 492 - udelay(5); 493 - } 494 - 495 - if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { 496 - rval = mb0 & MBS_MASK; 497 - fw->risc_ram[cnt] = htons(mb2); 498 - } else { 499 - rval = QLA_FUNCTION_FAILED; 500 - } 501 - } 502 - 503 - if (rval == QLA_SUCCESS) { 504 - /* Get stack SRAM. */ 505 - risc_address = 0x10000; 506 - WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_EXTENDED); 507 - clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 508 - } 509 - for (cnt = 0; cnt < sizeof(fw->stack_ram) / 2 && rval == QLA_SUCCESS; 510 - cnt++, risc_address++) { 511 - WRT_MAILBOX_REG(ha, reg, 1, LSW(risc_address)); 512 - WRT_MAILBOX_REG(ha, reg, 8, MSW(risc_address)); 513 - WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT); 514 - 515 - for (timer = 6000000; timer; timer--) { 516 - /* Check for pending interrupts. */ 517 - stat = RD_REG_DWORD(&reg->u.isp2300.host_status); 518 - if (stat & HSR_RISC_INT) { 519 - stat &= 0xff; 520 - 521 - if (stat == 0x1 || stat == 0x2) { 522 - set_bit(MBX_INTERRUPT, 523 - &ha->mbx_cmd_flags); 524 - 525 - mb0 = RD_MAILBOX_REG(ha, reg, 0); 526 - mb2 = RD_MAILBOX_REG(ha, reg, 2); 527 - 528 - /* Release mailbox registers. */ 529 - WRT_REG_WORD(&reg->semaphore, 0); 530 - WRT_REG_WORD(&reg->hccr, 531 - HCCR_CLR_RISC_INT); 532 - RD_REG_WORD(&reg->hccr); 533 - break; 534 - } else if (stat == 0x10 || stat == 0x11) { 535 - set_bit(MBX_INTERRUPT, 536 - &ha->mbx_cmd_flags); 537 - 538 - mb0 = RD_MAILBOX_REG(ha, reg, 0); 539 - mb2 = RD_MAILBOX_REG(ha, reg, 2); 540 - 541 - WRT_REG_WORD(&reg->hccr, 542 - HCCR_CLR_RISC_INT); 543 - RD_REG_WORD(&reg->hccr); 544 - break; 545 - } 546 - 547 - /* clear this intr; it wasn't a mailbox intr */ 548 - WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 549 - RD_REG_WORD(&reg->hccr); 550 - } 551 - udelay(5); 552 - } 553 - 554 - if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { 555 - rval = mb0 & MBS_MASK; 556 - fw->stack_ram[cnt] = htons(mb2); 557 - } else { 558 - rval = QLA_FUNCTION_FAILED; 559 - } 560 - } 561 - 562 - if (rval == QLA_SUCCESS) { 563 - /* Get data SRAM. */ 564 - risc_address = 0x11000; 565 - data_ram_cnt = ha->fw_memory_size - risc_address + 1; 566 - WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_EXTENDED); 567 - clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 568 - } 569 - for (cnt = 0; cnt < data_ram_cnt && rval == QLA_SUCCESS; 570 - cnt++, risc_address++) { 571 - WRT_MAILBOX_REG(ha, reg, 1, LSW(risc_address)); 572 - WRT_MAILBOX_REG(ha, reg, 8, MSW(risc_address)); 573 - WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT); 574 - 575 - for (timer = 6000000; timer; timer--) { 576 - /* Check for pending interrupts. */ 577 - stat = RD_REG_DWORD(&reg->u.isp2300.host_status); 578 - if (stat & HSR_RISC_INT) { 579 - stat &= 0xff; 580 - 581 - if (stat == 0x1 || stat == 0x2) { 582 - set_bit(MBX_INTERRUPT, 583 - &ha->mbx_cmd_flags); 584 - 585 - mb0 = RD_MAILBOX_REG(ha, reg, 0); 586 - mb2 = RD_MAILBOX_REG(ha, reg, 2); 587 - 588 - /* Release mailbox registers. */ 589 - WRT_REG_WORD(&reg->semaphore, 0); 590 - WRT_REG_WORD(&reg->hccr, 591 - HCCR_CLR_RISC_INT); 592 - RD_REG_WORD(&reg->hccr); 593 - break; 594 - } else if (stat == 0x10 || stat == 0x11) { 595 - set_bit(MBX_INTERRUPT, 596 - &ha->mbx_cmd_flags); 597 - 598 - mb0 = RD_MAILBOX_REG(ha, reg, 0); 599 - mb2 = RD_MAILBOX_REG(ha, reg, 2); 600 - 601 - WRT_REG_WORD(&reg->hccr, 602 - HCCR_CLR_RISC_INT); 603 - RD_REG_WORD(&reg->hccr); 604 - break; 605 - } 606 - 607 - /* clear this intr; it wasn't a mailbox intr */ 608 - WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 609 - RD_REG_WORD(&reg->hccr); 610 - } 611 - udelay(5); 612 - } 613 - 614 - if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { 615 - rval = mb0 & MBS_MASK; 616 - fw->data_ram[cnt] = htons(mb2); 617 - } else { 618 - rval = QLA_FUNCTION_FAILED; 619 - } 620 - } 401 + /* Get data SRAM. */ 402 + if (rval == QLA_SUCCESS) 403 + rval = qla2xxx_dump_ram(ha, 0x11000, fw->data_ram, 404 + ha->fw_memory_size - 0x11000 + 1, &nxt); 621 405 622 406 if (rval == QLA_SUCCESS) 623 - qla2xxx_copy_queues(ha, &fw->data_ram[cnt]); 407 + qla2xxx_copy_queues(ha, nxt); 624 408 625 409 if (rval != QLA_SUCCESS) { 626 410 qla_printk(KERN_WARNING, ha, ··· 902 1010 goto qla24xx_fw_dump_failed_0; 903 1011 904 1012 rval = qla24xx_dump_memory(ha, fw->code_ram, sizeof(fw->code_ram), 905 - fw->ext_mem, &nxt); 1013 + &nxt); 906 1014 if (rval != QLA_SUCCESS) 907 1015 goto qla24xx_fw_dump_failed_0; 908 1016 ··· 1210 1318 goto qla25xx_fw_dump_failed_0; 1211 1319 1212 1320 rval = qla24xx_dump_memory(ha, fw->code_ram, sizeof(fw->code_ram), 1213 - fw->ext_mem, &nxt); 1321 + &nxt); 1214 1322 if (rval != QLA_SUCCESS) 1215 1323 goto qla25xx_fw_dump_failed_0; 1216 1324
+5 -21
drivers/scsi/qla2xxx/qla_fw.h
··· 1036 1036 uint8_t reserved_1; 1037 1037 }; 1038 1038 1039 - /* 1040 - * Virtual Fabric ID type definition. 1041 - */ 1042 - typedef struct vf_id { 1043 - uint16_t id : 12; 1044 - uint16_t priority : 4; 1045 - } vf_id_t; 1046 - 1047 - /* 1048 - * Virtual Fabric HopCt type definition. 1049 - */ 1050 - typedef struct vf_hopct { 1051 - uint16_t reserved : 8; 1052 - uint16_t hopct : 8; 1053 - } vf_hopct_t; 1054 - 1055 1039 /* 1056 1040 * Virtual Port Control IOCB 1057 1041 */ ··· 1066 1082 1067 1083 uint8_t vp_idx_map[16]; 1068 1084 uint16_t flags; 1069 - struct vf_id id; 1085 + uint16_t id; 1070 1086 uint16_t reserved_4; 1071 - struct vf_hopct hopct; 1072 - uint8_t reserved_5[8]; 1087 + uint16_t hopct; 1088 + uint8_t reserved_5[24]; 1073 1089 }; 1074 1090 1075 1091 /* ··· 1116 1132 uint16_t reserved_vp2; 1117 1133 uint8_t port_name_idx2[WWN_SIZE]; 1118 1134 uint8_t node_name_idx2[WWN_SIZE]; 1119 - struct vf_id id; 1135 + uint16_t id; 1120 1136 uint16_t reserved_4; 1121 - struct vf_hopct hopct; 1137 + uint16_t hopct; 1122 1138 uint8_t reserved_5; 1123 1139 }; 1124 1140
-4
drivers/scsi/qla2xxx/qla_gbl.h
··· 152 152 qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t); 153 153 154 154 extern int 155 - qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *, dma_addr_t, size_t, 156 - uint32_t); 157 - 158 - extern int 159 155 qla2x00_abort_command(scsi_qla_host_t *, srb_t *); 160 156 161 157 extern int
+2 -2
drivers/scsi/qla2xxx/qla_gs.c
··· 1583 1583 eiter->type = __constant_cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE); 1584 1584 eiter->len = __constant_cpu_to_be16(4 + 4); 1585 1585 max_frame_size = IS_FWI2_CAPABLE(ha) ? 1586 - (uint32_t) icb24->frame_payload_size: 1587 - (uint32_t) ha->init_cb->frame_payload_size; 1586 + le16_to_cpu(icb24->frame_payload_size): 1587 + le16_to_cpu(ha->init_cb->frame_payload_size); 1588 1588 eiter->a.max_frame_size = cpu_to_be32(max_frame_size); 1589 1589 size += 4 + 4; 1590 1590
+1 -1
drivers/scsi/qla2xxx/qla_init.c
··· 3645 3645 if (le16_to_cpu(nv->login_timeout) < 4) 3646 3646 nv->login_timeout = __constant_cpu_to_le16(4); 3647 3647 ha->login_timeout = le16_to_cpu(nv->login_timeout); 3648 - icb->login_timeout = cpu_to_le16(nv->login_timeout); 3648 + icb->login_timeout = nv->login_timeout; 3649 3649 3650 3650 /* Set minimum RATOV to 100 tenths of a second. */ 3651 3651 ha->r_a_tov = 100;
+2 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 409 409 } 410 410 411 411 set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); 412 + set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 412 413 413 414 ha->flags.management_server_logged_in = 0; 414 415 qla2x00_post_aen_work(ha, FCH_EVT_LIP, mb[1]); ··· 455 454 456 455 ha->flags.management_server_logged_in = 0; 457 456 ha->link_data_rate = PORT_SPEED_UNKNOWN; 458 - if (ql2xfdmienable) 459 - set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 460 457 qla2x00_post_aen_work(ha, FCH_EVT_LINKDOWN, 0); 461 458 break; 462 459 ··· 510 511 set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); 511 512 } 512 513 set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); 514 + set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 513 515 514 516 ha->flags.gpsc_supported = 1; 515 517 ha->flags.management_server_logged_in = 0;
+8 -11
drivers/scsi/qla2xxx/qla_mbx.c
··· 681 681 * Context: 682 682 * Kernel context. 683 683 */ 684 - int 684 + static int 685 685 qla2x00_issue_iocb_timeout(scsi_qla_host_t *ha, void *buffer, 686 686 dma_addr_t phys_addr, size_t size, uint32_t tov) 687 687 { ··· 784 784 DEBUG2_3_11(printk("qla2x00_abort_command(%ld): failed=%x.\n", 785 785 ha->host_no, rval)); 786 786 } else { 787 - sp->flags |= SRB_ABORT_PENDING; 788 787 DEBUG11(printk("qla2x00_abort_command(%ld): done.\n", 789 788 ha->host_no)); 790 789 } ··· 1468 1469 lg->port_id[0] = al_pa; 1469 1470 lg->port_id[1] = area; 1470 1471 lg->port_id[2] = domain; 1471 - lg->vp_index = cpu_to_le16(ha->vp_idx); 1472 + lg->vp_index = ha->vp_idx; 1472 1473 rval = qla2x00_issue_iocb(ha, lg, lg_dma, 0); 1473 1474 if (rval != QLA_SUCCESS) { 1474 1475 DEBUG2_3_11(printk("%s(%ld): failed to issue Login IOCB " ··· 1723 1724 lg->port_id[0] = al_pa; 1724 1725 lg->port_id[1] = area; 1725 1726 lg->port_id[2] = domain; 1726 - lg->vp_index = cpu_to_le16(ha->vp_idx); 1727 + lg->vp_index = ha->vp_idx; 1727 1728 rval = qla2x00_issue_iocb(ha, lg, lg_dma, 0); 1728 1729 if (rval != QLA_SUCCESS) { 1729 1730 DEBUG2_3_11(printk("%s(%ld): failed to issue Logout IOCB " ··· 2209 2210 rval = QLA_FUNCTION_FAILED; 2210 2211 } else { 2211 2212 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); 2212 - sp->flags |= SRB_ABORT_PENDING; 2213 2213 } 2214 2214 2215 2215 dma_pool_free(ha->s_dma_pool, abt, abt_dma); ··· 2642 2644 struct vp_rpt_id_entry_24xx *rptid_entry) 2643 2645 { 2644 2646 uint8_t vp_idx; 2647 + uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); 2645 2648 scsi_qla_host_t *vha; 2646 2649 2647 2650 if (rptid_entry->entry_status != 0) 2648 - return; 2649 - if (rptid_entry->entry_status != __constant_cpu_to_le16(CS_COMPLETE)) 2650 2651 return; 2651 2652 2652 2653 if (rptid_entry->format == 0) { ··· 2656 2659 rptid_entry->port_id[2], rptid_entry->port_id[1], 2657 2660 rptid_entry->port_id[0])); 2658 2661 } else if (rptid_entry->format == 1) { 2659 - vp_idx = LSB(rptid_entry->vp_idx); 2662 + vp_idx = LSB(stat); 2660 2663 DEBUG15(printk("%s:format 1: scsi(%ld): VP[%d] enabled " 2661 2664 "- status %d - " 2662 2665 "with port id %02x%02x%02x\n",__func__,ha->host_no, 2663 - vp_idx, MSB(rptid_entry->vp_idx), 2666 + vp_idx, MSB(stat), 2664 2667 rptid_entry->port_id[2], rptid_entry->port_id[1], 2665 2668 rptid_entry->port_id[0])); 2666 2669 if (vp_idx == 0) 2667 2670 return; 2668 2671 2669 - if (MSB(rptid_entry->vp_idx) == 1) 2672 + if (MSB(stat) == 1) 2670 2673 return; 2671 2674 2672 2675 list_for_each_entry(vha, &ha->vp_list, vp_list) ··· 2979 2982 /* We update the firmware with only one data sequence. */ 2980 2983 options |= VCO_END_OF_DATA; 2981 2984 2982 - retry = 0; 2983 2985 do { 2986 + retry = 0; 2984 2987 memset(mn, 0, sizeof(*mn)); 2985 2988 mn->p.req.entry_type = VERIFY_CHIP_IOCB_TYPE; 2986 2989 mn->p.req.entry_count = 1;
+8 -4
drivers/scsi/qla2xxx/qla_os.c
··· 67 67 68 68 static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); 69 69 70 - int ql2xfdmienable; 70 + int ql2xfdmienable=1; 71 71 module_param(ql2xfdmienable, int, S_IRUGO|S_IRUSR); 72 72 MODULE_PARM_DESC(ql2xfdmienable, 73 73 "Enables FDMI registratons " ··· 2135 2135 kfree(ha->nvram); 2136 2136 } 2137 2137 2138 - struct qla_work_evt * 2138 + static struct qla_work_evt * 2139 2139 qla2x00_alloc_work(struct scsi_qla_host *ha, enum qla_work_type type, 2140 2140 int locked) 2141 2141 { ··· 2152 2152 return e; 2153 2153 } 2154 2154 2155 - int 2155 + static int 2156 2156 qla2x00_post_work(struct scsi_qla_host *ha, struct qla_work_evt *e, int locked) 2157 2157 { 2158 2158 unsigned long flags; ··· 2373 2373 } else { 2374 2374 fcport->login_retry = 0; 2375 2375 } 2376 - if (fcport->login_retry == 0) 2376 + if (fcport->login_retry == 0 && status != QLA_SUCCESS) 2377 2377 fcport->loop_id = FC_NO_LOOP_ID; 2378 2378 } 2379 2379 if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) ··· 2598 2598 set_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags); 2599 2599 start_dpc++; 2600 2600 } 2601 + 2602 + /* Process any deferred work. */ 2603 + if (!list_empty(&ha->work_list)) 2604 + start_dpc++; 2601 2605 2602 2606 /* Schedule the DPC routine if needed */ 2603 2607 if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
+1 -1
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.02.01-k1" 10 + #define QLA2XXX_VERSION "8.02.01-k2" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 13 #define QLA_DRIVER_MINOR_VER 2
+1
drivers/scsi/scsi_priv.h
··· 121 121 extern void __scsi_remove_device(struct scsi_device *); 122 122 123 123 extern struct bus_type scsi_bus_type; 124 + extern struct attribute_group *scsi_sysfs_shost_attr_groups[]; 124 125 125 126 /* scsi_netlink.c */ 126 127 #ifdef CONFIG_SCSI_NETLINK
+6 -1
drivers/scsi/scsi_proc.c
··· 190 190 */ 191 191 static int proc_print_scsidevice(struct device *dev, void *data) 192 192 { 193 - struct scsi_device *sdev = to_scsi_device(dev); 193 + struct scsi_device *sdev; 194 194 struct seq_file *s = data; 195 195 int i; 196 196 197 + if (!scsi_is_sdev_device(dev)) 198 + goto out; 199 + 200 + sdev = to_scsi_device(dev); 197 201 seq_printf(s, 198 202 "Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n Vendor: ", 199 203 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); ··· 234 230 else 235 231 seq_printf(s, "\n"); 236 232 233 + out: 237 234 return 0; 238 235 } 239 236
+45 -41
drivers/scsi/scsi_scan.c
··· 322 322 return NULL; 323 323 } 324 324 325 + static void scsi_target_destroy(struct scsi_target *starget) 326 + { 327 + struct device *dev = &starget->dev; 328 + struct Scsi_Host *shost = dev_to_shost(dev->parent); 329 + unsigned long flags; 330 + 331 + transport_destroy_device(dev); 332 + spin_lock_irqsave(shost->host_lock, flags); 333 + if (shost->hostt->target_destroy) 334 + shost->hostt->target_destroy(starget); 335 + list_del_init(&starget->siblings); 336 + spin_unlock_irqrestore(shost->host_lock, flags); 337 + put_device(dev); 338 + } 339 + 325 340 static void scsi_target_dev_release(struct device *dev) 326 341 { 327 342 struct device *parent = dev->parent; ··· 346 331 put_device(parent); 347 332 } 348 333 334 + struct device_type scsi_target_type = { 335 + .name = "scsi_target", 336 + .release = scsi_target_dev_release, 337 + }; 338 + 349 339 int scsi_is_target_device(const struct device *dev) 350 340 { 351 - return dev->release == scsi_target_dev_release; 341 + return dev->type == &scsi_target_type; 352 342 } 353 343 EXPORT_SYMBOL(scsi_is_target_device); 354 344 ··· 411 391 device_initialize(dev); 412 392 starget->reap_ref = 1; 413 393 dev->parent = get_device(parent); 414 - dev->release = scsi_target_dev_release; 415 394 sprintf(dev->bus_id, "target%d:%d:%d", 416 395 shost->host_no, channel, id); 396 + #ifndef CONFIG_SYSFS_DEPRECATED 397 + dev->bus = &scsi_bus_type; 398 + #endif 399 + dev->type = &scsi_target_type; 417 400 starget->id = id; 418 401 starget->channel = channel; 419 402 INIT_LIST_HEAD(&starget->siblings); 420 403 INIT_LIST_HEAD(&starget->devices); 421 - starget->state = STARGET_RUNNING; 404 + starget->state = STARGET_CREATED; 422 405 starget->scsi_level = SCSI_2; 423 406 retry: 424 407 spin_lock_irqsave(shost->host_lock, flags); ··· 434 411 spin_unlock_irqrestore(shost->host_lock, flags); 435 412 /* allocate and add */ 436 413 transport_setup_device(dev); 437 - error = device_add(dev); 438 - if (error) { 439 - dev_err(dev, "target device_add failed, error %d\n", error); 440 - spin_lock_irqsave(shost->host_lock, flags); 441 - list_del_init(&starget->siblings); 442 - spin_unlock_irqrestore(shost->host_lock, flags); 443 - transport_destroy_device(dev); 444 - put_device(parent); 445 - kfree(starget); 446 - return NULL; 447 - } 448 - transport_add_device(dev); 449 414 if (shost->hostt->target_alloc) { 450 415 error = shost->hostt->target_alloc(starget); 451 416 ··· 441 430 dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error); 442 431 /* don't want scsi_target_reap to do the final 443 432 * put because it will be under the host lock */ 444 - get_device(dev); 445 - scsi_target_reap(starget); 446 - put_device(dev); 433 + scsi_target_destroy(starget); 447 434 return NULL; 448 435 } 449 436 } ··· 468 459 { 469 460 struct scsi_target *starget = 470 461 container_of(work, struct scsi_target, ew.work); 471 - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 472 - unsigned long flags; 473 462 474 463 transport_remove_device(&starget->dev); 475 464 device_del(&starget->dev); 476 - transport_destroy_device(&starget->dev); 477 - spin_lock_irqsave(shost->host_lock, flags); 478 - if (shost->hostt->target_destroy) 479 - shost->hostt->target_destroy(starget); 480 - list_del_init(&starget->siblings); 481 - spin_unlock_irqrestore(shost->host_lock, flags); 482 - put_device(&starget->dev); 465 + scsi_target_destroy(starget); 483 466 } 484 467 485 468 /** ··· 486 485 { 487 486 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 488 487 unsigned long flags; 488 + enum scsi_target_state state; 489 + int empty; 489 490 490 491 spin_lock_irqsave(shost->host_lock, flags); 491 - 492 - if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { 493 - BUG_ON(starget->state == STARGET_DEL); 494 - starget->state = STARGET_DEL; 495 - spin_unlock_irqrestore(shost->host_lock, flags); 496 - execute_in_process_context(scsi_target_reap_usercontext, 497 - &starget->ew); 498 - return; 499 - 500 - } 492 + state = starget->state; 493 + empty = --starget->reap_ref == 0 && 494 + list_empty(&starget->devices) ? 1 : 0; 501 495 spin_unlock_irqrestore(shost->host_lock, flags); 502 496 503 - return; 497 + if (!empty) 498 + return; 499 + 500 + BUG_ON(state == STARGET_DEL); 501 + starget->state = STARGET_DEL; 502 + if (state == STARGET_CREATED) 503 + scsi_target_destroy(starget); 504 + else 505 + execute_in_process_context(scsi_target_reap_usercontext, 506 + &starget->ew); 504 507 } 505 508 506 509 /** ··· 1053 1048 scsi_inq_str(vend, result, 8, 16), 1054 1049 scsi_inq_str(mod, result, 16, 32)); 1055 1050 }); 1051 + 1056 1052 } 1057 - 1053 + 1058 1054 res = SCSI_SCAN_TARGET_PRESENT; 1059 1055 goto out_free_result; 1060 1056 } ··· 1495 1489 if (scsi_host_scan_allowed(shost)) 1496 1490 scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); 1497 1491 mutex_unlock(&shost->scan_mutex); 1498 - transport_configure_device(&starget->dev); 1499 1492 scsi_target_reap(starget); 1500 1493 put_device(&starget->dev); 1501 1494 ··· 1575 1570 out_reap: 1576 1571 /* now determine if the target has any children at all 1577 1572 * and if not, nuke it */ 1578 - transport_configure_device(&starget->dev); 1579 1573 scsi_target_reap(starget); 1580 1574 1581 1575 put_device(&starget->dev);
+75 -67
drivers/scsi/scsi_sysfs.c
··· 21 21 #include "scsi_priv.h" 22 22 #include "scsi_logging.h" 23 23 24 + static struct device_type scsi_dev_type; 25 + 24 26 static const struct { 25 27 enum scsi_device_state value; 26 28 char *name; ··· 251 249 shost_rd_attr(unchecked_isa_dma, "%d\n"); 252 250 shost_rd_attr2(proc_name, hostt->proc_name, "%s\n"); 253 251 254 - static struct device_attribute *scsi_sysfs_shost_attrs[] = { 255 - &dev_attr_unique_id, 256 - &dev_attr_host_busy, 257 - &dev_attr_cmd_per_lun, 258 - &dev_attr_can_queue, 259 - &dev_attr_sg_tablesize, 260 - &dev_attr_unchecked_isa_dma, 261 - &dev_attr_proc_name, 262 - &dev_attr_scan, 263 - &dev_attr_hstate, 264 - &dev_attr_supported_mode, 265 - &dev_attr_active_mode, 252 + static struct attribute *scsi_sysfs_shost_attrs[] = { 253 + &dev_attr_unique_id.attr, 254 + &dev_attr_host_busy.attr, 255 + &dev_attr_cmd_per_lun.attr, 256 + &dev_attr_can_queue.attr, 257 + &dev_attr_sg_tablesize.attr, 258 + &dev_attr_unchecked_isa_dma.attr, 259 + &dev_attr_proc_name.attr, 260 + &dev_attr_scan.attr, 261 + &dev_attr_hstate.attr, 262 + &dev_attr_supported_mode.attr, 263 + &dev_attr_active_mode.attr, 264 + NULL 265 + }; 266 + 267 + struct attribute_group scsi_shost_attr_group = { 268 + .attrs = scsi_sysfs_shost_attrs, 269 + }; 270 + 271 + struct attribute_group *scsi_sysfs_shost_attr_groups[] = { 272 + &scsi_shost_attr_group, 266 273 NULL 267 274 }; 268 275 ··· 346 335 /* all probing is done in the individual ->probe routines */ 347 336 static int scsi_bus_match(struct device *dev, struct device_driver *gendrv) 348 337 { 349 - struct scsi_device *sdp = to_scsi_device(dev); 338 + struct scsi_device *sdp; 339 + 340 + if (dev->type != &scsi_dev_type) 341 + return 0; 342 + 343 + sdp = to_scsi_device(dev); 350 344 if (sdp->no_uld_attach) 351 345 return 0; 352 346 return (sdp->inq_periph_qual == SCSI_INQ_PQ_CON)? 1: 0; ··· 367 351 368 352 static int scsi_bus_suspend(struct device * dev, pm_message_t state) 369 353 { 370 - struct device_driver *drv = dev->driver; 371 - struct scsi_device *sdev = to_scsi_device(dev); 354 + struct device_driver *drv; 355 + struct scsi_device *sdev; 372 356 int err; 357 + 358 + if (dev->type != &scsi_dev_type) 359 + return 0; 360 + 361 + drv = dev->driver; 362 + sdev = to_scsi_device(dev); 373 363 374 364 err = scsi_device_quiesce(sdev); 375 365 if (err) ··· 392 370 393 371 static int scsi_bus_resume(struct device * dev) 394 372 { 395 - struct device_driver *drv = dev->driver; 396 - struct scsi_device *sdev = to_scsi_device(dev); 373 + struct device_driver *drv; 374 + struct scsi_device *sdev; 397 375 int err = 0; 376 + 377 + if (dev->type != &scsi_dev_type) 378 + return 0; 379 + 380 + drv = dev->driver; 381 + sdev = to_scsi_device(dev); 398 382 399 383 if (drv && drv->resume) 400 384 err = drv->resume(dev); ··· 809 781 return count; 810 782 } 811 783 784 + static int scsi_target_add(struct scsi_target *starget) 785 + { 786 + int error; 787 + 788 + if (starget->state != STARGET_CREATED) 789 + return 0; 790 + 791 + error = device_add(&starget->dev); 792 + if (error) { 793 + dev_err(&starget->dev, "target device_add failed, error %d\n", error); 794 + get_device(&starget->dev); 795 + scsi_target_reap(starget); 796 + put_device(&starget->dev); 797 + return error; 798 + } 799 + transport_add_device(&starget->dev); 800 + starget->state = STARGET_RUNNING; 801 + 802 + return 0; 803 + } 804 + 812 805 static struct device_attribute sdev_attr_queue_type_rw = 813 806 __ATTR(queue_type, S_IRUGO | S_IWUSR, show_queue_type_field, 814 807 sdev_store_queue_type_rw); ··· 845 796 { 846 797 int error, i; 847 798 struct request_queue *rq = sdev->request_queue; 799 + struct scsi_target *starget = sdev->sdev_target; 848 800 849 801 if ((error = scsi_device_set_state(sdev, SDEV_RUNNING)) != 0) 850 802 return error; 851 803 804 + error = scsi_target_add(starget); 805 + if (error) 806 + return error; 807 + 808 + transport_configure_device(&starget->dev); 852 809 error = device_add(&sdev->sdev_gendev); 853 810 if (error) { 854 811 put_device(sdev->sdev_gendev.parent); ··· 889 834 goto out; 890 835 } 891 836 892 - error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL); 837 + error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL); 893 838 894 839 if (error) 895 840 sdev_printk(KERN_INFO, sdev, ··· 1026 971 } 1027 972 EXPORT_SYMBOL(scsi_register_interface); 1028 973 1029 - 1030 - static struct device_attribute *class_attr_overridden( 1031 - struct device_attribute **attrs, 1032 - struct device_attribute *attr) 1033 - { 1034 - int i; 1035 - 1036 - if (!attrs) 1037 - return NULL; 1038 - for (i = 0; attrs[i]; i++) 1039 - if (!strcmp(attrs[i]->attr.name, attr->attr.name)) 1040 - return attrs[i]; 1041 - return NULL; 1042 - } 1043 - 1044 - static int class_attr_add(struct device *classdev, 1045 - struct device_attribute *attr) 1046 - { 1047 - struct device_attribute *base_attr; 1048 - 1049 - /* 1050 - * Spare the caller from having to copy things it's not interested in. 1051 - */ 1052 - base_attr = class_attr_overridden(scsi_sysfs_shost_attrs, attr); 1053 - if (base_attr) { 1054 - /* extend permissions */ 1055 - attr->attr.mode |= base_attr->attr.mode; 1056 - 1057 - /* override null show/store with default */ 1058 - if (!attr->show) 1059 - attr->show = base_attr->show; 1060 - if (!attr->store) 1061 - attr->store = base_attr->store; 1062 - } 1063 - 1064 - return device_create_file(classdev, attr); 1065 - } 1066 - 1067 974 /** 1068 975 * scsi_sysfs_add_host - add scsi host to subsystem 1069 976 * @shost: scsi host struct to add to subsystem ··· 1035 1018 { 1036 1019 int error, i; 1037 1020 1021 + /* add host specific attributes */ 1038 1022 if (shost->hostt->shost_attrs) { 1039 1023 for (i = 0; shost->hostt->shost_attrs[i]; i++) { 1040 - error = class_attr_add(&shost->shost_dev, 1041 - shost->hostt->shost_attrs[i]); 1042 - if (error) 1043 - return error; 1044 - } 1045 - } 1046 - 1047 - for (i = 0; scsi_sysfs_shost_attrs[i]; i++) { 1048 - if (!class_attr_overridden(shost->hostt->shost_attrs, 1049 - scsi_sysfs_shost_attrs[i])) { 1050 1024 error = device_create_file(&shost->shost_dev, 1051 - scsi_sysfs_shost_attrs[i]); 1025 + shost->hostt->shost_attrs[i]); 1052 1026 if (error) 1053 1027 return error; 1054 1028 }
+53 -7
drivers/scsi/scsi_transport_fc.c
··· 1961 1961 } 1962 1962 1963 1963 /* 1964 - * Must be called with shost->host_lock held 1964 + * Called by fc_user_scan to locate an rport on the shost that 1965 + * matches the channel and target id, and invoke scsi_scan_target() 1966 + * on the rport. 1965 1967 */ 1966 - static int fc_user_scan(struct Scsi_Host *shost, uint channel, 1967 - uint id, uint lun) 1968 + static void 1969 + fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, uint lun) 1968 1970 { 1969 1971 struct fc_rport *rport; 1972 + unsigned long flags; 1973 + 1974 + spin_lock_irqsave(shost->host_lock, flags); 1970 1975 1971 1976 list_for_each_entry(rport, &fc_host_rports(shost), peers) { 1972 1977 if (rport->scsi_target_id == -1) ··· 1980 1975 if (rport->port_state != FC_PORTSTATE_ONLINE) 1981 1976 continue; 1982 1977 1983 - if ((channel == SCAN_WILD_CARD || channel == rport->channel) && 1984 - (id == SCAN_WILD_CARD || id == rport->scsi_target_id)) { 1985 - scsi_scan_target(&rport->dev, rport->channel, 1986 - rport->scsi_target_id, lun, 1); 1978 + if ((channel == rport->channel) && 1979 + (id == rport->scsi_target_id)) { 1980 + spin_unlock_irqrestore(shost->host_lock, flags); 1981 + scsi_scan_target(&rport->dev, channel, id, lun, 1); 1982 + return; 1987 1983 } 1988 1984 } 1985 + 1986 + spin_unlock_irqrestore(shost->host_lock, flags); 1987 + } 1988 + 1989 + /* 1990 + * Called via sysfs scan routines. Necessary, as the FC transport 1991 + * wants to place all target objects below the rport object. So this 1992 + * routine must invoke the scsi_scan_target() routine with the rport 1993 + * object as the parent. 1994 + */ 1995 + static int 1996 + fc_user_scan(struct Scsi_Host *shost, uint channel, uint id, uint lun) 1997 + { 1998 + uint chlo, chhi; 1999 + uint tgtlo, tgthi; 2000 + 2001 + if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || 2002 + ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) || 2003 + ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) 2004 + return -EINVAL; 2005 + 2006 + if (channel == SCAN_WILD_CARD) { 2007 + chlo = 0; 2008 + chhi = shost->max_channel + 1; 2009 + } else { 2010 + chlo = channel; 2011 + chhi = channel + 1; 2012 + } 2013 + 2014 + if (id == SCAN_WILD_CARD) { 2015 + tgtlo = 0; 2016 + tgthi = shost->max_id; 2017 + } else { 2018 + tgtlo = id; 2019 + tgthi = id + 1; 2020 + } 2021 + 2022 + for ( ; chlo < chhi; chlo++) 2023 + for ( ; tgtlo < tgthi; tgtlo++) 2024 + fc_user_scan_tgt(shost, chlo, tgtlo, lun); 1989 2025 1990 2026 return 0; 1991 2027 }
+20 -2
drivers/scsi/scsi_transport_sas.c
··· 192 192 sas_smp_request(q, rphy_to_shost(rphy), rphy); 193 193 } 194 194 195 + static void sas_host_release(struct device *dev) 196 + { 197 + struct Scsi_Host *shost = dev_to_shost(dev); 198 + struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 199 + struct request_queue *q = sas_host->q; 200 + 201 + if (q) 202 + blk_cleanup_queue(q); 203 + } 204 + 195 205 static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy) 196 206 { 197 207 struct request_queue *q; ··· 209 199 struct device *dev; 210 200 char namebuf[BUS_ID_SIZE]; 211 201 const char *name; 202 + void (*release)(struct device *); 212 203 213 204 if (!to_sas_internal(shost->transportt)->f->smp_handler) { 214 205 printk("%s can't handle SMP requests\n", shost->hostt->name); ··· 220 209 q = blk_init_queue(sas_non_host_smp_request, NULL); 221 210 dev = &rphy->dev; 222 211 name = dev->bus_id; 212 + release = NULL; 223 213 } else { 224 214 q = blk_init_queue(sas_host_smp_request, NULL); 225 215 dev = &shost->shost_gendev; 226 216 snprintf(namebuf, sizeof(namebuf), 227 217 "sas_host%d", shost->host_no); 228 218 name = namebuf; 219 + release = sas_host_release; 229 220 } 230 221 if (!q) 231 222 return -ENOMEM; 232 223 233 - error = bsg_register_queue(q, dev, name); 224 + error = bsg_register_queue(q, dev, name, release); 234 225 if (error) { 235 226 blk_cleanup_queue(q); 236 227 return -ENOMEM; ··· 266 253 return; 267 254 268 255 bsg_unregister_queue(q); 269 - blk_cleanup_queue(q); 270 256 } 271 257 272 258 /* ··· 1313 1301 struct sas_rphy *rphy = dev_to_rphy(dev); 1314 1302 struct sas_expander_device *edev = rphy_to_expander_device(rphy); 1315 1303 1304 + if (rphy->q) 1305 + blk_cleanup_queue(rphy->q); 1306 + 1316 1307 put_device(dev->parent); 1317 1308 kfree(edev); 1318 1309 } ··· 1324 1309 { 1325 1310 struct sas_rphy *rphy = dev_to_rphy(dev); 1326 1311 struct sas_end_device *edev = rphy_to_end_device(rphy); 1312 + 1313 + if (rphy->q) 1314 + blk_cleanup_queue(rphy->q); 1327 1315 1328 1316 put_device(dev->parent); 1329 1317 kfree(edev);
+8 -23
drivers/scsi/scsi_transport_spi.c
··· 24 24 #include <linux/workqueue.h> 25 25 #include <linux/blkdev.h> 26 26 #include <linux/mutex.h> 27 + #include <linux/sysfs.h> 27 28 #include <scsi/scsi.h> 28 29 #include "scsi_priv.h" 29 30 #include <scsi/scsi_device.h> ··· 1375 1374 * overloads the return by setting 1<<1 if the attribute should 1376 1375 * be writeable */ 1377 1376 #define TARGET_ATTRIBUTE_HELPER(name) \ 1378 - (si->f->show_##name ? 1 : 0) + \ 1379 - (si->f->set_##name ? 2 : 0) 1377 + (si->f->show_##name ? S_IRUGO : 0) | \ 1378 + (si->f->set_##name ? S_IWUSR : 0) 1380 1379 1381 - static int target_attribute_is_visible(struct kobject *kobj, 1382 - struct attribute *attr, int i) 1380 + static mode_t target_attribute_is_visible(struct kobject *kobj, 1381 + struct attribute *attr, int i) 1383 1382 { 1384 1383 struct device *cdev = container_of(kobj, struct device, kobj); 1385 1384 struct scsi_target *starget = transport_class_to_starget(cdev); ··· 1429 1428 spi_support_ius(starget)) 1430 1429 return TARGET_ATTRIBUTE_HELPER(hold_mcs); 1431 1430 else if (attr == &dev_attr_revalidate.attr) 1432 - return 1; 1431 + return S_IWUSR; 1433 1432 1434 1433 return 0; 1435 1434 } ··· 1463 1462 struct device *cdev) 1464 1463 { 1465 1464 struct kobject *kobj = &cdev->kobj; 1466 - int i; 1467 - struct attribute *attr; 1468 - int rc; 1469 1465 1470 - for (i = 0; (attr = target_attributes[i]) != NULL; i++) { 1471 - int j = target_attribute_group.is_visible(kobj, attr, i); 1472 - 1473 - /* FIXME: as well as returning -EEXIST, which we'd like 1474 - * to ignore, sysfs also does a WARN_ON and dumps a trace, 1475 - * which is bad, so temporarily, skip attributes that are 1476 - * already visible (the revalidate one) */ 1477 - if (j && attr != &dev_attr_revalidate.attr) 1478 - rc = sysfs_add_file_to_group(kobj, attr, 1479 - target_attribute_group.name); 1480 - /* and make the attribute writeable if we have a set 1481 - * function */ 1482 - if ((j & 1)) 1483 - rc = sysfs_chmod_file(kobj, attr, attr->mode | S_IWUSR); 1484 - } 1466 + /* force an update based on parameters read from the device */ 1467 + sysfs_update_group(kobj, &target_attribute_group); 1485 1468 1486 1469 return 0; 1487 1470 }
+3 -1
drivers/scsi/sgiwd93.c
··· 313 313 .probe = sgiwd93_probe, 314 314 .remove = __devexit_p(sgiwd93_remove), 315 315 .driver = { 316 - .name = "sgiwd93" 316 + .name = "sgiwd93", 317 + .owner = THIS_MODULE, 317 318 } 318 319 }; 319 320 ··· 334 333 MODULE_DESCRIPTION("SGI WD33C93 driver"); 335 334 MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>"); 336 335 MODULE_LICENSE("GPL"); 336 + MODULE_ALIAS("platform:sgiwd93");
+2
drivers/scsi/sni_53c710.c
··· 53 53 MODULE_AUTHOR("Thomas Bogend�rfer"); 54 54 MODULE_DESCRIPTION("SNI RM 53c710 SCSI Driver"); 55 55 MODULE_LICENSE("GPL"); 56 + MODULE_ALIAS("platform:snirm_53c710"); 56 57 57 58 #define SNIRM710_CLOCK 32 58 59 ··· 137 136 .remove = __devexit_p(snirm710_driver_remove), 138 137 .driver = { 139 138 .name = "snirm_53c710", 139 + .owner = THIS_MODULE, 140 140 }, 141 141 }; 142 142
+5 -5
drivers/scsi/st.c
··· 4322 4322 static ssize_t 4323 4323 st_defined_show(struct device *dev, struct device_attribute *attr, char *buf) 4324 4324 { 4325 - struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev); 4325 + struct st_modedef *STm = dev_get_drvdata(dev); 4326 4326 ssize_t l = 0; 4327 4327 4328 4328 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); ··· 4334 4334 static ssize_t 4335 4335 st_defblk_show(struct device *dev, struct device_attribute *attr, char *buf) 4336 4336 { 4337 - struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev); 4337 + struct st_modedef *STm = dev_get_drvdata(dev); 4338 4338 ssize_t l = 0; 4339 4339 4340 4340 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); ··· 4346 4346 static ssize_t 4347 4347 st_defdensity_show(struct device *dev, struct device_attribute *attr, char *buf) 4348 4348 { 4349 - struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev); 4349 + struct st_modedef *STm = dev_get_drvdata(dev); 4350 4350 ssize_t l = 0; 4351 4351 char *fmt; 4352 4352 ··· 4361 4361 st_defcompression_show(struct device *dev, struct device_attribute *attr, 4362 4362 char *buf) 4363 4363 { 4364 - struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev); 4364 + struct st_modedef *STm = dev_get_drvdata(dev); 4365 4365 ssize_t l = 0; 4366 4366 4367 4367 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); ··· 4373 4373 static ssize_t 4374 4374 st_options_show(struct device *dev, struct device_attribute *attr, char *buf) 4375 4375 { 4376 - struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev); 4376 + struct st_modedef *STm = dev_get_drvdata(dev); 4377 4377 struct scsi_tape *STp; 4378 4378 int i, j, options; 4379 4379 ssize_t l = 0;
+2
drivers/scsi/sun3x_esp.c
··· 294 294 .remove = __devexit_p(esp_sun3x_remove), 295 295 .driver = { 296 296 .name = "sun3x_esp", 297 + .owner = THIS_MODULE, 297 298 }, 298 299 }; 299 300 ··· 315 314 316 315 module_init(sun3x_esp_init); 317 316 module_exit(sun3x_esp_exit); 317 + MODULE_ALIAS("platform:sun3x_esp");
+4 -5
drivers/scsi/u14-34f.c
··· 1715 1715 1716 1716 } 1717 1717 1718 - static irqreturn_t ihdlr(int irq, unsigned int j) { 1718 + static irqreturn_t ihdlr(unsigned int j) 1719 + { 1719 1720 struct scsi_cmnd *SCpnt; 1720 1721 unsigned int i, k, c, status, tstatus, reg, ret; 1721 1722 struct mscp *spp, *cpp; 1722 - 1723 - if (sh[j]->irq != irq) 1724 - panic("%s: ihdlr, irq %d, sh[j]->irq %d.\n", BN(j), irq, sh[j]->irq); 1723 + int irq = sh[j]->irq; 1725 1724 1726 1725 /* Check if this board need to be serviced */ 1727 1726 if (!((reg = inb(sh[j]->io_port + REG_SYS_INTR)) & IRQ_ASSERTED)) goto none; ··· 1934 1935 if ((j = (unsigned int)((char *)shap - sha)) >= num_boards) return IRQ_NONE; 1935 1936 1936 1937 spin_lock_irqsave(sh[j]->host_lock, spin_flags); 1937 - ret = ihdlr(irq, j); 1938 + ret = ihdlr(j); 1938 1939 spin_unlock_irqrestore(sh[j]->host_lock, spin_flags); 1939 1940 return ret; 1940 1941 }
+10 -4
fs/sysfs/file.c
··· 477 477 .poll = sysfs_poll, 478 478 }; 479 479 480 - 481 - int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr, 482 - int type) 480 + int sysfs_add_file_mode(struct sysfs_dirent *dir_sd, 481 + const struct attribute *attr, int type, mode_t amode) 483 482 { 484 - umode_t mode = (attr->mode & S_IALLUGO) | S_IFREG; 483 + umode_t mode = (amode & S_IALLUGO) | S_IFREG; 485 484 struct sysfs_addrm_cxt acxt; 486 485 struct sysfs_dirent *sd; 487 486 int rc; ··· 498 499 sysfs_put(sd); 499 500 500 501 return rc; 502 + } 503 + 504 + 505 + int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr, 506 + int type) 507 + { 508 + return sysfs_add_file_mode(dir_sd, attr, type, attr->mode); 501 509 } 502 510 503 511
+70 -13
fs/sysfs/group.c
··· 23 23 int i; 24 24 25 25 for (i = 0, attr = grp->attrs; *attr; i++, attr++) 26 - if (!grp->is_visible || 27 - grp->is_visible(kobj, *attr, i)) 28 - sysfs_hash_and_remove(dir_sd, (*attr)->name); 26 + sysfs_hash_and_remove(dir_sd, (*attr)->name); 29 27 } 30 28 31 29 static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj, 32 - const struct attribute_group *grp) 30 + const struct attribute_group *grp, int update) 33 31 { 34 32 struct attribute *const* attr; 35 33 int error = 0, i; 36 34 37 - for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) 38 - if (!grp->is_visible || 39 - grp->is_visible(kobj, *attr, i)) 40 - error |= 41 - sysfs_add_file(dir_sd, *attr, SYSFS_KOBJ_ATTR); 35 + for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) { 36 + mode_t mode = 0; 37 + 38 + /* in update mode, we're changing the permissions or 39 + * visibility. Do this by first removing then 40 + * re-adding (if required) the file */ 41 + if (update) 42 + sysfs_hash_and_remove(dir_sd, (*attr)->name); 43 + if (grp->is_visible) { 44 + mode = grp->is_visible(kobj, *attr, i); 45 + if (!mode) 46 + continue; 47 + } 48 + error = sysfs_add_file_mode(dir_sd, *attr, SYSFS_KOBJ_ATTR, 49 + (*attr)->mode | mode); 50 + if (unlikely(error)) 51 + break; 52 + } 42 53 if (error) 43 54 remove_files(dir_sd, kobj, grp); 44 55 return error; 45 56 } 46 57 47 58 48 - int sysfs_create_group(struct kobject * kobj, 49 - const struct attribute_group * grp) 59 + static int internal_create_group(struct kobject *kobj, int update, 60 + const struct attribute_group *grp) 50 61 { 51 62 struct sysfs_dirent *sd; 52 63 int error; 53 64 54 - BUG_ON(!kobj || !kobj->sd); 65 + BUG_ON(!kobj || (!update && !kobj->sd)); 66 + 67 + /* Updates may happen before the object has been instantiated */ 68 + if (unlikely(update && !kobj->sd)) 69 + return -EINVAL; 55 70 56 71 if (grp->name) { 57 72 error = sysfs_create_subdir(kobj, grp->name, &sd); ··· 75 60 } else 76 61 sd = kobj->sd; 77 62 sysfs_get(sd); 78 - error = create_files(sd, kobj, grp); 63 + error = create_files(sd, kobj, grp, update); 79 64 if (error) { 80 65 if (grp->name) 81 66 sysfs_remove_subdir(sd); ··· 83 68 sysfs_put(sd); 84 69 return error; 85 70 } 71 + 72 + /** 73 + * sysfs_create_group - given a directory kobject, create an attribute group 74 + * @kobj: The kobject to create the group on 75 + * @grp: The attribute group to create 76 + * 77 + * This function creates a group for the first time. It will explicitly 78 + * warn and error if any of the attribute files being created already exist. 79 + * 80 + * Returns 0 on success or error. 81 + */ 82 + int sysfs_create_group(struct kobject *kobj, 83 + const struct attribute_group *grp) 84 + { 85 + return internal_create_group(kobj, 0, grp); 86 + } 87 + 88 + /** 89 + * sysfs_update_group - given a directory kobject, create an attribute group 90 + * @kobj: The kobject to create the group on 91 + * @grp: The attribute group to create 92 + * 93 + * This function updates an attribute group. Unlike 94 + * sysfs_create_group(), it will explicitly not warn or error if any 95 + * of the attribute files being created already exist. Furthermore, 96 + * if the visibility of the files has changed through the is_visible() 97 + * callback, it will update the permissions and add or remove the 98 + * relevant files. 99 + * 100 + * The primary use for this function is to call it after making a change 101 + * that affects group visibility. 102 + * 103 + * Returns 0 on success or error. 104 + */ 105 + int sysfs_update_group(struct kobject *kobj, 106 + const struct attribute_group *grp) 107 + { 108 + return internal_create_group(kobj, 1, grp); 109 + } 110 + 111 + 86 112 87 113 void sysfs_remove_group(struct kobject * kobj, 88 114 const struct attribute_group * grp) ··· 151 95 152 96 153 97 EXPORT_SYMBOL_GPL(sysfs_create_group); 98 + EXPORT_SYMBOL_GPL(sysfs_update_group); 154 99 EXPORT_SYMBOL_GPL(sysfs_remove_group);
+2
fs/sysfs/sysfs.h
··· 154 154 int sysfs_add_file(struct sysfs_dirent *dir_sd, 155 155 const struct attribute *attr, int type); 156 156 157 + int sysfs_add_file_mode(struct sysfs_dirent *dir_sd, 158 + const struct attribute *attr, int type, mode_t amode); 157 159 /* 158 160 * bin.c 159 161 */
+10 -4
include/linux/bsg.h
··· 56 56 #if defined(CONFIG_BLK_DEV_BSG) 57 57 struct bsg_class_device { 58 58 struct device *class_dev; 59 - struct device *dev; 59 + struct device *parent; 60 60 int minor; 61 61 struct request_queue *queue; 62 + struct kref ref; 63 + void (*release)(struct device *); 62 64 }; 63 65 64 - extern int bsg_register_queue(struct request_queue *, struct device *, const char *); 66 + extern int bsg_register_queue(struct request_queue *q, 67 + struct device *parent, const char *name, 68 + void (*release)(struct device *)); 65 69 extern void bsg_unregister_queue(struct request_queue *); 66 70 #else 67 - static inline int bsg_register_queue(struct request_queue * rq, struct device *dev, const char *name) 71 + static inline int bsg_register_queue(struct request_queue *q, 72 + struct device *parent, const char *name, 73 + void (*release)(struct device *)) 68 74 { 69 75 return 0; 70 76 } 71 - static inline void bsg_unregister_queue(struct request_queue *rq) 77 + static inline void bsg_unregister_queue(struct request_queue *q) 72 78 { 73 79 } 74 80 #endif
+3 -1
include/linux/sysfs.h
··· 32 32 33 33 struct attribute_group { 34 34 const char *name; 35 - int (*is_visible)(struct kobject *, 35 + mode_t (*is_visible)(struct kobject *, 36 36 struct attribute *, int); 37 37 struct attribute **attrs; 38 38 }; ··· 105 105 106 106 int __must_check sysfs_create_group(struct kobject *kobj, 107 107 const struct attribute_group *grp); 108 + int sysfs_update_group(struct kobject *kobj, 109 + const struct attribute_group *grp); 108 110 void sysfs_remove_group(struct kobject *kobj, 109 111 const struct attribute_group *grp); 110 112 int sysfs_add_file_to_group(struct kobject *kobj,
+2 -1
include/scsi/scsi_device.h
··· 181 181 sdev_printk(prefix, (scmd)->device, fmt, ##a) 182 182 183 183 enum scsi_target_state { 184 - STARGET_RUNNING = 1, 184 + STARGET_CREATED = 1, 185 + STARGET_RUNNING, 185 186 STARGET_DEL, 186 187 }; 187 188