summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorpancake <pancake@dazo>2007-06-25 15:14:14 +0200
committerpancake <pancake@dazo>2007-06-25 15:14:14 +0200
commit6521a8e9d11b8e87bb8d400238cb5a340202674e (patch)
treeec153e2e7071e3a34af2f89eb2a10367244733d5 /src
parent3728cdea3130c62f3d766df040d2cb85f1e6caa4 (diff)
download0xFFFF-6521a8e9d11b8e87bb8d400238cb5a340202674e.tar.bz2
* Update documentation for the 0.2 release
* Fix case0 bug of libusb in usb_device_found function
Diffstat (limited to 'src')
-rw-r--r--src/devices.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/devices.c b/src/devices.c
index 0739905..bd4a4d3 100644
--- a/src/devices.c
+++ b/src/devices.c
@@ -23,6 +23,18 @@
#include <string.h>
#include <stdlib.h>
+/*
+ * The internet tablet PC (and probably most of
+ * Nokia devices have different USB-IDs depending
+ * on the boot state.
+ *
+ * The following table shows this info:
+ *
+ * boot os
+ * n770 0421:0105 0421:0431
+ * n800 0421:0431
+ *
+ */
struct devices supported_devices[SUPPORTED_DEVICES] = {
{ "FFFF", 0x000, 0x0000, 0x0000 }, // dummy
{ "unkn", 0x421, 0x3f00, 0x0000 }, // probably a development board
@@ -53,6 +65,10 @@ int is_valid_device(struct usb_device_descriptor *udd)
return 0;
}
+/*
+ * List all supported device-ids and it's names
+ *
+ */
void list_valid_devices()
{
int i;
@@ -62,6 +78,12 @@ void list_valid_devices()
printf("%04x:%04x %s\n", ptr.vendor_id, ptr.product_id, ptr.name);
}
+/*
+ * Returns true (1) when a valid usb device is found and stores the udd and devices
+ * structures for the specified device.
+ * Otherwise returns false (0)
+ */
+
int usb_device_found(struct usb_device_descriptor *udd, struct devices *it_device)
{
struct usb_bus *bus;
@@ -75,9 +97,6 @@ int usb_device_found(struct usb_device_descriptor *udd, struct devices *it_devic
case -1:
fprintf(stderr, "\nerror: no devices found.\n");
exit(1);
- case 0:
- fprintf(stderr, "\noops: no permission to usb. got root?\n");
- exit(1);
default:
for (bus = usb_busses; bus; bus = bus->next) {
struct usb_device *dev = bus->devices;