source: bootcd/isolinux/syslinux-6.03/gpxe/src/hci/commands/iwmgmt_cmd.c

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 * Copyright (C) 2009 Joshua Oreman <oremanj@rwcr.net>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19FILE_LICENCE ( GPL2_OR_LATER );
20
21#include <gpxe/netdevice.h>
22#include <gpxe/net80211.h>
23#include <gpxe/command.h>
24#include <usr/iwmgmt.h>
25#include <hci/ifmgmt_cmd.h>
26
27/* "iwstat" command */
28
29static int iwstat_payload ( struct net_device *netdev ) {
30        struct net80211_device *dev = net80211_get ( netdev );
31
32        if ( dev )
33                iwstat ( dev );
34
35        return 0;
36}
37
38static int iwstat_exec ( int argc, char **argv ) {
39        return ifcommon_exec ( argc, argv,
40                               iwstat_payload, "Display wireless status of" );
41}
42
43/* "iwlist" command */
44
45static int iwlist_payload ( struct net_device *netdev ) {
46        struct net80211_device *dev = net80211_get ( netdev );
47
48        if ( dev )
49                return iwlist ( dev );
50
51        return 0;
52}
53
54static int iwlist_exec ( int argc, char **argv ) {
55        return ifcommon_exec ( argc, argv, iwlist_payload,
56                               "List wireless networks available via" );
57}
58
59/** Wireless interface management commands */
60struct command iwmgmt_commands[] __command = {
61        {
62                .name = "iwstat",
63                .exec = iwstat_exec,
64        },
65        {
66                .name = "iwlist",
67                .exec = iwlist_exec,
68        },
69};
Note: See TracBrowser for help on using the repository browser.