PTP driver refactoring for SJA1105 DSA
Vladimir Oltean
maintainercover PTP driver refactoring for SJA1105 DSA
This series creates a better separation between the driver core and the PTP portion. Therefore, users who are not interested in PTP can get a simpler and smaller driver by compiling it out.
This is in preparation for further patches: SPI transfer timestamping, synchronizing the hardware clock (as opposed to keeping it free-running), PPS input/output, etc.
Vladimir Oltean (4):
net: dsa: sja1105: Get rid of global declaration of struct
ptp_clock_info
net: dsa: sja1105: Make all public PTP functions take dsa_switch as
argument
net: dsa: sja1105: Move PTP data to its own private structure
net: dsa: sja1105: Change the PTP command access pattern
drivers/net/dsa/sja1105/sja1105.h | 16 +- drivers/net/dsa/sja1105/sja1105_main.c | 234 +-------------- drivers/net/dsa/sja1105/sja1105_ptp.c | 391 ++++++++++++++++++++----- drivers/net/dsa/sja1105/sja1105_ptp.h | 84 ++++-- drivers/net/dsa/sja1105/sja1105_spi.c | 2 +- 5 files changed, 386 insertions(+), 341 deletions(-)
Signature · 1 line
2.17.1
Vladimir Oltean
maintainerPATCH 1/4 net: dsa: sja1105: Get rid of global declaration of struct ptp_clock_info
We need priv->ptp_caps to hold a structure and not just a pointer, because we use container_of in the various PTP callbacks.
Therefore, the sja1105_ptp_caps structure declared in the global memory of the driver serves no further purpose after copying it into priv->ptp_caps.
So just populate priv->ptp_caps with the needed operations and remove sja1105_ptp_caps.
--- drivers/net/dsa/sja1105/sja1105_ptp.c | 29 +++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-)
drivers/net/dsa/sja1105/sja1105_ptp.c +14 -15
@@ -344,29 +344,28 @@ static void sja1105_ptp_overflow_check(struct work_struct *work)schedule_delayed_work (&priv->refresh_work,SJA1105_REFRESH_INTERVAL ); } -static const struct ptp_clock_info sja1105_ptp_caps = { - .owner =THIS_MODULE , - .name ="SJA1105 PHC" , - .adjfine = sja1105_ptp_adjfine, - .adjtime = sja1105_ptp_adjtime, - .gettime64 = sja1105_ptp_gettime, - .settime64 = sja1105_ptp_settime, - .max_adj =SJA1105_MAX_ADJ_PPB , -}; -int sja1105_ptp_clock_register (struct sja1105_private *priv) {struct dsa_switch *ds = priv->ds;/* Set up the cycle counter */ priv->tstamp_cc = (struct cyclecounter ) { - .read = sja1105_ptptsclk_read, - .mask =CYCLECOUNTER_MASK (64 ), - .shift =SJA1105_CC_SHIFT , - .mult =SJA1105_CC_MULT , + .read = sja1105_ptptsclk_read, + .mask =CYCLECOUNTER_MASK (64 ), + .shift =SJA1105_CC_SHIFT , + .mult =SJA1105_CC_MULT , }; + priv->ptp_caps = (struct ptp_clock_info ) { + .owner =THIS_MODULE , + .name ="SJA1105 PHC" , + .adjfine = sja1105_ptp_adjfine, + .adjtime = sja1105_ptp_adjtime, + .gettime64 = sja1105_ptp_gettime, + .settime64 = sja1105_ptp_settime, + .max_adj =SJA1105_MAX_ADJ_PPB , + }; +mutex_init (&priv->ptp_lock); - priv->ptp_caps = sja1105_ptp_caps; priv->clock =ptp_clock_register (&priv->ptp_caps, ds->dev);if (IS_ERR_OR_NULL (priv->clock))
Signature · 1 line
2.17.1
Vladimir Oltean
maintainerPATCH 2/4 net: dsa: sja1105: Make all public PTP functions take dsa_switch as argument
In reply to Vladimir OlteanThe new rule (as already started for sja1105_tas.h) is for functions of optional driver components (ones which may be disabled via Kconfig - PTP and TAS) to take struct dsa_switch *ds instead of struct sja1105_private *priv as first argument.
This is so that forward-declarations of struct sja1105_private can be avoided.
So make sja1105_ptp.h the second user of this rule.
--- drivers/net/dsa/sja1105/sja1105.h | 2 +- drivers/net/dsa/sja1105/sja1105_main.c | 11 +++++----- drivers/net/dsa/sja1105/sja1105_ptp.c | 30 +++++++++++++++----------- drivers/net/dsa/sja1105/sja1105_ptp.h | 28 +++++++++++------------- drivers/net/dsa/sja1105/sja1105_spi.c | 2 +- 5 files changed, 37 insertions(+), 36 deletions(-)
drivers/net/dsa/sja1105/sja1105.h +1 -1
@@ -71,7 +71,7 @@ struct sja1105_info {const struct sja1105_dynamic_table_ops *dyn_ops;const struct sja1105_table_ops *static_ops;const struct sja1105_regs *regs; -int (*ptp_cmd)(const void *ctx,const void *data); +int (*ptp_cmd)(const struct dsa_switch *ds,const void *data);int (*reset_cmd)(const void *ctx,const void *data);int (*setup_rgmii_delay)(const void *ctx,int port);/* Prototypes from include/net/dsa.h */
drivers/net/dsa/sja1105/sja1105_main.c +6 -5
@@ -1686,7 +1686,7 @@ static int sja1105_setup(struct dsa_switch *ds)return rc; } - rc =sja1105_ptp_clock_register (priv); + rc =sja1105_ptp_clock_register (ds);if (rc <0 ) {dev_err (ds->dev,"Failed to register PTP clock: %d\n" , rc);return rc;
@@ -1730,7 +1730,7 @@ static void sja1105_teardown(struct dsa_switch *ds)sja1105_tas_teardown (ds);cancel_work_sync (&priv->tagger_data.rxtstamp_work);skb_queue_purge (&priv->tagger_data.skb_rxtstamp_queue); -sja1105_ptp_clock_unregister (priv); +sja1105_ptp_clock_unregister (ds);sja1105_static_config_free (&priv->static_config); }
@@ -1852,14 +1852,14 @@ static netdev_tx_t sja1105_port_deferred_xmit(struct dsa_switch *ds, int port, now = priv->tstamp_cc.read (&priv->tstamp_cc); - rc =sja1105_ptpegr_ts_poll (priv, slot, &ts); + rc =sja1105_ptpegr_ts_poll (ds, slot, &ts);if (rc <0 ) {dev_err (ds->dev,"xmit: timed out polling for tstamp\n" );kfree_skb (clone); goto out_unlock_ptp; } - ts =sja1105_tstamp_reconstruct (priv, now, ts); + ts =sja1105_tstamp_reconstruct (ds, now, ts); ts =timecounter_cyc2time (&priv->tstamp_tc, ts); shwt.hwtstamp =ns_to_ktime (ts);
@@ -2002,6 +2002,7 @@ static void sja1105_rxtstamp_work(struct work_struct *work) {struct sja1105_tagger_data *data =to_tagger (work);struct sja1105_private *priv =to_sja1105 (data); +struct dsa_switch *ds = priv->ds;struct sk_buff *skb;u64 now;
@@ -2016,7 +2017,7 @@ static void sja1105_rxtstamp_work(struct work_struct *work) *shwt = (struct skb_shared_hwtstamps ) {0 }; ts =SJA1105_SKB_CB (skb)->meta_tstamp; - ts =sja1105_tstamp_reconstruct (priv, now, ts); + ts =sja1105_tstamp_reconstruct (ds, now, ts); ts =timecounter_cyc2time (&priv->tstamp_tc, ts); shwt->hwtstamp =ns_to_ktime (ts);
drivers/net/dsa/sja1105/sja1105_ptp.c +17 -13
@@ -78,10 +78,10 @@ int sja1105_get_ts_info(struct dsa_switch *ds, int port,return 0 ; } -int sja1105et_ptp_cmd (const void *ctx,const void *data) +int sja1105et_ptp_cmd (const struct dsa_switch *ds,const void *data) { +const struct sja1105_private *priv = ds->priv;const struct sja1105_ptp_cmd *cmd = data; -const struct sja1105_private *priv = ctx;const struct sja1105_regs *regs = priv->info->regs;const int size =SJA1105_SIZE_PTP_CMD ;u8 buf[SJA1105_SIZE_PTP_CMD ] = {0 };
@@ -95,10 +95,10 @@ int sja1105et_ptp_cmd(const void *ctx, const void *data) SJA1105_SIZE_PTP_CMD); } -int sja1105pqrs_ptp_cmd (const void *ctx,const void *data) +int sja1105pqrs_ptp_cmd (const struct dsa_switch *ds,const void *data) { +const struct sja1105_private *priv = ds->priv;const struct sja1105_ptp_cmd *cmd = data; -const struct sja1105_private *priv = ctx;const struct sja1105_regs *regs = priv->info->regs;const int size =SJA1105_SIZE_PTP_CMD ;u8 buf[SJA1105_SIZE_PTP_CMD ] = {0 };
@@ -126,9 +126,10 @@ int sja1105pqrs_ptp_cmd(const void *ctx, const void *data)* Must be called within one wraparound period of the partial timestamp since * it was generated by the MAC. */ -u64 sja1105_tstamp_reconstruct (struct sja1105_private *priv,u64 now, +u64 sja1105_tstamp_reconstruct (struct dsa_switch *ds,u64 now,u64 ts_partial) { +struct sja1105_private *priv = ds->priv;u64 partial_tstamp_mask =CYCLECOUNTER_MASK (priv->info->ptp_ts_bits);u64 ts_reconstructed;
@@ -170,8 +171,9 @@ u64 sja1105_tstamp_reconstruct(struct sja1105_private *priv, u64 now,* To have common code for E/T and P/Q/R/S for reading the timestamp, * we need to juggle with the offset and the bit indices. */ -int sja1105_ptpegr_ts_poll (struct sja1105_private *priv,int port,u64 *ts) +int sja1105_ptpegr_ts_poll (struct dsa_switch *ds,int port,u64 *ts) { +struct sja1105_private *priv = ds->priv;const struct sja1105_regs *regs = priv->info->regs;int tstamp_bit_start, tstamp_bit_end;int timeout =10 ;
@@ -214,9 +216,9 @@ int sja1105_ptpegr_ts_poll(struct sja1105_private *priv, int port, u64 *ts)return 0 ; } -int sja1105_ptp_reset (struct sja1105_private *priv) +int sja1105_ptp_reset (struct dsa_switch *ds) { -struct dsa_switch *ds = priv->ds; +struct sja1105_private *priv = ds->priv;struct sja1105_ptp_cmd cmd = {0 };int rc;
@@ -224,7 +226,7 @@ int sja1105_ptp_reset(struct sja1105_private *priv) cmd.resptp =1 ;dev_dbg (ds->dev,"Resetting PTP clock\n" ); - rc = priv->info->ptp_cmd (priv, &cmd); + rc = priv->info->ptp_cmd (ds, &cmd);timecounter_init (&priv->tstamp_tc, &priv->tstamp_cc,ktime_to_ns (ktime_get_real ()));
@@ -344,9 +346,9 @@ static void sja1105_ptp_overflow_check(struct work_struct *work)schedule_delayed_work (&priv->refresh_work,SJA1105_REFRESH_INTERVAL ); } -int sja1105_ptp_clock_register (struct sja1105_private *priv) +int sja1105_ptp_clock_register (struct dsa_switch *ds) { -struct dsa_switch *ds = priv->ds; +struct sja1105_private *priv = ds->priv;/* Set up the cycle counter */ priv->tstamp_cc = (struct cyclecounter ) {
@@ -374,11 +376,13 @@ int sja1105_ptp_clock_register(struct sja1105_private *priv)INIT_DELAYED_WORK (&priv->refresh_work, sja1105_ptp_overflow_check);schedule_delayed_work (&priv->refresh_work,SJA1105_REFRESH_INTERVAL ); -return sja1105_ptp_reset (priv); +return sja1105_ptp_reset (ds); } -void sja1105_ptp_clock_unregister (struct sja1105_private *priv) +void sja1105_ptp_clock_unregister (struct dsa_switch *ds) { +struct sja1105_private *priv = ds->priv; +if (IS_ERR_OR_NULL (priv->clock))return ;
drivers/net/dsa/sja1105/sja1105_ptp.h +12 -16
@@ -6,49 +6,45 @@#if IS_ENABLED (CONFIG_NET_DSA_SJA1105_PTP ) -int sja1105_ptp_clock_register (struct sja1105_private *priv); +int sja1105_ptp_clock_register (struct dsa_switch *ds); -void sja1105_ptp_clock_unregister (struct sja1105_private *priv); +void sja1105_ptp_clock_unregister (struct dsa_switch *ds); -int sja1105_ptpegr_ts_poll (struct sja1105_private *priv,int port,u64 *ts); +int sja1105_ptpegr_ts_poll (struct dsa_switch *ds,int port,u64 *ts); -int sja1105et_ptp_cmd (const void *ctx,const void *data); +int sja1105et_ptp_cmd (const struct dsa_switch *ds,const void *data); -int sja1105pqrs_ptp_cmd (const void *ctx,const void *data); +int sja1105pqrs_ptp_cmd (const struct dsa_switch *ds,const void *data);int sja1105_get_ts_info (struct dsa_switch *ds,int port,struct ethtool_ts_info *ts); -u64 sja1105_tstamp_reconstruct (struct sja1105_private *priv,u64 now, -u64 ts_partial); +u64 sja1105_tstamp_reconstruct (struct dsa_switch *ds,u64 now,u64 ts_partial); -int sja1105_ptp_reset (struct sja1105_private *priv); +int sja1105_ptp_reset (struct dsa_switch *ds);#else -static inline int sja1105_ptp_clock_register (struct sja1105_private *priv) +static inline int sja1105_ptp_clock_register (struct dsa_switch *ds) {return 0 ; } -static inline void sja1105_ptp_clock_unregister (struct sja1105_private *priv) -{ -return ; -} +static inline void sja1105_ptp_clock_unregister (struct dsa_switch *ds) { }static inline int -sja1105_ptpegr_ts_poll (struct sja1105_private *priv,int port,u64 *ts) +sja1105_ptpegr_ts_poll (struct dsa_switch *ds,int port,u64 *ts) {return 0 ; } -static inline u64 sja1105_tstamp_reconstruct (struct sja1105_private *priv, +static inline u64 sja1105_tstamp_reconstruct (struct dsa_switch *ds,u64 now,u64 ts_partial) {return 0 ; } -static inline int sja1105_ptp_reset (struct sja1105_private *priv) +static inline int sja1105_ptp_reset (struct dsa_switch *ds) {return 0 ; }
drivers/net/dsa/sja1105/sja1105_spi.c +1 -1
@@ -481,7 +481,7 @@ int sja1105_static_config_upload(struct sja1105_private *priv)dev_info (dev,"Succeeded after %d tried\n" ,RETRIES - retries); } - rc =sja1105_ptp_reset (priv); + rc =sja1105_ptp_reset (priv->ds);if (rc <0 )dev_err (dev,"Failed to reset PTP clock: %d\n" , rc);
Signature · 1 line
2.17.1
Vladimir Oltean
maintainerPATCH 3/4 net: dsa: sja1105: Move PTP data to its own private structure
In reply to Vladimir OlteanThis is a non-functional change with 2 goals (both for the case when CONFIG_NET_DSA_SJA1105_PTP is not enabled):
- Reduce the size of the sja1105_private structure.
- Make the PTP code more self-contained.
Leaving priv->ptp_data.lock to be initialized in sja1105_main.c is not a
leftover: it will be used in a future patch "net: dsa: sja1105: Restore PTP time after switch reset".
--- drivers/net/dsa/sja1105/sja1105.h | 13 +- drivers/net/dsa/sja1105/sja1105_main.c | 231 +---------------- drivers/net/dsa/sja1105/sja1105_ptp.c | 332 +++++++++++++++++++++---- drivers/net/dsa/sja1105/sja1105_ptp.h | 55 +++- 4 files changed, 335 insertions(+), 296 deletions(-)
drivers/net/dsa/sja1105/sja1105.h +2 -11
@@ -21,6 +21,7 @@#define SJA1105_AGEING_TIME_MS (ms) ((ms) / 10)#include "sja1105_tas.h" +#include "sja1105_ptp.h" /* Keeps the different addresses between E/T and P/Q/R/S */ struct sja1105_regs {
@@ -91,26 +92,16 @@ struct sja1105_private {struct spi_device *spidev;struct dsa_switch *ds;struct sja1105_port ports[SJA1105_NUM_PORTS ]; -struct ptp_clock_info ptp_caps; -struct ptp_clock *clock; -/* The cycle counter translates the PTP timestamps (based on -* a free-running counter) into a software time domain. -*/ -struct cyclecounter tstamp_cc; -struct timecounter tstamp_tc; -struct delayed_work refresh_work; -/* Serializes all operations on the cycle counter */ -struct mutex ptp_lock;/* Serializes transmission of management frames so that * the switch doesn't confuse them with one another. */ struct mutex mgmt_lock;struct sja1105_tagger_data tagger_data; +struct sja1105_ptp_data ptp_data;struct sja1105_tas_data tas_data; };#include "sja1105_dynamic_config.h" -#include "sja1105_ptp.h" struct sja1105_spi_message {u64 access;
drivers/net/dsa/sja1105/sja1105_main.c +2 -229
282 lines not on this page · raw message
drivers/net/dsa/sja1105/sja1105_ptp.c +288 -44
470 lines not on this page · raw message
drivers/net/dsa/sja1105/sja1105_ptp.h +43 -12
89 lines not on this page · raw message
Signature · 1 line
2.17.1
Vladimir Oltean
maintainerPATCH 4/4 net: dsa: sja1105: Change the PTP command access pattern
In reply to Vladimir OlteanThe PTP command register contains enable bits for:
- Putting the 64-bit PTPCLKVAL register in add/subtract or write mode
- Taking timestamps off of the corrected vs free-running clock
- Starting/stopping the TTEthernet scheduling
- Starting/stopping PPS output
- Resetting the switch
When a command needs to be issued (e.g. "change the PTPCLKVAL from write mode to add/subtract mode"), one cannot simply write to the command register setting the PTPCLKADD bit to 1, because that would zeroize the other settings. One also cannot do a read-modify-write (that would be too easy for this hardware) because not all bits of the command register are readable over SPI.
So this leaves us with the only option of keeping the value of the PTP command register in the driver, and operating on that.
Actually there are 2 types of PTP operations now:
- Operations that modify the cached PTP command. These operate on ptp_data->cmd as a pointer.
- Operations that apply all previously cached PTP settings, but don't otherwise cache what they did themselves. The sja1105_ptp_reset function is such an example. It copies the ptp_data->cmd on stack before modifying and writing it to SPI.
This practically means that struct sja1105_ptp_cmd is no longer an implementation detail, since it needs to be stored in full into struct sja1105_ptp_data, and hence in struct sja1105_private. So the (*ptp_cmd) function prototype can change and take struct sja1105_ptp_cmd as second argument now.
--- drivers/net/dsa/sja1105/sja1105.h | 3 ++- drivers/net/dsa/sja1105/sja1105_ptp.c | 14 +++++--------- drivers/net/dsa/sja1105/sja1105_ptp.h | 13 +++++++++++-- 3 files changed, 18 insertions(+), 12 deletions(-)
drivers/net/dsa/sja1105/sja1105.h +2 -1
@@ -72,7 +72,8 @@ struct sja1105_info {const struct sja1105_dynamic_table_ops *dyn_ops;const struct sja1105_table_ops *static_ops;const struct sja1105_regs *regs; -int (*ptp_cmd)(const struct dsa_switch *ds,const void *data); +int (*ptp_cmd)(const struct dsa_switch *ds, +const struct sja1105_ptp_cmd *cmd);int (*reset_cmd)(const void *ctx,const void *data);int (*setup_rgmii_delay)(const void *ctx,int port);/* Prototypes from include/net/dsa.h */
drivers/net/dsa/sja1105/sja1105_ptp.c +5 -9
@@ -59,10 +59,6 @@#define ptp_data_to_sja1105 (d) \ container_of((d), struct sja1105_private, ptp_data) -struct sja1105_ptp_cmd { -u64 resptp;/* reset */ -}; -static int sja1105_init_avb_params (struct sja1105_private *priv,bool on) {
@@ -212,10 +208,10 @@ int sja1105_get_ts_info(struct dsa_switch *ds, int port,return 0 ; } -int sja1105et_ptp_cmd (const struct dsa_switch *ds,const void *data) +int sja1105et_ptp_cmd (const struct dsa_switch *ds, +const struct sja1105_ptp_cmd *cmd) {const struct sja1105_private *priv = ds->priv; -const struct sja1105_ptp_cmd *cmd = data;const struct sja1105_regs *regs = priv->info->regs;const int size =SJA1105_SIZE_PTP_CMD ;u8 buf[SJA1105_SIZE_PTP_CMD ] = {0 };
@@ -229,10 +225,10 @@ int sja1105et_ptp_cmd(const struct dsa_switch *ds, const void *data) SJA1105_SIZE_PTP_CMD); } -int sja1105pqrs_ptp_cmd (const struct dsa_switch *ds,const void *data) +int sja1105pqrs_ptp_cmd (const struct dsa_switch *ds, +const struct sja1105_ptp_cmd *cmd) {const struct sja1105_private *priv = ds->priv; -const struct sja1105_ptp_cmd *cmd = data;const struct sja1105_regs *regs = priv->info->regs;const int size =SJA1105_SIZE_PTP_CMD ;u8 buf[SJA1105_SIZE_PTP_CMD ] = {0 };
@@ -422,7 +418,7 @@ int sja1105_ptp_reset(struct dsa_switch *ds) {struct sja1105_private *priv = ds->priv;struct sja1105_ptp_data *ptp_data = &priv->ptp_data; -struct sja1105_ptp_cmd cmd = {0 }; +struct sja1105_ptp_cmd cmd = ptp_data->cmd;int rc;mutex_lock (&ptp_data->lock);
drivers/net/dsa/sja1105/sja1105_ptp.h +11 -2
@@ -6,9 +6,14 @@ #if IS_ENABLED(CONFIG_NET_DSA_SJA1105_PTP) +struct sja1105_ptp_cmd { + u64 resptp; /* reset */ +}; + struct sja1105_ptp_data { struct ptp_clock_info caps; struct ptp_clock *clock; + struct sja1105_ptp_cmd cmd; /* The cycle counter translates the PTP timestamps (based on * a free-running counter) into a software time domain. */
@@ -23,9 +28,11 @@ int sja1105_ptp_clock_register(struct dsa_switch *ds);void sja1105_ptp_clock_unregister (struct dsa_switch *ds); -int sja1105et_ptp_cmd (const struct dsa_switch *ds,const void *data); +int sja1105et_ptp_cmd (const struct dsa_switch *ds, +const struct sja1105_ptp_cmd *cmd); -int sja1105pqrs_ptp_cmd (const struct dsa_switch *ds,const void *data); +int sja1105pqrs_ptp_cmd (const struct dsa_switch *ds, +const struct sja1105_ptp_cmd *cmd);int sja1105_get_ts_info (struct dsa_switch *ds,int port,struct ethtool_ts_info *ts);
@@ -47,6 +54,8 @@ int sja1105_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr);#else +struct sja1105_ptp_cmd ; +/* Structures cannot be empty in C. Bah! * Keep the mutex as the only element, which is a bit more difficult to * refactor out of sja1105_main.c anyway.
Signature · 1 line
2.17.1
Quoted 16 lines · Vladimir Oltean
This series creates a better separation between the driver core and the PTP portion. Therefore, users who are not interested in PTP can get a simpler and smaller driver by compiling it out.
This is in preparation for further patches: SPI transfer timestamping, synchronizing the hardware clock (as opposed to keeping it free-running), PPS input/output, etc.
Vladimir Oltean (4):
net: dsa: sja1105: Get rid of global declaration of struct
ptp_clock_info
net: dsa: sja1105: Make all public PTP functions takedsa_switchas
argument
net: dsa: sja1105: Move PTP data to its own private structure
net: dsa: sja1105: Change the PTP command access pattern
Quoted 6 lines
drivers/net/dsa/sja1105/sja1105.h | 16 +- drivers/net/dsa/sja1105/sja1105_main.c | 234 +-------------- drivers/net/dsa/sja1105/sja1105_ptp.c | 391 ++++++++++++++++++++----- drivers/net/dsa/sja1105/sja1105_ptp.h | 84 ++++-- drivers/net/dsa/sja1105/sja1105_spi.c | 2 +- 5 files changed, 386 insertions(+), 341 deletions(-)
David Miller
maintainerFrom: Richard Cochran <[email protected]>
Date: Sat, 12 Oct 2019 12:14:54 -0700
Quoted 17 lines · Vladimir Oltean
Quoted 16 lines
This series creates a better separation between the driver core and the PTP portion. Therefore, users who are not interested in PTP can get a simpler and smaller driver by compiling it out.
This is in preparation for further patches: SPI transfer timestamping, synchronizing the hardware clock (as opposed to keeping it free-running), PPS input/output, etc.
Vladimir Oltean (4):
net: dsa: sja1105: Get rid of global declaration of struct
ptp_clock_info
net: dsa: sja1105: Make all public PTP functions takedsa_switchas
argument
net: dsa: sja1105: Move PTP data to its own private structure
net: dsa: sja1105: Change the PTP command access pattern
Quoted 8 lines
Quoted 6 lines
drivers/net/dsa/sja1105/sja1105.h | 16 +- drivers/net/dsa/sja1105/sja1105_main.c | 234 +-------------- drivers/net/dsa/sja1105/sja1105_ptp.c | 391 ++++++++++++++++++++----- drivers/net/dsa/sja1105/sja1105_ptp.h | 84 ++++-- drivers/net/dsa/sja1105/sja1105_spi.c | 2 +- 5 files changed, 386 insertions(+), 341 deletions(-)Acked-by Richard Cochran <[email protected]>
Series applied, thanks everyone.