added r/o maxpacketsize to USB settings and report it to the camera

library.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9852 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2007-01-03 20:36:54 +00:00
parent 463a5bb61b
commit ec026db1ea
3 changed files with 16 additions and 3 deletions

View File

@@ -3,6 +3,10 @@ libgphoto2_port 0.7.2
Build:
* Put auto* files into auto-aux/ and auto-m4/.
USB:
* Reported wMaxPacketsize of the IN endpoint to the camlib
via GPPortSettings.
------------------------------------------------------------------------
libgphoto2_port 0.7.1

View File

@@ -69,9 +69,9 @@ struct _GPPortSettingsSerial {
typedef struct _GPPortSettingsUSB GPPortSettingsUSB;
struct _GPPortSettingsUSB {
int inep, outep, intep;
int config;
int interface;
int altsetting;
int config, interface, altsetting;
int maxpacketsize; /* r/o */
/* must be last to avoid binary incompatibility.
* luckily we just need to make sure this struct does not

View File

@@ -617,6 +617,8 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct)
/* Set the defaults */
if (dev->config) {
int i;
if (dev->config[config].interface[interface].altsetting[altsetting].bInterfaceClass
== USB_CLASS_MASS_STORAGE) {
gp_log (GP_LOG_VERBOSE, "gphoto2-port-usb",
@@ -632,6 +634,13 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct)
port->settings.usb.inep = gp_port_usb_find_ep(dev, config, interface, altsetting, USB_ENDPOINT_IN, USB_ENDPOINT_TYPE_BULK);
port->settings.usb.outep = gp_port_usb_find_ep(dev, config, interface, altsetting, USB_ENDPOINT_OUT, USB_ENDPOINT_TYPE_BULK);
port->settings.usb.intep = gp_port_usb_find_ep(dev, config, interface, altsetting, USB_ENDPOINT_IN, USB_ENDPOINT_TYPE_INTERRUPT);
for (i=0;i<dev->config[config].interface[interface].altsetting[altsetting].bNumEndpoints;i++) {
if (port->settings.usb.inep == dev->config[config].interface[interface].altsetting[altsetting].endpoint[i].bEndpointAddress) {
port->settings.usb.maxpacketsize = dev->config[config].interface[interface].altsetting[altsetting].endpoint[i].wMaxPacketSize;
break;
}
}
gp_log (GP_LOG_VERBOSE, "gphoto2-port-usb",
"Detected defaults: config %d, "
"interface %d, altsetting %d, "