* remote-e7000.c (e7000_parse_device): New function.
Add option "tcp_remote" to target command if using tcp to connect to a remote host which is then connected via serial port to the e7000 (for exampole, a port master). (e7000_open): Change to call e7000_parse_device.
This commit is contained in:
parent
f7ce02f4b3
commit
56a4bf5339
|
@ -1,3 +1,11 @@
|
||||||
|
Fri Jun 28 04:32:18 1996 Dawn Perchik <dawn@cygnus.com>
|
||||||
|
|
||||||
|
* remote-e7000.c (e7000_parse_device): New function.
|
||||||
|
Add option "tcp_remote" to target command if using
|
||||||
|
tcp to connect to a remote host which is then connected
|
||||||
|
via serial port to the e7000 (for exampole, a port master).
|
||||||
|
(e7000_open): Change to call e7000_parse_device.
|
||||||
|
|
||||||
Fri Jun 28 03:47:17 1996 Dawn Perchik <dawn@cygnus.com>
|
Fri Jun 28 03:47:17 1996 Dawn Perchik <dawn@cygnus.com>
|
||||||
|
|
||||||
* monitor.c (monitor_debug): Fix remotedebug buffering.
|
* monitor.c (monitor_debug): Fix remotedebug buffering.
|
||||||
|
|
|
@ -91,7 +91,9 @@ static serial_t e7000_desc;
|
||||||
|
|
||||||
/* Nonzero if using the tcp serial driver. */
|
/* Nonzero if using the tcp serial driver. */
|
||||||
|
|
||||||
static int using_tcp;
|
static int using_tcp; /* direct tcp connection to target */
|
||||||
|
static int using_tcp_remote; /* indirect connection to target
|
||||||
|
via tcp to controller */
|
||||||
|
|
||||||
/* Nonzero if using the pc isa card. */
|
/* Nonzero if using the pc isa card. */
|
||||||
|
|
||||||
|
@ -490,25 +492,32 @@ e7000_ftp_command (args, from_tty)
|
||||||
timeout = oldtimeout;
|
timeout = oldtimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
e7000_open (args, from_tty)
|
e7000_parse_device(args,dev_name,serial_flag,baudrate)
|
||||||
char *args;
|
char *args;
|
||||||
int from_tty;
|
char *dev_name;
|
||||||
|
int serial_flag;
|
||||||
|
int baudrate;
|
||||||
{
|
{
|
||||||
int n;
|
char junk[128];
|
||||||
int loop;
|
int n = 0;
|
||||||
char junk[100];
|
|
||||||
int sync;
|
|
||||||
target_preopen (from_tty);
|
|
||||||
|
|
||||||
n = 0;
|
|
||||||
if (args && strcasecmp (args, "pc") == 0)
|
if (args && strcasecmp (args, "pc") == 0)
|
||||||
{
|
{
|
||||||
strcpy (dev_name, args);
|
strcpy (dev_name, args);
|
||||||
|
using_pc = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (args)
|
/* FIXME! temp hack to allow use with port master -
|
||||||
|
target tcp_remote <device> */
|
||||||
|
if (args && strncmp (args, "tcp_remote", 10) == 0)
|
||||||
|
{
|
||||||
|
char com_type[128];
|
||||||
|
n = sscanf (args, " %s %s %d %s", com_type, dev_name, &baudrate, junk);
|
||||||
|
using_tcp_remote=1;
|
||||||
|
n--;
|
||||||
|
}
|
||||||
|
else if (args)
|
||||||
{
|
{
|
||||||
n = sscanf (args, " %s %d %s", dev_name, &baudrate, junk);
|
n = sscanf (args, " %s %d %s", dev_name, &baudrate, junk);
|
||||||
}
|
}
|
||||||
|
@ -517,18 +526,40 @@ e7000_open (args, from_tty)
|
||||||
{
|
{
|
||||||
error ("Bad arguments. Usage:\ttarget e7000 <device> <speed>\n\
|
error ("Bad arguments. Usage:\ttarget e7000 <device> <speed>\n\
|
||||||
or \t\ttarget e7000 <host>[:<port>]\n\
|
or \t\ttarget e7000 <host>[:<port>]\n\
|
||||||
|
or \t\ttarget e7000 tcp_remote <host>[:<port>]\n\
|
||||||
or \t\ttarget e7000 pc\n");
|
or \t\ttarget e7000 pc\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__GO32__) && !defined(__WIN32__)
|
#if !defined(__GO32__) && !defined(__WIN32__)
|
||||||
|
/* FIXME! test for ':' is ambiguous */
|
||||||
if (n == 1 && strchr (dev_name, ':') == 0)
|
if (n == 1 && strchr (dev_name, ':') == 0)
|
||||||
{
|
{
|
||||||
/* Default to normal telnet port */
|
/* Default to normal telnet port */
|
||||||
|
/* serial_open will use this to determine tcp communication */
|
||||||
strcat (dev_name, ":23");
|
strcat (dev_name, ":23");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (!using_tcp_remote && strchr (dev_name, ':'))
|
||||||
|
using_tcp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
e7000_open (args, from_tty)
|
||||||
|
char *args;
|
||||||
|
int from_tty;
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
int loop;
|
||||||
|
int sync;
|
||||||
|
int serial_flag;
|
||||||
|
|
||||||
|
target_preopen (from_tty);
|
||||||
|
|
||||||
|
n = e7000_parse_device(args,dev_name,serial_flag,baudrate);
|
||||||
|
|
||||||
push_target (&e7000_ops);
|
push_target (&e7000_ops);
|
||||||
|
|
||||||
e7000_desc = SERIAL_OPEN (dev_name);
|
e7000_desc = SERIAL_OPEN (dev_name);
|
||||||
|
@ -536,9 +567,6 @@ or \t\ttarget e7000 pc\n");
|
||||||
if (!e7000_desc)
|
if (!e7000_desc)
|
||||||
perror_with_name (dev_name);
|
perror_with_name (dev_name);
|
||||||
|
|
||||||
using_tcp = strcmp (e7000_desc->ops->name, "tcp") == 0;
|
|
||||||
using_pc = strcmp (e7000_desc->ops->name, "pc") == 0;
|
|
||||||
|
|
||||||
SERIAL_SETBAUDRATE (e7000_desc, baudrate);
|
SERIAL_SETBAUDRATE (e7000_desc, baudrate);
|
||||||
SERIAL_RAW (e7000_desc);
|
SERIAL_RAW (e7000_desc);
|
||||||
|
|
||||||
|
@ -1433,12 +1461,15 @@ e7000_load (args, from_tty)
|
||||||
time_t start_time, end_time; /* Start and end times of download */
|
time_t start_time, end_time; /* Start and end times of download */
|
||||||
unsigned long data_count; /* Number of bytes transferred to memory */
|
unsigned long data_count; /* Number of bytes transferred to memory */
|
||||||
|
|
||||||
if (!strchr (dev_name, ':'))
|
|
||||||
|
/* FIXME! change test to test for type of download */
|
||||||
|
if (!using_tcp)
|
||||||
{
|
{
|
||||||
generic_load (args, from_tty);
|
generic_load (args, from_tty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* for direct tcp connections, we can do a fast binary download */
|
||||||
buf[0] = 'D';
|
buf[0] = 'D';
|
||||||
buf[1] = 'T';
|
buf[1] = 'T';
|
||||||
quiet = 0;
|
quiet = 0;
|
||||||
|
|
Loading…
Reference in New Issue