📄 option.c
字号:
static struct option_choice serial_port_choice2= /* port type(SPIF)*/{ 9, "Serial Port: ", CYCLE_ITEM, 't', {"ttyz10", "ttyz11", "ttyz12", "ttyz13", "ttyz14", "ttyz15", "ttyz16", "ttyz17", "all", NULL, NULL}};static struct option_choice serial_port_choice3= /* port type(SPIF)*/{ 9, "Serial Port: ", CYCLE_ITEM, 't', {"ttyz18", "ttyz19", "ttyz1a", "ttyz1b", "ttyz1c", "ttyz1d", "ttyz1e", "ttyz1f", "all", NULL, NULL}};panel_set_processors(){ int i, num, b; for (b = 1, i = 0, num = 0; num < number_processors; b <<= 1, i++) { if (processors_mask & b) { (void)panel_set(processor_item[i], PANEL_VALUE, 0, 0); num++; } }}/****************************************************************************** * option_default_proc, notify procedure for default button in option popups. * ******************************************************************************/option_default_proc(item)Panel_item item;{ int test_id; int temp=0; if (!tty_mode) test_id = (int)panel_get(item, PANEL_CLIENT_DATA); else test_id = (int)item; switch (tests[test_id]->id) /* depend on which test it is */ { case PMEM: break; /* does nothing */ case VMEM: /* wait time defaults to 0 */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, "0", 0); } else { (int)tests[test_id]->data = 0; (int)tests[test_id]->special = 0; } break; case AUDIO: if (tests[option_id]->conf->uval.devinfo.status == 0) { if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, "100", 0); } else { tests[test_id]->data = (caddr_t)0; tests[test_id]->special = (caddr_t)100; } } else { if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); (void)panel_set(item4, PANEL_VALUE, 0, 0); (void)panel_set(item5, PANEL_VALUE, 0, 0); (void)panel_set(item6, PANEL_VALUE, 1, 0); (void)panel_set(item7, PANEL_VALUE, "", 0); } else { tests[test_id]->special = (caddr_t)""; tests[test_id]->data = (caddr_t)0x40; } } break; case CPU_SP: /* loopback defaults to a-b */ case CPU_SP1: /* loopback defaults to c-d */ if (!tty_mode) (void)panel_set(item1, PANEL_VALUE, 3, 0); else (int)tests[test_id]->data = 3; break; case ENET0: case ENET1: case ENET2: case OMNI_NET: case FDDI: case TRNET: if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 1, 0); (void)panel_set(item2, PANEL_VALUE, "10", 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); } else (int)tests[test_id]->data = 1; (int)tests[test_id]->special = 10; break; case CDROM: /* default to other, datatests, audiotest */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 4, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); (void)panel_set(item4, PANEL_VALUE, "255", 0); (void)panel_set(item5, PANEL_VALUE, 0, 0); (void)panel_set(item6, PANEL_VALUE, 0, 0); (void)panel_set(item7, PANEL_VALUE, "100", 0); } else { (int)tests[test_id]->data = 4+(100<<8); (int)tests[test_id]->special = 255; } break; case SCSIDISK1: /* defaults to enabling filetest */ case XYDISK1: /* and raw read-only test. */ case XDDISK1: case IPIDISK1: case IDDISK1: case SFDISK1: case OBFDISK1: temp = tests[test_id]->conf->uval.meminfo.amt; if ( temp <= 100 ) temp = 0; else temp = ((temp -1)/200) + 1; if (temp > 6) temp = 6; if (!tty_mode) { (void)panel_set(item1, PANEL_TOGGLE_VALUE, 0, 1, 0); (void)panel_set(item2, PANEL_TOGGLE_VALUE, 0, 1, 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); (void)panel_set(item4, PANEL_VALUE, 2, 0); (void)panel_set(item5, PANEL_VALUE, temp, 0); } else { tests[test_id]->enable = TRUE; tests[test_id+1]->enable = TRUE; (int)tests[test_id]->data &= ~0x7f; (int)tests[test_id]->data |= temp << 4; (int)tests[test_id]->data |= 0x2; if (!tests[test_id]->dev_enable) break; /* the device was not enabled for testing */ select_test(test_id, tests[test_id]->enable); select_test(test_id+1, tests[test_id+1]->enable); print_status(); } break; case MAGTAPE1: case MAGTAPE2: case SCSITAPE: if (!tty_mode) { if (cart_tape) (void)panel_set(item1, PANEL_VALUE, 2, 0); else if (hp_flt) (void)panel_set(item1, PANEL_VALUE, 3, 0); else if (halfin) (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); (void)panel_set(item4, PANEL_VALUE, "25300", 0); if (exabyte_8200 || exabyte_8500) (void)panel_set(item5, PANEL_VALUE, 1, 0); else (void)panel_set(item5, PANEL_VALUE, 0, 0); (void)panel_set(item6, PANEL_VALUE, 1, 0); if (ctlr_type == 3) (void)panel_set(item7, PANEL_VALUE, 0, 0); if (cart_tape || qic150) (void)panel_set(item8, PANEL_VALUE, 0, 0); (void)panel_set(item9, PANEL_VALUE, 0, 0); if (hp_flt || halfin) (void)panel_set(item10, PANEL_VALUE, "25", 0); else if (exabyte_8200 || exabyte_8500) (void)panel_set(item10, PANEL_VALUE, "8", 0); else (void)panel_set(item10, PANEL_VALUE, "10", 0); } else { if (hp_flt) (int)tests[test_id]->data = 0x190043; else if(halfin) (int)tests[test_id]->data = 0x190040; else if(exabyte_8200) (int)tests[test_id]->data = 0x80060; else if(exabyte_8500) (int)tests[test_id]->data = 0x80060; else (int)tests[test_id]->data = 0xa0042; (unsigned)tests[test_id]->special = 25300; /* 200 big blocks + 100 small blocks */ } break; case TV1: /* defaults to all loopback's disabled */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); (void)panel_set(item4, PANEL_VALUE, 0, 0); } else (int)tests[test_id]->data = 0; break; case IPC: /* defaults to neither floppy drive test nor printer test */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); } else (int)tests[test_id]->data = 0; break; case MCP: /* defaults to enabling both serial and printer ports tests */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, sp2_src, 0); (void)panel_set(item2, PANEL_VALUE, sp2_des, 0); (void)panel_set(item3, PANEL_TOGGLE_VALUE, 0, 1, 0); (void)panel_set(item4, PANEL_TOGGLE_VALUE, 0, 1, 0); } else { (void)strcpy(((struct loopback *)(tests[test_id]->data))->from, sp2_src); (void)strcpy(((struct loopback *)(tests[test_id]->data))->to, sp2_des); tests[test_id]->enable = TRUE; tests[test_id+1]->enable = TRUE; if (!tests[test_id]->dev_enable) break; /* the device was not enabled for testing */ select_test(test_id, tests[test_id]->enable); select_test(test_id+1, tests[test_id+1]->enable); print_status(); } break; case MTI: /* default for loopback configuration */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, sp_src, 0); (void)panel_set(item2, PANEL_VALUE, sp_des, 0); } else { (void)strcpy(((struct loopback *)(tests[test_id]->data))->from, sp_src); (void)strcpy(((struct loopback *)(tests[test_id]->data))->to, sp_des); } break; case SCSISP1: /* default for loopback configuration */ case SCSISP2: if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, scsisp_src, 0); (void)panel_set(item2, PANEL_VALUE, scsisp_des, 0); } else { (void)strcpy(((struct loopback *)(tests[test_id]->data))->from, scsisp_src); (void)strcpy(((struct loopback *)(tests[test_id]->data))->to, scsisp_des); } break; case SCP: /* default for loopback configuration */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, sunlink_src[0], 0); (void)panel_set(item2, PANEL_VALUE, sunlink_des[0], 0); } else { (void)strcpy(((struct loopback *)(tests[test_id]->data))->from, sunlink_src[0]); (void)strcpy(((struct loopback *)(tests[test_id]->data))->to, sunlink_des[0]); } break; case SCP2: /* default for loopback configuration */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, sunlink_src[tests[test_id]->unit], 0); (void)panel_set(item2, PANEL_VALUE, sunlink_des[tests[test_id]->unit], 0); } else { (void)strcpy(((struct loopback *)(tests[test_id]->data))->from, sunlink_src[tests[test_id]->unit]); (void)strcpy(((struct loopback *)(tests[test_id]->data))->to, sunlink_des[tests[test_id]->unit]); } break; /* defaults to On-board clock, "0 1 2 3" loopback, no internal loopback */ case SBUS_HSI: /* ifd0-3 */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 4, 0); } else (int)tests[test_id]->data = 0x40; break; case HSI: /* defaults to On-board, RS449, and 0-1(2-3) */ if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 3, 0); } else (int)tests[test_id]->data = 3; break; case GP: /* default to no Graphics Buffer */ if (!tty_mode) (void)panel_set(item1, PANEL_VALUE, 0, 0); else (int)tests[test_id]->data = 0; break; case PRESTO: if (!tty_mode) (void)panel_set(item1, PANEL_VALUE, 0, 0); else (int)tests[test_id]->data = 0; break; case VFC: break; /* does nothing */ case CG12: if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 0, 0); (void)panel_set(item2, PANEL_VALUE, 0, 0); (void)panel_set(item3, PANEL_VALUE, 0, 0); (void)panel_set(item4, PANEL_VALUE, 0, 0); (void)panel_set(item6, PANEL_VALUE, 0, 0); (void)panel_set(item5, PANEL_VALUE, 0, 0); (void)panel_set(item7, PANEL_VALUE, 0, 0); (void)panel_set(item8, PANEL_VALUE, 0, 0); (void)panel_set(item9, PANEL_VALUE, 0, 0); (void)panel_set(item10, PANEL_VALUE, 0, 0); (void)panel_set(item11, PANEL_VALUE, 0, 0); (void)panel_set(item13, PANEL_VALUE, "1", 0); /*function_loop_choice*/ (void)panel_set(item14, PANEL_VALUE, "1", 0); /*board_loop_choice*/ } else { (int)tests[test_id]->data = 1<<12; /* function loop count */ (int)tests[test_id]->special = 1; /* board loop count */ } break; case GT: if (!tty_mode) { (void)panel_set(item1, PANEL_VALUE, 1, 0); (void)panel_set(item2, PANEL_VALUE, 1, 0); (void)panel_set(item3, PANEL_VALUE, 1, 0); (void)panel_set(item4, PANEL_VALUE, 1, 0); (void)panel_set(item6, PANEL_VALUE, 1, 0); (void)panel_set(item5, PANEL_VALUE, 1, 0); (void)panel_set(item7, PANEL_VALUE, 1, 0); (void)panel_set(item8, PANEL_VALUE, 1, 0); (void)panel_set(item9, PANEL_VALUE, 1, 0); (void)panel_set(item10, PANEL_VALUE, 1, 0); (void)panel_set(item11, PANEL_VALUE, 1, 0); (void)panel_set(item12, PANEL_VALUE, 1, 0); (void)panel_set(item13, PANEL_VALUE, 1, 0); (void)panel_set(item14, PANEL_VALUE, 1, 0); (void)panel_set(item15, PANEL_VALUE, 1, 0); (void)panel_set(item16, PANEL_VALUE, 1, 0); (void)panel_set(item17, PANEL_VALUE, 1, 0); (void)panel_set(item18, PANEL_VALUE, 1, 0); (void)panel_set(item19, PANEL_VALUE, 1, 0); (void)panel_set(item20, PANEL_VALUE, 0, 0); (void)panel_set(item21, PANEL_VALUE, 0, 0); (void)panel_set(item22, PANEL_VALUE, "1", 0);/*function_loop_choice*/ (void)panel_set(item23, PANEL_VALUE, "1", 0);/*board_loop_choice*/ } else { (int)tests[test_id]->data = 0x03FFFFF; /* function loop count */ (int)tests[test_id]->special = 1; /* board loop count */ } break; case MP4: if (!tty_mode) { panel_set_processors(); (void)panel_set(item1, PANEL_VALUE, 0, 0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -