linux/drivers/ptp/ptp_chardev.c
<<
v4.02 3 6 3 6 v3.16.35 v3.16.7 v3.16.6 v3.16.5 v3.16.4 v3.16.4 v3.15.10 v3.15.9 v3.15.8 v3.15.7 v3.15.6 v3.15.5 v3.15.4 v3.15.4 v3.15.4 v3.15.5 v3.15.4 v438v3.19 v43.v3.08 v3.18.2 v3.15.10 v3.15.9 v3.15.4 v3.15.4 v3.11 v3.10.105 v3.10.104 v3.10.103 v3.10.102 <4tion value="v3.4.101" > v3.10.101 4option value="v410.100" > v3.10.100 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ption> v3.15.2 v3.15.1 v3.14.10 v3.14.9 v3.14.8 v3.14.7 v3.14.6 v3.14.5 v3.14.4 v3.14.4 v3.18.4 v3.17.4 v3.16.4 v3.15.4 v3.14.4 v3.14.6 v3.13.5 v3.14.4 v3.14.4 v3.10.87 2 2 2 2 2tion> v3.15.2 v3.15.1 2 2 2 2 2 2 ption> v3.13.2 v3.13.1 v3.12.10 v3.12.9 v3.12.8 v3.12.7 v3.12.6 v3.12.5 v3.12.4 v3.12.4 v3.10.13 v3.12.4 v3.12.4 v3.12.4 v3.10.104 v3.10.103 v3.10.102 v3.10.101 ton value="v3.1075" > v3.10.72tn value="v3.10.1".63 00ppion> v3.10.24 v3.10.14 v3.10.14 option value=v0.14" > v3.10.14 2nvaln> 0.14" > v3.10.14 2nvaln>3 .0.24" > v3.10.24 2nvaln>2 .0.14" > v3.10.14 2nvaln>1 .0.14" > v3.10.14 2nvaln v3.10.14 2nval 2nval 7 2nval53.2 v3.10.15 2nval53.1 v3.10.14 2nval53.0 v3.10.14 2nval5.n v3.10.12 v3.10.14 2nval5 7 2nval532 v3.10.15 2nval53. v3.10.15 2nval5 v3.10.15 2nval 2nval 2nvalv3.3 v3.14.16 2nvalv3.2 v3.14.15 2nvalv3.. v3.14.14 2nvalv3.0 v3.14.13 2nvalv3n v3.14.12 v3.14.11 v3.14.10 v3.14.9 v3.10.15 2nval option valu2nvalv314.17" > v3.14.17 2nvalv33 v3.14.16 2nvalv32 v3.14.15 2nvalv3. v3.14.15 2nvalv v3.14.15 2nval3 2nval3 1n v3.10.22 2nval33.v v3.10.21 2nval33.7 2nval33.v v3.10.19 2nval33.option valu2nval3 v3.10.15 2nval3 2nval33.3 v3.14.16 2nval33.2 v3.14.15 2nval33.. v3.14.14 2nval33.0 v3.10.14 2nvale=n v3.10.22 2nval33v v3.10.21 2nval337 2nval33v v3.10.19 2nval33option valu2nval3 o0.15" > v3.10.15 2nval3 option valu2nval3314.17" > v3.14.17 2nval333 v3.14.16 2nval332 v3.14.15 2nval33. v3.14.15 2nval3 v3.14.15 2nval2 2nval2 <0 v3.13.2 v3.10.72 2nval23.v v3.10.71 2nval23.7 2nval23.v v3.10.69 2nval23.option valu2nval23.10.68" > v3.10.68 2nval23.option valu2nval23.10.67" > v3.10.67 2nval23.3 v3.10.66 2nval23.2 v3.10.65 2nval23.option valu2nval2 .10.64" > v3.10.64 2nval2 .0 v3.10.63 2nvalon5n v3.10.62 2nval23.v v3.10.61 2nval23.7 2nval23.v v3.10.59 2nval23.option valu2nval23.10.58" > v3.10.58 2nval23.option valu2nval23.10.57" > v3.10.57 2nval23.3 v3.10.56 2nval23.2 v3.10.55 2nval23.option valu2nval2 .10.54" > v3.10.54 2nval2 .0 v3.10.53 2nvalon4n v3.10.52 2nval23.v v3.10.51 2nval23.7 2nval23.v v3.10.49 2nval23.option valu2nval23.10.48" > v3.10.48 2nval23.option valu2nval23.10.47" > v3.10.47 2nval23.3 v3.10.46 2nval23.2 v3.10.45 2nval23.option valu2nval2 .10.44" > v3.10.44 2nval2 .0 v3.10.43 2nvalonln v3.12.42 2nvalv3.v v3.18.4 v3.12.40 2nvalv3.v v3.16.4 v3.12.38 2nvalv3.option valu2nval23lv4.15" > v3.14.15 2nval2al3 v3.12.36 2nvalv3.2 v3.10.35 2nval23.option valu2nval2 .10.34" > v3.10.34 2nval2 .0 v3.10.33 2nvalon2n v3.10.32 2nvalv3.v v3.10.31 2nval23.v v3.10.30 2nvalv3.v v3.10.29 2nval23.5 v3.10.28 2nvalv3.option valu2nval23.10.27" > v3.10.27 2nval23.3 v3.10.26 2nvalv3.2 v3.10.25 2nval23.option valu2nval2 .10.24" > v3.10.24 2nval2 .0 v3.14.15 2nval2 1n v3.12.22 2nvalv3.v v3.10.21 2nval23.7 2nvalv3.v v3.10.19 2nval23.option valu2nvalv3.12.18" > v3.12.18 2nvalv3.option valu2nval23.14.17" > v3.14.17 2nval23.3 v3.12.16 2nvalv3.2 v3.14.15 2nval23.. v3.12.14 2nvalv3.0 v3.10.14 2nval2=n v3.12.12 v3.10.21 2nval237 2nval23. v3.10.54 2nval2 . v3.10.44 2nval2 . v3.10.34 2nval2 . v3.10.24 2nval2 . v3.12.14 2nvalv3. v3.12.14 2nvalv v3.12.14 2nval13.option valu2nval13.14.17" > v3.14.17 2nval13.3 v3.12.16 2nval13.2 v3.14.15 2nval13.. v3.12.14 2nval13.0 v3.10.13 2nvali3n v3.10.12 v3.10.11 v3.10.72tn value="v3.102nval.5. v3.14.17 2nval133 v3.12.16 2nval132 v3.14.15 2nval13. v3.14.15 2nval1 v3.14.15 2nval03.0 v3.10.13 2nvalv3n v3.10.12 v3.10.11 v3.10.72tn value="v3.102nval75. v3.10.24 2nvalv32 v3.10.14 2nvalv3. v3.10.14 2nvalv v3.10.14 2nva29u. v4.0 0.14" > v3.10.14 2nva2n>3 .0.24" > v3.10.24 2nva2n>2 .0.14" > v3.10.14 2nva2n>1 .0.14" > v3.10.14 2nva2n v3.10.32 2nva283.0 v3.18.13 2nva2v3n v3.18.12 v3.10.11 v3.10.72tn value="v3.102nva2 5 2nva273.2 v3.10.31 2nva273.1 v3.10.64 2nva27 .0 v3.10.63 2nva27n5n v3.10.63 2nva27n5v v3.10.61 2nva.73.7 2nva273.6 2nva273.5 2nva273. v3.10.57 2nva273.3 v3.10.56 2nva273.2 v3.10.55 2nva273.1 v3.10.54 2nva27 .0 v3.10.53 2nva27n4n v3.10.53 2nva27n4v v3.10.51 2nva.73.7 2nva273.6 2nva273.5 2nva273. v3.10.47 2nva273.3 v3.10.46 2nva273.2 v3.10.45 2nva273.1 v3.10.44 2nva27 .0 v3.10.43 2nva27nln v3.10.43 2nva27nlv v3.18.4 v3.12.40 2nva273.6 2nva273. v3.14.15 2nva273l3 v3.12.36 2nva273.2 v3.12.14 2nva273l1 v3.14.15 2nva27 l0 v3.10.14 2nva27a2n v3.10.32 2nva27a.v v3.10.31 2nva273.v v3.10.31 2nva273.6 2nva273.5 2nva273. v3.10.27 2nva273.3 v3.10.26 2nva273.2 v3.10.25 2nva273.1 v3.10.24 2nva27 .0 v3.14.15 2nva27n1n v3.14.15 2nva27n1v v3.10.21 2nva.7a.v v3.12.20 2nva273.6 2nva273.5 2nva273. v3.14.17 2nva273.3 v3.12.16 2nva273.2 v3.14.15 2nva273.1 v3.12.14 2nva27 .0 v3.18.13 2nva273n v3.18.12 v3.10.11 v3.18.9 v3.17.8 v3.17.7 v3.17.6 v3.17.5 v3.17.4 v3.17.4 v3.10.11 v3.18.9 v3.17.8 v3.16.7 v3.17.6 v3.17.5 v3.16.4 v3.18.9 v3.14.15 2nva25n1n v3.14.15 2nva25n1v v3.10.21 2nva.5a.v v3.12.20 2nva253.6 2nva253.5 2nva25 2nva253.2 v3.10.15 2nva253.1 v3.10.14 2nva253.0 v3.10.14 2nva25.n v3.10.12 v3.10.14 2nva25 7 2nva2532 v3.10.15 2nva253. v3.10.15 2nva.5 2nva2 option valu2nva2v314.17" > v3.14.17 2nva2v33 v3.14.16 2nva2v32 v3.14.15 2nva2v3. v3.14.15 2nva. v3.14.17 2nva233.7 2nva233.v v3.10.19 2nva233.option valu2nva23 v3.10.15 2nva23 2nva233.3 v3.14.16 2nva233.2 v3.14.15 2nva233.. v3.14.14 2nva233.0 v3.10.14 2nva2e=n v3.10.22 2nva233v v3.10.21 2nva2337 2nva233v v3.10.19 2nva233option valu2nva23 o0.15" > v3.10.15 2nva23 option valu2nva23314.17" > v3.14.17 2nva2333 v3.14.16 2nva2332 v3.14.15 2nva233. v3.14.15 2nva.3 v3.14.16 2nva22 1n v3.12.22 2nva2v3.v v3.10.21 2nva223.7 2nva2v3.v v3.10.19 2nva223.option valu2nva2v3.12.18" > v3.12.18 2nva2v3.option valu2nva223.14.17" > v3.14.17 2nva223.3 v3.12.16 2nva2v3.2 v3.14.15 2nva223.. v3.12.14 2nva2v3.0 v3.10.14 2nva22=n v3.12.12 v3.10.21 2nva2237 2nva2v3v v3.10.19 2nva223option valu2nva2v312.18" > v3.12.18 2nva2v3option valu2nva22314.17" > v3.14.17 2nva2233 v3.12.16 2nva2v32 v3.14.15 2nva223. v3.14.15 2nva22 v3.14.15 2nva2u=7 2nva2133 v3.12.16 2nva2132 v3.14.15 2nva213. v3.14.15 2nva.1 v3.14.15 2nva.0a.1 v3.10.24 2nva2v3.0 v3.10.23 2nva2v31n v3.10.22 2nva2v3.v v3.10.21 2nva2v3.7 2nva2v3.. v3.10.19 2nva2v3.. v3.10.18 2nva2v3.option valu2nva2v3.10.17" > v3.10.17 2nva2v3.3 v3.10.16 2nva2v3.2 v3.10.15 2nva2v3.1 v3.12.14 2nva203.0 v3.10.13 2nva2v3n v3.10.12 v3.10.11 v3.10.72tn value="v3.102nva275. v3.10.24 2nva2v32 v3.10.14 2nva2v3. v3.10.14 2nva.0 v3.10.14 2nva19=7 2nva19=6 2nva1n>3 .0.24" > v3.10.24 2nva1n>2 .0.14" > v3.10.14 2nva1n>1 .0.14" > v3.10.14 2nva1n v3.10.22 2nva1"v8 v3.10.11 v3.10.72tn value="v3.102nva1 5 2nva173. v3.14.17 2nva173.3 v3.12.16 2nva173.2 v3.14.15 2nva173.1 v3.12.14 2nva17 .0 v3.18.13 2nva173n v3.18.12 v3.10.11 v3.18.9 v3.17.8 v3.17.7 v3.17.6 v3.17.5 v3.17.4 v3.10.20 2nva163.2 v3.10.20 2nva163.1 v3.10.64 2nva16 .0 v3.10.63 2nva16n5n v3.10.63 2nva16n58 v3.10.61 2nva163.7 2nva.63.6 2nva163.5 2nva163. v3.10.57 2nva163.3 v3.10.56 2nva163.2 v3.10.55 2nva163.1 v3.10.54 2nva16 .0 v3.10.53 2nva16n4n v3.10.53 2nva16n48 v3.10.51 2nva163.7 2nva.63.6 2nva163.5 2nva163. v3.10.47 2nva163.3 v3.10.46 2nva163.2 v3.10.45 2nva163.1 v3.10.44 2nva16 .0 v3.10.43 2nva16nln v3.10.43 2nva16nl8 v3.18.4 v3.12.40 2nva.63.6 2nva163. v3.14.15 2nva163l3 v3.12.36 2nva1valv v3.12.14 2nva1val1 v3.14.15 2nva1valv v3.10.14 2nva1va2n v3.10.14 2nva1va28 v3.10.31 2nva163.7 2nva1va.3 v3.14.16 2nva1va22 v3.14.15 2nva1va.1 v3.14.15 2nva1va.0 v3.10.14 2nva16a1n v3.10.22 2nva1va.v v3.10.21 2nva1va.7 2nva163.. v3.10.20 2nva163.5 2nva163. v3.14.17 2nva163.3 v3.12.16 2nva163.2 v3.14.15 2nva163.1 v3.12.14 2nva16 .0 v3.18.13 2nva163n v3.18.12 v3.10.11 v3.18.9 v3.17.8 v3.16.7 v3.17.6 v3.12.14 2nva16 . v3.12.14 2nva16 v3.12.14 2nva15 7 2nva1532 v3.10.15 2nva153. v3.10.15 2nva.5 2nva1 option valu2nva1v314.17" > v3.14.17 2nva1v33 v3.14.16 2nva1v32 v3.14.15 2nva1v3. v3.14.15 2nva. v3.14.17 2nva133option valu2nva13 o0.15" > v3.10.15 2nva13 option valu2nva13314.17" > v3.14.17 2nva1333 v3.14.16 2nva1332 v3.14.15 2nva133. v3.14.15 2nva.3 v3.14.16 2nva12uv v3.14.9 v3.12.18 2nva1v3option valu2nva12314.17" > v3.14.17 2nva1233 v3.12.16 2nva1v32 v3.14.15 2nva123. v3.14.15 2nva.2 v3.14.15 2nva1. v3./spa > v3./form > v3.a v3 href="../linux+v3.7.7/drivers/ptp/ptp_chardev.c"> v3.img src="../.static/gfx/right.png" alt=">>"> ./spa > .spa class="lxr_search"> v3.input typon>hidden" namon>navtarget" option>"> v3.input typon>text" namon>search" idn>search"> v3.butt5submit">Search v3./form > ./spa > .spa class="lxr_prefs" > v3.a href="+prefs?return=drivers/ptp/ptp_chardev.c" v3 onclick="return ajax_prefs();"> v3Prefs> v3./a> ./spa > v3 3./div > v3 3.form ac" ="ajax+*" method="post" onsubmit="return false;"> .input typon>hidden" namon>ajax_lookup" idn>ajax_lookup" option>"> v3 3./form > v3 3.div class="headingbott5m">
v3
v3 v3 3.div idn>search_results" class="search_results"> v > v3 3./div > .div idn>content">> .div idn>file_contents"
35/7f/b5cf0986b7a401dd11059e8c8aea495e9276_3/0" L1" class="line" namon>L1">3 31./a>.spa  class="comment">/*./spa  >L2" class="line" namon>L2">3 32./a>.spa  class="comment"> * PTP 1588 clock support - charac"er device implementa"
	 ../spa  >L3" class="line" namon>L3">3 33./a>.spa  class="comment"> *./spa  >L4" class="line" namon>L4">3 34./a>.spa  class="comment"> * Copyright (C) 2010 OMICRON electronics GmbH./spa  >L5" class="line" namon>L5">3 35./a>.spa  class="comment"> *./spa  >L6" class="line" namon>L6">3 36./a>.spa  class="comment"> *  This program is free software; you ca  redistribute it and/or modify./spa  >L7" class="line" namon>L7">3 37./a>.spa  class="comment"> *  it under the "erms of the GNU General Public License as published by./spa  >L8" class="line" namon>L8">3 38./a>.spa  class="comment"> *  the Free Software Founda"
	 ; either vers15L9" class="line" namon>L9">3 39./a>.spa  class="comment"> *  (at your 15"
	 ) any later vers15<../spa  >L10" class="line" namon>L10">3 .18.a>.spa  class="comment"> *./spa  >L11" class="line" namon>L11">3 11./a>.spa  class="comment"> *  This program is distributed in the hope "hat it will be useful,./spa  >L12" class="line" namon>L12">3 12./a>.spa  class="comment"> *  but WITHOUT ANY WARRANTY; without even the implied warranty of./spa  >L13" class="line" namon>L13">3 13./a>.spa  class="comment"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See "he./spa  >L14" class="line" namon>L14">3 14./a>.spa  class="comment"> *  GNU General Public License for more details../spa  >L15" class="line" namon>L15">3 15./a>.spa  class="comment"> *./spa  >L16" class="line" namon>L16">3 16./a>.spa  class="comment"> *  You should have received a copy of the GNU General Public License./spa  >L17" class="line" namon>L17">3 17./a>.spa  class="comment"> *  along with this program; if not, write to the Free Software./spa  >L18" class="line" namon>L18">3 18./a>.spa  class="comment"> *  Founda"
	 , Inc., 675 Mass Ave, Cambridge, MA 02139, USA../spa  >L19" class="line" namon>L19">3 19./a>.spa  class="comment"> */./spa  >L20" class="line" namon>L20">3 218.a>#include <linux/module.h8.a>>>L21" class="line" namon>L21">3 218.a>#include <linux/posix-clock.h8.a>>>L22" class="line" namon>L22">3 228.a>#include <linux/poll.h8.a>>>L23" class="line" namon>L23">3 238.a>#include <linux/sched.h8.a>>>L24" class="line" namon>L24">3 24./a>>L25" class="line" namon>L25">3 258.a>#include "ptp_private.h8.a>">L26" class="line" namon>L26">3 26./a>>L27" class="line" namon>L27">3 27./a>int3.a href="+code=ptp_open" class="sref">ptp_open./a>(struct3.a href="+code=posix_clock" class="sref">posix_clock./a> *.a href="+code=pc" class="sref">pc./a>,3.a href="+code=fmode_t" class="sref">fmode_t./a> .a href="+code=fmode" class="sref">fmode./a>)>L28" class="line" namon>L28">3 28./a>{>L29" class="line" namon>L29">3 29./a>        return 0;>L30" class="line" namon>L30">3 318.a>}>L31" class="line" namon>L31">3 31./a>>L32" class="line" namon>L32">3 328.a>long .a href="+code=ptp_ioctl" class="sref">ptp_ioctl./a>(struct3.a href="+code=posix_clock" class="sref">posix_clock./a> *.a href="+code=pc" class="sref">pc./a>,3unsigned int3.a href="+code=cmd" class="sref">cmd./a>,3unsigned long .a href="+code=arg" class="sref">arg./a>)>L33" class="line" namon>L33">3 33./a>{>L34" class="line" namon>L34">3 34./a>        struct3.a href="+code=ptp_clock_caps" class="sref">ptp_clock_caps./a> .a href="+code=caps" class="sref">caps./a>;>L35" class="line" namon>L35">3 35./a>        struct3.a href="+code=ptp_clock_request" class="sref">ptp_clock_request./a> .a href="+code=req" class="sref">req./a>;>L36" class="line" namon>L36">3 36./a>        struct3.a href="+code=ptp_clock" class="sref">ptp_clock./a> *.a href="+code=ptp" class="sref">ptp./a> = .a href="+code=container_of" class="sref">container_of./a>(.a href="+code=pc" class="sref">pc./a>,3struct3.a href="+code=ptp_clock" class="sref">ptp_clock./a>,3.a href="+code=clock" class="sref">clock./a>);>L37" class="line" namon>L37">3 37./a>        struct3.a href="+code=ptp_clock_info" class="sref">ptp_clock_info./a> *.a href="+code=ops" class="sref">ops./a> = .a href="+code=ptp" class="sref">ptp./a>->.a href="+code=info" class="sref">info./a>;>L38" class="line" namon>L38">3 38./a>        int3.a href="+code=enable" class="sref">enable./a>,3.a href="+code=err" class="sref">err./a> = 0;>L39" class="line" namon>L39">3 39./a>>L40" class="line" namon>L40">3 40./a>        switch (.a href="+code=cmd" class="sref">cmd./a>) {>L41" class="line" namon>L41">3 41./a>>L42" class="line" namon>L42">3 42./a>        case3.a href="+code=PTP_CLOCK_GETCAPS" class="sref">PTP_CLOCK_GETCAPS./a>:>L43" class="line" namon>L43">3 43./a>                .a href="+code=memset" class="sref">memset./a>(&.a href="+code=caps" class="sref">caps./a>, 0,3sizeof(.a href="+code=caps" class="sref">caps./a>));>L44" class="line" namon>L44">3 44./a>                .a href="+code=caps" class="sref">caps./a>..a href="+code=max_adj" class="sref">max_adj./a> = .a href="+code=ptp" class="sref">ptp./a>->.a href="+code=info" class="sref">info./a>->.a href="+code=max_adj" class="sref">max_adj./a>;>L45" class="line" namon>L45">3 45./a>                .a href="+code=caps" class="sref">caps./a>..a href="+code=n_alarm" class="sref">n_alarm./a> = .a href="+code=ptp" class="sref">ptp./a>->.a href="+code=info" class="sref">info./a>->.a href="+code=n_alarm" class="sref">n_alarm./a>;>L46" class="line" namon>L46">3 46./a>                .a href="+code=caps" class="sref">caps./a>..a href="+code=n_ext_ts" class="sref">n_ext_ts./a> = .a href="+code=ptp" class="sref">ptp./a>->.a href="+code=info" class="sref">info./a>->.a href="+code=n_ext_ts" class="sref">n_ext_ts./a>;>L47" class="line" namon>L47">3 47./a>                .a href="+code=caps" class="sref">caps./a>..a href="+code=n_per_out" class="sref">n_per_out./a> = .a href="+code=ptp" class="sref">ptp./a>->.a href="+code=info" class="sref">info./a>->.a href="+code=n_per_out" class="sref">n_per_out./a>;>L48" class="line" namon>L48">3 48./a>                .a href="+code=caps" class="sref">caps./a>..a href="+code=pps" class="sref">pps./a> = .a href="+code=ptp" class="sref">ptp./a>->.a href="+code=info" class="sref">info./a>->.a href="+code=pps" class="sref">pps./a>;>L49" class="line" namon>L49">3 49./a>                if (.a href="+code=copy_to_user" class="sref">copy_to_user./a>((void .a href="+code=__user" class="sref">__user./a> *).a href="+code=arg" class="sref">arg./a>, &.a href="+code=caps" class="sref">caps./a>, sizeof(.a href="+code=caps" class="sref">caps./a>)))>L50" class="line" namon>L50">3 50./a>                        .a href="+code=err" class="sref">err./a> = -.a href="+code=EFAULT" class="sref">EFAULT./a>;>L51" class="line" namon>L51">3 51./a>                break;>L52" class="line" namon>L52">3 52./a>>L53" class="line" namon>L53">3 53./a>        case3.a href="+code=PTP_EXTTS_REQUEST" class="sref">PTP_EXTTS_REQUEST./a>:>L54" class="line" namon>L54">3 54./a>                if (.a href="+code=copy_from_user" class="sref">copy_from_user./a>(&.a href="+code=req" class="sref">req./a>..a href="+code=extts" class="sref">extts./a>, (void .a href="+code=__user" class="sref">__user./a> *).a href="+code=arg" class="sref">arg./a>,>L55" class="line" namon>L55">3 55./a>                                   sizeof(.a href="+code=req" class="sref">req./a>..a href="+code=extts" class="sref">extts./a>))) {>L56" class="line" namon>L56">3 56./a>                        .a href="+code=err" class="sref">err./a> = -.a href="+code=EFAULT" class="sref">EFAULT./a>;>L57" class="line" namon>L57">3 57./a>                        break;>L58" class="line" namon>L58">3 58./a>                }>L59" class="line" namon>L59">3 59./a>                if (.a href="+code=req" class="sref">req./a>..a href="+code=extts" class="sref">extts./a>..a href="+code=index" class="sref">index./a> >= .a href="+code=ops" class="sref">ops./a>->.a href="+code=n_ext_ts" class="sref">n_ext_ts./a>) {>L60" class="line" namon>L60">3 60./a>                        .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L61" class="line" namon>L61">3 61./a>                        break;>L62" class="line" namon>L62">3 62./a>                }>L63" class="line" namon>L63">3 63./a>                .a href="+code=req" class="sref">req./a>..a href="+code=typo" class="sref">typo./a> = .a href="+code=PTP_CLK_REQ_EXTTS" class="sref">PTP_CLK_REQ_EXTTS./a>;>L64" class="line" namon>L64">3 64./a>                .a href="+code=enable" class="sref">enable./a> = .a href="+code=req" class="sref">req./a>..a href="+code=extts" class="sref">extts./a>..a href="+code=flags" class="sref">flags./a> &3.a href="+code=PTP_ENABLE_FEATURE" class="sref">PTP_ENABLE_FEATURE./a> ? 1 : 0;>L65" class="line" namon>L65">3 65./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=ops" class="sref">ops./a>->.a href="+code=enable" class="sref">enable./a>(.a href="+code=ops" class="sref">ops./a>, &.a href="+code=req" class="sref">req./a>,3.a href="+code=enable" class="sref">enable./a>);>L66" class="line" namon>L66">3 66./a>                break;>L67" class="line" namon>L67">3 67./a>>L68" class="line" namon>L68">3 68./a>        case3.a href="+code=PTP_PEROUT_REQUEST" class="sref">PTP_PEROUT_REQUEST./a>:>L69" class="line" namon>L69">3 69./a>                if (.a href="+code=copy_from_user" class="sref">copy_from_user./a>(&.a href="+code=req" class="sref">req./a>..a href="+code=perout" class="sref">perout./a>, (void .a href="+code=__user" class="sref">__user./a> *).a href="+code=arg" class="sref">arg./a>,>L70" class="line" namon>L70">3 70./a>                                   sizeof(.a href="+code=req" class="sref">req./a>..a href="+code=perout" class="sref">perout./a>))) {>L71" class="line" namon>L71">3 71./a>                        .a href="+code=err" class="sref">err./a> = -.a href="+code=EFAULT" class="sref">EFAULT./a>;>L72" class="line" namon>L72">3 72./a>                        break;>L73" class="line" namon>L73">3 73./a>                }>L74" class="line" namon>L74">3 74./a>                if (.a href="+code=req" class="sref">req./a>..a href="+code=perout" class="sref">perout./a>..a href="+code=index" class="sref">index./a> >= .a href="+code=ops" class="sref">ops./a>->.a href="+code=n_per_out" class="sref">n_per_out./a>) {>L75" class="line" namon>L75">3 75./a>                        .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L76" class="line" namon>L76">3 76./a>                        break;>L77" class="line" namon>L77">3 77./a>                }>L78" class="line" namon>L78">3 78./a>                .a href="+code=req" class="sref">req./a>..a href="+code=typo" class="sref">typo./a> = .a href="+code=PTP_CLK_REQ_PEROUT" class="sref">PTP_CLK_REQ_PEROUT./a>;>L79" class="line" namon>L79">3 79./a>                .a href="+code=enable" class="sref">enable./a> = .a href="+code=req" class="sref">req./a>..a href="+code=perout" class="sref">perout./a>..a href="+code=period" class="sref">period./a>..a href="+code=sec" class="sref">sec./a> || .a href="+code=req" class="sref">req./a>..a href="+code=perout" class="sref">perout./a>..a href="+code=period" class="sref">period./a>..a href="+code=nsec" class="sref">nsec./a>;>L80" class="line" namon>L80">3 80./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=ops" class="sref">ops./a>->.a href="+code=enable" class="sref">enable./a>(.a href="+code=ops" class="sref">ops./a>, &.a href="+code=req" class="sref">req./a>,3.a href="+code=enable" class="sref">enable./a>);>L81" class="line" namon>L81">3 81./a>                break;>L82" class="line" namon>L82">3 82./a>>L83" class="line" namon>L83">3 83./a>        case3.a href="+code=PTP_ENABLE_PPS" class="sref">PTP_ENABLE_PPS./a>:>L84" class="line" namon>L84">3 84./a>                if (!.a href="+code=capable" class="sref">capable./a>(.a href="+code=CAP_SYS_TIME" class="sref">CAP_SYS_TIME./a>))>L85" class="line" namon>L85">3 85./a>                        return -.a href="+code=EPERM" class="sref">EPERM./a>;>L86" class="line" namon>L86">3 86./a>                .a href="+code=req" class="sref">req./a>..a href="+code=typo" class="sref">typo./a> = .a href="+code=PTP_CLK_REQ_PPS" class="sref">PTP_CLK_REQ_PPS./a>;>L87" class="line" namon>L87">3 87./a>                .a href="+code=enable" class="sref">enable./a> = .a href="+code=arg" class="sref">arg./a> ? 1 : 0;>L88" class="line" namon>L88">3 88./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=ops" class="sref">ops./a>->.a href="+code=enable" class="sref">enable./a>(.a href="+code=ops" class="sref">ops./a>, &.a href="+code=req" class="sref">req./a>,3.a href="+code=enable" class="sref">enable./a>);>L89" class="line" namon>L89">3 89./a>                break;>L90" class="line" namon>L90">3 90./a>>L91" class="line" namon>L91">3 91./a>        default:>L92" class="line" namon>L92">3 92./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOTTY" class="sref">ENOTTY./a>;>L93" class="line" namon>L93">3 93./a>                break;>L94" class="line" namon>L94">3 94./a>        }>L95" class="line" namon>L95">3 95./a>        return .a href="+code=err" class="sref">err./a>;>L96" class="line" namon>L96">3 96./a>}>L97" class="line" namon>L97">3 97./a>>L98" class="line" namon>L98">3 98./a>unsigned int3.a href="+code=ptp_poll" class="sref">ptp_poll./a>(struct3.a href="+code=posix_clock" class="sref">posix_clock./a> *.a href="+code=pc" class="sref">pc./a>,3struct3.a href="+code=file" class="sref">file./a> *.a href="+code=fp" class="sref">fp./a>,3.a href="+code=poll_table" class="sref">poll_table./a> *.a href="+code=wait" class="sref">wait./a>)>L99" class="line" namon>L99">3 99./a>{>L100" class="line" namon>L100">3100./a>        struct3.a href="+code=ptp_clock" class="sref">ptp_clock./a> *.a href="+code=ptp" class="sref">ptp./a> = .a href="+code=container_of" class="sref">container_of./a>(.a href="+code=pc" class="sref">pc./a>,3struct3.a href="+code=ptp_clock" class="sref">ptp_clock./a>,3.a href="+code=clock" class="sref">clock./a>);>L101" class="line" namon>L101">3101./a>>L102" class="line" namon>L102">3102./a>        .a href="+code=poll_wait" class="sref">poll_wait./a>(.a href="+code=fp" class="sref">fp./a>,3&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsev_wq" class="sref">tsev_wq./a>,3.a href="+code=wait" class="sref">wait./a>);>L103" class="line" namon>L103">3103./a>>L104" class="line" namon>L104">3104./a>        return .a href="+code=queue_cnt" class="sref">queue_cnt./a>(&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsevq" class="sref">tsevq./a>) ? .a href="+code=POLLIN" class="sref">POLLIN./a> : 0;>L105" class="line" namon>L105">3105./a>}>L106" class="line" namon>L106">3106./a>>L107" class="line" namon>L107">3107./a>.a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=ptp_read" class="sref">ptp_read./a>(struct3.a href="+code=posix_clock" class="sref">posix_clock./a> *.a href="+code=pc" class="sref">pc./a>,>L108" class="line" namon>L108">3108./a>                3.a href="+code=uint" class="sref">uint./a> .a href="+code=rdflags" class="sref">rdflags./a>,3char .a href="+code=__user" class="sref">__user./a> *.a href="+code=buf" class="sref">buf./a>,3.a href="+code=size_t" class="sref">size_t./a> .a href="+code=cnt" class="sref">cnt./a>)>L109" class="line" namon>L109">3109./a>{>L110" class="line" namon>L110">3110./a>        struct3.a href="+code=ptp_clock" class="sref">ptp_clock./a> *.a href="+code=ptp" class="sref">ptp./a> = .a href="+code=container_of" class="sref">container_of./a>(.a href="+code=pc" class="sref">pc./a>,3struct3.a href="+code=ptp_clock" class="sref">ptp_clock./a>,3.a href="+code=clock" class="sref">clock./a>);>L111" class="line" namon>L111">3111./a>        struct3.a href="+code=timestamp_event_queue" class="sref">timestamp_event_queue./a> *.a href="+code=queue" class="sref">queue./a> =3&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsevq" class="sref">tsevq./a>;>L112" class="line" namon>L112">3112./a>        struct3.a href="+code=ptp_extts_event" class="sref">ptp_extts_event./a> .a href="+code=event" class="sref">event./a>[.a href="+code=PTP_BUF_TIMESTAMPS" class="sref">PTP_BUF_TIMESTAMPS./a>];>L113" class="line" namon>L113">3113./a>        unsigned long .a href="+code=flags" class="sref">flags./a>;>L114" class="line" namon>L114">3114./a>        .a href="+code=size_t" class="sref">size_t./a> .a href="+code=qcnt" class="sref">qcnt./a>,3.a href="+code=i" class="sref">i./a>;>L115" class="line" namon>L115">3115./a>>L116" class="line" namon>L116">3116./a>        if (.a href="+code=cnt" class="sref">cnt./a> % sizeof(struct3.a href="+code=ptp_extts_event" class="sref">ptp_extts_event./a>) != 0)>L117" class="line" namon>L117">3117./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L118" class="line" namon>L118">3118./a>>L119" class="line" namon>L119">3119./a>        if (.a href="+code=cnt" class="sref">cnt./a> > sizeof(.a href="+code=event" class="sref">event./a>))>L120" class="line" namon>L120">3120./a>                .a href="+code=cnt" class="sref">cnt./a> = sizeof(.a href="+code=event" class="sref">event./a>);>L121" class="line" namon>L121">3121./a>>L122" class="line" namon>L122">3122./a>        .a href="+code=cnt" class="sref">cnt./a> = .a href="+code=cnt" class="sref">cnt./a> / sizeof(struct3.a href="+code=ptp_extts_event" class="sref">ptp_extts_event./a>);>L123" class="line" namon>L123">3123./a>>L124" class="line" namon>L124">3124./a>        if (.a href="+code=mutex_lock_interruptible" class="sref">mutex_lock_interruptible./a>(&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsevq_mux" class="sref">tsevq_mux./a>))>L125" class="line" namon>L125">3125./a>                return -.a href="+code=ERESTARTSYS" class="sref">ERESTARTSYS./a>;>L126" class="line" namon>L126">3126./a>>L127" class="line" namon>L127">3127./a>        if (.a href="+code=wait_event_interruptible" class="sref">wait_event_interruptible./a>(.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsev_wq" class="sref">tsev_wq./a>,>L128" class="line" namon>L128">3128./a>                333333333333333333333.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=defunct" class="sref">defunct./a> || .a href="+code=queue_cnt" class="sref">queue_cnt./a>(.a href="+code=queue" class="sref">queue./a>))) {>L129" class="line" namon>L129">3129./a>                .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsevq_mux" class="sref">tsevq_mux./a>);>L130" class="line" namon>L130">3130./a>                return -.a href="+code=ERESTARTSYS" class="sref">ERESTARTSYS./a>;>L131" class="line" namon>L131">3131./a>        }>L132" class="line" namon>L132">3132./a>>L133" class="line" namon>L133">3133./a>        if (.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=defunct" class="sref">defunct./a>) {>L134" class="line" namon>L134">3134./a>                .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsevq_mux" class="sref">tsevq_mux./a>);>L135" class="line" namon>L135">3135./a>                return -.a href="+code=ENODEV" class="sref">ENODEV./a>;>L136" class="line" namon>L136">3136./a>        }>L137" class="line" namon>L137">3137./a>>L138" class="line" namon>L138">3138./a>        .a href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsave./a>(&.a href="+code=queue" class="sref">queue./a>->.a href="+code=lock" class="sref">lock./a>,3.a href="+code=flags" class="sref">flags./a>);>L139" class="line" namon>L139">3139./a>>L140" class="line" namon>L140">3140./a>        .a href="+code=qcnt" class="sref">qcnt./a> = .a href="+code=queue_cnt" class="sref">queue_cnt./a>(.a href="+code=queue" class="sref">queue./a>);>L141" class="line" namon>L141">3141./a>>L142" class="line" namon>L142">3142./a>        if (.a href="+code=cnt" class="sref">cnt./a> > .a href="+code=qcnt" class="sref">qcnt./a>)>L143" class="line" namon>L143">3143./a>                .a href="+code=cnt" class="sref">cnt./a> = .a href="+code=qcnt" class="sref">qcnt./a>;>L144" class="line" namon>L144">3144./a>>L145" class="line" namon>L145">3145./a>        for (.a href="+code=i" class="sref">i./a> = 0;3.a href="+code=i" class="sref">i./a> < .a href="+code=cnt" class="sref">cnt./a>;3.a href="+code=i" class="sref">i./a>++) {>L146" class="line" namon>L146">3146./a>                .a href="+code=event" class="sref">event./a>[.a href="+code=i" class="sref">i./a>] = .a href="+code=queue" class="sref">queue./a>->.a href="+code=buf" class="sref">buf./a>[.a href="+code=queue" class="sref">queue./a>->.a href="+code=head" class="sref">head./a>];>L147" class="line" namon>L147">3147./a>                .a href="+code=queue" class="sref">queue./a>->.a href="+code=head" class="sref">head./a> = (.a href="+code=queue" class="sref">queue./a>->.a href="+code=head" class="sref">head./a> + 1) % .a href="+code=PTP_MAX_TIMESTAMPS" class="sref">PTP_MAX_TIMESTAMPS./a>;>L148" class="line" namon>L148">3148./a>        }>L149" class="line" namon>L149">3149./a>>L150" class="line" namon>L150">3150./a>        .a href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore./a>(&.a href="+code=queue" class="sref">queue./a>->.a href="+code=lock" class="sref">lock./a>,3.a href="+code=flags" class="sref">flags./a>);>L151" class="line" namon>L151">3151./a>>L152" class="line" namon>L152">3152./a>        .a href="+code=cnt" class="sref">cnt./a> = .a href="+code=cnt" class="sref">cnt./a> * sizeof(struct3.a href="+code=ptp_extts_event" class="sref">ptp_extts_event./a>);>L153" class="line" namon>L153">3153./a>>L154" class="line" namon>L154">3154./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=ptp" class="sref">ptp./a>->.a href="+code=tsevq_mux" class="sref">tsevq_mux./a>);>L155" class="line" namon>L155">3155./a>>L156" class="line" namon>L156">3156./a>        if (.a href="+code=copy_to_user" class="sref">copy_to_user./a>(.a href="+code=buf" class="sref">buf./a>,3.a href="+code=event" class="sref">event./a>,3.a href="+code=cnt" class="sref">cnt./a>))>L157" class="line" namon>L157">3157./a>                return -.a href="+code=EFAULT" class="sref">EFAULT./a>;>L158" class="line" namon>L158">3158./a>>L159" class="line" namon>L159">3159./a>        return .a href="+code=cnt" class="sref">cnt./a>;>L160" class="line" namon>L160">31618.a>}>L161" class="line" namon>L161">3161./a>
./div > .div class="footer"> The original LXR software by the LXR community./a>,3this experimental vers15lxr@linux.no./a>. ./div >.div class="subfooter"> lxr.linux.no kindly hosted by Redpill Linpro AS./a>,3provider of Linux consulting and opera" s services since 1995. ./div > ./body >./html >