aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2008-06-02 11:35:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:01 -0400
commita19d7292dc7f1c7d8704a353f51c7f1529de953b (patch)
tree3df480ca539a4f016428cd46f60aee8572dd38fa /drivers/net/wireless
parenta67edb9e31a328397516d2285269232e98c5f88b (diff)
rndis_wlan: cleanup: rename and remove local pointers
Mixed use of 'dev' and 'usbdev' for usbnet pointer can be confusing. So changing all 'usbnet *dev' to 'usbnet *usbdev'. Also remove 'net_device *net' pointer from 'rndis_wext_bind' as 'usbdev->net' were already used where needed. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rndis_wlan.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index ad46a0ba6e64..8505d8bcb69d 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2279,9 +2279,9 @@ static void rndis_wext_set_multicast_list(struct net_device *dev)
2279 queue_work(priv->workqueue, &priv->work); 2279 queue_work(priv->workqueue, &priv->work);
2280} 2280}
2281 2281
2282static void rndis_wext_link_change(struct usbnet *dev, int state) 2282static void rndis_wext_link_change(struct usbnet *usbdev, int state)
2283{ 2283{
2284 struct rndis_wext_private *priv = get_rndis_wext_priv(dev); 2284 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
2285 2285
2286 /* queue work to avoid recursive calls into rndis_command */ 2286 /* queue work to avoid recursive calls into rndis_command */
2287 set_bit(state ? WORK_LINK_UP : WORK_LINK_DOWN, &priv->work_pending); 2287 set_bit(state ? WORK_LINK_UP : WORK_LINK_DOWN, &priv->work_pending);
@@ -2289,7 +2289,7 @@ static void rndis_wext_link_change(struct usbnet *dev, int state)
2289} 2289}
2290 2290
2291 2291
2292static int rndis_wext_get_caps(struct usbnet *dev) 2292static int rndis_wext_get_caps(struct usbnet *usbdev)
2293{ 2293{
2294 struct { 2294 struct {
2295 __le32 num_items; 2295 __le32 num_items;
@@ -2297,18 +2297,18 @@ static int rndis_wext_get_caps(struct usbnet *dev)
2297 } networks_supported; 2297 } networks_supported;
2298 int len, retval, i, n; 2298 int len, retval, i, n;
2299 __le32 tx_power; 2299 __le32 tx_power;
2300 struct rndis_wext_private *priv = get_rndis_wext_priv(dev); 2300 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
2301 2301
2302 /* determine if supports setting txpower */ 2302 /* determine if supports setting txpower */
2303 len = sizeof(tx_power); 2303 len = sizeof(tx_power);
2304 retval = rndis_query_oid(dev, OID_802_11_TX_POWER_LEVEL, &tx_power, 2304 retval = rndis_query_oid(usbdev, OID_802_11_TX_POWER_LEVEL, &tx_power,
2305 &len); 2305 &len);
2306 if (retval == 0 && le32_to_cpu(tx_power) != 0xFF) 2306 if (retval == 0 && le32_to_cpu(tx_power) != 0xFF)
2307 priv->caps |= CAP_SUPPORT_TXPOWER; 2307 priv->caps |= CAP_SUPPORT_TXPOWER;
2308 2308
2309 /* determine supported modes */ 2309 /* determine supported modes */
2310 len = sizeof(networks_supported); 2310 len = sizeof(networks_supported);
2311 retval = rndis_query_oid(dev, OID_802_11_NETWORK_TYPES_SUPPORTED, 2311 retval = rndis_query_oid(usbdev, OID_802_11_NETWORK_TYPES_SUPPORTED,
2312 &networks_supported, &len); 2312 &networks_supported, &len);
2313 if (retval >= 0) { 2313 if (retval >= 0) {
2314 n = le32_to_cpu(networks_supported.num_items); 2314 n = le32_to_cpu(networks_supported.num_items);
@@ -2447,9 +2447,9 @@ end:
2447} 2447}
2448 2448
2449 2449
2450static int bcm4320_early_init(struct usbnet *dev) 2450static int bcm4320_early_init(struct usbnet *usbdev)
2451{ 2451{
2452 struct rndis_wext_private *priv = get_rndis_wext_priv(dev); 2452 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
2453 char buf[8]; 2453 char buf[8];
2454 2454
2455 /* Early initialization settings, setting these won't have effect 2455 /* Early initialization settings, setting these won't have effect
@@ -2497,27 +2497,26 @@ static int bcm4320_early_init(struct usbnet *dev)
2497 else 2497 else
2498 priv->param_workaround_interval = modparam_workaround_interval; 2498 priv->param_workaround_interval = modparam_workaround_interval;
2499 2499
2500 rndis_set_config_parameter_str(dev, "Country", priv->param_country); 2500 rndis_set_config_parameter_str(usbdev, "Country", priv->param_country);
2501 rndis_set_config_parameter_str(dev, "FrameBursting", 2501 rndis_set_config_parameter_str(usbdev, "FrameBursting",
2502 priv->param_frameburst ? "1" : "0"); 2502 priv->param_frameburst ? "1" : "0");
2503 rndis_set_config_parameter_str(dev, "Afterburner", 2503 rndis_set_config_parameter_str(usbdev, "Afterburner",
2504 priv->param_afterburner ? "1" : "0"); 2504 priv->param_afterburner ? "1" : "0");
2505 sprintf(buf, "%d", priv->param_power_save); 2505 sprintf(buf, "%d", priv->param_power_save);
2506 rndis_set_config_parameter_str(dev, "PowerSaveMode", buf); 2506 rndis_set_config_parameter_str(usbdev, "PowerSaveMode", buf);
2507 sprintf(buf, "%d", priv->param_power_output); 2507 sprintf(buf, "%d", priv->param_power_output);
2508 rndis_set_config_parameter_str(dev, "PwrOut", buf); 2508 rndis_set_config_parameter_str(usbdev, "PwrOut", buf);
2509 sprintf(buf, "%d", priv->param_roamtrigger); 2509 sprintf(buf, "%d", priv->param_roamtrigger);
2510 rndis_set_config_parameter_str(dev, "RoamTrigger", buf); 2510 rndis_set_config_parameter_str(usbdev, "RoamTrigger", buf);
2511 sprintf(buf, "%d", priv->param_roamdelta); 2511 sprintf(buf, "%d", priv->param_roamdelta);
2512 rndis_set_config_parameter_str(dev, "RoamDelta", buf); 2512 rndis_set_config_parameter_str(usbdev, "RoamDelta", buf);
2513 2513
2514 return 0; 2514 return 0;
2515} 2515}
2516 2516
2517 2517
2518static int rndis_wext_bind(struct usbnet *dev, struct usb_interface *intf) 2518static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf)
2519{ 2519{
2520 struct net_device *net = dev->net;
2521 struct rndis_wext_private *priv; 2520 struct rndis_wext_private *priv;
2522 int retval, len; 2521 int retval, len;
2523 __le32 tmp; 2522 __le32 tmp;
@@ -2530,18 +2529,18 @@ static int rndis_wext_bind(struct usbnet *dev, struct usb_interface *intf)
2530 /* These have to be initialized before calling generic_rndis_bind(). 2529 /* These have to be initialized before calling generic_rndis_bind().
2531 * Otherwise we'll be in big trouble in rndis_wext_early_init(). 2530 * Otherwise we'll be in big trouble in rndis_wext_early_init().
2532 */ 2531 */
2533 dev->driver_priv = priv; 2532 usbdev->driver_priv = priv;
2534 memset(priv, 0, sizeof(*priv)); 2533 memset(priv, 0, sizeof(*priv));
2535 memset(priv->name, 0, sizeof(priv->name)); 2534 memset(priv->name, 0, sizeof(priv->name));
2536 strcpy(priv->name, "IEEE802.11"); 2535 strcpy(priv->name, "IEEE802.11");
2537 net->wireless_handlers = &rndis_iw_handlers; 2536 usbdev->net->wireless_handlers = &rndis_iw_handlers;
2538 priv->usbdev = dev; 2537 priv->usbdev = usbdev;
2539 2538
2540 mutex_init(&priv->command_lock); 2539 mutex_init(&priv->command_lock);
2541 spin_lock_init(&priv->stats_lock); 2540 spin_lock_init(&priv->stats_lock);
2542 2541
2543 /* try bind rndis_host */ 2542 /* try bind rndis_host */
2544 retval = generic_rndis_bind(dev, intf, FLAG_RNDIS_PHYM_WIRELESS); 2543 retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS);
2545 if (retval < 0) 2544 if (retval < 0)
2546 goto fail; 2545 goto fail;
2547 2546
@@ -2552,20 +2551,21 @@ static int rndis_wext_bind(struct usbnet *dev, struct usb_interface *intf)
2552 * rndis_host wants to avoid all OID as much as possible 2551 * rndis_host wants to avoid all OID as much as possible
2553 * so do promisc/multicast handling in rndis_wext. 2552 * so do promisc/multicast handling in rndis_wext.
2554 */ 2553 */
2555 dev->net->set_multicast_list = rndis_wext_set_multicast_list; 2554 usbdev->net->set_multicast_list = rndis_wext_set_multicast_list;
2556 tmp = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST; 2555 tmp = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST;
2557 retval = rndis_set_oid(dev, OID_GEN_CURRENT_PACKET_FILTER, &tmp, 2556 retval = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &tmp,
2558 sizeof(tmp)); 2557 sizeof(tmp));
2559 2558
2560 len = sizeof(tmp); 2559 len = sizeof(tmp);
2561 retval = rndis_query_oid(dev, OID_802_3_MAXIMUM_LIST_SIZE, &tmp, &len); 2560 retval = rndis_query_oid(usbdev, OID_802_3_MAXIMUM_LIST_SIZE, &tmp,
2561 &len);
2562 priv->multicast_size = le32_to_cpu(tmp); 2562 priv->multicast_size = le32_to_cpu(tmp);
2563 if (retval < 0 || priv->multicast_size < 0) 2563 if (retval < 0 || priv->multicast_size < 0)
2564 priv->multicast_size = 0; 2564 priv->multicast_size = 0;
2565 if (priv->multicast_size > 0) 2565 if (priv->multicast_size > 0)
2566 dev->net->flags |= IFF_MULTICAST; 2566 usbdev->net->flags |= IFF_MULTICAST;
2567 else 2567 else
2568 dev->net->flags &= ~IFF_MULTICAST; 2568 usbdev->net->flags &= ~IFF_MULTICAST;
2569 2569
2570 priv->iwstats.qual.qual = 0; 2570 priv->iwstats.qual.qual = 0;
2571 priv->iwstats.qual.level = 0; 2571 priv->iwstats.qual.level = 0;
@@ -2575,13 +2575,13 @@ static int rndis_wext_bind(struct usbnet *dev, struct usb_interface *intf)
2575 | IW_QUAL_QUAL_INVALID 2575 | IW_QUAL_QUAL_INVALID
2576 | IW_QUAL_LEVEL_INVALID; 2576 | IW_QUAL_LEVEL_INVALID;
2577 2577
2578 rndis_wext_get_caps(dev); 2578 rndis_wext_get_caps(usbdev);
2579 set_default_iw_params(dev); 2579 set_default_iw_params(usbdev);
2580 2580
2581 /* turn radio on */ 2581 /* turn radio on */
2582 priv->radio_on = 1; 2582 priv->radio_on = 1;
2583 disassociate(dev, 1); 2583 disassociate(usbdev, 1);
2584 netif_carrier_off(dev->net); 2584 netif_carrier_off(usbdev->net);
2585 2585
2586 /* because rndis_command() sleeps we need to use workqueue */ 2586 /* because rndis_command() sleeps we need to use workqueue */
2587 priv->workqueue = create_singlethread_workqueue("rndis_wlan"); 2587 priv->workqueue = create_singlethread_workqueue("rndis_wlan");
@@ -2598,12 +2598,12 @@ fail:
2598} 2598}
2599 2599
2600 2600
2601static void rndis_wext_unbind(struct usbnet *dev, struct usb_interface *intf) 2601static void rndis_wext_unbind(struct usbnet *usbdev, struct usb_interface *intf)
2602{ 2602{
2603 struct rndis_wext_private *priv = get_rndis_wext_priv(dev); 2603 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
2604 2604
2605 /* turn radio off */ 2605 /* turn radio off */
2606 disassociate(dev, 0); 2606 disassociate(usbdev, 0);
2607 2607
2608 cancel_delayed_work_sync(&priv->stats_work); 2608 cancel_delayed_work_sync(&priv->stats_work);
2609 cancel_work_sync(&priv->work); 2609 cancel_work_sync(&priv->work);
@@ -2614,13 +2614,13 @@ static void rndis_wext_unbind(struct usbnet *dev, struct usb_interface *intf)
2614 kfree(priv->wpa_ie); 2614 kfree(priv->wpa_ie);
2615 kfree(priv); 2615 kfree(priv);
2616 2616
2617 rndis_unbind(dev, intf); 2617 rndis_unbind(usbdev, intf);
2618} 2618}
2619 2619
2620 2620
2621static int rndis_wext_reset(struct usbnet *dev) 2621static int rndis_wext_reset(struct usbnet *usbdev)
2622{ 2622{
2623 return deauthenticate(dev); 2623 return deauthenticate(usbdev);
2624} 2624}
2625 2625
2626 2626