Here's a patch that adds an option the "CHDK settings" menu to control the PTP extension.
For cameras with wifi, the values are "Off", "USB", "Always". Default is "USB".
For cameras without, the options are "Off" and "On", default on.
On wifi cameras "USB" uses the USB bit in phsyw, as modified by remote settings and usb_force_active.
If the extension is disabled, the PTP handler returns PTP_RC_OperationNotSupported, as the camera would if CHDK were not installed.
My reason for adding this is that with PTP/IP becoming usable, I want to document that it's insecure, and I'd prefer to give people the option of doing something about it.
The contains a few additional changes to support this.
Added function get_usb_bit_physw_mod, which returns the USB bit as seen by the Canon firmware. This will be useful in a couple other places.
Some old vxworks cameras (ixus 30, 40, 50, and 700) have different kbd code, that doesn't end up with the USB bit in physw_status. I consolidated this and moved it to kbd_common.c, under the define KBD_USB_OVERRIDE_FUNC. This also adds support for usb_force_present on ixus30 and ixus40.
Testing that PTP option and USB remote works on one or more of these cameras would be appreciated.Added define CAM_HAS_WIFI, to identify cameras with wifi capability. Default is undef. Most cams are identified by the sigfinders (r5800) but there are complications: ixus132 and sx520 use identical firmware to the wifi capable ixus135 and sx530. Since they have separate platform trees, I just added a comment and undef to their respective platform_camera.h files. sx270 builds from the same source as sx280, so I made the define conditional on PLATFORMID. Since ixus w is the only wifi capable vxworks cam (AFAIK), I just added the define without updating the sig finder. It's possible I missed other cameras that have wifi in the firmware but not hardware.
Comments and suggestions are welcome