iPXE
Data Structures | Functions | Variables
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 More...
 
static int iwstat_exec (int argc, char **argv)
 The "iwstat" command. More...
 
static int iwlist_payload (struct net_device *netdev, struct iwlist_options *opts __unused)
 "iwlist" payload More...
 
static int iwlist_exec (int argc, char **argv)
 The "iwlist" command. More...
 

Variables

static struct option_descriptor iwstat_opts [] = {}
 "iwstat" option list More...
 
static struct ifcommon_command_descriptor iwstat_cmd
 "iwstat" command descriptor More...
 
static struct option_descriptor iwlist_opts [] = {}
 "iwlist" option list More...
 
static struct ifcommon_command_descriptor iwlist_cmd
 "iwlist" command descriptor More...
 
struct command iwmgmt_commands [] __command
 Wireless interface management commands. More...
 

Detailed Description

Wireless interface management commands.

Definition in file iwmgmt_cmd.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ iwstat_payload()

static 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:52
Structure encapsulating the complete state of an 802.11 device.
Definition: net80211.h:786
struct net80211_device * net80211_get(struct net_device *netdev)
Get 802.11 device from wrapping network device.
Definition: net80211.c:624
void iwstat(struct net80211_device *dev)
Print status of 802.11 device.
Definition: iwmgmt.c:41

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

◆ iwstat_exec()

static 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:51
static struct ifcommon_command_descriptor iwstat_cmd
"iwstat" command descriptor
Definition: iwmgmt_cmd.c:59

References ifcommon_exec(), and iwstat_cmd.

◆ iwlist_payload()

static 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
static struct net_device * netdev
Definition: gdbudp.c:52
Structure encapsulating the complete state of an 802.11 device.
Definition: net80211.h:786
struct net80211_device * net80211_get(struct net_device *netdev)
Get 802.11 device from wrapping network device.
Definition: net80211.c:624

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

◆ iwlist_exec()

static 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
int ifcommon_exec(int argc, char **argv, struct ifcommon_command_descriptor *ifcmd)
Execute if<xxx> command.
Definition: ifmgmt_cmd.c:51

References ifcommon_exec(), and iwlist_cmd.

Variable Documentation

◆ iwstat_opts

struct option_descriptor iwstat_opts[] = {}
static

"iwstat" option list

Definition at line 39 of file iwmgmt_cmd.c.

◆ iwstat_cmd

struct ifcommon_command_descriptor iwstat_cmd
static
Initial value:
=
0, MAX_ARGUMENTS, "[<interface>...]",
static int iwstat_payload(struct net_device *netdev, struct iwstat_options *opts __unused)
"iwstat" payload
Definition: iwmgmt_cmd.c:48
#define MAX_ARGUMENTS
No maximum number of arguments.
Definition: parseopt.h:96
static struct option_descriptor iwstat_opts[]
"iwstat" option list
Definition: iwmgmt_cmd.c:39
"iwstat" options
Definition: iwmgmt_cmd.c:36
#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:57

"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.

◆ 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
#define MAX_ARGUMENTS
No maximum number of arguments.
Definition: parseopt.h:96
"iwlist" options
Definition: iwmgmt_cmd.c:76
static int iwlist_payload(struct net_device *netdev, struct iwlist_options *opts __unused)
"iwlist" payload
Definition: iwmgmt_cmd.c:88
#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:57

"iwlist" command descriptor

Definition at line 99 of file iwmgmt_cmd.c.

Referenced by iwlist_exec().

◆ __command

struct command iwmgmt_commands [] __command
Initial value:
= {
{
.name = "iwstat",
.exec = iwstat_exec,
},
{
.name = "iwlist",
.exec = iwlist_exec,
},
}
static int iwstat_exec(int argc, char **argv)
The "iwstat" command.
Definition: iwmgmt_cmd.c:71
static int iwlist_exec(int argc, char **argv)
The "iwlist" command.
Definition: iwmgmt_cmd.c:111

Wireless interface management commands.

Definition at line 116 of file iwmgmt_cmd.c.