]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] libertas: remove deprecated pm_register and associated code
authorMarcelo Tosatti <mtosatti@redhat.com>
Fri, 25 May 2007 04:04:11 +0000 (00:04 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jun 2007 18:28:36 +0000 (14:28 -0400)
Subject says it all.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/if_usb.c
drivers/net/wireless/libertas/main.c
drivers/net/wireless/libertas/sbi.h

index ae6f72a6cdf396d5946e5ff1de1863c18a6d0380..6bc78bb8d1a29ebaf1cc0bf50bc5c86f77fc116d 100644 (file)
@@ -852,18 +852,6 @@ wlan_private *libertas_sbi_get_priv(void *card)
        return cardp->priv;
 }
 
-#ifdef ENABLE_PM
-int libertas_sbi_suspend(wlan_private * priv)
-{
-       return 0;
-}
-
-int libertas_sbi_resume(wlan_private * priv)
-{
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_PM
 static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
 {
index 76f81c331b9a3b953fd5c1fe8de8d7f43c282b97..c407f23401333c38cd12553aeb6e21885d289aac 100644 (file)
@@ -28,10 +28,6 @@ const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION
 #endif
     "";
 
-#ifdef ENABLE_PM
-static struct pm_dev *wlan_pm_dev = NULL;
-#endif
-
 #define WLAN_TX_PWR_DEFAULT            20      /*100mW */
 #define WLAN_TX_PWR_US_DEFAULT         20      /*100mW */
 #define WLAN_TX_PWR_JP_DEFAULT         16      /*50mW */
@@ -172,12 +168,6 @@ u8 libertas_adhoc_rates_g[G_SUPPORTED_RATES] =
  */
 u8 libertas_adhoc_rates_b[4] = { 0x82, 0x84, 0x8b, 0x96 };
 
-/**
- * the global variable of a pointer to wlan_private
- * structure variable
- */
-static wlan_private *wlanpriv = NULL;
-
 #define MAX_DEVS 5
 static struct net_device *libertas_devs[MAX_DEVS];
 static int libertas_found = 0;
@@ -374,117 +364,6 @@ static int wlan_close(struct net_device *dev) {
 }
 
 
-#ifdef ENABLE_PM
-
-/**
- *  @brief This function is a callback function. it is called by
- *  kernel to enter or exit power saving mode.
- *
- *  @param pmdev   A pointer to pm_dev
- *  @param pmreq   pm_request_t
- *  @param pmdata  A pointer to pmdata
- *  @return       0 or -1
- */
-static int wlan_pm_callback(struct pm_dev *pmdev, pm_request_t pmreq,
-                           void *pmdata)
-{
-       wlan_private *priv = wlanpriv;
-       wlan_adapter *adapter = priv->adapter;
-       struct net_device *dev = priv->wlan_dev.netdev;
-
-       lbs_pr_debug(1, "WPRM_PM_CALLBACK: pmreq = %d.\n", pmreq);
-
-       switch (pmreq) {
-       case PM_SUSPEND:
-               lbs_pr_debug(1, "WPRM_PM_CALLBACK: enter PM_SUSPEND.\n");
-
-               /* in associated mode */
-               if (adapter->connect_status == libertas_connected) {
-                       if ((adapter->psstate != PS_STATE_SLEEP)
-                           ) {
-                               lbs_pr_debug(1,
-                                      "wlan_pm_callback: can't enter sleep mode\n");
-                               return -1;
-                       } else {
-
-                               /*
-                                * Detach the network interface
-                                * if the network is running
-                                */
-                               if (netif_running(dev)) {
-                                       netif_device_detach(dev);
-                                       lbs_pr_debug(1,
-                                              "netif_device_detach().\n");
-                               }
-                               libertas_sbi_suspend(priv);
-                       }
-                       break;
-               }
-
-               /* in non associated mode */
-
-               /*
-                * Detach the network interface
-                * if the network is running
-                */
-               if (netif_running(dev))
-                       netif_device_detach(dev);
-
-               /*
-                * Storing and restoring of the regs be taken care
-                * at the driver rest will be done at wlan driver
-                * this makes driver independent of the card
-                */
-
-               libertas_sbi_suspend(priv);
-
-               break;
-
-       case PM_RESUME:
-               /* in associated mode */
-               if (adapter->connect_status == libertas_connected) {
-                       {
-                               /*
-                                * Bring the inteface up first
-                                * This case should not happen still ...
-                                */
-                               libertas_sbi_resume(priv);
-
-                               /*
-                                * Attach the network interface
-                                * if the network is running
-                                */
-                               if (netif_running(dev)) {
-                                       netif_device_attach(dev);
-                                       lbs_pr_debug(1,
-                                              "after netif_device_attach().\n");
-                               }
-                               lbs_pr_debug(1,
-                                      "After netif attach, in associated mode.\n");
-                       }
-                       break;
-               }
-
-               /* in non associated mode */
-
-               /*
-                * Bring the inteface up first
-                * This case should not happen still ...
-                */
-
-               libertas_sbi_resume(priv);
-
-               if (netif_running(dev))
-                       netif_device_attach(dev);
-
-               lbs_pr_debug(1, "after netif attach, in NON associated mode.\n");
-               break;
-       }
-
-       return 0;
-}
-#endif                         /* ENABLE_PM */
-
 static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        int ret = 0;
@@ -914,7 +793,6 @@ wlan_private *wlan_add_card(void *card)
        priv->mesh_open = 0;
        priv->infra_open = 0;
        priv->mesh_dev = mesh_dev;
-       wlanpriv = priv;
 
        SET_MODULE_OWNER(dev);
        SET_MODULE_OWNER(mesh_dev);
@@ -929,8 +807,8 @@ wlan_private *wlan_add_card(void *card)
        mesh_dev->hard_start_xmit = mesh_pre_start_xmit;
        mesh_dev->stop = mesh_close;
        mesh_dev->do_ioctl = libertas_do_ioctl;
-       memcpy(mesh_dev->dev_addr, wlanpriv->wlan_dev.netdev->dev_addr,
-                       sizeof(wlanpriv->wlan_dev.netdev->dev_addr));
+       memcpy(mesh_dev->dev_addr, priv->wlan_dev.netdev->dev_addr,
+                       sizeof(priv->wlan_dev.netdev->dev_addr));
 
 #define        WLAN_WATCHDOG_TIMEOUT   (5 * HZ)
 
@@ -1001,10 +879,6 @@ wlan_private *wlan_add_card(void *card)
                goto err_init_fw;
        libertas_devs[libertas_found] = dev;
        libertas_found++;
-#ifdef ENABLE_PM
-       if (!(wlan_pm_dev = pm_register(PM_UNKNOWN_DEV, 0, wlan_pm_callback)))
-               lbs_pr_alert( "failed to register PM callback\n");
-#endif
        if (device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp))
                goto err_create_file;
 
@@ -1024,7 +898,6 @@ err_registerdev:
 err_kmalloc:
        free_netdev(dev);
        free_netdev(mesh_dev);
-       wlanpriv = NULL;
 
        LEAVE();
        return NULL;
@@ -1092,10 +965,6 @@ int wlan_remove_card(void *card)
        wrqu.ap_addr.sa_family = ARPHRD_ETHER;
        wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
 
-#ifdef ENABLE_PM
-       pm_unregister(wlan_pm_dev);
-#endif
-
        adapter->surpriseremoved = 1;
 
        /* Stop the thread servicing the interrupts */
@@ -1120,7 +989,6 @@ int wlan_remove_card(void *card)
        priv->mesh_dev = NULL ;
        free_netdev(mesh_dev);
        free_netdev(dev);
-       wlanpriv = NULL;
 
        LEAVE();
        return 0;
index 59d3a59ccef0be89c4e957c35c69c0d30c075ef8..5dda74b6fb969748f55010398f2e5e3bcb76955c 100644 (file)
@@ -32,9 +32,4 @@ int libertas_sbi_read_event_cause(wlan_private *);
 int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb);
 wlan_private *libertas_sbi_get_priv(void *card);
 
-#ifdef ENABLE_PM
-int libertas_sbi_suspend(wlan_private *);
-int libertas_sbi_resume(wlan_private *);
-#endif
-
 #endif                         /* _SBI_H */