aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ptp_clock_kernel.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
commitcd6362befe4cc7bf589a5236d2a780af2d47bcc9 (patch)
tree3bd4e13ec3f92a00dc4f6c3d65e820b54dbfe46e /include/linux/ptp_clock_kernel.h
parent0f1b1e6d73cb989ce2c071edc57deade3b084dfe (diff)
parentb1586f099ba897542ece36e8a23c1a62907261ef (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Here is my initial pull request for the networking subsystem during this merge window: 1) Support for ESN in AH (RFC 4302) from Fan Du. 2) Add full kernel doc for ethtool command structures, from Ben Hutchings. 3) Add BCM7xxx PHY driver, from Florian Fainelli. 4) Export computed TCP rate information in netlink socket dumps, from Eric Dumazet. 5) Allow IPSEC SA to be dumped partially using a filter, from Nicolas Dichtel. 6) Convert many drivers to pci_enable_msix_range(), from Alexander Gordeev. 7) Record SKB timestamps more efficiently, from Eric Dumazet. 8) Switch to microsecond resolution for TCP round trip times, also from Eric Dumazet. 9) Clean up and fix 6lowpan fragmentation handling by making use of the existing inet_frag api for it's implementation. 10) Add TX grant mapping to xen-netback driver, from Zoltan Kiss. 11) Auto size SKB lengths when composing netlink messages based upon past message sizes used, from Eric Dumazet. 12) qdisc dumps can take a long time, add a cond_resched(), From Eric Dumazet. 13) Sanitize netpoll core and drivers wrt. SKB handling semantics. Get rid of never-used-in-tree netpoll RX handling. From Eric W Biederman. 14) Support inter-address-family and namespace changing in VTI tunnel driver(s). From Steffen Klassert. 15) Add Altera TSE driver, from Vince Bridgers. 16) Optimizing csum_replace2() so that it doesn't adjust the checksum by checksumming the entire header, from Eric Dumazet. 17) Expand BPF internal implementation for faster interpreting, more direct translations into JIT'd code, and much cleaner uses of BPF filtering in non-socket ocntexts. From Daniel Borkmann and Alexei Starovoitov" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1976 commits) netpoll: Use skb_irq_freeable to make zap_completion_queue safe. net: Add a test to see if a skb is freeable in irq context qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port' net: ptp: move PTP classifier in its own file net: sxgbe: make "core_ops" static net: sxgbe: fix logical vs bitwise operation net: sxgbe: sxgbe_mdio_register() frees the bus Call efx_set_channels() before efx->type->dimension_resources() xen-netback: disable rogue vif in kthread context net/mlx4: Set proper build dependancy with vxlan be2net: fix build dependency on VxLAN mac802154: make csma/cca parameters per-wpan mac802154: allow only one WPAN to be up at any given time net: filter: minor: fix kdoc in __sk_run_filter netlink: don't compare the nul-termination in nla_strcmp can: c_can: Avoid led toggling for every packet. can: c_can: Simplify TX interrupt cleanup can: c_can: Store dlc private can: c_can: Reduce register access can: c_can: Make the code readable ...
Diffstat (limited to 'include/linux/ptp_clock_kernel.h')
-rw-r--r--include/linux/ptp_clock_kernel.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 38a993508327..0d8ff3fb84ba 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -49,7 +49,11 @@ struct ptp_clock_request {
49 * @n_alarm: The number of programmable alarms. 49 * @n_alarm: The number of programmable alarms.
50 * @n_ext_ts: The number of external time stamp channels. 50 * @n_ext_ts: The number of external time stamp channels.
51 * @n_per_out: The number of programmable periodic signals. 51 * @n_per_out: The number of programmable periodic signals.
52 * @n_pins: The number of programmable pins.
52 * @pps: Indicates whether the clock supports a PPS callback. 53 * @pps: Indicates whether the clock supports a PPS callback.
54 * @pin_config: Array of length 'n_pins'. If the number of
55 * programmable pins is nonzero, then drivers must
56 * allocate and initialize this array.
53 * 57 *
54 * clock operations 58 * clock operations
55 * 59 *
@@ -70,6 +74,18 @@ struct ptp_clock_request {
70 * parameter request: Desired resource to enable or disable. 74 * parameter request: Desired resource to enable or disable.
71 * parameter on: Caller passes one to enable or zero to disable. 75 * parameter on: Caller passes one to enable or zero to disable.
72 * 76 *
77 * @verify: Confirm that a pin can perform a given function. The PTP
78 * Hardware Clock subsystem maintains the 'pin_config'
79 * array on behalf of the drivers, but the PHC subsystem
80 * assumes that every pin can perform every function. This
81 * hook gives drivers a way of telling the core about
82 * limitations on specific pins. This function must return
83 * zero if the function can be assigned to this pin, and
84 * nonzero otherwise.
85 * parameter pin: index of the pin in question.
86 * parameter func: the desired function to use.
87 * parameter chan: the function channel index to use.
88 *
73 * Drivers should embed their ptp_clock_info within a private 89 * Drivers should embed their ptp_clock_info within a private
74 * structure, obtaining a reference to it using container_of(). 90 * structure, obtaining a reference to it using container_of().
75 * 91 *
@@ -83,13 +99,17 @@ struct ptp_clock_info {
83 int n_alarm; 99 int n_alarm;
84 int n_ext_ts; 100 int n_ext_ts;
85 int n_per_out; 101 int n_per_out;
102 int n_pins;
86 int pps; 103 int pps;
104 struct ptp_pin_desc *pin_config;
87 int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta); 105 int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta);
88 int (*adjtime)(struct ptp_clock_info *ptp, s64 delta); 106 int (*adjtime)(struct ptp_clock_info *ptp, s64 delta);
89 int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts); 107 int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts);
90 int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts); 108 int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts);
91 int (*enable)(struct ptp_clock_info *ptp, 109 int (*enable)(struct ptp_clock_info *ptp,
92 struct ptp_clock_request *request, int on); 110 struct ptp_clock_request *request, int on);
111 int (*verify)(struct ptp_clock_info *ptp, unsigned int pin,
112 enum ptp_pin_function func, unsigned int chan);
93}; 113};
94 114
95struct ptp_clock; 115struct ptp_clock;
@@ -156,4 +176,17 @@ extern void ptp_clock_event(struct ptp_clock *ptp,
156 176
157extern int ptp_clock_index(struct ptp_clock *ptp); 177extern int ptp_clock_index(struct ptp_clock *ptp);
158 178
179/**
180 * ptp_find_pin() - obtain the pin index of a given auxiliary function
181 *
182 * @ptp: The clock obtained from ptp_clock_register().
183 * @func: One of the ptp_pin_function enumerated values.
184 * @chan: The particular functional channel to find.
185 * Return: Pin index in the range of zero to ptp_clock_caps.n_pins - 1,
186 * or -1 if the auxiliary function cannot be found.
187 */
188
189int ptp_find_pin(struct ptp_clock *ptp,
190 enum ptp_pin_function func, unsigned int chan);
191
159#endif 192#endif