Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
bypass.c File Reference
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <asm/unistd.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/netdevice.h>
#include <linux/kernel_stat.h>
#include <linux/pci.h>
#include <linux/rtnetlink.h>
#include <linux/ethtool.h>
#include <net/net_namespace.h>
#include "bplibk.h"

Go to the source code of this file.

Macros

#define MOD_NAME   "bypass"
 
#define VERSION   "\n"MOD_NAME" version 9.0.4\n"
 
#define bp_symbol_get(fn_name)   symbol_get(fn_name)
 
#define bp_symbol_put(fn_name)   symbol_put(fn_name)
 
#define SET_BPLIB_INT_FN(fn_name, arg_type, arg, ret)
 
#define SET_BPLIB_INT_FN2(fn_name, arg_type, arg, arg_type1, arg1, ret)
 
#define SET_BPLIB_INT_FN3(fn_name, arg_type, arg, arg_type1, arg1, arg_type2, arg2, ret)
 
#define DO_BPLIB_GET_ARG_FN(fn_name, ioctl_val, if_index)
 
#define DO_BPLIB_SET_ARG_FN(fn_name, ioctl_val, if_index, arg)
 

Functions

 MODULE_AUTHOR ("www.silicom.co.il")
 
 MODULE_LICENSE ("GPL")
 
int init_lib_module (void)
 
void cleanup_lib_module (void)
 
int is_bypass_dev (int if_index)
 
int is_bypass (int if_index)
 
int get_bypass_slave (int if_index)
 
int get_bypass_caps (int if_index)
 
int get_wd_set_caps (int if_index)
 
int set_bypass (int if_index, int bypass_mode)
 
int get_bypass (int if_index)
 
int get_bypass_change (int if_index)
 
int set_dis_bypass (int if_index, int dis_bypass)
 
int get_dis_bypass (int if_index)
 
int set_bypass_pwoff (int if_index, int bypass_mode)
 
int get_bypass_pwoff (int if_index)
 
int set_bypass_pwup (int if_index, int bypass_mode)
 
int get_bypass_pwup (int if_index)
 
int set_bypass_wd (int if_index, int ms_timeout, int *ms_timeout_set)
 
int get_bypass_wd (int if_index, int *ms_timeout_set)
 
int get_wd_expire_time (int if_index, int *ms_time_left)
 
int reset_bypass_wd_timer (int if_index)
 
int set_std_nic (int if_index, int bypass_mode)
 
int get_std_nic (int if_index)
 
int set_tx (int if_index, int tx_state)
 
int get_tx (int if_index)
 
int set_tap (int if_index, int tap_mode)
 
int get_tap (int if_index)
 
int get_tap_change (int if_index)
 
int set_dis_tap (int if_index, int dis_tap)
 
int get_dis_tap (int if_index)
 
int set_tap_pwup (int if_index, int tap_mode)
 
int get_tap_pwup (int if_index)
 
int set_bp_disc (int if_index, int disc_mode)
 
int get_bp_disc (int if_index)
 
int get_bp_disc_change (int if_index)
 
int set_bp_dis_disc (int if_index, int dis_disc)
 
int get_bp_dis_disc (int if_index)
 
int set_bp_disc_pwup (int if_index, int disc_mode)
 
int get_bp_disc_pwup (int if_index)
 
int set_wd_exp_mode (int if_index, int mode)
 
int get_wd_exp_mode (int if_index)
 
int set_wd_autoreset (int if_index, int time)
 
int get_wd_autoreset (int if_index)
 
int set_tpl (int if_index, int tpl_mode)
 
int get_tpl (int if_index)
 
int set_bp_hw_reset (int if_index, int mode)
 
int get_bp_hw_reset (int if_index)
 
int get_bypass_info (int if_index, struct bp_info *bp_info)
 
 EXPORT_SYMBOL_NOVERS (is_bypass)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_slave)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_caps)
 
 EXPORT_SYMBOL_NOVERS (get_wd_set_caps)
 
 EXPORT_SYMBOL_NOVERS (set_bypass)
 
 EXPORT_SYMBOL_NOVERS (get_bypass)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_change)
 
 EXPORT_SYMBOL_NOVERS (set_dis_bypass)
 
 EXPORT_SYMBOL_NOVERS (get_dis_bypass)
 
 EXPORT_SYMBOL_NOVERS (set_bypass_pwoff)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_pwoff)
 
 EXPORT_SYMBOL_NOVERS (set_bypass_pwup)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_pwup)
 
 EXPORT_SYMBOL_NOVERS (set_bypass_wd)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_wd)
 
 EXPORT_SYMBOL_NOVERS (get_wd_expire_time)
 
 EXPORT_SYMBOL_NOVERS (reset_bypass_wd_timer)
 
 EXPORT_SYMBOL_NOVERS (set_std_nic)
 
 EXPORT_SYMBOL_NOVERS (get_std_nic)
 
 EXPORT_SYMBOL_NOVERS (set_tx)
 
 EXPORT_SYMBOL_NOVERS (get_tx)
 
 EXPORT_SYMBOL_NOVERS (set_tap)
 
 EXPORT_SYMBOL_NOVERS (get_tap)
 
 EXPORT_SYMBOL_NOVERS (get_tap_change)
 
 EXPORT_SYMBOL_NOVERS (set_dis_tap)
 
 EXPORT_SYMBOL_NOVERS (get_dis_tap)
 
 EXPORT_SYMBOL_NOVERS (set_tap_pwup)
 
 EXPORT_SYMBOL_NOVERS (get_tap_pwup)
 
 EXPORT_SYMBOL_NOVERS (set_bp_disc)
 
 EXPORT_SYMBOL_NOVERS (get_bp_disc)
 
 EXPORT_SYMBOL_NOVERS (get_bp_disc_change)
 
 EXPORT_SYMBOL_NOVERS (set_bp_dis_disc)
 
 EXPORT_SYMBOL_NOVERS (get_bp_dis_disc)
 
 EXPORT_SYMBOL_NOVERS (set_bp_disc_pwup)
 
 EXPORT_SYMBOL_NOVERS (get_bp_disc_pwup)
 
 EXPORT_SYMBOL_NOVERS (set_wd_exp_mode)
 
 EXPORT_SYMBOL_NOVERS (get_wd_exp_mode)
 
 EXPORT_SYMBOL_NOVERS (set_wd_autoreset)
 
 EXPORT_SYMBOL_NOVERS (get_wd_autoreset)
 
 EXPORT_SYMBOL_NOVERS (set_tpl)
 
 EXPORT_SYMBOL_NOVERS (get_tpl)
 
 EXPORT_SYMBOL_NOVERS (set_bp_hw_reset)
 
 EXPORT_SYMBOL_NOVERS (get_bp_hw_reset)
 
 EXPORT_SYMBOL_NOVERS (get_bypass_info)
 
 module_init (init_lib_module)
 
 module_exit (cleanup_lib_module)
 

Macro Definition Documentation

#define bp_symbol_get (   fn_name)    symbol_get(fn_name)

Definition at line 83 of file bypass.c.

#define bp_symbol_put (   fn_name)    symbol_put(fn_name)

Definition at line 84 of file bypass.c.

#define DO_BPLIB_GET_ARG_FN (   fn_name,
  ioctl_val,
  if_index 
)
Value:
({ int data, ret=0; \
if(is_dev_sd(if_index)){ \
SET_BPLIB_INT_FN(fn_name, int, if_index, ret); \
return ret; \
} \
return doit(ioctl_val,if_index, &data); \
})

Definition at line 112 of file bypass.c.

#define DO_BPLIB_SET_ARG_FN (   fn_name,
  ioctl_val,
  if_index,
  arg 
)
Value:
({ int data, ret=0; \
if(is_dev_sd(if_index)){ \
SET_BPLIB_INT_FN2(fn_name, int, if_index, int, arg, ret); \
return ret; \
} \
return doit(ioctl_val,if_index, &data); \
})

Definition at line 121 of file bypass.c.

#define MOD_NAME   "bypass"

Definition at line 36 of file bypass.c.

#define SET_BPLIB_INT_FN (   fn_name,
  arg_type,
  arg,
  ret 
)
Value:
({ int (* fn_ex)(arg_type)=NULL; \
fn_ex=bp_symbol_get(fn_name##_sd); \
if(fn_ex) { \
ret= fn_ex(arg); \
bp_symbol_put(fn_name##_sd); \
} else ret=-1; \
})

Definition at line 86 of file bypass.c.

#define SET_BPLIB_INT_FN2 (   fn_name,
  arg_type,
  arg,
  arg_type1,
  arg1,
  ret 
)
Value:
({ int (* fn_ex)(arg_type,arg_type1)=NULL; \
fn_ex=bp_symbol_get(fn_name##_sd); \
if(fn_ex) { \
ret= fn_ex(arg,arg1); \
bp_symbol_put(fn_name##_sd); \
} else ret=-1; \
})

Definition at line 95 of file bypass.c.

#define SET_BPLIB_INT_FN3 (   fn_name,
  arg_type,
  arg,
  arg_type1,
  arg1,
  arg_type2,
  arg2,
  ret 
)
Value:
({ int (* fn_ex)(arg_type,arg_type1, arg_type2)=NULL; \
fn_ex=bp_symbol_get(fn_name##_sd); \
if(fn_ex) { \
ret= fn_ex(arg,arg1,arg2); \
bp_symbol_put(fn_name##_sd); \
} else ret=-1; \
})

Definition at line 103 of file bypass.c.

#define VERSION   "\n"MOD_NAME" version 9.0.4\n"

Definition at line 38 of file bypass.c.

Function Documentation

void cleanup_lib_module ( void  )

Definition at line 479 of file bypass.c.

EXPORT_SYMBOL_NOVERS ( is_bypass  )
EXPORT_SYMBOL_NOVERS ( get_bypass_slave  )
EXPORT_SYMBOL_NOVERS ( get_bypass_caps  )
EXPORT_SYMBOL_NOVERS ( get_wd_set_caps  )
EXPORT_SYMBOL_NOVERS ( set_bypass  )
EXPORT_SYMBOL_NOVERS ( get_bypass  )
EXPORT_SYMBOL_NOVERS ( get_bypass_change  )
EXPORT_SYMBOL_NOVERS ( set_dis_bypass  )
EXPORT_SYMBOL_NOVERS ( get_dis_bypass  )
EXPORT_SYMBOL_NOVERS ( set_bypass_pwoff  )
EXPORT_SYMBOL_NOVERS ( get_bypass_pwoff  )
EXPORT_SYMBOL_NOVERS ( set_bypass_pwup  )
EXPORT_SYMBOL_NOVERS ( get_bypass_pwup  )
EXPORT_SYMBOL_NOVERS ( set_bypass_wd  )
EXPORT_SYMBOL_NOVERS ( get_bypass_wd  )
EXPORT_SYMBOL_NOVERS ( get_wd_expire_time  )
EXPORT_SYMBOL_NOVERS ( reset_bypass_wd_timer  )
EXPORT_SYMBOL_NOVERS ( set_std_nic  )
EXPORT_SYMBOL_NOVERS ( get_std_nic  )
EXPORT_SYMBOL_NOVERS ( set_tx  )
EXPORT_SYMBOL_NOVERS ( get_tx  )
EXPORT_SYMBOL_NOVERS ( set_tap  )
EXPORT_SYMBOL_NOVERS ( get_tap  )
EXPORT_SYMBOL_NOVERS ( get_tap_change  )
EXPORT_SYMBOL_NOVERS ( set_dis_tap  )
EXPORT_SYMBOL_NOVERS ( get_dis_tap  )
EXPORT_SYMBOL_NOVERS ( set_tap_pwup  )
EXPORT_SYMBOL_NOVERS ( get_tap_pwup  )
EXPORT_SYMBOL_NOVERS ( set_bp_disc  )
EXPORT_SYMBOL_NOVERS ( get_bp_disc  )
EXPORT_SYMBOL_NOVERS ( get_bp_disc_change  )
EXPORT_SYMBOL_NOVERS ( set_bp_dis_disc  )
EXPORT_SYMBOL_NOVERS ( get_bp_dis_disc  )
EXPORT_SYMBOL_NOVERS ( set_bp_disc_pwup  )
EXPORT_SYMBOL_NOVERS ( get_bp_disc_pwup  )
EXPORT_SYMBOL_NOVERS ( set_wd_exp_mode  )
EXPORT_SYMBOL_NOVERS ( get_wd_exp_mode  )
EXPORT_SYMBOL_NOVERS ( set_wd_autoreset  )
EXPORT_SYMBOL_NOVERS ( get_wd_autoreset  )
EXPORT_SYMBOL_NOVERS ( set_tpl  )
EXPORT_SYMBOL_NOVERS ( get_tpl  )
EXPORT_SYMBOL_NOVERS ( set_bp_hw_reset  )
EXPORT_SYMBOL_NOVERS ( get_bp_hw_reset  )
EXPORT_SYMBOL_NOVERS ( get_bypass_info  )
int get_bp_dis_disc ( int  if_index)

Definition at line 378 of file bypass.c.

int get_bp_disc ( int  if_index)

Definition at line 363 of file bypass.c.

int get_bp_disc_change ( int  if_index)

Definition at line 368 of file bypass.c.

int get_bp_disc_pwup ( int  if_index)

Definition at line 389 of file bypass.c.

int get_bp_hw_reset ( int  if_index)

Definition at line 429 of file bypass.c.

int get_bypass ( int  if_index)

Definition at line 213 of file bypass.c.

int get_bypass_caps ( int  if_index)

Definition at line 198 of file bypass.c.

int get_bypass_change ( int  if_index)

Definition at line 218 of file bypass.c.

int get_bypass_info ( int  if_index,
struct bp_info bp_info 
)

Definition at line 434 of file bypass.c.

int get_bypass_pwoff ( int  if_index)

Definition at line 240 of file bypass.c.

int get_bypass_pwup ( int  if_index)

Definition at line 251 of file bypass.c.

int get_bypass_slave ( int  if_index)

Definition at line 193 of file bypass.c.

int get_bypass_wd ( int  if_index,
int ms_timeout_set 
)

Definition at line 272 of file bypass.c.

int get_dis_bypass ( int  if_index)

Definition at line 229 of file bypass.c.

int get_dis_tap ( int  if_index)

Definition at line 343 of file bypass.c.

int get_std_nic ( int  if_index)

Definition at line 308 of file bypass.c.

int get_tap ( int  if_index)

Definition at line 328 of file bypass.c.

int get_tap_change ( int  if_index)

Definition at line 333 of file bypass.c.

int get_tap_pwup ( int  if_index)

Definition at line 353 of file bypass.c.

int get_tpl ( int  if_index)

Definition at line 419 of file bypass.c.

int get_tx ( int  if_index)

Definition at line 318 of file bypass.c.

int get_wd_autoreset ( int  if_index)

Definition at line 409 of file bypass.c.

int get_wd_exp_mode ( int  if_index)

Definition at line 399 of file bypass.c.

int get_wd_expire_time ( int  if_index,
int ms_time_left 
)

Definition at line 283 of file bypass.c.

int get_wd_set_caps ( int  if_index)

Definition at line 203 of file bypass.c.

int init_lib_module ( void  )

Definition at line 472 of file bypass.c.

int is_bypass ( int  if_index)

Definition at line 183 of file bypass.c.

int is_bypass_dev ( int  if_index)

Definition at line 138 of file bypass.c.

MODULE_AUTHOR ( "www.silicom.co.il"  )
module_exit ( cleanup_lib_module  )
module_init ( init_lib_module  )
MODULE_LICENSE ( "GPL"  )
int reset_bypass_wd_timer ( int  if_index)

Definition at line 297 of file bypass.c.

int set_bp_dis_disc ( int  if_index,
int  dis_disc 
)

Definition at line 373 of file bypass.c.

int set_bp_disc ( int  if_index,
int  disc_mode 
)

Definition at line 358 of file bypass.c.

int set_bp_disc_pwup ( int  if_index,
int  disc_mode 
)

Definition at line 383 of file bypass.c.

int set_bp_hw_reset ( int  if_index,
int  mode 
)

Definition at line 424 of file bypass.c.

int set_bypass ( int  if_index,
int  bypass_mode 
)

Definition at line 208 of file bypass.c.

int set_bypass_pwoff ( int  if_index,
int  bypass_mode 
)

Definition at line 234 of file bypass.c.

int set_bypass_pwup ( int  if_index,
int  bypass_mode 
)

Definition at line 245 of file bypass.c.

int set_bypass_wd ( int  if_index,
int  ms_timeout,
int ms_timeout_set 
)

Definition at line 256 of file bypass.c.

int set_dis_bypass ( int  if_index,
int  dis_bypass 
)

Definition at line 223 of file bypass.c.

int set_dis_tap ( int  if_index,
int  dis_tap 
)

Definition at line 338 of file bypass.c.

int set_std_nic ( int  if_index,
int  bypass_mode 
)

Definition at line 303 of file bypass.c.

int set_tap ( int  if_index,
int  tap_mode 
)

Definition at line 323 of file bypass.c.

int set_tap_pwup ( int  if_index,
int  tap_mode 
)

Definition at line 348 of file bypass.c.

int set_tpl ( int  if_index,
int  tpl_mode 
)

Definition at line 414 of file bypass.c.

int set_tx ( int  if_index,
int  tx_state 
)

Definition at line 313 of file bypass.c.

int set_wd_autoreset ( int  if_index,
int  time 
)

Definition at line 404 of file bypass.c.

int set_wd_exp_mode ( int  if_index,
int  mode 
)

Definition at line 394 of file bypass.c.