aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-05-25 13:05:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:40 -0400
commit634b8f49c11f49272b09d13a34b22a17b8c3d419 (patch)
tree75ccd1d8160390235ada42d1c311710534392a02 /drivers/net/wireless/libertas/main.c
parentec3eef28d9bc3fbcc5d3dd668dffcaa675015b11 (diff)
[PATCH] libertas: remove unused variables in wlan_dev_t
Actually, this patch removev wlan_dev_t totally and puts the used variables of it directly into wlan_private. That reduces one level of indirection and looks a little bit simpler. It's now "priv->card" and not "priv->wlan_dev.card" and "priv->dev" instead of "priv->wlan_dev.netdev" Changed two occurences of "((wlan_private *) dev->priv)->wlan_dev.netdev" into "dev", because I didn't see the point in doing pointer-ping-pong. The variables "ioport", "upld_rcv" and "upld_type" where unused. They have been removed. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 8c1f0e1e890..5e0fc8b72d7 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -261,10 +261,10 @@ static int wlan_dev_open(struct net_device *dev)
261 priv->open = 1; 261 priv->open = 1;
262 262
263 if (adapter->connect_status == libertas_connected) { 263 if (adapter->connect_status == libertas_connected) {
264 netif_carrier_on(priv->wlan_dev.netdev); 264 netif_carrier_on(priv->dev);
265 netif_carrier_on(priv->mesh_dev); 265 netif_carrier_on(priv->mesh_dev);
266 } else { 266 } else {
267 netif_carrier_off(priv->wlan_dev.netdev); 267 netif_carrier_off(priv->dev);
268 netif_carrier_off(priv->mesh_dev); 268 netif_carrier_off(priv->mesh_dev);
269 } 269 }
270 270
@@ -286,7 +286,7 @@ static int mesh_open(struct net_device *dev)
286 priv->mesh_open = 1 ; 286 priv->mesh_open = 1 ;
287 netif_wake_queue(priv->mesh_dev); 287 netif_wake_queue(priv->mesh_dev);
288 if (priv->infra_open == 0) 288 if (priv->infra_open == 0)
289 return wlan_dev_open(priv->wlan_dev.netdev) ; 289 return wlan_dev_open(priv->dev) ;
290 return 0; 290 return 0;
291} 291}
292 292
@@ -303,9 +303,9 @@ static int wlan_open(struct net_device *dev)
303 if(pre_open_check(dev) == -1) 303 if(pre_open_check(dev) == -1)
304 return -1; 304 return -1;
305 priv->infra_open = 1 ; 305 priv->infra_open = 1 ;
306 netif_wake_queue(priv->wlan_dev.netdev); 306 netif_wake_queue(priv->dev);
307 if (priv->open == 0) 307 if (priv->open == 0)
308 return wlan_dev_open(priv->wlan_dev.netdev) ; 308 return wlan_dev_open(priv->dev) ;
309 return 0; 309 return 0;
310} 310}
311 311
@@ -315,7 +315,7 @@ static int wlan_dev_close(struct net_device *dev)
315 315
316 lbs_deb_enter(LBS_DEB_NET); 316 lbs_deb_enter(LBS_DEB_NET);
317 317
318 netif_carrier_off(priv->wlan_dev.netdev); 318 netif_carrier_off(priv->dev);
319 netif_carrier_off(priv->mesh_dev); 319 netif_carrier_off(priv->mesh_dev);
320 priv->open = 0; 320 priv->open = 0;
321 321
@@ -336,7 +336,7 @@ static int mesh_close(struct net_device *dev)
336 priv->mesh_open = 0; 336 priv->mesh_open = 0;
337 netif_stop_queue(priv->mesh_dev); 337 netif_stop_queue(priv->mesh_dev);
338 if (priv->infra_open == 0) 338 if (priv->infra_open == 0)
339 return wlan_dev_close( ((wlan_private *) dev->priv)->wlan_dev.netdev) ; 339 return wlan_dev_close(dev);
340 else 340 else
341 return 0; 341 return 0;
342} 342}
@@ -351,10 +351,10 @@ static int wlan_close(struct net_device *dev)
351{ 351{
352 wlan_private *priv = (wlan_private *) dev->priv; 352 wlan_private *priv = (wlan_private *) dev->priv;
353 353
354 netif_stop_queue(priv->wlan_dev.netdev); 354 netif_stop_queue(dev);
355 priv->infra_open = 0; 355 priv->infra_open = 0;
356 if (priv->mesh_open == 0) 356 if (priv->mesh_open == 0)
357 return wlan_dev_close( ((wlan_private *) dev->priv)->wlan_dev.netdev) ; 357 return wlan_dev_close(dev);
358 else 358 else
359 return 0; 359 return 0;
360} 360}
@@ -367,12 +367,12 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
367 367
368 lbs_deb_enter(LBS_DEB_NET); 368 lbs_deb_enter(LBS_DEB_NET);
369 369
370 if (priv->wlan_dev.dnld_sent || priv->adapter->TxLockFlag) { 370 if (priv->dnld_sent || priv->adapter->TxLockFlag) {
371 priv->stats.tx_dropped++; 371 priv->stats.tx_dropped++;
372 goto done; 372 goto done;
373 } 373 }
374 374
375 netif_stop_queue(priv->wlan_dev.netdev); 375 netif_stop_queue(priv->dev);
376 netif_stop_queue(priv->mesh_dev); 376 netif_stop_queue(priv->mesh_dev);
377 377
378 if (libertas_process_tx(priv, skb) == 0) 378 if (libertas_process_tx(priv, skb) == 0)
@@ -395,7 +395,7 @@ static int mesh_pre_start_xmit(struct sk_buff *skb, struct net_device *dev)
395 395
396 SET_MESH_FRAME(skb); 396 SET_MESH_FRAME(skb);
397 397
398 ret = wlan_hard_start_xmit(skb, priv->wlan_dev.netdev); 398 ret = wlan_hard_start_xmit(skb, priv->dev);
399 lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); 399 lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
400 return ret; 400 return ret;
401} 401}
@@ -425,7 +425,7 @@ static void wlan_tx_timeout(struct net_device *dev)
425 425
426 lbs_pr_err("tx watch dog timeout\n"); 426 lbs_pr_err("tx watch dog timeout\n");
427 427
428 priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; 428 priv->dnld_sent = DNLD_RES_RECEIVED;
429 dev->trans_start = jiffies; 429 dev->trans_start = jiffies;
430 430
431 if (priv->adapter->currenttxskb) { 431 if (priv->adapter->currenttxskb) {
@@ -437,7 +437,7 @@ static void wlan_tx_timeout(struct net_device *dev)
437 } else 437 } else
438 wake_up_interruptible(&priv->mainthread.waitq); 438 wake_up_interruptible(&priv->mainthread.waitq);
439 } else if (priv->adapter->connect_status == libertas_connected) { 439 } else if (priv->adapter->connect_status == libertas_connected) {
440 netif_wake_queue(priv->wlan_dev.netdev); 440 netif_wake_queue(priv->dev);
441 netif_wake_queue(priv->mesh_dev); 441 netif_wake_queue(priv->mesh_dev);
442 } 442 }
443 443
@@ -611,14 +611,14 @@ static int wlan_service_main_thread(void *data)
611 lbs_deb_thread( "main-thread 111: intcounter=%d " 611 lbs_deb_thread( "main-thread 111: intcounter=%d "
612 "currenttxskb=%p dnld_sent=%d\n", 612 "currenttxskb=%p dnld_sent=%d\n",
613 adapter->intcounter, 613 adapter->intcounter,
614 adapter->currenttxskb, priv->wlan_dev.dnld_sent); 614 adapter->currenttxskb, priv->dnld_sent);
615 615
616 add_wait_queue(&thread->waitq, &wait); 616 add_wait_queue(&thread->waitq, &wait);
617 set_current_state(TASK_INTERRUPTIBLE); 617 set_current_state(TASK_INTERRUPTIBLE);
618 spin_lock_irq(&adapter->driver_lock); 618 spin_lock_irq(&adapter->driver_lock);
619 if ((adapter->psstate == PS_STATE_SLEEP) || 619 if ((adapter->psstate == PS_STATE_SLEEP) ||
620 (!adapter->intcounter 620 (!adapter->intcounter
621 && (priv->wlan_dev.dnld_sent || adapter->cur_cmd || 621 && (priv->dnld_sent || adapter->cur_cmd ||
622 list_empty(&adapter->cmdpendingq)))) { 622 list_empty(&adapter->cmdpendingq)))) {
623 lbs_deb_thread( 623 lbs_deb_thread(
624 "main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n", 624 "main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n",
@@ -633,7 +633,7 @@ static int wlan_service_main_thread(void *data)
633 lbs_deb_thread( 633 lbs_deb_thread(
634 "main-thread 222 (waking up): intcounter=%d currenttxskb=%p " 634 "main-thread 222 (waking up): intcounter=%d currenttxskb=%p "
635 "dnld_sent=%d\n", adapter->intcounter, 635 "dnld_sent=%d\n", adapter->intcounter,
636 adapter->currenttxskb, priv->wlan_dev.dnld_sent); 636 adapter->currenttxskb, priv->dnld_sent);
637 637
638 set_current_state(TASK_RUNNING); 638 set_current_state(TASK_RUNNING);
639 remove_wait_queue(&thread->waitq, &wait); 639 remove_wait_queue(&thread->waitq, &wait);
@@ -642,7 +642,7 @@ static int wlan_service_main_thread(void *data)
642 lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p " 642 lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p "
643 "dnld_sent=%d\n", 643 "dnld_sent=%d\n",
644 adapter->intcounter, 644 adapter->intcounter,
645 adapter->currenttxskb, priv->wlan_dev.dnld_sent); 645 adapter->currenttxskb, priv->dnld_sent);
646 646
647 if (kthread_should_stop() 647 if (kthread_should_stop()
648 || adapter->surpriseremoved) { 648 || adapter->surpriseremoved) {
@@ -671,7 +671,7 @@ static int wlan_service_main_thread(void *data)
671 lbs_deb_thread("main-thread 444: intcounter=%d currenttxskb=%p " 671 lbs_deb_thread("main-thread 444: intcounter=%d currenttxskb=%p "
672 "dnld_sent=%d\n", 672 "dnld_sent=%d\n",
673 adapter->intcounter, 673 adapter->intcounter,
674 adapter->currenttxskb, priv->wlan_dev.dnld_sent); 674 adapter->currenttxskb, priv->dnld_sent);
675 675
676 /* command response? */ 676 /* command response? */
677 if (adapter->hisregcpy & his_cmdupldrdy) { 677 if (adapter->hisregcpy & his_cmdupldrdy) {
@@ -702,7 +702,7 @@ static int wlan_service_main_thread(void *data)
702 702
703 /* Check if we need to confirm Sleep Request received previously */ 703 /* Check if we need to confirm Sleep Request received previously */
704 if (adapter->psstate == PS_STATE_PRE_SLEEP) { 704 if (adapter->psstate == PS_STATE_PRE_SLEEP) {
705 if (!priv->wlan_dev.dnld_sent && !adapter->cur_cmd) { 705 if (!priv->dnld_sent && !adapter->cur_cmd) {
706 if (adapter->connect_status == 706 if (adapter->connect_status ==
707 libertas_connected) { 707 libertas_connected) {
708 lbs_deb_thread( 708 lbs_deb_thread(
@@ -710,7 +710,7 @@ static int wlan_service_main_thread(void *data)
710 "dnld_sent=%d cur_cmd=%p, confirm now\n", 710 "dnld_sent=%d cur_cmd=%p, confirm now\n",
711 adapter->intcounter, 711 adapter->intcounter,
712 adapter->currenttxskb, 712 adapter->currenttxskb,
713 priv->wlan_dev.dnld_sent, 713 priv->dnld_sent,
714 adapter->cur_cmd); 714 adapter->cur_cmd);
715 715
716 libertas_ps_confirm_sleep(priv, 716 libertas_ps_confirm_sleep(priv,
@@ -736,7 +736,7 @@ static int wlan_service_main_thread(void *data)
736 continue; 736 continue;
737 737
738 /* Execute the next command */ 738 /* Execute the next command */
739 if (!priv->wlan_dev.dnld_sent && !priv->adapter->cur_cmd) 739 if (!priv->dnld_sent && !priv->adapter->cur_cmd)
740 libertas_execute_next_command(priv); 740 libertas_execute_next_command(priv);
741 741
742 /* Wake-up command waiters which can't sleep in 742 /* Wake-up command waiters which can't sleep in
@@ -784,8 +784,8 @@ wlan_private *libertas_add_card(void *card)
784 goto err_kzalloc; 784 goto err_kzalloc;
785 } 785 }
786 786
787 priv->wlan_dev.netdev = dev; 787 priv->dev = dev;
788 priv->wlan_dev.card = card; 788 priv->card = card;
789 priv->mesh_open = 0; 789 priv->mesh_open = 0;
790 priv->infra_open = 0; 790 priv->infra_open = 0;
791 791
@@ -828,7 +828,7 @@ EXPORT_SYMBOL_GPL(libertas_add_card);
828 828
829int libertas_activate_card(wlan_private *priv, char *fw_name) 829int libertas_activate_card(wlan_private *priv, char *fw_name)
830{ 830{
831 struct net_device *dev = priv->wlan_dev.netdev; 831 struct net_device *dev = priv->dev;
832 int ret = -1; 832 int ret = -1;
833 833
834 lbs_deb_enter(LBS_DEB_MAIN); 834 lbs_deb_enter(LBS_DEB_MAIN);
@@ -916,8 +916,8 @@ int libertas_add_mesh(wlan_private *priv)
916 mesh_dev->do_ioctl = libertas_do_ioctl; 916 mesh_dev->do_ioctl = libertas_do_ioctl;
917 mesh_dev->get_stats = wlan_get_stats; 917 mesh_dev->get_stats = wlan_get_stats;
918 mesh_dev->ethtool_ops = &libertas_ethtool_ops; 918 mesh_dev->ethtool_ops = &libertas_ethtool_ops;
919 memcpy(mesh_dev->dev_addr, priv->wlan_dev.netdev->dev_addr, 919 memcpy(mesh_dev->dev_addr, priv->dev->dev_addr,
920 sizeof(priv->wlan_dev.netdev->dev_addr)); 920 sizeof(priv->dev->dev_addr));
921 921
922#ifdef WIRELESS_EXT 922#ifdef WIRELESS_EXT
923 mesh_dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def; 923 mesh_dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def;
@@ -984,10 +984,10 @@ int libertas_remove_card(wlan_private *priv)
984 if (!adapter) 984 if (!adapter)
985 goto out; 985 goto out;
986 986
987 dev = priv->wlan_dev.netdev; 987 dev = priv->dev;
988 988
989 netif_stop_queue(priv->wlan_dev.netdev); 989 netif_stop_queue(priv->dev);
990 netif_carrier_off(priv->wlan_dev.netdev); 990 netif_carrier_off(priv->dev);
991 991
992 wake_pending_cmdnodes(priv); 992 wake_pending_cmdnodes(priv);
993 993
@@ -1003,7 +1003,7 @@ int libertas_remove_card(wlan_private *priv)
1003 1003
1004 memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN); 1004 memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN);
1005 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 1005 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
1006 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); 1006 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
1007 1007
1008 adapter->surpriseremoved = 1; 1008 adapter->surpriseremoved = 1;
1009 1009
@@ -1017,7 +1017,7 @@ int libertas_remove_card(wlan_private *priv)
1017 1017
1018 lbs_deb_net("unregister finish\n"); 1018 lbs_deb_net("unregister finish\n");
1019 1019
1020 priv->wlan_dev.netdev = NULL; 1020 priv->dev = NULL;
1021 free_netdev(dev); 1021 free_netdev(dev);
1022 1022
1023out: 1023out: