iwmgmt_cmd.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
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
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
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 };