aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth.c
diff options
context:
space:
mode:
authorLi Yang <leoli@freescale.com>2007-07-18 23:47:47 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-24 16:28:38 -0400
commitac421852b3a01e7440ac7bb2e635b60a99d0a391 (patch)
treeb5dc87e69b764cf40cb5fb3a915340e1bbd0a08b /drivers/net/ucc_geth.c
parentf695baf2df9e0413d3521661070103711545207a (diff)
ucc_geth: add ethtool support
The patch enables statistics in ucc_geth and adds ethtool support to ucc_geth driver. Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r--drivers/net/ucc_geth.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index e4736a3b1b7a..4a3fd62156d9 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -43,10 +43,6 @@
43 43
44#undef DEBUG 44#undef DEBUG
45 45
46#define DRV_DESC "QE UCC Gigabit Ethernet Controller"
47#define DRV_NAME "ucc_geth"
48#define DRV_VERSION "1.1"
49
50#define ugeth_printk(level, format, arg...) \ 46#define ugeth_printk(level, format, arg...) \
51 printk(level format "\n", ## arg) 47 printk(level format "\n", ## arg)
52 48
@@ -65,6 +61,8 @@
65#define ugeth_vdbg(fmt, args...) do { } while (0) 61#define ugeth_vdbg(fmt, args...) do { } while (0)
66#endif /* UGETH_VERBOSE_DEBUG */ 62#endif /* UGETH_VERBOSE_DEBUG */
67 63
64void uec_set_ethtool_ops(struct net_device *netdev);
65
68static DEFINE_SPINLOCK(ugeth_lock); 66static DEFINE_SPINLOCK(ugeth_lock);
69 67
70static struct ucc_geth_info ugeth_primary_info = { 68static struct ucc_geth_info ugeth_primary_info = {
@@ -104,6 +102,7 @@ static struct ucc_geth_info ugeth_primary_info = {
104 .maxRetransmission = 0xf, 102 .maxRetransmission = 0xf,
105 .collisionWindow = 0x37, 103 .collisionWindow = 0x37,
106 .receiveFlowControl = 1, 104 .receiveFlowControl = 1,
105 .transmitFlowControl = 1,
107 .maxGroupAddrInHash = 4, 106 .maxGroupAddrInHash = 4,
108 .maxIndAddrInHash = 4, 107 .maxIndAddrInHash = 4,
109 .prel = 7, 108 .prel = 7,
@@ -139,7 +138,9 @@ static struct ucc_geth_info ugeth_primary_info = {
139 .numStationAddresses = UCC_GETH_NUM_OF_STATION_ADDRESSES_1, 138 .numStationAddresses = UCC_GETH_NUM_OF_STATION_ADDRESSES_1,
140 .largestexternallookupkeysize = 139 .largestexternallookupkeysize =
141 QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE, 140 QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE,
142 .statisticsMode = UCC_GETH_STATISTICS_GATHERING_MODE_NONE, 141 .statisticsMode = UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE |
142 UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX |
143 UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX,
143 .vlanOperationTagged = UCC_GETH_VLAN_OPERATION_TAGGED_NOP, 144 .vlanOperationTagged = UCC_GETH_VLAN_OPERATION_TAGGED_NOP,
144 .vlanOperationNonTagged = UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP, 145 .vlanOperationNonTagged = UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP,
145 .rxQoSMode = UCC_GETH_QOS_MODE_DEFAULT, 146 .rxQoSMode = UCC_GETH_QOS_MODE_DEFAULT,
@@ -1200,7 +1201,7 @@ static int init_inter_frame_gap_params(u8 non_btb_cs_ipg,
1200 return 0; 1201 return 0;
1201} 1202}
1202 1203
1203static int init_flow_control_params(u32 automatic_flow_control_mode, 1204int init_flow_control_params(u32 automatic_flow_control_mode,
1204 int rx_flow_control_enable, 1205 int rx_flow_control_enable,
1205 int tx_flow_control_enable, 1206 int tx_flow_control_enable,
1206 u16 pause_period, 1207 u16 pause_period,
@@ -2507,7 +2508,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
2507 /* For more details see the hardware spec. */ 2508 /* For more details see the hardware spec. */
2508 init_flow_control_params(ug_info->aufc, 2509 init_flow_control_params(ug_info->aufc,
2509 ug_info->receiveFlowControl, 2510 ug_info->receiveFlowControl,
2510 1, 2511 ug_info->transmitFlowControl,
2511 ug_info->pausePeriod, 2512 ug_info->pausePeriod,
2512 ug_info->extensionField, 2513 ug_info->extensionField,
2513 &uf_regs->upsmr, 2514 &uf_regs->upsmr,
@@ -3732,8 +3733,6 @@ static int ucc_geth_close(struct net_device *dev)
3732 return 0; 3733 return 0;
3733} 3734}
3734 3735
3735const struct ethtool_ops ucc_geth_ethtool_ops = { };
3736
3737static phy_interface_t to_phy_interface(const char *phy_connection_type) 3736static phy_interface_t to_phy_interface(const char *phy_connection_type)
3738{ 3737{
3739 if (strcasecmp(phy_connection_type, "mii") == 0) 3738 if (strcasecmp(phy_connection_type, "mii") == 0)
@@ -3896,6 +3895,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3896 SET_NETDEV_DEV(dev, device); 3895 SET_NETDEV_DEV(dev, device);
3897 3896
3898 /* Fill in the dev structure */ 3897 /* Fill in the dev structure */
3898 uec_set_ethtool_ops(dev);
3899 dev->open = ucc_geth_open; 3899 dev->open = ucc_geth_open;
3900 dev->hard_start_xmit = ucc_geth_start_xmit; 3900 dev->hard_start_xmit = ucc_geth_start_xmit;
3901 dev->tx_timeout = ucc_geth_timeout; 3901 dev->tx_timeout = ucc_geth_timeout;
@@ -3909,7 +3909,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3909// dev->change_mtu = ucc_geth_change_mtu; 3909// dev->change_mtu = ucc_geth_change_mtu;
3910 dev->mtu = 1500; 3910 dev->mtu = 1500;
3911 dev->set_multicast_list = ucc_geth_set_multi; 3911 dev->set_multicast_list = ucc_geth_set_multi;
3912 dev->ethtool_ops = &ucc_geth_ethtool_ops;
3913 3912
3914 ugeth->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1; 3913 ugeth->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
3915 ugeth->phy_interface = phy_interface; 3914 ugeth->phy_interface = phy_interface;