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

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

?? sl82c105.c.2419

?? ep9315平臺下硬盤驅動的源碼
?? 2419
字號:
/* * linux/drivers/ide/sl82c105.c * * SL82C105/Winbond 553 IDE driver * * Maintainer unknown. * * Changelog: * * 15/11/1998	RMK	Drive tuning added from Rebel.com's kernel *			sources * 30/03/2002	RMK	Add fixes specified in W83C553F errata. *			(with special thanks to Todd Inglett) */#include <linux/config.h>#include <linux/types.h>#include <linux/kernel.h>#include <linux/timer.h>#include <linux/mm.h>#include <linux/ioport.h>#include <linux/interrupt.h>#include <linux/blkdev.h>#include <linux/hdreg.h>#include <linux/pci.h>#include <linux/ide.h>#include <asm/io.h>#include <asm/dma.h>#include "ide_modes.h"extern char *ide_xfer_verbose (byte xfer_rate);/* * SL82C105 PCI config register 0x40 bits. */#define CTRL_IDE_IRQB	(1 << 30)#define CTRL_IDE_IRQA	(1 << 28)#define CTRL_LEGIRQ	(1 << 11)#define CTRL_P1F16	(1 << 5)#define CTRL_P1EN	(1 << 4)#define CTRL_P0F16	(1 << 1)#define	CTRL_P0EN	(1 << 0)/* * Convert a PIO mode and cycle time to the required on/off * times for the interface.  This has protection against run-away * timings. */static unsigned int get_timing_sl82c105(ide_pio_data_t *p){	unsigned int cmd_on;	unsigned int cmd_off;	cmd_on = (ide_pio_timings[p->pio_mode].active_time + 29) / 30;	cmd_off = (p->cycle_time - 30 * cmd_on + 29) / 30;	if (cmd_on > 32)		cmd_on = 32;	if (cmd_on == 0)		cmd_on = 1;	if (cmd_off > 32)		cmd_off = 32;	if (cmd_off == 0)		cmd_off = 1;	return (cmd_on - 1) << 8 | (cmd_off - 1) | (p->use_iordy ? 0x40 : 0x00);}/* * Configure the drive and chipset for PIO */static void config_for_pio(ide_drive_t *drive, int pio, int report){	ide_hwif_t *hwif = HWIF(drive);	struct pci_dev *dev = hwif->pci_dev;	ide_pio_data_t p;	unsigned short drv_ctrl = 0x909;	unsigned int xfer_mode, reg;	reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0);	pio = ide_get_best_pio_mode(drive, pio, 5, &p);	switch (pio) {	default:	case 0:		xfer_mode = XFER_PIO_0;		break;	case 1:		xfer_mode = XFER_PIO_1;		break;	case 2:		xfer_mode = XFER_PIO_2;		break;	case 3:		xfer_mode = XFER_PIO_3;		break;	case 4:		xfer_mode = XFER_PIO_4;		break;	}	if (ide_config_drive_speed(drive, xfer_mode) == 0)		drv_ctrl = get_timing_sl82c105(&p);	if (drive->using_dma == 0) {		/*		 * If we are actually using MW DMA, then we can not		 * reprogram the interface drive control register.		 */		pci_write_config_word(dev, reg, drv_ctrl);		pci_read_config_word(dev, reg, &drv_ctrl);		if (report) {			printk("%s: selected %s (%dns) (%04X)\n", drive->name,			       ide_xfer_verbose(xfer_mode), p.cycle_time, drv_ctrl);		}	}}/* * Configure the drive and the chipset for DMA */static int config_for_dma(ide_drive_t *drive){	ide_hwif_t *hwif = HWIF(drive);	struct pci_dev *dev = hwif->pci_dev;	unsigned short drv_ctrl = 0x909;	unsigned int reg;	reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0);	if (ide_config_drive_speed(drive, XFER_MW_DMA_2) == 0)		drv_ctrl = 0x0240;	pci_write_config_word(dev, reg, drv_ctrl);	return 0;}/* * Check to see if the drive and * chipset is capable of DMA mode */static int sl82c105_check_drive(ide_drive_t *drive){	ide_dma_action_t dma_func = ide_dma_off_quietly;	do {		struct hd_driveid *id = drive->id;		ide_hwif_t *hwif = HWIF(drive);		if (!hwif->autodma)			break;		if (!id || !(id->capability & 1))			break;		/* Consult the list of known "bad" drives */		if (ide_dmaproc(ide_dma_bad_drive, drive)) {			dma_func = ide_dma_off;			break;		}		if (id->field_valid & 2) {			if  (id->dma_mword & 7 || id->dma_1word & 7)				dma_func = ide_dma_on;			break;		}		if (ide_dmaproc(ide_dma_good_drive, drive)) {			dma_func = ide_dma_on;			break;		}	} while (0);	return HWIF(drive)->dmaproc(dma_func, drive);}/* * The SL82C105 holds off all IDE interrupts while in DMA mode until * all DMA activity is completed.  Sometimes this causes problems (eg, * when the drive wants to report an error condition). * * 0x7e is a "chip testing" register.  Bit 2 resets the DMA controller * state machine.  We need to kick this to work around various bugs. */static inline void sl82c105_reset_host(struct pci_dev *dev){	u16 val;	pci_read_config_word(dev, 0x7e, &val);	pci_write_config_word(dev, 0x7e, val | (1 << 2));	pci_write_config_word(dev, 0x7e, val & ~(1 << 2));}/* * If we get an IRQ timeout, it might be that the DMA state machine * got confused.  Fix from Todd Inglett.  Details from Winbond. * * This function is called when the IDE timer expires, the drive * indicates that it is READY, and we were waiting for DMA to complete. */static int sl82c105_lostirq(ide_drive_t *drive){	ide_hwif_t *hwif = HWIF(drive);	struct pci_dev *dev = hwif->pci_dev;	u32 val, mask = hwif->channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA;	unsigned long dma_base = hwif->dma_base;	printk("sl82c105: lost IRQ: resetting host\n");	/*	 * Check the raw interrupt from the drive.	 */	pci_read_config_dword(dev, 0x40, &val);	if (val & mask)		printk("sl82c105: drive was requesting IRQ, but host lost it\n");	/*	 * Was DMA enabled?  If so, disable it - we're resetting the	 * host.  The IDE layer will be handling the drive for us.	 */	val = inb(dma_base);	if (val & 1) {		outb(val & ~1, dma_base);		printk("sl82c105: DMA was enabled\n");	}	sl82c105_reset_host(dev);	/* ide_dmaproc would return 1, so we do as well */	return 1;}/* * ATAPI devices can cause the SL82C105 DMA state machine to go gaga. * Winbond recommend that the DMA state machine is reset prior to * setting the bus master DMA enable bit. * * The generic IDE core will have disabled the BMEN bit before this * function is called. */static void sl82c105_before_bm_enable(ide_drive_t *drive){	ide_hwif_t *hwif = HWIF(drive);	struct pci_dev *dev = hwif->pci_dev;	sl82c105_reset_host(dev);}/* * Our very own dmaproc.  We need to intercept various calls * to fix up the SL82C105 specific behaviour. */static int sl82c105_dmaproc(ide_dma_action_t func, ide_drive_t *drive){	switch (func) {	case ide_dma_check:		return sl82c105_check_drive(drive);	case ide_dma_on:		if (config_for_dma(drive))			func = ide_dma_off;		/* fall through */	case ide_dma_off_quietly:	case ide_dma_off:		config_for_pio(drive, 4, 0);		break;	case ide_dma_read:	case ide_dma_write:	case ide_dma_begin:	case ide_dma_timeout:		sl82c105_before_bm_enable(drive);		break;	case ide_dma_lostirq:		return sl82c105_lostirq(drive);	default:		break;	}	return ide_dmaproc(func, drive);}/* * We only deal with PIO mode here - DMA mode 'using_dma' is not * initialised at the point that this function is called. */static void tune_sl82c105(ide_drive_t *drive, byte pio){	config_for_pio(drive, pio, 1);	/*	 * We support 32-bit I/O on this interface, and it	 * doesn't have problems with interrupts.	 */	drive->io_32bit = 1;	drive->unmask = 1;}/* * Return the revision of the Winbond bridge * which this function is part of. */static unsigned int sl82c105_bridge_revision(struct pci_dev *dev){	struct pci_dev *bridge;	unsigned char rev;	/*	 * The bridge should be part of the same device, but function 0.	 */	bridge = pci_find_slot(dev->bus->number,			       PCI_DEVFN(PCI_SLOT(dev->devfn), 0));	if (!bridge)		return -1;	/*	 * Make sure it is a Winbond 553 and is an ISA bridge.	 */	if (bridge->vendor != PCI_VENDOR_ID_WINBOND ||	    bridge->device != PCI_DEVICE_ID_WINBOND_83C553 ||	    bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA)		return -1;	/*	 * We need to find function 0's revision, not function 1	 */	pci_read_config_byte(bridge, PCI_REVISION_ID, &rev);	return rev;}/* * Enable the PCI device */unsigned int __init pci_init_sl82c105(struct pci_dev *dev, const char *msg){	u32 val;	pci_read_config_dword(dev, 0x40, &val);	val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1EN | CTRL_P1F16;	pci_write_config_dword(dev, 0x40, val);	return dev->irq;}void __init dma_init_sl82c105(ide_hwif_t *hwif, unsigned long dma_base){	unsigned int bridge_rev;	byte dma_state;	dma_state = inb(dma_base + 2);	bridge_rev = sl82c105_bridge_revision(hwif->pci_dev);	if (bridge_rev <= 5) {		hwif->autodma = 0;		hwif->drives[0].autotune = 1;		hwif->drives[1].autotune = 1;		printk("    %s: Winbond 553 bridge revision %d, BM-DMA disabled\n",		       hwif->name, bridge_rev);		dma_state &= ~0x60;	} else {		dma_state |= 0x60;		hwif->autodma = 1;	}	outb(dma_state, dma_base + 2);	ide_setup_dma(hwif, dma_base, 8);	if (bridge_rev <= 5)		hwif->dmaproc = NULL;	else		hwif->dmaproc = sl82c105_dmaproc;}/* * Initialise the chip */void __init ide_init_sl82c105(ide_hwif_t *hwif){	hwif->tuneproc = tune_sl82c105;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费精品视频| 欧美绝品在线观看成人午夜影视| 日韩在线播放一区二区| 亚洲天堂成人在线观看| 亚洲欧洲日产国码二区| 国产精品区一区二区三区| 国产视频一区在线观看| 国产调教视频一区| 日韩一区欧美一区| 亚洲久本草在线中文字幕| 亚洲欧美日韩一区二区三区在线观看| 国产精品久久777777| 亚洲免费观看高清完整版在线| 国产精品久久久久久久裸模 | 日韩在线播放一区二区| 性做久久久久久| 久久机这里只有精品| 精品一区二区三区在线观看| 国产精品一区二区在线观看不卡 | 日韩av午夜在线观看| 男男成人高潮片免费网站| 国产老妇另类xxxxx| 成人黄色小视频| 欧美午夜精品久久久| 91精品黄色片免费大全| 国产亚洲一区二区三区在线观看| 国产欧美日韩在线| 亚洲一区二区精品久久av| 日本aⅴ免费视频一区二区三区| 精品一区二区国语对白| 色综合网色综合| 欧美一区二区三区电影| 国产精品色哟哟网站| 天堂资源在线中文精品| 大胆欧美人体老妇| 7799精品视频| 亚洲私人黄色宅男| 日韩av一区二区三区四区| 国产一区二区久久| 欧美精品在线视频| 中国av一区二区三区| 天堂蜜桃91精品| 91首页免费视频| 久久精品这里都是精品| 首页国产丝袜综合| 色婷婷av一区二区三区软件| 精品不卡在线视频| 亚洲成人中文在线| 99re这里只有精品视频首页| 久久久久久久电影| 天天综合色天天综合| 99国产精品久| 中文字幕乱码日本亚洲一区二区 | 香蕉影视欧美成人| 91小视频免费观看| 国产精品―色哟哟| 国产寡妇亲子伦一区二区| 欧美一区三区二区| 亚洲超碰精品一区二区| www.亚洲色图.com| 国产精品久久久久天堂| 国产风韵犹存在线视精品| 日韩免费观看高清完整版在线观看| 亚洲一区二区三区中文字幕在线| youjizz国产精品| 国产精品免费aⅴ片在线观看| 激情文学综合丁香| xnxx国产精品| 激情小说欧美图片| 久久久久亚洲综合| 国产河南妇女毛片精品久久久| 精品国产乱码久久久久久图片 | 三级精品在线观看| 欧美天堂一区二区三区| 亚洲最大色网站| 色婷婷久久久综合中文字幕 | 亚洲欧美视频一区| 99久久综合99久久综合网站| 国产精品久久久久久户外露出| 成人免费的视频| 综合激情成人伊人| 91污片在线观看| 亚洲一区中文日韩| 欧美日韩国产片| 麻豆免费看一区二区三区| 日韩免费在线观看| 粉嫩一区二区三区在线看| 国产精品久久久一本精品| 一本一本久久a久久精品综合麻豆| 亚洲美女视频在线| 欧美日韩一区二区三区在线| 日韩成人免费在线| 久久免费电影网| 91视频免费看| 免费高清在线一区| 日本一区二区不卡视频| 91久久一区二区| 久久er99热精品一区二区| 国产精品三级久久久久三级| 欧洲一区二区三区在线| 美女在线视频一区| 国产精品蜜臀av| 欧美精品乱码久久久久久按摩| 美女视频黄a大片欧美| 国产精品网曝门| 欧美揉bbbbb揉bbbbb| 麻豆国产一区二区| 国产精品久久久久久久久搜平片 | 国产精品欧美一区喷水| 在线观看日韩毛片| 久久 天天综合| 中文字幕五月欧美| 日韩一级片在线观看| kk眼镜猥琐国模调教系列一区二区 | 日韩视频一区二区| 91偷拍与自偷拍精品| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产精品私人影院| 555夜色666亚洲国产免| 成人av影视在线观看| 久久精品国产精品亚洲精品| 伊人开心综合网| 国产调教视频一区| 精品日韩欧美在线| 欧美色爱综合网| 99久久99久久免费精品蜜臀| 国产一区在线不卡| 日韩专区在线视频| 亚洲综合久久久久| 中文字幕在线视频一区| 国产亚洲精品久| 日韩女优毛片在线| 91超碰这里只有精品国产| 色欧美日韩亚洲| gogo大胆日本视频一区| 高清av一区二区| 国产精品99精品久久免费| 蜜桃av一区二区在线观看| 一区二区三区成人| 亚洲精品免费视频| 国产精品国产馆在线真实露脸| 久久先锋资源网| 国产亚洲一区二区三区四区 | 乱一区二区av| 日本aⅴ精品一区二区三区 | 亚洲精品成人精品456| 国产精品嫩草影院com| 久久久久国产精品麻豆ai换脸| 日韩亚洲欧美一区二区三区| 欧美日韩一区二区欧美激情| 欧美羞羞免费网站| 91成人国产精品| 欧美欧美欧美欧美首页| 欧美精品 日韩| 日韩欧美国产wwwww| 久久午夜老司机| 欧美国产一区二区| 中文字幕亚洲不卡| 亚洲黄网站在线观看| 亚洲成人av中文| 日韩精品欧美成人高清一区二区| 亚洲国产成人精品视频| 无码av免费一区二区三区试看 | 久久久久久毛片| 久久精品视频网| 国产精品久久久久桃色tv| 亚洲欧美另类久久久精品2019| 一区二区三区成人| 免费精品视频在线| 大桥未久av一区二区三区中文| 99re亚洲国产精品| 欧美男女性生活在线直播观看| 欧美精品久久99久久在免费线| 日韩一级精品视频在线观看| 日本一区二区免费在线| 亚洲欧洲成人自拍| 日韩国产欧美在线视频| 国产揄拍国内精品对白| 成人免费高清视频在线观看| 欧美视频完全免费看| 久久人人爽爽爽人久久久| 亚洲欧美综合另类在线卡通| 亚洲一区二区视频在线观看| 激情图区综合网| 91蜜桃视频在线| 欧美videos大乳护士334| 国产精品黄色在线观看| 五月天婷婷综合| 成人性生交大片免费看中文| 欧美视频在线一区二区三区| 久久亚洲精品国产精品紫薇| 亚洲成人自拍偷拍| 国产成人av自拍| 欧美精品v国产精品v日韩精品| 国产精品乱人伦| 日韩中文欧美在线| 色狠狠桃花综合| 久久精品视频在线免费观看| 日韩中文字幕不卡| 国内精品在线播放|