X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fjtag%2Fdrivers%2Fremote_bitbang.c;h=f6691bb625a5483690ec44528eebbd78217dedf7;hb=46bcaec696ae0974b47aeaea876737f13d0c55e5;hp=941a07f147857ab2c71e7afa6c0ba21c42eb9cfe;hpb=47a276cfae12e73b66d8af3889ba558ad3f157eb;p=openocd.git diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 941a07f147..f6691bb625 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -22,14 +22,16 @@ #include "config.h" #endif -#include +#ifndef _WIN32 #include #include +#endif #include #include "bitbang.h" -/* from unix man page and sys/un.h: */ -#define UNIX_PATH_MAX 108 +#ifndef UNIX_PATH_LEN +#define UNIX_PATH_LEN 108 +#endif /* arbitrary limit on host name length: */ #define REMOTE_BITBANG_HOST_MAX 255 @@ -128,11 +130,6 @@ static struct bitbang_interface remote_bitbang_bitbang = { .blink = &remote_bitbang_blink, }; -static int remote_bitbang_speed(int speed) -{ - return ERROR_OK; -} - static int remote_bitbang_init_tcp(void) { LOG_INFO("Connecting to %s:%i", remote_bitbang_host, remote_bitbang_port); @@ -199,8 +196,8 @@ static int remote_bitbang_init_unix(void) struct sockaddr_un addr; addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, remote_bitbang_host, UNIX_PATH_MAX); - addr.sun_path[UNIX_PATH_MAX-1] = '\0'; + strncpy(addr.sun_path, remote_bitbang_host, UNIX_PATH_LEN); + addr.sun_path[UNIX_PATH_LEN-1] = '\0'; if (connect(fd, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0) { LOG_ERROR("connect: %s", strerror(errno)); @@ -233,19 +230,6 @@ static int remote_bitbang_init(void) return remote_bitbang_init_tcp(); } -static int remote_bitbang_khz(int khz, int *jtag_speed) -{ - *jtag_speed = 0; - return ERROR_OK; -} - -static int remote_bitbang_speed_div(int speed, int *khz) -{ - /* I don't think this really matters any. */ - *khz = 1; - return ERROR_OK; -} - COMMAND_HANDLER(remote_bitbang_handle_remote_bitbang_port_command) { if (CMD_ARGC == 1) { @@ -288,10 +272,7 @@ static const struct command_registration remote_bitbang_command_handlers[] = { struct jtag_interface remote_bitbang_interface = { .name = "remote_bitbang", .execute_queue = &bitbang_execute_queue, - .speed = &remote_bitbang_speed, .commands = remote_bitbang_command_handlers, .init = &remote_bitbang_init, .quit = &remote_bitbang_quit, - .khz = &remote_bitbang_khz, - .speed_div = &remote_bitbang_speed_div, };