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

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

?? pdc4030.c

?? ep9315平臺下硬盤驅動的源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*  -*- linux-c -*- *  linux/drivers/ide/legacy/pdc4030.c		Version 0.90  May 27, 1999 * *  Copyright (C) 1995-2002  Linus Torvalds & authors (see below) *//* *  Principal Author/Maintainer:  Peter Denison <promise@pnd-pc.demon.co.uk> * *  This file provides support for the second port and cache of Promise *  IDE interfaces, e.g. DC4030VL, DC4030VL-1 and DC4030VL-2. * *  Thanks are due to Mark Lord for advice and patiently answering stupid *  questions, and all those mugs^H^H^H^Hbrave souls who've tested this, *  especially Andre Hedrick. * *  Version 0.01	Initial version, #include'd in ide.c rather than *                      compiled separately. *                      Reads use Promise commands, writes as before. Drives *                      on second channel are read-only. *  Version 0.02        Writes working on second channel, reads on both *                      channels. Writes fail under high load. Suspect *			transfers of >127 sectors don't work. *  Version 0.03        Brought into line with ide.c version 5.27. *                      Other minor changes. *  Version 0.04        Updated for ide.c version 5.30 *                      Changed initialization strategy *  Version 0.05	Kernel integration.  -ml *  Version 0.06	Ooops. Add hwgroup to direct call of ide_intr() -ml *  Version 0.07	Added support for DC4030 variants *			Secondary interface autodetection *  Version 0.08	Renamed to pdc4030.c *  Version 0.09	Obsolete - never released - did manual write request *			splitting before max_sectors[major][minor] available. *  Version 0.10	Updated for 2.1 series of kernels *  Version 0.11	Updated for 2.3 series of kernels *			Autodetection code added. * *  Version 0.90	Transition to BETA code. No lost/unexpected interrupts *//* * Once you've compiled it in, you'll have to also enable the interface * setup routine from the kernel command line, as in  * *	'linux ide0=dc4030' or 'linux ide1=dc4030' * * It should now work as a second controller also ('ide1=dc4030') but only * if you DON'T have BIOS V4.44, which has a bug. If you have this version * and EPROM programming facilities, you need to fix 4 bytes: * 	2496:	81	81 *	2497:	3E	3E *	2498:	22	98	* *	2499:	06	05	* *	249A:	F0	F0 *	249B:	01	01 *	... *	24A7:	81	81 *	24A8:	3E	3E *	24A9:	22	98	* *	24AA:	06	05	* *	24AB:	70	70 *	24AC:	01	01 * * As of January 1999, Promise Technology Inc. have finally supplied me with * some technical information which has shed a glimmer of light on some of the * problems I was having, especially with writes.  * * There are still potential problems with the robustness and efficiency of * this driver because I still don't understand what the card is doing with * interrupts, however, it has been stable for a while with no reports of ill * effects. */#define DEBUG_READ#define DEBUG_WRITE#define __PROMISE_4030#include <linux/module.h>#include <linux/config.h>#include <linux/types.h>#include <linux/kernel.h>#include <linux/delay.h>#include <linux/timer.h>#include <linux/mm.h>#include <linux/ioport.h>#include <linux/blkdev.h>#include <linux/hdreg.h>#include <linux/ide.h>#include <linux/init.h>#include <asm/io.h>#include <asm/irq.h>#include "pdc4030.h"static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block);/* * promise_selectproc() is invoked by ide.c * in preparation for access to the specified drive. */static void promise_selectproc (ide_drive_t *drive){	unsigned int number;	number = (HWIF(drive)->channel << 1) + drive->select.b.unit;	HWIF(drive)->OUTB(number, IDE_FEATURE_REG);}/* * pdc4030_cmd handles the set of vendor specific commands that are initiated * by command F0. They all have the same success/failure notification - * 'P' (=0x50) on success, 'p' (=0x70) on failure. */int pdc4030_cmd(ide_drive_t *drive, u8 cmd){	u32 timeout;	u8 status_val;	promise_selectproc(drive);	/* redundant? */	HWIF(drive)->OUTB(0xF3, IDE_SECTOR_REG);	HWIF(drive)->OUTB(cmd, IDE_SELECT_REG);	HWIF(drive)->OUTB(PROMISE_EXTENDED_COMMAND, IDE_COMMAND_REG);	timeout = HZ * 10;	timeout += jiffies;	do {		if(time_after(jiffies, timeout)) {			return 2; /* device timed out */		}		/* Delays at least 10ms to give interface a chance */		mdelay(10);		status_val = HWIF(drive)->INB(IDE_SECTOR_REG);	} while (status_val != 0x50 && status_val != 0x70);	if(status_val == 0x50)		return 0; /* device returned success */	else		return 1; /* device returned failure */}/* * pdc4030_identify sends a vendor-specific IDENTIFY command to the drive */int pdc4030_identify(ide_drive_t *drive){	return pdc4030_cmd(drive, PROMISE_IDENTIFY);}int enable_promise_support;/* * setup_pdc4030() * Completes the setup of a Promise DC4030 controller card, once found. */int __init setup_pdc4030(ide_hwif_t *hwif){        ide_drive_t *drive;	ide_hwif_t *hwif2;	struct dc_ident ident;	int i;	ide_startstop_t startstop;		if (!hwif) return 0;	drive = &hwif->drives[0];	hwif2 = &ide_hwifs[hwif->index+1];	if (hwif->chipset == ide_pdc4030) /* we've already been found ! */		return 1;	if (hwif->INB(IDE_NSECTOR_REG) == 0xFF ||	    hwif->INB(IDE_SECTOR_REG) == 0xFF) {		return 0;	}	if (IDE_CONTROL_REG)		hwif->OUTB(0x08, IDE_CONTROL_REG);	if (pdc4030_cmd(drive,PROMISE_GET_CONFIG)) {		return 0;	}	if (ide_wait_stat(&startstop, drive,DATA_READY,BAD_W_STAT,WAIT_DRQ)) {		printk(KERN_INFO			"%s: Failed Promise read config!\n",hwif->name);		return 0;	}	hwif->ata_input_data(drive, &ident, SECTOR_WORDS);	if (ident.id[1] != 'P' || ident.id[0] != 'T') {		return 0;	}	printk(KERN_INFO "%s: Promise caching controller, ",hwif->name);	switch(ident.type) {		case 0x43:	printk("DC4030VL-2, "); break;		case 0x41:	printk("DC4030VL-1, "); break;		case 0x40:	printk("DC4030VL, "); break;		default:			printk("unknown - type 0x%02x - please report!\n"			       ,ident.type);			printk("Please e-mail the following data to "			       "promise@pnd-pc.demon.co.uk along with\n"			       "a description of your card and drives:\n");			for (i=0; i < 0x90; i++) {				printk("%02x ", ((unsigned char *)&ident)[i]);				if ((i & 0x0f) == 0x0f) printk("\n");			}			return 0;	}	printk("%dKB cache, ",(int)ident.cache_mem);	switch(ident.irq) {            case 0x00: hwif->irq = 14; break;            case 0x01: hwif->irq = 12; break;            default:   hwif->irq = 15; break;	}	printk("on IRQ %d\n",hwif->irq);	/*	 * Once found and identified, we set up the next hwif in the array	 * (hwif2 = ide_hwifs[hwif->index+1]) with the same io ports, irq	 * and other settings as the main hwif. This gives us two "mated"	 * hwifs pointing to the Promise card.	 *	 * We also have to shift the default values for the remaining	 * interfaces "up by one" to make room for the second interface on the	 * same set of values.	 */	hwif->chipset	= hwif2->chipset = ide_pdc4030;	hwif->mate	= hwif2;	hwif2->mate	= hwif;	hwif2->channel	= 1;	hwif->rqsize	= hwif2->rqsize = 127;	hwif->addressing = hwif2->addressing = 1;	hwif->selectproc = hwif2->selectproc = &promise_selectproc;	hwif->serialized = hwif2->serialized = 1;	/* DC4030 hosted drives need their own identify... */	hwif->identify = hwif2->identify = &pdc4030_identify;	/* Shift the remaining interfaces up by one */	for (i=MAX_HWIFS-1 ; i > hwif->index+1 ; i--) {		ide_hwif_t *h = &ide_hwifs[i];#ifdef DEBUG		printk(KERN_DEBUG "pdc4030: Shifting i/f %d values to i/f %d\n",i-1,i);#endif /* DEBUG */		ide_init_hwif_ports(&h->hw, (h-1)->io_ports[IDE_DATA_OFFSET], 0, NULL);		memcpy(h->io_ports, h->hw.io_ports, sizeof(h->io_ports));		h->noprobe = (h-1)->noprobe;	}	ide_init_hwif_ports(&hwif2->hw, hwif->io_ports[IDE_DATA_OFFSET], 0, NULL);	memcpy(hwif2->io_ports, hwif->hw.io_ports, sizeof(hwif2->io_ports));	hwif2->irq = hwif->irq;	hwif2->hw.irq = hwif->hw.irq = hwif->irq;	for (i=0; i<2 ; i++) {		hwif->drives[i].io_32bit = 3;		hwif2->drives[i].io_32bit = 3;		hwif->drives[i].keep_settings = 1;		hwif2->drives[i].keep_settings = 1;		if (!ident.current_tm[i].cyl)			hwif->drives[i].noprobe = 1;		if (!ident.current_tm[i+2].cyl)			hwif2->drives[i].noprobe = 1;	}		/* Now override the normal ide disk read/write */	hwif->rw_disk = promise_rw_disk;	hwif2->rw_disk = promise_rw_disk;	#ifndef HWIF_PROBE_CLASSIC_METHOD	probe_hwif_init(&ide_hwifs[hwif->index]);	probe_hwif_init(&ide_hwifs[hwif2->index]);#endif /* HWIF_PROBE_CLASSIC_METHOD */        return 1;}/* * detect_pdc4030() * Tests for the presence of a DC4030 Promise card on this interface * Returns: 1 if found, 0 if not found */int __init detect_pdc4030(ide_hwif_t *hwif){	ide_drive_t *drive = &hwif->drives[0];	if (IDE_DATA_REG == 0) { /* Skip test for non-existent interface */		return 0;	}	hwif->OUTB(0xF3, IDE_SECTOR_REG);	hwif->OUTB(0x14, IDE_SELECT_REG);	hwif->OUTB(PROMISE_EXTENDED_COMMAND, IDE_COMMAND_REG);		ide_delay_50ms();	if (hwif->INB(IDE_ERROR_REG) == 'P' &&	    hwif->INB(IDE_NSECTOR_REG) == 'T' &&	    hwif->INB(IDE_SECTOR_REG) == 'I') {		return 1;	} else {		return 0;	}}#ifndef MODULEvoid __init ide_probe_for_pdc4030(void)#elseint ide_probe_for_pdc4030(void)#endif{	unsigned int	index;	ide_hwif_t	*hwif;#ifndef MODULE	if (enable_promise_support == 0)		return;#endif	for (index = 0; index < MAX_HWIFS; index++) {		hwif = &ide_hwifs[index];		if (hwif->chipset == ide_unknown && detect_pdc4030(hwif)) {#ifndef MODULE			setup_pdc4030(hwif);#else			return setup_pdc4030(hwif);#endif		}	}#ifdef MODULE	return 0;#endif}void __init release_pdc4030(ide_hwif_t *hwif, ide_hwif_t *mate){	hwif->chipset = ide_unknown;	hwif->selectproc = NULL;	hwif->serialized = 0;	hwif->drives[0].io_32bit = 0;	hwif->drives[1].io_32bit = 0;	hwif->drives[0].keep_settings = 0;	hwif->drives[1].keep_settings = 0;	hwif->drives[0].noprobe = 0;	hwif->drives[1].noprobe = 0;	if (mate != NULL) {		mate->chipset = ide_unknown;		mate->selectproc = NULL;		mate->serialized = 0;		mate->drives[0].io_32bit = 0;		mate->drives[1].io_32bit = 0;		mate->drives[0].keep_settings = 0;		mate->drives[1].keep_settings = 0;		mate->drives[0].noprobe = 0;		mate->drives[1].noprobe = 0;	}}#ifndef MODULE/* * init_pdc4030: * * called by ide.c when parsing command line */void __init init_pdc4030(void){	enable_promise_support = 1;}#elseMODULE_AUTHOR("Peter Denison");MODULE_DESCRIPTION("Support of Promise 4030 VLB series IDE chipsets");MODULE_LICENSE("GPL");int __init pdc4030_mod_init(void){	if (enable_promise_support == 0)		enable_promise_support = 1;	if (!ide_probe_for_pdc4030())		return -ENODEV;        return 0;}module_init(pdc4030_mod_init);void __init pdc4030_mod_exit(void){	unsigned int    index;	ide_hwif_t      *hwif;	if (enable_promise_support == 0)		return; 	for (index = 0; index < MAX_HWIFS; index++) {		hwif = &ide_hwifs[index];		if (hwif->chipset == ide_pdc4030) {			ide_hwif_t *mate = &ide_hwifs[hwif->index+1];			if (mate->chipset == ide_pdc4030)				release_pdc4030(hwif, mate);			else				release_pdc4030(hwif, NULL);                }        }	enable_promise_support = 0;}module_exit(pdc4030_mod_exit);#endif/* * promise_read_intr() is the handler for disk read/multread interrupts */static ide_startstop_t promise_read_intr (ide_drive_t *drive){	int total_remaining;	unsigned int sectors_left, sectors_avail, nsect;	struct request *rq;	ata_status_t status;#ifdef CONFIG_IDE_TASKFILE_IO	unsigned long flags;	char *to;#endif /* CONFIG_IDE_TASKFILE_IO */	status.all = HWIF(drive)->INB(IDE_STATUS_REG);	if (!OK_STAT(status.all, DATA_READY, BAD_R_STAT))		return DRIVER(drive)->error(drive,			"promise_read_intr", status.all);read_again:	do {		sectors_left = HWIF(drive)->INB(IDE_NSECTOR_REG);		HWIF(drive)->INB(IDE_SECTOR_REG);	} while (HWIF(drive)->INB(IDE_NSECTOR_REG) != sectors_left);	rq = HWGROUP(drive)->rq;	sectors_avail = rq->nr_sectors - sectors_left;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲一区二区| 亚洲青青青在线视频| 夜夜亚洲天天久久| 国产一区二区三区最好精华液| 日本二三区不卡| 久久精品免视看| 精品一区二区日韩| 91麻豆精品国产91久久久资源速度| 亚洲色图制服丝袜| 成人国产亚洲欧美成人综合网| 欧美一区二区三区公司| 夜夜亚洲天天久久| 91丨porny丨蝌蚪视频| 国产亚洲人成网站| 国产在线观看一区二区| 在线不卡免费欧美| 日韩电影一二三区| 91精品国产一区二区人妖| 一卡二卡三卡日韩欧美| 91在线观看免费视频| 国产精品久久久久久久久免费樱桃| 美腿丝袜亚洲综合| 日韩欧美在线网站| 日韩二区三区四区| 欧美男同性恋视频网站| 亚洲一二三四区不卡| 色婷婷亚洲综合| 亚洲日本一区二区三区| 99国产精品一区| 成人欧美一区二区三区在线播放| 成人黄色av网站在线| 国产精品区一区二区三| eeuss国产一区二区三区| 国产精品情趣视频| 色综合久久综合网欧美综合网| 亚洲欧洲精品天堂一级| 色欧美乱欧美15图片| 亚洲精品久久嫩草网站秘色| 91传媒视频在线播放| 婷婷成人激情在线网| 日韩欧美专区在线| 国产在线观看一区二区| 国产人成一区二区三区影院| hitomi一区二区三区精品| 亚洲综合一区二区精品导航| 欧美日韩五月天| 久久精品国产色蜜蜜麻豆| 久久婷婷综合激情| 99久久精品国产毛片| 一区二区三区高清在线| 91麻豆精品国产无毒不卡在线观看| 蜜臀a∨国产成人精品| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 久久久亚洲精华液精华液精华液| 国产精品一区二区三区99 | 精品区一区二区| 国产精品1区2区3区在线观看| 欧美高清在线一区| 欧美亚洲日本国产| 九一久久久久久| 亚洲精品久久嫩草网站秘色| 91精品国产91久久久久久最新毛片 | 精品精品国产高清a毛片牛牛| 成人免费看视频| 午夜精品视频一区| 久久久久久久免费视频了| 色婷婷综合久久久久中文一区二区| 丝袜国产日韩另类美女| 国产精品欧美精品| 7777精品伊人久久久大香线蕉经典版下载 | 日日夜夜免费精品| 国产亚洲精品资源在线26u| 欧美性受xxxx| 成人精品免费看| 蜜桃久久av一区| 亚洲日本乱码在线观看| 精品少妇一区二区三区免费观看 | 欧美日韩在线不卡| 成人国产电影网| 美国十次了思思久久精品导航| 国产精品久久久久久久久久免费看| 欧美日韩国产精品成人| 99re成人精品视频| 国产制服丝袜一区| 免费观看日韩av| 夜夜嗨av一区二区三区四季av| 国产午夜亚洲精品不卡| 3atv在线一区二区三区| 91久久奴性调教| www.66久久| 国产不卡视频一区二区三区| 久久99精品国产麻豆婷婷| 亚洲成人免费视| 亚洲黄网站在线观看| 国产精品久久久99| 久久久久九九视频| 精品国产乱码久久久久久闺蜜| 欧美猛男男办公室激情| 欧美综合亚洲图片综合区| 成人教育av在线| 成人黄色网址在线观看| 成人午夜私人影院| 豆国产96在线|亚洲| 国产99久久久久久免费看农村| 久久国产婷婷国产香蕉| 久久精品国产亚洲aⅴ| 老司机精品视频导航| 男男gaygay亚洲| 日韩成人伦理电影在线观看| 午夜精品久久久久久久99樱桃| 亚洲狠狠爱一区二区三区| 日韩理论片一区二区| 亚洲男人电影天堂| 亚洲激情自拍视频| 午夜私人影院久久久久| 日韩黄色免费电影| 美女免费视频一区| 国产精品系列在线播放| 成人av网址在线| 日本高清成人免费播放| 欧美日韩精品一区二区三区蜜桃 | 在线精品视频免费观看| 欧美日韩亚洲综合一区二区三区| 欧美日韩国产中文| 日韩欧美一级在线播放| 久久精品亚洲精品国产欧美kt∨ | 91免费观看视频在线| 欧美日韩一区在线| 日韩欧美中文一区二区| 国产三级三级三级精品8ⅰ区| 国产精品欧美久久久久一区二区| 亚洲日本在线天堂| 日本免费新一区视频| 国产成人啪午夜精品网站男同| 成人黄色777网| 精品视频一区三区九区| 亚洲精品在线免费观看视频| 中文字幕欧美激情| 亚洲激情自拍偷拍| 麻豆精品在线播放| www.99精品| 欧美一级高清片| 欧美国产丝袜视频| 爽爽淫人综合网网站| 国产精品一级片| 欧美日韩在线播放三区| 国产色产综合色产在线视频 | 精品写真视频在线观看| 成人午夜视频免费看| 欧美蜜桃一区二区三区| 久久午夜免费电影| 亚洲国产精品嫩草影院| 国产一区二区中文字幕| 欧美三级中文字幕| 国产精品区一区二区三区| 五月婷婷激情综合| aaa亚洲精品一二三区| 91精品国产91久久久久久一区二区| 国产精品视频线看| 久久99精品久久只有精品| 色综合天天综合| 久久久久久亚洲综合| 天堂成人国产精品一区| av一二三不卡影片| 亚洲精品在线网站| 日韩av中文字幕一区二区| 91片黄在线观看| 国产嫩草影院久久久久| 美腿丝袜一区二区三区| 欧美无砖专区一中文字| 国产精品热久久久久夜色精品三区| 美脚の诱脚舐め脚责91 | 激情深爱一区二区| 欧美精品v日韩精品v韩国精品v| 国产精品剧情在线亚洲| 久久国产三级精品| 欧美一区三区二区| 亚洲最新视频在线播放| 99视频在线精品| 国产精品无人区| 国产激情91久久精品导航| 精品国产免费人成电影在线观看四季| 一级女性全黄久久生活片免费| 成人黄页毛片网站| 中文字幕电影一区| 成人爽a毛片一区二区免费| 久久精品亚洲麻豆av一区二区| 婷婷国产在线综合| 8x福利精品第一导航| 午夜成人免费电影| 欧美精品高清视频| 日韩av中文在线观看| 5566中文字幕一区二区电影| 亚洲国产aⅴ天堂久久| 欧美性xxxxxxxx| 五月婷婷色综合| 欧美一级搡bbbb搡bbbb| 另类调教123区| 久久久国产精品麻豆| 国产综合一区二区|