From 299176206b266f204be859adf9e66efd06628ab2 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 19 Aug 2006 17:48:59 -0400 Subject: drivers/net: Remove deprecated use of pci_module_init() From: Michal Piotrowski Signed-off-by: Michal Piotrowski Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index ad878dfddef4..1b752141a4f3 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -3510,7 +3510,7 @@ static struct pci_driver skge_driver = { static int __init skge_init_module(void) { - return pci_module_init(&skge_driver); + return pci_register_driver(&skge_driver); } static void __exit skge_cleanup_module(void) -- cgit v1.2.3 From d38efdd65aaabd82374f386d0cc54de2ffc90af3 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 28 Aug 2006 16:19:35 -0700 Subject: [PATCH] skge: cleanup suspend/resume code The code for suspend/resume needs several fixes. The hardware lock should be setup in probe only, not in resume. Interrupts should be disabled during suspend, etc. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 1b752141a4f3..b8ebd9c7d40a 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -3106,7 +3106,6 @@ static int skge_reset(struct skge_hw *hw) else hw->ram_size = t8 * 4096; - spin_lock_init(&hw->hw_lock); hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; if (hw->ports > 1) hw->intr_mask |= IS_PORT_2; @@ -3332,6 +3331,7 @@ static int __devinit skge_probe(struct pci_dev *pdev, hw->pdev = pdev; mutex_init(&hw->phy_mutex); INIT_WORK(&hw->phy_work, skge_extirq, hw); + spin_lock_init(&hw->hw_lock); hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); if (!hw->regs) { @@ -3449,26 +3449,25 @@ static int skge_suspend(struct pci_dev *pdev, pm_message_t state) struct skge_hw *hw = pci_get_drvdata(pdev); int i, wol = 0; - for (i = 0; i < 2; i++) { + pci_save_state(pdev); + for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; - if (dev) { + if (netif_running(dev)) { struct skge_port *skge = netdev_priv(dev); - if (netif_running(dev)) { - netif_carrier_off(dev); - if (skge->wol) - netif_stop_queue(dev); - else - skge_down(dev); - } - netif_device_detach(dev); + + netif_carrier_off(dev); + if (skge->wol) + netif_stop_queue(dev); + else + skge_down(dev); wol |= skge->wol; } + netif_device_detach(dev); } - pci_save_state(pdev); + skge_write32(hw, B0_IMSK, 0); pci_enable_wake(pdev, pci_choose_state(pdev, state), wol); - pci_disable_device(pdev); pci_set_power_state(pdev, pci_choose_state(pdev, state)); return 0; @@ -3477,23 +3476,33 @@ static int skge_suspend(struct pci_dev *pdev, pm_message_t state) static int skge_resume(struct pci_dev *pdev) { struct skge_hw *hw = pci_get_drvdata(pdev); - int i; + int i, err; pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); pci_enable_wake(pdev, PCI_D0, 0); - skge_reset(hw); + err = skge_reset(hw); + if (err) + goto out; - for (i = 0; i < 2; i++) { + for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; - if (dev) { - netif_device_attach(dev); - if (netif_running(dev) && skge_up(dev)) + + netif_device_attach(dev); + if (netif_running(dev)) { + err = skge_up(dev); + + if (err) { + printk(KERN_ERR PFX "%s: could not up: %d\n", + dev->name, err); dev_close(dev); + goto out; + } } } - return 0; +out: + return err; } #endif -- cgit v1.2.3 From 78bc218663e3bd6cbbaf6a363d2f88f17541adfb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 28 Aug 2006 16:19:36 -0700 Subject: [PATCH] skge: pci bus post fixes At the end of a critical section, we need to force the PCI write to complete by doing a read. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index b8ebd9c7d40a..85296ba5eac2 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -2747,7 +2747,7 @@ static int skge_poll(struct net_device *dev, int *budget) spin_lock_irq(&hw->hw_lock); hw->intr_mask |= rxirqmask[skge->port]; skge_write32(hw, B0_IMSK, hw->intr_mask); - mmiowb(); + skge_read32(hw, B0_IMSK); spin_unlock_irq(&hw->hw_lock); return 0; @@ -2881,6 +2881,7 @@ static void skge_extirq(void *arg) spin_lock_irq(&hw->hw_lock); hw->intr_mask |= IS_EXT_REG; skge_write32(hw, B0_IMSK, hw->intr_mask); + skge_read32(hw, B0_IMSK); spin_unlock_irq(&hw->hw_lock); } @@ -2955,6 +2956,7 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) skge_error_irq(hw); skge_write32(hw, B0_IMSK, hw->intr_mask); + skge_read32(hw, B0_IMSK); spin_unlock(&hw->hw_lock); return IRQ_HANDLED; @@ -3424,6 +3426,7 @@ static void __devexit skge_remove(struct pci_dev *pdev) spin_lock_irq(&hw->hw_lock); hw->intr_mask = 0; skge_write32(hw, B0_IMSK, 0); + skge_read32(hw, B0_IMSK); spin_unlock_irq(&hw->hw_lock); skge_write16(hw, B0_LED, LED_STAT_OFF); -- cgit v1.2.3 From 83c758fabd3589842ebcb3af6b9150ff55bc39aa Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 28 Aug 2006 16:19:37 -0700 Subject: [PATCH] skge: use dev_alloc_skb To avoid problems with buggy protocols that assume extra header space, use dev_alloc_skb() when allocating receive buffers. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 85296ba5eac2..e38b178769c2 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port *skge) do { struct sk_buff *skb; - skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL); + skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, + GFP_KERNEL); if (!skb) return -ENOMEM; @@ -2609,7 +2610,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, goto error; if (len < RX_COPY_THRESHOLD) { - skb = alloc_skb(len + 2, GFP_ATOMIC); + skb = dev_alloc_skb(len + 2); if (!skb) goto resubmit; @@ -2624,7 +2625,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, skge_rx_reuse(e, skge->rx_buf_size); } else { struct sk_buff *nskb; - nskb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_ATOMIC); + nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN); if (!nskb) goto resubmit; -- cgit v1.2.3 From ccdaa2a9daf4777aa50866a28921153ad837a2be Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 28 Aug 2006 16:19:38 -0700 Subject: [PATCH] skge: use ethX for irq assigments The user level irq balance daemon uses "eth" as a way to distinquish ethernet devices. Also, by using device name it is possible to distinquish different boards. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index e38b178769c2..bcdf9f59607d 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -3343,23 +3343,16 @@ static int __devinit skge_probe(struct pci_dev *pdev, goto err_out_free_hw; } - err = request_irq(pdev->irq, skge_intr, IRQF_SHARED, DRV_NAME, hw); - if (err) { - printk(KERN_ERR PFX "%s: cannot assign irq %d\n", - pci_name(pdev), pdev->irq); - goto err_out_iounmap; - } - pci_set_drvdata(pdev, hw); - err = skge_reset(hw); if (err) - goto err_out_free_irq; + goto err_out_iounmap; printk(KERN_INFO PFX DRV_VERSION " addr 0x%llx irq %d chip %s rev %d\n", (unsigned long long)pci_resource_start(pdev, 0), pdev->irq, skge_board_name(hw), hw->chip_rev); - if ((dev = skge_devinit(hw, 0, using_dac)) == NULL) + dev = skge_devinit(hw, 0, using_dac); + if (!dev) goto err_out_led_off; if (!is_valid_ether_addr(dev->dev_addr)) { @@ -3369,7 +3362,6 @@ static int __devinit skge_probe(struct pci_dev *pdev, goto err_out_free_netdev; } - err = register_netdev(dev); if (err) { printk(KERN_ERR PFX "%s: cannot register net device\n", @@ -3377,6 +3369,12 @@ static int __devinit skge_probe(struct pci_dev *pdev, goto err_out_free_netdev; } + err = request_irq(pdev->irq, skge_intr, IRQF_SHARED, dev->name, hw); + if (err) { + printk(KERN_ERR PFX "%s: cannot assign irq %d\n", + dev->name, pdev->irq); + goto err_out_unregister; + } skge_show_addr(dev); if (hw->ports > 1 && (dev1 = skge_devinit(hw, 1, using_dac))) { @@ -3389,15 +3387,16 @@ static int __devinit skge_probe(struct pci_dev *pdev, free_netdev(dev1); } } + pci_set_drvdata(pdev, hw); return 0; +err_out_unregister: + unregister_netdev(dev); err_out_free_netdev: free_netdev(dev); err_out_led_off: skge_write16(hw, B0_LED, LED_STAT_OFF); -err_out_free_irq: - free_irq(pdev->irq, hw); err_out_iounmap: iounmap(hw->regs); err_out_free_hw: -- cgit v1.2.3 From 6fc47e31c0e802d205d67e644f654532e5d365d5 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 28 Aug 2006 16:19:39 -0700 Subject: [PATCH] skge: version 1.7 Increase version. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index bcdf9f59607d..a1fc04365e07 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -43,7 +43,7 @@ #include "skge.h" #define DRV_NAME "skge" -#define DRV_VERSION "1.6" +#define DRV_VERSION "1.7" #define PFX DRV_NAME " " #define DEFAULT_TX_RING_SIZE 128 -- cgit v1.2.3 From c54f9765daafe8493dba837b3d70e97432cd876a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Sep 2006 15:53:47 -0700 Subject: [PATCH] skge: use netdev_alloc_skb Change to use new netdev_alloc_skb interface for 2.6.18. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index a1fc04365e07..e86a88aa9d06 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -818,8 +818,9 @@ static void skge_rx_clean(struct skge_port *skge) /* Allocate buffers for receive ring * For receive: to_clean is next received frame. */ -static int skge_rx_fill(struct skge_port *skge) +static int skge_rx_fill(struct net_device *dev) { + struct skge_port *skge = netdev_priv(dev); struct skge_ring *ring = &skge->rx_ring; struct skge_element *e; @@ -827,8 +828,8 @@ static int skge_rx_fill(struct skge_port *skge) do { struct sk_buff *skb; - skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, - GFP_KERNEL); + skb = __netdev_alloc_skb(dev, skge->rx_buf_size + NET_IP_ALIGN, + GFP_KERNEL); if (!skb) return -ENOMEM; @@ -2179,7 +2180,7 @@ static int skge_up(struct net_device *dev) if (err) goto free_pci_mem; - err = skge_rx_fill(skge); + err = skge_rx_fill(dev); if (err) goto free_rx_ring; @@ -2585,16 +2586,17 @@ static inline int bad_phy_status(const struct skge_hw *hw, u32 status) /* Get receive buffer from descriptor. * Handles copy of small buffers and reallocation failures */ -static inline struct sk_buff *skge_rx_get(struct skge_port *skge, - struct skge_element *e, - u32 control, u32 status, u16 csum) +static struct sk_buff *skge_rx_get(struct net_device *dev, + struct skge_element *e, + u32 control, u32 status, u16 csum) { + struct skge_port *skge = netdev_priv(dev); struct sk_buff *skb; u16 len = control & BMU_BBC; if (unlikely(netif_msg_rx_status(skge))) printk(KERN_DEBUG PFX "%s: rx slot %td status 0x%x len %d\n", - skge->netdev->name, e - skge->rx_ring.start, + dev->name, e - skge->rx_ring.start, status, len); if (len > skge->rx_buf_size) @@ -2610,7 +2612,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, goto error; if (len < RX_COPY_THRESHOLD) { - skb = dev_alloc_skb(len + 2); + skb = netdev_alloc_skb(dev, len + 2); if (!skb) goto resubmit; @@ -2625,7 +2627,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, skge_rx_reuse(e, skge->rx_buf_size); } else { struct sk_buff *nskb; - nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN); + nskb = netdev_alloc_skb(dev, skge->rx_buf_size + NET_IP_ALIGN); if (!nskb) goto resubmit; @@ -2640,20 +2642,19 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, } skb_put(skb, len); - skb->dev = skge->netdev; if (skge->rx_csum) { skb->csum = csum; skb->ip_summed = CHECKSUM_HW; } - skb->protocol = eth_type_trans(skb, skge->netdev); + skb->protocol = eth_type_trans(skb, dev); return skb; error: if (netif_msg_rx_err(skge)) printk(KERN_DEBUG PFX "%s: rx err, slot %td control 0x%x status 0x%x\n", - skge->netdev->name, e - skge->rx_ring.start, + dev->name, e - skge->rx_ring.start, control, status); if (skge->hw->chip_id == CHIP_ID_GENESIS) { @@ -2723,7 +2724,7 @@ static int skge_poll(struct net_device *dev, int *budget) if (control & BMU_OWN) break; - skb = skge_rx_get(skge, e, control, rd->status, rd->csum2); + skb = skge_rx_get(dev, e, control, rd->status, rd->csum2); if (likely(skb)) { dev->last_rx = jiffies; netif_receive_skb(skb); -- cgit v1.2.3 From 29365c900963d4986b74a0dadea46872bf283d76 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Sep 2006 15:53:48 -0700 Subject: [PATCH] skge: irq lock race The driver needs to access the IRQ status inside of lock to avoid races with other places changing IRQ mask etc. This may be related to some of the SMP bugs reported against skge in kernel bugzilla. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index e86a88aa9d06..8a321be24835 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -2891,13 +2891,15 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) { struct skge_hw *hw = dev_id; u32 status; + int handled = 0; + spin_lock(&hw->hw_lock); /* Reading this register masks IRQ */ status = skge_read32(hw, B0_SP_ISRC); if (status == 0) - return IRQ_NONE; + goto out; - spin_lock(&hw->hw_lock); + handled = 1; status &= hw->intr_mask; if (status & IS_EXT_REG) { hw->intr_mask &= ~IS_EXT_REG; @@ -2959,9 +2961,10 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) skge_write32(hw, B0_IMSK, hw->intr_mask); skge_read32(hw, B0_IMSK); +out: spin_unlock(&hw->hw_lock); - return IRQ_HANDLED; + return IRQ_RETVAL(handled); } #ifdef CONFIG_NET_POLL_CONTROLLER -- cgit v1.2.3 From 513f533e3f161c5a59555677d35e8ae28037bd89 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Sep 2006 15:53:49 -0700 Subject: [PATCH] skge: use NAPI for transmit complete The skge driver has much better performance if transmit done is handled in NAPI softirq. Change from doing transmit locking in driver (LLTX) and use device lock. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 82 +++++++++++++++++++----------------------------------- drivers/net/skge.h | 1 - 2 files changed, 28 insertions(+), 55 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 8a321be24835..34a4b87819bd 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -91,7 +91,7 @@ MODULE_DEVICE_TABLE(pci, skge_id_table); static int skge_up(struct net_device *dev); static int skge_down(struct net_device *dev); static void skge_phy_reset(struct skge_port *skge); -static void skge_tx_clean(struct skge_port *skge); +static void skge_tx_clean(struct net_device *dev); static int xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); static int gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); static void genesis_get_stats(struct skge_port *skge, u64 *data); @@ -105,6 +105,7 @@ static const int txqaddr[] = { Q_XA1, Q_XA2 }; static const int rxqaddr[] = { Q_R1, Q_R2 }; static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F }; static const u32 txirqmask[] = { IS_XA1_F, IS_XA2_F }; +static const u32 irqmask[] = { IS_R1_F|IS_XA1_F, IS_R2_F|IS_XA2_F }; static int skge_get_regs_len(struct net_device *dev) { @@ -2283,7 +2284,7 @@ static int skge_down(struct net_device *dev) skge_led(skge, LED_MODE_OFF); netif_poll_disable(dev); - skge_tx_clean(skge); + skge_tx_clean(dev); skge_rx_clean(skge); kfree(skge->rx_ring.start); @@ -2308,25 +2309,12 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) int i; u32 control, len; u64 map; - unsigned long flags; if (skb_padto(skb, ETH_ZLEN)) return NETDEV_TX_OK; - if (!spin_trylock_irqsave(&skge->tx_lock, flags)) - /* Collision - tell upper layer to requeue */ - return NETDEV_TX_LOCKED; - - if (unlikely(skge_avail(&skge->tx_ring) < skb_shinfo(skb)->nr_frags + 1)) { - if (!netif_queue_stopped(dev)) { - netif_stop_queue(dev); - - printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", - dev->name); - } - spin_unlock_irqrestore(&skge->tx_lock, flags); + if (unlikely(skge_avail(&skge->tx_ring) < skb_shinfo(skb)->nr_frags + 1)) return NETDEV_TX_BUSY; - } e = skge->tx_ring.to_use; td = e->desc; @@ -2401,8 +2389,6 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) netif_stop_queue(dev); } - spin_unlock_irqrestore(&skge->tx_lock, flags); - dev->trans_start = jiffies; return NETDEV_TX_OK; @@ -2432,18 +2418,18 @@ static void skge_tx_free(struct skge_port *skge, struct skge_element *e, printk(KERN_DEBUG PFX "%s: tx done slot %td\n", skge->netdev->name, e - skge->tx_ring.start); - dev_kfree_skb_any(e->skb); + dev_kfree_skb(e->skb); } e->skb = NULL; } /* Free all buffers in transmit ring */ -static void skge_tx_clean(struct skge_port *skge) +static void skge_tx_clean(struct net_device *dev) { + struct skge_port *skge = netdev_priv(dev); struct skge_element *e; - unsigned long flags; - spin_lock_irqsave(&skge->tx_lock, flags); + netif_tx_lock_bh(dev); for (e = skge->tx_ring.to_clean; e != skge->tx_ring.to_use; e = e->next) { struct skge_tx_desc *td = e->desc; skge_tx_free(skge, e, td->control); @@ -2451,8 +2437,8 @@ static void skge_tx_clean(struct skge_port *skge) } skge->tx_ring.to_clean = e; - netif_wake_queue(skge->netdev); - spin_unlock_irqrestore(&skge->tx_lock, flags); + netif_wake_queue(dev); + netif_tx_unlock_bh(dev); } static void skge_tx_timeout(struct net_device *dev) @@ -2463,7 +2449,7 @@ static void skge_tx_timeout(struct net_device *dev) printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP); - skge_tx_clean(skge); + skge_tx_clean(dev); } static int skge_change_mtu(struct net_device *dev, int new_mtu) @@ -2679,15 +2665,15 @@ resubmit: } /* Free all buffers in Tx ring which are no longer owned by device */ -static void skge_txirq(struct net_device *dev) +static void skge_tx_done(struct net_device *dev) { struct skge_port *skge = netdev_priv(dev); struct skge_ring *ring = &skge->tx_ring; struct skge_element *e; - rmb(); + skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F); - spin_lock(&skge->tx_lock); + netif_tx_lock(dev); for (e = ring->to_clean; e != ring->to_use; e = e->next) { struct skge_tx_desc *td = e->desc; @@ -2698,11 +2684,10 @@ static void skge_txirq(struct net_device *dev) } skge->tx_ring.to_clean = e; - if (netif_queue_stopped(skge->netdev) - && skge_avail(&skge->tx_ring) > TX_LOW_WATER) - netif_wake_queue(skge->netdev); + if (skge_avail(&skge->tx_ring) > TX_LOW_WATER) + netif_wake_queue(dev); - spin_unlock(&skge->tx_lock); + netif_tx_unlock(dev); } static int skge_poll(struct net_device *dev, int *budget) @@ -2714,6 +2699,10 @@ static int skge_poll(struct net_device *dev, int *budget) int to_do = min(dev->quota, *budget); int work_done = 0; + skge_tx_done(dev); + + skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F); + for (e = ring->to_clean; prefetch(e->next), work_done < to_do; e = e->next) { struct skge_rx_desc *rd = e->desc; struct sk_buff *skb; @@ -2744,10 +2733,9 @@ static int skge_poll(struct net_device *dev, int *budget) if (work_done >= to_do) return 1; /* not done */ - netif_rx_complete(dev); - spin_lock_irq(&hw->hw_lock); - hw->intr_mask |= rxirqmask[skge->port]; + __netif_rx_complete(dev); + hw->intr_mask |= irqmask[skge->port]; skge_write32(hw, B0_IMSK, hw->intr_mask); skge_read32(hw, B0_IMSK); spin_unlock_irq(&hw->hw_lock); @@ -2906,14 +2894,8 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) schedule_work(&hw->phy_work); } - if (status & IS_XA1_F) { - skge_write8(hw, Q_ADDR(Q_XA1, Q_CSR), CSR_IRQ_CL_F); - skge_txirq(hw->dev[0]); - } - - if (status & IS_R1_F) { - skge_write8(hw, Q_ADDR(Q_R1, Q_CSR), CSR_IRQ_CL_F); - hw->intr_mask &= ~IS_R1_F; + if (status & (IS_XA1_F|IS_R1_F)) { + hw->intr_mask &= ~(IS_XA1_F|IS_R1_F); netif_rx_schedule(hw->dev[0]); } @@ -2932,14 +2914,8 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) skge_mac_intr(hw, 0); if (hw->dev[1]) { - if (status & IS_XA2_F) { - skge_write8(hw, Q_ADDR(Q_XA2, Q_CSR), CSR_IRQ_CL_F); - skge_txirq(hw->dev[1]); - } - - if (status & IS_R2_F) { - skge_write8(hw, Q_ADDR(Q_R2, Q_CSR), CSR_IRQ_CL_F); - hw->intr_mask &= ~IS_R2_F; + if (status & (IS_XA2_F|IS_R2_F)) { + hw->intr_mask &= ~(IS_XA2_F|IS_R2_F); netif_rx_schedule(hw->dev[1]); } @@ -3228,7 +3204,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, dev->poll_controller = skge_netpoll; #endif dev->irq = hw->pdev->irq; - dev->features = NETIF_F_LLTX; + if (highmem) dev->features |= NETIF_F_HIGHDMA; @@ -3250,8 +3226,6 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, skge->port = port; - spin_lock_init(&skge->tx_lock); - if (hw->chip_id != CHIP_ID_GENESIS) { dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; skge->rx_csum = 1; diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 593387b3c0dd..79e09271bcf9 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h @@ -2417,7 +2417,6 @@ struct skge_port { struct net_device *netdev; int port; - spinlock_t tx_lock; struct skge_ring tx_ring; struct skge_ring rx_ring; -- cgit v1.2.3 From f6aa1693671fa9ea661fd30f003820d129fe0628 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Sep 2006 15:53:50 -0700 Subject: [PATCH] skge: version 1.8 Because of the NAPI and other SMP fixes, let's call this a version. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 34a4b87819bd..3f1b72eb3492 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -43,7 +43,7 @@ #include "skge.h" #define DRV_NAME "skge" -#define DRV_VERSION "1.7" +#define DRV_VERSION "1.8" #define PFX DRV_NAME " " #define DEFAULT_TX_RING_SIZE 128 -- cgit v1.2.3 From 0486a8c83b0f83c52c4d93accd841e08ccdf04dc Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 6 Sep 2006 11:06:10 -0700 Subject: [PATCH] skge: check for PCI hotplug during IRQ Check if IRQ came from hardware fault (hotplug). Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/skge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 3f1b72eb3492..fba8b7455d8b 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -2884,7 +2884,7 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) spin_lock(&hw->hw_lock); /* Reading this register masks IRQ */ status = skge_read32(hw, B0_SP_ISRC); - if (status == 0) + if (status == 0 || status == ~0) goto out; handled = 1; -- cgit v1.2.3 From 7282d491ecaee9883233a0e27283c4c79486279a Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 13 Sep 2006 14:30:00 -0400 Subject: drivers/net: const-ify ethtool_ops declarations Signed-off-by: Jeff Garzik --- drivers/net/3c501.c | 2 +- drivers/net/3c501.h | 2 +- drivers/net/3c503.c | 4 ++-- drivers/net/3c505.c | 2 +- drivers/net/3c507.c | 4 ++-- drivers/net/3c509.c | 4 ++-- drivers/net/3c515.c | 4 ++-- drivers/net/3c523.c | 4 ++-- drivers/net/3c527.c | 4 ++-- drivers/net/3c59x.c | 4 ++-- drivers/net/8139cp.c | 2 +- drivers/net/8139too.c | 4 ++-- drivers/net/acenic.c | 2 +- drivers/net/amd8111e.c | 2 +- drivers/net/arm/at91_ether.c | 2 +- drivers/net/arm/etherh.c | 2 +- drivers/net/au1000_eth.c | 2 +- drivers/net/b44.c | 2 +- drivers/net/bnx2.c | 2 +- drivers/net/bonding/bond_main.c | 2 +- drivers/net/cassini.c | 2 +- drivers/net/chelsio/cxgb2.c | 2 +- drivers/net/cris/eth_v10.c | 4 ++-- drivers/net/dl2k.c | 4 ++-- drivers/net/e100.c | 2 +- drivers/net/e1000/e1000_ethtool.c | 2 +- drivers/net/eepro.c | 4 ++-- drivers/net/eepro100.c | 4 ++-- drivers/net/ehea/ehea_ethtool.c | 2 +- drivers/net/epic100.c | 4 ++-- drivers/net/ewrk3.c | 8 ++++---- drivers/net/fealnx.c | 4 ++-- drivers/net/fec_8xx/fec_main.c | 28 +++++++++++++------------- drivers/net/forcedeth.c | 2 +- drivers/net/fs_enet/fs_enet-main.c | 2 +- drivers/net/gianfar.c | 2 +- drivers/net/gianfar.h | 2 -- drivers/net/gianfar_ethtool.c | 2 +- drivers/net/hamachi.c | 8 ++++---- drivers/net/ibm_emac/ibm_emac_core.c | 2 +- drivers/net/ibmveth.c | 2 +- drivers/net/ioc3-eth.c | 4 ++-- drivers/net/iseries_veth.c | 2 +- drivers/net/ixgb/ixgb_ethtool.c | 2 +- drivers/net/loopback.c | 2 +- drivers/net/mv643xx_eth.c | 4 ++-- drivers/net/myri10ge/myri10ge.c | 2 +- drivers/net/natsemi.c | 4 ++-- drivers/net/ne2k-pci.c | 4 ++-- drivers/net/ns83820.c | 2 +- drivers/net/pcmcia/3c574_cs.c | 4 ++-- drivers/net/pcmcia/3c589_cs.c | 4 ++-- drivers/net/pcmcia/axnet_cs.c | 4 ++-- drivers/net/pcmcia/fmvj18x_cs.c | 4 ++-- drivers/net/pcmcia/ibmtr_cs.c | 2 +- drivers/net/pcmcia/nmclan_cs.c | 4 ++-- drivers/net/pcmcia/pcnet_cs.c | 4 ++-- drivers/net/pcmcia/smc91c92_cs.c | 4 ++-- drivers/net/pcmcia/xirc2ps_cs.c | 4 ++-- drivers/net/pcnet32.c | 2 +- drivers/net/qla3xxx.c | 2 +- drivers/net/r8169.c | 2 +- drivers/net/rionet.c | 2 +- drivers/net/s2io.c | 2 +- drivers/net/s2io.h | 2 +- drivers/net/sis190.c | 2 +- drivers/net/sis900.c | 4 ++-- drivers/net/sk98lin/skethtool.c | 2 +- drivers/net/sk98lin/skge.c | 2 +- drivers/net/skge.c | 2 +- drivers/net/sky2.c | 2 +- drivers/net/smc911x.c | 2 +- drivers/net/smc91x.c | 2 +- drivers/net/spider_net.h | 2 +- drivers/net/spider_net_ethtool.c | 2 +- drivers/net/starfire.c | 4 ++-- drivers/net/sunbmac.c | 2 +- drivers/net/sundance.c | 4 ++-- drivers/net/sungem.c | 2 +- drivers/net/sunhme.c | 2 +- drivers/net/sunlance.c | 2 +- drivers/net/sunqe.c | 2 +- drivers/net/tg3.c | 2 +- drivers/net/tulip/de2104x.c | 2 +- drivers/net/tulip/dmfe.c | 4 ++-- drivers/net/tulip/tulip_core.c | 2 +- drivers/net/tulip/uli526x.c | 4 ++-- drivers/net/tulip/winbond-840.c | 4 ++-- drivers/net/tulip/xircom_cb.c | 2 +- drivers/net/tulip/xircom_tulip_cb.c | 4 ++-- drivers/net/tun.c | 4 ++-- drivers/net/typhoon.c | 2 +- drivers/net/ucc_geth.c | 15 +------------- drivers/net/via-rhine.c | 4 ++-- drivers/net/via-velocity.c | 4 ++-- drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c | 2 +- drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h | 2 +- drivers/net/wireless/hostap/hostap.h | 2 +- drivers/net/wireless/hostap/hostap_ioctl.c | 2 +- drivers/net/wireless/ipw2100.c | 2 +- drivers/net/wireless/ipw2200.c | 2 +- drivers/net/wireless/orinoco.c | 4 ++-- drivers/net/wireless/ray_cs.c | 4 ++-- drivers/net/wireless/wavelan_cs.c | 2 +- drivers/net/wireless/wl3501_cs.c | 2 +- drivers/net/yellowfin.c | 4 ++-- 106 files changed, 163 insertions(+), 178 deletions(-) (limited to 'drivers/net/skge.c') diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index 591e7fb47b9f..1b82bccd8c71 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c @@ -881,7 +881,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) debug = level; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_msglevel = netdev_get_msglevel, .set_msglevel = netdev_set_msglevel, diff --git a/drivers/net/3c501.h b/drivers/net/3c501.h index 965474aa1cc6..39d332474750 100644 --- a/drivers/net/3c501.h +++ b/drivers/net/3c501.h @@ -13,7 +13,7 @@ static void el_reset(struct net_device *dev); static int el1_close(struct net_device *dev); static struct net_device_stats *el1_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; #define EL1_IO_EXTENT 16 diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index 64313e3dfcb8..a34b2206132d 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c @@ -79,7 +79,7 @@ static void el2_block_input(struct net_device *dev, int count, struct sk_buff *s int ring_offset); static void el2_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; /* This routine probes for a memory-mapped 3c503 board by looking for @@ -666,7 +666,7 @@ static void netdev_get_drvinfo(struct net_device *dev, sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c index f3a88efc86d6..ab8230a68bea 100644 --- a/drivers/net/3c505.c +++ b/drivers/net/3c505.c @@ -1169,7 +1169,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) debug = level; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_msglevel = netdev_get_msglevel, .set_msglevel = netdev_set_msglevel, diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c index 3a95605e18c5..8205a535c5b7 100644 --- a/drivers/net/3c507.c +++ b/drivers/net/3c507.c @@ -294,7 +294,7 @@ static void el16_tx_timeout (struct net_device *dev); static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad); static void init_82586_mem(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void init_rx_bufs(struct net_device *); static int io = 0x300; @@ -919,7 +919,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) debug = level; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_msglevel = netdev_get_msglevel, .set_msglevel = netdev_set_msglevel, diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 48b99beb1e8b..16817306f048 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -200,7 +200,7 @@ static void set_multicast_list(struct net_device *dev); static void el3_tx_timeout (struct net_device *dev); static void el3_down(struct net_device *dev); static void el3_up(struct net_device *dev); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; #ifdef EL3_SUSPEND static int el3_suspend(struct device *, pm_message_t); static int el3_resume(struct device *); @@ -1349,7 +1349,7 @@ static void el3_set_msglevel(struct net_device *dev, u32 v) el3_debug = v; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .get_drvinfo = el3_get_drvinfo, .get_settings = el3_get_settings, .set_settings = el3_set_settings, diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index bde9f5bd3362..91f2232e6050 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c @@ -379,7 +379,7 @@ static int corkscrew_close(struct net_device *dev); static void update_stats(int addr, struct net_device *dev); static struct net_device_stats *corkscrew_get_stats(struct net_device *dev); static void set_rx_mode(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; /* @@ -1561,7 +1561,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) corkscrew_debug = level; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_msglevel = netdev_get_msglevel, .set_msglevel = netdev_set_msglevel, diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 3364eb4aff1e..cf8a0bc3bf34 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c @@ -189,7 +189,7 @@ static void elmc_timeout(struct net_device *dev); #ifdef ELMC_MULTICAST static void set_multicast_list(struct net_device *dev); #endif -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; /* helper-functions */ static int init586(struct net_device *dev); @@ -1259,7 +1259,7 @@ static void netdev_get_drvinfo(struct net_device *dev, sprintf(info->bus_info, "MCA 0x%lx", dev->base_addr); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index 323b6e510108..625e57dc3b4a 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c @@ -222,7 +222,7 @@ static int mc32_close(struct net_device *dev); static struct net_device_stats *mc32_get_stats(struct net_device *dev); static void mc32_set_multicast_list(struct net_device *dev); static void mc32_reset_multicast_list(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void cleanup_card(struct net_device *dev) { @@ -1627,7 +1627,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) mc32_debug = level; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_msglevel = netdev_get_msglevel, .set_msglevel = netdev_set_msglevel, diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 5ca7a563f0ba..e1e53bbd150b 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -729,7 +729,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); #endif static void vortex_tx_timeout(struct net_device *dev); static void acpi_set_WOL(struct net_device *dev); -static struct ethtool_ops vortex_ethtool_ops; +static const struct ethtool_ops vortex_ethtool_ops; static void set_8021q_mode(struct net_device *dev, int enable); /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */ @@ -2873,7 +2873,7 @@ static void vortex_get_drvinfo(struct net_device *dev, } } -static struct ethtool_ops vortex_ethtool_ops = { +static const struct ethtool_ops vortex_ethtool_ops = { .get_drvinfo = vortex_get_drvinfo, .get_strings = vortex_get_strings, .get_msglevel = vortex_get_msglevel, diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 488241c5bdd8..5ba11fa08147 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -1546,7 +1546,7 @@ static void cp_get_ethtool_stats (struct net_device *dev, pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma); } -static struct ethtool_ops cp_ethtool_ops = { +static const struct ethtool_ops cp_ethtool_ops = { .get_drvinfo = cp_get_drvinfo, .get_regs_len = cp_get_regs_len, .get_stats_count = cp_get_stats_count, diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 10301d3daa7d..dbc5c0b1b96c 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -639,7 +639,7 @@ static void __set_rx_mode (struct net_device *dev); static void rtl8139_hw_start (struct net_device *dev); static void rtl8139_thread (void *_data); static void rtl8139_tx_timeout_task(void *_data); -static struct ethtool_ops rtl8139_ethtool_ops; +static const struct ethtool_ops rtl8139_ethtool_ops; /* write MMIO register, with flush */ /* Flush avoids rtl8139 bug w/ posted MMIO writes */ @@ -2446,7 +2446,7 @@ static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data) memcpy(data, ethtool_stats_keys, sizeof(ethtool_stats_keys)); } -static struct ethtool_ops rtl8139_ethtool_ops = { +static const struct ethtool_ops rtl8139_ethtool_ops = { .get_drvinfo = rtl8139_get_drvinfo, .get_settings = rtl8139_get_settings, .set_settings = rtl8139_set_settings, diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 5c8b9dc5dbf1..0473c6d14b4a 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -451,7 +451,7 @@ static int ace_get_settings(struct net_device *, struct ethtool_cmd *); static int ace_set_settings(struct net_device *, struct ethtool_cmd *); static void ace_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); -static struct ethtool_ops ace_ethtool_ops = { +static const struct ethtool_ops ace_ethtool_ops = { .get_settings = ace_get_settings, .set_settings = ace_set_settings, .get_drvinfo = ace_get_drvinfo, diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index a77df854032c..28855a01ed7b 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c @@ -1645,7 +1645,7 @@ static int amd8111e_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol_ return 0; } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = amd8111e_get_drvinfo, .get_regs_len = amd8111e_get_regs_len, .get_regs = amd8111e_get_regs, diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 85493b7b924f..95b28aa01f4f 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c @@ -648,7 +648,7 @@ static void at91ether_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo strlcpy(info->bus_info, dev->class_dev.dev->bus_id, sizeof(info->bus_info)); } -static struct ethtool_ops at91ether_ethtool_ops = { +static const struct ethtool_ops at91ether_ethtool_ops = { .get_settings = at91ether_get_settings, .set_settings = at91ether_set_settings, .get_drvinfo = at91ether_get_drvinfo, diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index d52deb8d2075..4ae98970b282 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c @@ -626,7 +626,7 @@ static int etherh_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) return 0; } -static struct ethtool_ops etherh_ethtool_ops = { +static const struct ethtool_ops etherh_ethtool_ops = { .get_settings = etherh_get_settings, .set_settings = etherh_set_settings, .get_drvinfo = etherh_get_drvinfo, diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index ec493368d784..ac33b1b9cf4a 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -608,7 +608,7 @@ au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) info->regdump_len = 0; } -static struct ethtool_ops au1000_ethtool_ops = { +static const struct ethtool_ops au1000_ethtool_ops = { .get_settings = au1000_get_settings, .set_settings = au1000_set_settings, .get_drvinfo = au1000_get_drvinfo, diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 17eb2912971d..e891ea2ecc3c 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c @@ -2012,7 +2012,7 @@ static int b44_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) return 0; } -static struct ethtool_ops b44_ethtool_ops = { +static const struct ethtool_ops b44_ethtool_ops = { .get_drvinfo = b44_get_drvinfo, .get_settings = b44_get_settings, .set_settings = b44_set_settings, diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index eae5a55103b0..b158de28d6f9 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -5429,7 +5429,7 @@ bnx2_phys_id(struct net_device *dev, u32 data) return 0; } -static struct ethtool_ops bnx2_ethtool_ops = { +static const struct ethtool_ops bnx2_ethtool_ops = { .get_settings = bnx2_get_settings, .set_settings = bnx2_set_settings, .get_drvinfo = bnx2_get_drvinfo, diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 8b951238f3a2..850aae21a2fe 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4130,7 +4130,7 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, snprintf(drvinfo->fw_version, 32, "%d", BOND_ABI_VERSION); } -static struct ethtool_ops bond_ethtool_ops = { +static const struct ethtool_ops bond_ethtool_ops = { .get_tx_csum = ethtool_op_get_tx_csum, .get_tso = ethtool_op_get_tso, .get_ufo = ethtool_op_get_ufo, diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 7ed376448a68..275057ca3dbc 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c @@ -4812,7 +4812,7 @@ static void cas_get_ethtool_stats(struct net_device *dev, BUG_ON(i != CAS_NUM_STAT_KEYS); } -static struct ethtool_ops cas_ethtool_ops = { +static const struct ethtool_ops cas_ethtool_ops = { .get_drvinfo = cas_get_drvinfo, .get_settings = cas_get_settings, .set_settings = cas_set_settings, diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index b6de184e4699..5f1b06753462 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c @@ -779,7 +779,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e, return 0; } -static struct ethtool_ops t1_ethtool_ops = { +static const struct ethtool_ops t1_ethtool_ops = { .get_settings = get_settings, .set_settings = set_settings, .get_drvinfo = get_drvinfo, diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 0eb1f8787ed7..f1501b6f247e 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c @@ -434,7 +434,7 @@ static void e100_reset_transceiver(struct net_device* net); static void e100_clear_network_leds(unsigned long dummy); static void e100_set_network_leds(int active); -static struct ethtool_ops e100_ethtool_ops; +static const struct ethtool_ops e100_ethtool_ops; static void broadcom_check_speed(struct net_device* dev); static void broadcom_check_duplex(struct net_device* dev); @@ -1552,7 +1552,7 @@ static int e100_nway_reset(struct net_device *dev) return 0; } -static struct ethtool_ops e100_ethtool_ops = { +static const struct ethtool_ops e100_ethtool_ops = { .get_settings = e100_get_settings, .set_settings = e100_set_settings, .get_drvinfo = e100_get_drvinfo, diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 5c520f6f66ef..c5c80da239de 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c @@ -83,7 +83,7 @@ static int mii_read (struct net_device *dev, int phy_addr, int reg_num); static int mii_write (struct net_device *dev, int phy_addr, int reg_num, u16 data); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; static int __devinit rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent) @@ -1261,7 +1261,7 @@ static u32 rio_get_link(struct net_device *dev) return np->link_status; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .get_drvinfo = rio_get_drvinfo, .get_settings = rio_get_settings, .set_settings = rio_set_settings, diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 47d970896a5c..dc5e38aefca6 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -2477,7 +2477,7 @@ static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data) } } -static struct ethtool_ops e100_ethtool_ops = { +static const struct ethtool_ops e100_ethtool_ops = { .get_settings = e100_get_settings, .set_settings = e100_set_settings, .get_drvinfo = e100_get_drvinfo, diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index 3fccffdb27b5..0759bf0dcce6 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c @@ -1922,7 +1922,7 @@ e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) } } -static struct ethtool_ops e1000_ethtool_ops = { +static const struct ethtool_ops e1000_ethtool_ops = { .get_settings = e1000_get_settings, .set_settings = e1000_set_settings, .get_drvinfo = e1000_get_drvinfo, diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index bf9efa75390f..09ff9b9418f4 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c @@ -743,7 +743,7 @@ static void __init eepro_print_info (struct net_device *dev) printEEPROMInfo(dev); } -static struct ethtool_ops eepro_ethtool_ops; +static const struct ethtool_ops eepro_ethtool_ops; /* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probe avoids doing writes, and @@ -1771,7 +1771,7 @@ static void eepro_ethtool_get_drvinfo(struct net_device *dev, sprintf(drvinfo->bus_info, "ISA 0x%lx", dev->base_addr); } -static struct ethtool_ops eepro_ethtool_ops = { +static const struct ethtool_ops eepro_ethtool_ops = { .get_settings = eepro_ethtool_get_settings, .get_drvinfo = eepro_ethtool_get_drvinfo, }; diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index 4ee87903c9cf..499e93b31f54 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -494,7 +494,7 @@ static struct net_device_stats *speedo_get_stats(struct net_device *dev); static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static void set_rx_mode(struct net_device *dev); static void speedo_show_state(struct net_device *dev); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; @@ -2015,7 +2015,7 @@ static void speedo_set_msglevel(struct net_device *dev, u32 v) sp->msg_enable = v; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .get_drvinfo = speedo_get_drvinfo, .get_settings = speedo_get_settings, .set_settings = speedo_set_settings, diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c index 6906af6277c8..82eb2fb8c75e 100644 --- a/drivers/net/ehea/ehea_ethtool.c +++ b/drivers/net/ehea/ehea_ethtool.c @@ -270,7 +270,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev, kfree(cb6); } -struct ethtool_ops ehea_ethtool_ops = { +const struct ethtool_ops ehea_ethtool_ops = { .get_settings = ehea_get_settings, .get_drvinfo = ehea_get_drvinfo, .get_msglevel = ehea_get_msglevel, diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index b885b2029b49..ba2565ee0439 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c @@ -299,7 +299,7 @@ static int epic_rx(struct net_device *dev, int budget); static int epic_poll(struct net_device *dev, int *budget); static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static int epic_close(struct net_device *dev); static struct net_device_stats *epic_get_stats(struct net_device *dev); static void set_rx_mode(struct net_device *dev); @@ -1492,7 +1492,7 @@ static void ethtool_complete(struct net_device *dev) } } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_settings = netdev_get_settings, .set_settings = netdev_set_settings, diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index 78a1c425a9ab..75a43f7c70cf 100644 --- a/drivers/net/ewrk3.c +++ b/drivers/net/ewrk3.c @@ -305,8 +305,8 @@ static int ewrk3_close(struct net_device *dev); static struct net_device_stats *ewrk3_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops ethtool_ops_203; -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops_203; +static const struct ethtool_ops ethtool_ops; /* ** Private functions @@ -1666,14 +1666,14 @@ static int ewrk3_phys_id(struct net_device *dev, u32 data) return signal_pending(current) ? -ERESTARTSYS : 0; } -static struct ethtool_ops ethtool_ops_203 = { +static const struct ethtool_ops ethtool_ops_203 = { .get_drvinfo = ewrk3_get_drvinfo, .get_settings = ewrk3_get_settings, .set_settings = ewrk3_set_settings, .phys_id = ewrk3_phys_id, }; -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .get_drvinfo = ewrk3_get_drvinfo, .get_settings = ewrk3_get_settings, .set_settings = ewrk3_set_settings, diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index b7f471651df1..191bd429076a 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c @@ -440,7 +440,7 @@ static void set_rx_mode(struct net_device *dev); static void __set_rx_mode(struct net_device *dev); static struct net_device_stats *get_stats(struct net_device *dev); static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static int netdev_close(struct net_device *dev); static void reset_rx_descriptors(struct net_device *dev); static void reset_tx_descriptors(struct net_device *dev); @@ -1885,7 +1885,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 value) debug = value; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_settings = netdev_get_settings, .set_settings = netdev_set_settings, diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c index 282b1452c39a..22ac2df1aeb0 100644 --- a/drivers/net/fec_8xx/fec_main.c +++ b/drivers/net/fec_8xx/fec_main.c @@ -1034,20 +1034,20 @@ static void fec_set_msglevel(struct net_device *dev, __u32 value) fep->msg_enable = value; } -static struct ethtool_ops fec_ethtool_ops = { - .get_drvinfo = fec_get_drvinfo, - .get_regs_len = fec_get_regs_len, - .get_settings = fec_get_settings, - .set_settings = fec_set_settings, - .nway_reset = fec_nway_reset, - .get_link = ethtool_op_get_link, - .get_msglevel = fec_get_msglevel, - .set_msglevel = fec_set_msglevel, - .get_tx_csum = ethtool_op_get_tx_csum, - .set_tx_csum = ethtool_op_set_tx_csum, /* local! */ - .get_sg = ethtool_op_get_sg, - .set_sg = ethtool_op_set_sg, - .get_regs = fec_get_regs, +static const struct ethtool_ops fec_ethtool_ops = { + .get_drvinfo = fec_get_drvinfo, + .get_regs_len = fec_get_regs_len, + .get_settings = fec_get_settings, + .set_settings = fec_set_settings, + .nway_reset = fec_nway_reset, + .get_link = ethtool_op_get_link, + .get_msglevel = fec_get_msglevel, + .set_msglevel = fec_set_msglevel, + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, /* local! */ + .get_sg = ethtool_op_get_sg, + .set_sg = ethtool_op_set_sg, + .get_regs = fec_get_regs, }; static int fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 59f9a515c07c..b8df5ca4e6aa 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -3962,7 +3962,7 @@ static void nv_get_strings(struct net_device *dev, u32 stringset, u8 *buffer) } } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = nv_get_drvinfo, .get_link = ethtool_op_get_link, .get_wol = nv_get_wol, diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index df62506a1787..34412bc7c4b6 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -908,7 +908,7 @@ static void fs_set_msglevel(struct net_device *dev, u32 value) fep->msg_enable = value; } -static struct ethtool_ops fs_ethtool_ops = { +static const struct ethtool_ops fs_ethtool_ops = { .get_drvinfo = fs_get_drvinfo, .get_regs_len = fs_get_regs_len, .get_settings = fs_get_settings, diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index bf3aa275ef4a..4788a41da1c0 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -143,7 +143,7 @@ void gfar_start(struct net_device *dev); static void gfar_clear_exact_match(struct net_device *dev); static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr); -extern struct ethtool_ops gfar_ethtool_ops; +extern const struct ethtool_ops gfar_ethtool_ops; MODULE_AUTHOR("Freescale Semiconductor, Inc"); MODULE_DESCRIPTION("Gianfar Ethernet Driver"); diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index f87bbc408dae..c35d47c40c39 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h @@ -754,8 +754,6 @@ static inline void gfar_write(volatile unsigned __iomem *addr, u32 val) out_be32(addr, val); } -extern struct ethtool_ops *gfar_op_array[]; - extern irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs); extern int startup_gfar(struct net_device *dev); extern void stop_gfar(struct net_device *dev); diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index de8da82cb7ee..6d71bea5e900 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c @@ -567,7 +567,7 @@ static void gfar_set_msglevel(struct net_device *dev, uint32_t data) } -struct ethtool_ops gfar_ethtool_ops = { +const struct ethtool_ops gfar_ethtool_ops = { .get_settings = gfar_gsettings, .set_settings = gfar_ssettings, .get_drvinfo = gfar_gdrvinfo, diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index a860c81e4d87..b59bab9e9792 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c @@ -563,8 +563,8 @@ static void hamachi_error(struct net_device *dev, int intr_status); static int hamachi_close(struct net_device *dev); static struct net_device_stats *hamachi_get_stats(struct net_device *dev); static void set_rx_mode(struct net_device *dev); -static struct ethtool_ops ethtool_ops; -static struct ethtool_ops ethtool_ops_no_mii; +static const struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops_no_mii; static int __devinit hamachi_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) @@ -1919,7 +1919,7 @@ static u32 hamachi_get_link(struct net_device *dev) return mii_link_ok(&np->mii_if); } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .begin = check_if_running, .get_drvinfo = hamachi_get_drvinfo, .get_settings = hamachi_get_settings, @@ -1928,7 +1928,7 @@ static struct ethtool_ops ethtool_ops = { .get_link = hamachi_get_link, }; -static struct ethtool_ops ethtool_ops_no_mii = { +static const struct ethtool_ops ethtool_ops_no_mii = { .begin = check_if_running, .get_drvinfo = hamachi_get_drvinfo, }; diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c index 82468e2dc799..944eea66e790 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c @@ -1883,7 +1883,7 @@ static void emac_ethtool_get_drvinfo(struct net_device *ndev, info->regdump_len = emac_ethtool_get_regs_len(ndev); } -static struct ethtool_ops emac_ethtool_ops = { +static const struct ethtool_ops emac_ethtool_ops = { .get_settings = emac_ethtool_get_settings, .set_settings = emac_ethtool_set_settings, .get_drvinfo = emac_ethtool_get_drvinfo, diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 0464e78f733a..48e68f5d1651 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -606,7 +606,7 @@ static u32 netdev_get_link(struct net_device *dev) { return 1; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_settings = netdev_get_settings, .get_link = netdev_get_link, diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index fbda7614d0ef..7acba88f9b56 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -115,7 +115,7 @@ static inline void ioc3_stop(struct ioc3_private *ip); static void ioc3_init(struct net_device *dev); static const char ioc3_str[] = "IOC3 Ethernet"; -static struct ethtool_ops ioc3_ethtool_ops; +static const struct ethtool_ops ioc3_ethtool_ops; /* We use this to acquire receive skb's that we can DMA directly into. */ @@ -1580,7 +1580,7 @@ static u32 ioc3_get_link(struct net_device *dev) return rc; } -static struct ethtool_ops ioc3_ethtool_ops = { +static const struct ethtool_ops ioc3_ethtool_ops = { .get_drvinfo = ioc3_get_drvinfo, .get_settings = ioc3_get_settings, .set_settings = ioc3_set_settings, diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index cdc14401cdbe..41b1d08fd57b 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c @@ -1029,7 +1029,7 @@ static u32 veth_get_link(struct net_device *dev) return 1; } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = veth_get_drvinfo, .get_settings = veth_get_settings, .get_link = veth_get_link, diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c index ba621083830a..64a383e4e892 100644 --- a/drivers/net/ixgb/ixgb_ethtool.c +++ b/drivers/net/ixgb/ixgb_ethtool.c @@ -699,7 +699,7 @@ ixgb_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) } } -static struct ethtool_ops ixgb_ethtool_ops = { +static const struct ethtool_ops ixgb_ethtool_ops = { .get_settings = ixgb_get_settings, .set_settings = ixgb_set_settings, .get_drvinfo = ixgb_get_drvinfo, diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 4a9f40cdba5a..f429b19bf620 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -190,7 +190,7 @@ static u32 loopback_get_link(struct net_device *dev) return 1; } -static struct ethtool_ops loopback_ethtool_ops = { +static const struct ethtool_ops loopback_ethtool_ops = { .get_link = loopback_get_link, .get_tso = ethtool_op_get_tso, .set_tso = ethtool_op_set_tso, diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 70fe838872db..0917a767faf8 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -74,7 +74,7 @@ static int ethernet_phy_detect(unsigned int eth_port_num); static int mv643xx_mdio_read(struct net_device *dev, int phy_id, int location); static void mv643xx_mdio_write(struct net_device *dev, int phy_id, int location, int val); static int mv643xx_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); -static struct ethtool_ops mv643xx_ethtool_ops; +static const struct ethtool_ops mv643xx_ethtool_ops; static char mv643xx_driver_name[] = "mv643xx_eth"; static char mv643xx_driver_version[] = "1.0"; @@ -2766,7 +2766,7 @@ static int mv643xx_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, int c return generic_mii_ioctl(&mp->mii, if_mii(ifr), cmd, NULL); } -static struct ethtool_ops mv643xx_ethtool_ops = { +static const struct ethtool_ops mv643xx_ethtool_ops = { .get_settings = mv643xx_get_settings, .set_settings = mv643xx_set_settings, .get_drvinfo = mv643xx_get_drvinfo, diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b19e2034d11f..2773440c84be 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -1389,7 +1389,7 @@ static u32 myri10ge_get_msglevel(struct net_device *netdev) return mgp->msg_enable; } -static struct ethtool_ops myri10ge_ethtool_ops = { +static const struct ethtool_ops myri10ge_ethtool_ops = { .get_settings = myri10ge_get_settings, .get_drvinfo = myri10ge_get_drvinfo, .get_coalesce = myri10ge_get_coalesce, diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 51cc1e60b8c4..d7b241f7d7bc 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c @@ -647,7 +647,7 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr); static int netdev_close(struct net_device *dev); static int netdev_get_regs(struct net_device *dev, u8 *buf); static int netdev_get_eeprom(struct net_device *dev, u8 *buf); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; static inline void __iomem *ns_ioaddr(struct net_device *dev) { @@ -2573,7 +2573,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 return res; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .get_drvinfo = get_drvinfo, .get_regs_len = get_regs_len, .get_eeprom_len = get_eeprom_len, diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index 1ee7eac0f6ed..589785d1e762 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c @@ -175,7 +175,7 @@ static void ne2k_pci_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset); static void ne2k_pci_block_output(struct net_device *dev, const int count, const unsigned char *buf, const int start_page); -static struct ethtool_ops ne2k_pci_ethtool_ops; +static const struct ethtool_ops ne2k_pci_ethtool_ops; @@ -635,7 +635,7 @@ static void ne2k_pci_get_drvinfo(struct net_device *dev, strcpy(info->bus_info, pci_name(pci_dev)); } -static struct ethtool_ops ne2k_pci_ethtool_ops = { +static const struct ethtool_ops ne2k_pci_ethtool_ops = { .get_drvinfo = ne2k_pci_get_drvinfo, .get_tx_csum = ethtool_op_get_tx_csum, .get_sg = ethtool_op_get_sg, diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index ff76b81d5f3b..a05f6cbfdc0f 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -1273,7 +1273,7 @@ static u32 ns83820_get_link(struct net_device *ndev) return cfg & CFG_LNKSTS ? 1 : 0; } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = ns83820_get_drvinfo, .get_link = ns83820_get_link }; diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index fab93360f017..2418cdb9d317 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -245,7 +245,7 @@ static int el3_rx(struct net_device *dev, int worklimit); static int el3_close(struct net_device *dev); static void el3_tx_timeout(struct net_device *dev); static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void set_rx_mode(struct net_device *dev); static void tc574_detach(struct pcmcia_device *p_dev); @@ -1095,7 +1095,7 @@ static void netdev_get_drvinfo(struct net_device *dev, strcpy(info->driver, "3c574_cs"); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 875a0fe251e7..a0e2b01c027c 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c @@ -158,7 +158,7 @@ static int el3_rx(struct net_device *dev); static int el3_close(struct net_device *dev); static void el3_tx_timeout(struct net_device *dev); static void set_multicast_list(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void tc589_detach(struct pcmcia_device *p_dev); @@ -530,7 +530,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) } #endif /* PCMCIA_DEBUG */ -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, #ifdef PCMCIA_DEBUG .get_msglevel = netdev_get_msglevel, diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index c54f6a7ebf31..a8891a9000ac 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -91,7 +91,7 @@ static void axnet_release(struct pcmcia_device *link); static int axnet_open(struct net_device *dev); static int axnet_close(struct net_device *dev); static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); static void ei_watchdog(u_long arg); static void axnet_reset_8390(struct net_device *dev); @@ -671,7 +671,7 @@ static void netdev_get_drvinfo(struct net_device *dev, strcpy(info->driver, "axnet_cs"); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 74211af0e0c9..d682f30dea6e 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c @@ -103,7 +103,7 @@ static void fjn_reset(struct net_device *dev); static struct net_device_stats *fjn_get_stats(struct net_device *dev); static void set_rx_mode(struct net_device *dev); static void fjn_tx_timeout(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; /* card type @@ -1092,7 +1092,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) } #endif /* PCMCIA_DEBUG */ -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, #ifdef PCMCIA_DEBUG .get_msglevel = netdev_get_msglevel, diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index b8fe70b85641..bc0ca41a0542 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c @@ -126,7 +126,7 @@ static void netdev_get_drvinfo(struct net_device *dev, strcpy(info->driver, "ibmtr_cs"); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index a8f6bfc96fd2..7d5687e94607 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c @@ -431,7 +431,7 @@ static struct net_device_stats *mace_get_stats(struct net_device *dev); static int mace_rx(struct net_device *dev, unsigned char RxCnt); static void restore_multicast_list(struct net_device *dev); static void set_multicast_list(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void nmclan_detach(struct pcmcia_device *p_dev); @@ -907,7 +907,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level) } #endif /* PCMCIA_DEBUG */ -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, #ifdef PCMCIA_DEBUG .get_msglevel = netdev_get_msglevel, diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index cc0dcc9bf636..a09c22840f63 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c @@ -108,7 +108,7 @@ static void pcnet_release(struct pcmcia_device *link); static int pcnet_open(struct net_device *dev); static int pcnet_close(struct net_device *dev); static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); static void ei_watchdog(u_long arg); static void pcnet_reset_8390(struct net_device *dev); @@ -1181,7 +1181,7 @@ static void netdev_get_drvinfo(struct net_device *dev, strcpy(info->driver, "pcnet_cs"); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 3fb369f2e7ed..a2f3a0e2a005 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c @@ -299,7 +299,7 @@ static void mdio_sync(kio_addr_t addr); static int mdio_read(struct net_device *dev, int phy_id, int loc); static void mdio_write(struct net_device *dev, int phy_id, int loc, int value); static int smc_link_ok(struct net_device *dev); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; /*====================================================================== @@ -2207,7 +2207,7 @@ static int smc_nway_reset(struct net_device *dev) return -EOPNOTSUPP; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .begin = check_if_running, .get_drvinfo = smc_get_drvinfo, .get_settings = smc_get_settings, diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 4122bb46f5ff..62664c01eb45 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c @@ -361,7 +361,7 @@ static int set_card_type(struct pcmcia_device *link, const void *s); static int do_config(struct net_device *dev, struct ifmap *map); static int do_open(struct net_device *dev); static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void hardreset(struct net_device *dev); static void do_reset(struct net_device *dev, int full); static int init_mii(struct net_device *dev); @@ -1553,7 +1553,7 @@ static void netdev_get_drvinfo(struct net_device *dev, sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index de05aeb734da..21dc68eff514 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -1499,7 +1499,7 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs, spin_unlock_irqrestore(&lp->lock, flags); } -static struct ethtool_ops pcnet32_ethtool_ops = { +static const struct ethtool_ops pcnet32_ethtool_ops = { .get_settings = pcnet32_get_settings, .set_settings = pcnet32_set_settings, .get_drvinfo = pcnet32_get_drvinfo, diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index c729aeeb4696..09a481a71838 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1588,7 +1588,7 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value) qdev->msg_enable = value; } -static struct ethtool_ops ql3xxx_ethtool_ops = { +static const struct ethtool_ops ql3xxx_ethtool_ops = { .get_settings = ql_get_settings, .get_drvinfo = ql_get_drvinfo, .get_perm_addr = ethtool_op_get_perm_addr, diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index ebb948bbd589..c3015d68bbbe 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -1124,7 +1124,7 @@ static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data) } -static struct ethtool_ops rtl8169_ethtool_ops = { +static const struct ethtool_ops rtl8169_ethtool_ops = { .get_drvinfo = rtl8169_get_drvinfo, .get_regs_len = rtl8169_get_regs_len, .get_link = ethtool_op_get_link, diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 12cde0604580..b7ff484af3e1 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c @@ -427,7 +427,7 @@ static void rionet_set_msglevel(struct net_device *ndev, u32 value) rnet->msg_enable = value; } -static struct ethtool_ops rionet_ethtool_ops = { +static const struct ethtool_ops rionet_ethtool_ops = { .get_drvinfo = rionet_get_drvinfo, .get_msglevel = rionet_get_msglevel, .set_msglevel = rionet_set_msglevel, diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index b93751c3d036..542059107538 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -5736,7 +5736,7 @@ static int s2io_ethtool_op_set_tso(struct net_device *dev, u32 data) return 0; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_settings = s2io_ethtool_gset, .set_settings = s2io_ethtool_sset, .get_drvinfo = s2io_ethtool_gdrvinfo, diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 7142cf80d730..3afd9126a591 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h @@ -999,7 +999,7 @@ static irqreturn_t s2io_msix_fifo_handle(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs); static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static void s2io_set_link(unsigned long data); static int s2io_set_swapper(nic_t * sp); static void s2io_card_down(nic_t *nic); diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 7c1982af2a44..e8f26b79bbaf 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c @@ -1747,7 +1747,7 @@ static void sis190_set_msglevel(struct net_device *dev, u32 value) tp->msg_enable = value; } -static struct ethtool_ops sis190_ethtool_ops = { +static const struct ethtool_ops sis190_ethtool_ops = { .get_settings = sis190_get_settings, .set_settings = sis190_set_settings, .get_drvinfo = sis190_get_drvinfo, diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 430500da6a9d..28606e20df1c 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c @@ -232,7 +232,7 @@ static void sis900_set_capability( struct net_device *net_dev ,struct mii_phy *p static u16 sis900_reset_phy(struct net_device *net_dev, int phy_addr); static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr); static void sis900_set_mode (long ioaddr, int speed, int duplex); -static struct ethtool_ops sis900_ethtool_ops; +static const struct ethtool_ops sis900_ethtool_ops; /** * sis900_get_mac_addr - Get MAC address for stand alone SiS900 model @@ -2099,7 +2099,7 @@ static void sis900_get_wol(struct net_device *net_dev, struct ethtool_wolinfo *w wol->supported = (WAKE_PHY | WAKE_MAGIC); } -static struct ethtool_ops sis900_ethtool_ops = { +static const struct ethtool_ops sis900_ethtool_ops = { .get_drvinfo = sis900_get_drvinfo, .get_msglevel = sis900_get_msglevel, .set_msglevel = sis900_set_msglevel, diff --git a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c index 4265ed91a9c4..e5cb5b548b88 100644 --- a/drivers/net/sk98lin/skethtool.c +++ b/drivers/net/sk98lin/skethtool.c @@ -581,7 +581,7 @@ static int setRxCsum(struct net_device *dev, u32 data) return 0; } -struct ethtool_ops SkGeEthtoolOps = { +const struct ethtool_ops SkGeEthtoolOps = { .get_settings = getSettings, .set_settings = setSettings, .get_drvinfo = getDriverInfo, diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 49e76c7f10da..0ecfc14e7990 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c @@ -248,7 +248,7 @@ static void DumpLong(char*, int); /* global variables *********************************************************/ static SK_BOOL DoPrintInterfaceChange = SK_TRUE; -extern struct ethtool_ops SkGeEthtoolOps; +extern const struct ethtool_ops SkGeEthtoolOps; /* local variables **********************************************************/ static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}}; diff --git a/drivers/net/skge.c b/drivers/net/skge.c index fba8b7455d8b..4b267b85fff2 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -691,7 +691,7 @@ static int skge_phys_id(struct net_device *dev, u32 data) return 0; } -static struct ethtool_ops skge_ethtool_ops = { +static const struct ethtool_ops skge_ethtool_ops = { .get_settings = skge_get_settings, .set_settings = skge_set_settings, .get_drvinfo = skge_get_drvinfo, diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 9429859be54f..c4c51f1418f5 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -3033,7 +3033,7 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, regs->len - B3_RI_WTO_R1); } -static struct ethtool_ops sky2_ethtool_ops = { +static const struct ethtool_ops sky2_ethtool_ops = { .get_settings = sky2_get_settings, .set_settings = sky2_set_settings, .get_drvinfo = sky2_get_drvinfo, diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 4438fe8c9499..a621b17456e5 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -1821,7 +1821,7 @@ static int smc911x_ethtool_geteeprom_len(struct net_device *dev) return SMC911X_EEPROM_LEN; } -static struct ethtool_ops smc911x_ethtool_ops = { +static const struct ethtool_ops smc911x_ethtool_ops = { .get_settings = smc911x_ethtool_getsettings, .set_settings = smc911x_ethtool_setsettings, .get_drvinfo = smc911x_ethtool_getdrvinfo, diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 4edfa7fc483a..d7e56438b5d6 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -1739,7 +1739,7 @@ static void smc_ethtool_setmsglevel(struct net_device *dev, u32 level) lp->msg_enable = level; } -static struct ethtool_ops smc_ethtool_ops = { +static const struct ethtool_ops smc_ethtool_ops = { .get_settings = smc_ethtool_getsettings, .set_settings = smc_ethtool_setsettings, .get_drvinfo = smc_ethtool_getdrvinfo, diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h index 30407cdf0892..2e80882b345a 100644 --- a/drivers/net/spider_net.h +++ b/drivers/net/spider_net.h @@ -29,7 +29,7 @@ extern int spider_net_stop(struct net_device *netdev); extern int spider_net_open(struct net_device *netdev); -extern struct ethtool_ops spider_net_ethtool_ops; +extern const struct ethtool_ops spider_net_ethtool_ops; extern char spider_net_driver_name[]; diff --git a/drivers/net/spider_net_ethtool.c b/drivers/net/spider_net_ethtool.c index 02209222b8c9..b0e65d0e0645 100644 --- a/drivers/net/spider_net_ethtool.c +++ b/drivers/net/spider_net_ethtool.c @@ -142,7 +142,7 @@ spider_net_ethtool_get_ringparam(struct net_device *netdev, ering->rx_pending = card->rx_desc; } -struct ethtool_ops spider_net_ethtool_ops = { +const struct ethtool_ops spider_net_ethtool_ops = { .get_settings = spider_net_ethtool_get_settings, .get_drvinfo = spider_net_ethtool_get_drvinfo, .get_wol = spider_net_ethtool_get_wol, diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 525b098a3254..337c3b7ac90e 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c @@ -642,7 +642,7 @@ static struct net_device_stats *get_stats(struct net_device *dev); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int netdev_close(struct net_device *dev); static void netdev_media_change(struct net_device *dev); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; #ifdef VLAN_SUPPORT @@ -1868,7 +1868,7 @@ static void set_msglevel(struct net_device *dev, u32 val) debug = val; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .begin = check_if_running, .get_drvinfo = get_drvinfo, .get_settings = get_settings, diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c index d46891510767..9e4be86495a0 100644 --- a/drivers/net/sunbmac.c +++ b/drivers/net/sunbmac.c @@ -1071,7 +1071,7 @@ static u32 bigmac_get_link(struct net_device *dev) return (bp->sw_bmsr & BMSR_LSTATUS); } -static struct ethtool_ops bigmac_ethtool_ops = { +static const struct ethtool_ops bigmac_ethtool_ops = { .get_drvinfo = bigmac_get_drvinfo, .get_link = bigmac_get_link, }; diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index f64a28513ba2..6b8f4baf87fd 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -431,7 +431,7 @@ static int __set_mac_addr(struct net_device *dev); static struct net_device_stats *get_stats(struct net_device *dev); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int netdev_close(struct net_device *dev); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; static void sundance_reset(struct net_device *dev, unsigned long reset_cmd) { @@ -1569,7 +1569,7 @@ static void set_msglevel(struct net_device *dev, u32 val) np->msg_enable = val; } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .begin = check_if_running, .get_drvinfo = get_drvinfo, .get_settings = get_settings, diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index eb8a47605837..e567d0ae77ee 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -2753,7 +2753,7 @@ static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) return 0; } -static struct ethtool_ops gem_ethtool_ops = { +static const struct ethtool_ops gem_ethtool_ops = { .get_drvinfo = gem_get_drvinfo, .get_link = ethtool_op_get_link, .get_settings = gem_get_settings, diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 6779ac1f904a..2ff0ded24000 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -2512,7 +2512,7 @@ static u32 hme_get_link(struct net_device *dev) return (hp->sw_bmsr & BMSR_LSTATUS); } -static struct ethtool_ops hme_ethtool_ops = { +static const struct ethtool_ops hme_ethtool_ops = { .get_settings = hme_get_settings, .set_settings = hme_set_settings, .get_drvinfo = hme_get_drvinfo, diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index e4c8576454d7..77670741e101 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -1318,7 +1318,7 @@ static u32 sparc_lance_get_link(struct net_device *dev) return 1; } -static struct ethtool_ops sparc_lance_ethtool_ops = { +static const struct ethtool_ops sparc_lance_ethtool_ops = { .get_drvinfo = sparc_lance_get_drvinfo, .get_link = sparc_lance_get_link, }; diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index d5c1448d587c..9202a1c369dd 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c @@ -718,7 +718,7 @@ static u32 qe_get_link(struct net_device *dev) return (phyconfig & MREGS_PHYCONFIG_LSTAT); } -static struct ethtool_ops qe_ethtool_ops = { +static const struct ethtool_ops qe_ethtool_ops = { .get_drvinfo = qe_get_drvinfo, .get_link = qe_get_link, }; diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 4d66d86e41ea..3b84ac234644 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -8962,7 +8962,7 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) return 0; } -static struct ethtool_ops tg3_ethtool_ops = { +static const struct ethtool_ops tg3_ethtool_ops = { .get_settings = tg3_get_settings, .set_settings = tg3_set_settings, .get_drvinfo = tg3_get_drvinfo, diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 17a2ebaef58c..e1b48bd86646 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c @@ -1670,7 +1670,7 @@ static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs, spin_unlock_irq(&de->lock); } -static struct ethtool_ops de_ethtool_ops = { +static const struct ethtool_ops de_ethtool_ops = { .get_link = ethtool_op_get_link, .get_tx_csum = ethtool_op_get_tx_csum, .get_sg = ethtool_op_get_sg, diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 66dade556821..ccf2c225f084 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c @@ -298,7 +298,7 @@ static int dmfe_start_xmit(struct sk_buff *, struct DEVICE *); static int dmfe_stop(struct DEVICE *); static struct net_device_stats * dmfe_get_stats(struct DEVICE *); static void dmfe_set_filter_mode(struct DEVICE *); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static u16 read_srom_word(long ,int); static irqreturn_t dmfe_interrupt(int , void *, struct pt_regs *); #ifdef CONFIG_NET_POLL_CONTROLLER @@ -1048,7 +1048,7 @@ static void netdev_get_drvinfo(struct net_device *dev, dev->base_addr, dev->irq); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 0a339dff014e..831919a81918 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -837,7 +837,7 @@ static void tulip_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *in strcpy(info->bus_info, pci_name(np->pdev)); } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = tulip_get_drvinfo }; diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index c4c720e2d4c3..0b176be51eb3 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c @@ -222,7 +222,7 @@ static int uli526x_start_xmit(struct sk_buff *, struct net_device *); static int uli526x_stop(struct net_device *); static struct net_device_stats * uli526x_get_stats(struct net_device *); static void uli526x_set_filter_mode(struct net_device *); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static u16 read_srom_word(long, int); static irqreturn_t uli526x_interrupt(int, void *, struct pt_regs *); static void uli526x_descriptor_init(struct uli526x_board_info *, unsigned long); @@ -985,7 +985,7 @@ static void uli526x_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) wol->wolopts = 0; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_settings = netdev_get_settings, .get_link = netdev_get_link, diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 264723b592cf..2fca1ee24f5a 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c @@ -339,7 +339,7 @@ static u32 __set_rx_mode(struct net_device *dev); static void set_rx_mode(struct net_device *dev); static struct net_device_stats *get_stats(struct net_device *dev); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static int netdev_close(struct net_device *dev); @@ -1447,7 +1447,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 value) debug = value; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_settings = netdev_get_settings, .set_settings = netdev_set_settings, diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index cf43390d2c80..629eac645289 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c @@ -190,7 +190,7 @@ static void netdev_get_drvinfo(struct net_device *dev, strcpy(info->bus_info, pci_name(private->pdev)); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c index d797b7b2e35f..312788caa4c6 100644 --- a/drivers/net/tulip/xircom_tulip_cb.c +++ b/drivers/net/tulip/xircom_tulip_cb.c @@ -334,7 +334,7 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev); static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static void set_rx_mode(struct net_device *dev); static void check_duplex(struct net_device *dev); -static struct ethtool_ops ops; +static const struct ethtool_ops ops; /* The Xircom cards are picky about when certain bits in CSR6 can be @@ -1430,7 +1430,7 @@ static void xircom_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i strcpy(info->bus_info, pci_name(tp->pdev)); } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_settings = xircom_get_settings, .set_settings = xircom_set_settings, .get_drvinfo = xircom_get_drvinfo, diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 20db30891db0..de8da6dee1b0 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -69,7 +69,7 @@ static int debug; /* Network device part of the driver */ static LIST_HEAD(tun_dev_list); -static struct ethtool_ops tun_ethtool_ops; +static const struct ethtool_ops tun_ethtool_ops; /* Net device open. */ static int tun_net_open(struct net_device *dev) @@ -856,7 +856,7 @@ static int tun_set_rx_csum(struct net_device *dev, u32 data) return 0; } -static struct ethtool_ops tun_ethtool_ops = { +static const struct ethtool_ops tun_ethtool_ops = { .get_settings = tun_get_settings, .get_drvinfo = tun_get_drvinfo, .get_msglevel = tun_get_msglevel, diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 03107310ea7b..2fb4f978ed54 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c @@ -1241,7 +1241,7 @@ typhoon_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) ering->tx_pending = TXLO_ENTRIES - 1; } -static struct ethtool_ops typhoon_ethtool_ops = { +static const struct ethtool_ops typhoon_ethtool_ops = { .get_settings = typhoon_get_settings, .set_settings = typhoon_set_settings, .get_drvinfo = typhoon_get_drvinfo, diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 4e188f4289b4..700ebd7d1457 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -4129,20 +4129,7 @@ static int ucc_geth_close(struct net_device *dev) return 0; } -struct ethtool_ops ucc_geth_ethtool_ops = { - .get_settings = NULL, - .get_drvinfo = NULL, - .get_regs_len = NULL, - .get_regs = NULL, - .get_link = NULL, - .get_coalesce = NULL, - .set_coalesce = NULL, - .get_ringparam = NULL, - .set_ringparam = NULL, - .get_strings = NULL, - .get_stats_count = NULL, - .get_ethtool_stats = NULL, -}; +const struct ethtool_ops ucc_geth_ethtool_ops = { }; static int ucc_geth_probe(struct device *device) { diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index f7bc44f2d96a..acd0a91a09c3 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c @@ -411,7 +411,7 @@ static void rhine_error(struct net_device *dev, int intr_status); static void rhine_set_rx_mode(struct net_device *dev); static struct net_device_stats *rhine_get_stats(struct net_device *dev); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static int rhine_close(struct net_device *dev); static void rhine_shutdown (struct pci_dev *pdev); @@ -1796,7 +1796,7 @@ static int rhine_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) return 0; } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, .get_settings = netdev_get_settings, .set_settings = netdev_set_settings, diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index a0f7820cb54b..dd472b64e5a2 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -86,7 +86,7 @@ static int msglevel = MSG_LEVEL_INFO; static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); -static struct ethtool_ops velocity_ethtool_ops; +static const struct ethtool_ops velocity_ethtool_ops; /* Define module options @@ -2971,7 +2971,7 @@ static void velocity_set_msglevel(struct net_device *dev, u32 value) msglevel = value; } -static struct ethtool_ops velocity_ethtool_ops = { +static const struct ethtool_ops velocity_ethtool_ops = { .get_settings = velocity_get_settings, .set_settings = velocity_set_settings, .get_drvinfo = velocity_get_drvinfo, diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c index e386dcc32e8c..c947025d655f 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c @@ -44,7 +44,7 @@ static void bcm43xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo * strncpy(info->bus_info, pci_name(bcm->pci_dev), ETHTOOL_BUSINFO_LEN); } -struct ethtool_ops bcm43xx_ethtool_ops = { +const struct ethtool_ops bcm43xx_ethtool_ops = { .get_drvinfo = bcm43xx_get_drvinfo, .get_link = ethtool_op_get_link, }; diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h index 813704991f62..6f8d42d3cdf5 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h @@ -3,6 +3,6 @@ #include -extern struct ethtool_ops bcm43xx_ethtool_ops; +extern const struct ethtool_ops bcm43xx_ethtool_ops; #endif /* BCM43xx_ETHTOOL_H_ */ diff --git a/drivers/net/wireless/hostap/hostap.h b/drivers/net/wireless/hostap/hostap.h index 5e63765219fe..e663518bd570 100644 --- a/drivers/net/wireless/hostap/hostap.h +++ b/drivers/net/wireless/hostap/hostap.h @@ -86,7 +86,7 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb); /* hostap_ioctl.c */ extern const struct iw_handler_def hostap_iw_handler_def; -extern struct ethtool_ops prism2_ethtool_ops; +extern const struct ethtool_ops prism2_ethtool_ops; int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 8399de581893..7a4978516eac 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c @@ -3908,7 +3908,7 @@ static void prism2_get_drvinfo(struct net_device *dev, local->sta_fw_ver & 0xff); } -struct ethtool_ops prism2_ethtool_ops = { +const struct ethtool_ops prism2_ethtool_ops = { .get_drvinfo = prism2_get_drvinfo }; diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index d2db8eb412c1..b4d81a04c895 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -5911,7 +5911,7 @@ static u32 ipw2100_ethtool_get_link(struct net_device *dev) return (priv->status & STATUS_ASSOCIATED) ? 1 : 0; } -static struct ethtool_ops ipw2100_ethtool_ops = { +static const struct ethtool_ops ipw2100_ethtool_ops = { .get_link = ipw2100_ethtool_get_link, .get_drvinfo = ipw_ethtool_get_drvinfo, }; diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index f29ec0ebed2f..7358664e0908 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -10461,7 +10461,7 @@ static int ipw_ethtool_set_eeprom(struct net_device *dev, return 0; } -static struct ethtool_ops ipw_ethtool_ops = { +static const struct ethtool_ops ipw_ethtool_ops = { .get_link = ipw_ethtool_get_link, .get_drvinfo = ipw_ethtool_get_drvinfo, .get_eeprom_len = ipw_ethtool_get_eeprom_len, diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 1174ff53e025..1840b69e3cb5 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -165,7 +165,7 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; #define MAX_RID_LEN 1024 static const struct iw_handler_def orinoco_handler_def; -static struct ethtool_ops orinoco_ethtool_ops; +static const struct ethtool_ops orinoco_ethtool_ops; /********************************************************************/ /* Data tables */ @@ -4293,7 +4293,7 @@ static void orinoco_get_drvinfo(struct net_device *dev, "PCMCIA %p", priv->hw.iobase); } -static struct ethtool_ops orinoco_ethtool_ops = { +static const struct ethtool_ops orinoco_ethtool_ops = { .get_drvinfo = orinoco_get_drvinfo, .get_link = ethtool_op_get_link, }; diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 8e112d139e29..4574290f971f 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -99,7 +99,7 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map); static struct net_device_stats *ray_get_stats(struct net_device *dev); static int ray_dev_init(struct net_device *dev); -static struct ethtool_ops netdev_ethtool_ops; +static const struct ethtool_ops netdev_ethtool_ops; static int ray_open(struct net_device *dev); static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev); @@ -1092,7 +1092,7 @@ static void netdev_get_drvinfo(struct net_device *dev, strcpy(info->driver, "ray_cs"); } -static struct ethtool_ops netdev_ethtool_ops = { +static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, }; diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 561250f73fd3..0065f057bb1c 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c @@ -1837,7 +1837,7 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) strncpy(info->driver, "wavelan_cs", sizeof(info->driver)-1); } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = wl_get_drvinfo }; diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index c03e400facee..e0d294c12970 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -1464,7 +1464,7 @@ static void wl3501_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i strlcpy(info->driver, wl3501_dev_info, sizeof(info->driver)); } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = wl3501_get_drvinfo }; diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index de11246b99ee..a4c4953f1365 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c @@ -356,7 +356,7 @@ static void yellowfin_error(struct net_device *dev, int intr_status); static int yellowfin_close(struct net_device *dev); static struct net_device_stats *yellowfin_get_stats(struct net_device *dev); static void set_rx_mode(struct net_device *dev); -static struct ethtool_ops ethtool_ops; +static const struct ethtool_ops ethtool_ops; static int __devinit yellowfin_init_one(struct pci_dev *pdev, @@ -1352,7 +1352,7 @@ static void yellowfin_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo strcpy(info->bus_info, pci_name(np->pci_dev)); } -static struct ethtool_ops ethtool_ops = { +static const struct ethtool_ops ethtool_ops = { .get_drvinfo = yellowfin_get_drvinfo }; -- cgit v1.2.3