Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
stack.c File Reference
#include <linux/device.h>
#include <linux/gfp.h>
#include <net/genetlink.h>
#include <linux/netdevice.h>
#include <linux/wimax.h>
#include <linux/module.h>
#include "wimax-internal.h"
#include "debug-levels.h"

Go to the source code of this file.

Macros

#define D_SUBMODULE   stack
 

Functions

 module_param_string (debug, wimax_debug_params, sizeof(wimax_debug_params), 0644)
 
 MODULE_PARM_DESC (debug,"String of space-separated NAME:VALUE pairs, where NAMEs ""are the different debug submodules and VALUE are the ""initial debug value to set.")
 
void __wimax_state_change (struct wimax_dev *wimax_dev, enum wimax_st new_state)
 
void wimax_state_change (struct wimax_dev *wimax_dev, enum wimax_st new_state)
 
 EXPORT_SYMBOL_GPL (wimax_state_change)
 
enum wimax_st wimax_state_get (struct wimax_dev *wimax_dev)
 
 EXPORT_SYMBOL_GPL (wimax_state_get)
 
void wimax_dev_init (struct wimax_dev *wimax_dev)
 
 EXPORT_SYMBOL_GPL (wimax_dev_init)
 
int wimax_dev_add (struct wimax_dev *wimax_dev, struct net_device *net_dev)
 
 EXPORT_SYMBOL_GPL (wimax_dev_add)
 
void wimax_dev_rm (struct wimax_dev *wimax_dev)
 
 EXPORT_SYMBOL_GPL (wimax_dev_rm)
 
 module_init (wimax_subsys_init)
 
 module_exit (wimax_subsys_exit)
 
 MODULE_AUTHOR ("Intel Corporation <[email protected]>")
 
 MODULE_DESCRIPTION ("Linux WiMAX stack")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct genl_ops
wimax_gnl_msg_from_user
wimax_gnl_reset
wimax_gnl_rfkill 
wimax_gnl_state_get
 
struct d_level D_LEVEL []
 
size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL)
 
struct genl_family wimax_gnl_family
 
struct genl_multicast_group wimax_gnl_mcg
 

Macro Definition Documentation

#define D_SUBMODULE   stack

Definition at line 62 of file stack.c.

Function Documentation

void __wimax_state_change ( struct wimax_dev wimax_dev,
enum wimax_st  new_state 
)

Definition at line 203 of file stack.c.

EXPORT_SYMBOL_GPL ( wimax_state_change  )
EXPORT_SYMBOL_GPL ( wimax_state_get  )
EXPORT_SYMBOL_GPL ( wimax_dev_init  )
EXPORT_SYMBOL_GPL ( wimax_dev_add  )
EXPORT_SYMBOL_GPL ( wimax_dev_rm  )
MODULE_AUTHOR ( "Intel Corporation <[email protected]>"  )
MODULE_DESCRIPTION ( "Linux WiMAX stack )
module_exit ( wimax_subsys_exit  )
module_init ( wimax_subsys_init  )
MODULE_LICENSE ( "GPL"  )
module_param_string ( debug  ,
wimax_debug_params  ,
sizeof(wimax_debug_params)  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"String of space-separated NAME:VALUE  pairs,
where NAMEs""are the different debug submodules and VALUE are the""initial debug value to set."   
)
int wimax_dev_add ( struct wimax_dev wimax_dev,
struct net_device net_dev 
)

wimax_dev_add - Register a new WiMAX device

: WiMAX device descriptor (as embedded in your 's priv data). You must have called wimax_dev_init() on it before.

: net device the is associated with. The function expects SET_NETDEV_DEV() and register_netdev() were already called on it.

Registers the new WiMAX device, sets up the user-kernel control interface (generic netlink) and common WiMAX infrastructure.

Note that the parts that will allow interaction with user space are setup at the very end, when the rest is in place, as once that happens, the driver might get user space control requests via netlink or from debugfs that might translate into calls into wimax_dev->op_*().

Definition at line 457 of file stack.c.

void wimax_dev_init ( struct wimax_dev wimax_dev)

wimax_dev_init - initialize a newly allocated instance

: WiMAX device descriptor to initialize.

Initializes fields of a freshly allocated instance. This function assumes that after allocation, the memory occupied by was zeroed.

Definition at line 396 of file stack.c.

void wimax_dev_rm ( struct wimax_dev wimax_dev)

wimax_dev_rm - Unregister an existing WiMAX device

: WiMAX device descriptor

Unregisters a WiMAX device previously registered for use with wimax_add_rm().

IMPORTANT! Must call before calling unregister_netdev().

After this function returns, you will not get any more user space control requests (via netlink or debugfs) and thus to wimax_dev->ops.

Reentrancy control is ensured by setting the state to __WIMAX_ST_QUIESCING. rfkill operations coming through wimax_*rfkill*() will be stopped by the quiescing state; ops coming from the rfkill subsystem will be stopped by the support being removed by wimax_rfkill_rm().

Definition at line 523 of file stack.c.

void wimax_state_change ( struct wimax_dev wimax_dev,
enum wimax_st  new_state 
)

wimax_state_change - Set the current state of a WiMAX device

: WiMAX device descriptor (properly referenced) : New state to switch to

This implements the state changes for the wimax devices. It will

  • verify that the state transition is legal (for now it'll just print a warning if not) according to the table in linux/wimax.h's documentation for 'enum wimax_st'.
  • perform the actions needed for leaving the current state and whichever are needed for entering the new state.
  • issue a report to user space indicating the new state (and an optional payload with information about the new state).

NOTE: must be locked

Definition at line 347 of file stack.c.

enum wimax_st wimax_state_get ( struct wimax_dev wimax_dev)

wimax_state_get() - Return the current state of a WiMAX device

: WiMAX device descriptor

Returns: Current state of the device according to its driver.

Definition at line 376 of file stack.c.

Variable Documentation

struct d_level D_LEVEL[]
Initial value:

Definition at line 540 of file stack.c.

size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL)

Definition at line 549 of file stack.c.

struct genl_family wimax_gnl_family
Initial value:
= {
.name = "WiMAX",
.version = WIMAX_GNL_VERSION,
.hdrsize = 0,
.maxattr = WIMAX_GNL_ATTR_MAX,
}

Definition at line 552 of file stack.c.

Initial value:
= {
.name = "msg",
}

Definition at line 560 of file stack.c.

Definition at line 77 of file op-state-get.c.