aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/oki-semi
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-10-31 11:33:52 -0400
committerDavid S. Miller <davem@davemloft.net>2012-11-01 11:35:18 -0400
commita24006ed12616bde1bbdb26868495906a212d8dc (patch)
treeb03b42a75f1ff9ced6e2ab75efe6f7b3c8aa3ef2 /drivers/net/ethernet/oki-semi
parent42a7ccef0a06519e2ea0be71d7c0f4ed9198509f (diff)
ptp: Enable clock drivers along with associated net/PHY drivers
Where a PTP clock driver is associated with a net or PHY driver, it should be enabled automatically whenever that driver is enabled. Therefore: - Make PTP clock drivers select rather than depending on PTP_1588_CLOCK - Remove separate boolean options for PTP clock drivers that are built as part of net driver modules. (This also fixes cases where the PTP subsystem is wrongly forced to be built-in.) - Set 'default y' for PTP clock drivers that depend on specific net drivers but are built separately Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/oki-semi')
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/Kconfig14
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h2
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c14
3 files changed, 0 insertions, 30 deletions
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
index d0e36f2b6fba..00bc4fc968c7 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
@@ -20,17 +20,3 @@ config PCH_GBE
20 purpose use. 20 purpose use.
21 ML7223/ML7831 is companion chip for Intel Atom E6xx series. 21 ML7223/ML7831 is companion chip for Intel Atom E6xx series.
22 ML7223/ML7831 is completely compatible for Intel EG20T PCH. 22 ML7223/ML7831 is completely compatible for Intel EG20T PCH.
23
24if PCH_GBE
25
26config PCH_PTP
27 bool "PCH PTP clock support"
28 default n
29 select PTP_1588_CLOCK
30 select PTP_1588_CLOCK_PCH
31 ---help---
32 Say Y here if you want to use Precision Time Protocol (PTP) in the
33 driver. PTP is a method to precisely synchronize distributed clocks
34 over Ethernet networks.
35
36endif # PCH_GBE
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 b07311eaa693..7fb7e178c74e 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
@@ -649,7 +649,6 @@ extern void pch_gbe_free_tx_resources(struct pch_gbe_adapter *adapter,
649extern void pch_gbe_free_rx_resources(struct pch_gbe_adapter *adapter, 649extern void pch_gbe_free_rx_resources(struct pch_gbe_adapter *adapter,
650 struct pch_gbe_rx_ring *rx_ring); 650 struct pch_gbe_rx_ring *rx_ring);
651extern void pch_gbe_update_stats(struct pch_gbe_adapter *adapter); 651extern void pch_gbe_update_stats(struct pch_gbe_adapter *adapter);
652#ifdef CONFIG_PCH_PTP
653extern u32 pch_ch_control_read(struct pci_dev *pdev); 652extern u32 pch_ch_control_read(struct pci_dev *pdev);
654extern void pch_ch_control_write(struct pci_dev *pdev, u32 val); 653extern void pch_ch_control_write(struct pci_dev *pdev, u32 val);
655extern u32 pch_ch_event_read(struct pci_dev *pdev); 654extern u32 pch_ch_event_read(struct pci_dev *pdev);
@@ -659,7 +658,6 @@ extern u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
659extern u64 pch_rx_snap_read(struct pci_dev *pdev); 658extern u64 pch_rx_snap_read(struct pci_dev *pdev);
660extern u64 pch_tx_snap_read(struct pci_dev *pdev); 659extern u64 pch_tx_snap_read(struct pci_dev *pdev);
661extern int pch_set_station_address(u8 *addr, struct pci_dev *pdev); 660extern int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
662#endif
663 661
664/* pch_gbe_param.c */ 662/* pch_gbe_param.c */
665extern void pch_gbe_check_options(struct pch_gbe_adapter *adapter); 663extern void pch_gbe_check_options(struct pch_gbe_adapter *adapter);
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 b2a94d02a521..499249a15e88 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
@@ -21,10 +21,8 @@
21#include "pch_gbe.h" 21#include "pch_gbe.h"
22#include "pch_gbe_api.h" 22#include "pch_gbe_api.h"
23#include <linux/module.h> 23#include <linux/module.h>
24#ifdef CONFIG_PCH_PTP
25#include <linux/net_tstamp.h> 24#include <linux/net_tstamp.h>
26#include <linux/ptp_classify.h> 25#include <linux/ptp_classify.h>
27#endif
28 26
29#define DRV_VERSION "1.01" 27#define DRV_VERSION "1.01"
30const char pch_driver_version[] = DRV_VERSION; 28const char pch_driver_version[] = DRV_VERSION;
@@ -98,7 +96,6 @@ const char pch_driver_version[] = DRV_VERSION;
98 96
99#define PCH_GBE_INT_DISABLE_ALL 0 97#define PCH_GBE_INT_DISABLE_ALL 0
100 98
101#ifdef CONFIG_PCH_PTP
102/* Macros for ieee1588 */ 99/* Macros for ieee1588 */
103/* 0x40 Time Synchronization Channel Control Register Bits */ 100/* 0x40 Time Synchronization Channel Control Register Bits */
104#define MASTER_MODE (1<<0) 101#define MASTER_MODE (1<<0)
@@ -113,7 +110,6 @@ const char pch_driver_version[] = DRV_VERSION;
113 110
114#define PTP_L4_MULTICAST_SA "01:00:5e:00:01:81" 111#define PTP_L4_MULTICAST_SA "01:00:5e:00:01:81"
115#define PTP_L2_MULTICAST_SA "01:1b:19:00:00:00" 112#define PTP_L2_MULTICAST_SA "01:1b:19:00:00:00"
116#endif
117 113
118static unsigned int copybreak __read_mostly = PCH_GBE_COPYBREAK_DEFAULT; 114static unsigned int copybreak __read_mostly = PCH_GBE_COPYBREAK_DEFAULT;
119 115
@@ -122,7 +118,6 @@ static void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg,
122 int data); 118 int data);
123static void pch_gbe_set_multi(struct net_device *netdev); 119static void pch_gbe_set_multi(struct net_device *netdev);
124 120
125#ifdef CONFIG_PCH_PTP
126static struct sock_filter ptp_filter[] = { 121static struct sock_filter ptp_filter[] = {
127 PTP_FILTER 122 PTP_FILTER
128}; 123};
@@ -291,7 +286,6 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
291 286
292 return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0; 287 return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0;
293} 288}
294#endif
295 289
296inline void pch_gbe_mac_load_mac_addr(struct pch_gbe_hw *hw) 290inline void pch_gbe_mac_load_mac_addr(struct pch_gbe_hw *hw)
297{ 291{
@@ -1261,9 +1255,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
1261 (int)sizeof(struct pch_gbe_tx_desc) * ring_num, 1255 (int)sizeof(struct pch_gbe_tx_desc) * ring_num,
1262 &hw->reg->TX_DSC_SW_P); 1256 &hw->reg->TX_DSC_SW_P);
1263 1257
1264#ifdef CONFIG_PCH_PTP
1265 pch_tx_timestamp(adapter, skb); 1258 pch_tx_timestamp(adapter, skb);
1266#endif
1267 1259
1268 dev_kfree_skb_any(skb); 1260 dev_kfree_skb_any(skb);
1269} 1261}
@@ -1771,9 +1763,7 @@ pch_gbe_clean_rx(struct pch_gbe_adapter *adapter,
1771 /* Write meta date of skb */ 1763 /* Write meta date of skb */
1772 skb_put(skb, length); 1764 skb_put(skb, length);
1773 1765
1774#ifdef CONFIG_PCH_PTP
1775 pch_rx_timestamp(adapter, skb); 1766 pch_rx_timestamp(adapter, skb);
1776#endif
1777 1767
1778 skb->protocol = eth_type_trans(skb, netdev); 1768 skb->protocol = eth_type_trans(skb, netdev);
1779 if (tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK) 1769 if (tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK)
@@ -2369,10 +2359,8 @@ static int pch_gbe_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
2369 2359
2370 pr_debug("cmd : 0x%04x\n", cmd); 2360 pr_debug("cmd : 0x%04x\n", cmd);
2371 2361
2372#ifdef CONFIG_PCH_PTP
2373 if (cmd == SIOCSHWTSTAMP) 2362 if (cmd == SIOCSHWTSTAMP)
2374 return hwtstamp_ioctl(netdev, ifr, cmd); 2363 return hwtstamp_ioctl(netdev, ifr, cmd);
2375#endif
2376 2364
2377 return generic_mii_ioctl(&adapter->mii, if_mii(ifr), cmd, NULL); 2365 return generic_mii_ioctl(&adapter->mii, if_mii(ifr), cmd, NULL);
2378} 2366}
@@ -2665,14 +2653,12 @@ static int pch_gbe_probe(struct pci_dev *pdev,
2665 goto err_free_netdev; 2653 goto err_free_netdev;
2666 } 2654 }
2667 2655
2668#ifdef CONFIG_PCH_PTP
2669 adapter->ptp_pdev = pci_get_bus_and_slot(adapter->pdev->bus->number, 2656 adapter->ptp_pdev = pci_get_bus_and_slot(adapter->pdev->bus->number,
2670 PCI_DEVFN(12, 4)); 2657 PCI_DEVFN(12, 4));
2671 if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) { 2658 if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) {
2672 pr_err("Bad ptp filter\n"); 2659 pr_err("Bad ptp filter\n");
2673 return -EINVAL; 2660 return -EINVAL;
2674 } 2661 }
2675#endif
2676 2662
2677 netdev->netdev_ops = &pch_gbe_netdev_ops; 2663 netdev->netdev_ops = &pch_gbe_netdev_ops;
2678 netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD; 2664 netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;