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

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

?? device.c

?? Linux Kernel 2.6.9 for OMAP1710
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  drivers/s390/cio/device.c *  bus driver for ccw devices *   $Revision: 1.124 $ * *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, *			 IBM Corporation *    Author(s): Arnd Bergmann (arndb@de.ibm.com) *		 Cornelia Huck (cohuck@de.ibm.com) *		 Martin Schwidefsky (schwidefsky@de.ibm.com) */#include <linux/config.h>#include <linux/module.h>#include <linux/init.h>#include <linux/spinlock.h>#include <linux/errno.h>#include <linux/err.h>#include <linux/slab.h>#include <linux/list.h>#include <linux/device.h>#include <linux/workqueue.h>#include <asm/ccwdev.h>#include <asm/cio.h>#include "cio.h"#include "css.h"#include "device.h"#include "ioasm.h"/******************* bus type handling ***********************//* The Linux driver model distinguishes between a bus type and * the bus itself. Of course we only have one channel * subsystem driver and one channel system per machine, but * we still use the abstraction. T.R. says it's a good idea. */static intccw_bus_match (struct device * dev, struct device_driver * drv){	struct ccw_device *cdev = to_ccwdev(dev);	struct ccw_driver *cdrv = to_ccwdrv(drv);	const struct ccw_device_id *ids = cdrv->ids, *found;	if (!ids)		return 0;	found = ccw_device_id_match(ids, &cdev->id);	if (!found)		return 0;	cdev->id.driver_info = found->driver_info;	return 1;}/* * Hotplugging interface for ccw devices. * Heavily modeled on pci and usb hotplug. */static intccw_hotplug (struct device *dev, char **envp, int num_envp,	     char *buffer, int buffer_size){	struct ccw_device *cdev = to_ccwdev(dev);	int i = 0;	int length = 0;	if (!cdev)		return -ENODEV;	if (cdev->private->state == DEV_STATE_NOT_OPER)		return -ENODEV;	/* what we want to pass to /sbin/hotplug */	envp[i++] = buffer;	length += scnprintf(buffer, buffer_size - length, "CU_TYPE=%04X",			   cdev->id.cu_type);	if ((buffer_size - length <= 0) || (i >= num_envp))		return -ENOMEM;	++length;	buffer += length;	envp[i++] = buffer;	length += scnprintf(buffer, buffer_size - length, "CU_MODEL=%02X",			   cdev->id.cu_model);	if ((buffer_size - length <= 0) || (i >= num_envp))		return -ENOMEM;	++length;	buffer += length;	/* The next two can be zero, that's ok for us */	envp[i++] = buffer;	length += scnprintf(buffer, buffer_size - length, "DEV_TYPE=%04X",			   cdev->id.dev_type);	if ((buffer_size - length <= 0) || (i >= num_envp))		return -ENOMEM;	++length;	buffer += length;	envp[i++] = buffer;	length += scnprintf(buffer, buffer_size - length, "DEV_MODEL=%02X",			   cdev->id.dev_model);	if ((buffer_size - length <= 0) || (i >= num_envp))		return -ENOMEM;	envp[i] = 0;	return 0;}struct bus_type ccw_bus_type = {	.name  = "ccw",	.match = &ccw_bus_match,	.hotplug = &ccw_hotplug,};static int io_subchannel_probe (struct device *);static int io_subchannel_remove (struct device *);void io_subchannel_irq (struct device *);static int io_subchannel_notify(struct device *, int);static void io_subchannel_verify(struct device *);static void io_subchannel_ioterm(struct device *);static void io_subchannel_shutdown(struct device *);struct css_driver io_subchannel_driver = {	.subchannel_type = SUBCHANNEL_TYPE_IO,	.drv = {		.name = "io_subchannel",		.bus  = &css_bus_type,		.probe = &io_subchannel_probe,		.remove = &io_subchannel_remove,		.shutdown = &io_subchannel_shutdown,	},	.irq = io_subchannel_irq,	.notify = io_subchannel_notify,	.verify = io_subchannel_verify,	.termination = io_subchannel_ioterm,};struct workqueue_struct *ccw_device_work;struct workqueue_struct *ccw_device_notify_work;static wait_queue_head_t ccw_device_init_wq;static atomic_t ccw_device_init_count;static int __initinit_ccw_bus_type (void){	int ret;	init_waitqueue_head(&ccw_device_init_wq);	atomic_set(&ccw_device_init_count, 0);	ccw_device_work = create_singlethread_workqueue("cio");	if (!ccw_device_work)		return -ENOMEM; /* FIXME: better errno ? */	ccw_device_notify_work = create_singlethread_workqueue("cio_notify");	if (!ccw_device_notify_work) {		ret = -ENOMEM; /* FIXME: better errno ? */		goto out_err;	}	slow_path_wq = create_singlethread_workqueue("kslowcrw");	if (!slow_path_wq) {		ret = -ENOMEM; /* FIXME: better errno ? */		goto out_err;	}	if ((ret = bus_register (&ccw_bus_type)))		goto out_err;	if ((ret = driver_register(&io_subchannel_driver.drv)))		goto out_err;	wait_event(ccw_device_init_wq,		   atomic_read(&ccw_device_init_count) == 0);	flush_workqueue(ccw_device_work);	return 0;out_err:	if (ccw_device_work)		destroy_workqueue(ccw_device_work);	if (ccw_device_notify_work)		destroy_workqueue(ccw_device_notify_work);	if (slow_path_wq)		destroy_workqueue(slow_path_wq);	return ret;}static void __exitcleanup_ccw_bus_type (void){	driver_unregister(&io_subchannel_driver.drv);	bus_unregister(&ccw_bus_type);	destroy_workqueue(ccw_device_notify_work);	destroy_workqueue(ccw_device_work);}subsys_initcall(init_ccw_bus_type);module_exit(cleanup_ccw_bus_type);/************************ device handling **************************//* * A ccw_device has some interfaces in sysfs in addition to the * standard ones. * The following entries are designed to export the information which * resided in 2.4 in /proc/subchannels. Subchannel and device number * are obvious, so they don't have an entry :) * TODO: Split chpids and pimpampom up? Where is "in use" in the tree? */static ssize_tchpids_show (struct device * dev, char * buf){	struct subchannel *sch = to_subchannel(dev);	struct ssd_info *ssd = &sch->ssd_info;	ssize_t ret = 0;	int chp;	for (chp = 0; chp < 8; chp++)		ret += sprintf (buf+ret, "%02x ", ssd->chpid[chp]);	ret += sprintf (buf+ret, "\n");	return min((ssize_t)PAGE_SIZE, ret);}static ssize_tpimpampom_show (struct device * dev, char * buf){	struct subchannel *sch = to_subchannel(dev);	struct pmcw *pmcw = &sch->schib.pmcw;	return sprintf (buf, "%02x %02x %02x\n",			pmcw->pim, pmcw->pam, pmcw->pom);}static ssize_tdevtype_show (struct device *dev, char *buf){	struct ccw_device *cdev = to_ccwdev(dev);	struct ccw_device_id *id = &(cdev->id);	if (id->dev_type != 0)		return sprintf(buf, "%04x/%02x\n",				id->dev_type, id->dev_model);	else		return sprintf(buf, "n/a\n");}static ssize_tcutype_show (struct device *dev, char *buf){	struct ccw_device *cdev = to_ccwdev(dev);	struct ccw_device_id *id = &(cdev->id);	return sprintf(buf, "%04x/%02x\n",		       id->cu_type, id->cu_model);}static ssize_tonline_show (struct device *dev, char *buf){	struct ccw_device *cdev = to_ccwdev(dev);	return sprintf(buf, cdev->online ? "1\n" : "0\n");}static voidccw_device_remove_disconnected(struct ccw_device *cdev){	struct subchannel *sch;	/*	 * Forced offline in disconnected state means	 * 'throw away device'.	 */	sch = to_subchannel(cdev->dev.parent);	device_unregister(&sch->dev);	/* Reset intparm to zeroes. */	sch->schib.pmcw.intparm = 0;	cio_modify(sch);	put_device(&sch->dev);}intccw_device_set_offline(struct ccw_device *cdev){	int ret;	if (!cdev)		return -ENODEV;	if (!cdev->online || !cdev->drv)		return -EINVAL;	if (cdev->drv->set_offline) {		ret = cdev->drv->set_offline(cdev);		if (ret != 0)			return ret;	}	cdev->online = 0;	spin_lock_irq(cdev->ccwlock);	ret = ccw_device_offline(cdev);	spin_unlock_irq(cdev->ccwlock);	if (ret == 0)		wait_event(cdev->private->wait_q, dev_fsm_final_state(cdev));	else {		pr_debug("ccw_device_offline returned %d, device %s\n",			 ret, cdev->dev.bus_id);		cdev->online = 1;	} 	return ret;}intccw_device_set_online(struct ccw_device *cdev){	int ret;	if (!cdev)		return -ENODEV;	if (cdev->online || !cdev->drv)		return -EINVAL;	spin_lock_irq(cdev->ccwlock);	ret = ccw_device_online(cdev);	spin_unlock_irq(cdev->ccwlock);	if (ret == 0)		wait_event(cdev->private->wait_q, dev_fsm_final_state(cdev));	else {		pr_debug("ccw_device_online returned %d, device %s\n",			 ret, cdev->dev.bus_id);		return ret;	}	if (cdev->private->state != DEV_STATE_ONLINE)		return -ENODEV;	if (!cdev->drv->set_online || cdev->drv->set_online(cdev) == 0) {		cdev->online = 1;		return 0;	}	spin_lock_irq(cdev->ccwlock);	ret = ccw_device_offline(cdev);	spin_unlock_irq(cdev->ccwlock);	if (ret == 0)		wait_event(cdev->private->wait_q, dev_fsm_final_state(cdev));	else 		pr_debug("ccw_device_offline returned %d, device %s\n",			 ret, cdev->dev.bus_id);	return (ret = 0) ? -ENODEV : ret;}static ssize_tonline_store (struct device *dev, const char *buf, size_t count){	struct ccw_device *cdev = to_ccwdev(dev);	int i, force, ret;	char *tmp;	if (atomic_compare_and_swap(0, 1, &cdev->private->onoff))		return -EAGAIN;	if (cdev->drv && !try_module_get(cdev->drv->owner)) {		atomic_set(&cdev->private->onoff, 0);		return -EINVAL;	}	if (!strncmp(buf, "force\n", count)) {		force = 1;		i = 1;	} else {		force = 0;		i = simple_strtoul(buf, &tmp, 16);	}	if (i == 1) {		/* Do device recognition, if needed. */		if (cdev->id.cu_type == 0) {			ret = ccw_device_recognition(cdev);			if (ret) {				printk(KERN_WARNING"Couldn't start recognition "				       "for device %s (ret=%d)\n",				       cdev->dev.bus_id, ret);				goto out;			}			wait_event(cdev->private->wait_q,				   cdev->private->flags.recog_done);		}		if (cdev->drv && cdev->drv->set_online)			ccw_device_set_online(cdev);	} else if (i == 0) {		if (cdev->private->state == DEV_STATE_DISCONNECTED)			ccw_device_remove_disconnected(cdev);		else if (cdev->drv && cdev->drv->set_offline)			ccw_device_set_offline(cdev);	}	if (force && cdev->private->state == DEV_STATE_BOXED) {		ret = ccw_device_stlck(cdev);		if (ret) {			printk(KERN_WARNING"ccw_device_stlck for device %s "			       "returned %d!\n", cdev->dev.bus_id, ret);			goto out;		}		/* Do device recognition, if needed. */		if (cdev->id.cu_type == 0) {			cdev->private->state = DEV_STATE_NOT_OPER;			ret = ccw_device_recognition(cdev);			if (ret) {				printk(KERN_WARNING"Couldn't start recognition "				       "for device %s (ret=%d)\n",				       cdev->dev.bus_id, ret);				goto out;			}			wait_event(cdev->private->wait_q,				   cdev->private->flags.recog_done);		}		if (cdev->drv && cdev->drv->set_online)			ccw_device_set_online(cdev);	}	out:	if (cdev->drv)		module_put(cdev->drv->owner);	atomic_set(&cdev->private->onoff, 0);	return count;}static ssize_tavailable_show (struct device *dev, char *buf){	struct ccw_device *cdev = to_ccwdev(dev);	struct subchannel *sch;	switch (cdev->private->state) {	case DEV_STATE_BOXED:		return sprintf(buf, "boxed\n");	case DEV_STATE_DISCONNECTED:	case DEV_STATE_DISCONNECTED_SENSE_ID:	case DEV_STATE_NOT_OPER:		sch = to_subchannel(dev->parent);		if (!sch->lpm)			return sprintf(buf, "no path\n");		else			return sprintf(buf, "no device\n");	default:		/* All other states considered fine. */		return sprintf(buf, "good\n");	}}static DEVICE_ATTR(chpids, 0444, chpids_show, NULL);static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL);static DEVICE_ATTR(devtype, 0444, devtype_show, NULL);static DEVICE_ATTR(cutype, 0444, cutype_show, NULL);static DEVICE_ATTR(online, 0644, online_show, online_store);extern struct device_attribute dev_attr_cmb_enable;static DEVICE_ATTR(availability, 0444, available_show, NULL);static struct attribute * subch_attrs[] = {	&dev_attr_chpids.attr,	&dev_attr_pimpampom.attr,	NULL,};static struct attribute_group subch_attr_group = {	.attrs = subch_attrs,};static inline intsubchannel_add_files (struct device *dev){	return sysfs_create_group(&dev->kobj, &subch_attr_group);}static struct attribute * ccwdev_attrs[] = {	&dev_attr_devtype.attr,	&dev_attr_cutype.attr,	&dev_attr_online.attr,	&dev_attr_cmb_enable.attr,	&dev_attr_availability.attr,	NULL,};static struct attribute_group ccwdev_attr_group = {	.attrs = ccwdev_attrs,};static inline intdevice_add_files (struct device *dev){	return sysfs_create_group(&dev->kobj, &ccwdev_attr_group);}static inline voiddevice_remove_files(struct device *dev){	sysfs_remove_group(&dev->kobj, &ccwdev_attr_group);}/* this is a simple abstraction for device_register that sets the * correct bus type and adds the bus specific files */intccw_device_register(struct ccw_device *cdev){	struct device *dev = &cdev->dev;	int ret;	dev->bus = &ccw_bus_type;	if ((ret = device_add(dev)))		return ret;	if ((ret = device_add_files(dev)))		device_del(dev);	return ret;}static struct ccw_device *get_disc_ccwdev_by_devno(unsigned int devno, struct ccw_device *sibling){	struct ccw_device *cdev;	struct list_head *entry;	struct device *dev;	if (!get_bus(&ccw_bus_type))		return NULL;	down_read(&ccw_bus_type.subsys.rwsem);	cdev = NULL;	list_for_each(entry, &ccw_bus_type.devices.list) {		dev = get_device(container_of(entry,					      struct device, bus_list));		if (!dev)			continue;		cdev = to_ccwdev(dev);		if ((cdev->private->state == DEV_STATE_DISCONNECTED) &&		    (cdev->private->devno == devno) &&		    (!strncmp(cdev->dev.bus_id, sibling->dev.bus_id,			      BUS_ID_SIZE))) {			cdev->private->state = DEV_STATE_NOT_OPER;			break;		}		put_device(dev);		cdev = NULL;	}	up_read(&ccw_bus_type.subsys.rwsem);	put_bus(&ccw_bus_type);	return cdev;}extern int css_get_ssd_info(struct subchannel *sch);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
a美女胸又www黄视频久久| 国产婷婷色一区二区三区| 91精品1区2区| 91在线精品一区二区| 不卡影院免费观看| 成人18视频在线播放| av一区二区久久| 色婷婷香蕉在线一区二区| 99久久久无码国产精品| 91视频免费播放| 色视频成人在线观看免| 91久久精品日日躁夜夜躁欧美| 欧洲在线/亚洲| 欧美日韩综合不卡| 欧美一区二区视频在线观看2022 | 欧美久久久一区| 欧美久久久一区| 欧美va亚洲va香蕉在线| 久久精品无码一区二区三区| 中文字幕av一区 二区| 亚洲人精品午夜| 午夜精彩视频在线观看不卡| 久久精品国产精品亚洲综合| 国产乱妇无码大片在线观看| 成人av免费在线播放| 在线观看中文字幕不卡| 欧美一级片免费看| 国产欧美一区二区精品性色超碰| 中文字幕+乱码+中文字幕一区| 一区在线观看视频| 亚洲一级片在线观看| 久久成人麻豆午夜电影| 成a人片亚洲日本久久| 欧美日韩一区视频| 久久综合网色—综合色88| 亚洲视频每日更新| 五月婷婷激情综合网| 国产在线视频一区二区三区| 99精品桃花视频在线观看| 欧美剧在线免费观看网站| 国产三区在线成人av| 一区二区三区免费网站| 极品少妇xxxx精品少妇| 99精品国产一区二区三区不卡| 欧美精品久久99| 国产精品色哟哟网站| 天天操天天色综合| 成人国产电影网| 在线播放日韩导航| 国产精品嫩草影院com| 天天色综合成人网| 99视频一区二区三区| 91精品蜜臀在线一区尤物| 欧美国产欧美亚州国产日韩mv天天看完整 | 色香色香欲天天天影视综合网| 制服丝袜亚洲播放| 亚洲欧洲日韩综合一区二区| 另类欧美日韩国产在线| 91蜜桃婷婷狠狠久久综合9色| 欧美成人午夜电影| 一区二区免费视频| 成人av网站在线观看免费| 日韩一区二区三区免费看| 亚洲婷婷综合色高清在线| 久久精品国产久精国产爱| 一本久道久久综合中文字幕| 精品国产污网站| 亚洲国产精品一区二区久久恐怖片 | 亚洲va欧美va人人爽| www.亚洲免费av| 久久综合色鬼综合色| 五月天中文字幕一区二区| www.激情成人| 久久精品夜夜夜夜久久| 麻豆精品在线视频| 欧美日韩精品欧美日韩精品一综合| 国产女人18毛片水真多成人如厕 | 蜜桃视频免费观看一区| 91高清在线观看| 国产精品看片你懂得| 国产一区二区看久久| 日韩无一区二区| 婷婷丁香久久五月婷婷| 91福利精品视频| 亚洲卡通欧美制服中文| av男人天堂一区| 国产精品系列在线| 国产麻豆欧美日韩一区| 欧美成人免费网站| 麻豆国产欧美一区二区三区| 欧美日韩国产首页在线观看| 亚洲国产中文字幕| 色综合久久天天| 亚洲伦理在线精品| 色综合久久久久久久久久久| 自拍偷拍国产精品| www.日韩av| 国产精品国产三级国产普通话三级 | 日韩精品一区在线| 免费观看91视频大全| 911精品产国品一二三产区| 五月天激情综合网| 欧美日本精品一区二区三区| 午夜视频在线观看一区二区| 欧美日韩情趣电影| 天堂成人国产精品一区| 3d成人动漫网站| 久久99精品久久久久久国产越南| 日韩欧美国产wwwww| 久久超级碰视频| 久久精品视频免费| 成人开心网精品视频| 亚洲精品成人悠悠色影视| 欧美午夜电影在线播放| 日本成人在线不卡视频| 精品区一区二区| 国产成人av在线影院| 亚洲丝袜美腿综合| 欧美三级一区二区| 麻豆精品在线观看| 国产欧美精品日韩区二区麻豆天美| 成人av电影观看| 亚洲尤物视频在线| 日韩精品中文字幕在线不卡尤物| 精品一区二区国语对白| 国产亚洲精品免费| 99re热视频精品| 日日夜夜精品视频天天综合网| 日韩欧美高清在线| 成人av资源网站| 午夜激情久久久| 久久久精品国产免费观看同学| 成人av先锋影音| 午夜精品福利一区二区三区av| 欧美成人伊人久久综合网| 豆国产96在线|亚洲| 亚洲一区在线视频| 精品精品国产高清一毛片一天堂| 成人高清av在线| 日韩在线一区二区| 欧美激情在线一区二区三区| 色婷婷精品大在线视频| 老司机精品视频在线| 国产精品每日更新| 欧美福利电影网| 懂色av一区二区夜夜嗨| 日韩高清不卡在线| 国产精品人人做人人爽人人添| 欧美三日本三级三级在线播放| 狠狠色狠狠色综合系列| 一区二区三区av电影 | 五月婷婷激情综合网| 国产午夜精品久久久久久免费视 | 日韩女同互慰一区二区| 91在线视频网址| 国内精品伊人久久久久av一坑 | 亚洲一二三区在线观看| 精品国产一区二区亚洲人成毛片 | 26uuuu精品一区二区| 日本精品一区二区三区四区的功能| 美女一区二区在线观看| 一区二区三区电影在线播| 久久久欧美精品sm网站| 欧美精品v国产精品v日韩精品 | 在线观看国产日韩| 国产麻豆一精品一av一免费| 亚洲成av人片在线观看| 亚洲日韩欧美一区二区在线| 日韩欧美激情在线| 欧美日韩国产三级| 91在线porny国产在线看| 国产美女精品在线| 日本一道高清亚洲日美韩| 亚洲人吸女人奶水| 国产精品三级av| 久久中文娱乐网| 日韩你懂的在线播放| 欧美日韩国产成人在线91| 色久优优欧美色久优优| 成人av影院在线| 国产精品91一区二区| 久久电影国产免费久久电影| 日日夜夜精品视频免费| 亚洲影院久久精品| 亚洲精品成人a在线观看| 1024亚洲合集| 中文字幕亚洲精品在线观看| 中文在线资源观看网站视频免费不卡| 日韩一卡二卡三卡国产欧美| 欧美丝袜自拍制服另类| 色婷婷激情久久| 99r精品视频| www.欧美.com| av成人免费在线观看| 国产东北露脸精品视频| 国产福利一区在线| 国产一区二区免费看| 国产精品自拍在线| 国产盗摄女厕一区二区三区| 国产露脸91国语对白|