summaryrefslogtreecommitdiff
path: root/camlibs/tp6801
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-24 23:46:34 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-25 00:18:07 +0200
commit208a49c2638eaf63d959ea0cba4eac4fec31b0be (patch)
treeb49f4768851eeb7286d7556b3fab2210d81431bd /camlibs/tp6801
parent3730b4cf9bc8e3de328441f1f21b998f88b22b5f (diff)
downloadlibgphoto2-208a49c2638eaf63d959ea0cba4eac4fec31b0be.tar.gz
tp6081-dump: include <unistd.h> for close(2), add more static
Diffstat (limited to 'camlibs/tp6801')
-rw-r--r--camlibs/tp6801/tp6801-dump.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/camlibs/tp6801/tp6801-dump.c b/camlibs/tp6801/tp6801-dump.c
index 7563f2511..0b12e8fcb 100644
--- a/camlibs/tp6801/tp6801-dump.c
+++ b/camlibs/tp6801/tp6801-dump.c
@@ -17,10 +17,12 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
+#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <scsi/sg.h>
@@ -28,6 +30,7 @@
#define READ 0
#define WRITE 1
+static
void tp6801_send_cmd(int fd, int rw, int cmd, int offset, unsigned char *data, int data_size)
{
int i;
@@ -69,16 +72,19 @@ void tp6801_send_cmd(int fd, int rw, int cmd, int offset, unsigned char *data, i
}
}
+static
void eeprom_read(int fd, int offset, unsigned char *data, int data_size)
{
tp6801_send_cmd(fd, READ, 0xc1, offset, data, data_size);
}
+static
void eeprom_erase_block(int fd, int offset)
{
tp6801_send_cmd(fd, READ, 0xc6, offset, NULL, 0);
}
+static
void eeprom_program_page(int fd, int offset, unsigned char *data)
{
tp6801_send_cmd(fd, WRITE, 0xcb, offset, data, 256);