linux/net/can/proc.c
<<
on> /spa8.1 /form.1 a on> href="../linux+v3.7.4/net/can/proc.c">on> img src="../.static/gfx/right.png" alt=">>">on /spa8.1on spa8 class="lxr_search">on> on> input typ4on> input typ4on> buttv3.typ4Search onclick="return ajax_prefs();">on> Prefs1 /a>on /spa8.1> /div.1> form ac4.18="ajax+*" method="post" onsubmit="return false;">on input typ4o> /form.1o> div class="headingbottvm"> div id /div.1 div id1 div id 1 /a> spa8 class="comment">/* /spa8.1 2 /a> spa8 class="comment"> * proc.c - procfs support for Protocol family CAN core module /spa8.1 3 /a> spa8 class="comment"> * /spa8.1 4 /a> spa8 class="comment"> * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 5 /a> spa8 class="comment"> * All rights reserved. 6 /a> spa8 class="comment"> * /spa8.1 7 /a> spa8 class="comment"> * Redistribut v3.and use in source.and binary forms, with or without /spa8.1 8 /a> spa8 class="comment"> * modificat v3, are permitted provided that the following condit v3s /spa8.1 9 /a> spa8 class="comment"> * are met: /spa8.1 lue=a> spa8 class="comment"> * 1. Redistribut v3s of source.code must retain the above.copyright /spa8.1 11 /a> spa8 class="comment"> * notice, this list of condit v3s.and the following disclaimer. 12 /a> spa8 class="comment"> * 2. Redistribut v3s in binary form must reproduce.the above.copyright /spa8.1 13 /a> spa8 class="comment"> * notice, this list of condit v3s.and the following disclaimer in the /spa8.1 14 /a> spa8 class="comment"> * documentat v3.and/or other materials provided with the distribut v3. 15 /a> spa8 class="comment"> * 3. Neither the nam4 of Volkswagen nor the nam4s of its contributors /spa8.1 16 /a> spa8 class="comment"> * may be used to endorse or promote products derived from this software /spa8.1 17 /a> spa8 class="comment"> * without specific prior written permiss v3. 18 /a> spa8 class="comment"> * 19 /a> spa8 class="comment"> * Alternat vely, provided that this notice is retained in full, this /spa8.1 2ue=a> spa8 class="comment"> * software may be distributed under the terms of the GNU General /spa8.1 21 /a> spa8 class="comment"> * Public License ("GPL") vers v3 2, in which case.the provis v3s of the /spa8.1 22 /a> spa8 class="comment"> * GPL apply INSTEAD OF those.g ven above. 23 /a> spa8 class="comment"> * /spa8.1 24 /a> spa8 class="comment"> * The provided data structures.and external interfaces.from this code /spa8.1 25 /a> spa8 class="comment"> * are not restricted to be used by modules with a GPL compat ble license. 26 /a> spa8 class="comment"> * /spa8.1 27 /a> spa8 class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS /spa8.1 28 /a> spa8 class="comment"> * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT /spa8.1 29 /a> spa8 class="comment"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR /spa8.1 3ue=a> spa8 class="comment"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT /spa8.1 31 /a> spa8 class="comment"> * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, /spa8.1 32 /a> spa8 class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT /spa8.1 33 /a> spa8 class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, /spa8.1 34 /a> spa8 class="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY /spa8.1 35 /a> spa8 class="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT /spa8.1 36 /a> spa8 class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE /spa8.1 37 /a> spa8 class="comment"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH /spa8.1 38 /a> spa8 class="comment"> * DAMAGE. 39 /a> spa8 class="comment"> * /spa8.1 4ue=a> spa8 class="comment"> */ /spa8.1 41 /a>1 42 /a>#include <linux/module.h /a>>1 43 /a>#include <linux/proc_fs.h /a>>1 44 /a>#include <linux/list.h /a>>1 45 /a>#include <linux/rcupdate.h /a>>1 46 /a>#include <linux/if_arp.h /a>>1 47 /a>#include <linux/can/core.h /a>>1 48 /a>1 49 /a>#include "af_can.h /a>"1 50 /a>1 51 /a> spa8 class="comment">/* /spa8.1 52 /a> spa8 class="comment"> * proc filenam4s for the PF_CAN core /spa8.1 53 /a> spa8 class="comment"> */ /spa8.1 54 /a>1 55 /a>#define a href="+code=CAN_PROC_VERSION" class="sref">CAN_PROC_VERSION /a> spa8 class="string">"vers v3" 56 /a>#define a href="+code=CAN_PROC_STATS" class="sref">CAN_PROC_STATS /a> spa8 class="string">"stats" 57 /a>#define a href="+code=CAN_PROC_RESET_STATS" class="sref">CAN_PROC_RESET_STATS /a> spa8 class="string">"reset_stats" 58 /a>#define a href="+code=CAN_PROC_RCVLIST_ALL" class="sref">CAN_PROC_RCVLIST_ALL /a> spa8 class="string">"rcvlist_all" 59 /a>#define a href="+code=CAN_PROC_RCVLIST_FIL" class="sref">CAN_PROC_RCVLIST_FIL /a> spa8 class="string">"rcvlist_fil" 60 /a>#define a href="+code=CAN_PROC_RCVLIST_INV" class="sref">CAN_PROC_RCVLIST_INV /a> spa8 class="string">"rcvlist_inv" 61 /a>#define a href="+code=CAN_PROC_RCVLIST_SFF" class="sref">CAN_PROC_RCVLIST_SFF /a> spa8 class="string">"rcvlist_sff" 62 /a>#define a href="+code=CAN_PROC_RCVLIST_EFF" class="sref">CAN_PROC_RCVLIST_EFF /a> spa8 class="string">"rcvlist_eff" 63 /a>#define a href="+code=CAN_PROC_RCVLIST_ERR" class="sref">CAN_PROC_RCVLIST_ERR /a> spa8 class="string">"rcvlist_err" 64 /a>1 65 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=can_dir" class="sref">can_dir /a>;1 66 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_vers v3" class="sref">pde_vers v3 /a>;1 67 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_stats" class="sref">pde_stats /a>;1 68 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_reset_stats" class="sref">pde_reset_stats /a>;1 69 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_rcvlist_all" class="sref">pde_rcvlist_all /a>;1 70 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_rcvlist_fil" class="sref">pde_rcvlist_fil /a>;1 71 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_rcvlist_inv" class="sref">pde_rcvlist_inv /a>;1 72 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_rcvlist_sff" class="sref">pde_rcvlist_sff /a>;1 73 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_rcvlist_eff" class="sref">pde_rcvlist_eff /a>;1 74 /a>static struct a href="+code=proc_dir_entry" class="sref">proc_dir_entry /a> * a href="+code=pde_rcvlist_err" class="sref">pde_rcvlist_err /a>;1 75 /a>1 76 /a>static int a href="+code=user_reset" class="sref">user_reset /a>;1 77 /a>1 78 /a>static const char a href="+code=rx_list_nam4" class="sref">rx_list_nam4 /a>[][8] = {1 79 /a> [ a href="+code=RX_ERR" class="sref">RX_ERR /a>] = spa8 class="string">"rx_err" 80 /a> [ a href="+code=RX_ALL" class="sref">RX_ALL /a>] = spa8 class="string">"rx_all" 81 /a> [ a href="+code=RX_FIL" class="sref">RX_FIL /a>] = spa8 class="string">"rx_fil" 82 /a> [ a href="+code=RX_INV" class="sref">RX_INV /a>] = spa8 class="string">"rx_inv" 83 /a> [ a href="+code=RX_EFF" class="sref">RX_EFF /a>] = spa8 class="string">"rx_eff" 84 /a>};1 85 /a>1 86 /a> spa8 class="comment">/* /spa8.1 87 /a> spa8 class="comment"> * af_can statistics stuff /spa8.1 88 /a> spa8 class="comment"> */ /spa8.1 89 /a>1 90 /a>static void a href="+code=can_init_stats" class="sref">can_init_stats /a>(void)1 91 /a>{1 92 /a> spa8 class="comment">/* /spa8.1 93 /a> spa8 class="comment"> * This memset func4.18 is called from a timer context (when /spa8.1 94 /a> spa8 class="comment"> * can_stattimer is ac4.ve which is the default) OR in a process /spa8.1 95 /a> spa8 class="comment"> * context (reading.the proc_fs when can_stattimer is disabled). 96 /a> spa8 class="comment"> */ /spa8.1 97 /a> a href="+code=memset" class="sref">memset /a>(& a href="+code=can_stats" class="sref">can_stats /a>, 0, sizeof( a href="+code=can_stats" class="sref">can_stats /a>));1 98 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=jiffies_init" class="sref">jiffies_init /a> = a href="+code=jiffies" class="sref">jiffies /a>;1 99 /a>1 100 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=stats_reset" class="sref">stats_reset /a>++;1 101 /a>1 102 /a> if ( a href="+code=user_reset" class="sref">user_reset /a>) {1 103 /a> a href="+code=user_reset" class="sref">user_reset /a> = 0;1 104 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=user_reset" class="sref">user_reset /a>++;1 105 /a> }1 106 /a>}1 107 /a>1 108 /a>static unsigned long. a href="+code=calc_rat4" class="sref">calc_rat4 /a>(unsigned long. a href="+code=oldjif" class="sref">oldjif /a>, unsigned long. a href="+code=newjif" class="sref">newjif /a>,1 109 /a> unsigned long. a href="+code=count" class="sref">count /a>)1 1lue=a>{1 111 /a> unsigned long. a href="+code=rat4" class="sref">rat4 /a>;1 112 /a>1 113 /a> if ( a href="+code=oldjif" class="sref">oldjif /a> == a href="+code=newjif" class="sref">newjif /a>)1 114 /a> return 0;1 115 /a>1 116 /a> spa8 class="comment">/* see can_stat_update() - this should NEVER happen! */ /spa8.1 117 /a> if ( a href="+code=count" class="sref">count /a> > ( a href="+code=ULONG_MAX" class="sref">ULONG_MAX /a> / a href="+code=HZ" class="sref">HZ /a>)) {1 118 /a> a href="+code=printk" class="sref">printk /a>( a href="+code=KERN_ERR" class="sref">KERN_ERR /a> spa8 class="string">"can: calc_rat4: count exceeded! %ld\n" 119 /a> a href="+code=count" class="sref">count /a>);1 120 /a> return 99999999;1 121 /a> }1 122 /a>1 123 /a> a href="+code=rat4" class="sref">rat4 /a> = ( a href="+code=count" class="sref">count /a> * a href="+code=HZ" class="sref">HZ /a>) / ( a href="+code=newjif" class="sref">newjif /a> - a href="+code=oldjif" class="sref">oldjif /a>);1 124 /a>1 125 /a> return a href="+code=rat4" class="sref">rat4 /a>;1 126 /a>}1 127 /a>1 128 /a>void a href="+code=can_stat_update" class="sref">can_stat_update /a>(unsigned long. a href="+code=data" class="sref">data /a>)1 129 /a>{1 130 /a> unsigned long. a href="+code=j" class="sref">j /a> = a href="+code=jiffies" class="sref">jiffies /a>; spa8 class="comment">/* snapshot */ /spa8.1 131 /a>1 132 /a> spa8 class="comment">/* restart counting.in timer context on user request */ /spa8.1 133 /a> if ( a href="+code=user_reset" class="sref">user_reset /a>)1 134 /a> a href="+code=can_init_stats" class="sref">can_init_stats /a>();1 135 /a>1 136 /a> spa8 class="comment">/* restart counting.on jiffies overflow */ /spa8.1 137 /a> if ( a href="+code=j" class="sref">j /a> < a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=jiffies_init" class="sref">jiffies_init /a>)1 138 /a> a href="+code=can_init_stats" class="sref">can_init_stats /a>();1 139 /a>1 140 /a> spa8 class="comment">/* prevent overflow in calc_rat4() */ /spa8.1 141 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s" class="sref">rx_fram4s /a> > ( a href="+code=ULONG_MAX" class="sref">ULONG_MAX /a> / a href="+code=HZ" class="sref">HZ /a>))1 142 /a> a href="+code=can_init_stats" class="sref">can_init_stats /a>();1 143 /a>1 144 /a> spa8 class="comment">/* prevent overflow in calc_rat4() */ /spa8.1 145 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=tx_fram4s" class="sref">tx_fram4s /a> > ( a href="+code=ULONG_MAX" class="sref">ULONG_MAX /a> / a href="+code=HZ" class="sref">HZ /a>))1 146 /a> a href="+code=can_init_stats" class="sref">can_init_stats /a>();1 147 /a>1 148 /a> spa8 class="comment">/* matches overflow - very improbable */ /spa8.1 149 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=matches" class="sref">matches /a> > ( a href="+code=ULONG_MAX" class="sref">ULONG_MAX /a> / 100))1 150 /a> a href="+code=can_init_stats" class="sref">can_init_stats /a>();1 151 /a>1 152 /a> spa8 class="comment">/* calc total 184.4s */ /spa8.1 153 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s" class="sref">rx_fram4s /a>)1 154 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=total_rx_match_ratio" class="sref">total_rx_match_ratio /a> = ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=matches" class="sref">matches /a> * 100) /1 155 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s" class="sref">rx_fram4s /a>;1 156 /a>1 157 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=total_tx_rat4" class="sref">total_tx_rat4 /a> = a href="+code=calc_rat4" class="sref">calc_rat4 /a>( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=jiffies_init" class="sref">jiffies_init /a>,. a href="+code=j" class="sref">j /a>,1 158 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=tx_fram4s" class="sref">tx_fram4s /a>);1 159 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=total_rx_rat4" class="sref">total_rx_rat4 /a> = a href="+code=calc_rat4" class="sref">calc_rat4 /a>( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=jiffies_init" class="sref">jiffies_init /a>,. a href="+code=j" class="sref">j /a>,1 160 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s" class="sref">rx_fram4s /a>);1 161 /a>1 162 /a> spa8 class="comment">/* calc current 184.4s */ /spa8.1 163 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s_delta" class="sref">rx_fram4s_delta /a>)1 164 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_match_ratio" class="sref">current_rx_match_ratio /a> =1 165 /a> ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=matches_delta" class="sref">matches_delta /a> * 100) /1 166 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s_delta" class="sref">rx_fram4s_delta /a>;1 167 /a>1 168 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_tx_rat4" class="sref">current_tx_rat4 /a> = a href="+code=calc_rat4" class="sref">calc_rat4 /a>(0,. a href="+code=HZ" class="sref">HZ /a>,. a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=tx_fram4s_delta" class="sref">tx_fram4s_delta /a>);1 169 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_rat4" class="sref">current_rx_rat4 /a> = a href="+code=calc_rat4" class="sref">calc_rat4 /a>(0,. a href="+code=HZ" class="sref">HZ /a>,. a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s_delta" class="sref">rx_fram4s_delta /a>);1 170 /a>1 171 /a> spa8 class="comment">/* check / update maximum 184.4s */ /spa8.1 172 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_tx_rat4" class="sref">max_tx_rat4 /a> < a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_tx_rat4" class="sref">current_tx_rat4 /a>)1 173 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_tx_rat4" class="sref">max_tx_rat4 /a> = a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_tx_rat4" class="sref">current_tx_rat4 /a>;1 174 /a>1 175 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_rx_rat4" class="sref">max_rx_rat4 /a> < a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_rat4" class="sref">current_rx_rat4 /a>)1 176 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_rx_rat4" class="sref">max_rx_rat4 /a> = a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_rat4" class="sref">current_rx_rat4 /a>;1 177 /a>1 178 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_rx_match_ratio" class="sref">max_rx_match_ratio /a> < a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_match_ratio" class="sref">current_rx_match_ratio /a>)1 179 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_rx_match_ratio" class="sref">max_rx_match_ratio /a> = a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_match_ratio" class="sref">current_rx_match_ratio /a>;1 180 /a>1 181 /a> spa8 class="comment">/* clear 184.4s for 'current rat4' calculat v3.*/ /spa8.1 182 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=tx_fram4s_delta" class="sref">tx_fram4s_delta /a> = 0;1 183 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=rx_fram4s_delta" class="sref">rx_fram4s_delta /a> = 0;1 184 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=matches_delta" class="sref">matches_delta /a> = 0;1 185 /a>1 186 /a> spa8 class="comment">/* restart timer (one second) */ /spa8.1 187 /a> a href="+code=mod_timer" class="sref">mod_timer /a>(& a href="+code=can_stattimer" class="sref">can_stattimer /a>,. a href="+code=round_jiffies" class="sref">round_jiffies /a>( a href="+code=jiffies" class="sref">jiffies /a> + a href="+code=HZ" class="sref">HZ /a>));1 188 /a>}1 189 /a>1 19ue=a> spa8 class="comment">/* /spa8.1 191 /a> spa8 class="comment"> * proc read func4.18s /spa8.1 192 /a> spa8 class="comment"> */ /spa8.1 193 /a>1 194 /a>static void a href="+code=can_print_rcvlist" class="sref">can_print_rcvlist /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.struct a href="+code=hlist_head" class="sref">hlist_head /a> * a href="+code=rx_list" class="sref">rx_list /a>,1 195 /a> struct a href="+code=net_devic4" class="sref">net_devic4 /a> * a href="+code=dev" class="sref">dev /a>)1 196 /a>{1 197 /a> struct a href="+code=receiver" class="sref">receiver /a> * a href="+code=r" class="sref">r /a>;1 198 /a> struct a href="+code=hlist_node" class="sref">hlist_node /a> * a href="+code=3" class="sref">3 /a>;1 199 /a>1 200 /a> a href="+code=hlist_for_each_entry_rcu" class="sref">hlist_for_each_entry_rcu /a>( a href="+code=r" class="sref">r /a>,. a href="+code=3" class="sref">3 /a>,. a href="+code=rx_list" class="sref">rx_list /a>,. a href="+code=list" class="sref">list /a>) {1 201 /a> char * a href="+code=fmt" class="sref">fmt /a> = ( a href="+code=r" class="sref">r /a>-> a href="+code=can_id" class="sref">can_id /a> & a href="+code=CAN_EFF_FLAG" class="sref">CAN_EFF_FLAG /a>)?1 202 /a> spa8 class="string">" %-5s %08x %08x %pK %pK %8ld %s\n" 203 /a> spa8 class="string">" %-5s %03x %08x %pK %pK %8ld %s\n" 204 /a>1 205 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. a href="+code=fmt" class="sref">fmt /a>,. a href="+code=DNAME" class="sref">DNAME /a>( a href="+code=dev" class="sref">dev /a>),. a href="+code=r" class="sref">r /a>-> a href="+code=can_id" class="sref">can_id /a>,. a href="+code=r" class="sref">r /a>-> a href="+code=mask" class="sref">mask /a>,1 206 /a> a href="+code=r" class="sref">r /a>-> a href="+code=func" class="sref">func /a>,. a href="+code=r" class="sref">r /a>-> a href="+code=data" class="sref">data /a>,. a href="+code=r" class="sref">r /a>-> a href="+code=matches" class="sref">matches /a>,. a href="+code=r" class="sref">r /a>-> a href="+code=ident" class="sref">ident /a>);1 207 /a> }1 208 /a>}1 209 /a>1 210 /a>static void a href="+code=can_print_recv_banner" class="sref">can_print_recv_banner /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>)1 211 /a>{1 212 /a> spa8 class="comment">/* /spa8.1 213 /a> spa8 class="comment"> * can1. 00000000 00000000 00000000 /spa8.1 214 /a> spa8 class="comment"> * ....... 0 tp20 /spa8.1 215 /a> spa8 class="comment"> */ /spa8.1 216 /a> a href="+code=seq_puts" class="sref">seq_puts /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" devic4 can_id can_mask func4.18" 217 /a> spa8 class="string">" userdata matches ident\n" 218 /a>}1 219 /a>1 220 /a>static int a href="+code=can_stats_proc_show" class="sref">can_stats_proc_show /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.void * a href="+code=v" class="sref">v /a>)1 221 /a>{1 222 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 223 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld transmitted fram4s (TXF)\n"can_stats /a>. a href="+code=tx_fram4s" class="sref">tx_fram4s /a>);1 224 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld received fram4s (RXF)\n"can_stats /a>. a href="+code=rx_fram4s" class="sref">rx_fram4s /a>);1 225 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld matched fram4s (RXMF)\n"can_stats /a>. a href="+code=matches" class="sref">matches /a>);1 226 /a>1 227 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 228 /a>1 229 /a> if ( a href="+code=can_stattimer" class="sref">can_stattimer /a>. a href="+code=func4.18" class="sref">funct v3 /a> == a href="+code=can_stat_update" class="sref">can_stat_update /a>) {1 230 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld %% total match ratio (RXMR)\n" 231 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=total_rx_match_ratio" class="sref">total_rx_match_ratio /a>);1 232 /a>1 233 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld fram4s/s total tx rat4 (TXR)\n" 234 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=total_tx_rat4" class="sref">total_tx_rat4 /a>);1 235 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld fram4s/s total rx rat4 (RXR)\n" 236 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=total_rx_rat4" class="sref">total_rx_rat4 /a>);1 237 /a>1 238 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 239 /a>1 240 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld %% current match ratio (CRXMR)\n" 241 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_match_ratio" class="sref">current_rx_match_ratio /a>);1 242 /a>1 243 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld fram4s/s current tx rat4 (CTXR)\n" 244 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_tx_rat4" class="sref">current_tx_rat4 /a>);1 245 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld fram4s/s current rx rat4 (CRXR)\n" 246 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=current_rx_rat4" class="sref">current_rx_rat4 /a>);1 247 /a>1 248 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 249 /a>1 250 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld %% max match ratio (MRXMR)\n" 251 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_rx_match_ratio" class="sref">max_rx_match_ratio /a>);1 252 /a>1 253 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld fram4s/s max tx rat4 (MTXR)\n" 254 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_tx_rat4" class="sref">max_tx_rat4 /a>);1 255 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld fram4s/s max rx rat4 (MRXR)\n" 256 /a> a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=max_rx_rat4" class="sref">max_rx_rat4 /a>);1 257 /a>1 258 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 259 /a> }1 260 /a>1 261 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld current receive list entries (CRCV)\n" 262 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=rcv_entries" class="sref">rcv_entries /a>);1 263 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld maximum receive list entries (MRCV)\n" 264 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=rcv_entries_max" class="sref">rcv_entries_max /a>);1 265 /a>1 266 /a> if ( a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=stats_reset" class="sref">stats_reset /a>)1 267 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">"\n %8ld statistic resets (STR)\n" 268 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=stats_reset" class="sref">stats_reset /a>);1 269 /a>1 270 /a> if ( a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=user_reset" class="sref">user_reset /a>)1 271 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" %8ld user statistic resets (USTR)\n" 272 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=user_reset" class="sref">user_reset /a>);1 273 /a>1 274 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 275 /a> return 0;1 276 /a>}1 277 /a>1 278 /a>static int a href="+code=can_stats_proc_ope8" class="sref">can_stats_proc_ope8 /a>(struct a href="+code=inode" class="sref">inode /a> * a href="+code=inode" class="sref">inode /a>,.struct a href="+code=fil4" class="sref">fil4 /a> * a href="+code=fil4" class="sref">fil4 /a>)1 279 /a>{1 280 /a> return a href="+code=single_ope8" class="sref">single_ope8 /a>( a href="+code=fil4" class="sref">fil4 /a>, a href="+code=can_stats_proc_show" class="sref">can_stats_proc_show /a>, a href="+code=NULL" class="sref">NULL /a>);1 281 /a>}1 282 /a>1 283 /a>static const struct a href="+code=fil4_operations" class="sref">fil4_operations /a> a href="+code=can_stats_proc_fops" class="sref">can_stats_proc_fops /a> = {1 284 /a> . a href="+code=owner" class="sref">owner /a> = a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,1 285 /a> . a href="+code=ope8" class="sref">ope8 /a> = a href="+code=can_stats_proc_ope8" class="sref">can_stats_proc_ope8 /a>,1 286 /a> . a href="+code=read" class="sref">read /a> = a href="+code=seq_read" class="sref">seq_read /a>,1 287 /a> . a href="+code=llseek" class="sref">llseek /a> = a href="+code=seq_lseek" class="sref">seq_lseek /a>,1 288 /a> . a href="+code=releas4" class="sref">releas4 /a> = a href="+code=single_releas4" class="sref">single_releas4 /a>,1 289 /a>};1 290 /a>1 291 /a>static int a href="+code=can_reset_stats_proc_show" class="sref">can_reset_stats_proc_show /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.void * a href="+code=v" class="sref">v /a>)1 292 /a>{1 293 /a> a href="+code=user_reset" class="sref">user_reset /a> = 1;1 294 /a>1 295 /a> if ( a href="+code=can_stattimer" class="sref">can_stattimer /a>. a href="+code=func4.18" class="sref">funct v3 /a> == a href="+code=can_stat_update" class="sref">can_stat_update /a>) {1 296 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">"Scheduled statistic reset #%ld.\n" 297 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=stats_reset" class="sref">stats_reset /a> + 1);1 298 /a>1 299 /a> } else {1 300 /a> if ( a href="+code=can_stats" class="sref">can_stats /a>. a href="+code=jiffies_init" class="sref">jiffies_init /a> != a href="+code=jiffies" class="sref">jiffies /a>)1 301 /a> a href="+code=can_init_stats" class="sref">can_init_stats /a>();1 302 /a>1 303 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">"Performed statistic reset #%ld.\n" 304 /a> a href="+code=can_pstats" class="sref">can_pstats /a>. a href="+code=stats_reset" class="sref">stats_reset /a>);1 305 /a> }1 306 /a> return 0;1 307 /a>}1 308 /a>1 309 /a>static int a href="+code=can_reset_stats_proc_ope8" class="sref">can_reset_stats_proc_ope8 /a>(struct a href="+code=inode" class="sref">inode /a> * a href="+code=inode" class="sref">inode /a>,.struct a href="+code=fil4" class="sref">fil4 /a> * a href="+code=fil4" class="sref">fil4 /a>)1 310 /a>{1 311 /a> return a href="+code=single_ope8" class="sref">single_ope8 /a>( a href="+code=fil4" class="sref">fil4 /a>, a href="+code=can_reset_stats_proc_show" class="sref">can_reset_stats_proc_show /a>, a href="+code=NULL" class="sref">NULL /a>);1 312 /a>}1 313 /a>1 314 /a>static const struct a href="+code=fil4_operations" class="sref">fil4_operations /a> a href="+code=can_reset_stats_proc_fops" class="sref">can_reset_stats_proc_fops /a> = {1 315 /a> . a href="+code=owner" class="sref">owner /a> = a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,1 316 /a> . a href="+code=ope8" class="sref">ope8 /a> = a href="+code=can_reset_stats_proc_ope8" class="sref">can_reset_stats_proc_ope8 /a>,1 317 /a> . a href="+code=read" class="sref">read /a> = a href="+code=seq_read" class="sref">seq_read /a>,1 318 /a> . a href="+code=llseek" class="sref">llseek /a> = a href="+code=seq_lseek" class="sref">seq_lseek /a>,1 319 /a> . a href="+code=releas4" class="sref">releas4 /a> = a href="+code=single_releas4" class="sref">single_releas4 /a>,1 320 /a>};1 321 /a>1 322 /a>static int a href="+code=can_version_proc_show" class="sref">can_version_proc_show /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.void * a href="+code=v" class="sref">v /a>)1 323 /a>{1 324 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">"%s\n"CAN_VERSION_STRING /a>);1 325 /a> return 0;1 326 /a>}1 327 /a>1 328 /a>static int a href="+code=can_version_proc_ope8" class="sref">can_version_proc_ope8 /a>(struct a href="+code=inode" class="sref">inode /a> * a href="+code=inode" class="sref">inode /a>,.struct a href="+code=fil4" class="sref">fil4 /a> * a href="+code=fil4" class="sref">fil4 /a>)1 329 /a>{1 330 /a> return a href="+code=single_ope8" class="sref">single_ope8 /a>( a href="+code=fil4" class="sref">fil4 /a>, a href="+code=can_version_proc_show" class="sref">can_version_proc_show /a>, a href="+code=NULL" class="sref">NULL /a>);1 331 /a>}1 332 /a>1 333 /a>static const struct a href="+code=fil4_operations" class="sref">fil4_operations /a> a href="+code=can_version_proc_fops" class="sref">can_version_proc_fops /a> = {1 334 /a> . a href="+code=owner" class="sref">owner /a> = a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,1 335 /a> . a href="+code=ope8" class="sref">ope8 /a> = a href="+code=can_version_proc_ope8" class="sref">can_version_proc_ope8 /a>,1 336 /a> . a href="+code=read" class="sref">read /a> = a href="+code=seq_read" class="sref">seq_read /a>,1 337 /a> . a href="+code=llseek" class="sref">llseek /a> = a href="+code=seq_lseek" class="sref">seq_lseek /a>,1 338 /a> . a href="+code=releas4" class="sref">releas4 /a> = a href="+code=single_releas4" class="sref">single_releas4 /a>,1 339 /a>};1 340 /a>1 341 /a>static a href="+code=inline" class="sref">inline /a> void a href="+code=can_rcvlist_proc_show_one" class="sref">can_rcvlist_proc_show_one /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.int a href="+code=idx" class="sref">idx /a>,1 342 /a> struct a href="+code=net_devic4" class="sref">net_devic4 /a> * a href="+code=dev" class="sref">dev /a>,1 343 /a> struct a href="+code=dev_rcv_lists" class="sref">dev_rcv_lists /a> * a href="+code=d" class="sref">d /a>)1 344 /a>{1 345 /a> if (! a href="+code=hlist_empty" class="sref">hlist_empty /a>(& a href="+code=d" class="sref">d /a>-> a href="+code=rx" class="sref">rx /a>[ a href="+code=idx" class="sref">idx /a>])) {1 346 /a> a href="+code=can_print_recv_banner" class="sref">can_print_recv_banner /a>( a href="+code=m" class="sref">m /a>);1 347 /a> a href="+code=can_print_rcvlist" class="sref">can_print_rcvlist /a>( a href="+code=m" class="sref">m /a>,.& a href="+code=d" class="sref">d /a>-> a href="+code=rx" class="sref">rx /a>[ a href="+code=idx" class="sref">idx /a>], a href="+code=dev" class="sref">dev /a>);1 348 /a> } else1 349 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" (%s: no entry)\n"DNAME /a>( a href="+code=dev" class="sref">dev /a>));1 350 /a>1 351 /a>}1 352 /a>1 353 /a>static int a href="+code=can_rcvlist_proc_show" class="sref">can_rcvlist_proc_show /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.void * a href="+code=v" class="sref">v /a>)1 354 /a>{1 355 /a> spa8 class="comment">/* double cast to prevent GCC warning */ /spa8.1 356 /a> int a href="+code=idx" class="sref">idx /a> = (int)(long) a href="+code=m" class="sref">m /a>-> a href="+code=private" class="sref">private /a>;1 357 /a> struct a href="+code=net_devic4" class="sref">net_devic4 /a> * a href="+code=dev" class="sref">dev /a>;1 358 /a> struct a href="+code=dev_rcv_lists" class="sref">dev_rcv_lists /a> * a href="+code=d" class="sref">d /a>;1 359 /a>1 360 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">"\nreceive list '%s':\n"rx_list_nam4 /a>[ a href="+code=idx" class="sref">idx /a>]);1 361 /a>1 362 /a> a href="+code=rcu_read_lock" class="sref">rcu_read_lock /a>();1 363 /a>1 364 /a> spa8 class="comment">/* receive list for 'all' CAN devic4s (dev == NULL) */ /spa8.1 365 /a> a href="+code=d" class="sref">d /a> = & a href="+code=can_rx_alldev_list" class="sref">can_rx_alldev_list /a>;1 366 /a> a href="+code=can_rcvlist_proc_show_one" class="sref">can_rcvlist_proc_show_one /a>( a href="+code=m" class="sref">m /a>,. a href="+code=idx" class="sref">idx /a>, a href="+code=NULL" class="sref">NULL /a>, a href="+code=d" class="sref">d /a>);1 367 /a>1 368 /a> spa8 class="comment">/* receive list for registered CAN devic4s */ /spa8.1 369 /a> a href="+code=for_each_netdev_rcu" class="sref">for_each_netdev_rcu /a>(& a href="+code=init_net" class="sref">init_net /a>, a href="+code=dev" class="sref">dev /a>) {1 370 /a> if ( a href="+code=dev" class="sref">dev /a>-> a href="+code=type" class="sref">type /a> == a href="+code=ARPHRD_CAN" class="sref">ARPHRD_CAN /a> && a href="+code=dev" class="sref">dev /a>-> a href="+code=ml_priv" class="sref">ml_priv /a>)1 371 /a> a href="+code=can_rcvlist_proc_show_one" class="sref">can_rcvlist_proc_show_one /a>( a href="+code=m" class="sref">m /a>,. a href="+code=idx" class="sref">idx /a>, a href="+code=dev" class="sref">dev /a>, a href="+code=dev" class="sref">dev /a>-> a href="+code=ml_priv" class="sref">ml_priv /a>);1 372 /a> }1 373 /a>1 374 /a> a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock /a>();1 375 /a>1 376 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 377 /a> return 0;1 378 /a>}1 379 /a>1 380 /a>static int a href="+code=can_rcvlist_proc_ope8" class="sref">can_rcvlist_proc_ope8 /a>(struct a href="+code=inode" class="sref">inode /a> * a href="+code=inode" class="sref">inode /a>,.struct a href="+code=fil4" class="sref">fil4 /a> * a href="+code=fil4" class="sref">fil4 /a>)1 381 /a>{1 382 /a> return a href="+code=single_ope8" class="sref">single_ope8 /a>( a href="+code=fil4" class="sref">fil4 /a>, a href="+code=can_rcvlist_proc_show" class="sref">can_rcvlist_proc_show /a>, a href="+code=PDE" class="sref">PDE /a>( a href="+code=inode" class="sref">inode /a>)-> a href="+code=data" class="sref">data /a>);1 383 /a>}1 384 /a>1 385 /a>static const struct a href="+code=fil4_operations" class="sref">fil4_operations /a> a href="+code=can_rcvlist_proc_fops" class="sref">can_rcvlist_proc_fops /a> = {1 386 /a> . a href="+code=owner" class="sref">owner /a> = a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,1 387 /a> . a href="+code=ope8" class="sref">ope8 /a> = a href="+code=can_rcvlist_proc_ope8" class="sref">can_rcvlist_proc_ope8 /a>,1 388 /a> . a href="+code=read" class="sref">read /a> = a href="+code=seq_read" class="sref">seq_read /a>,1 389 /a> . a href="+code=llseek" class="sref">llseek /a> = a href="+code=seq_lseek" class="sref">seq_lseek /a>,1 390 /a> . a href="+code=releas4" class="sref">releas4 /a> = a href="+code=single_releas4" class="sref">single_releas4 /a>,1 391 /a>};1 392 /a>1 393 /a>static a href="+code=inline" class="sref">inline /a> void a href="+code=can_rcvlist_sff_proc_show_one" class="sref">can_rcvlist_sff_proc_show_one /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,1 394 /a> struct a href="+code=net_devic4" class="sref">net_devic4 /a> * a href="+code=dev" class="sref">dev /a>,1 395 /a> struct a href="+code=dev_rcv_lists" class="sref">dev_rcv_lists /a> * a href="+code=d" class="sref">d /a>)1 396 /a>{1 397 /a> int a href="+code=i" class="sref">i /a>;1 398 /a> int a href="+code=all_empty" class="sref">all_empty /a> = 1;1 399 /a>1 400 /a> spa8 class="comment">/* check wether at least one list is non-empty */ /spa8.1 401 /a> for ( a href="+code=i" class="sref">i /a> = 0; a href="+code=i" class="sref">i /a> < 0x800; a href="+code=i" class="sref">i /a>++)1 402 /a> if (! a href="+code=hlist_empty" class="sref">hlist_empty /a>(& a href="+code=d" class="sref">d /a>-> a href="+code=rx_sff" class="sref">rx_sff /a>[ a href="+code=i" class="sref">i /a>])) {1 403 /a> a href="+code=all_empty" class="sref">all_empty /a> = 0;1 404 /a> break;1 405 /a> }1 406 /a>1 407 /a> if (! a href="+code=all_empty" class="sref">all_empty /a>) {1 408 /a> a href="+code=can_print_recv_banner" class="sref">can_print_recv_banner /a>( a href="+code=m" class="sref">m /a>);1 409 /a> for ( a href="+code=i" class="sref">i /a> = 0; a href="+code=i" class="sref">i /a> < 0x800; a href="+code=i" class="sref">i /a>++) {1 410 /a> if (! a href="+code=hlist_empty" class="sref">hlist_empty /a>(& a href="+code=d" class="sref">d /a>-> a href="+code=rx_sff" class="sref">rx_sff /a>[ a href="+code=i" class="sref">i /a>]))1 411 /a> a href="+code=can_print_rcvlist" class="sref">can_print_rcvlist /a>( a href="+code=m" class="sref">m /a>,.& a href="+code=d" class="sref">d /a>-> a href="+code=rx_sff" class="sref">rx_sff /a>[ a href="+code=i" class="sref">i /a>], a href="+code=dev" class="sref">dev /a>);1 412 /a> }1 413 /a> } else1 414 /a> a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">" (%s: no entry)\n"DNAME /a>( a href="+code=dev" class="sref">dev /a>));1 415 /a>}1 416 /a>1 417 /a>static int a href="+code=can_rcvlist_sff_proc_show" class="sref">can_rcvlist_sff_proc_show /a>(struct a href="+code=seq_fil4" class="sref">seq_fil4 /a> * a href="+code=m" class="sref">m /a>,.void * a href="+code=v" class="sref">v /a>)1 418 /a>{1 419 /a> struct a href="+code=net_devic4" class="sref">net_devic4 /a> * a href="+code=dev" class="sref">dev /a>;1 420 /a> struct a href="+code=dev_rcv_lists" class="sref">dev_rcv_lists /a> * a href="+code=d" class="sref">d /a>;1 421 /a>1 422 /a> spa8 class="comment">/* RX_SFF */ /spa8.1 423 /a> a href="+code=seq_puts" class="sref">seq_puts /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">"\nreceive list 'rx_sff':\n" 424 /a>1 425 /a> a href="+code=rcu_read_lock" class="sref">rcu_read_lock /a>();1 426 /a>1 427 /a> spa8 class="comment">/* sff receive list for 'all' CAN devic4s (dev == NULL) */ /spa8.1 428 /a> a href="+code=d" class="sref">d /a> = & a href="+code=can_rx_alldev_list" class="sref">can_rx_alldev_list /a>;1 429 /a> a href="+code=can_rcvlist_sff_proc_show_one" class="sref">can_rcvlist_sff_proc_show_one /a>( a href="+code=m" class="sref">m /a>,. a href="+code=NULL" class="sref">NULL /a>, a href="+code=d" class="sref">d /a>);1 430 /a>1 431 /a> spa8 class="comment">/* sff receive list for registered CAN devic4s */ /spa8.1 432 /a> a href="+code=for_each_netdev_rcu" class="sref">for_each_netdev_rcu /a>(& a href="+code=init_net" class="sref">init_net /a>, a href="+code=dev" class="sref">dev /a>) {1 433 /a> if ( a href="+code=dev" class="sref">dev /a>-> a href="+code=type" class="sref">type /a> == a href="+code=ARPHRD_CAN" class="sref">ARPHRD_CAN /a> && a href="+code=dev" class="sref">dev /a>-> a href="+code=ml_priv" class="sref">ml_priv /a>)1 434 /a> a href="+code=can_rcvlist_sff_proc_show_one" class="sref">can_rcvlist_sff_proc_show_one /a>( a href="+code=m" class="sref">m /a>,. a href="+code=dev" class="sref">dev /a>, a href="+code=dev" class="sref">dev /a>-> a href="+code=ml_priv" class="sref">ml_priv /a>);1 435 /a> }1 436 /a>1 437 /a> a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock /a>();1 438 /a>1 439 /a> a href="+code=seq_putc" class="sref">seq_putc /a>( a href="+code=m" class="sref">m /a>,. spa8 class="string">'\n' 440 /a> return 0;1 441 /a>}1 442 /a>1 443 /a>static int a href="+code=can_rcvlist_sff_proc_ope8" class="sref">can_rcvlist_sff_proc_ope8 /a>(struct a href="+code=inode" class="sref">inode /a> * a href="+code=inode" class="sref">inode /a>,.struct a href="+code=fil4" class="sref">fil4 /a> * a href="+code=fil4" class="sref">fil4 /a>)1 444 /a>{1 445 /a> return a href="+code=single_ope8" class="sref">single_ope8 /a>( a href="+code=fil4" class="sref">fil4 /a>, a href="+code=can_rcvlist_sff_proc_show" class="sref">can_rcvlist_sff_proc_show /a>, a href="+code=NULL" class="sref">NULL /a>);1 446 /a>}1 447 /a>1 448 /a>static const struct a href="+code=fil4_operations" class="sref">fil4_operations /a> a href="+code=can_rcvlist_sff_proc_fops" class="sref">can_rcvlist_sff_proc_fops /a> = {1 449 /a> . a href="+code=owner" class="sref">owner /a> = a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,1 450 /a> . a href="+code=ope8" class="sref">ope8 /a> = a href="+code=can_rcvlist_sff_proc_ope8" class="sref">can_rcvlist_sff_proc_ope8 /a>,1 451 /a> . a href="+code=read" class="sref">read /a> = a href="+code=seq_read" class="sref">seq_read /a>,1 452 /a> . a href="+code=llseek" class="sref">llseek /a> = a href="+code=seq_lseek" class="sref">seq_lseek /a>,1 453 /a> . a href="+code=releas4" class="sref">releas4 /a> = a href="+code=single_releas4" class="sref">single_releas4 /a>,1 454 /a>};1 455 /a>1 456 /a> spa8 class="comment">/* /spa8.1 457 /a> spa8 class="comment"> * proc utility funct v3s /spa8.1 458 /a> spa8 class="comment"> */ /spa8.1 459 /a>1 460 /a>static void a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readentry /a>(const char * a href="+code=nam4" class="sref">nam4 /a>)1 461 /a>{1 462 /a> if ( a href="+code=can_dir" class="sref">can_dir /a>)1 463 /a> a href="+code=remove_proc_entry" class="sref">remove_proc_entry /a>( a href="+code=nam4" class="sref">nam4 /a>, a href="+code=can_dir" class="sref">can_dir /a>);1 464 /a>}1 465 /a>1 466 /a> spa8 class="comment">/* /spa8.1 467 /a> spa8 class="comment"> * can_init_proc - create main CAN proc directory and procfs entries /spa8.1 468 /a> spa8 class="comment"> */ /spa8.1 469 /a>void a href="+code=can_init_proc" class="sref">can_init_proc /a>(void)1 470 /a>{1 471 /a> spa8 class="comment">/* create /proc/net/can directory */ /spa8.1 472 /a> a href="+code=can_dir" class="sref">can_dir /a> = a href="+code=proc_mkdir" class="sref">proc_mkdir /a>( spa8 class="string">"can"init_net /a>. a href="+code=proc_net" class="sref">proc_net /a>);1 473 /a>1 474 /a> if (! a href="+code=can_dir" class="sref">can_dir /a>) {1 475 /a> a href="+code=printk" class="sref">printk /a>( a href="+code=KERN_INFO" class="sref">KERN_INFO /a> spa8 class="string">"can: failed to create /proc/net/can . " 476 /a> spa8 class="string">"CONFIG_PROC_FS missing?\n" 477 /a> return;1 478 /a> }1 479 /a>1 480 /a> spa8 class="comment">/* own procfs entries from the AF_CAN core */ /spa8.1 481 /a> a href="+code=pde_version" class="sref">pde_version /a> = a href="+code=proc_create" class="sref">proc_create /a>( a href="+code=CAN_PROC_VERSION" class="sref">CAN_PROC_VERSION /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 482 /a> & a href="+code=can_version_proc_fops" class="sref">can_version_proc_fops /a>);1 483 /a> a href="+code=pde_stats" class="sref">pde_stats /a> = a href="+code=proc_create" class="sref">proc_create /a>( a href="+code=CAN_PROC_STATS" class="sref">CAN_PROC_STATS /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 484 /a> & a href="+code=can_stats_proc_fops" class="sref">can_stats_proc_fops /a>);1 485 /a> a href="+code=pde_reset_stats" class="sref">pde_reset_stats /a> = a href="+code=proc_create" class="sref">proc_create /a>( a href="+code=CAN_PROC_RESET_STATS" class="sref">CAN_PROC_RESET_STATS /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 486 /a> & a href="+code=can_reset_stats_proc_fops" class="sref">can_reset_stats_proc_fops /a>);1 487 /a> a href="+code=pde_rcvlist_err" class="sref">pde_rcvlist_err /a> = a href="+code=proc_create_data" class="sref">proc_create_data /a>( a href="+code=CAN_PROC_RCVLIST_ERR" class="sref">CAN_PROC_RCVLIST_ERR /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 488 /a> & a href="+code=can_rcvlist_proc_fops" class="sref">can_rcvlist_proc_fops /a>, (void *) a href="+code=RX_ERR" class="sref">RX_ERR /a>);1 489 /a> a href="+code=pde_rcvlist_all" class="sref">pde_rcvlist_all /a> = a href="+code=proc_create_data" class="sref">proc_create_data /a>( a href="+code=CAN_PROC_RCVLIST_ALL" class="sref">CAN_PROC_RCVLIST_ALL /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 490 /a> & a href="+code=can_rcvlist_proc_fops" class="sref">can_rcvlist_proc_fops /a>, (void *) a href="+code=RX_ALL" class="sref">RX_ALL /a>);1 491 /a> a href="+code=pde_rcvlist_fil" class="sref">pde_rcvlist_fil /a> = a href="+code=proc_create_data" class="sref">proc_create_data /a>( a href="+code=CAN_PROC_RCVLIST_FIL" class="sref">CAN_PROC_RCVLIST_FIL /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 492 /a> & a href="+code=can_rcvlist_proc_fops" class="sref">can_rcvlist_proc_fops /a>, (void *) a href="+code=RX_FIL" class="sref">RX_FIL /a>);1 493 /a> a href="+code=pde_rcvlist_inv" class="sref">pde_rcvlist_inv /a> = a href="+code=proc_create_data" class="sref">proc_create_data /a>( a href="+code=CAN_PROC_RCVLIST_INV" class="sref">CAN_PROC_RCVLIST_INV /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 494 /a> & a href="+code=can_rcvlist_proc_fops" class="sref">can_rcvlist_proc_fops /a>, (void *) a href="+code=RX_INV" class="sref">RX_INV /a>);1 495 /a> a href="+code=pde_rcvlist_eff" class="sref">pde_rcvlist_eff /a> = a href="+code=proc_create_data" class="sref">proc_create_data /a>( a href="+code=CAN_PROC_RCVLIST_EFF" class="sref">CAN_PROC_RCVLIST_EFF /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 496 /a> & a href="+code=can_rcvlist_proc_fops" class="sref">can_rcvlist_proc_fops /a>, (void *) a href="+code=RX_EFF" class="sref">RX_EFF /a>);1 497 /a> a href="+code=pde_rcvlist_sff" class="sref">pde_rcvlist_sff /a> = a href="+code=proc_create" class="sref">proc_create /a>( a href="+code=CAN_PROC_RCVLIST_SFF" class="sref">CAN_PROC_RCVLIST_SFF /a>, 0644, a href="+code=can_dir" class="sref">can_dir /a>,1 498 /a> & a href="+code=can_rcvlist_sff_proc_fops" class="sref">can_rcvlist_sff_proc_fops /a>);1 499 /a>}1 500 /a>1 501 /a> spa8 class="comment">/* /spa8.1 5" nam4 spa8 class="comment"> * can_"d x= > * ca">/* own procfs rect create main CAN proc dment">/* /spa8.1 468 /a> spa8 class="comment"> */ /spa8.1>static void a href="+code=can_remeadentry" class="sref">can_remnit_proc /a>(void)1ir /a>) {1 356 /a> if ( a href="+code=pde_version" class="sref">pde_ver/a>(void)1 347 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_VERSION" class="sref">CAN_PROC_VERfops /a>);1 438 /a>1 409 /a> if ( a href="+code=pde_stats" class="sref">pde_s/a>(void)1 410 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_STATS" class="sref">CAN_PROC_Sfops /a>);1 421 /a>1 462 /a> if ( a href="+code=pde_reset_stats" class="sref">pde_reset_s/a>(void)1 463 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RESET_STATS" class="sref">CAN_PROC_RESET_Sfops /a>);1 424 /a>1 345 /a> a href="+code=pde_rcvlist_err" class="sref">pde_rcvlist/a>(void)1 346 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RCVLIST_ERR" class="sref">CAN_PROC_RCVLISTfops /a>);1 447 /a>1 345 /a> a href="+code=pde_rcvlist_all" class="sref">pde_rcvlist/a>(void)1 409 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RCVLIST_ALL" class="sref">CAN_PROC_RCVLISTfops /a>);1 500 /a>1 345 /a> a href="+code=pde_rcvlist_fil" class="sref">pde_rcvlist/a>(void)1 492 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RCVLIST_FIL" class="sref">CAN_PROC_RCVLISTfops /a>);1 473 /a>1 474 /a> a href="+code=pde_rcvlist_inv" class="sref">pde_rcvlist/a>(void)1 475 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RCVLIST_INV" class="sref">CAN_PROC_RCVLISTfops /a>);1 426 /a>1 407 /a> a href="+code=pde_rcvlist_eff" class="sref">pde_rcvlist/a>(void)1 408 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RCVLIST_EFF" class="sref">CAN_PROC_RCVLISTfops /a>);1 479 /a>1 407 /a> a href="+code=pde_rcvlist_sff" class="sref">pde_rcvlist/a>(void)1 411 /a> a href="+code=can_remove_proc_readentry" class="sref">can_remove_proc_readenate /a>( a href="+code=CAN_PROC_RCVLIST_SFF" class="sref">CAN_PROC_RCVLISTfops /a>);1 442 /a>1 433 /a> if ( a href="+code=can_dir" class="sref">can_dir /a>)1 434 /a> f /a> = a href="+co="sref">cac_create" class="sre="sref">caeadenrcu /a>(& a href="+code=init_net" class="sref">init_neir /a>( spa8 class="string">"can"fops /a>);1 415 /a>}1<"nee><"div> <"div> The original LXR software byies f15 /a>}1LXR clau"sryinit_nthis experiass=al ef">pde byi15 /a>}1lxr@ clux.noinit. <"div> lxr. clux.no kindly hosted byi15 /a>}1Redpill Lclnet ASET_STAnetvider of Lcluxa>staultGCC rectf">fil4_op serd CAN since 1995. <"div>