~ubuntu-branches/ubuntu/vivid/isight-firmware-tools/vivid

« back to all changes in this revision

Viewing changes to src/load.c

  • Committer: Bazaar Package Importer
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2009-03-04 20:19:36 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090304201936-5accw1ub5r75oaxl
Tags: 1.4.1-1
* New upstream release
  - Remove patches(02_ja-po, 03_support_mba, 05_support_macosx_5.5).
* Update debian/rules
  - Add DEB_CONFIGURE_USER_FLAGS and set "--disable-udev --enable-hal"
* Updated Galician debconf templates. (Closes: #512242)
* Update Japanese po. (06_japanese.po.dpatch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#include "load.h"
47
47
#define TIMEOUT 300
48
48
 
49
 
/* OPTIONS */
50
 
static gchar            *firmware       = "isight.fw";
51
 
static const gchar      *USB_BUS        = NULL;
52
 
static const gchar      *USB_DEV        = NULL;
53
 
 
54
 
static GOptionEntry entries[] = {
55
 
        { "firmware", 'f',
56
 
          0,
57
 
          G_OPTION_ARG_FILENAME, &firmware,
58
 
          N_("Path to the firmware."),
59
 
          NULL
60
 
        },
61
 
        { "usb-bus", 'b',
62
 
          0,
63
 
          G_OPTION_ARG_STRING, &USB_BUS,
64
 
          N_("USB bus id"),
65
 
          NULL
66
 
        },
67
 
        { "usb-dev", 'd',
68
 
          0,
69
 
          G_OPTION_ARG_STRING, &USB_DEV,
70
 
          N_("USB device id"),
71
 
          NULL
72
 
        },
73
 
        { NULL }
74
 
};
75
 
 
76
49
int
77
50
load_firmware(struct usb_device *dev, char *firmware)
78
51
{
186
159
        return dev;
187
160
}
188
161
 
 
162
struct usb_device*
 
163
find_usb_product(const guint32 vendor_id, const guint32 product_id)
 
164
{
 
165
        struct usb_bus *bi;
 
166
        struct usb_device *di, *dev = NULL;
 
167
 
 
168
        for (bi = usb_busses; bi != NULL; bi = bi->next) {
 
169
                for (di = bi->devices; di != NULL; di = di->next) {
 
170
                        if (di->descriptor.idVendor == vendor_id &&
 
171
                            di->descriptor.idProduct == product_id) {
 
172
                                dev = di;
 
173
                                break;
 
174
                        }
 
175
                }
 
176
 
 
177
                if (dev)
 
178
                        break;
 
179
        }
 
180
 
 
181
        if (!dev)
 
182
                ift_warning(_("USB device 0x%04X:0x%04X not found"),
 
183
                            vendor_id, product_id);
 
184
 
 
185
        return dev;
 
186
}