Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
ipath_sysfs.c File Reference
#include <linux/ctype.h>
#include <linux/stat.h>
#include "ipath_kernel.h"
#include "ipath_verbs.h"
#include "ipath_common.h"

Go to the source code of this file.

Macros

#define DEVICE_COUNTER(name, attr)
 

Functions

int ipath_parse_ushort (const char *str, unsigned short *valp)
 
 DEVICE_COUNTER (ib_link_downeds, IBLinkDownedCnt)
 
 DEVICE_COUNTER (ib_link_err_recoveries, IBLinkErrRecoveryCnt)
 
 DEVICE_COUNTER (ib_status_changes, IBStatusChangeCnt)
 
 DEVICE_COUNTER (ib_symbol_errs, IBSymbolErrCnt)
 
 DEVICE_COUNTER (lb_flow_stalls, LBFlowStallCnt)
 
 DEVICE_COUNTER (lb_ints, LBIntCnt)
 
 DEVICE_COUNTER (rx_bad_formats, RxBadFormatCnt)
 
 DEVICE_COUNTER (rx_buf_ovfls, RxBufOvflCnt)
 
 DEVICE_COUNTER (rx_data_pkts, RxDataPktCnt)
 
 DEVICE_COUNTER (rx_dropped_pkts, RxDroppedPktCnt)
 
 DEVICE_COUNTER (rx_dwords, RxDwordCnt)
 
 DEVICE_COUNTER (rx_ebps, RxEBPCnt)
 
 DEVICE_COUNTER (rx_flow_ctrl_errs, RxFlowCtrlErrCnt)
 
 DEVICE_COUNTER (rx_flow_pkts, RxFlowPktCnt)
 
 DEVICE_COUNTER (rx_icrc_errs, RxICRCErrCnt)
 
 DEVICE_COUNTER (rx_len_errs, RxLenErrCnt)
 
 DEVICE_COUNTER (rx_link_problems, RxLinkProblemCnt)
 
 DEVICE_COUNTER (rx_lpcrc_errs, RxLPCRCErrCnt)
 
 DEVICE_COUNTER (rx_max_min_len_errs, RxMaxMinLenErrCnt)
 
 DEVICE_COUNTER (rx_p0_hdr_egr_ovfls, RxP0HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p1_hdr_egr_ovfls, RxP1HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p2_hdr_egr_ovfls, RxP2HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p3_hdr_egr_ovfls, RxP3HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p4_hdr_egr_ovfls, RxP4HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p5_hdr_egr_ovfls, RxP5HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p6_hdr_egr_ovfls, RxP6HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p7_hdr_egr_ovfls, RxP7HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_p8_hdr_egr_ovfls, RxP8HdrEgrOvflCnt)
 
 DEVICE_COUNTER (rx_pkey_mismatches, RxPKeyMismatchCnt)
 
 DEVICE_COUNTER (rx_tid_full_errs, RxTIDFullErrCnt)
 
 DEVICE_COUNTER (rx_tid_valid_errs, RxTIDValidErrCnt)
 
 DEVICE_COUNTER (rx_vcrc_errs, RxVCRCErrCnt)
 
 DEVICE_COUNTER (tx_data_pkts, TxDataPktCnt)
 
 DEVICE_COUNTER (tx_dropped_pkts, TxDroppedPktCnt)
 
 DEVICE_COUNTER (tx_dwords, TxDwordCnt)
 
 DEVICE_COUNTER (tx_flow_pkts, TxFlowPktCnt)
 
 DEVICE_COUNTER (tx_flow_stalls, TxFlowStallCnt)
 
 DEVICE_COUNTER (tx_len_errs, TxLenErrCnt)
 
 DEVICE_COUNTER (tx_max_min_len_errs, TxMaxMinLenErrCnt)
 
 DEVICE_COUNTER (tx_underruns, TxUnderrunCnt)
 
 DEVICE_COUNTER (tx_unsup_vl_errs, TxUnsupVLErrCnt)
 
int ipath_expose_reset (struct device *dev)
 
int ipath_device_create_group (struct device *dev, struct ipath_devdata *dd)
 
void ipath_device_remove_group (struct device *dev, struct ipath_devdata *dd)
 

Variables

struct attribute_groupipath_driver_attr_groups []
 

Macro Definition Documentation

#define DEVICE_COUNTER (   name,
  attr 
)
Value:
static ssize_t show_counter_##name(struct device *dev, \
char *buf) \
{ \
return scnprintf(\
buf, PAGE_SIZE, "%llu\n", (unsigned long long) \
attr) / sizeof(u64))); \
} \
static DEVICE_ATTR(name, S_IRUGO, show_counter_##name, NULL);

Definition at line 433 of file ipath_sysfs.c.

Function Documentation

DEVICE_COUNTER ( ib_link_downeds  ,
IBLinkDownedCnt   
)
DEVICE_COUNTER ( ib_link_err_recoveries  ,
IBLinkErrRecoveryCnt   
)
DEVICE_COUNTER ( ib_status_changes  ,
IBStatusChangeCnt   
)
DEVICE_COUNTER ( ib_symbol_errs  ,
IBSymbolErrCnt   
)
DEVICE_COUNTER ( lb_flow_stalls  ,
LBFlowStallCnt   
)
DEVICE_COUNTER ( lb_ints  ,
LBIntCnt   
)
DEVICE_COUNTER ( rx_bad_formats  ,
RxBadFormatCnt   
)
DEVICE_COUNTER ( rx_buf_ovfls  ,
RxBufOvflCnt   
)
DEVICE_COUNTER ( rx_data_pkts  ,
RxDataPktCnt   
)
DEVICE_COUNTER ( rx_dropped_pkts  ,
RxDroppedPktCnt   
)
DEVICE_COUNTER ( rx_dwords  ,
RxDwordCnt   
)
DEVICE_COUNTER ( rx_ebps  ,
RxEBPCnt   
)
DEVICE_COUNTER ( rx_flow_ctrl_errs  ,
RxFlowCtrlErrCnt   
)
DEVICE_COUNTER ( rx_flow_pkts  ,
RxFlowPktCnt   
)
DEVICE_COUNTER ( rx_icrc_errs  ,
RxICRCErrCnt   
)
DEVICE_COUNTER ( rx_len_errs  ,
RxLenErrCnt   
)
DEVICE_COUNTER ( rx_link_problems  ,
RxLinkProblemCnt   
)
DEVICE_COUNTER ( rx_lpcrc_errs  ,
RxLPCRCErrCnt   
)
DEVICE_COUNTER ( rx_max_min_len_errs  ,
RxMaxMinLenErrCnt   
)
DEVICE_COUNTER ( rx_p0_hdr_egr_ovfls  ,
RxP0HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p1_hdr_egr_ovfls  ,
RxP1HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p2_hdr_egr_ovfls  ,
RxP2HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p3_hdr_egr_ovfls  ,
RxP3HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p4_hdr_egr_ovfls  ,
RxP4HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p5_hdr_egr_ovfls  ,
RxP5HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p6_hdr_egr_ovfls  ,
RxP6HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p7_hdr_egr_ovfls  ,
RxP7HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_p8_hdr_egr_ovfls  ,
RxP8HdrEgrOvflCnt   
)
DEVICE_COUNTER ( rx_pkey_mismatches  ,
RxPKeyMismatchCnt   
)
DEVICE_COUNTER ( rx_tid_full_errs  ,
RxTIDFullErrCnt   
)
DEVICE_COUNTER ( rx_tid_valid_errs  ,
RxTIDValidErrCnt   
)
DEVICE_COUNTER ( rx_vcrc_errs  ,
RxVCRCErrCnt   
)
DEVICE_COUNTER ( tx_data_pkts  ,
TxDataPktCnt   
)
DEVICE_COUNTER ( tx_dropped_pkts  ,
TxDroppedPktCnt   
)
DEVICE_COUNTER ( tx_dwords  ,
TxDwordCnt   
)
DEVICE_COUNTER ( tx_flow_pkts  ,
TxFlowPktCnt   
)
DEVICE_COUNTER ( tx_flow_stalls  ,
TxFlowStallCnt   
)
DEVICE_COUNTER ( tx_len_errs  ,
TxLenErrCnt   
)
DEVICE_COUNTER ( tx_max_min_len_errs  ,
TxMaxMinLenErrCnt   
)
DEVICE_COUNTER ( tx_underruns  ,
TxUnderrunCnt   
)
DEVICE_COUNTER ( tx_unsup_vl_errs  ,
TxUnsupVLErrCnt   
)
int ipath_device_create_group ( struct device dev,
struct ipath_devdata dd 
)

Definition at line 1186 of file ipath_sysfs.c.

void ipath_device_remove_group ( struct device dev,
struct ipath_devdata dd 
)

Definition at line 1225 of file ipath_sysfs.c.

int ipath_expose_reset ( struct device dev)

ipath_expose_reset - create a device reset file : the device structure

Only expose a file that lets us reset the device after someone enters diag mode. A device reset is quite likely to crash the machine entirely, so we don't want to normally make it available.

Called with ipath_mutex held.

Definition at line 1171 of file ipath_sysfs.c.

int ipath_parse_ushort ( const char str,
unsigned short valp 
)

ipath_parse_ushort - parse an unsigned short value in an arbitrary base : the string containing the number : where to put the result

returns the number of bytes consumed, or negative value on error

Definition at line 48 of file ipath_sysfs.c.

Variable Documentation

struct attribute_group* ipath_driver_attr_groups[]
Initial value:
= {
&driver_attr_group,
}

Definition at line 1074 of file ipath_sysfs.c.