/* * sym53c500_cs.c Bob Tracy (rct@frus.com) * * A rewrite of the pcmcia-cs add-on driver for newer (circa 1997) * New Media Bus Toaster PCMCIA SCSI cards using the Symbios Logic * 53c500 controller: intended for use with 2.6 and later kernels. * The pcmcia-cs add-on version of this driver is not supported * beyond 2.4. It consisted of three files with history/copyright * information as follows: * * SYM53C500.h * Bob Tracy (rct@frus.com) * Original by Tom Corner (tcorner@via.at). * Adapted from NCR53c406a.h which is Copyrighted (C) 1994 * Normunds Saumanis (normunds@rx.tech.swh.lv) * * SYM53C500.c * Bob Tracy (rct@frus.com) * Original driver by Tom Corner (tcorner@via.at) was adapted * from NCR53c406a.c which is Copyrighted (C) 1994, 1995, 1996 * Normunds Saumanis (normunds@fi.ibm.com) * * sym53c500.c * Bob Tracy (rct@frus.com) * Original by Tom Corner (tcorner@via.at) was adapted from a * driver for the Qlogic SCSI card written by * David Hinds (dhinds@allegro.stanford.edu). * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ #define SYM53C500_DEBUG 0 #define VERBOSE_SYM53C500_DEBUG 0 /* * Set this to 0 if you encounter kernel lockups while transferring * data in PIO mode. Note this can be changed via "sysfs". */ #define USE_FAST_PIO 1 /* =============== End of user configurable parameters ============== */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* ================================================================== */ #define SYNC_MODE 0 /* Synchronous transfer mode */ /* Default configuration */ #define C1_IMG 0x07 /* ID=7 */ #define C2_IMG 0x48 /* FE SCSI2 */ #define C3_IMG 0x20 /* CDB */ #define C4_IMG 0x04 /* ANE */ #define C5_IMG 0xa4 /* ? changed from b6= AA PI SIE POL */ #define C7_IMG 0x80 /* added for SYM53C500 t. corner */ /* Hardware Registers: offsets from io_port (base) */ /* Control Register Set 0 */ #define TC_LSB 0x00 /* transfer counter lsb */ #define TC_MSB 0x01 /* transfer counter msb */ #define SCSI_FIFO 0x02 /* scsi fifo register */ #define CMD_REG 0x03 /* command register */ #define STAT_REG 0x04 /* status register */ #define DEST_ID 0x04 /* selection/reselection bus id */ #define INT_REG 0x05 /* interrupt status register */ #define SRTIMOUT 0x05 /* select/reselect timeout reg */ #define SEQ_REG 0x06 /* sequence step register */ #define SYNCPRD 0x06 /* synchronous transfer period */ #define FIFO_FLAGS 0x07 /* indicates # of bytes in fifo */ #define SYNCOFF 0x07 /* synchronous offset register */ #define CONFIG1 0x08 /* configuration register */ #define CLKCONV 0x09 /* clock conversion register */ /* #define TESTREG 0x0A */ /* test mode register */ #define CONFIG2 0x0B /* configuration 2 register */ #define CONFIG3 0x0C /* configuration 3 register */ #define CONFIG4 0x0D /* configuration 4 register */ #define TC_HIGH 0x0E /* transfer counter high */ /* #define FIFO_BOTTOM 0x0F */ /* reserve FIFO byte register */ /* Control Register Set 1 */ /* #define JUMPER_SENSE 0x00 */ /* jumper sense port reg (r/w) */ /* #define SRAM_PTR 0x01 */ /* SRAM address pointer reg (r/w) */ /* #define SRAM_DATA 0x02 */ /* SRAM data register (r/w) */ #define PIO_FIFO 0x04 /* PIO FIFO registers (r/w) */ /* #define PIO_FIFO1 0x05 */ /* */ /* #define PIO_FIFO2 0x06 */ /* */ /* #define PIO_FIFO3 0x07 */ /* */ #define PIO_STATUS 0x08 /* PIO status (r/w) */ /* #define ATA_CMD 0x09 */ /* ATA command/status reg (r/w) */ /* #define ATA_ERR 0x0A */ /* ATA features/error reg (r/w) */ #define PIO_FLAG 0x0B /* PIO flag interrupt enable (r/w) */ #define CONFIG5 0x09 /* configuration 5 register */ /* #define SIGNATURE 0x0E */ /* signature register (r) */ /* #define CONFIG6 0x0F */ /* configuration 6 register (r) */ #define CONFIG7 0x0d /* select register set 0 */ #define REG0(x) (outb(C4_IMG, (x) + CONFIG4)) /* select register set 1 */ #define REG1(x) outb(C7_IMG, (x) + CONFIG7); outb(C5_IMG, (x) + CONFIG5) #if SYM53C500_DEBUG #define DEB(x) x #else #define DEB(x) #endif #if VERBOSE_SYM53C500_DEBUG #define VDEB(x) x #else #define VDEB(x) #endif #define LOAD_DMA_COUNT(x, count) \ outb(count & 0xff, (x) + TC_LSB); \ outb((count >> 8) & 0xff, (x) + TC_MSB); \ outb((count >> 16) & 0xff, (x) + TC_HIGH); /* Chip commands */ #define DMA_OP 0x80 #define SCSI_NOP 0x00 #define FLUSH_FIFO 0x01 #define CHIP_RESET 0x02 #define SCSI_RESET 0x03 #define RESELECT 0x40 #define SELECT_NO_ATN 0x41 #define SELECT_ATN 0x42 #define SELECT_ATN_STOP 0x43 #define ENABLE_SEL 0x44 #define DISABLE_SEL 0x45 #define SELECT_ATN3 0x46 #define RESELECT3 0x47 #define TRANSFER_INFO 0x10 #define INIT_CMD_COMPLETE 0x11 #define MSG_ACCEPT 0x12 #define TRANSFER_PAD 0x18 #define SET_ATN 0x1a #define RESET_AT
##############################################################################
# Copyright (c) 2017 14_ykl@tongji.edu.cn and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---

schema: "yardstick:task:0.1"
description: >
    Yardstick TC049 config file;
    HA test case: Control node Openstack service down - swift-proxy.

{% set file = file or '/etc/yardstick/pod.yaml' %}
{% set attack_host = attack_host or "node1" %}
{% set attack_process = attack_process or "swift-proxy" %}

scenarios:
-
  type: ServiceHA
  options:
    attackers:
    - fault_type: "kill-process"
      process_name: "{{ attack_process }}"
      host: {{attack_host}}

    monitors:
    - monitor_type: "openstack-cmd"
      command_name: "swift stat"
      monitor_time: 10
      monitor_number: 3
      sla:
        max_outage_time: 5
    - monitor_type: "process"
      process_name: "{{ attack_process }}"
      host: {{attack_host}}
      monitor_time: 30
      monitor_number: 3
      sla:
        max_recover_time: 30

  nodes:
    {{attack_host}}: {{attack_host}}.LF

  runner:
    type: Duration
    duration: 1
  sla:
    outage_time: 5
    action: monitor


context:
  type: Node
  name: LF
  file: {{file}}
(link); return -ENODEV; } /* SYM53C500_config */ static int sym53c500_resume(struct pcmcia_device *link) { struct scsi_info_t *info = link->priv; /* See earlier comment about manufacturer IDs. */ if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { outb(0x80, link->resource[0]->start + 0xd); outb(0x24, link->resource[0]->start + 0x9); outb(0x04, link->resource[0]->start + 0xd); } /* * If things don't work after a "resume", * this is a good place to start looking. */ SYM53C500_int_host_reset(link->resource[0]->start); return 0; } static void SYM53C500_detach(struct pcmcia_device *link) { dev_dbg(&link->dev, "SYM53C500_detach\n"); SYM53C500_release(link); kfree(link->priv); link->priv = NULL; } /* SYM53C500_detach */ static int SYM53C500_probe(struct pcmcia_device *link) { struct scsi_info_t *info; dev_dbg(&link->dev, "SYM53C500_attach()\n"); /* Create new SCSI device */ info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; info->p_dev = link; link->priv = info; link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; return SYM53C500_config(link); } /* SYM53C500_attach */ MODULE_AUTHOR("Bob Tracy "); MODULE_DESCRIPTION("SYM53C500 PCMCIA SCSI driver"); MODULE_LICENSE("GPL"); static const struct pcmcia_device_id sym53c500_ids[] = { PCMCIA_DEVICE_PROD_ID12("BASICS by New Media Corporation", "SCSI Sym53C500", 0x23c78a9d, 0x0099e7f7), PCMCIA_DEVICE_PROD_ID12("New Media Corporation", "SCSI Bus Toaster Sym53C500", 0x085a850b, 0x45432eb8), PCMCIA_DEVICE_PROD_ID2("SCSI9000", 0x21648f44), PCMCIA_DEVICE_NULL, }; MODULE_DEVICE_TABLE(pcmcia, sym53c500_ids); static struct pcmcia_driver sym53c500_cs_driver = { .owner = THIS_MODULE, .name = "sym53c500_cs", .probe = SYM53C500_probe, .remove = SYM53C500_detach, .id_table = sym53c500_ids, .resume = sym53c500_resume, }; static int __init init_sym53c500_cs(void) { return pcmcia_register_driver(&sym53c500_cs_driver); } static void __exit exit_sym53c500_cs(void) { pcmcia_unregister_driver(&sym53c500_cs_driver); } module_init(init_sym53c500_cs); module_exit(exit_sym53c500_cs);