iPXE
iwmgmt_cmd.c File Reference

Wireless interface management commands. More...

#include <ipxe/netdevice.h>
#include <ipxe/net80211.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <usr/iwmgmt.h>
#include <hci/ifmgmt_cmd.h>

Go to the source code of this file.

Data Structures

struct  iwstat_options
 "iwstat" options More...
struct  iwlist_options
 "iwlist" options More...

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static int iwstat_payload (struct net_device *netdev, struct iwstat_options *opts __unused)
 "iwstat" payload
static int iwstat_exec (int argc, char **argv)
 The "iwstat" command.
static int iwlist_payload (struct net_device *netdev, struct iwlist_options *opts __unused)
 "iwlist" payload
static int iwlist_exec (int argc, char **argv)
 The "iwlist" command.
 COMMAND (iwstat, iwstat_exec)
 Wireless interface management commands.
 COMMAND (iwlist, iwlist_exec)

Variables

static struct option_descriptor iwstat_opts [] = {}
 "iwstat" option list
static struct ifcommon_command_descriptor iwstat_cmd
 "iwstat" command descriptor
static struct option_descriptor iwlist_opts [] = {}
 "iwlist" option list
static struct ifcommon_command_descriptor iwlist_cmd
 "iwlist" command descriptor

Detailed Description

Wireless interface management commands.

Definition in file iwmgmt_cmd.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ iwstat_payload()

int iwstat_payload ( struct net_device * netdev,
struct iwstat_options *opts __unused )
static

"iwstat" payload

Parameters
netdevNetwork device
optsCommand options
Return values
rcReturn status code

Definition at line 48 of file iwmgmt_cmd.c.

49 {
50 struct net80211_device *dev = net80211_get ( netdev );
51
52 if ( dev )
53 iwstat ( dev );
54
55 return 0;
56}
static struct net_device * netdev
Definition gdbudp.c:53
struct net80211_device * net80211_get(struct net_device *netdev)
Get 802.11 device from wrapping network device.
Definition net80211.c:625
void iwstat(struct net80211_device *dev)
Print status of 802.11 device.
Definition iwmgmt.c:41
Structure encapsulating the complete state of an 802.11 device.
Definition net80211.h:787

References __unused, iwstat(), net80211_get(), netdev, and opts.

◆ iwstat_exec()

int iwstat_exec ( int argc,
char ** argv )
static

The "iwstat" command.

Parameters
argcArgument count
argvArgument list
Return values
rcReturn status code

Definition at line 71 of file iwmgmt_cmd.c.

71 {
72 return ifcommon_exec ( argc, argv, &iwstat_cmd );
73}
int ifcommon_exec(int argc, char **argv, struct ifcommon_command_descriptor *ifcmd)
Execute if<xxx> command.
Definition ifmgmt_cmd.c:52
static struct ifcommon_command_descriptor iwstat_cmd
"iwstat" command descriptor
Definition iwmgmt_cmd.c:59

References ifcommon_exec(), and iwstat_cmd.

Referenced by COMMAND().

◆ iwlist_payload()

int iwlist_payload ( struct net_device * netdev,
struct iwlist_options *opts __unused )
static

"iwlist" payload

Parameters
netdevNetwork device
optsCommand options
Return values
rcReturn status code

Definition at line 88 of file iwmgmt_cmd.c.

89 {
90 struct net80211_device *dev = net80211_get ( netdev );
91
92 if ( dev )
93 return iwlist ( dev );
94
95 return 0;
96}
int iwlist(struct net80211_device *dev)
Scan for wireless networks using 802.11 device.
Definition iwmgmt.c:120

References __unused, iwlist(), net80211_get(), netdev, and opts.

◆ iwlist_exec()

int iwlist_exec ( int argc,
char ** argv )
static

The "iwlist" command.

Parameters
argcArgument count
argvArgument list
Return values
rcReturn status code

Definition at line 111 of file iwmgmt_cmd.c.

111 {
112 return ifcommon_exec ( argc, argv, &iwlist_cmd );
113}
static struct ifcommon_command_descriptor iwlist_cmd
"iwlist" command descriptor
Definition iwmgmt_cmd.c:99

References ifcommon_exec(), and iwlist_cmd.

Referenced by COMMAND().

◆ COMMAND() [1/2]

COMMAND ( iwstat ,
iwstat_exec  )

Wireless interface management commands.

References iwstat(), and iwstat_exec().

◆ COMMAND() [2/2]

COMMAND ( iwlist ,
iwlist_exec  )

References iwlist(), and iwlist_exec().

Variable Documentation

◆ iwstat_opts

struct option_descriptor iwstat_opts[] = {}
static

"iwstat" option list

Definition at line 39 of file iwmgmt_cmd.c.

39{};

◆ iwstat_cmd

struct ifcommon_command_descriptor iwstat_cmd
static
Initial value:
=
0, MAX_ARGUMENTS, "[<interface>...]",
#define IFCOMMON_COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage, _payload, _stop_on_first_success)
Construct "if<xxx>" command descriptor.
Definition ifmgmt_cmd.h:58
static int iwstat_payload(struct net_device *netdev, struct iwstat_options *opts __unused)
"iwstat" payload
Definition iwmgmt_cmd.c:48
static struct option_descriptor iwstat_opts[]
"iwstat" option list
Definition iwmgmt_cmd.c:39
#define MAX_ARGUMENTS
No maximum number of arguments.
Definition parseopt.h:98
"iwstat" options
Definition iwmgmt_cmd.c:36

"iwstat" command descriptor

Definition at line 59 of file iwmgmt_cmd.c.

Referenced by iwstat_exec().

◆ iwlist_opts

struct option_descriptor iwlist_opts[] = {}
static

"iwlist" option list

Definition at line 79 of file iwmgmt_cmd.c.

79{};

◆ iwlist_cmd

struct ifcommon_command_descriptor iwlist_cmd
static
Initial value:
=
0, MAX_ARGUMENTS, "[<interface>...]",
static struct option_descriptor iwlist_opts[]
"iwlist" option list
Definition iwmgmt_cmd.c:79
static int iwlist_payload(struct net_device *netdev, struct iwlist_options *opts __unused)
"iwlist" payload
Definition iwmgmt_cmd.c:88
"iwlist" options
Definition iwmgmt_cmd.c:76

"iwlist" command descriptor

Definition at line 99 of file iwmgmt_cmd.c.

Referenced by iwlist_exec().