Skip to contentSkip to conversation

document that udev isn't yet ready (fwd)

PATCH In review Adrian Bunk 6 participants 14 messages Nov 19, 2003 – Nov 21, 2003

Subsystems (6)
VFS USB Kbuild Library code +2 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 document that udev isn't yet ready (fwd)

The trivial documentation patch forwarded below still applies (with a few lines offset) against 2.6.0-test9-mm4.

Please apply
Adrian

----- Forwarded message from Adrian Bunk <[email protected]> -----

Date: Wed, 8 Oct 2003 14:07:11 +0200
From: Adrian Bunk <[email protected]>
To: Andreas Jellinghaus <[email protected]>,
Greg KH <[email protected]>, Linus Torvalds <[email protected]>
Cc: [email protected]
Subject: [2.6 patch] document that udev isn't yet ready

Quoted 6 lines · Andreas Jellinghaus
Quoted 4 lines · Greg KH

And remember, _I_ did not submit that patch to the kernel marking devfs obsolete. Other kernel developers did. And for good reasons, which have all been explained before. Even if udev wasn't even written yet, it would have been done.

Quoted 6 lines

"Note that devfs has been obsoleted by udev,"

Most people expect after reading that sentence, that udev can do the work devfs did for them. But udev is not ready to do that, even by far. Thats why people complain.
...

The following trivial change to te help text should clarify it:

fs/Kconfig renamed from fs/Kconfig.old +1 -1
@@ -784,7 +784,7 @@
 	  ptys, you will also need to enable (and mount) the /dev/pts
 	  filesystem (CONFIG_DEVPTS_FS).
 
-	  Note that devfs has been obsoleted by udev,
+	  Note that devfs will be obsoleted by udev
 	  <http://www.kernel.org/pub/linux/utils/kernel/hotplug/>.
 	  It has been stripped down to a bare minimum and is only provided for
 	  legacy installations that use its naming scheme which is
Quoted 1 line

Regards, Andreas

cu
Adrian

Signature · 12 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

----- End forwarded message -----
#1 lore raw
Quoted 2 lines · Adrian Bunk

The trivial documentation patch forwarded below still applies (with a few lines offset) against 2.6.0-test9-mm4.

Hm, with the 006 release, what do you find lacking in udev?

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines · Adrian Bunk

The trivial documentation patch forwarded below still applies (with a few lines offset) against 2.6.0-test9-mm4.

Hm, with the 006 release, what do you find lacking in udev?

I am guessing its more driver support, etc. Input devices for instance do not seem to have any sysfs support yet, and full initramfs support with udev in there, and udev.permissions setup to get general permissions, etc right, might make it more advertisable for the masses (no need to maintain /dev or the initial costs for users not so interested in the workings of things).

Lets just say from what I have seen from users talking/asking, the initial setup and seeming 'lack of functionality' is the biggest blocker.

Cheers,

Signature · 1 line
Martin Schlemmer
#3 lore raw
Quoted 10 lines · Martin Schlemmer
Quoted 6 lines · Greg KH
Quoted 2 lines · Adrian Bunk

The trivial documentation patch forwarded below still applies (with a few lines offset) against 2.6.0-test9-mm4.

Hm, with the 006 release, what do you find lacking in udev?

I am guessing its more driver support, etc. Input devices for instance do not seem to have any sysfs support yet,

Yes, we do need better driver support. But that's nothing that udev itself can do :)

I have a number of patches pending for 2.6.1 that will add more driver support for sysfs.

Quoted 1 line

and full initramfs support with udev in there,

The people keeping the klibc kernel bk tree have enough support in it to place udev into initramfs. Again, nothing that udev needs to do for this.

Quoted 1 line

and udev.permissions setup to get general permissions, etc right,

We now support wildcards in udev.permissions, forgot to mention that in the 006 release. So it's just a matter of distros building up a permissions file that matches their needs.

Quoted 3 lines

might make it more advertisable for the masses (no need to maintain /dev or the initial costs for users not so interested in the workings of things).

Mostly it's a implementation issue with a distro to get everything tied together properly. Much like devfs had issues when it was added to the kernel and people had to tweak userspace a bunch to get it to work properly.

Quoted 3 lines

Lets just say from what I have seen from users talking/asking, the initial setup and seeming 'lack of functionality' is the biggest blocker.

Initial setup will be done by distros when they implement it into their system. What do you mean by "lack of functionality"? What users are telling you this, and what functions are they? Please feel free to forward them on to me, otherwise I will not know...

Now yes, I do know that udev still has a way to go to be solid and mature, but it is usable for the most part :)

thanks,

greg k-h

#4 lore raw

Hi!

Quoted 12 lines
Quoted 5 lines
Quoted 2 lines

Hm, with the 006 release, what do you find lacking in udev?

I am guessing its more driver support, etc. Input devices for instance do not seem to have any sysfs support yet,

Yes, we do need better driver support. But that's nothing that udev itself can do :)

I have a number of patches pending for 2.6.1 that will add more driver support for sysfs.

What drivers did you convert? sysfs-for-inputs would be *very* welcome.

Signature · 2 lines
				Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...
#5 lore raw
Quoted 8 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Hm, with the 006 release, what do you find lacking in udev?

I am guessing its more driver support, etc. Input devices for instance do not seem to have any sysfs support yet,

Quoted 8 lines
Quoted 6 lines

Yes, we do need better driver support. But that's nothing that udev itself can do :)

I have a number of patches pending for 2.6.1 that will add more driver support for sysfs.

What drivers did you convert? sysfs-for-inputs would be *very* welcome.

I have patches for the memory devices, all sound drivers (ALSA and OSS), frame buffer devices, and misc devices in my linuxusb.bkbits.net/usb-2.5 tree. Hanna Linder is working on the input sysfs patches, and has posted some work in the past.

thanks,

greg k-h

#6 lore raw

Hi!

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
Quoted 2 lines

Hm, with the 006 release, what do you find lacking in udev?

I am guessing its more driver support, etc. Input devices for instance do not seem to have any sysfs support yet,

Yes, we do need better driver support. But that's nothing that udev itself can do :)

I have a number of patches pending for 2.6.1 that will add more driver support for sysfs.

Quoted 7 lines
Quoted 2 lines

What drivers did you convert? sysfs-for-inputs would be *very* welcome.

I have patches for the memory devices, all sound drivers (ALSA and OSS), frame buffer devices, and misc devices in my linuxusb.bkbits.net/usb-2.5 tree. Hanna Linder is working on the input sysfs patches, and has posted some work in the past.

Do you have URL/her e-mail address? I don't remember seeing anything :-(.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#7 lore raw

driver model for inputs

In reply to Greg KH

Hi!

Quoted 4 lines · Greg

I have patches for the memory devices, all sound drivers (ALSA and OSS), frame buffer devices, and misc devices in my linuxusb.bkbits.net/usb-2.5 tree. Hanna Linder is working on the input sysfs patches, and has posted some work in the past.

I could only find 2.5.70 patches, and those did not seem "good enough" to do power managment with them. Do you have some newer version?

[One of machines near me needs keyboard to be reinitialized after S3 sleep... And users are starting to hit that, too.]
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#8 lore raw

Re: driver model for inputs

Quoted 9 lines · --On Thursday, November 20, 2003 11:28:25 PM +0100 Pavel Machek <[email protected]>…
Quoted 2 lines

tree. Hanna Linder is working on the input sysfs patches, and has posted some work in the past.

I could only find 2.5.70 patches, and those did not seem "good enough" to do power managment with them. Do you have some newer version?

[One of machines near me needs keyboard to be reinitialized after S3 sleep... And users are starting to hit that, too.]
Pavel

Hi Pavel,

I have test8 version of the patch which mostly works. The only problem now is a panic when I remove the mouse... The input layer is sorta hard to follow you know :) Im guessing it is a reference counting issue. Do you want what I have now or can I update it to test9 and see if taking a break from staring at it has helped?

Thanks.

Hanna

#9 lore raw

Re: driver model for inputs

Hi!

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

tree. Hanna Linder is working on the input sysfs patches, and has posted some work in the past.

I could only find 2.5.70 patches, and those did not seem "good enough" to do power managment with them. Do you have some newer version?

Quoted 8 lines
Quoted 2 lines

[One of machines near me needs keyboard to be reinitialized after S3 sleep... And users are starting to hit that, too.]

I have test8 version of the patch which mostly works. The only problem now is a panic when I remove the mouse... The input layer is sorta hard to follow you know :) Im guessing it is a reference counting issue. Do you want what I have now or can I update it to test9 and see if taking a break from staring at it has helped?

If you could post -test8 version, that would be great.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#10 lore raw

Re: driver model for inputs

Quoted 2 lines · --On Thursday, November 20, 2003 11:55:04 PM +0100 Pavel Machek <[email protected]>…

If you could post -test8 version, that would be great.
Pavel

It is actually test5. Ive been working on multiple sysfs patches, the parport one is test8. Ill get started on this one again and send out a cleaned up test9 version in a bit. This one is pretty ugly because it's got lots of printks in it. I was going to break it up before submitting it too. But here ya go...

Hanna

---

Makefile +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/Makefile linux-260t5-ic/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 0
-EXTRAVERSION = -test5
+EXTRAVERSION = -test5ic
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
drivers/base/bus.c +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/base/bus.c linux-260t5-ic/drivers/base/bus.c
@@ -8,7 +8,7 @@
  *
  */
 
-#undef DEBUG
+#define DEBUG
 
 #include <linux/device.h>
 #include <linux/module.h>
drivers/base/class.c +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/base/class.c linux-260t5-ic/drivers/base/class.c
@@ -10,7 +10,7 @@
  *
  */
 
-#undef DEBUG
+#define DEBUG
 
 #include <linux/device.h>
 #include <linux/module.h>
drivers/base/core.c +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/base/core.c linux-260t5-ic/drivers/base/core.c
@@ -8,7 +8,7 @@
  *
  */
 
-#undef DEBUG
+#define DEBUG
 
 #include <linux/device.h>
 #include <linux/err.h>
drivers/input/evdev.c +41 -19

172 lines not on this page · raw message

drivers/input/input.c +116 -0

144 lines not on this page · raw message

drivers/input/joydev.c +16 -6
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/input/joydev.c linux-260t5-ic/drivers/input/joydev.c
@@ -143,7 +143,7 @@ static int joydev_fasync(int fd, struct 
 
 static void joydev_free(struct joydev *joydev)
 {
-	devfs_remove("js%d", joydev->minor);
+	//input_unregister_class_dev(intf.name, joydev->minor);
 	joydev_table[joydev->minor] = NULL;
 	kfree(joydev);
 }
@@ -159,8 +159,10 @@ static int joydev_release(struct inode *
 	if (!--list->joydev->open) {
 		if (list->joydev->exist)
 			input_close_device(&list->joydev->handle);
-		else
+		else{
+	//		input_unregister_class_dev(intf.name, list->joydev->minor);
 			joydev_free(list->joydev);
+		}
 	}
 
 	kfree(list);
@@ -375,6 +377,12 @@ static struct file_operations joydev_fop
 	.fasync =	joydev_fasync,
 };
 
+static struct input_class_interface intf = {
+	.name = 	"js%d",
+	.mode = 	S_IFCHR | S_IRUGO | S_IWUSR,
+	.minor_base = 	JOYDEV_MINOR_BASE,
+};
+
 static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id)
 {
 	struct joydev *joydev;
@@ -445,9 +453,9 @@ static struct input_handle *joydev_conne
 	}
 
 	joydev_table[minor] = joydev;
-	
-	devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
-			S_IFCHR|S_IRUGO|S_IWUSR, "js%d", minor);
+
+	intf.minor = minor;
+	//input_register_class_dev(dev, &intf); 	
 
 	return &joydev->handle;
 }
@@ -460,8 +468,10 @@ static void joydev_disconnect(struct inp
 
 	if (joydev->open)
 		input_close_device(handle);	
-	else
+	else{
+		//input_unregister_class_dev(intf.name, joydev->minor);
 		joydev_free(joydev);
+	}
 }
 
 static struct input_device_id joydev_ids[] = {
drivers/input/mouse/logips2pp.c +12 -12
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/input/mouse/logips2pp.c linux-260t5-ic/drivers/input/mouse/logips2pp.c
@@ -19,7 +19,7 @@
 
 void ps2pp_process_packet(struct psmouse *psmouse)
 {
-	struct input_dev *dev = &psmouse->dev;
+	struct input_dev *dev = psmouse->dev;
         unsigned char *packet = psmouse->packet;
 
 	if ((packet[0] & 0x48) == 0x48 && (packet[1] & 0x02) == 0x02) {
@@ -155,9 +155,9 @@ int ps2pp_detect_model(struct psmouse *p
 	psmouse->model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
 
 	if (param[1] < 3)
-		clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
+		clear_bit(BTN_MIDDLE, psmouse->dev->keybit);
 	if (param[1] < 2)
-		clear_bit(BTN_RIGHT, psmouse->dev.keybit);
+		clear_bit(BTN_RIGHT, psmouse->dev->keybit);
 
 	psmouse->type = PSMOUSE_PS2;
 
@@ -169,21 +169,21 @@ int ps2pp_detect_model(struct psmouse *p
 
 		for (i = 0; logitech_4btn[i] != -1; i++)
 			if (logitech_4btn[i] == psmouse->model)
-				set_bit(BTN_SIDE, psmouse->dev.keybit);
+				set_bit(BTN_SIDE, psmouse->dev->keybit);
 
 		for (i = 0; logitech_wheel[i] != -1; i++)
 			if (logitech_wheel[i] == psmouse->model) {
-				set_bit(REL_WHEEL, psmouse->dev.relbit);
+				set_bit(REL_WHEEL, psmouse->dev->relbit);
 				psmouse->name = "Wheel Mouse";
 			}
 
 		for (i = 0; logitech_mx[i] != -1; i++)
 			if (logitech_mx[i]  == psmouse->model) {
-				set_bit(BTN_SIDE, psmouse->dev.keybit);
-				set_bit(BTN_EXTRA, psmouse->dev.keybit);
-				set_bit(BTN_BACK, psmouse->dev.keybit);
-				set_bit(BTN_FORWARD, psmouse->dev.keybit);
-				set_bit(BTN_TASK, psmouse->dev.keybit);
+				set_bit(BTN_SIDE, psmouse->dev->keybit);
+				set_bit(BTN_EXTRA, psmouse->dev->keybit);
+				set_bit(BTN_BACK, psmouse->dev->keybit);
+				set_bit(BTN_FORWARD, psmouse->dev->keybit);
+				set_bit(BTN_TASK, psmouse->dev->keybit);
 				psmouse->name = "MX Mouse";
 			}
 
@@ -193,8 +193,8 @@ int ps2pp_detect_model(struct psmouse *p
 
 		if (psmouse->model == 97) { /* TouchPad 3 */
 
-			set_bit(REL_WHEEL, psmouse->dev.relbit);
-			set_bit(REL_HWHEEL, psmouse->dev.relbit);
+			set_bit(REL_WHEEL, psmouse->dev->relbit);
+			set_bit(REL_HWHEEL, psmouse->dev->relbit);
 
 			param[0] = 0x11; param[1] = 0x04; param[2] = 0x68; /* Unprotect RAM */
 			psmouse_command(psmouse, param, 0x30d1);
drivers/input/mouse/psmouse-base.c +25 -20

90 lines not on this page · raw message

drivers/input/mouse/psmouse.h +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/input/mouse/psmouse.h linux-260t5-ic/drivers/input/mouse/psmouse.h
@@ -18,7 +18,7 @@
 
 struct psmouse {
 	void *private;
-	struct input_dev dev;
+	struct input_dev *dev;
 	struct serio *serio;
 	char *vendor;
 	char *name;
drivers/input/mouse/synaptics.c +19 -19
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/input/mouse/synaptics.c linux-260t5-ic/drivers/input/mouse/synaptics.c
@@ -230,23 +230,23 @@ int synaptics_init(struct psmouse *psmou
 	 * which says that they should be valid regardless of the actual size of
 	 * the senser.
 	 */
-	set_bit(EV_ABS, psmouse->dev.evbit);
-	set_abs_params(&psmouse->dev, ABS_X, 1472, 5472, 0, 0);
-	set_abs_params(&psmouse->dev, ABS_Y, 1408, 4448, 0, 0);
-	set_abs_params(&psmouse->dev, ABS_PRESSURE, 0, 255, 0, 0);
-
-	set_bit(EV_MSC, psmouse->dev.evbit);
-	set_bit(MSC_GESTURE, psmouse->dev.mscbit);
-
-	set_bit(EV_KEY, psmouse->dev.evbit);
-	set_bit(BTN_LEFT, psmouse->dev.keybit);
-	set_bit(BTN_RIGHT, psmouse->dev.keybit);
-	set_bit(BTN_FORWARD, psmouse->dev.keybit);
-	set_bit(BTN_BACK, psmouse->dev.keybit);
-
-	clear_bit(EV_REL, psmouse->dev.evbit);
-	clear_bit(REL_X, psmouse->dev.relbit);
-	clear_bit(REL_Y, psmouse->dev.relbit);
+	set_bit(EV_ABS, psmouse->dev->evbit);
+	set_abs_params(psmouse->dev, ABS_X, 1472, 5472, 0, 0);
+	set_abs_params(psmouse->dev, ABS_Y, 1408, 4448, 0, 0);
+	set_abs_params(psmouse->dev, ABS_PRESSURE, 0, 255, 0, 0);
+
+	set_bit(EV_MSC, psmouse->dev->evbit);
+	set_bit(MSC_GESTURE, psmouse->dev->mscbit);
+
+	set_bit(EV_KEY, psmouse->dev->evbit);
+	set_bit(BTN_LEFT, psmouse->dev->keybit);
+	set_bit(BTN_RIGHT, psmouse->dev->keybit);
+	set_bit(BTN_FORWARD, psmouse->dev->keybit);
+	set_bit(BTN_BACK, psmouse->dev->keybit);
+
+	clear_bit(EV_REL, psmouse->dev->evbit);
+	clear_bit(REL_X, psmouse->dev->relbit);
+	clear_bit(REL_Y, psmouse->dev->relbit);
 
 	return 0;
 
@@ -303,7 +303,7 @@ static void synaptics_parse_hw_state(str
  */
 static void synaptics_process_packet(struct psmouse *psmouse)
 {
-	struct input_dev *dev = &psmouse->dev;
+	struct input_dev *dev = psmouse->dev;
 	struct synaptics_data *priv = psmouse->private;
 	struct synaptics_hw_state hw;
 
@@ -353,7 +353,7 @@ static void synaptics_process_packet(str
 
 void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
 {
-	struct input_dev *dev = &psmouse->dev;
+	struct input_dev *dev = psmouse->dev;
 	struct synaptics_data *priv = psmouse->private;
 	unsigned char *pBuf = priv->proto_buf;
 	unsigned char u = psmouse->packet[0];
drivers/input/mousedev.c +61 -20

191 lines not on this page · raw message

drivers/input/tsdev.c +16 -6
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/input/tsdev.c linux-260t5-ic/drivers/input/tsdev.c
@@ -118,7 +118,7 @@ static int tsdev_open(struct inode *inod
 
 static void tsdev_free(struct tsdev *tsdev)
 {
-	devfs_remove("input/ts%d", tsdev->minor);
+	//input_unregister_class_dev(intf.name, tsdev->minor);
 	tsdev_table[tsdev->minor] = NULL;
 	kfree(tsdev);
 }
@@ -133,8 +133,10 @@ static int tsdev_release(struct inode *i
 	if (!--list->tsdev->open) {
 		if (list->tsdev->exist)
 			input_close_device(&list->tsdev->handle);
-		else
+		else{
+	//		input_unregister_class_dev(intf.name,list->tsdev->minor);
 			tsdev_free(list->tsdev);
+		}
 	}
 	kfree(list);
 	return 0;
@@ -298,6 +300,12 @@ static void tsdev_event(struct input_han
 	wake_up_interruptible(&tsdev->wait);
 }
 
+static struct input_class_interface intf = {
+	.name =		"input/ts%d", 
+	.mode = 	S_IFCHRIS | S_IRUGO | S_IWUSR,
+	.minor_base = 	TSDEV_MINOR_BASE,
+};
+
 static struct input_handle *tsdev_connect(struct input_handler *handler,
 					  struct input_dev *dev,
 					  struct input_device_id *id)
@@ -330,9 +338,9 @@ static struct input_handle *tsdev_connec
 	tsdev->handle.private = tsdev;
 
 	tsdev_table[minor] = tsdev;
-	
-	devfs_mk_cdev(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor),
-			S_IFCHR|S_IRUGO|S_IWUSR, "input/ts%d", minor);
+
+	intf.minor = minor;
+	//input_register_class_dev(dev, &intf);	
 
 	return &tsdev->handle;
 }
@@ -346,8 +354,10 @@ static void tsdev_disconnect(struct inpu
 	if (tsdev->open) {
 		input_close_device(handle);
 		wake_up_interruptible(&tsdev->wait);
-	} else
+	} else {
+		//input_unregister_class_dev(intf.name,tsdev->minor);
 		tsdev_free(tsdev);
+	}
 }
 
 static struct input_device_id tsdev_ids[] = {
drivers/usb/input/hid-input.c +26 -20

96 lines not on this page · raw message

drivers/usb/input/hid-lgff.c +5 -5
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/usb/input/hid-lgff.c linux-260t5-ic/drivers/usb/input/hid-lgff.c
@@ -262,15 +262,15 @@ static void hid_lgff_input_init(struct h
 	ff = dev->ff;
 
 	while (*ff >= 0) {
-		set_bit(*ff, hidinput->input.ffbit);
+		set_bit(*ff, hidinput->input->ffbit);
 		++ff;
 	}
 
-	hidinput->input.upload_effect = hid_lgff_upload_effect;
-	hidinput->input.flush = hid_lgff_flush;
+	hidinput->input->upload_effect = hid_lgff_upload_effect;
+	hidinput->input->flush = hid_lgff_flush;
 
-	set_bit(EV_FF, hidinput->input.evbit);
-	hidinput->input.ff_effects_max = LGFF_EFFECTS;
+	set_bit(EV_FF, hidinput->input->evbit);
+	hidinput->input->ff_effects_max = LGFF_EFFECTS;
 }
 
 static void hid_lgff_exit(struct hid_device* hid)
drivers/usb/input/hid-tmff.c +5 -5
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/usb/input/hid-tmff.c linux-260t5-ic/drivers/usb/input/hid-tmff.c
@@ -155,7 +155,7 @@ int hid_tmff_init(struct hid_device *hid
 					private->report = report;
 					private->rumble = field;
 
-					set_bit(FF_RUMBLE, hidinput->input.ffbit);
+					set_bit(FF_RUMBLE, hidinput->input->ffbit);
 					break;
 
 				default:
@@ -164,11 +164,11 @@ int hid_tmff_init(struct hid_device *hid
 			}
 
 			/* Fallthrough to here only when a valid usage is found */
-			hidinput->input.upload_effect = hid_tmff_upload_effect;
-			hidinput->input.flush = hid_tmff_flush;
+			hidinput->input->upload_effect = hid_tmff_upload_effect;
+			hidinput->input->flush = hid_tmff_flush;
 
-			set_bit(EV_FF, hidinput->input.evbit);
-			hidinput->input.ff_effects_max = TMFF_EFFECTS;
+			set_bit(EV_FF, hidinput->input->evbit);
+			hidinput->input->ff_effects_max = TMFF_EFFECTS;
 		}
 	}
 
drivers/usb/input/hid.h +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/usb/input/hid.h linux-260t5-ic/drivers/usb/input/hid.h
@@ -327,7 +327,7 @@ struct hid_control_fifo {
 struct hid_input {
 	struct list_head list;
 	struct hid_report *report;
-	struct input_dev input;
+	struct input_dev *input;
 };
 
 struct hid_device {							/* device report descriptor */
drivers/usb/input/kbtab.c +27 -23

96 lines not on this page · raw message

drivers/usb/input/pid.c +5 -5
diff -Nrup -Xdontdiff linux-2.6.0-test5/drivers/usb/input/pid.c linux-260t5-ic/drivers/usb/input/pid.c
@@ -290,11 +290,11 @@ int hid_pid_init(struct hid_device *hid)
     }
 
     usb_fill_control_urb(private->urbffout, hid->dev,0,(void *) &private->ffcr,private->ctrl_buffer,8,hid_pid_ctrl_out,hid);
-    hidinput->input.upload_effect = hid_pid_upload_effect;
-    hidinput->input.flush = hid_pid_flush;
-    hidinput->input.ff_effects_max = 8;  // A random default
-    set_bit(EV_FF, hidinput->input.evbit);
-    set_bit(EV_FF_STATUS, hidinput->input.evbit);
+    hidinput->input->upload_effect = hid_pid_upload_effect;
+    hidinput->input->flush = hid_pid_flush;
+    hidinput->input->ff_effects_max = 8;  // A random default
+    set_bit(EV_FF, hidinput->input->evbit);
+    set_bit(EV_FF_STATUS, hidinput->input->evbit);
 
     spin_lock_init(&private->lock);
 
drivers/usb/input/powermate.c +27 -22

93 lines not on this page · raw message

drivers/usb/input/usbkbd.c +27 -22

119 lines not on this page · raw message

drivers/usb/input/usbmouse.c +24 -20

90 lines not on this page · raw message

drivers/usb/input/xpad.c +29 -23

103 lines not on this page · raw message

include/linux/input.h +21 -0
diff -Nrup -Xdontdiff linux-2.6.0-test5/include/linux/input.h linux-260t5-ic/include/linux/input.h
@@ -12,12 +12,16 @@
 #ifdef __KERNEL__
 #include <linux/time.h>
 #include <linux/list.h>
+#include <linux/device.h>
 #else
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include <asm/types.h>
 #endif
 
+#define DEBUG 1
+#define INPUT_DEBUG
+
 /*
  * The event structure itself
  */
@@ -811,6 +815,9 @@ struct input_dev {
 
 	struct list_head	h_list;
 	struct list_head	node;
+
+	struct class_device class_dev;
+	unsigned minor;
 };
 
 /*
@@ -888,6 +895,14 @@ struct input_handle {
 	struct list_head	h_node;
 };
 
+struct input_class_interface {
+
+	char *name;
+	mode_t mode;
+	unsigned minor;
+	int minor_base; 
+};
+
 #define to_dev(n) container_of(n,struct input_dev,node)
 #define to_handler(n) container_of(n,struct input_handler,node);
 #define to_handle(n) container_of(n,struct input_handle,d_node)
@@ -902,6 +917,12 @@ void input_unregister_handler(struct inp
 int input_grab_device(struct input_handle *);
 void input_release_device(struct input_handle *);
 
+void input_register_class_dev(struct input_dev *, struct input_class_interface *);
+void input_unregister_class_dev(char *, unsigned );
+
+struct input_dev * input_dev_get(struct input_dev *);
+void input_dev_put(struct input_dev *);
+
 int input_open_device(struct input_handle *);
 void input_close_device(struct input_handle *);
 
lib/kobject.c +1 -1
diff -Nrup -Xdontdiff linux-2.6.0-test5/lib/kobject.c linux-260t5-ic/lib/kobject.c
@@ -10,7 +10,7 @@
  * about using the kobject interface.
  */
 
-#undef DEBUG
+#define DEBUG
 
 #include <linux/kobject.h>
 #include <linux/string.h>
#11 lore raw

Re: driver model for inputs

Hi!

Quoted 6 lines
Quoted 1 line

If you could post -test8 version, that would be great.

It is actually test5. Ive been working on multiple sysfs patches, the parport one is test8. Ill get started on this one again and send out a cleaned up test9 version in a bit. This one is pretty ugly because it's got lots of printks in it. I was going to break it up before submitting it too. But here ya go...

[Snip snip; most of patch seems to be moving from something.dev to something-> dev]

This seems to deal with udev aspect of the problem... Do you have any ideas have powermanagment fits into the picture? I need a way to hook suspend() and resume() methods, so that I can fix keyboard/mouse after sleep.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#12 lore raw

Re: driver model for inputs

Quoted 3 lines · --On Friday, November 21, 2003 12:54:10 AM +0100 Pavel Machek <[email protected]>…

[Snip snip; most of patch seems to be moving from something.dev to something-> dev]

To take advantage of the internal kobject reference counting. The main changes are the registering and unregistering of class objects which gives the input class and devices in the sysfs tree.

Quoted 6 lines

This seems to deal with udev aspect of the problem... Do you have any ideas have powermanagment fits into the picture? I need a way to hook suspend() and resume() methods, so that I can fix keyboard/mouse after sleep.
Pavel

I dont know much about the power management stuff yet. Pat or Greg could probably tell you more than I can.

Hanna

#13 lore raw

Re: driver model for inputs

In reply to Hanna Linder
Quoted 13 lines · Hanna Linder
Quoted 9 lines · --On Thursday, November 20, 2003 11:28:25 PM +0100 Pavel Machek <[email protected]>…
Quoted 2 lines

tree. Hanna Linder is working on the input sysfs patches, and has posted some work in the past.

I could only find 2.5.70 patches, and those did not seem "good enough" to do power managment with them. Do you have some newer version?

[One of machines near me needs keyboard to be reinitialized after S3 sleep... And users are starting to hit that, too.]
Pavel

Quoted 7 lines

Hi Pavel,

I have test8 version of the patch which mostly works. The only problem now is a panic when I remove the mouse... The input layer is sorta hard to follow you know :) Im guessing it is a reference counting issue. Do you want what I have now or can I update it to test9 and see if taking a break from staring at it has helped?

Post it for review, please. We are only now getting somewhat close to fixing sysfs-related breakage in netdev and input layer is much more vile when it comes to locking (and lack of it) and lifetime rules (ditto).