亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ultrastor.c

?? <Linux1.0核心游記>電子書+書后源碼+Linux1.0源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* *	ultrastor.c	Copyright (C) 1992 David B. Gentzel *	Low-level SCSI driver for UltraStor 14F, 24F, and 34F *	by David B. Gentzel, Whitfield Software Services, Carnegie, PA *	    (gentzel@nova.enet.dec.com) *  scatter/gather added by Scott Taylor (n217cg@tamuts.tamu.edu) *  24F and multiple command support by John F. Carr (jfc@athena.mit.edu) *    John's work modified by Caleb Epstein (cae@jpmorgan.com) and  *    Eric Youngdale (eric@tantalus.nrl.navy.mil). *	Thanks to UltraStor for providing the necessary documentation *//* * TODO: *	1. Find out why scatter/gather is limited to 16 requests per command. *	2. Look at command linking (mscp.command_link and *	   mscp.command_link_id).  (Does not work with many disks,  *				and no performance increase.  ERY). *	3. Allow multiple adapters. *//* * NOTES: *    The UltraStor 14F, 24F, and 34F are a family of intelligent, high *    performance SCSI-2 host adapters.  They all support command queueing *    and scatter/gather I/O.  Some of them can also emulate the standard *    WD1003 interface for use with OS's which don't support SCSI.  Here *    is the scoop on the various models: *	14F - ISA first-party DMA HA with floppy support and WD1003 emulation. *	14N - ISA HA with floppy support.  I think that this is a non-DMA *	      HA.  Nothing further known. *	24F - EISA Bus Master HA with floppy support and WD1003 emulation. *	34F - VL-Bus Bus Master HA with floppy support (no WD1003 emulation). * *    The 14F, 24F, and 34F are supported by this driver. * *    Places flagged with a triple question-mark are things which are either *    unfinished, questionable, or wrong. *//* Changes from version 1.9 to 1.11 * * Patches to bring this driver up to speed with the default kernel * driver which supports only the 14F and 34F adapters.  This version * should compile cleanly into 0.99.13, 0.99.12 and probably 0.99.11. * * Fixes from Eric Youngdale to fix a few possible race conditions and * several problems with bit testing operations (insufficient * parentheses). * * Removed the ultrastor_abort() and ultrastor_reset() functions * (enclosed them in #if 0 / #endif).  These functions, at least on * the 24F, cause the SCSI bus to do odd things and generally lead to * kernel panics and machine hangs.  This is like the Adaptec code. * * Use check/snarf_region for 14f, 34f to avoid I/O space address conflicts. *//* Changes from version 1.8 to version 1.9 * *  0.99.11 patches (cae@jpmorgan.com) *//* Changes from version 1.7 to version 1.8 * * Better error reporting. *//* Changes from version 1.6 to version 1.7 * * Removed CSIR command code. * * Better race condition avoidance (xchgb function added). * * Set ICM and OGM status to zero at probe (24F) * * reset sends soft reset to UltraStor adapter * * reset adapter if adapter interrupts with an invalid MSCP address * * handle aborted command interrupt (24F) * *//* Changes from version 1.5 to version 1.6: * * Read MSCP address from ICM _before_ clearing the interrupt flag. * This fixes a race condition. *//* Changes from version 1.4 to version 1.5: * * Abort now calls done when multiple commands are enabled. * * Clear busy when aborted command finishes, not when abort is called. * * More debugging messages for aborts. *//* Changes from version 1.3 to version 1.4: * * Enable automatic request of sense data on error (requires newer version * of scsi.c to be useful). * * Fix PORT_OVERRIDE for 14F. * * Fix abort and reset to work properly (config.aborted wasn't cleared * after it was tested, so after a command abort no further commands would * work). * * Boot time test to enable SCSI bus reset (defaults to not allowing reset). * * Fix test for OGM busy -- the busy bit is in different places on the 24F. * * Release ICM slot by clearing first byte on 24F. */#include <linux/stddef.h>#include <linux/string.h>#include <linux/sched.h>#include <linux/kernel.h>#include <linux/ioport.h>#include <asm/io.h>#include <asm/bitops.h>#include <asm/system.h>#include <asm/dma.h>#define ULTRASTOR_PRIVATE	/* Get the private stuff from ultrastor.h */#include "../block/blk.h"#include "scsi.h"#include "hosts.h"#include "ultrastor.h"#define FALSE 0#define TRUE 1#ifndef ULTRASTOR_DEBUG#define ULTRASTOR_DEBUG (UD_ABORT|UD_CSIR|UD_RESET)#endif#define VERSION "1.11 alpha"#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr)[0])#define PACKED		__attribute__((packed))#define ALIGNED(x)	__attribute__((aligned(x)))/* The 14F uses an array of 4-byte ints for its scatter/gather list.   The data can be unaligned, but need not be.  It's easier to give   the list normal alignment since it doesn't need to fit into a   packed structure.  */typedef struct {  unsigned int address;  unsigned int num_bytes;} ultrastor_sg_list;/* MailBox SCSI Command Packet.  Basic command structure for communicating   with controller. */struct mscp {  unsigned char opcode: 3;		/* type of command */  unsigned char xdir: 2;		/* data transfer direction */  unsigned char dcn: 1;		/* disable disconnect */  unsigned char ca: 1;		/* use cache (if available) */  unsigned char sg: 1;		/* scatter/gather operation */  unsigned char target_id: 3;		/* target SCSI id */  unsigned char ch_no: 2;		/* SCSI channel (always 0 for 14f) */  unsigned char lun: 3;		/* logical unit number */  unsigned int transfer_data PACKED;	/* transfer data pointer */  unsigned int transfer_data_length PACKED;	/* length in bytes */  unsigned int command_link PACKED;	/* for linking command chains */  unsigned char scsi_command_link_id;	/* identifies command in chain */  unsigned char number_of_sg_list;	/* (if sg is set) 8 bytes per list */  unsigned char length_of_sense_byte;  unsigned char length_of_scsi_cdbs;	/* 6, 10, or 12 */  unsigned char scsi_cdbs[12];	/* SCSI commands */  unsigned char adapter_status;	/* non-zero indicates HA error */  unsigned char target_status;	/* non-zero indicates target error */  unsigned int sense_data PACKED;  /* The following fields are for software only.  They are included in     the MSCP structure because they are associated with SCSI requests.  */  void (*done)(Scsi_Cmnd *);  Scsi_Cmnd *SCint;  ultrastor_sg_list sglist[ULTRASTOR_14F_MAX_SG];};/* Port addresses (relative to the base address) */#define U14F_PRODUCT_ID(port) ((port) + 0x4)#define CONFIG(port) ((port) + 0x6)/* Port addresses relative to the doorbell base address.  */#define LCL_DOORBELL_MASK(port) ((port) + 0x0)#define LCL_DOORBELL_INTR(port) ((port) + 0x1)#define SYS_DOORBELL_MASK(port) ((port) + 0x2)#define SYS_DOORBELL_INTR(port) ((port) + 0x3)/* Used to store configuration info read from config i/o registers.  Most of   this is not used yet, but might as well save it.      This structure also holds port addresses that are not at the same offset   on the 14F and 24F.      This structure holds all data that must be duplicated to support multiple   adapters.  */static struct ultrastor_config{  unsigned short port_address;		/* base address of card */  unsigned short doorbell_address;	/* base address of doorbell CSRs */  unsigned short ogm_address;		/* base address of OGM */  unsigned short icm_address;		/* base address of ICM */  const void *bios_segment;  unsigned char interrupt: 4;  unsigned char dma_channel: 3;  unsigned char bios_drive_number: 1;  unsigned char heads;  unsigned char sectors;  unsigned char ha_scsi_id: 3;  unsigned char subversion: 4;  unsigned char revision;  /* The slot number is used to distinguish the 24F (slot != 0) from     the 14F and 34F (slot == 0). */  unsigned char slot;#ifdef PRINT_U24F_VERSION  volatile int csir_done;#endif  /* Our index in the host adapter array maintained by higher-level driver */  int host_number;  /* A pool of MSCP structures for this adapter, and a bitmask of     busy structures.  (If ULTRASTOR_14F_MAX_CMDS == 1, a 1 byte     busy flag is used instead.)  */#if ULTRASTOR_MAX_CMDS == 1  unsigned char mscp_busy;#else  unsigned short mscp_free;#endif  volatile unsigned char aborted[ULTRASTOR_MAX_CMDS];  struct mscp mscp[ULTRASTOR_MAX_CMDS];} config = {0};/* Set this to 1 to reset the SCSI bus on error.  */int ultrastor_bus_reset = 0;/* Allowed BIOS base addresses (NULL indicates reserved) */static const void *const bios_segment_table[8] = {  NULL,	     (void *)0xC4000, (void *)0xC8000, (void *)0xCC000,  (void *)0xD0000, (void *)0xD4000, (void *)0xD8000, (void *)0xDC000,};/* Allowed IRQs for 14f */static const unsigned char interrupt_table_14f[4] = { 15, 14, 11, 10 };/* Allowed DMA channels for 14f (0 indicates reserved) */static const unsigned char dma_channel_table_14f[4] = { 5, 6, 7, 0 };/* Head/sector mappings allowed by 14f */static const struct {  unsigned char heads;  unsigned char sectors;} mapping_table[4] = { { 16, 63 }, { 64, 32 }, { 64, 63 }, { 64, 32 } };#ifndef PORT_OVERRIDE/* ??? A probe of address 0x310 screws up NE2000 cards */static const unsigned short ultrastor_ports_14f[] = {  0x330, 0x340, /*0x310,*/ 0x230, 0x240, 0x210, 0x130, 0x140,};#endifstatic void ultrastor_interrupt(int cpl);static inline void build_sg_list(struct mscp *, Scsi_Cmnd *SCpnt);static inline int find_and_clear_bit_16(unsigned short *field){  int rv;  cli();  if (*field == 0) panic("No free mscp");  asm("xorl %0,%0\n0:\tbsfw %1,%w0\n\tbtr %0,%1\n\tjnc 0b"      : "=&r" (rv), "=m" (*field) : "1" (*field));  sti();  return rv;}/* This asm is fragile: it doesn't work without the casts and it may   not work without optimization.  Maybe I should add a swap builtin   to gcc.  --jfc  */static inline unsigned char xchgb(unsigned char reg,				  volatile unsigned char *mem){  asm("xchgb %0,%1" :      "=r" (reg), "=m" (*(unsigned char *)mem) :      "0" (reg), "1" (*(unsigned char *)mem));  return reg;}#if ULTRASTOR_DEBUG & (UD_COMMAND | UD_ABORT)static void log_ultrastor_abort(register struct ultrastor_config *config,				int command){  static char fmt[80] = "abort %d (%x); MSCP free pool: %x;";  register int i;  int flags;  save_flags(flags);  cli();  for (i = 0; i < ULTRASTOR_MAX_CMDS; i++)    {      fmt[20 + i*2] = ' ';      if (! (config->mscp_free & (1 << i)))	fmt[21 + i*2] = '0' + config->mscp[i].target_id;      else	fmt[21 + i*2] = '-';    }  fmt[20 + ULTRASTOR_MAX_CMDS * 2] = '\n';  fmt[21 + ULTRASTOR_MAX_CMDS * 2] = 0;  printk(fmt, command, &config->mscp[command], config->mscp_free);  restore_flags(flags);}#endifstatic int ultrastor_14f_detect(int hostnum){    size_t i;    unsigned char in_byte, version_byte = 0;    struct config_1 {      unsigned char bios_segment: 3;      unsigned char removable_disks_as_fixed: 1;      unsigned char interrupt: 2;    unsigned char dma_channel: 2;    } config_1;    struct config_2 {      unsigned char ha_scsi_id: 3;      unsigned char mapping_mode: 2;      unsigned char bios_drive_number: 1;      unsigned char tfr_port: 2;    } config_2;#if (ULTRASTOR_DEBUG & UD_DETECT)    printk("US14F: detect: called\n");#endif    /* If a 24F has already been configured, don't look for a 14F.  */    if (config.bios_segment)	return FALSE;#ifdef PORT_OVERRIDE    if(check_region(PORT_OVERRIDE, 0xc)) {      printk("Ultrastor I/O space already in use\n");      return FALSE;    };    config.port_address = PORT_OVERRIDE;#else    for (i = 0; i < ARRAY_SIZE(ultrastor_ports_14f); i++) {      if(check_region(ultrastor_ports_14f[i], 0x0c)) continue;      config.port_address = ultrastor_ports_14f[i];#endif#if (ULTRASTOR_DEBUG & UD_DETECT)	printk("US14F: detect: testing port address %03X\n", config.port_address);#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美另类小说视频| 粉嫩高潮美女一区二区三区| 精品一区二区在线看| 9i看片成人免费高清| 欧美一区二区三区免费大片| 中文在线免费一区三区高中清不卡 | 精品视频一区二区不卡| 久久久久国产精品麻豆ai换脸| 亚洲与欧洲av电影| 懂色av噜噜一区二区三区av| 欧美一区二区免费视频| 一级特黄大欧美久久久| eeuss鲁片一区二区三区| 日韩一区二区电影| 亚洲已满18点击进入久久| 成人性视频网站| 国产精品美女久久久久久久久久久 | 欧美手机在线视频| 亚洲精品视频观看| 91丨九色丨尤物| 中文字幕精品一区二区精品绿巨人 | 亚洲一二三四区| 91免费在线看| 亚洲视频一区二区在线| 国产成人aaa| 久久久久久久久99精品| 久久国产精品99久久久久久老狼 | 天天色 色综合| 91成人在线精品| 亚洲一区二区三区国产| 色狠狠av一区二区三区| 亚洲一区二区三区四区在线免费观看| 99久久精品国产网站| 日韩伦理av电影| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 精品国产一区二区三区不卡| 日本亚洲最大的色成网站www| 欧美日韩精品一区二区| 亚洲午夜精品在线| 欧美日韩在线精品一区二区三区激情 | 免费高清视频精品| 日韩欧美在线综合网| 美女爽到高潮91| 精品99999| 成人小视频免费在线观看| 国产精品色婷婷| 97se亚洲国产综合自在线观| 国产精品国产精品国产专区不蜜| 99精品欧美一区二区蜜桃免费 | 久久嫩草精品久久久久| 国产成人在线色| 国产精品美女久久福利网站| 91在线云播放| 天堂成人国产精品一区| 日韩欧美的一区二区| 国产98色在线|日韩| 日韩理论在线观看| 日韩午夜在线观看| 国产999精品久久久久久绿帽| 一色屋精品亚洲香蕉网站| 欧美羞羞免费网站| 狠狠色狠狠色综合日日91app| 国产欧美日本一区视频| 欧美午夜不卡在线观看免费| 极品销魂美女一区二区三区| 国产精品久久777777| 日本道精品一区二区三区| 奇米影视一区二区三区小说| 国产精品欧美一区喷水| 欧美精品在线视频| 国产精品一级片在线观看| 亚洲黄色小视频| 国产亚洲欧美日韩俺去了| 欧美色涩在线第一页| 国产乱淫av一区二区三区 | 久久成人18免费观看| 亚洲日本护士毛茸茸| 91精品欧美综合在线观看最新| 国产黑丝在线一区二区三区| 亚洲国产精品久久人人爱蜜臀| 精品少妇一区二区三区日产乱码 | 91麻豆精品国产91久久久资源速度 | 色婷婷精品大在线视频| 美女免费视频一区二区| 亚洲免费在线视频| 国产亚洲短视频| 欧美一二三四在线| 欧美无乱码久久久免费午夜一区| 国产大片一区二区| 久久精品99久久久| 午夜电影网亚洲视频| 国产肉丝袜一区二区| 制服丝袜中文字幕一区| 91论坛在线播放| 国产成人鲁色资源国产91色综| 日韩精品免费专区| 一区二区三区不卡在线观看| 中文字幕在线观看不卡视频| 精品999在线播放| 欧美变态口味重另类| 欧美日韩一二三区| 色av成人天堂桃色av| 一本大道久久a久久综合| 丁香婷婷综合五月| 国产成人精品亚洲午夜麻豆| 麻豆精品一区二区综合av| 五月婷婷综合激情| 夜色激情一区二区| 亚洲色大成网站www久久九九| 国产精品毛片a∨一区二区三区| 26uuu国产日韩综合| 久久婷婷成人综合色| 久久影院电视剧免费观看| 精品国产亚洲在线| 日韩精品一区二区三区视频| 欧美成人高清电影在线| 日韩欧美国产三级电影视频| 日韩欧美不卡在线观看视频| 日韩欧美二区三区| 久久久影视传媒| 中国av一区二区三区| 中文字幕一区二| 亚洲欧美综合另类在线卡通| 国产精品白丝在线| 亚洲同性同志一二三专区| 亚洲视频每日更新| 亚洲高清三级视频| 美日韩一区二区三区| 国产美女精品人人做人人爽| 国产美女主播视频一区| 成人午夜私人影院| 在线观看亚洲精品视频| 6080yy午夜一二三区久久| 日韩一卡二卡三卡国产欧美| 精品99一区二区| 国产精品成人免费| 亚洲高清不卡在线| 国模无码大尺度一区二区三区| 国产成人在线影院| 欧美图区在线视频| 精品福利一区二区三区| 中文字幕在线一区免费| 亚洲va欧美va天堂v国产综合| 蜜桃视频在线一区| 成人精品免费看| 欧美午夜视频网站| 久久精品一区二区三区不卡| 亚洲人xxxx| 调教+趴+乳夹+国产+精品| 国产美女视频91| 欧美午夜电影网| 国产午夜久久久久| 午夜影院在线观看欧美| 国产成人在线色| 欧美精品v日韩精品v韩国精品v| 亚洲精品在线免费播放| 国产精品入口麻豆原神| 日本怡春院一区二区| 成人高清免费在线播放| 在线电影欧美成精品| 国产精品网站一区| 久久国产三级精品| 色狠狠av一区二区三区| 久久精品视频免费| 亚洲成人高清在线| www.视频一区| 精品国产sm最大网站| 一区二区三区 在线观看视频| 94-欧美-setu| 久久亚洲一区二区三区明星换脸| 亚洲最大的成人av| 国产成人一区在线| 日韩免费高清视频| 午夜精品123| 99九九99九九九视频精品| 久久久精品人体av艺术| 午夜精品国产更新| 欧美性大战久久久久久久蜜臀| 中文字幕不卡在线| 国产精品一区二区三区99| 777a∨成人精品桃花网| 亚洲永久精品国产| 91年精品国产| 亚洲免费资源在线播放| 成人精品高清在线| 国产精品三级av在线播放| 国产精品综合在线视频| 精品噜噜噜噜久久久久久久久试看| 一区二区三区精品| 91欧美一区二区| 亚洲精品成人少妇| 91网上在线视频| 亚洲精品伦理在线| 91在线你懂得| 亚洲欧美日韩国产手机在线| 成人福利在线看| 亚洲欧美一区二区三区国产精品| 成人一区二区三区| 国产精品久久三| 99久久国产免费看|