From e700f9f4a208bf6c5d2b4dd67816555930524476 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 14 Aug 2006 17:52:54 -0400 Subject: [PATCH] myri10ge: define some previously hardwired firmware constants Define some previously hardwired firmware constants. Signed-off-by: Brice Goglin Signed-off-by: Jeff Garzik --- drivers/net/myri10ge/myri10ge.c | 17 ++++++++++------- drivers/net/myri10ge/myri10ge_mcp.h | 14 +++++++++++++- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'drivers/net/myri10ge') diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 9bdd43ab3573..f463a2f2bdde 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -271,7 +271,7 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, struct mcp_cmd *buf; char buf_bytes[sizeof(*buf) + 8]; struct mcp_cmd_response *response = mgp->cmd; - char __iomem *cmd_addr = mgp->sram + MXGEFW_CMD_OFFSET; + char __iomem *cmd_addr = mgp->sram + MXGEFW_ETH_CMD; u32 dma_low, dma_high, result, value; int sleep_total = 0; @@ -404,7 +404,7 @@ static void myri10ge_dummy_rdma(struct myri10ge_priv *mgp, int enable) buf[4] = htonl(dma_low); /* dummy addr LSW */ buf[5] = htonl(enable); /* enable? */ - submit = mgp->sram + 0xfc01c0; + submit = mgp->sram + MXGEFW_BOOT_DUMMY_RDMA; myri10ge_pio_copy(submit, &buf, sizeof(buf)); for (i = 0; mgp->cmd->data != MYRI10GE_NO_CONFIRM_DATA && i < 20; i++) @@ -600,7 +600,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp) buf[5] = htonl(8); /* where to copy to */ buf[6] = htonl(0); /* where to jump to */ - submit = mgp->sram + 0xfc0000; + submit = mgp->sram + MXGEFW_BOOT_HANDOFF; myri10ge_pio_copy(submit, &buf, sizeof(buf)); mb(); @@ -1648,9 +1648,11 @@ static int myri10ge_open(struct net_device *dev) } if (mgp->mtrr >= 0) { - mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + 0x200000; - mgp->rx_small.wc_fifo = (u8 __iomem *) mgp->sram + 0x300000; - mgp->rx_big.wc_fifo = (u8 __iomem *) mgp->sram + 0x340000; + mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; + mgp->rx_small.wc_fifo = + (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; + mgp->rx_big.wc_fifo = + (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_BIG; } else { mgp->tx.wc_fifo = NULL; mgp->rx_small.wc_fifo = NULL; @@ -1841,7 +1843,8 @@ myri10ge_submit_req_wc(struct myri10ge_tx_buf *tx, if (cnt > 0) { /* pad it to 64 bytes. The src is 64 bytes bigger than it * needs to be so that we don't overrun it */ - myri10ge_pio_copy(tx->wc_fifo + (cnt << 18), src, 64); + myri10ge_pio_copy(tx->wc_fifo + MXGEFW_ETH_SEND_OFFSET(cnt), + src, 64); mb(); } } diff --git a/drivers/net/myri10ge/myri10ge_mcp.h b/drivers/net/myri10ge/myri10ge_mcp.h index 0a6cae6cb186..d7dfaa5f64a2 100644 --- a/drivers/net/myri10ge/myri10ge_mcp.h +++ b/drivers/net/myri10ge/myri10ge_mcp.h @@ -91,7 +91,19 @@ struct mcp_kreq_ether_recv { /* Commands */ -#define MXGEFW_CMD_OFFSET 0xf80000 +#define MXGEFW_BOOT_HANDOFF 0xfc0000 +#define MXGEFW_BOOT_DUMMY_RDMA 0xfc01c0 + +#define MXGEFW_ETH_CMD 0xf80000 +#define MXGEFW_ETH_SEND_4 0x200000 +#define MXGEFW_ETH_SEND_1 0x240000 +#define MXGEFW_ETH_SEND_2 0x280000 +#define MXGEFW_ETH_SEND_3 0x2c0000 +#define MXGEFW_ETH_RECV_SMALL 0x300000 +#define MXGEFW_ETH_RECV_BIG 0x340000 + +#define MXGEFW_ETH_SEND(n) (0x200000 + (((n) & 0x03) * 0x40000)) +#define MXGEFW_ETH_SEND_OFFSET(n) (MXGEFW_ETH_SEND(n) - MXGEFW_ETH_SEND_4) enum myri10ge_mcp_cmd_type { MXGEFW_CMD_NONE = 0, -- cgit v1.2.3 From fd6746daade513bf7f887625c107878b6aacccfd Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 14 Aug 2006 17:53:15 -0400 Subject: [PATCH] myri10ge: convert to netdev_alloc_skb Convert the myri10ge driver to use netdev_alloc_skb instead of dev_alloc_skb, which requires to propagate the net_device across several functions. Signed-off-by: Brice Goglin Signed-off-by: Jeff Garzik --- drivers/net/myri10ge/myri10ge.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'drivers/net/myri10ge') diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index f463a2f2bdde..c0c41ca688ef 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -798,12 +798,13 @@ myri10ge_submit_8rx(struct mcp_kreq_ether_recv __iomem * dst, * pages directly and building a fraglist in the near future. */ -static inline struct sk_buff *myri10ge_alloc_big(int bytes) +static inline struct sk_buff *myri10ge_alloc_big(struct net_device *dev, + int bytes) { struct sk_buff *skb; unsigned long data, roundup; - skb = dev_alloc_skb(bytes + 4096 + MXGEFW_PAD); + skb = netdev_alloc_skb(dev, bytes + 4096 + MXGEFW_PAD); if (skb == NULL) return NULL; @@ -821,12 +822,13 @@ static inline struct sk_buff *myri10ge_alloc_big(int bytes) /* Allocate 2x as much space as required and use whichever portion * does not cross a 4KB boundary */ -static inline struct sk_buff *myri10ge_alloc_small_safe(unsigned int bytes) +static inline struct sk_buff *myri10ge_alloc_small_safe(struct net_device *dev, + unsigned int bytes) { struct sk_buff *skb; unsigned long data, boundary; - skb = dev_alloc_skb(2 * (bytes + MXGEFW_PAD) - 1); + skb = netdev_alloc_skb(dev, 2 * (bytes + MXGEFW_PAD) - 1); if (unlikely(skb == NULL)) return NULL; @@ -847,12 +849,13 @@ static inline struct sk_buff *myri10ge_alloc_small_safe(unsigned int bytes) /* Allocate just enough space, and verify that the allocated * space does not cross a 4KB boundary */ -static inline struct sk_buff *myri10ge_alloc_small(int bytes) +static inline struct sk_buff *myri10ge_alloc_small(struct net_device *dev, + int bytes) { struct sk_buff *skb; unsigned long roundup, data, end; - skb = dev_alloc_skb(bytes + 16 + MXGEFW_PAD); + skb = netdev_alloc_skb(dev, bytes + 16 + MXGEFW_PAD); if (unlikely(skb == NULL)) return NULL; @@ -868,15 +871,17 @@ static inline struct sk_buff *myri10ge_alloc_small(int bytes) "myri10ge_alloc_small: small skb crossed 4KB boundary\n"); myri10ge_skb_cross_4k = 1; dev_kfree_skb_any(skb); - skb = myri10ge_alloc_small_safe(bytes); + skb = myri10ge_alloc_small_safe(dev, bytes); } return skb; } static inline int -myri10ge_getbuf(struct myri10ge_rx_buf *rx, struct pci_dev *pdev, int bytes, - int idx) +myri10ge_getbuf(struct myri10ge_rx_buf *rx, struct myri10ge_priv *mgp, + int bytes, int idx) { + struct net_device *dev = mgp->dev; + struct pci_dev *pdev = mgp->pdev; struct sk_buff *skb; dma_addr_t bus; int len, retval = 0; @@ -884,11 +889,11 @@ myri10ge_getbuf(struct myri10ge_rx_buf *rx, struct pci_dev *pdev, int bytes, bytes += VLAN_HLEN; /* account for 802.1q vlan tag */ if ((bytes + MXGEFW_PAD) > (4096 - 16) /* linux overhead */ ) - skb = myri10ge_alloc_big(bytes); + skb = myri10ge_alloc_big(dev, bytes); else if (myri10ge_skb_cross_4k) - skb = myri10ge_alloc_small_safe(bytes); + skb = myri10ge_alloc_small_safe(dev, bytes); else - skb = myri10ge_alloc_small(bytes); + skb = myri10ge_alloc_small(dev, bytes); if (unlikely(skb == NULL)) { rx->alloc_fail++; @@ -951,7 +956,7 @@ myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx, unmap_len = pci_unmap_len(&rx->info[idx], len); /* try to replace the received skb */ - if (myri10ge_getbuf(rx, mgp->pdev, bytes, idx)) { + if (myri10ge_getbuf(rx, mgp, bytes, idx)) { /* drop the frame -- the old skbuf is re-cycled */ mgp->stats.rx_dropped += 1; return 0; @@ -968,7 +973,6 @@ myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx, skb_put(skb, len); skb->protocol = eth_type_trans(skb, mgp->dev); - skb->dev = mgp->dev; if (mgp->csum_flag) { if ((skb->protocol == ntohs(ETH_P_IP)) || (skb->protocol == ntohs(ETH_P_IPV6))) { @@ -1439,7 +1443,7 @@ static int myri10ge_allocate_rings(struct net_device *dev) /* Fill the receive rings */ for (i = 0; i <= mgp->rx_small.mask; i++) { - status = myri10ge_getbuf(&mgp->rx_small, mgp->pdev, + status = myri10ge_getbuf(&mgp->rx_small, mgp, mgp->small_bytes, i); if (status) { printk(KERN_ERR @@ -1451,8 +1455,7 @@ static int myri10ge_allocate_rings(struct net_device *dev) for (i = 0; i <= mgp->rx_big.mask; i++) { status = - myri10ge_getbuf(&mgp->rx_big, mgp->pdev, - dev->mtu + ETH_HLEN, i); + myri10ge_getbuf(&mgp->rx_big, mgp, dev->mtu + ETH_HLEN, i); if (status) { printk(KERN_ERR "myri10ge: %s: alloced only %d big bufs\n", -- cgit v1.2.3 From c58ac5caeb32ef17c2e4fc208f7dc93f6de32b7d Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 21 Aug 2006 17:36:49 -0400 Subject: [PATCH] myri10ge: use netif_msg_link Add msg_enable and use netif_msg_link to enable/disable reporting of link status changes since some Ethernet switches seem to generate a lot of status changes under some circumstances and some people want to avoid useless flooding in the logs. Also add a counter for link status changes to statistics. Signed-off-by: Brice Goglin Signed-off-by: Jeff Garzik --- drivers/net/myri10ge/myri10ge.c | 46 ++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'drivers/net/myri10ge') diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index c0c41ca688ef..a79afe2134ba 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -192,6 +192,8 @@ struct myri10ge_priv { u32 read_dma; u32 write_dma; u32 read_write_dma; + u32 link_changes; + u32 msg_enable; }; static char *myri10ge_fw_unaligned = "myri10ge_ethp_z8e.dat"; @@ -257,6 +259,12 @@ module_param(myri10ge_max_irq_loops, int, S_IRUGO); MODULE_PARM_DESC(myri10ge_max_irq_loops, "Set stuck legacy IRQ detection threshold\n"); +#define MYRI10GE_MSG_DEFAULT NETIF_MSG_LINK + +static int myri10ge_debug = -1; /* defaults above */ +module_param(myri10ge_debug, int, 0); +MODULE_PARM_DESC(myri10ge_debug, "Debug level (0=none,...,16=all)"); + #define MYRI10GE_FW_OFFSET 1024*1024 #define MYRI10GE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((u32)((u64)(X) >> 32)) : (0) @@ -764,6 +772,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) mgp->rx_small.cnt = 0; mgp->rx_done.idx = 0; mgp->rx_done.cnt = 0; + mgp->link_changes = 0; status = myri10ge_update_mac_address(mgp, mgp->dev->dev_addr); myri10ge_change_promisc(mgp, 0, 0); myri10ge_change_pause(mgp, mgp->pause); @@ -1085,13 +1094,19 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp) if (mgp->link_state != stats->link_up) { mgp->link_state = stats->link_up; if (mgp->link_state) { - printk(KERN_INFO "myri10ge: %s: link up\n", - mgp->dev->name); + if (netif_msg_link(mgp)) + printk(KERN_INFO + "myri10ge: %s: link up\n", + mgp->dev->name); netif_carrier_on(mgp->dev); + mgp->link_changes++; } else { - printk(KERN_INFO "myri10ge: %s: link down\n", - mgp->dev->name); + if (netif_msg_link(mgp)) + printk(KERN_INFO + "myri10ge: %s: link down\n", + mgp->dev->name); netif_carrier_off(mgp->dev); + mgp->link_changes++; } } if (mgp->rdma_tags_available != @@ -1293,8 +1308,9 @@ static const char myri10ge_gstrings_stats[][ETH_GSTRING_LEN] = { "serial_number", "tx_pkt_start", "tx_pkt_done", "tx_req", "tx_done", "rx_small_cnt", "rx_big_cnt", "wake_queue", "stop_queue", "watchdog_resets", "tx_linearized", - "link_up", "dropped_link_overflow", "dropped_link_error_or_filtered", - "dropped_runt", "dropped_overrun", "dropped_no_small_buffer", + "link_changes", "link_up", "dropped_link_overflow", + "dropped_link_error_or_filtered", "dropped_runt", + "dropped_overrun", "dropped_no_small_buffer", "dropped_no_big_buffer" }; @@ -1345,6 +1361,7 @@ myri10ge_get_ethtool_stats(struct net_device *netdev, data[i++] = (unsigned int)mgp->stop_queue; data[i++] = (unsigned int)mgp->watchdog_resets; data[i++] = (unsigned int)mgp->tx_linearized; + data[i++] = (unsigned int)mgp->link_changes; data[i++] = (unsigned int)ntohl(mgp->fw_stats->link_up); data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_link_overflow); data[i++] = @@ -1355,6 +1372,18 @@ myri10ge_get_ethtool_stats(struct net_device *netdev, data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_no_big_buffer); } +static void myri10ge_set_msglevel(struct net_device *netdev, u32 value) +{ + struct myri10ge_priv *mgp = netdev_priv(netdev); + mgp->msg_enable = value; +} + +static u32 myri10ge_get_msglevel(struct net_device *netdev) +{ + struct myri10ge_priv *mgp = netdev_priv(netdev); + return mgp->msg_enable; +} + static struct ethtool_ops myri10ge_ethtool_ops = { .get_settings = myri10ge_get_settings, .get_drvinfo = myri10ge_get_drvinfo, @@ -1375,7 +1404,9 @@ static struct ethtool_ops myri10ge_ethtool_ops = { #endif .get_strings = myri10ge_get_strings, .get_stats_count = myri10ge_get_stats_count, - .get_ethtool_stats = myri10ge_get_ethtool_stats + .get_ethtool_stats = myri10ge_get_ethtool_stats, + .set_msglevel = myri10ge_set_msglevel, + .get_msglevel = myri10ge_get_msglevel }; static int myri10ge_allocate_rings(struct net_device *dev) @@ -2587,6 +2618,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) mgp->csum_flag = MXGEFW_FLAGS_CKSUM; mgp->pause = myri10ge_flow_control; mgp->intr_coal_delay = myri10ge_intr_coal_delay; + mgp->msg_enable = netif_msg_init(myri10ge_debug, MYRI10GE_MSG_DEFAULT); init_waitqueue_head(&mgp->down_wq); if (pci_enable_device(pdev)) { -- cgit v1.2.3 From 85a7ea1b0a3263f3ad423b789a841d03c9acbb65 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 21 Aug 2006 17:36:56 -0400 Subject: [PATCH] myri10ge: use multicast support in the firmware Some recent myri10ge firmwares support multicast filtering as well as an extended mcp_irq_data structure (64 instead of 40 bytes). The new command MXGEFW_CMD_SET_STATS_DMA_V2 is used to check whether the firmware support those. mgp->fw_multicast_support is defined accordingly. When fw_multicast_support is set, some new multicast filtering commands is passed to the board in myri10ge_set_multicast_list(). Signed-off-by: Brice Goglin Signed-off-by: Jeff Garzik --- drivers/net/myri10ge/myri10ge.c | 99 +++++++++++++++++++++++++++++++++++-- drivers/net/myri10ge/myri10ge_mcp.h | 33 +++++++++++-- 2 files changed, 124 insertions(+), 8 deletions(-) (limited to 'drivers/net/myri10ge') diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index a79afe2134ba..e2346e8a4d52 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -187,6 +187,7 @@ struct myri10ge_priv { u8 mac_addr[6]; /* eeprom mac address */ unsigned long serial_number; int vendor_specific_offset; + int fw_multicast_support; u32 devctl; u16 msi_flags; u32 read_dma; @@ -328,6 +329,8 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, if (result == 0) { data->data0 = value; return 0; + } else if (result == MXGEFW_CMD_UNKNOWN) { + return -ENOSYS; } else { dev_err(&mgp->pdev->dev, "command %d failed, result = %d\n", @@ -1309,8 +1312,8 @@ static const char myri10ge_gstrings_stats[][ETH_GSTRING_LEN] = { "tx_req", "tx_done", "rx_small_cnt", "rx_big_cnt", "wake_queue", "stop_queue", "watchdog_resets", "tx_linearized", "link_changes", "link_up", "dropped_link_overflow", - "dropped_link_error_or_filtered", "dropped_runt", - "dropped_overrun", "dropped_no_small_buffer", + "dropped_link_error_or_filtered", "dropped_multicast_filtered", + "dropped_runt", "dropped_overrun", "dropped_no_small_buffer", "dropped_no_big_buffer" }; @@ -1366,6 +1369,8 @@ myri10ge_get_ethtool_stats(struct net_device *netdev, data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_link_overflow); data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_link_error_or_filtered); + data[i++] = + (unsigned int)ntohl(mgp->fw_stats->dropped_multicast_filtered); data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_runt); data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_overrun); data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_no_small_buffer); @@ -1722,7 +1727,21 @@ static int myri10ge_open(struct net_device *dev) cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->fw_stats_bus); cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->fw_stats_bus); - status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_STATS_DMA, &cmd, 0); + cmd.data2 = sizeof(struct mcp_irq_data); + status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_STATS_DMA_V2, &cmd, 0); + if (status == -ENOSYS) { + dma_addr_t bus = mgp->fw_stats_bus; + bus += offsetof(struct mcp_irq_data, send_done_count); + cmd.data0 = MYRI10GE_LOWPART_TO_U32(bus); + cmd.data1 = MYRI10GE_HIGHPART_TO_U32(bus); + status = myri10ge_send_cmd(mgp, + MXGEFW_CMD_SET_STATS_DMA_OBSOLETE, + &cmd, 0); + /* Firmware cannot support multicast without STATS_DMA_V2 */ + mgp->fw_multicast_support = 0; + } else { + mgp->fw_multicast_support = 1; + } if (status) { printk(KERN_ERR "myri10ge: %s: Couldn't set stats DMA\n", dev->name); @@ -2177,9 +2196,81 @@ static struct net_device_stats *myri10ge_get_stats(struct net_device *dev) static void myri10ge_set_multicast_list(struct net_device *dev) { + struct myri10ge_cmd cmd; + struct myri10ge_priv *mgp; + struct dev_mc_list *mc_list; + int err; + + mgp = netdev_priv(dev); /* can be called from atomic contexts, * pass 1 to force atomicity in myri10ge_send_cmd() */ - myri10ge_change_promisc(netdev_priv(dev), dev->flags & IFF_PROMISC, 1); + myri10ge_change_promisc(mgp, dev->flags & IFF_PROMISC, 1); + + /* This firmware is known to not support multicast */ + if (!mgp->fw_multicast_support) + return; + + /* Disable multicast filtering */ + + err = myri10ge_send_cmd(mgp, MXGEFW_ENABLE_ALLMULTI, &cmd, 1); + if (err != 0) { + printk(KERN_ERR "myri10ge: %s: Failed MXGEFW_ENABLE_ALLMULTI," + " error status: %d\n", dev->name, err); + goto abort; + } + + if (dev->flags & IFF_ALLMULTI) { + /* request to disable multicast filtering, so quit here */ + return; + } + + /* Flush the filters */ + + err = myri10ge_send_cmd(mgp, MXGEFW_LEAVE_ALL_MULTICAST_GROUPS, + &cmd, 1); + if (err != 0) { + printk(KERN_ERR + "myri10ge: %s: Failed MXGEFW_LEAVE_ALL_MULTICAST_GROUPS" + ", error status: %d\n", dev->name, err); + goto abort; + } + + /* Walk the multicast list, and add each address */ + for (mc_list = dev->mc_list; mc_list != NULL; mc_list = mc_list->next) { + memcpy(&cmd.data0, &mc_list->dmi_addr, 4); + memcpy(&cmd.data1, ((char *)&mc_list->dmi_addr) + 4, 2); + cmd.data0 = htonl(cmd.data0); + cmd.data1 = htonl(cmd.data1); + err = myri10ge_send_cmd(mgp, MXGEFW_JOIN_MULTICAST_GROUP, + &cmd, 1); + + if (err != 0) { + printk(KERN_ERR "myri10ge: %s: Failed " + "MXGEFW_JOIN_MULTICAST_GROUP, error status:" + "%d\t", dev->name, err); + printk(KERN_ERR "MAC %02x:%02x:%02x:%02x:%02x:%02x\n", + ((unsigned char *)&mc_list->dmi_addr)[0], + ((unsigned char *)&mc_list->dmi_addr)[1], + ((unsigned char *)&mc_list->dmi_addr)[2], + ((unsigned char *)&mc_list->dmi_addr)[3], + ((unsigned char *)&mc_list->dmi_addr)[4], + ((unsigned char *)&mc_list->dmi_addr)[5] + ); + goto abort; + } + } + /* Enable multicast filtering */ + err = myri10ge_send_cmd(mgp, MXGEFW_DISABLE_ALLMULTI, &cmd, 1); + if (err != 0) { + printk(KERN_ERR "myri10ge: %s: Failed MXGEFW_DISABLE_ALLMULTI," + "error status: %d\n", dev->name, err); + goto abort; + } + + return; + +abort: + return; } static int myri10ge_set_mac_address(struct net_device *dev, void *addr) diff --git a/drivers/net/myri10ge/myri10ge_mcp.h b/drivers/net/myri10ge/myri10ge_mcp.h index d7dfaa5f64a2..9519ae7cd5ec 100644 --- a/drivers/net/myri10ge/myri10ge_mcp.h +++ b/drivers/net/myri10ge/myri10ge_mcp.h @@ -166,7 +166,7 @@ enum myri10ge_mcp_cmd_type { MXGEFW_CMD_SET_MTU, MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET, /* in microseconds */ MXGEFW_CMD_SET_STATS_INTERVAL, /* in microseconds */ - MXGEFW_CMD_SET_STATS_DMA, + MXGEFW_CMD_SET_STATS_DMA_OBSOLETE, /* replaced by SET_STATS_DMA_V2 */ MXGEFW_ENABLE_PROMISC, MXGEFW_DISABLE_PROMISC, @@ -180,7 +180,26 @@ enum myri10ge_mcp_cmd_type { * data2 = RDMA length (MSH), WDMA length (LSH) * command return data = repetitions (MSH), 0.5-ms ticks (LSH) */ - MXGEFW_DMA_TEST + MXGEFW_DMA_TEST, + + MXGEFW_ENABLE_ALLMULTI, + MXGEFW_DISABLE_ALLMULTI, + + /* returns MXGEFW_CMD_ERROR_MULTICAST + * if there is no room in the cache + * data0,MSH(data1) = multicast group address */ + MXGEFW_JOIN_MULTICAST_GROUP, + /* returns MXGEFW_CMD_ERROR_MULTICAST + * if the address is not in the cache, + * or is equal to FF-FF-FF-FF-FF-FF + * data0,MSH(data1) = multicast group address */ + MXGEFW_LEAVE_MULTICAST_GROUP, + MXGEFW_LEAVE_ALL_MULTICAST_GROUPS, + + MXGEFW_CMD_SET_STATS_DMA_V2, + /* data0, data1 = bus addr, + * data2 = sizeof(struct mcp_irq_data) from driver point of view, allows + * adding new stuff to mcp_irq_data without changing the ABI */ }; enum myri10ge_mcp_cmd_status { @@ -192,11 +211,17 @@ enum myri10ge_mcp_cmd_status { MXGEFW_CMD_ERROR_CLOSED, MXGEFW_CMD_ERROR_HASH_ERROR, MXGEFW_CMD_ERROR_BAD_PORT, - MXGEFW_CMD_ERROR_RESOURCES + MXGEFW_CMD_ERROR_RESOURCES, + MXGEFW_CMD_ERROR_MULTICAST }; -/* 40 Bytes */ +#define MXGEFW_OLD_IRQ_DATA_LEN 40 + struct mcp_irq_data { + /* add new counters at the beginning */ + u32 future_use[5]; + u32 dropped_multicast_filtered; + /* 40 Bytes */ u32 send_done_count; u32 link_up; -- cgit v1.2.3 From ce7f93680aa1d37171c654536ae0ce9745d86a24 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Thu, 31 Aug 2006 01:32:59 -0400 Subject: [PATCH] myri10ge: improve firmware selection Improve the firmware selection by adding 2 cases where we should use the optimized firmware: * when the actual PCIe link width is lower than 8x. * when the board is plugged to one of the new Intel PCIe chipsets that are known to provide aligned PCIe completions. The patch actually raises two concerns: * We might want to add a generic PCI function to get the PCIe link width since some other drivers (at least ipath) do the same. But we probably do not want to add a new function for every PCIe capability. I will probably look at it and discuss it on linux-pci in the future. * As requested during the submission, the PCI ids of chipsets that are known to provided aligned completion are defined in the myri10ge code. If we keep adding new ones, it might become better to move them to pciids.h. But, this sort of quirk to detect these chipsets are very specific to our NIC, I don't think it is worth moving it to the PCI core until somebody else really needs it. Signed-off-by: Brice Goglin Signed-off-by: Jeff Garzik --- drivers/net/myri10ge/myri10ge.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'drivers/net/myri10ge') diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index e2346e8a4d52..b19e2034d11f 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -2417,6 +2417,8 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp) */ #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 +#define PCI_DEVICE_ID_INTEL_E5000_PCIE23 0x25f7 +#define PCI_DEVICE_ID_INTEL_E5000_PCIE47 0x25fa static void myri10ge_select_firmware(struct myri10ge_priv *mgp) { @@ -2426,15 +2428,34 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp) mgp->fw_name = myri10ge_fw_unaligned; if (myri10ge_force_firmware == 0) { + int link_width, exp_cap; + u16 lnk; + + exp_cap = pci_find_capability(mgp->pdev, PCI_CAP_ID_EXP); + pci_read_config_word(mgp->pdev, exp_cap + PCI_EXP_LNKSTA, &lnk); + link_width = (lnk >> 4) & 0x3f; + myri10ge_enable_ecrc(mgp); - /* Check to see if the upstream bridge is known to - * provide aligned completions */ - if (bridge - /* ServerWorks HT2000/HT1000 */ - && bridge->vendor == PCI_VENDOR_ID_SERVERWORKS - && bridge->device == - PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE) { + /* Check to see if Link is less than 8 or if the + * upstream bridge is known to provide aligned + * completions */ + if (link_width < 8) { + dev_info(&mgp->pdev->dev, "PCIE x%d Link\n", + link_width); + mgp->tx.boundary = 4096; + mgp->fw_name = myri10ge_fw_aligned; + } else if (bridge && + /* ServerWorks HT2000/HT1000 */ + ((bridge->vendor == PCI_VENDOR_ID_SERVERWORKS + && bridge->device == + PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE) + /* All Intel E5000 PCIE ports */ + || (bridge->vendor == PCI_VENDOR_ID_INTEL + && bridge->device >= + PCI_DEVICE_ID_INTEL_E5000_PCIE23 + && bridge->device <= + PCI_DEVICE_ID_INTEL_E5000_PCIE47))) { dev_info(&mgp->pdev->dev, "Assuming aligned completions (0x%x:0x%x)\n", bridge->vendor, bridge->device); -- 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/myri10ge') 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