Skip to content

Commit 1be6558

Browse files
authored
Merge pull request #22 from MicrochipTech/bugfix/removing_pax_option
Removed the --pax option from the Velocity CLI
2 parents 119df40 + c752b9a commit 1be6558

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

cli/common.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ int switchtec_handler(const char *optarg, void *value_addr,
3030
const struct argconfig_options *opt);
3131
int mfg_handler(const char *optarg, void *value_addr,
3232
const struct argconfig_options *opt);
33-
int pax_handler(const char *optarg, void *value_addr,
34-
const struct argconfig_options *opt);
3533
enum switchtec_fw_type check_and_print_fw_image(int img_fd,
3634
const char *img_filename);
3735

@@ -73,16 +71,7 @@ enum switchtec_fw_type check_and_print_fw_image(int img_fd,
7371
required_positional)
7472

7573
#define __DEVICE_OPTION(type) \
76-
DEVICE_OPTION_BASIC(UART_HELP_TEXT, switchtec_handler, (type)), \
77-
{ \
78-
"pax", 'x', .cfg_type=CFG_CUSTOM, \
79-
.value_addr=&cfg.dev, \
80-
.argument_type=required_argument, \
81-
.custom_handler=pax_handler, \
82-
.env="SWITCHTEC_PAX", \
83-
.help="PAX ID within a PAX fabric. Only valid on " \
84-
"Switchtec PAX devices" \
85-
}
74+
DEVICE_OPTION_BASIC(UART_HELP_TEXT, switchtec_handler, (type))
8675

8776
#define DEVICE_OPTION __DEVICE_OPTION(required_positional)
8877
#define DEVICE_OPTION_OPTIONAL __DEVICE_OPTION(optional_positional)

cli/main.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,30 +122,6 @@ int mfg_handler(const char *optarg, void *value_addr,
122122
return switchtec_handler(optarg, value_addr, opt);
123123
}
124124

125-
int pax_handler(const char *optarg, void *value_addr,
126-
const struct argconfig_options *opt)
127-
{
128-
char *end;
129-
long num;
130-
131-
errno = 0;
132-
num = strtol(optarg, &end, 0);
133-
global_pax_id = num;
134-
135-
if ((end == optarg) || errno || num < 0 ||
136-
(global_pax_id & ~SWITCHTEC_PAX_ID_MASK)) {
137-
fprintf(stderr, "Invalid PAX ID specified: %s\n", optarg);
138-
return 1;
139-
}
140-
141-
if (set_global_pax_id()) {
142-
fprintf(stderr, "%s: Setting PAX ID is not supported.\n", optarg);
143-
return 4;
144-
}
145-
146-
return 0;
147-
}
148-
149125
#define CMD_DESC_LIST "list all Switchtec devices on this machine"
150126

151127
static int list(int argc, char **argv)

0 commit comments

Comments
 (0)