iwmgmt_cmd.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009 Joshua Oreman <oremanj@rwcr.net>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 FILE_LICENCE ( GPL2_OR_LATER );
00020 
00021 #include <gpxe/netdevice.h>
00022 #include <gpxe/net80211.h>
00023 #include <gpxe/command.h>
00024 #include <usr/iwmgmt.h>
00025 #include <hci/ifmgmt_cmd.h>
00026 
00027 /* "iwstat" command */
00028 
00029 static int iwstat_payload ( struct net_device *netdev ) {
00030         struct net80211_device *dev = net80211_get ( netdev );
00031 
00032         if ( dev )
00033                 iwstat ( dev );
00034 
00035         return 0;
00036 }
00037 
00038 static int iwstat_exec ( int argc, char **argv ) {
00039         return ifcommon_exec ( argc, argv,
00040                                iwstat_payload, "Display wireless status of" );
00041 }
00042 
00043 /* "iwlist" command */
00044 
00045 static int iwlist_payload ( struct net_device *netdev ) {
00046         struct net80211_device *dev = net80211_get ( netdev );
00047 
00048         if ( dev )
00049                 return iwlist ( dev );
00050 
00051         return 0;
00052 }
00053 
00054 static int iwlist_exec ( int argc, char **argv ) {
00055         return ifcommon_exec ( argc, argv, iwlist_payload,
00056                                "List wireless networks available via" );
00057 }
00058 
00059 /** Wireless interface management commands */
00060 struct command iwmgmt_commands[] __command = {
00061         {
00062                 .name = "iwstat",
00063                 .exec = iwstat_exec,
00064         },
00065         {
00066                 .name = "iwlist",
00067                 .exec = iwlist_exec,
00068         },
00069 };

Generated on Tue Apr 6 20:01:06 2010 for gPXE by  doxygen 1.5.7.1