From owner-p4-projects@FreeBSD.ORG Wed Jun 27 18:08:22 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A094816A46D; Wed, 27 Jun 2007 18:08:22 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5413C16A46B for ; Wed, 27 Jun 2007 18:08:22 +0000 (UTC) (envelope-from thioretic@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 4677A13C4B0 for ; Wed, 27 Jun 2007 18:08:22 +0000 (UTC) (envelope-from thioretic@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5RI8M6K079877 for ; Wed, 27 Jun 2007 18:08:22 GMT (envelope-from thioretic@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5RI8Mif079874 for perforce@freebsd.org; Wed, 27 Jun 2007 18:08:22 GMT (envelope-from thioretic@FreeBSD.org) Date: Wed, 27 Jun 2007 18:08:22 GMT Message-Id: <200706271808.l5RI8Mif079874@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thioretic@FreeBSD.org using -f From: Maxim Zhuravlev To: Perforce Change Reviews Cc: Subject: PERFORCE change 122417 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2007 18:08:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=122417 Change 122417 by thioretic@thioretic on 2007/06/27 18:08:09 Specifies some basic interfaces. See TODO file. Affected files ... .. //depot/projects/soc2007/thioretic_gidl/TODO#2 edit .. //depot/projects/soc2007/thioretic_gidl/kern/device_if.m#2 edit .. //depot/projects/soc2007/thioretic_gidl/kern/driverops_if.m#1 add .. //depot/projects/soc2007/thioretic_gidl/kern/stackns_if.m#1 add .. //depot/projects/soc2007/thioretic_gidl/sys/uio.h#2 edit Differences ... ==== //depot/projects/soc2007/thioretic_gidl/TODO#2 (text+ko) ==== @@ -1,1 +1,45 @@ -=== Generic Input Device Layer project TODO file ===+=== Generic Input Device Layer project TODO file === +1. Specify stack namespace kobj (add/delete/...) and associated args' types + SOLUTION: specify method sufficent for handling different + kinds of objects. + FILE(S) AFFECTED: kern/stackns_if.m + # the kobj implements the *core* of namespace functionality. + # detailed *outerspace* interfaces is not yet specified. The + # way the namespace will interact with outer world is a matter + # of discussion. + # + # ex. drivers namespace. The namespace is to handle device parts + # of drivers, their driverops part and i/o requests. All these + # can be handled by same operations (add/delete/...), so there + # will be only one set of operations and the kind of object will + # be a parameter. +2. Specify new driver's interface + includes: + a. device interface (attach, detach, probe...) + SOLUTION: add info method + FILE(S) AFFECTED: kern/device_if.m + # currently it returns info of a kinda drivers'-specified + # type. Well, possibly it will become a more standardized + # type in a distant future. It may nicely fit a *caps* + # functionality, when a driver specifies devices with + # which capibilities it supports, and is probed just + # against suitable devices (ex. only against mice devices). + # This would reduce autoconfiguration time and provide a + # user with info in well-defined format. Don't tell me about + # sysctl. I do know, I do know ... ;o) + b. driverops kobj (more likely former cdevsw) + SOLUTION: convert devfs's cdevsw struct t kobj. + FILE(S) AFFECTED: kern/driverops_if.m + # take into account that cdev structure is devfs-specific + # and should be replaced with device_t parameter + # representing the device. Will check, whether it's possible + # to provide an arbitrary interface. No dirty hack will do. + c. modified uio struct (add some *stack-aware* fields) + SOLUTION: add variables: stack_path, state... + FILE(S) AFFECTED: sys/uio.h + # [char* stack_path] holds the path the i/o request should + # pass in stack to be processed. During lifecycle i/o + # request's path may change. + # [int state] lets drivers to influence on i/o request + # lifecycle. + # ... ==== //depot/projects/soc2007/thioretic_gidl/kern/device_if.m#2 (text+ko) ==== @@ -62,6 +62,10 @@ { return EOPNOTSUPP; } + static void* null_info (device_t dev) + { + return EOPNOTSUPP; + } }; /** @@ -314,3 +318,29 @@ METHOD int quiesce { device_t dev; } DEFAULT null_quiesce; + +/** + * @brief This is called when the driver is asked to provide some + * the driver's specific info for the given device. + * + * The method is (? may be) called when a driver is probed against + * some device. The method is included in device interface since + * we shouldn't assert that all drivers in the device's drivers stack + * have provided a *driverops* interface. + * + * To include this method in a device driver, use a line like this + * in the driver's method list: + * + * @code + * KOBJMETHOD(device_info, foo_info) + * @endcode + * + * @param dev the device being requested info about + * + * @retval a pointer to data of a user-defined type. + * currently char* is more likely. + * + */ +METHOD void* info { + device_t dev; +} DEFAULT null_info; ==== //depot/projects/soc2007/thioretic_gidl/sys/uio.h#2 (text+ko) ==== @@ -68,6 +68,11 @@ enum uio_seg uio_segflg; enum uio_rw uio_rw; struct thread *uio_td; + char* stack_path; +#define INVALIDATE 1 +#define FULFILLED 2 +#define RETRY 4 + int state; }; /*