#include "config.h"
#endif
-#include <sys/socket.h>
+#ifndef _WIN32
#include <sys/un.h>
#include <netdb.h>
+#endif
#include <jtag/interface.h>
#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
.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);
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));
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) {
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,
};