aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2007-05-25 00:04:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:36 -0400
commit5c20676fcda300c023d55ba1221b5ff4ab749537 (patch)
treeb14b2d3b54f8f91d5a91131bb73a5597c9b221d3
parent0b7db95602d0eb5339c7b7a9c7beff4b146bdeec (diff)
[PATCH] libertas: remove deprecated pm_register and associated code
Subject says it all. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/if_usb.c12
-rw-r--r--drivers/net/wireless/libertas/main.c136
-rw-r--r--drivers/net/wireless/libertas/sbi.h5
3 files changed, 2 insertions, 151 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index ae6f72a6cdf3..6bc78bb8d1a2 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -852,18 +852,6 @@ wlan_private *libertas_sbi_get_priv(void *card)
852 return cardp->priv; 852 return cardp->priv;
853} 853}
854 854
855#ifdef ENABLE_PM
856int libertas_sbi_suspend(wlan_private * priv)
857{
858 return 0;
859}
860
861int libertas_sbi_resume(wlan_private * priv)
862{
863 return 0;
864}
865#endif
866
867#ifdef CONFIG_PM 855#ifdef CONFIG_PM
868static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) 856static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
869{ 857{
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 76f81c331b9a..c407f2340133 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -28,10 +28,6 @@ const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION
28#endif 28#endif
29 ""; 29 "";
30 30
31#ifdef ENABLE_PM
32static struct pm_dev *wlan_pm_dev = NULL;
33#endif
34
35#define WLAN_TX_PWR_DEFAULT 20 /*100mW */ 31#define WLAN_TX_PWR_DEFAULT 20 /*100mW */
36#define WLAN_TX_PWR_US_DEFAULT 20 /*100mW */ 32#define WLAN_TX_PWR_US_DEFAULT 20 /*100mW */
37#define WLAN_TX_PWR_JP_DEFAULT 16 /*50mW */ 33#define WLAN_TX_PWR_JP_DEFAULT 16 /*50mW */
@@ -172,12 +168,6 @@ u8 libertas_adhoc_rates_g[G_SUPPORTED_RATES] =
172 */ 168 */
173u8 libertas_adhoc_rates_b[4] = { 0x82, 0x84, 0x8b, 0x96 }; 169u8 libertas_adhoc_rates_b[4] = { 0x82, 0x84, 0x8b, 0x96 };
174 170
175/**
176 * the global variable of a pointer to wlan_private
177 * structure variable
178 */
179static wlan_private *wlanpriv = NULL;
180
181#define MAX_DEVS 5 171#define MAX_DEVS 5
182static struct net_device *libertas_devs[MAX_DEVS]; 172static struct net_device *libertas_devs[MAX_DEVS];
183static int libertas_found = 0; 173static int libertas_found = 0;
@@ -374,117 +364,6 @@ static int wlan_close(struct net_device *dev) {
374} 364}
375 365
376 366
377#ifdef ENABLE_PM
378
379/**
380 * @brief This function is a callback function. it is called by
381 * kernel to enter or exit power saving mode.
382 *
383 * @param pmdev A pointer to pm_dev
384 * @param pmreq pm_request_t
385 * @param pmdata A pointer to pmdata
386 * @return 0 or -1
387 */
388static int wlan_pm_callback(struct pm_dev *pmdev, pm_request_t pmreq,
389 void *pmdata)
390{
391 wlan_private *priv = wlanpriv;
392 wlan_adapter *adapter = priv->adapter;
393 struct net_device *dev = priv->wlan_dev.netdev;
394
395 lbs_pr_debug(1, "WPRM_PM_CALLBACK: pmreq = %d.\n", pmreq);
396
397 switch (pmreq) {
398 case PM_SUSPEND:
399 lbs_pr_debug(1, "WPRM_PM_CALLBACK: enter PM_SUSPEND.\n");
400
401 /* in associated mode */
402 if (adapter->connect_status == libertas_connected) {
403 if ((adapter->psstate != PS_STATE_SLEEP)
404 ) {
405 lbs_pr_debug(1,
406 "wlan_pm_callback: can't enter sleep mode\n");
407 return -1;
408 } else {
409
410 /*
411 * Detach the network interface
412 * if the network is running
413 */
414 if (netif_running(dev)) {
415 netif_device_detach(dev);
416 lbs_pr_debug(1,
417 "netif_device_detach().\n");
418 }
419 libertas_sbi_suspend(priv);
420 }
421 break;
422 }
423
424 /* in non associated mode */
425
426 /*
427 * Detach the network interface
428 * if the network is running
429 */
430 if (netif_running(dev))
431 netif_device_detach(dev);
432
433 /*
434 * Storing and restoring of the regs be taken care
435 * at the driver rest will be done at wlan driver
436 * this makes driver independent of the card
437 */
438
439 libertas_sbi_suspend(priv);
440
441 break;
442
443 case PM_RESUME:
444 /* in associated mode */
445 if (adapter->connect_status == libertas_connected) {
446 {
447 /*
448 * Bring the inteface up first
449 * This case should not happen still ...
450 */
451 libertas_sbi_resume(priv);
452
453 /*
454 * Attach the network interface
455 * if the network is running
456 */
457 if (netif_running(dev)) {
458 netif_device_attach(dev);
459 lbs_pr_debug(1,
460 "after netif_device_attach().\n");
461 }
462 lbs_pr_debug(1,
463 "After netif attach, in associated mode.\n");
464 }
465 break;
466 }
467
468 /* in non associated mode */
469
470 /*
471 * Bring the inteface up first
472 * This case should not happen still ...
473 */
474
475 libertas_sbi_resume(priv);
476
477 if (netif_running(dev))
478 netif_device_attach(dev);
479
480 lbs_pr_debug(1, "after netif attach, in NON associated mode.\n");
481 break;
482 }
483
484 return 0;
485}
486#endif /* ENABLE_PM */
487
488static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 367static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
489{ 368{
490 int ret = 0; 369 int ret = 0;
@@ -914,7 +793,6 @@ wlan_private *wlan_add_card(void *card)
914 priv->mesh_open = 0; 793 priv->mesh_open = 0;
915 priv->infra_open = 0; 794 priv->infra_open = 0;
916 priv->mesh_dev = mesh_dev; 795 priv->mesh_dev = mesh_dev;
917 wlanpriv = priv;
918 796
919 SET_MODULE_OWNER(dev); 797 SET_MODULE_OWNER(dev);
920 SET_MODULE_OWNER(mesh_dev); 798 SET_MODULE_OWNER(mesh_dev);
@@ -929,8 +807,8 @@ wlan_private *wlan_add_card(void *card)
929 mesh_dev->hard_start_xmit = mesh_pre_start_xmit; 807 mesh_dev->hard_start_xmit = mesh_pre_start_xmit;
930 mesh_dev->stop = mesh_close; 808 mesh_dev->stop = mesh_close;
931 mesh_dev->do_ioctl = libertas_do_ioctl; 809 mesh_dev->do_ioctl = libertas_do_ioctl;
932 memcpy(mesh_dev->dev_addr, wlanpriv->wlan_dev.netdev->dev_addr, 810 memcpy(mesh_dev->dev_addr, priv->wlan_dev.netdev->dev_addr,
933 sizeof(wlanpriv->wlan_dev.netdev->dev_addr)); 811 sizeof(priv->wlan_dev.netdev->dev_addr));
934 812
935#define WLAN_WATCHDOG_TIMEOUT (5 * HZ) 813#define WLAN_WATCHDOG_TIMEOUT (5 * HZ)
936 814
@@ -1001,10 +879,6 @@ wlan_private *wlan_add_card(void *card)
1001 goto err_init_fw; 879 goto err_init_fw;
1002 libertas_devs[libertas_found] = dev; 880 libertas_devs[libertas_found] = dev;
1003 libertas_found++; 881 libertas_found++;
1004#ifdef ENABLE_PM
1005 if (!(wlan_pm_dev = pm_register(PM_UNKNOWN_DEV, 0, wlan_pm_callback)))
1006 lbs_pr_alert( "failed to register PM callback\n");
1007#endif
1008 if (device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp)) 882 if (device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp))
1009 goto err_create_file; 883 goto err_create_file;
1010 884
@@ -1024,7 +898,6 @@ err_registerdev:
1024err_kmalloc: 898err_kmalloc:
1025 free_netdev(dev); 899 free_netdev(dev);
1026 free_netdev(mesh_dev); 900 free_netdev(mesh_dev);
1027 wlanpriv = NULL;
1028 901
1029 LEAVE(); 902 LEAVE();
1030 return NULL; 903 return NULL;
@@ -1092,10 +965,6 @@ int wlan_remove_card(void *card)
1092 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 965 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
1093 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); 966 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
1094 967
1095#ifdef ENABLE_PM
1096 pm_unregister(wlan_pm_dev);
1097#endif
1098
1099 adapter->surpriseremoved = 1; 968 adapter->surpriseremoved = 1;
1100 969
1101 /* Stop the thread servicing the interrupts */ 970 /* Stop the thread servicing the interrupts */
@@ -1120,7 +989,6 @@ int wlan_remove_card(void *card)
1120 priv->mesh_dev = NULL ; 989 priv->mesh_dev = NULL ;
1121 free_netdev(mesh_dev); 990 free_netdev(mesh_dev);
1122 free_netdev(dev); 991 free_netdev(dev);
1123 wlanpriv = NULL;
1124 992
1125 LEAVE(); 993 LEAVE();
1126 return 0; 994 return 0;
diff --git a/drivers/net/wireless/libertas/sbi.h b/drivers/net/wireless/libertas/sbi.h
index 59d3a59ccef0..5dda74b6fb96 100644
--- a/drivers/net/wireless/libertas/sbi.h
+++ b/drivers/net/wireless/libertas/sbi.h
@@ -32,9 +32,4 @@ int libertas_sbi_read_event_cause(wlan_private *);
32int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb); 32int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb);
33wlan_private *libertas_sbi_get_priv(void *card); 33wlan_private *libertas_sbi_get_priv(void *card);
34 34
35#ifdef ENABLE_PM
36int libertas_sbi_suspend(wlan_private *);
37int libertas_sbi_resume(wlan_private *);
38#endif
39
40#endif /* _SBI_H */ 35#endif /* _SBI_H */