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 */
#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)
{
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};
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};
{
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);
#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.
*/
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);
#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.