I read an article at http://www.technovelty.org/code/linux/plugging-in-usb.html. Its just very good.
In which function exactly the enumeration of a connected device is done by host and in which function uevent is sent ?
I introduced printks in usb_new_device etc functions and If i use "udevadm monitor --kernel", it is showing the kernel events even before the enumeration function which is called in usb_new_device in hub.c ?
Log follows
[ 110.819399] 123456 hub_irq
[ 110.824952] 123456 hub_port_connect_change
[ 110.979624] 123456 hub_port_init
[ 111.059625] usb 2-1.2: new high speed USB device using fsl-ehci and address 3
[ 111.189722] 123456 usb_new_device
[ 111.196219] usb 2-1.2: New USB device found, idVendor=05ac, idProduct=12a0
[ 111.203113] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 111.210438] usb 2-1.2: Product: iPhone
[ 111.214196] usb 2-1.2: Manufacturer: Apple Inc.
[ 111.218728] usb 2-1.2: SerialNumber: 9356b662a93170509226069e5adf53f2351d774e
KERNEL[110.940183] add /devices/platform/fsl-ehci.1/usb2/2-1/2-1.2 (usb)
Check the timestamps though udevadm out put is at the end(udevadm runs in user space) its actuallt got the event at [ 110.940183] where as usb_new_device was called at [ 111.189722]