projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: add flash-force instructions for TeleBT v3.0
[fw/altos]
/
ao-tools
/
ao-chaosread
/
ao-chaosread.c
diff --git
a/ao-tools/ao-chaosread/ao-chaosread.c
b/ao-tools/ao-chaosread/ao-chaosread.c
index 5c0de1257fbded71cda28e0d7dbaaf2fcffaba7c..b0a6168aa71e991fc7f7e7ee86f55d299c4d2074 100644
(file)
--- a/
ao-tools/ao-chaosread/ao-chaosread.c
+++ b/
ao-tools/ao-chaosread/ao-chaosread.c
@@
-36,7
+36,7
@@
struct chaoskey {
int kernel_active;
};
int kernel_active;
};
-libusb_device_handle *
+
static
libusb_device_handle *
chaoskey_match(libusb_device *dev, char *match_serial)
{
struct libusb_device_descriptor desc;
chaoskey_match(libusb_device *dev, char *match_serial)
{
struct libusb_device_descriptor desc;
@@
-96,7
+96,7
@@
out:
return 0;
}
return 0;
}
-struct chaoskey *
+st
atic st
ruct chaoskey *
chaoskey_open(char *serial)
{
struct chaoskey *ck;
chaoskey_open(char *serial)
{
struct chaoskey *ck;
@@
-161,22
+161,11
@@
out:
return NULL;
}
return NULL;
}
-void
-chaoskey_close(struct chaoskey *ck)
-{
- libusb_release_interface(ck->handle, 0);
- if (ck->kernel_active)
- libusb_attach_kernel_driver(ck->handle, 0);
- libusb_close(ck->handle);
- libusb_exit(ck->ctx);
- free(ck);
-}
-
#define COOKED_ENDPOINT 0x85
#define RAW_ENDPOINT 0x86
#define FLASH_ENDPOINT 0x87
#define COOKED_ENDPOINT 0x85
#define RAW_ENDPOINT 0x86
#define FLASH_ENDPOINT 0x87
-int
+
static
int
chaoskey_read(struct chaoskey *ck, int endpoint, void *buffer, int len)
{
uint8_t *buf = buffer;
chaoskey_read(struct chaoskey *ck, int endpoint, void *buffer, int len)
{
uint8_t *buf = buffer;