From e66ca022bdaed7cd3b818c662c6594e10af786cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Sat, 16 May 2009 18:41:29 +0000 Subject: [PATCH] [ 2782584 ] PPWDATA and PPWCONTROL ioclts take unsigned char not uint8_t (Yen Rui) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1598 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 6 ++++++ urjtag/include/urjtag/parport.h | 8 ++++---- urjtag/src/tap/parport.c | 4 ++-- urjtag/src/tap/parport/direct.c | 8 ++++---- urjtag/src/tap/parport/ppdev.c | 4 ++-- urjtag/src/tap/parport/ppi.c | 12 +++++++----- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 35e1b8a8..0ac53004 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,9 @@ +2009-05-16 Arnim Laeuger + + * include/urjtag/parport.h, src/tap/parport/ppdev.c, src/tap/parport/ppi.c, + src/tap/parport/direct.c, src/tap/parport.c: [ 2782584 ] PPWDATA and PPWCONTROL + ioclts take unsigned char not uint8_t (Yen Rui) + 2009-05-14 Arnim Laeuger * src/svf/svf_bison.y, src/svf/svf.c, src/cmd/cmd_svf.c, diff --git a/urjtag/include/urjtag/parport.h b/urjtag/include/urjtag/parport.h index 8fad61e6..ccd9dd73 100644 --- a/urjtag/include/urjtag/parport.h +++ b/urjtag/include/urjtag/parport.h @@ -40,13 +40,13 @@ typedef struct /** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */ int (*close) (urj_parport_t *); /** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */ - int (*set_data) (urj_parport_t *, uint8_t); + int (*set_data) (urj_parport_t *, unsigned char); /** @return data on success; -1 on error */ int (*get_data) (urj_parport_t *); /** @return status on success; -1 on error */ int (*get_status) (urj_parport_t *); /** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */ - int (*set_control) (urj_parport_t *, uint8_t); + int (*set_control) (urj_parport_t *, unsigned char); } urj_parport_driver_t; @@ -59,12 +59,12 @@ struct urj_parport int urj_tap_parport_open (urj_parport_t *port); int urj_tap_parport_close (urj_parport_t *port); -int urj_tap_parport_set_data (urj_parport_t *port, uint8_t data); +int urj_tap_parport_set_data (urj_parport_t *port, const unsigned char data); /** @return data on success; -1 on error */ int urj_tap_parport_get_data (urj_parport_t *port); /** @return status on success; -1 on error */ int urj_tap_parport_get_status (urj_parport_t *port); -int urj_tap_parport_set_control (urj_parport_t *port, uint8_t data); +int urj_tap_parport_set_control (urj_parport_t *port, const unsigned char data); extern urj_parport_driver_t *urj_tap_parport_drivers[]; diff --git a/urjtag/src/tap/parport.c b/urjtag/src/tap/parport.c index f73e842a..f3497e41 100644 --- a/urjtag/src/tap/parport.c +++ b/urjtag/src/tap/parport.c @@ -62,7 +62,7 @@ urj_tap_parport_close (urj_parport_t *port) } int -urj_tap_parport_set_data (urj_parport_t *port, uint8_t data) +urj_tap_parport_set_data (urj_parport_t *port, const unsigned char data) { return port->driver->set_data (port, data); } @@ -80,7 +80,7 @@ urj_tap_parport_get_status (urj_parport_t *port) } int -urj_tap_parport_set_control (urj_parport_t *port, uint8_t data) +urj_tap_parport_set_control (urj_parport_t *port, const unsigned char data) { return port->driver->set_control (port, data); } diff --git a/urjtag/src/tap/parport/direct.c b/urjtag/src/tap/parport/direct.c index fde57db8..fa238ac5 100644 --- a/urjtag/src/tap/parport/direct.c +++ b/urjtag/src/tap/parport/direct.c @@ -287,9 +287,9 @@ direct_close (urj_parport_t *parport) } static int -direct_set_data (urj_parport_t *parport, uint8_t data) +direct_set_data (urj_parport_t *parport, unsigned char data) { - unsigned int port = ((direct_params_t *) parport->params)->port; + unsigned short int port = ((direct_params_t *) parport->params)->port; outb (data, port); return URJ_STATUS_OK; } @@ -309,9 +309,9 @@ direct_get_status (urj_parport_t *parport) } static int -direct_set_control (urj_parport_t *parport, uint8_t data) +direct_set_control (urj_parport_t *parport, unsigned char data) { - unsigned int port = ((direct_params_t *) parport->params)->port; + unsigned short int port = ((direct_params_t *) parport->params)->port; outb (data ^ 0x0B, port + 2); /* SELECT, AUTOFD, and STROBE are inverted */ return URJ_STATUS_OK; } diff --git a/urjtag/src/tap/parport/ppdev.c b/urjtag/src/tap/parport/ppdev.c index fd2680e7..44cfb9f1 100644 --- a/urjtag/src/tap/parport/ppdev.c +++ b/urjtag/src/tap/parport/ppdev.c @@ -197,7 +197,7 @@ ppdev_close (urj_parport_t *parport) } static int -ppdev_set_data (urj_parport_t *parport, uint8_t data) +ppdev_set_data (urj_parport_t *parport, unsigned char data) { ppdev_params_t *p = parport->params; @@ -241,7 +241,7 @@ ppdev_get_status (urj_parport_t *parport) } static int -ppdev_set_control (urj_parport_t *parport, uint8_t data) +ppdev_set_control (urj_parport_t *parport, unsigned char data) { ppdev_params_t *p = parport->params; diff --git a/urjtag/src/tap/parport/ppi.c b/urjtag/src/tap/parport/ppi.c index 2b2de1da..19c4689d 100644 --- a/urjtag/src/tap/parport/ppi.c +++ b/urjtag/src/tap/parport/ppi.c @@ -180,11 +180,13 @@ ppi_close (urj_parport_t *parport) } static int -ppi_set_data (urj_parport_t *parport, uint8_t data) +ppi_set_data (urj_parport_t *parport, unsigned char data) { ppi_params_t *p = parport->params; - if (ioctl (p->fd, PPISDATA, &data) == -1) + uint8_t d = data; + + if (ioctl (p->fd, PPISDATA, &d) == -1) { urj_error_IO_set ("ioctl(PPISDATA) fails"); return URJ_STATUS_FAIL; @@ -224,13 +226,13 @@ ppi_get_status (urj_parport_t *parport) } static int -ppi_set_control (urj_parport_t *parport, uint8_t data) +ppi_set_control (urj_parport_t *parport, unsigned char data) { ppi_params_t *p = parport->params; - data ^= 0x0B; /* SELECT, AUTOFD, and STROBE are inverted */ + uint8_t d = data ^ 0x0B; /* SELECT, AUTOFD, and STROBE are inverted */ - if (ioctl (p->fd, PPIGCTRL, &data) == -1) + if (ioctl (p->fd, PPIGCTRL, &d) == -1) { urj_error_IO_set ("ioctl(PPIGCTRL) fails"); return URJ_STATUS_FAIL;