netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ptp/ptp_pch: Modified according to the mainter's comments
@ 2012-03-23  2:12 Takahiro Shimizu
  2012-03-23  2:12 ` [PATCH 2/2] net/pch_gbe: " Takahiro Shimizu
  2012-03-23  2:35 ` [PATCH 1/2] ptp/ptp_pch: " David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Takahiro Shimizu @ 2012-03-23  2:12 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/ptp_pch.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 375eb04..212381e 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -261,6 +261,7 @@ u64 pch_rx_snap_read(struct pci_dev *pdev)
 
 	ns = ((u64) hi) << 32;
 	ns |= lo;
+	ns <<= TICKS_NS_SHIFT;
 
 	return ns;
 }
@@ -277,6 +278,7 @@ u64 pch_tx_snap_read(struct pci_dev *pdev)
 
 	ns = ((u64) hi) << 32;
 	ns |= lo;
+	ns <<= TICKS_NS_SHIFT;
 
 	return ns;
 }
@@ -649,8 +651,6 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	iowrite32(1, &chip->regs->trgt_lo);
 	iowrite32(0, &chip->regs->trgt_hi);
 	iowrite32(PCH_TSE_TTIPEND, &chip->regs->event);
-	/* Version: IEEE1588 v1 and IEEE1588-2008,  Mode: All Evwnt, Locked  */
-	iowrite32(0x80020000, &chip->regs->ch_control);
 
 	pch_eth_enable_set(chip);
 
-- 
1.7.4.4

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

* [PATCH 2/2] net/pch_gbe: Modified according to the mainter's comments
  2012-03-23  2:12 [PATCH 1/2] ptp/ptp_pch: Modified according to the mainter's comments Takahiro Shimizu
@ 2012-03-23  2:12 ` Takahiro Shimizu
  2012-03-23  2:35 ` [PATCH 1/2] ptp/ptp_pch: " David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Takahiro Shimizu @ 2012-03-23  2:12 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>
---
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |   35 ++++++++-----------
 1 files changed, 15 insertions(+), 20 deletions(-)

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 8035e5f..d983e76 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
@@ -101,13 +101,11 @@ const char pch_driver_version[] = DRV_VERSION;
 
 #ifdef CONFIG_PCH_PTP
 /* Macros for ieee1588 */
-#define TICKS_NS_SHIFT  5
-
 /* 0x40 Time Synchronization Channel Control Register Bits */
 #define MASTER_MODE   (1<<0)
-#define SLAVE_MODE    (0<<0)
+#define SLAVE_MODE    (0)
 #define V2_MODE       (1<<31)
-#define CAP_MODE0     (0<<16)
+#define CAP_MODE0     (0)
 #define CAP_MODE2     (1<<17)
 
 /* 0x44 Time Synchronization Channel Event Register Bits */
@@ -129,14 +127,13 @@ static struct sock_filter ptp_filter[] = {
 static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
 {
 	u8 *data = skb->data;
-	unsigned int offset;
+	unsigned int offset, sk_filter;
 	u16 *hi, *id;
 	u32 lo;
 
-	if ((sk_run_filter(skb, ptp_filter) != PTP_CLASS_V2_IPV4) &&
-		(sk_run_filter(skb, ptp_filter) != PTP_CLASS_V1_IPV4)) {
+	sk_filter = sk_run_filter(skb, ptp_filter);
+	if ((sk_filter != PTP_CLASS_V2) && (sk_filter != PTP_CLASS_V1))
 		return 0;
-	}
 
 	offset = ETH_HLEN + IPV4_HLEN(data) + UDP_HLEN;
 
@@ -153,8 +150,8 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
 		seqid  == *id);
 }
 
-static void pch_rx_timestamp(
-			struct pch_gbe_adapter *adapter, struct sk_buff *skb)
+static void
+pch_rx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb)
 {
 	struct skb_shared_hwtstamps *shhwtstamps;
 	struct pci_dev *pdev;
@@ -183,7 +180,6 @@ static void pch_rx_timestamp(
 		goto out;
 
 	ns = pch_rx_snap_read(pdev);
-	ns <<= TICKS_NS_SHIFT;
 
 	shhwtstamps = skb_hwtstamps(skb);
 	memset(shhwtstamps, 0, sizeof(*shhwtstamps));
@@ -192,8 +188,8 @@ out:
 	pch_ch_event_write(pdev, RX_SNAPSHOT_LOCKED);
 }
 
-static void pch_tx_timestamp(
-			struct pch_gbe_adapter *adapter, struct sk_buff *skb)
+static void
+pch_tx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb)
 {
 	struct skb_shared_hwtstamps shhwtstamps;
 	struct pci_dev *pdev;
@@ -202,11 +198,11 @@ static void pch_tx_timestamp(
 	u32 cnt, val;
 
 	shtx = skb_shinfo(skb);
-	if (unlikely(shtx->tx_flags & SKBTX_HW_TSTAMP && adapter->hwts_tx_en))
-		shtx->tx_flags |= SKBTX_IN_PROGRESS;
-	else
+	if (likely(!(shtx->tx_flags & SKBTX_HW_TSTAMP && adapter->hwts_tx_en)))
 		return;
 
+	shtx->tx_flags |= SKBTX_IN_PROGRESS;
+
 	/* Get ieee1588's dev information */
 	pdev = adapter->ptp_pdev;
 
@@ -226,7 +222,6 @@ static void pch_tx_timestamp(
 	}
 
 	ns = pch_tx_snap_read(pdev);
-	ns <<= TICKS_NS_SHIFT;
 
 	memset(&shhwtstamps, 0, sizeof(shhwtstamps));
 	shhwtstamps.hwtstamp = ns_to_ktime(ns);
@@ -267,15 +262,15 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 		break;
 	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
 		adapter->hwts_rx_en = 0;
-		pch_ch_control_write(pdev, (SLAVE_MODE | CAP_MODE0));
+		pch_ch_control_write(pdev, SLAVE_MODE | CAP_MODE0);
 		break;
 	case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
 		adapter->hwts_rx_en = 1;
-		pch_ch_control_write(pdev, (MASTER_MODE | CAP_MODE0));
+		pch_ch_control_write(pdev, MASTER_MODE | CAP_MODE0);
 		break;
 	case HWTSTAMP_FILTER_PTP_V2_EVENT:
 		adapter->hwts_rx_en = 1;
-		pch_ch_control_write(pdev, (V2_MODE | CAP_MODE2));
+		pch_ch_control_write(pdev, V2_MODE | CAP_MODE2);
 		break;
 	default:
 		return -ERANGE;
-- 
1.7.4.4

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

* Re: [PATCH 1/2] ptp/ptp_pch: Modified according to the mainter's comments
  2012-03-23  2:12 [PATCH 1/2] ptp/ptp_pch: Modified according to the mainter's comments Takahiro Shimizu
  2012-03-23  2:12 ` [PATCH 2/2] net/pch_gbe: " Takahiro Shimizu
@ 2012-03-23  2:35 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-03-23  2:35 UTC (permalink / raw)
  To: tshimizu818
  Cc: jeffrey.t.kirsher, lucas.demarchi, mirq-linux, paul.gortmaker,
	jdmason, john.stultz, richardcochran, arnd, khc, netdev,
	linux-kernel, qi.wang, yong.y.wang, joel.clark, kok.howg.ewe


You've sent three sets of patches.

And you've numbered them individually within each set.

And this is totally confusing.

Does one set need to be applied before another set?  And if so,
in what order.

I'm tossing all of your patches, submit your changes properly,
orderred together as one single set of numberred patches.

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23  2:12 [PATCH 1/2] ptp/ptp_pch: Modified according to the mainter's comments Takahiro Shimizu
2012-03-23  2:12 ` [PATCH 2/2] net/pch_gbe: " Takahiro Shimizu
2012-03-23  2:35 ` [PATCH 1/2] ptp/ptp_pch: " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).