[Galaxy S II Original Android Development] olifee:
Hi gokhanmoral,

Another proposal for a "special feature" which might be just a 'toggle' for you.

This post here:

http://blog.teadriven.me.uk/2011/09/custom-usb-devices-on-android-phone.html

suggests that when "CONFIG_USB_SEC_WHITELIST=n" is set, any USB-device might be connected to our SGS2.

I guess using kernel-modules (everybody can compile for him-/herself with you new sources easily :) ) we should then also have the possibility to add external stuff like additional wifi-cards, USB-to-serial converters (FTDI) or even more crazy stuff ^^.

Could you check on that? It might be worth a while ;-).

EDIT: Having a look at sources myself, it appears it would not detect anything then? But I am not sure...

I see USB_OTG_WHITELIST is already inactive, which might be what we are really looking for ;-). In fact, I did not find the "not supported"-message stated there in any logcat / dmesg. So maybe it is already possible? I will try as soon as I get some "peculiar" hardware + module here ^^.

(see EDIT4 below, they appear to be saying turning it off should work :) ).

EDIT2: Now I finally know why the app "linux installer" is always complaining your kernel would not have loop / ext2/3/4-support (works then clicking "override" of course)! It checks for /proc/config.gz, which is not included in this kernel. If this does not cost any performance, any chance you could enable it?

EDIT3: Finally found an FTDI-USB-Serial-Convertor to test. Compiled usbserial and ftdi_sio, which work on linux machine and also load fine on your kernel (had no luck with external wifi, apparently incompatible with the special internal stack).

However, "s3c_otghcd" immediately takes control of the device:

[19532.876432] otg_dbg: in root_hub_feature()::00483
[19532.876444] => case SetPortFeature -USB_PORT_FEAT_RESET
[19532.936503] otg_dbg: in otg_handle_interrupt()::00087
[19532.936514] => Port Interrupt
[19532.936525] otg_dbg: in process_port_intr()::00271
[19532.936535] => port enable/disable changed
[19533.006493] usb 2-1: new high speed USB device using s3c_otghcd and address 2
[19533.027971] hub 2-1:1.0: USB hub found
[19533.028350] hub 2-1:1.0: 4 ports detected
[19533.226416] hub 2-1:1.0: activate --> -1
[19533.256627] usb 2-1.3: new high speed USB device using s3c_otghcd and address 3
[19533.275220] hub 2-1.3:1.0: USB hub found
[19533.276107] hub 2-1.3:1.0: 4 ports detected
[19533.476515] hub 2-1.3:1.0: activate --> -1
[19533.507113] usb 2-1.3.2: new full speed USB device using s3c_otghcd and address 4
[19533.507801] usb 2-1.3.2: device descriptor read/64, error -71
[19533.612180] usb 2-1.3.2: device descriptor read/64, error -71
[19533.747222] usb 2-1.3.2: new full speed USB device using s3c_otghcd and address 5
[19533.747951] usb 2-1.3.2: device descriptor read/64, error -71
[19533.852137] usb 2-1.3.2: device descriptor read/64, error -71
[19533.986990] usb 2-1.3.2: new full speed USB device using s3c_otghcd and address 6
[19534.396417] usb 2-1.3.2: device not accepting address 6, error -71
[19534.426650] usb 2-1.3.2: new full speed USB device using s3c_otghcd and address 7
[19534.836510] usb 2-1.3.2: device not accepting address 7, error -71
[19534.836910] hub 2-1.3:1.0: unable to enumerate USB device on port 2

As you can see, an USB-Hub was recognized just fine (I can even attach USB-Thumbdrives to it!).

If you wonder about two hubs: The usb-serial-device is in fact a device with to single-usb-serial-FTDI-devices, with a pseudo-hub included (which says it has four ports of which two are used). So it appears as powered 4-port-hub (the real one), 4-port-hub (the 'virtual one' in the device) and then the two ftdi_sio which are not detected correctly :(.

As it appears, s3c_otghcd was somehow trying to deal with the FTDI-device, although the correct module was already loaded...

Do you have any idea how to force s3c_otghcd to ignore stuff it can't deal with?

EDIT4: Some people appear to be working on this right here:

http://xdaforums.com/showthread.php?t=1185793&page=2

and apparently made some progress ^^.

EDIT5: IT WORKS, see linked post. Also send a PM to gokhanmoral with my changed config-flags, so maybe it will be included in future builds.