Skip to contentSkip to conversation

IXP4xx: Silence section mismatch warning in Ethernet driver.

RFC In review Krzysztof Halasa 1 participant 6 messages Dec 21, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 IXP4xx: Silence section mismatch warning in Ethernet driver.

Few patches I'm posting for review only.

Not for operational use.

IXP4xx: Silence section mismatch warning in Ethernet driver.

drivers/net/arm/ixp4xx_eth.c +3 -3
@@ -1232,7 +1232,7 @@ static int __devexit eth_remove_one(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_driver drv = {
+static struct platform_driver ixp4xx_eth_driver = {
 	.driver.name	= DRV_NAME,
 	.probe		= eth_init_one,
 	.remove		= eth_remove_one,
@@ -1248,12 +1248,12 @@ static int __init eth_init_module(void)
 	mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
 	__raw_writel(DEFAULT_CORE_CNTRL, &mdio_regs->core_control);
 
-	return platform_driver_register(&drv);
+	return platform_driver_register(&ixp4xx_eth_driver);
 }
 
 static void __exit eth_cleanup_module(void)
 {
-	platform_driver_unregister(&drv);
+	platform_driver_unregister(&ixp4xx_eth_driver);
 }
 
 MODULE_AUTHOR("Krzysztof Halasa");
Signature · 1 line
Krzysztof Halasa
#1 lore raw

Re: [RFC] IXP4xx: Make the Ethernet driver use built-in netdev stats.

Few patches I'm posting for review only.

Not for operational use.

IXP4xx: Make the Ethernet driver use built-in netdev stats.

drivers/net/arm/ixp4xx_eth.c +8 -16
@@ -164,7 +164,6 @@ struct port {
 	struct npe *npe;
 	struct net_device *netdev;
 	struct napi_struct napi;
-	struct net_device_stats stat;
 	struct mii_if_info mii;
 	struct delayed_work mdio_thread;
 	struct eth_plat_info *plat;
@@ -562,7 +561,7 @@ static int eth_poll(struct napi_struct *napi, int budget)
 #endif
 
 		if (!skb) {
-			port->stat.rx_dropped++;
+			dev->stats.rx_dropped++;
 			/* put the desc back on RX-ready queue */
 			desc->buf_len = MAX_MRU;
 			desc->pkt_len = 0;
@@ -589,8 +588,8 @@ static int eth_poll(struct napi_struct *napi, int budget)
 
 		skb->protocol = eth_type_trans(skb, dev);
 		dev->last_rx = jiffies;
-		port->stat.rx_packets++;
-		port->stat.rx_bytes += skb->len;
+		dev->stats.rx_packets++;
+		dev->stats.rx_bytes += skb->len;
 		netif_receive_skb(skb);
 
 		/* put the new buffer on RX-free queue */
@@ -635,8 +634,8 @@ static void eth_txdone_irq(void *unused)
 		debug_desc(phys, desc);
 
 		if (port->tx_buff_tab[n_desc]) { /* not the draining packet */
-			port->stat.tx_packets++;
-			port->stat.tx_bytes += desc->pkt_len;
+			port->netdev->stats.tx_packets++;
+			port->netdev->stats.tx_bytes += desc->pkt_len;
 
 			dma_unmap_tx(port, desc);
 #if DEBUG_TX
@@ -674,7 +673,7 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if (unlikely(skb->len > MAX_MRU)) {
 		dev_kfree_skb(skb);
-		port->stat.tx_errors++;
+		dev->stats.tx_errors++;
 		return NETDEV_TX_OK;
 	}
 
@@ -690,7 +689,7 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
 	bytes = ALIGN(offset + len, 4);
 	if (!(mem = kmalloc(bytes, GFP_ATOMIC))) {
 		dev_kfree_skb(skb);
-		port->stat.tx_dropped++;
+		dev->stats.tx_dropped++;
 		return NETDEV_TX_OK;
 	}
 	memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
@@ -704,7 +703,7 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
 #else
 		kfree(mem);
 #endif
-		port->stat.tx_dropped++;
+		dev->stats.tx_dropped++;
 		return NETDEV_TX_OK;
 	}
 
@@ -747,12 +746,6 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
 }
 
 
-static struct net_device_stats *eth_stats(struct net_device *dev)
-{
-	struct port *port = netdev_priv(dev);
-	return &port->stat;
-}
-
 static void eth_set_mcast_list(struct net_device *dev)
 {
 	struct port *port = netdev_priv(dev);
@@ -1156,7 +1149,6 @@ static int __devinit eth_init_one(struct platform_device *pdev)
 	dev->open = eth_open;
 	dev->hard_start_xmit = eth_xmit;
 	dev->stop = eth_close;
-	dev->get_stats = eth_stats;
 	dev->do_ioctl = eth_ioctl;
 	dev->set_multicast_list = eth_set_mcast_list;
 	dev->tx_queue_len = 100;
Signature · 1 line
Krzysztof Halasa
#2 lore raw

Re: [RFC] IXP4xx: Add PHYLIB support to Ethernet driver.

In reply to Krzysztof Halasa

Few patches I'm posting for review only.

Not for operational use.

IXP4xx: Add PHYLIB support to Ethernet driver.

drivers/net/arm/Kconfig +1 -1
@@ -51,7 +51,7 @@ config EP93XX_ETH
 config IXP4XX_ETH
 	tristate "Intel IXP4xx Ethernet support"
 	depends on ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR
-	select MII
+	select PHYLIB
 	help
 	  Say Y here if you want to use built-in Ethernet ports
 	  on IXP4xx processor.
drivers/net/arm/ixp4xx_eth.c +95 -99

351 lines not on this page · raw message

Signature · 1 line
Krzysztof Halasa
#3 lore raw

Re: [RFC] IXP4xx: Add PHYLIB MII ioctl to the Ethernet driver.

In reply to Krzysztof Halasa

Few patches I'm posting for review only.

Not for operational use.

IXP4xx: Add PHYLIB MII ioctl to the Ethernet driver.

drivers/net/arm/ixp4xx_eth.c +3 -1
@@ -789,9 +789,11 @@ static void eth_set_mcast_list(struct net_device *dev)
 
 static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
 {
+	struct port *port = netdev_priv(dev);
+
 	if (!netif_running(dev))
 		return -EINVAL;
-	return -EINVAL;
+	return phy_mii_ioctl(port->phydev, if_mii(req), cmd);
 }
 
 
Signature · 1 line
Krzysztof Halasa
#4 lore raw

Re: [RFC] IXP4xx: Add ethtool support to Ethernet driver.

In reply to Krzysztof Halasa

Few patches I'm posting for review only.

Not for operational use.

IXP4xx: Add ethtool support to Ethernet driver.

drivers/net/arm/ixp4xx_eth.c +45 -0
@@ -170,6 +170,7 @@ struct port {
 	u32 desc_tab_phys;
 	int id;			/* logical port ID */
 	int speed, duplex;
+	u8 firmware[4];
 };
 
 /* NPE message structure */
@@ -796,6 +797,45 @@ static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
 	return phy_mii_ioctl(port->phydev, if_mii(req), cmd);
 }
 
+/* ethtool support */
+
+static void ixp4xx_get_drvinfo(struct net_device *dev,
+			       struct ethtool_drvinfo *info)
+{
+	struct port *port = netdev_priv(dev);
+	strcpy(info->driver, DRV_NAME);
+	snprintf(info->fw_version, sizeof(info->fw_version), "%u:%u:%u:%u",
+		 port->firmware[0], port->firmware[1],
+		 port->firmware[2], port->firmware[3]);
+	strcpy(info->bus_info, "internal");
+}
+
+static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+	struct port *port = netdev_priv(dev);
+	return phy_ethtool_gset(port->phydev, cmd);
+}
+
+static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+	struct port *port = netdev_priv(dev);
+	return phy_ethtool_sset(port->phydev, cmd);
+}
+
+static int ixp4xx_nway_reset(struct net_device *dev)
+{
+	struct port *port = netdev_priv(dev);
+	return phy_start_aneg(port->phydev);
+}
+
+static struct ethtool_ops ixp4xx_ethtool_ops = {
+	.get_drvinfo = ixp4xx_get_drvinfo,
+	.get_settings = ixp4xx_get_settings,
+	.set_settings = ixp4xx_set_settings,
+	.nway_reset = ixp4xx_nway_reset,
+	.get_link = ethtool_op_get_link,
+};
+
 
 static int request_queues(struct port *port)
 {
@@ -943,6 +983,10 @@ static int eth_open(struct net_device *dev)
 			       npe_name(npe));
 			return -EIO;
 		}
+		port->firmware[0] = msg.byte4;
+		port->firmware[1] = msg.byte5;
+		port->firmware[2] = msg.byte6;
+		port->firmware[3] = msg.byte7;
 	}
 
 	memset(&msg, 0, sizeof(msg));
@@ -1152,6 +1196,7 @@ static int __devinit eth_init_one(struct platform_device *pdev)
 	dev->hard_start_xmit = eth_xmit;
 	dev->stop = eth_close;
 	dev->do_ioctl = eth_ioctl;
+	dev->ethtool_ops = &ixp4xx_ethtool_ops;
 	dev->set_multicast_list = eth_set_mcast_list;
 	dev->tx_queue_len = 100;
 
Signature · 1 line
Krzysztof Halasa
#5 lore raw

Re: [RFC] WAN: Add IXP4xx HSS HDLC driver.

In reply to Krzysztof Halasa

Few patches I'm posting for review only.

Not for operational use.

WAN: Add IXP4xx HSS HDLC driver.

I think It finally makes sense to have at least this HDLC part upstream. There is no point in keeping it separate. Channelized part isn't yet ready.

No support for internal clocks other than 2 Mb/s. Rarely used.

drivers/net/wan/Kconfig +7 -0
@@ -333,6 +333,13 @@ config DSCC4_PCI_RST
 
 	  Say Y if your card supports this feature.
 
+config IXP4XX_HSS
+	tristate "Intel IXP4xx HSS (synchronous serial port) support"
+	depends on HDLC && ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR
+	help
+	  Say Y here if you want to use built-in HSS ports
+	  on IXP4xx processor.
+
 config DLCI
 	tristate "Frame Relay DLCI support"
 	---help---
drivers/net/wan/Makefile +1 -0
index 1025496..89bec24 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_C101)		+= c101.o
 obj-$(CONFIG_WANXL)		+= wanxl.o
 obj-$(CONFIG_PCI200SYN)		+= pci200syn.o
 obj-$(CONFIG_PC300TOO)		+= pc300too.o
+obj-$(CONFIG_IXP4XX_HSS)	+= ixp4xx_hss.o
 
 clean-files := wanxlfw.inc
 $(obj)/wanxl.o:	$(obj)/wanxlfw.inc
drivers/net/wan/ixp4xx_hss.c new file +1358 -0

1,358 lines not on this page · raw message

Signature · 1 line
Krzysztof Halasa