1 /* $NetBSD: wirelessconf.c,v 1.2 2009/10/14 23:51:22 pooka Exp $ */
4 * Copyright (c) 2009 Antti Kantee. All Rights Reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <sys/types.h>
29 #include <sys/ioctl.h>
30 #include <sys/reboot.h>
31 #include <sys/socket.h>
35 #include <rump/rump.h>
36 #include <rump/rump_syscalls.h>
45 * Example program for raising rum0 interface under rump. This
46 * requires a rum-compatible usb device attached as ugen.
49 #define RUMFW "/libdata/firmware/rum/rum-rt2573"
56 rump_boot_sethowto(RUMP_AB_VERBOSE
);
59 /* rum? shouldn't that be marsala? */
60 s
= rump_sys_socket(AF_INET
, SOCK_DGRAM
, 0);
63 strcpy(ifr
.ifr_name
, "rum0");
64 if (rump_sys_ioctl(s
, SIOCGIFFLAGS
, &ifr
) == -1) {
66 printf("rum@usb not found!\n");
69 err(1, "get if flags");
71 printf("\ndevice autoconfiguration finished\n");
73 printf("tira-if-su ...\n");
74 if (rump_pub_etfs_register(RUMFW
, RUMFW
, RUMP_ETFS_REG
) != 0)
75 errx(1, "firmware etfs registration failed");
77 strcpy(ifr
.ifr_name
, "rum0");
78 ifr
.ifr_flags
= IFF_UP
;
79 if (rump_sys_ioctl(s
, SIOCSIFFLAGS
, &ifr
) == -1)