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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ohci-hcd.c

?? linux客戶機函數(shù)定義的實際例子
?? C
?? 第 1 頁 / 共 2 頁
字號:
	if ((ohci->hcca->done_head != 0)
			&& ! (le32_to_cpup (&ohci->hcca->done_head) & 0x01)) {
		ints =  OHCI_INTR_WDH;
	} else if ((ints = (readl (&regs->intrstatus)
			& readl (&regs->intrenable))) == 0) {
		return;
	} 

	// dbg ("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci->hcca->frame_no));

	if (ints & OHCI_INTR_UE) {
		ohci->disabled++;
		err ("OHCI Unrecoverable Error, %s disabled", hcd->self.bus_name);
		// e.g. due to PCI Master/Target Abort

#ifdef	DEBUG
		ohci_dump (ohci, 1);
#endif
		hc_reset (ohci);
	}
  
	if (ints & OHCI_INTR_WDH) {
		writel (OHCI_INTR_WDH, &regs->intrdisable);	
		dl_done_list (ohci, dl_reverse_done_list (ohci));
		writel (OHCI_INTR_WDH, &regs->intrenable); 
	}
  
	/* could track INTR_SO to reduce available PCI/... bandwidth */

	// FIXME:  this assumes SOF (1/ms) interrupts don't get lost...
	if (ints & OHCI_INTR_SF) { 
		unsigned int frame = le16_to_cpu (ohci->hcca->frame_no) & 1;
		writel (OHCI_INTR_SF, &regs->intrdisable);	
		if (ohci->ed_rm_list [!frame] != NULL) {
			dl_del_list (ohci, !frame);
		}
		if (ohci->ed_rm_list [frame] != NULL)
			writel (OHCI_INTR_SF, &regs->intrenable);	
	}

	writel (ints, &regs->intrstatus);
	writel (OHCI_INTR_MIE, &regs->intrenable);	
}

/*-------------------------------------------------------------------------*/

static void ohci_stop (struct usb_hcd *hcd)
{	
	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);

	dbg ("%s: stop %s controller%s",
		hcd->self.bus_name,
		hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS),
		ohci->disabled ? " (disabled)" : ""
		);
#ifdef	DEBUG
	ohci_dump (ohci, 1);
#endif

	if (!ohci->disabled)
		hc_reset (ohci);
	
	ohci_mem_cleanup (ohci);

#ifdef CONFIG_PCI
	pci_free_consistent (ohci->hcd.pdev, sizeof *ohci->hcca,
		ohci->hcca, ohci->hcca_dma);
#endif
}

/*-------------------------------------------------------------------------*/

static int __devinit
ohci_start (struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
	int		ret;

#ifdef CONFIG_PCI
	if (hcd->pdev) {
		ohci->hcca = pci_alloc_consistent (hcd->pdev,
				sizeof *ohci->hcca, &ohci->hcca_dma);
		if (!ohci->hcca)
			return -ENOMEM;

		/* AMD 756, for most chips (early revs), corrupts register
		 * values on read ... so enable the vendor workaround.
		 */
		if (hcd->pdev->vendor == 0x1022
				&& hcd->pdev->device == 0x740c) {
			ohci->flags = OHCI_QUIRK_AMD756;
			info ("%s: AMD756 erratum 4 workaround",
				hcd->self.bus_name);
		}

		/* Apple's OHCI driver has a lot of bizarre workarounds
		 * for this chip.  Evidently control and bulk lists
		 * can get confused.  (B&W G3 models, and ...)
		 */
		else if (hcd->pdev->vendor == 0x1045
				&& hcd->pdev->device == 0xc861) {
			info ("%s: WARNING: OPTi workarounds unavailable",
				hcd->self.bus_name);
		}
	}
#else
#	error "where's hcca coming from?"
#endif /* CONFIG_PCI */

        memset (ohci->hcca, 0, sizeof (struct ohci_hcca));
	if ((ret = ohci_mem_init (ohci)) < 0) {
		ohci_stop (hcd);
		return ret;
	}
	ohci->regs = hcd->regs;

	if (hc_reset (ohci) < 0) {
		ohci_stop (hcd);
		return -ENODEV;
	}

	if (hc_start (ohci) < 0) {
		err ("can't start %s", ohci->hcd.self.bus_name);
		ohci_stop (hcd);
		return -EBUSY;
	}

#ifdef	DEBUG
	ohci_dump (ohci, 1);
#endif
	return 0;
}

/*-------------------------------------------------------------------------*/

#ifdef	CONFIG_PM

static int ohci_suspend (struct usb_hcd *hcd, u32 state)
{
	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
	unsigned long		flags;
	u16			cmd;

	if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) {
		dbg ("can't suspend %s (state is %s)", hcd->self.bus_name,
			hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS));
		return -EIO;
	}

	/* act as if usb suspend can always be used */
	dbg ("%s: suspend to %d", hcd->self.bus_name, state);
	ohci->sleeping = 1;

	/* First stop processing */
  	spin_lock_irqsave (&ohci->lock, flags);
	ohci->hc_control &=
		~(OHCI_CTRL_PLE|OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_IE);
	writel (ohci->hc_control, &ohci->regs->control);
	writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
	(void) readl (&ohci->regs->intrstatus);
  	spin_unlock_irqrestore (&ohci->lock, flags);

	/* Wait a frame or two */
	mdelay (1);
	if (!readl (&ohci->regs->intrstatus) & OHCI_INTR_SF)
		mdelay (1);
		
 #ifdef CONFIG_PMAC_PBOOK
	if (_machine == _MACH_Pmac)
		disable_irq (hcd->pdev->irq);
 	/* else, 2.4 assumes shared irqs -- don't disable */
 #endif

	/* Enable remote wakeup */
	writel (readl (&ohci->regs->intrenable) | OHCI_INTR_RD,
		&ohci->regs->intrenable);

	/* Suspend chip and let things settle down a bit */
 	ohci->hc_control = OHCI_USB_SUSPEND;
 	writel (ohci->hc_control, &ohci->regs->control);
	(void) readl (&ohci->regs->control);
	mdelay (500); /* No schedule here ! */

	switch (readl (&ohci->regs->control) & OHCI_CTRL_HCFS) {
		case OHCI_USB_RESET:
			dbg ("%s suspend->reset ?", hcd->self.bus_name);
			break;
		case OHCI_USB_RESUME:
			dbg ("%s suspend->resume ?", hcd->self.bus_name);
			break;
		case OHCI_USB_OPER:
			dbg ("%s suspend->operational ?", hcd->self.bus_name);
			break;
		case OHCI_USB_SUSPEND:
			dbg ("%s suspended", hcd->self.bus_name);
			break;
	}

	/* In some rare situations, Apple's OHCI have happily trashed
	 * memory during sleep. We disable its bus master bit during
	 * suspend
	 */
	pci_read_config_word (hcd->pdev, PCI_COMMAND, &cmd);
	cmd &= ~PCI_COMMAND_MASTER;
	pci_write_config_word (hcd->pdev, PCI_COMMAND, cmd);
#ifdef CONFIG_PMAC_PBOOK
	{
	   	struct device_node	*of_node;
 
		/* Disable USB PAD & cell clock */
		of_node = pci_device_to_OF_node (hcd->pdev);
		if (of_node)
			pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0);
	}
#endif
	return 0;
}


// FIXME:  this restart logic should be generic,
// and handle full hcd state cleanup

/* controller died; cleanup debris, then restart */
/* must not be called from interrupt context */

static int hc_restart (struct ohci_hcd *ohci)
{
	int temp;
	int i;

	ohci->disabled = 1;
	ohci->sleeping = 0;
	if (ohci->hcd.self.root_hub)
		usb_disconnect (&ohci->hcd.self.root_hub);
	
	/* empty the interrupt branches */
	for (i = 0; i < NUM_INTS; i++) ohci->ohci_int_load [i] = 0;
	for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table [i] = 0;
	
	/* no EDs to remove */
	ohci->ed_rm_list [0] = NULL;
	ohci->ed_rm_list [1] = NULL;

	/* empty control and bulk lists */	 
	ohci->ed_isotail     = NULL;
	ohci->ed_controltail = NULL;
	ohci->ed_bulktail    = NULL;

	if ((temp = hc_reset (ohci)) < 0 || (temp = hc_start (ohci)) < 0) {
		err ("can't restart %s, %d", ohci->hcd.self.bus_name, temp);
		return temp;
	} else
		dbg ("restart %s completed", ohci->hcd.self.bus_name);
	return 0;
}

static int ohci_resume (struct usb_hcd *hcd)
{
	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
	int			temp;
	int			retval = 0;
	unsigned long		flags;

#ifdef CONFIG_PMAC_PBOOK
	{
		struct device_node *of_node;

		/* Re-enable USB PAD & cell clock */
		of_node = pci_device_to_OF_node (hcd->pdev);
		if (of_node)
			pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1);
	}
#endif
	/* did we suspend, or were we powered off? */
	ohci->hc_control = readl (&ohci->regs->control);
	temp = ohci->hc_control & OHCI_CTRL_HCFS;

#ifdef DEBUG
	/* the registers may look crazy here */
	ohci_dump_status (ohci);
#endif

	/* Re-enable bus mastering */
	pci_set_master (ohci->hcd.pdev);
	
	switch (temp) {

	case OHCI_USB_RESET:	// lost power
		info ("USB restart: %s", hcd->self.bus_name);
		retval = hc_restart (ohci);
		break;

	case OHCI_USB_SUSPEND:	// host wakeup
	case OHCI_USB_RESUME:	// remote wakeup
		info ("USB continue: %s from %s wakeup", hcd->self.bus_name,
			 (temp == OHCI_USB_SUSPEND)
				? "host" : "remote");
		ohci->hc_control = OHCI_USB_RESUME;
		writel (ohci->hc_control, &ohci->regs->control);
		(void) readl (&ohci->regs->control);
		mdelay (20); /* no schedule here ! */
		/* Some controllers (lucent) need a longer delay here */
		mdelay (15);

		temp = readl (&ohci->regs->control);
		temp = ohci->hc_control & OHCI_CTRL_HCFS;
		if (temp != OHCI_USB_RESUME) {
			err ("controller %s won't resume", hcd->self.bus_name);
			ohci->disabled = 1;
			retval = -EIO;
			break;
		}

		/* Some chips likes being resumed first */
		writel (OHCI_USB_OPER, &ohci->regs->control);
		(void) readl (&ohci->regs->control);
		mdelay (3);

		/* Then re-enable operations */
		spin_lock_irqsave (&ohci->lock, flags);
		ohci->disabled = 0;
		ohci->sleeping = 0;
		ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER;
		if (!ohci->ed_rm_list [0] && !ohci->ed_rm_list [1]) {
			if (ohci->ed_controltail)
				ohci->hc_control |= OHCI_CTRL_CLE;
			if (ohci->ed_bulktail)
				ohci->hc_control |= OHCI_CTRL_BLE;
		}
		hcd->state = USB_STATE_READY;
		writel (ohci->hc_control, &ohci->regs->control);

		/* trigger a start-frame interrupt (why?) */
		writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
		writel (OHCI_INTR_SF, &ohci->regs->intrenable);

		/* Check for a pending done list */
		writel (OHCI_INTR_WDH, &ohci->regs->intrdisable);	
		(void) readl (&ohci->regs->intrdisable);
		spin_unlock_irqrestore (&ohci->lock, flags);

 #ifdef CONFIG_PMAC_PBOOK
		if (_machine == _MACH_Pmac)
			enable_irq (hcd->pdev->irq);
 #endif
		if (ohci->hcca->done_head)
			dl_done_list (ohci, dl_reverse_done_list (ohci));
		writel (OHCI_INTR_WDH, &ohci->regs->intrenable); 

		/* assume there are TDs on the bulk and control lists */
		writel (OHCI_BLF | OHCI_CLF, &ohci->regs->cmdstatus);

// ohci_dump_status (ohci);
dbg ("sleeping = %d, disabled = %d", ohci->sleeping, ohci->disabled);
		break;

	default:
		warn ("odd PCI resume for %s", hcd->self.bus_name);
	}
	return retval;
}

#endif	/* CONFIG_PM */


/*-------------------------------------------------------------------------*/

static const char	hcd_name [] = "ohci-hcd";

static const struct hc_driver ohci_driver = {
	description:		hcd_name,

	/*
	 * generic hardware linkage
	 */
	irq:			ohci_irq,
	flags:			HCD_MEMORY | HCD_USB11,

	/*
	 * basic lifecycle operations
	 */
	start:			ohci_start,
#ifdef	CONFIG_PM
	suspend:		ohci_suspend,
	resume:			ohci_resume,
#endif
	stop:			ohci_stop,

	/*
	 * memory lifecycle (except per-request)
	 */
	hcd_alloc:		ohci_hcd_alloc,
	hcd_free:		ohci_hcd_free,

	/*
	 * managing i/o requests and associated device resources
	 */
	urb_enqueue:		ohci_urb_enqueue,
	urb_dequeue:		ohci_urb_dequeue,
	free_config:		ohci_free_config,

	/*
	 * scheduling support
	 */
	get_frame_number:	ohci_get_frame,

	/*
	 * root hub support
	 */
	hub_status_data:	ohci_hub_status_data,
	hub_control:		ohci_hub_control,
};

#define DRIVER_INFO DRIVER_VERSION " " DRIVER_DESC

MODULE_AUTHOR (DRIVER_AUTHOR);
MODULE_DESCRIPTION (DRIVER_INFO);
MODULE_LICENSE ("GPL");

/*-------------------------------------------------------------------------*/

#ifdef CONFIG_PCI

/* There do exist non-PCI implementations of OHCI ...
 * Examples include the SA-1111 (ARM) and some MIPS
 * and related hardware.
 */

static const struct pci_device_id __devinitdata pci_ids [] = { {

	/* handle any USB OHCI controller */
	class:		(PCI_CLASS_SERIAL_USB << 8) | 0x10,
	class_mask:	~0,
	driver_data:	(unsigned long) &ohci_driver,

	/* no matter who makes it */
	vendor:		PCI_ANY_ID,
	device:		PCI_ANY_ID,
	subvendor:	PCI_ANY_ID,
	subdevice:	PCI_ANY_ID,

	}, { /* end: all zeroes */ }
};
MODULE_DEVICE_TABLE (pci, pci_ids);

/* pci driver glue; this is a "new style" PCI driver module */
static struct pci_driver ohci_pci_driver = {
	name:		(char *) hcd_name,
	id_table:	pci_ids,

	probe:		usb_hcd_pci_probe,
	remove:		usb_hcd_pci_remove,

#ifdef	CONFIG_PM
	suspend:	usb_hcd_pci_suspend,
	resume:		usb_hcd_pci_resume,
#endif
};

 
static int __init ohci_hcd_init (void) 
{
	dbg (DRIVER_INFO);
	dbg ("block sizes: ed %d td %d",
		sizeof (struct ed), sizeof (struct td));
	return pci_module_init (&ohci_pci_driver);
}
module_init (ohci_hcd_init);

/*-------------------------------------------------------------------------*/

static void __exit ohci_hcd_cleanup (void) 
{	
	pci_unregister_driver (&ohci_pci_driver);
}
module_exit (ohci_hcd_cleanup);

#endif /* CONFIG_PCI */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆文化传媒在线观看| 五月天亚洲精品| 成人av中文字幕| 国产精品萝li| 91亚洲国产成人精品一区二区三| 中文字幕在线观看不卡视频| av电影在线观看不卡| 亚洲欧美日本在线| 欧美日韩欧美一区二区| 麻豆视频一区二区| 久久久国产精华| 99精品国产99久久久久久白柏| 亚洲女同一区二区| 欧美精品在线一区二区三区| 国产在线精品免费| 中文字幕亚洲一区二区av在线| 色哟哟亚洲精品| 老司机午夜精品| 久久久激情视频| 欧美吻胸吃奶大尺度电影| 蜜臀av国产精品久久久久| 国产欧美日韩一区二区三区在线观看| 91在线播放网址| 日韩av一区二| 国产精品久久久久久久久搜平片| 色婷婷综合在线| 久久精品国产成人一区二区三区| 国产精品女上位| 精品视频免费在线| 国产成人精品免费一区二区| 一区二区高清在线| 久久久久99精品一区| 欧美性色黄大片| 国产成人丝袜美腿| 午夜视频一区二区三区| 国产亚洲短视频| 777久久久精品| eeuss影院一区二区三区| 麻豆精品国产传媒mv男同| 自拍偷拍欧美激情| 欧美一二三区在线| 色婷婷香蕉在线一区二区| 国产主播一区二区| 天堂资源在线中文精品| 亚洲欧洲无码一区二区三区| 日韩欧美亚洲国产精品字幕久久久| 91日韩在线专区| 国产高清一区日本| 麻豆精品在线看| 亚洲国产精品一区二区www在线| 中文字幕精品综合| 精品国产麻豆免费人成网站| 欧美三级韩国三级日本一级| www.色精品| 高清av一区二区| 久草这里只有精品视频| 视频一区在线视频| 一区二区激情小说| 亚洲欧美偷拍三级| 综合久久久久综合| 国产欧美日韩中文久久| 久久亚洲一区二区三区明星换脸| 91精品国产丝袜白色高跟鞋| 欧洲精品中文字幕| 日本久久精品电影| 99精品一区二区| av亚洲精华国产精华精华| 成人性生交大片| 成人性生交大合| av在线不卡免费看| 成人动漫中文字幕| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧日韩精品视频| 91在线小视频| 91麻豆自制传媒国产之光| 91免费观看视频| 色综合婷婷久久| 99九九99九九九视频精品| 成人不卡免费av| av成人免费在线观看| 91麻豆精品一区二区三区| 99国产欧美另类久久久精品| 99在线精品观看| 色偷偷88欧美精品久久久| 在线观看亚洲精品| 在线视频一区二区三| 在线视频一区二区免费| 欧美高清性hdvideosex| 欧美电视剧免费观看| 久久影院午夜论| 日本一区二区三区国色天香| 亚洲天堂免费看| 午夜欧美电影在线观看| 日日摸夜夜添夜夜添精品视频 | 中文字幕亚洲在| 亚洲精品国产视频| 亚洲成av人在线观看| 青青草国产成人99久久| 久久99久久99小草精品免视看| 国模大尺度一区二区三区| 成人免费视频播放| 欧美日韩在线免费视频| 欧美一区二区福利在线| 欧美国产精品一区二区三区| 亚洲色图在线看| 日韩和欧美一区二区三区| 国产一区999| 色呦呦日韩精品| 日韩一级高清毛片| 中文字幕欧美区| 午夜视黄欧洲亚洲| 国产suv精品一区二区883| 在线视频综合导航| 精品区一区二区| 成人欧美一区二区三区黑人麻豆| 亚洲第四色夜色| 国产精华液一区二区三区| 91成人看片片| 精品久久久久久久久久久久久久久久久| 欧美国产日韩精品免费观看| 亚洲成a人在线观看| 国产成人精品在线看| 欧美男人的天堂一二区| 国产无遮挡一区二区三区毛片日本| 亚洲综合丁香婷婷六月香| 韩日av一区二区| 欧美性生活影院| 国产精品无人区| 美日韩一区二区| 色综合一个色综合| 久久久99精品久久| 日韩av中文字幕一区二区| 91无套直看片红桃| 久久只精品国产| 日韩中文字幕不卡| 色婷婷综合久久久久中文| 国产三级精品视频| 美女mm1313爽爽久久久蜜臀| 一本大道久久a久久精品综合| 亚洲精品在线免费观看视频| 亚洲国产精品人人做人人爽| 成人高清在线视频| 国产欧美综合在线| 九色|91porny| 欧美一级夜夜爽| 五月激情六月综合| 欧洲一区在线电影| 日韩中文字幕不卡| 欧美在线小视频| 亚洲精品免费一二三区| 99v久久综合狠狠综合久久| 国产欧美日韩精品一区| 久久不见久久见免费视频7| 91麻豆精品国产综合久久久久久| 亚洲老妇xxxxxx| 色婷婷久久综合| 亚洲女人****多毛耸耸8| 91蜜桃传媒精品久久久一区二区| 国产精品视频免费看| 粉嫩av亚洲一区二区图片| 久久久久久免费| 国产乱一区二区| 欧美va亚洲va香蕉在线| 青青草伊人久久| 欧美日韩色综合| 午夜久久久久久久久| 色老头久久综合| 亚洲区小说区图片区qvod| 色综合久久综合网欧美综合网| 欧美日韩国产小视频| 99re这里都是精品| 久久婷婷一区二区三区| 男女男精品视频| 在线电影国产精品| 日本成人在线网站| 在线精品国精品国产尤物884a| 亚洲人成人一区二区在线观看| 国产白丝网站精品污在线入口| 国产精品无码永久免费888| 国产电影一区二区三区| 久久精品一区四区| 国产一区二区三区观看| 国产亚洲一区二区在线观看| 激情综合网激情| 久久综合视频网| 成人91在线观看| 国产精品久久久久久久久免费丝袜 | 成人h精品动漫一区二区三区| 日韩片之四级片| 国产成人a级片| 国产色综合久久| 不卡视频在线观看| 一区二区三区四区国产精品| 色婷婷激情一区二区三区| 亚洲免费高清视频在线| 欧美在线免费播放| 免费看黄色91| 久久综合久久久久88| 国产成人无遮挡在线视频| 中文字幕巨乱亚洲|