diff options
Diffstat (limited to 'utils/nwztools/scsitools/scsitool.c')
-rw-r--r-- | utils/nwztools/scsitools/scsitool.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/nwztools/scsitools/scsitool.c b/utils/nwztools/scsitools/scsitool.c index fd1ed545da..b3f05a0785 100644 --- a/utils/nwztools/scsitools/scsitool.c +++ b/utils/nwztools/scsitools/scsitool.c | |||
@@ -321,7 +321,7 @@ int get_model_id(unsigned long *model_id) | |||
321 | return 0; | 321 | return 0; |
322 | } | 322 | } |
323 | 323 | ||
324 | int get_model_and_series(int *model_index, int *series_index) | 324 | int get_model_and_series(int *model_index, int *series_index, unsigned long *model_id_out) |
325 | { | 325 | { |
326 | /* if the user forced the series, simply match by name, special for '?' which | 326 | /* if the user forced the series, simply match by name, special for '?' which |
327 | * prompts the list */ | 327 | * prompts the list */ |
@@ -346,6 +346,8 @@ int get_model_and_series(int *model_index, int *series_index) | |||
346 | unsigned long model_id; | 346 | unsigned long model_id; |
347 | if(get_model_id(&model_id)) | 347 | if(get_model_id(&model_id)) |
348 | return 1; | 348 | return 1; |
349 | if(model_id_out) | ||
350 | *model_id_out = model_id; | ||
349 | *model_index = -1; | 351 | *model_index = -1; |
350 | for(int i = 0; i < NWZ_MODEL_COUNT; i++) | 352 | for(int i = 0; i < NWZ_MODEL_COUNT; i++) |
351 | if(nwz_model[i].mid == model_id) | 353 | if(nwz_model[i].mid == model_id) |
@@ -448,7 +450,7 @@ int get_dnk_nvp(int argc, char **argv) | |||
448 | return 1; | 450 | return 1; |
449 | } | 451 | } |
450 | int series_index, model_index; | 452 | int series_index, model_index; |
451 | int ret = get_model_and_series(&model_index, &series_index); | 453 | int ret = get_model_and_series(&model_index, &series_index, NULL); |
452 | if(ret) | 454 | if(ret) |
453 | return ret; | 455 | return ret; |
454 | size_t size = 0; | 456 | size_t size = 0; |
@@ -820,15 +822,18 @@ int do_dest(int argc, char **argv) | |||
820 | } | 822 | } |
821 | /* get model/series */ | 823 | /* get model/series */ |
822 | int model_index, series_index; | 824 | int model_index, series_index; |
823 | int ret = get_model_and_series(&model_index, &series_index); | 825 | unsigned long model_id; |
826 | int ret = get_model_and_series(&model_index, &series_index, &model_id); | ||
824 | if(ret) | 827 | if(ret) |
825 | return ret; | 828 | return ret; |
826 | int shp_index = NWZ_NVP_INVALID; | 829 | int shp_index = NWZ_NVP_INVALID; |
827 | if(nwz_series[series_index].nvp_index) | 830 | if(nwz_series[series_index].nvp_index) |
828 | shp_index = (*nwz_series[series_index].nvp_index)[NWZ_NVP_SHP]; | 831 | shp_index = (*nwz_series[series_index].nvp_index)[NWZ_NVP_SHP]; |
832 | shp_index = NWZ_NVP_INVALID; | ||
829 | if(shp_index == NWZ_NVP_INVALID) | 833 | if(shp_index == NWZ_NVP_INVALID) |
830 | { | 834 | { |
831 | printf("This device doesn't have node 'shp'\n"); | 835 | printf("This device doesn't have node 'shp'\n"); |
836 | help_us(true, model_id); | ||
832 | return 5; | 837 | return 5; |
833 | } | 838 | } |
834 | /* in all cases, we need to read shp */ | 839 | /* in all cases, we need to read shp */ |