- struct osmocom_ms *ms;
-
- llist_for_each_entry(ms, &ms_list, entity) {
- struct gsm_settings *set = &ms->settings;
-
- vty_out(vty, "MS NAME: %s%s", ms->name, VTY_NEWLINE);
- vty_out(vty, " IMEI: %s%s", set->imei, VTY_NEWLINE);
- vty_out(vty, " IMEISV: %s%s", set->imeisv, VTY_NEWLINE);
- if (set->imei_random)
- vty_out(vty, " IMEI generation: random (%d trailing "
- "digits)%s", set->imei_random, VTY_NEWLINE);
- else
- vty_out(vty, " IMEI generation: fixed%s", VTY_NEWLINE);
- vty_out(vty, " network selection mode: %s%s",
- (set->plmn_mode == PLMN_MODE_AUTO)
- ? "automatic" : "manual", VTY_NEWLINE);
- }
-
- return CMD_SUCCESS;
-}
-
-DEFUN(show_support, show_support_cmd, "show support [ms_name]",
- SHOW_STR "Display information about MS support\n"
- "Name of MS (see \"show ms\")")
-{
- struct osmocom_ms *ms;
-
- if (argc) {
- ms = get_ms(argv[0], vty);
- if (!ms)
- return CMD_WARNING;
- gsm_support_dump(ms, print_vty, vty);
- } else {
- llist_for_each_entry(ms, &ms_list, entity) {
- gsm_support_dump(ms, print_vty, vty);
- vty_out(vty, "%s", VTY_NEWLINE);
+ struct gsm_settings *set = &ms->settings;
+ struct gsm_trans *trans;
+ char *service = "";
+
+ if (!ms->started)
+ service = ", radio is not started";
+ else if (ms->mmlayer.state == GSM48_MM_ST_MM_IDLE) {
+ /* current MM idle state */
+ switch (ms->mmlayer.substate) {
+ case GSM48_MM_SST_NORMAL_SERVICE:
+ case GSM48_MM_SST_PLMN_SEARCH_NORMAL:
+ service = ", service is normal";
+ break;
+ case GSM48_MM_SST_LOC_UPD_NEEDED:
+ case GSM48_MM_SST_ATTEMPT_UPDATE:
+ service = ", service is limited (pending)";
+ break;
+ case GSM48_MM_SST_NO_CELL_AVAIL:
+ service = ", service is unavailable";
+ break;
+ default:
+ if (ms->subscr.sim_valid)
+ service = ", service is limited";
+ else
+ service = ", service is limited "
+ "(IMSI detached)";
+ break;