Lines Matching refs:hellcreek
21 struct hellcreek *hellcreek = ds->priv; in hellcreek_get_ts_info() local
23 info->phc_index = hellcreek->ptp_clock ? in hellcreek_get_ts_info()
24 ptp_clock_index(hellcreek->ptp_clock) : -1; in hellcreek_get_ts_info()
42 static int hellcreek_set_hwtstamp_config(struct hellcreek *hellcreek, int port, in hellcreek_set_hwtstamp_config() argument
46 &hellcreek->ports[port].port_hwtstamp; in hellcreek_set_hwtstamp_config()
119 struct hellcreek *hellcreek = ds->priv; in hellcreek_port_hwtstamp_set() local
124 ps = &hellcreek->ports[port].port_hwtstamp; in hellcreek_port_hwtstamp_set()
129 err = hellcreek_set_hwtstamp_config(hellcreek, port, &config); in hellcreek_port_hwtstamp_set()
143 struct hellcreek *hellcreek = ds->priv; in hellcreek_port_hwtstamp_get() local
147 ps = &hellcreek->ports[port].port_hwtstamp; in hellcreek_port_hwtstamp_get()
157 static struct ptp_header *hellcreek_should_tstamp(struct hellcreek *hellcreek, in hellcreek_should_tstamp() argument
162 &hellcreek->ports[port].port_hwtstamp; in hellcreek_should_tstamp()
185 static int hellcreek_ptp_hwtstamp_available(struct hellcreek *hellcreek, in hellcreek_ptp_hwtstamp_available() argument
190 status = hellcreek_ptp_read(hellcreek, ts_reg); in hellcreek_ptp_hwtstamp_available()
193 dev_err(hellcreek->dev, in hellcreek_ptp_hwtstamp_available()
203 static u64 hellcreek_ptp_hwtstamp_read(struct hellcreek *hellcreek, in hellcreek_ptp_hwtstamp_read() argument
208 nsh = hellcreek_ptp_read(hellcreek, ts_reg); in hellcreek_ptp_hwtstamp_read()
209 nsh = hellcreek_ptp_read(hellcreek, ts_reg); in hellcreek_ptp_hwtstamp_read()
210 nsh = hellcreek_ptp_read(hellcreek, ts_reg); in hellcreek_ptp_hwtstamp_read()
211 nsh = hellcreek_ptp_read(hellcreek, ts_reg); in hellcreek_ptp_hwtstamp_read()
212 nsl = hellcreek_ptp_read(hellcreek, ts_reg); in hellcreek_ptp_hwtstamp_read()
217 static int hellcreek_txtstamp_work(struct hellcreek *hellcreek, in hellcreek_txtstamp_work() argument
239 dev_err(hellcreek->dev, "Wrong port for timestamping!\n"); in hellcreek_txtstamp_work()
243 ts_status = hellcreek_ptp_hwtstamp_available(hellcreek, status_reg); in hellcreek_txtstamp_work()
252 dev_err(hellcreek->dev, in hellcreek_txtstamp_work()
263 mutex_lock(&hellcreek->ptp_lock); in hellcreek_txtstamp_work()
264 ns = hellcreek_ptp_hwtstamp_read(hellcreek, data_reg); in hellcreek_txtstamp_work()
265 ns += hellcreek_ptp_gettime_seconds(hellcreek, ns); in hellcreek_txtstamp_work()
266 mutex_unlock(&hellcreek->ptp_lock); in hellcreek_txtstamp_work()
296 static void hellcreek_get_rxts(struct hellcreek *hellcreek, in hellcreek_get_rxts() argument
330 mutex_lock(&hellcreek->ptp_lock); in hellcreek_get_rxts()
331 ns += hellcreek_ptp_gettime_seconds(hellcreek, ns); in hellcreek_get_rxts()
332 mutex_unlock(&hellcreek->ptp_lock); in hellcreek_get_rxts()
342 static void hellcreek_rxtstamp_work(struct hellcreek *hellcreek, in hellcreek_rxtstamp_work() argument
350 hellcreek_get_rxts(hellcreek, ps, skb, &ps->rx_queue, port); in hellcreek_rxtstamp_work()
355 struct hellcreek *hellcreek = ptp_to_hellcreek(ptp); in hellcreek_hwtstamp_work() local
356 struct dsa_switch *ds = hellcreek->ds; in hellcreek_hwtstamp_work()
365 ps = &hellcreek->ports[i].port_hwtstamp; in hellcreek_hwtstamp_work()
368 restart |= hellcreek_txtstamp_work(hellcreek, ps, i); in hellcreek_hwtstamp_work()
370 hellcreek_rxtstamp_work(hellcreek, ps, i); in hellcreek_hwtstamp_work()
379 struct hellcreek *hellcreek = ds->priv; in hellcreek_port_txtstamp() local
385 ps = &hellcreek->ports[port].port_hwtstamp; in hellcreek_port_txtstamp()
395 hdr = hellcreek_should_tstamp(hellcreek, port, skb, type); in hellcreek_port_txtstamp()
416 ptp_schedule_worker(hellcreek->ptp_clock, 0); in hellcreek_port_txtstamp()
422 struct hellcreek *hellcreek = ds->priv; in hellcreek_port_rxtstamp() local
426 ps = &hellcreek->ports[port].port_hwtstamp; in hellcreek_port_rxtstamp()
438 hdr = hellcreek_should_tstamp(hellcreek, port, skb, type); in hellcreek_port_rxtstamp()
446 ptp_schedule_worker(hellcreek->ptp_clock, 0); in hellcreek_port_rxtstamp()
451 static void hellcreek_hwtstamp_port_setup(struct hellcreek *hellcreek, int port) in hellcreek_hwtstamp_port_setup() argument
454 &hellcreek->ports[port].port_hwtstamp; in hellcreek_hwtstamp_port_setup()
459 int hellcreek_hwtstamp_setup(struct hellcreek *hellcreek) in hellcreek_hwtstamp_setup() argument
461 struct dsa_switch *ds = hellcreek->ds; in hellcreek_hwtstamp_setup()
469 hellcreek_hwtstamp_port_setup(hellcreek, i); in hellcreek_hwtstamp_setup()
475 hellcreek_ptp_write(hellcreek, PR_SETTINGS_C_TS_SRC_TK_MASK | in hellcreek_hwtstamp_setup()
482 void hellcreek_hwtstamp_free(struct hellcreek *hellcreek) in hellcreek_hwtstamp_free() argument