dp83640 219 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 222 drivers/net/phy/dp83640.c if (dp83640->clock->page != page) { dp83640 224 drivers/net/phy/dp83640.c dp83640->clock->page = page; dp83640 235 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 237 drivers/net/phy/dp83640.c if (dp83640->clock->page != page) { dp83640 239 drivers/net/phy/dp83640.c dp83640->clock->page = page; dp83640 298 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = clock->chosen; dp83640 299 drivers/net/phy/dp83640.c struct phy_device *phydev = dp83640->phydev; dp83640 542 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 543 drivers/net/phy/dp83640.c struct dp83640_clock *clock = dp83640->clock; dp83640 590 drivers/net/phy/dp83640.c static void prune_rx_ts(struct dp83640_private *dp83640) dp83640 595 drivers/net/phy/dp83640.c list_for_each_safe(this, next, &dp83640->rxts) { dp83640 599 drivers/net/phy/dp83640.c list_add(&rxts->list, &dp83640->rxpool); dp83640 739 drivers/net/phy/dp83640.c static int decode_evnt(struct dp83640_private *dp83640, dp83640 767 drivers/net/phy/dp83640.c dp83640->edata.sec_hi = phy_txts->sec_hi; dp83640 770 drivers/net/phy/dp83640.c dp83640->edata.sec_lo = phy_txts->sec_lo; dp83640 773 drivers/net/phy/dp83640.c dp83640->edata.ns_hi = phy_txts->ns_hi; dp83640 776 drivers/net/phy/dp83640.c dp83640->edata.ns_lo = phy_txts->ns_lo; dp83640 785 drivers/net/phy/dp83640.c event.timestamp = phy2txts(&dp83640->edata); dp83640 793 drivers/net/phy/dp83640.c ptp_clock_event(dp83640->clock->ptp_clock, &event); dp83640 850 drivers/net/phy/dp83640.c static void decode_rxts(struct dp83640_private *dp83640, dp83640 863 drivers/net/phy/dp83640.c spin_lock_irqsave(&dp83640->rx_lock, flags); dp83640 865 drivers/net/phy/dp83640.c prune_rx_ts(dp83640); dp83640 867 drivers/net/phy/dp83640.c if (list_empty(&dp83640->rxpool)) { dp83640 871 drivers/net/phy/dp83640.c rxts = list_first_entry(&dp83640->rxpool, struct rxts, list); dp83640 875 drivers/net/phy/dp83640.c spin_lock(&dp83640->rx_queue.lock); dp83640 876 drivers/net/phy/dp83640.c skb_queue_walk(&dp83640->rx_queue, skb) { dp83640 881 drivers/net/phy/dp83640.c __skb_unlink(skb, &dp83640->rx_queue); dp83640 885 drivers/net/phy/dp83640.c list_add(&rxts->list, &dp83640->rxpool); dp83640 889 drivers/net/phy/dp83640.c spin_unlock(&dp83640->rx_queue.lock); dp83640 892 drivers/net/phy/dp83640.c list_add_tail(&rxts->list, &dp83640->rxts); dp83640 894 drivers/net/phy/dp83640.c spin_unlock_irqrestore(&dp83640->rx_lock, flags); dp83640 900 drivers/net/phy/dp83640.c static void decode_txts(struct dp83640_private *dp83640, dp83640 911 drivers/net/phy/dp83640.c skb = skb_dequeue(&dp83640->tx_queue); dp83640 922 drivers/net/phy/dp83640.c skb = skb_dequeue(&dp83640->tx_queue); dp83640 938 drivers/net/phy/dp83640.c static void decode_status_frame(struct dp83640_private *dp83640, dp83640 960 drivers/net/phy/dp83640.c decode_rxts(dp83640, phy_rxts); dp83640 966 drivers/net/phy/dp83640.c decode_txts(dp83640, phy_txts); dp83640 971 drivers/net/phy/dp83640.c size = decode_evnt(dp83640, ptr, len, ests); dp83640 1137 drivers/net/phy/dp83640.c struct dp83640_private *dp83640; dp83640 1147 drivers/net/phy/dp83640.c dp83640 = kzalloc(sizeof(struct dp83640_private), GFP_KERNEL); dp83640 1148 drivers/net/phy/dp83640.c if (!dp83640) dp83640 1151 drivers/net/phy/dp83640.c dp83640->phydev = phydev; dp83640 1152 drivers/net/phy/dp83640.c INIT_DELAYED_WORK(&dp83640->ts_work, rx_timestamp_work); dp83640 1154 drivers/net/phy/dp83640.c INIT_LIST_HEAD(&dp83640->rxts); dp83640 1155 drivers/net/phy/dp83640.c INIT_LIST_HEAD(&dp83640->rxpool); dp83640 1157 drivers/net/phy/dp83640.c list_add(&dp83640->rx_pool_data[i].list, &dp83640->rxpool); dp83640 1159 drivers/net/phy/dp83640.c phydev->priv = dp83640; dp83640 1161 drivers/net/phy/dp83640.c spin_lock_init(&dp83640->rx_lock); dp83640 1162 drivers/net/phy/dp83640.c skb_queue_head_init(&dp83640->rx_queue); dp83640 1163 drivers/net/phy/dp83640.c skb_queue_head_init(&dp83640->tx_queue); dp83640 1165 drivers/net/phy/dp83640.c dp83640->clock = clock; dp83640 1168 drivers/net/phy/dp83640.c clock->chosen = dp83640; dp83640 1176 drivers/net/phy/dp83640.c list_add_tail(&dp83640->list, &clock->phylist); dp83640 1183 drivers/net/phy/dp83640.c kfree(dp83640); dp83640 1194 drivers/net/phy/dp83640.c struct dp83640_private *tmp, *dp83640 = phydev->priv; dp83640 1200 drivers/net/phy/dp83640.c cancel_delayed_work_sync(&dp83640->ts_work); dp83640 1202 drivers/net/phy/dp83640.c skb_queue_purge(&dp83640->rx_queue); dp83640 1203 drivers/net/phy/dp83640.c skb_queue_purge(&dp83640->tx_queue); dp83640 1205 drivers/net/phy/dp83640.c clock = dp83640_clock_get(dp83640->clock); dp83640 1207 drivers/net/phy/dp83640.c if (dp83640 == clock->chosen) { dp83640 1213 drivers/net/phy/dp83640.c if (tmp == dp83640) { dp83640 1221 drivers/net/phy/dp83640.c kfree(dp83640); dp83640 1243 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 1244 drivers/net/phy/dp83640.c struct dp83640_clock *clock = dp83640->clock; dp83640 1324 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 1337 drivers/net/phy/dp83640.c dp83640->hwts_tx_en = cfg.tx_type; dp83640 1341 drivers/net/phy/dp83640.c dp83640->hwts_rx_en = 0; dp83640 1342 drivers/net/phy/dp83640.c dp83640->layer = 0; dp83640 1343 drivers/net/phy/dp83640.c dp83640->version = 0; dp83640 1348 drivers/net/phy/dp83640.c dp83640->hwts_rx_en = 1; dp83640 1349 drivers/net/phy/dp83640.c dp83640->layer = PTP_CLASS_L4; dp83640 1350 drivers/net/phy/dp83640.c dp83640->version = PTP_CLASS_V1; dp83640 1355 drivers/net/phy/dp83640.c dp83640->hwts_rx_en = 1; dp83640 1356 drivers/net/phy/dp83640.c dp83640->layer = PTP_CLASS_L4; dp83640 1357 drivers/net/phy/dp83640.c dp83640->version = PTP_CLASS_V2; dp83640 1362 drivers/net/phy/dp83640.c dp83640->hwts_rx_en = 1; dp83640 1363 drivers/net/phy/dp83640.c dp83640->layer = PTP_CLASS_L2; dp83640 1364 drivers/net/phy/dp83640.c dp83640->version = PTP_CLASS_V2; dp83640 1369 drivers/net/phy/dp83640.c dp83640->hwts_rx_en = 1; dp83640 1370 drivers/net/phy/dp83640.c dp83640->layer = PTP_CLASS_L4 | PTP_CLASS_L2; dp83640 1371 drivers/net/phy/dp83640.c dp83640->version = PTP_CLASS_V2; dp83640 1377 drivers/net/phy/dp83640.c txcfg0 = (dp83640->version & TX_PTP_VER_MASK) << TX_PTP_VER_SHIFT; dp83640 1378 drivers/net/phy/dp83640.c rxcfg0 = (dp83640->version & TX_PTP_VER_MASK) << TX_PTP_VER_SHIFT; dp83640 1380 drivers/net/phy/dp83640.c if (dp83640->layer & PTP_CLASS_L2) { dp83640 1384 drivers/net/phy/dp83640.c if (dp83640->layer & PTP_CLASS_L4) { dp83640 1389 drivers/net/phy/dp83640.c if (dp83640->hwts_tx_en) dp83640 1392 drivers/net/phy/dp83640.c if (dp83640->hwts_tx_en == HWTSTAMP_TX_ONESTEP_SYNC) dp83640 1395 drivers/net/phy/dp83640.c if (dp83640->hwts_rx_en) dp83640 1398 drivers/net/phy/dp83640.c mutex_lock(&dp83640->clock->extreg_lock); dp83640 1403 drivers/net/phy/dp83640.c mutex_unlock(&dp83640->clock->extreg_lock); dp83640 1410 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = dp83640 1415 drivers/net/phy/dp83640.c while ((skb = skb_dequeue(&dp83640->rx_queue))) { dp83640 1420 drivers/net/phy/dp83640.c skb_queue_head(&dp83640->rx_queue, skb); dp83640 1427 drivers/net/phy/dp83640.c if (!skb_queue_empty(&dp83640->rx_queue)) dp83640 1428 drivers/net/phy/dp83640.c schedule_delayed_work(&dp83640->ts_work, SKB_TIMESTAMP_TIMEOUT); dp83640 1434 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 1442 drivers/net/phy/dp83640.c decode_status_frame(dp83640, skb); dp83640 1447 drivers/net/phy/dp83640.c if (!dp83640->hwts_rx_en) dp83640 1450 drivers/net/phy/dp83640.c if ((type & dp83640->version) == 0 || (type & dp83640->layer) == 0) dp83640 1453 drivers/net/phy/dp83640.c spin_lock_irqsave(&dp83640->rx_lock, flags); dp83640 1454 drivers/net/phy/dp83640.c prune_rx_ts(dp83640); dp83640 1455 drivers/net/phy/dp83640.c list_for_each_safe(this, next, &dp83640->rxts) { dp83640 1462 drivers/net/phy/dp83640.c list_add(&rxts->list, &dp83640->rxpool); dp83640 1466 drivers/net/phy/dp83640.c spin_unlock_irqrestore(&dp83640->rx_lock, flags); dp83640 1471 drivers/net/phy/dp83640.c skb_queue_tail(&dp83640->rx_queue, skb); dp83640 1472 drivers/net/phy/dp83640.c schedule_delayed_work(&dp83640->ts_work, SKB_TIMESTAMP_TIMEOUT); dp83640 1484 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = phydev->priv; dp83640 1486 drivers/net/phy/dp83640.c switch (dp83640->hwts_tx_en) { dp83640 1497 drivers/net/phy/dp83640.c skb_queue_tail(&dp83640->tx_queue, skb); dp83640 1509 drivers/net/phy/dp83640.c struct dp83640_private *dp83640 = dev->priv; dp83640 1515 drivers/net/phy/dp83640.c info->phc_index = ptp_clock_index(dp83640->clock->ptp_clock);