Date: Wed, 27 Jun 2007 18:08:22 GMT From: Maxim Zhuravlev <thioretic@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 122417 for review Message-ID: <200706271808.l5RI8Mif079874@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }; /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706271808.l5RI8Mif079874>