From 01414802054c382072b6cb9a1bdc6e243c74b2d5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 17 Aug 2010 02:31:15 -0700 Subject: ethtool: Provide a default implementation of ethtool_ops::get_drvinfo The driver name and bus address for a net_device can normally be found through the driver model now. Instead of requiring drivers to provide this information redundantly through the ethtool_ops::get_drvinfo operation, use the driver model to do so if the driver does not define the operation. Since ETHTOOL_GDRVINFO no longer requires the driver to implement any operations, do not require net_device::ethtool_ops to be set either. Remove implementations of get_drvinfo and ethtool_ops that provide only this information. Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller --- drivers/net/wireless/ray_cs.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'drivers/net/wireless/ray_cs.c') diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 88560d0ae50a..3bd9cf76517d 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -80,8 +79,6 @@ 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 const struct ethtool_ops netdev_ethtool_ops; - static int ray_open(struct net_device *dev); static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev); @@ -333,7 +330,6 @@ static int ray_probe(struct pcmcia_device *p_dev) /* Raylink entries in the device structure */ dev->netdev_ops = &ray_netdev_ops; - SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); dev->wireless_handlers = &ray_handler_def; #ifdef WIRELESS_SPY local->wireless_data.spy_data = &local->spy_data; @@ -1062,18 +1058,6 @@ AP to AP 1 1 dest AP src AP dest source } } /* end encapsulate_frame */ -/*===========================================================================*/ - -static void netdev_get_drvinfo(struct net_device *dev, - struct ethtool_drvinfo *info) -{ - strcpy(info->driver, "ray_cs"); -} - -static const struct ethtool_ops netdev_ethtool_ops = { - .get_drvinfo = netdev_get_drvinfo, -}; - /*====================================================================*/ /*------------------------------------------------------------------*/ -- cgit From c061b18df0f1fe3f50fe451dbbdc9ede3c19701a Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 23 Aug 2010 18:20:03 +0000 Subject: drivers/net: Remove address use from assignments of function pointers "foo = &function" is more commonly written "foo = function" Done with coccinelle script: // @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // drivers/net/tehuti.c used a function and struct with the same name, the function was renamed. Compile tested x86 only. Signed-off-by: Joe Perches Signed-off-by: David S. Miller --- drivers/net/wireless/ray_cs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/net/wireless/ray_cs.c') diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 3bd9cf76517d..d91a831a7700 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -604,7 +604,7 @@ static int dl_startup_params(struct net_device *dev) /* Start kernel timer to wait for dl startup to complete. */ local->timer.expires = jiffies + HZ / 2; local->timer.data = (long)local; - local->timer.function = &verify_dl_startup; + local->timer.function = verify_dl_startup; add_timer(&local->timer); dev_dbg(&link->dev, "ray_cs dl_startup_params started timer for verify_dl_startup\n"); @@ -1981,12 +1981,12 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id) dev_dbg(&link->dev, "ray_cs interrupt network \"%s\" start failed\n", local->sparm.b4.a_current_ess_id); - local->timer.function = &start_net; + local->timer.function = start_net; } else { dev_dbg(&link->dev, "ray_cs interrupt network \"%s\" join failed\n", local->sparm.b4.a_current_ess_id); - local->timer.function = &join_net; + local->timer.function = join_net; } add_timer(&local->timer); } @@ -2454,9 +2454,9 @@ static void authenticate(ray_dev_t *local) del_timer(&local->timer); if (build_auth_frame(local, local->bss_id, OPEN_AUTH_REQUEST)) { - local->timer.function = &join_net; + local->timer.function = join_net; } else { - local->timer.function = &authenticate_timeout; + local->timer.function = authenticate_timeout; } local->timer.expires = jiffies + HZ * 2; local->timer.data = (long)local; @@ -2541,7 +2541,7 @@ static void associate(ray_dev_t *local) del_timer(&local->timer); local->timer.expires = jiffies + HZ * 2; local->timer.data = (long)local; - local->timer.function = &join_net; + local->timer.function = join_net; add_timer(&local->timer); local->card_status = CARD_ASSOC_FAILED; return; -- cgit From b6f45c2c03c1d858233cb0c35471dcb6cb213cdf Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 1 Sep 2010 18:16:22 -0700 Subject: ray_cs: make data const Make the startup and other data parameters that are read/only const. Compile tested only. Signed-off-by: Stephen Hemminger Signed-off-by: John W. Linville --- drivers/net/wireless/ray_cs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/net/wireless/ray_cs.c') diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 9c38fc331dca..390ccf6e08a3 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -198,7 +198,7 @@ module_param(bc, int, 0); module_param(phy_addr, charp, 0); module_param(ray_mem_speed, int, 0); -static UCHAR b5_default_startup_parms[] = { +static const UCHAR b5_default_startup_parms[] = { 0, 0, /* Adhoc station */ 'L', 'I', 'N', 'U', 'X', 0, 0, 0, /* 32 char ESSID */ 0, 0, 0, 0, 0, 0, 0, 0, @@ -233,7 +233,7 @@ static UCHAR b5_default_startup_parms[] = { 2, 0, 0, 0, 0, 0, 0, 0 /* basic rate set */ }; -static UCHAR b4_default_startup_parms[] = { +static const UCHAR b4_default_startup_parms[] = { 0, 0, /* Adhoc station */ 'L', 'I', 'N', 'U', 'X', 0, 0, 0, /* 32 char ESSID */ 0, 0, 0, 0, 0, 0, 0, 0, @@ -265,9 +265,9 @@ static UCHAR b4_default_startup_parms[] = { }; /*===========================================================================*/ -static unsigned char eth2_llc[] = { 0xaa, 0xaa, 3, 0, 0, 0 }; +static const u8 eth2_llc[] = { 0xaa, 0xaa, 3, 0, 0, 0 }; -static char hop_pattern_length[] = { 1, +static const char hop_pattern_length[] = { 1, USA_HOP_MOD, EUROPE_HOP_MOD, JAPAN_HOP_MOD, KOREA_HOP_MOD, SPAIN_HOP_MOD, FRANCE_HOP_MOD, @@ -275,7 +275,7 @@ static char hop_pattern_length[] = { 1, JAPAN_TEST_HOP_MOD }; -static char rcsid[] = +static const char rcsid[] = "Raylink/WebGear wireless LAN - Corey "; static const struct net_device_ops ray_netdev_ops = { @@ -2608,7 +2608,7 @@ static void clear_interrupt(ray_dev_t *local) #ifdef CONFIG_PROC_FS #define MAXDATA (PAGE_SIZE - 80) -static char *card_status[] = { +static const char *card_status[] = { "Card inserted - uninitialized", /* 0 */ "Card not downloaded", /* 1 */ "Waiting for download parameters", /* 2 */ @@ -2625,8 +2625,8 @@ static char *card_status[] = { "Association failed" /* 16 */ }; -static char *nettype[] = { "Adhoc", "Infra " }; -static char *framing[] = { "Encapsulation", "Translation" } +static const char *nettype[] = { "Adhoc", "Infra " }; +static const char *framing[] = { "Encapsulation", "Translation" } ; /*===========================================================================*/ -- cgit