|
@@ -80,7 +80,10 @@ void print_device_video_inputs(struct videohub_data *d) {
|
80
|
80
|
if (num_outputs == 0) {
|
81
|
81
|
printf("%-24s | %c |\n", "-", format_status(d->inputs.port[i].status));
|
82
|
82
|
} else {
|
83
|
|
- printf("%-24s | %c |\n", d->outputs.port[routed_to].name, format_status(d->inputs.port[i].status));
|
|
83
|
+ printf("%-24s | %c |\n",
|
|
84
|
+ routed_to == NO_PORT ? "" : d->outputs.port[routed_to].name,
|
|
85
|
+ format_status(d->inputs.port[i].status)
|
|
86
|
+ );
|
84
|
87
|
bool first_skipped = false;
|
85
|
88
|
for(r = 0; r < d->outputs.num; r++) {
|
86
|
89
|
if (d->outputs.port[r].routed_to == i) {
|
|
@@ -120,7 +123,7 @@ void print_device_video_outputs(struct videohub_data *d) {
|
120
|
123
|
i + 1,
|
121
|
124
|
port_lock_symbol(d->outputs.port[i].lock),
|
122
|
125
|
d->outputs.port[i].name,
|
123
|
|
- d->inputs.port[d->outputs.port[i].routed_to].name,
|
|
126
|
+ d->outputs.port[i].routed_to == NO_PORT ? "" : d->inputs.port[d->outputs.port[i].routed_to].name,
|
124
|
127
|
format_status(d->outputs.port[i].status)
|
125
|
128
|
);
|
126
|
129
|
}
|
|
@@ -141,7 +144,7 @@ void print_device_monitoring_outputs(struct videohub_data *d) {
|
141
|
144
|
i + 1,
|
142
|
145
|
port_lock_symbol(d->mon_outputs.port[i].lock),
|
143
|
146
|
d->mon_outputs.port[i].name,
|
144
|
|
- d->inputs.port[d->mon_outputs.port[i].routed_to].name
|
|
147
|
+ d->mon_outputs.port[i].routed_to == NO_PORT ? "" : d->inputs.port[d->mon_outputs.port[i].routed_to].name
|
145
|
148
|
);
|
146
|
149
|
}
|
147
|
150
|
printf_line(len);
|
|
@@ -158,11 +161,9 @@ static char *dir2opt(enum serial_dir dir) {
|
158
|
161
|
}
|
159
|
162
|
|
160
|
163
|
void print_device_serial_ports(struct videohub_data *d) {
|
161
|
|
- unsigned char port_seen[MAX_PORTS];
|
162
|
164
|
unsigned int i, len = 63;
|
163
|
165
|
if (!d->serial.num)
|
164
|
166
|
return;
|
165
|
|
- memset(port_seen, 0, sizeof(port_seen));
|
166
|
167
|
printf("Serial ports\n");
|
167
|
168
|
printf_line(len);
|
168
|
169
|
printf(" | ## | x | Dir | %-18s | %-18s | s |\n", "Serial port", "Connected serial");
|
|
@@ -173,12 +174,9 @@ void print_device_serial_ports(struct videohub_data *d) {
|
173
|
174
|
port_lock_symbol(d->serial.port[i].lock),
|
174
|
175
|
dir2opt(d->serial.port[i].direction),
|
175
|
176
|
d->serial.port[i].name,
|
176
|
|
- (d->serial.port[i].routed_to_set && !port_seen[d->serial.port[i].routed_to]
|
177
|
|
- ? d->serial.port[d->serial.port[i].routed_to].name
|
178
|
|
- : ""),
|
|
177
|
+ d->serial.port[i].routed_to == NO_PORT ? "" : d->serial.port[d->serial.port[i].routed_to].name,
|
179
|
178
|
format_status(d->serial.port[i].status)
|
180
|
179
|
);
|
181
|
|
- port_seen[d->serial.port[i].routed_to]++;
|
182
|
180
|
}
|
183
|
181
|
printf_line(len);
|
184
|
182
|
printf("\n");
|
|
@@ -195,7 +193,7 @@ static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
|
195
|
193
|
printf(" --%s-name %2d \"%s\" \\\n", p, i + 1, s_port->port[i].name);
|
196
|
194
|
break;
|
197
|
195
|
case PARSE_ROUTE:
|
198
|
|
- if (v->cmd == CMD_SERIAL_PORT_ROUTING && !s_port->port[i].routed_to_set)
|
|
196
|
+ if (s_port->port[i].routed_to == NO_PORT)
|
199
|
197
|
continue;
|
200
|
198
|
printf(" --%s-input %2d %2d \\\n", p, i + 1, s_port->port[i].routed_to + 1);
|
201
|
199
|
break;
|