2 * Copyright (C) 2009 Joshua Oreman <oremanj@rwcr.net>.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA
20 FILE_LICENCE ( GPL2_OR_LATER );
22 #include <ipxe/netdevice.h>
23 #include <ipxe/net80211.h>
24 #include <ipxe/command.h>
25 #include <ipxe/parseopt.h>
26 #include <usr/iwmgmt.h>
27 #include <hci/ifmgmt_cmd.h>
31 * Wireless interface management commands
35 /** "iwstat" options */
36 struct iwstat_options {};
38 /** "iwstat" option list */
39 static struct option_descriptor iwstat_opts[] = {};
44 * @v netdev Network device
45 * @v opts Command options
46 * @ret rc Return status code
48 static int iwstat_payload ( struct net_device *netdev,
49 struct iwstat_options *opts __unused ) {
50 struct net80211_device *dev = net80211_get ( netdev );
58 /** "iwstat" command descriptor */
59 static struct ifcommon_command_descriptor iwstat_cmd =
60 IFCOMMON_COMMAND_DESC ( struct iwstat_options, iwstat_opts,
61 0, MAX_ARGUMENTS, "[<interface>...]",
65 * The "iwstat" command
67 * @v argc Argument count
68 * @v argv Argument list
69 * @ret rc Return status code
71 static int iwstat_exec ( int argc, char **argv ) {
72 return ifcommon_exec ( argc, argv, &iwstat_cmd );
75 /** "iwlist" options */
76 struct iwlist_options {};
78 /** "iwlist" option list */
79 static struct option_descriptor iwlist_opts[] = {};
84 * @v netdev Network device
85 * @v opts Command options
86 * @ret rc Return status code
88 static int iwlist_payload ( struct net_device *netdev,
89 struct iwlist_options *opts __unused ) {
90 struct net80211_device *dev = net80211_get ( netdev );
93 return iwlist ( dev );
98 /** "iwlist" command descriptor */
99 static struct ifcommon_command_descriptor iwlist_cmd =
100 IFCOMMON_COMMAND_DESC ( struct iwlist_options, iwlist_opts,
101 0, MAX_ARGUMENTS, "[<interface>...]",
105 * The "iwlist" command
107 * @v argc Argument count
108 * @v argv Argument list
109 * @ret rc Return status code
111 static int iwlist_exec ( int argc, char **argv ) {
112 return ifcommon_exec ( argc, argv, &iwlist_cmd );
115 /** Wireless interface management commands */
116 struct command iwmgmt_commands[] __command = {