All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ptp/ptp_pch: Changed PTP supporting mode
@ 2012-03-23  2:18 Takahiro Shimizu
  2012-03-23  2:18 ` [PATCH 2/2] net/pch_gbe: " Takahiro Shimizu
  0 siblings, 1 reply; 2+ messages in thread
From: Takahiro Shimizu @ 2012-03-23  2:18 UTC (permalink / raw)
  To: jeffrey.t.kirsher, davem, lucas.demarchi, mirq-linux,
	paul.gortmaker, jdmason, john.stultz, richardcochran, arnd, khc,
	netdev, linux-kernel
  Cc: qi.wang, yong.y.wang, joel.clark, kok.howg.ewe, Takahiro Shimizu


Signed-off-by: Takahiro Shimizu <tshimizu818@gmail.com>
---
 drivers/ptp/Kconfig   |    4 ++--
 drivers/ptp/ptp_pch.c |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index cd9bc3b..6af221b 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -78,8 +78,8 @@ config PTP_1588_CLOCK_PCH
 	depends on PCH_GBE
 	help
 	  This driver adds support for using the PCH EG20T as a PTP
-	  clock. This clock is only useful if your PTP programs are
-	  getting hardware time stamps on the PTP Ethernet packets
+	  clock E2E mode. This clock is only useful if your PTP programs
+	  are getting hardware time stamps on the PTP Ethernet packets
 	  using the SO_TIMESTAMPING API.
 
 	  To compile this driver as a module, choose M here: the module
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 212381e..08c3311 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -308,7 +308,7 @@ static void pch_reset(struct pch_dev *chip)
  *				    traffic on the  ethernet interface
  * @addr:	dress which contain the column separated address to be used.
  */
-static int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
+int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
 {
 	s32 i;
 	struct pch_dev *chip = pci_get_drvdata(pdev);
@@ -352,6 +352,7 @@ static int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
 	}
 	return 0;
 }
+EXPORT_SYMBOL(pch_set_station_address);
 
 /*
  * Interrupt service routine
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] net/pch_gbe: Changed PTP supporting mode
  2012-03-23  2:18 [PATCH 1/2] ptp/ptp_pch: Changed PTP supporting mode Takahiro Shimizu
@ 2012-03-23  2:18 ` Takahiro Shimizu
  0 siblings, 0 replies; 2+ messages in thread
From: Takahiro Shimizu @ 2012-03-23  2:18 UTC (permalink / raw)
  To: jeffrey.t.kirsher, davem, lucas.demarchi, mirq-linux,
	paul.gortmaker, jdmason, john.stultz, richardcochran, arnd, khc,
	netdev, linux-kernel
  Cc: qi.wang, yong.y.wang, joel.clark, kok.howg.ewe, Takahiro Shimizu


Signed-off-by: Takahiro Shimizu <tshimizu818@gmail.com>
---
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h    |    1 +
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
index dd14915..9f3dbc4 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
@@ -660,6 +660,7 @@ extern u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
 extern u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
 extern u64 pch_rx_snap_read(struct pci_dev *pdev);
 extern u64 pch_tx_snap_read(struct pci_dev *pdev);
+extern int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
 #endif
 
 /* pch_gbe_param.c */
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 56089ca..776bcf2 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -111,6 +111,9 @@ const char pch_driver_version[] = DRV_VERSION;
 /* 0x44 Time Synchronization Channel Event Register Bits */
 #define TX_SNAPSHOT_LOCKED (1<<0)
 #define RX_SNAPSHOT_LOCKED (1<<1)
+
+#define PTP_L4_MULTICAST_SA "01:00:5e:00:01:81"
+#define PTP_L2_MULTICAST_SA "01:1b:19:00:00:00"
 #endif
 
 static unsigned int copybreak __read_mostly = PCH_GBE_COPYBREAK_DEFAULT;
@@ -235,6 +238,7 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 	struct hwtstamp_config cfg;
 	struct pch_gbe_adapter *adapter = netdev_priv(netdev);
 	struct pci_dev *pdev;
+	u8 station[20];
 
 	if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
 		return -EFAULT;
@@ -268,9 +272,17 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 		adapter->hwts_rx_en = 1;
 		pch_ch_control_write(pdev, MASTER_MODE | CAP_MODE0);
 		break;
-	case HWTSTAMP_FILTER_PTP_V2_EVENT:
+	case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
+		adapter->hwts_rx_en = 1;
+		pch_ch_control_write(pdev, V2_MODE | CAP_MODE2);
+		strcpy(station, PTP_L4_MULTICAST_SA);
+		pch_set_station_address(station, pdev);
+		break;
+	case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
 		adapter->hwts_rx_en = 1;
 		pch_ch_control_write(pdev, V2_MODE | CAP_MODE2);
+		strcpy(station, PTP_L2_MULTICAST_SA);
+		pch_set_station_address(station, pdev);
 		break;
 	default:
 		return -ERANGE;
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-23  2:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23  2:18 [PATCH 1/2] ptp/ptp_pch: Changed PTP supporting mode Takahiro Shimizu
2012-03-23  2:18 ` [PATCH 2/2] net/pch_gbe: " Takahiro Shimizu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.