void CREATE_RSTP_INSTANCE() { int The_EOR; UID_STP_CFG_T uid_cfg; BITMAP_T ports; //init the port number for the bridges and set the bits high for the port creation STP_IN_init(NUMBER_OF_PORTS); BitmapClear(&enabled_ports); BitmapClear(&ports); for (The_EOR = 1; The_EOR <= NUMBER_OF_PORTS; The_EOR++) { BitmapSetBit(&ports, The_EOR - 1); } uid_cfg.field_mask = BR_CFG_STATE; uid_cfg.stp_enabled = STP_ENABLED; //set the init info for my bridge instanse,including creatation of the bridge The_EOR = STP_IN_stpm_set_cfg (VLAN_ID,&ports,&uid_cfg); #ifdef MY_PRINT_RSTP if(The_EOR == STP_OK) printf("Yes! The configuration is done!!!\n"); else printf("No! I'm a litter upset for the set failure!!!\n"); #endif }
static void Init() { WORD i; screen[0] = NewBitmap(WIDTH, HEIGHT, DEPTH); screen[1] = NewBitmap(WIDTH, HEIGHT, DEPTH); custom->dmacon = DMAF_SETCLR | DMAF_BLITTER; for (i = 0; i < 8; i++) { Area2D flare_area = { 0, i * SIZE, SIZE, SIZE }; flare[i] = NewBitmap(SIZE, SIZE, DEPTH); BitmapCopyArea(flare[i], 0, 0, flares, &flare_area); } carry = NewBitmap(SIZE + 16, SIZE, 2); cp = NewCopList(50); for (i = 0; i < 2; i++) BitmapClear(screen[i]); CopInit(cp); CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, bplptr, screen[active], DEPTH); CopLoadPal(cp, flares->palette, 0); CopEnd(cp); CopListActivate(cp); custom->dmacon = DMAF_SETCLR | DMAF_RASTER; }
int bridge_start(void) { BITMAP_T ports; UID_MSG_T msg; UID_STP_CFG_T uid_cfg; register int iii; //rl_callback_handler_install(get_prompt(), rl_read_cli); if (0 != UiD_SocketInit(&uid_socket, UID_REPL_PATH, UID_BIND_AS_CLIENT)) { printf("FATAL: can't init the connection\n"); exit(-3); } /* send HANDSHAKE */ msg.header.sender_pid = my_pid; msg.header.cmd_type = UID_CNTRL; msg.body.cntrl.cmd = UID_BRIDGE_HANDSHAKE; msg.body.cntrl.param1 = NUMBER_OF_PORTS; iii = UiD_SocketSendto(&uid_socket, &msg, sizeof(UID_MSG_T)); if (iii < 0) { printf("can't send HANDSHAKE: %s\n", strerror(errno)); printf("May be 'mngr' is not alive ? :(\n"); return (-4); } stp_cli_init(); STP_IN_init(NUMBER_OF_PORTS); BitmapClear(&enabled_ports); BitmapClear(&ports); for (iii = 1; iii <= NUMBER_OF_PORTS; iii++) { BitmapSetBit(&ports, iii - 1); } uid_cfg.field_mask = BR_CFG_STATE; uid_cfg.stp_enabled = STP_ENABLED; snprintf(uid_cfg.vlan_name, NAME_LEN - 1, "B%ld", (long)my_pid); iii = STP_IN_stpm_set_cfg(0, &ports, &uid_cfg); if (STP_OK != iii) { printf("FATAL: can't enable:%s\n", STP_IN_get_error_explanation (iii)); return (-1); } return 0; }
static void Init() { custom->dmacon = DMAF_SETCLR | DMAF_BLITTER; BitmapClear(screen); cp = NewCopList(100); CopInit(cp); CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, bplptr, screen, DEPTH); CopLoadPal(cp, palette, 0); CopEnd(cp); CopListActivate(cp); custom->dmacon = DMAF_SETCLR | DMAF_RASTER; }
static void Init() { EnableDMA(DMAF_BLITTER); BitmapClear(screen); cp = NewCopList(100); CopInit(cp); CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, bplptr, screen, DEPTH); CopLoadPal(cp, palette, 0); CopEnd(cp); CopListActivate(cp); EnableDMA(DMAF_RASTER); }
static void Init() { scroll = NewBitmap(WIDTH, HEIGHT + 16, 1); custom->dmacon = DMAF_SETCLR | DMAF_BLITTER; BitmapClear(scroll); line_start = text; cp[0] = MakeCopperList(0); cp[1] = MakeCopperList(1); CopListActivate(cp[active]); custom->dmacon = DMAF_SETCLR | DMAF_RASTER; }
static void WaveScopeDrawChannel(WORD num) { WaveScopeChanT *ch = &wavescope.channel[num]; BitmapT *bm = ch->bm; LONG *dst = bm->planes[0]; UBYTE *samples; UBYTE *multab; LONG i, di, volume; WORD n; BitmapClear(bm); multab = wavescope.multab; samples = ch->samples; volume = ch->volume << 8; i = ch->i, di = ch->di; for (n = 0; n < WS_SAMPLES; n++) { WORD x; i = swap16(i); x = multab[samples[i] | volume]; i = swap16(i); i += di; if (i >= (AHX_SAMPLE_LEN << 16)) i -= (AHX_SAMPLE_LEN << 16); { LONG *src = (LONG *)(wavescope.spans->planes[0] + (x & ~7)); *dst++ = *src++; *dst++ = *src++; } } ch->i = i; }