From e174961ca1a0b28f7abf0be47973ad57cb74e5f0 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 27 Oct 2008 15:59:26 -0700 Subject: net: convert print_mac to %pM This converts pretty much everything to print_mac. There were a few things that had conflicts which I have just dropped for now, no harm done. I've built an allyesconfig with this and looked at the files that weren't built very carefully, but it's a huge patch. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller --- drivers/net/ibmveth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/net/ibmveth.c') diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index c2d57f83608..9dc49588cba 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -1371,13 +1371,12 @@ static int ibmveth_show(struct seq_file *seq, void *v) struct ibmveth_adapter *adapter = seq->private; char *current_mac = ((char*) &adapter->netdev->dev_addr); char *firmware_mac = ((char*) &adapter->mac_addr) ; - DECLARE_MAC_BUF(mac); seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version); seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address); - seq_printf(seq, "Current MAC: %s\n", print_mac(mac, current_mac)); - seq_printf(seq, "Firmware MAC: %s\n", print_mac(mac, firmware_mac)); + seq_printf(seq, "Current MAC: %pM\n", current_mac); + seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); seq_printf(seq, "\nAdapter Statistics:\n"); seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); -- cgit v1.2.3 From babcda74e9d96bb58fd9c6c5112dbdbff169e695 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 3 Nov 2008 21:11:17 -0800 Subject: drivers/net: Kill now superfluous ->last_rx stores. The generic packet receive code takes care of setting netdev->last_rx when necessary, for the sake of the bonding ARP monitor. Drivers need not do it any more. Some cases had to be skipped over because the drivers were making use of the ->last_rx value themselves. Signed-off-by: David S. Miller --- drivers/net/ibmveth.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/ibmveth.c') diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 9dc49588cba..2c409570c5d 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -1014,7 +1014,6 @@ static int ibmveth_poll(struct napi_struct *napi, int budget) netdev->stats.rx_packets++; netdev->stats.rx_bytes += length; frames_processed++; - netdev->last_rx = jiffies; } } while (frames_processed < budget); -- cgit v1.2.3 From 4cf1653aa90c6320dc8032443b5e322820aa28b1 Mon Sep 17 00:00:00 2001 From: Wang Chen Date: Wed, 12 Nov 2008 23:38:14 -0800 Subject: netdevice: safe convert to netdev_priv() #part-2 We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen Signed-off-by: David S. Miller --- drivers/net/ibmveth.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'drivers/net/ibmveth.c') diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 2c409570c5d..02ecfdb4df6 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -527,7 +527,7 @@ retry: static int ibmveth_open(struct net_device *netdev) { - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); u64 mac_address = 0; int rxq_entries = 1; unsigned long lpar_rc; @@ -666,7 +666,7 @@ static int ibmveth_open(struct net_device *netdev) static int ibmveth_close(struct net_device *netdev) { - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); long lpar_rc; ibmveth_debug_printk("close starting\n"); @@ -722,7 +722,7 @@ static u32 netdev_get_link(struct net_device *dev) { static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); if (data) adapter->rx_csum = 1; @@ -741,7 +741,7 @@ static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data) static void ibmveth_set_tx_csum_flags(struct net_device *dev, u32 data) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); if (data) { dev->features |= NETIF_F_IP_CSUM; @@ -753,7 +753,7 @@ static void ibmveth_set_tx_csum_flags(struct net_device *dev, u32 data) static int ibmveth_set_csum_offload(struct net_device *dev, u32 data, void (*done) (struct net_device *, u32)) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); u64 set_attr, clr_attr, ret_attr; long ret; int rc1 = 0, rc2 = 0; @@ -805,7 +805,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data, static int ibmveth_set_rx_csum(struct net_device *dev, u32 data) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); if ((data && adapter->rx_csum) || (!data && !adapter->rx_csum)) return 0; @@ -815,7 +815,7 @@ static int ibmveth_set_rx_csum(struct net_device *dev, u32 data) static int ibmveth_set_tx_csum(struct net_device *dev, u32 data) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); int rc = 0; if (data && (dev->features & NETIF_F_IP_CSUM)) @@ -833,7 +833,7 @@ static int ibmveth_set_tx_csum(struct net_device *dev, u32 data) static u32 ibmveth_get_rx_csum(struct net_device *dev) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); return adapter->rx_csum; } @@ -862,7 +862,7 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { int i; - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++) data[i] = IBMVETH_GET_STAT(adapter, ibmveth_stats[i].offset); @@ -889,7 +889,7 @@ static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) { - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); union ibmveth_buf_desc desc; unsigned long lpar_rc; unsigned long correlator; @@ -1044,7 +1044,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget) static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance) { struct net_device *netdev = dev_instance; - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); unsigned long lpar_rc; if (netif_rx_schedule_prep(netdev, &adapter->napi)) { @@ -1058,7 +1058,7 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance) static void ibmveth_set_multicast_list(struct net_device *netdev) { - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); unsigned long lpar_rc; if((netdev->flags & IFF_PROMISC) || (netdev->mc_count > adapter->mcastFilterSize)) { @@ -1106,7 +1106,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) static int ibmveth_change_mtu(struct net_device *dev, int new_mtu) { - struct ibmveth_adapter *adapter = dev->priv; + struct ibmveth_adapter *adapter = netdev_priv(dev); struct vio_dev *viodev = adapter->vdev; int new_mtu_oh = new_mtu + IBMVETH_BUFF_OH; int i; @@ -1158,7 +1158,7 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu) #ifdef CONFIG_NET_POLL_CONTROLLER static void ibmveth_poll_controller(struct net_device *dev) { - ibmveth_replenish_task(dev->priv); + ibmveth_replenish_task(netdev_priv(dev)); ibmveth_interrupt(dev->irq, dev); } #endif @@ -1240,7 +1240,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ if(!netdev) return -ENOMEM; - adapter = netdev->priv; + adapter = netdev_priv(netdev); dev->dev.driver_data = netdev; adapter->vdev = dev; @@ -1336,7 +1336,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ static int __devexit ibmveth_remove(struct vio_dev *dev) { struct net_device *netdev = dev->dev.driver_data; - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); int i; for(i = 0; iparent, struct device, kobj)->driver_data; - struct ibmveth_adapter *adapter = netdev->priv; + struct ibmveth_adapter *adapter = netdev_priv(netdev); long value = simple_strtol(buf, NULL, 10); long rc; -- cgit v1.2.3 From 908a7a16b852ffd618a9127be8d62432182d81b4 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Mon, 22 Dec 2008 20:43:12 -0800 Subject: net: Remove unused netdev arg from some NAPI interfaces. When the napi api was changed to separate its 1:1 binding to the net_device struct, the netif_rx_[prep|schedule|complete] api failed to remove the now vestigual net_device structure parameter. This patch cleans up that api by properly removing it.. Signed-off-by: Neil Horman Signed-off-by: David S. Miller --- drivers/net/ibmveth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/ibmveth.c') diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 02ecfdb4df6..1f055a95508 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -1028,7 +1028,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget) ibmveth_assert(lpar_rc == H_SUCCESS); - netif_rx_complete(netdev, napi); + netif_rx_complete(napi); if (ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, napi)) { @@ -1047,11 +1047,11 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance) struct ibmveth_adapter *adapter = netdev_priv(netdev); unsigned long lpar_rc; - if (netif_rx_schedule_prep(netdev, &adapter->napi)) { + if (netif_rx_schedule_prep(&adapter->napi)) { lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); ibmveth_assert(lpar_rc == H_SUCCESS); - __netif_rx_schedule(netdev, &adapter->napi); + __netif_rx_schedule(&adapter->napi); } return IRQ_HANDLED; } -- cgit v1.2.3