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

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

?? scsi.c

?? linux和2410結合開發 用他可以生成2410所需的zImage文件
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* *  scsi.c Copyright (C) 1992 Drew Eckhardt *         Copyright (C) 1993, 1994, 1995, 1999 Eric Youngdale * *  generic mid-level SCSI driver *      Initial versions: Drew Eckhardt *      Subsequent revisions: Eric Youngdale * *  <drew@colorado.edu> * *  Bug correction thanks go to : *      Rik Faith <faith@cs.unc.edu> *      Tommy Thorn <tthorn> *      Thomas Wuensche <tw@fgb1.fgb.mw.tu-muenchen.de> * *  Modified by Eric Youngdale eric@andante.org or ericy@gnu.ai.mit.edu to *  add scatter-gather, multiple outstanding request, and other *  enhancements. * *  Native multichannel, wide scsi, /proc/scsi and hot plugging *  support added by Michael Neuffer <mike@i-connect.net> * *  Added request_module("scsi_hostadapter") for kerneld: *  (Put an "alias scsi_hostadapter your_hostadapter" in /etc/modules.conf) *  Bjorn Ekwall  <bj0rn@blox.se> *  (changed to kmod) * *  Major improvements to the timeout, abort, and reset processing, *  as well as performance modifications for large queue depths by *  Leonard N. Zubkoff <lnz@dandelion.com> * *  Converted cli() code to spinlocks, Ingo Molnar * *  Jiffies wrap fixes (host->resetting), 3 Dec 1998 Andrea Arcangeli * *  out_of_space hacks, D. Gilbert (dpg) 990608 */#define REVISION	"Revision: 1.00"#define VERSION		"Id: scsi.c 1.00 2000/09/26"#include <linux/config.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/timer.h>#include <linux/string.h>#include <linux/slab.h>#include <linux/ioport.h>#include <linux/kernel.h>#include <linux/stat.h>#include <linux/blk.h>#include <linux/interrupt.h>#include <linux/delay.h>#include <linux/init.h>#include <linux/smp_lock.h>#include <linux/completion.h>#define __KERNEL_SYSCALLS__#include <linux/unistd.h>#include <linux/spinlock.h>#include <asm/system.h>#include <asm/irq.h>#include <asm/dma.h>#include <asm/uaccess.h>#include "scsi.h"#include "hosts.h"#include "constants.h"#ifdef CONFIG_KMOD#include <linux/kmod.h>#endif#undef USE_STATIC_SCSI_MEMORYstruct proc_dir_entry *proc_scsi;#ifdef CONFIG_PROC_FSstatic int scsi_proc_info(char *buffer, char **start, off_t offset, int length);static void scsi_dump_status(int level);#endif/*   static const char RCSid[] = "$Header: /vger/u4/cvs/linux/drivers/scsi/scsi.c,v 1.38 1997/01/19 23:07:18 davem Exp $"; *//* * Definitions and constants. */#define MIN_RESET_DELAY (2*HZ)/* Do not call reset on error if we just did a reset within 15 sec. */#define MIN_RESET_PERIOD (15*HZ)/* * Macro to determine the size of SCSI command. This macro takes vendor * unique commands into account. SCSI commands in groups 6 and 7 are * vendor unique and we will depend upon the command length being * supplied correctly in cmd_len. */#define CDB_SIZE(SCpnt)	((((SCpnt->cmnd[0] >> 5) & 7) < 6) ? \				COMMAND_SIZE(SCpnt->cmnd[0]) : SCpnt->cmd_len)/* * Data declarations. */unsigned long scsi_pid;Scsi_Cmnd *last_cmnd;/* Command group 3 is reserved and should never be used.  */const unsigned char scsi_command_size[8] ={	6, 10, 10, 12,	16, 12, 10, 10};static unsigned long serial_number;static Scsi_Cmnd *scsi_bh_queue_head;static Scsi_Cmnd *scsi_bh_queue_tail;/* * Note - the initial logging level can be set here to log events at boot time. * After the system is up, you may enable logging via the /proc interface. */unsigned int scsi_logging_level;const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE] ={	"Direct-Access    ",	"Sequential-Access",	"Printer          ",	"Processor        ",	"WORM             ",	"CD-ROM           ",	"Scanner          ",	"Optical Device   ",	"Medium Changer   ",	"Communications   ",	"Unknown          ",	"Unknown          ",	"Unknown          ",	"Enclosure        ",};/*  * Function prototypes. */extern void scsi_times_out(Scsi_Cmnd * SCpnt);void scsi_build_commandblocks(Scsi_Device * SDpnt);/* * These are the interface to the old error handling code.  It should go away * someday soon. */extern void scsi_old_done(Scsi_Cmnd * SCpnt);extern void scsi_old_times_out(Scsi_Cmnd * SCpnt);/* * Function:    scsi_initialize_queue() * * Purpose:     Selects queue handler function for a device. * * Arguments:   SDpnt   - device for which we need a handler function. * * Returns:     Nothing * * Lock status: No locking assumed or required. * * Notes:       Most devices will end up using scsi_request_fn for the *              handler function (at least as things are done now). *              The "block" feature basically ensures that only one of *              the blocked hosts is active at one time, mainly to work around *              buggy DMA chipsets where the memory gets starved. *              For this case, we have a special handler function, which *              does some checks and ultimately calls scsi_request_fn. * *              The single_lun feature is a similar special case. * *              We handle these things by stacking the handlers.  The *              special case handlers simply check a few conditions, *              and return if they are not supposed to do anything. *              In the event that things are OK, then they call the next *              handler in the list - ultimately they call scsi_request_fn *              to do the dirty deed. */void  scsi_initialize_queue(Scsi_Device * SDpnt, struct Scsi_Host * SHpnt) {	blk_init_queue(&SDpnt->request_queue, scsi_request_fn);        blk_queue_headactive(&SDpnt->request_queue, 0);        SDpnt->request_queue.queuedata = (void *) SDpnt;}#ifdef MODULEMODULE_PARM(scsi_logging_level, "i");MODULE_PARM_DESC(scsi_logging_level, "SCSI logging level; should be zero or nonzero");#elsestatic int __init scsi_logging_setup(char *str){	int tmp;	if (get_option(&str, &tmp) == 1) {		scsi_logging_level = (tmp ? ~0 : 0);		return 1;	} else {		printk(KERN_INFO "scsi_logging_setup : usage scsi_logging_level=n "		       "(n should be 0 or non-zero)\n");		return 0;	}}__setup("scsi_logging=", scsi_logging_setup);#endif/* *	Issue a command and wait for it to complete */ static void scsi_wait_done(Scsi_Cmnd * SCpnt){	struct request *req;	req = &SCpnt->request;	req->rq_status = RQ_SCSI_DONE;	/* Busy, but indicate request done */	if (req->waiting != NULL) {		complete(req->waiting);	}}/* * This lock protects the freelist for all devices on the system. * We could make this finer grained by having a single lock per * device if it is ever found that there is excessive contention * on this lock. */static spinlock_t device_request_lock = SPIN_LOCK_UNLOCKED;/* * Used to protect insertion into and removal from the queue of * commands to be processed by the bottom half handler. */static spinlock_t scsi_bhqueue_lock = SPIN_LOCK_UNLOCKED;/* * Function:    scsi_allocate_request * * Purpose:     Allocate a request descriptor. * * Arguments:   device    - device for which we want a request * * Lock status: No locks assumed to be held.  This function is SMP-safe. * * Returns:     Pointer to request block. * * Notes:       With the new queueing code, it becomes important *              to track the difference between a command and a *              request.  A request is a pending item in the queue that *              has not yet reached the top of the queue. */Scsi_Request *scsi_allocate_request(Scsi_Device * device){  	Scsi_Request *SRpnt = NULL;    	if (!device)  		panic("No device passed to scsi_allocate_request().\n");  	SRpnt = (Scsi_Request *) kmalloc(sizeof(Scsi_Request), GFP_ATOMIC);	if( SRpnt == NULL )	{		return NULL;	}	memset(SRpnt, 0, sizeof(Scsi_Request));	SRpnt->sr_device = device;	SRpnt->sr_host = device->host;	SRpnt->sr_magic = SCSI_REQ_MAGIC;	SRpnt->sr_data_direction = SCSI_DATA_UNKNOWN;	return SRpnt;}/* * Function:    scsi_release_request * * Purpose:     Release a request descriptor. * * Arguments:   device    - device for which we want a request * * Lock status: No locks assumed to be held.  This function is SMP-safe. * * Returns:     Pointer to request block. * * Notes:       With the new queueing code, it becomes important *              to track the difference between a command and a *              request.  A request is a pending item in the queue that *              has not yet reached the top of the queue.  We still need *              to free a request when we are done with it, of course. */void scsi_release_request(Scsi_Request * req){	if( req->sr_command != NULL )	{		scsi_release_command(req->sr_command);		req->sr_command = NULL;	}	kfree(req);}/* * Function:    scsi_allocate_device * * Purpose:     Allocate a command descriptor. * * Arguments:   device    - device for which we want a command descriptor *              wait      - 1 if we should wait in the event that none *                          are available. *              interruptible - 1 if we should unblock and return NULL *                          in the event that we must wait, and a signal *                          arrives. * * Lock status: No locks assumed to be held.  This function is SMP-safe. * * Returns:     Pointer to command descriptor. * * Notes:       Prior to the new queue code, this function was not SMP-safe. * *              If the wait flag is true, and we are waiting for a free *              command block, this function will interrupt and return *              NULL in the event that a signal arrives that needs to *              be handled. * *              This function is deprecated, and drivers should be *              rewritten to use Scsi_Request instead of Scsi_Cmnd. */Scsi_Cmnd *scsi_allocate_device(Scsi_Device * device, int wait,                                 int interruptable){ 	struct Scsi_Host *host;  	Scsi_Cmnd *SCpnt = NULL;	Scsi_Device *SDpnt;	unsigned long flags;    	if (!device)  		panic("No device passed to scsi_allocate_device().\n");    	host = device->host;  	spin_lock_irqsave(&device_request_lock, flags); 	while (1 == 1) {		SCpnt = NULL;		if (!device->device_blocked) {			if (device->single_lun) {				/*				 * FIXME(eric) - this is not at all optimal.  Given that				 * single lun devices are rare and usually slow				 * (i.e. CD changers), this is good enough for now, but				 * we may want to come back and optimize this later.				 *				 * Scan through all of the devices attached to this				 * host, and see if any are active or not.  If so,				 * we need to defer this command.				 *				 * We really need a busy counter per device.  This would				 * allow us to more easily figure out whether we should				 * do anything here or not.				 */				for (SDpnt = host->host_queue;				     SDpnt;				     SDpnt = SDpnt->next) {					/*					 * Only look for other devices on the same bus					 * with the same target ID.					 */					if (SDpnt->channel != device->channel					    || SDpnt->id != device->id					    || SDpnt == device) { 						continue;					}                                        if( atomic_read(&SDpnt->device_active) != 0)                                        {                                                break;                                        }				}				if (SDpnt) {					/*					 * Some other device in this cluster is busy.					 * If asked to wait, we need to wait, otherwise					 * return NULL.					 */					SCpnt = NULL;					goto busy;				}			}			/*			 * Now we can check for a free command block for this device.			 */			for (SCpnt = device->device_queue; SCpnt; SCpnt = SCpnt->next) {				if (SCpnt->request.rq_status == RQ_INACTIVE)					break;			}		}		/*		 * If we couldn't find a free command block, and we have been		 * asked to wait, then do so.		 */		if (SCpnt) {			break;		}      busy:		/*		 * If we have been asked to wait for a free block, then		 * wait here.		 */		if (wait) {                        DECLARE_WAITQUEUE(wait, current);                        /*                         * We need to wait for a free commandblock.  We need to                         * insert ourselves into the list before we release the                         * lock.  This way if a block were released the same                         * microsecond that we released the lock, the call                         * to schedule() wouldn't block (well, it might switch,                         * but the current task will still be schedulable.                         */                        add_wait_queue(&device->scpnt_wait, &wait);                        if( interruptable ) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲男女毛片无遮挡| 久久精品国产一区二区三| 亚洲精品写真福利| 日韩av网站免费在线| 成人福利视频网站| 欧美色综合影院| 日韩免费电影网站| 午夜精品久久久久久久久久久 | 欧美日韩大陆在线| 一区二区三区中文在线观看| 国产福利精品一区二区| 精品国产91亚洲一区二区三区婷婷 | 日韩免费视频线观看| av一区二区三区四区| 中国av一区二区三区| 成人精品一区二区三区中文字幕| 欧美sm极限捆绑bd| 久久电影网站中文字幕| 中文字幕色av一区二区三区| www.一区二区| 秋霞午夜鲁丝一区二区老狼| 91精品国产色综合久久不卡蜜臀 | 99久久99久久精品免费看蜜桃| 欧美视频三区在线播放| 国内精品写真在线观看 | 国产精品77777| 国产亚洲成aⅴ人片在线观看| 久久99久久久久| 欧美欧美欧美欧美首页| 国产一区 二区| 中文在线资源观看网站视频免费不卡 | 亚洲制服丝袜av| av高清不卡在线| 国产综合色精品一区二区三区| 亚洲一区二区高清| 国产精品国产自产拍高清av| 91论坛在线播放| 午夜精品久久久久久久久久| 国产精品久久久久久久蜜臀| 日韩欧美国产午夜精品| 欧美精选午夜久久久乱码6080| 激情综合色综合久久综合| 日韩电影免费在线看| 午夜精品久久久久久久久久 | 久久网这里都是精品| 成人伦理片在线| 国产成人精品影院| 国产精品亚洲成人| 国产.欧美.日韩| 五月天亚洲精品| 日本女人一区二区三区| 日韩影院精彩在线| 中文字幕在线不卡一区二区三区| 久久久久成人黄色影片| 在线观看网站黄不卡| 国内一区二区在线| 国产精品996| 成人一区在线看| www.欧美精品一二区| aaa国产一区| 色欧美日韩亚洲| 国产精品一区在线观看你懂的| 精品中文字幕一区二区| 国产精一品亚洲二区在线视频| 国产综合成人久久大片91| 国产综合色精品一区二区三区| 国产精品1区2区| 色天天综合久久久久综合片| 欧美在线一区二区| 欧美成人精精品一区二区频| 国产日韩欧美精品电影三级在线| 91麻豆精品91久久久久同性| 风间由美性色一区二区三区| 成人黄色电影在线| 色噜噜夜夜夜综合网| 国产成人av资源| 不卡的电影网站| 欧美视频在线不卡| 欧美videofree性高清杂交| 欧美高清在线视频| 亚洲国产一区二区三区| 日韩一区日韩二区| 日韩精品视频网| 国产成人aaa| 在线成人av影院| 国产精品女同一区二区三区| 亚洲小少妇裸体bbw| 国产毛片精品视频| 日本精品一区二区三区高清| 欧美一级免费大片| 欧美色爱综合网| 在线观看亚洲专区| 国产亚洲一区二区三区四区| 亚洲一区二区在线视频| 经典三级一区二区| 欧美日韩精品系列| 国产精品人妖ts系列视频| 日本欧美肥老太交大片| 91蜜桃网址入口| 久久精品亚洲麻豆av一区二区| 亚洲午夜久久久久中文字幕久| 国产成人综合亚洲网站| 91精品国产综合久久香蕉麻豆| 国产精品欧美综合在线| 日韩精品午夜视频| 91蜜桃婷婷狠狠久久综合9色| 欧美一区永久视频免费观看| 日韩理论电影院| 亚洲va天堂va国产va久| 蜜乳av一区二区| 国产一区二区免费视频| 欧美日韩三级在线| 亚洲精品一二三区| 91亚洲男人天堂| 亚洲国产成人一区二区三区| 麻豆精品一二三| 欧美一区二区网站| 午夜一区二区三区视频| 日本精品一区二区三区四区的功能| 国产蜜臀av在线一区二区三区| 蜜桃视频免费观看一区| 91精品国产综合久久精品麻豆| 亚洲精品免费在线播放| 99re66热这里只有精品3直播| 国产精品亲子乱子伦xxxx裸| 成人av资源在线观看| 国产精品女人毛片| 99在线精品视频| 亚洲精品国产无套在线观| 91网上在线视频| 一区二区在线看| 在线观看欧美黄色| 天天做天天摸天天爽国产一区| 欧美调教femdomvk| 日韩精品欧美精品| 精品少妇一区二区| 国产高清精品网站| 国产精品国产馆在线真实露脸| 99国产欧美另类久久久精品| 亚洲免费av在线| 欧美久久久久久久久久| 午夜精品福利一区二区蜜股av| 777午夜精品视频在线播放| 日韩二区在线观看| 久久精品日产第一区二区三区高清版| 国产综合色产在线精品| 亚洲特黄一级片| 欧美精品日韩精品| 国产一区二区调教| 亚洲欧美日韩中文字幕一区二区三区| 91成人免费在线| 狠狠色狠狠色综合| 亚洲女同女同女同女同女同69| 欧美午夜精品一区二区蜜桃 | 日韩三级.com| 国产九九视频一区二区三区| 日韩一区中文字幕| 51精品秘密在线观看| 国产传媒日韩欧美成人| 一区二区三区四区中文字幕| 日韩午夜av电影| 波多野结衣中文字幕一区二区三区 | 国产亚洲一区二区三区在线观看| 91在线观看美女| 美女脱光内衣内裤视频久久网站 | 国产美女精品人人做人人爽| 亚洲欧美aⅴ...| 欧美成人乱码一区二区三区| 色综合中文综合网| 国产最新精品精品你懂的| 亚洲欧美日韩国产一区二区三区 | 亚洲黄一区二区三区| 日韩一区二区在线观看视频播放| 成人三级伦理片| 久久精品av麻豆的观看方式| 中文字幕一区二区三| 精品蜜桃在线看| 欧美在线视频不卡| 成人黄色a**站在线观看| 国产在线日韩欧美| 日韩av在线播放中文字幕| 亚洲人成伊人成综合网小说| 久久女同互慰一区二区三区| 91精品国产综合久久精品图片| 在线视频你懂得一区二区三区| 国产成人av一区| 韩国成人精品a∨在线观看| 五月综合激情网| 一区二区国产视频| 成人欧美一区二区三区白人| 久久尤物电影视频在线观看| 555夜色666亚洲国产免| 欧美军同video69gay| 欧美视频日韩视频在线观看| 欧美性xxxxxx少妇| 欧美亚洲一区二区在线| 99久久久久久99| 色婷婷国产精品综合在线观看| www.欧美色图| 日本道色综合久久|