USB mouse 枚举过程 在 linux 上的代码分析1

usb mouse 在插入后,在不传输 鼠标坐标或动作数据的情况下,会进行 26次中断
	这26次中断包括了 枚举过程的控制传输
usb mouse 在拔出后,有一次中断
	这次中断中,还有控制传输,为什么 电气连接都没有了,还有控制传输
		ohci_s3c2410_hub_control不是控制传输,而是 // 这些对应了 https://blog.csdn.net/u011011827/article/details/126452348 中的 1-4
			"对port状态进行读取" , 读 change bit
			"对port进行控制"
				清 change bit
				对 port reset
usb 插入之后,对于软件来说
	会有中断顶半部
	第一次中断 顶半部中会提交任务(hcd_resume_work)到工作者线程
	hcd_resume_work 也会提交 任务(hub_event)到工作者线程
		hcd_resume_work 先运行,然后hub_event 再运行
	中断顶半部会和工作者线程同时并发,来完成usb的枚举过程
	
usb 插入后,对于硬件来说
	1. 对 hub 和port 进行 状态监听和控制
	2. 利用 usb_control_msg 进行控制传输
		在传输的过程中会有中断
插入过程解析
中断的原因 分别可能为
	WritebackDoneHead
	StartofFrame
	ResumeDetected
	RootHubStatusChange

共前6+20次ohci_irq,6次中,4次rhsc
		其中调用了10次 usb_hcd_poll_rh_status 和 ohci_root_hub_state_changes
	后20次中
		没有调用 usb_hcd_poll_rh_status 和 ohci_root_hub_state_changes

每次 ohci_root_hub_state_changes 中都会调用 1次或两次 s3c2410_hub_control 
	而 s3c2410_hub_control 有debug信息,这个信息是之后的探索方向

以下为前6次的log
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4c ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 3
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,9d SET TIMER
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 1
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,9d SET TIMER
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,99


SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9 // 这一次是怎么被调用的
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9 // 这一次是怎么被调用的


SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5 SET TIMER
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1


SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5 SET TIMER
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1
第一次中断后
	查到是 rhsc
	将 usb device 和 usb interface(hub) 唤醒,不涉及总线上的控制传输


	ohci_irq
		usb_hcd_poll_rh_status
			hcd->driver->hub_status_data // 即ohci_s3c2410_hub_status_data
				ohci_hub_status_data
					ohci_root_hub_state_changes
						usb_hcd_resume_root_hub
							queue_work(pm_wq, &hcd->wakeup_work); // 对应 hcd_resume_work
	kthread->worker_thread->process_one_work // 工作队列 的运行时机 在 worker_thread 内核线程 被调度时
		hcd_resume_work
			usb_remote_wakeup
				[26] usb_remote_wakeup:3646: usb usb1: usb wakeup-resume
				usb_autoresume_device
					__pm_runtime_resume->rpm_resume->rpm_callback->__rpm_callback->usb_resume_both
						usb_resume_device
							usb_generic_driver_resume
								hcd_bus_resume
									[26] hcd_bus_resume:2182: usb usb1: usb auto-resume
									ohci_bus_resume
										ohci_rh_resume
											[26] ohci_rh_resume:184: s3c2410-ohci s3c2410-ohci: wakeup root hub
										usb_hcd_poll_rh_status
						usb_resume_interface
							driver->resume/ 即 hub_resume
								[26] hub_resume:3807: hub 1-0:1.0: hub_resume
								hub_activate
									[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0001,(ptrval),0004)
									[26] ohci_hub_control:757: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00010301 CSC LSDA PPS CCS
									[26] hub_activate:1126: usb usb1-port1: status 0301 change 0001
									[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0x2301,0x0010,0x0001,(ptrval),0000)
									
						
		

第二次中断后
	查到是rhsc
	还是控制传输
第三次中断后
	查到是rhsc
	还是控制传输
第4次及之后的中断 后
	不再是rhsc
	而是控制传输(包括set address , get descriptor , set configure)
拔出过程解析
唯一一次中断后
	查到是 rhsc
	做控制传输
	软件去注册
	hub suspend
	root hub suspend
枚举过程LOG
+            ClearHubFeature, // 0x2001,
+            ClearPortFeature,// 0x2301,
+            GetHubDescriptor,// 0xa006,
+            GetHubStatus,    // 0xa000,
+            GetPortStatus,   // 0xa300,
+            SetHubFeature,   // 0x2003,
+            SetPortFeature); // 0x2303

SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4c ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 3
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,9d SET TIMER
[26] usb_remote_wakeup:3645: usb usb1: usb wakeup-resume
[26] hcd_bus_resume:2182: usb usb1: usb auto-resume
[26] ohci_rh_resume:184: s3c2410-ohci s3c2410-ohci: wakeup root hub
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 1
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,9d SET TIMER
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,99
[26] hub_resume:3807: hub 1-0:1.0: hub_resume
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0001,(ptrval),0004)
[26] ohci_hub_control:755: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00010301 CSC LSDA PPS CCS
[26] hub_activate:1125: usb usb1-port1: status 0301 change 0001
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0x2301,0x0010,0x0001,(ptrval),0000)
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0002,(ptrval),0004)
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
[26] hub_event:5533: hub 1-0:1.0: state 7 ports 2 chg 0002 evt 0000
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0001,(ptrval),0004)
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
[26] hub_port_connect_change:5300: usb usb1-port1: status 0301, change 0000, 1.5 Mb/s
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0x2303,0x0004,0x0001,(ptrval),0000)
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5 SET TIMER
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0001,(ptrval),0004)
[26] ohci_hub_control:755: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00100303 PRSC LSDA PPS PES CCS
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0x2301,0x0014,0x0001,(ptrval),0000)
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1
usb 1-1: new low-speed USB device number 2 using s3c2410-ohci
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0x2303,0x0004,0x0001,(ptrval),0000)
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5 SET TIMER
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0001,(ptrval),0004)
[26] ohci_hub_control:755: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00100303 PRSC LSDA PPS PES CCS
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0x2301,0x0014,0x0001,(ptrval),0000)
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
[26] usb_parse_interface:554: usb 1-1: skipped 1 descriptor after interface
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
[26] usb_get_langid:939: usb 1-1: default language 0x0409
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
[26] usb_new_device:2529: usb 1-1: udev 2, busnum 1, minor = 1
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
[26] usb_probe_device:255: usb 1-1: usb_probe_device
[26] usb_choose_configuration:187: usb 1-1: configuration #1 chosen from 1 choice
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
[26] usb_set_configuration:2162: usb 1-1: adding 1-1:1.0 (config #1, interface 0)
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
[26] usb_probe_interface:327: usbhid 1-1:1.0: usb_probe_interface
[26] usb_probe_interface:349: usbhid 1-1:1.0: usb_probe_interface - got id
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
<intr> td_done:826: s3c2410-ohci s3c2410-ohci: urb (ptrval) td (ptrval) (2) cc 4, len=0/0
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
input: YSPRINGTECH USB OPTICAL MOUSE as /devices/platform/s3c2410-ohci/usb1/1-1/1-1:1.0/0003:10C4:8105.0001/input/input0
hid-generic 0003:10C4:8105.0001: input: USB HID v1.11 Mouse [YSPRINGTECH USB OPTICAL MOUSE] on usb-s3c24xx-1/input0
[26] hub_event:5533: hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),0xa300,0x0000,0x0001,(ptrval),0004)
  • log解析 s3c2410_hub_control 角度
// 当hubstatus 或者 portstatus[0...n] 中的 任一个bit 发生变化时,就会产生rhsc中断
第一次中断(由于 port1 的 CCS 中断)
	获取 port1的 change CCS(change in CurrentConnectStatus)
	清除 port1的 CSC
第二次中断(由于 state 7 ports 2 chg 0002 evt 0000 中断?)
	获取 port2的状态
	对port1 做 reset
第三次中断(由于port1 的 PRSC 中断)
	获取 port1的 change PRSC 
	清除 port1的 PRSC 
第四次中断(由于 ?)
	对port1 做 reset

第五次中断(由于 ?)
第六次中断(由于port1 的 PRSC 中断)
	获取 port1的 change PRSC 
	清除 port1的 PRSC 
	
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4c ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 3
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,9d SET TIMER
[26] usb_remote_wakeup:3645: usb usb1: usb wakeup-resume
[26] hcd_bus_resume:2182: usb usb1: usb auto-resume
[26] ohci_rh_resume:184: s3c2410-ohci s3c2410-ohci: wakeup root hub
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 1
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,9d SET TIMER
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,99
[26] hub_resume:3807: hub 1-0:1.0: hub_resume
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004) 
[26] ohci_hub_control:755: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00010301 CSC LSDA PPS CCS
// port 1 对应 roothub.portstatus [0] ,
    change : (CSC)change in CurrentConnectStatus

    device connected, 
    port power is on , 
    low speed device attached , 
[26] hub_activate:1125: usb usb1-port1: status 0301 change 0001
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),ClearPortFeature,0x0010(USB_PORT_FEAT_C_CONNECTION,RH_PS_CSC),0x0001,(ptrval),0000)
// port 1
    clear (CSC)ConnectStatusChange
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0002,(ptrval),0004)
// port 2 对应 roothub.portstatus [1],
    没有change
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
[26] hub_event:5533: hub 1-0:1.0: state 7 ports 2 chg 0002 evt 0000
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
// port 1 对应 roothub.portstatus [0] ,
    没有change
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a9
[26] hub_port_connect_change:5300: usb usb1-port1: status 0301, change 0000, 1.5 Mb/s
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),SetPortFeature,0x0004,0x0001,(ptrval),0000)
// port 1 对应 roothub.portstatus [0] ,
    port reset
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5 SET TIMER
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
[26] ohci_hub_control:755: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00100303 PRSC LSDA PPS PES CCS
// port 1 对应 roothub.portstatus [0] ,
    change : (PRSC)change port reset is complete

    device connected CSC , 
    port is enabled
    port power is on ,
    low speed device attached ,
    
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),ClearPortFeature,0x0014(USB_PORT_FEAT_C_RESET,RH_PS_PRSC),0x0001,(ptrval),0000)
// port 1
    clear (PRSC) port reset is complete
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1
usb 1-1: new low-speed USB device number 2 using s3c2410-ohci
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,6 ---------------------------------
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),SetPortFeature,0x0004,0x0001,(ptrval),0000)
// port 1 对应 roothub.portstatus [0] ,
    port reset
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,4 ---------------------------------
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44 ---------------------------------
<intr> ohci_irq:932: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5 SET TIMER
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
[26] ohci_hub_control:755: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00100303 PRSC LSDA PPS PES CCS
// port 1 对应 roothub.portstatus [0] ,
    change : change port reset is complete

    device connected CSC , 
    port is enabled
    port power is on ,
    low speed device attached ,
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),ClearPortFeature,0x0014(USB_PORT_FEAT_C_RESET,RH_PS_PRSC),0x0001,(ptrval),0000)
// port 1
    clear (PRSC) port reset is complete
SUD File: drivers/usb/host/ohci-hub.c, Line: 00357: ohci_root_hub_state_changes,state : 2
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1

拔出log解析
SUD File: drivers/usb/host/ohci-hcd.c, Line: 00889: ohci_irq            ,44
<intr> ohci_irq:930: s3c2410-ohci s3c2410-ohci: rhsc
SUD File: drivers/usb/core/hcd.c, Line: 00791: usb_hcd_poll_rh_status,1,a5
[26] hub_event:5533: hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
[26] ohci_hub_control:754: s3c2410-ohci s3c2410-ohci: GetStatus roothub.portstatus [0] = 0x00030100 PESC CSC PPS
// port 1
    // change : PESC CSC
    // PES : port is disabled
    // CCS : no device connected
    // PPS : port power is on
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),ClearPortFeature,0x0010,0x0001,(ptrval),0000)
// port 1
    // clear CSC
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),ClearPortFeature,0x0011,0x0001,(ptrval),0000)
// port 1
    // clear PESC
[26] hub_port_connect_change:5300: usb usb1-port1: status 0100, change 0003, 12 Mb/s
usb 1-1: USB disconnect, device number 2
[26] usb_disconnect:2217: usb 1-1: unregistering device
[26] usb_disable_device:1411: usb 1-1: unregistering interface 1-1:1.0
[26] usb_disable_device:1434: usb 1-1: usb_disable_device nuking all URBs
SUD File: drivers/usb/core/hcd.c, Line: 00794: usb_hcd_poll_rh_status,1,a1
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
// port 1
    no change
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
// port 1
    no change
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
// port 1
    no change
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
// port 1
    no change
[26] ohci_s3c2410_hub_control:177: s3c2410-ohci s3c2410-ohci: s3c2410_hub_control((ptrval),GetPortStatus,0x0000,0x0001,(ptrval),0004)
// port 1
    no change
[26] hub_port_debounce:4454: usb usb1-port1: debounce total 100ms stable 100ms status 0x100
[26] hub_suspend:3762: hub 1-0:1.0: hub_suspend
[26] hcd_bus_suspend:2130: usb usb1: bus auto-suspend, wakeup 1
[26] ohci_rh_suspend:73: s3c2410-ohci s3c2410-ohci: suspend root hub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值