netdev
[Top] [All Lists]

[patch 13/26] net/airo: replace schedule_timeout() with msleep()/ssleep(

To: jgarzik@xxxxxxxxx
Subject: [patch 13/26] net/airo: replace schedule_timeout() with msleep()/ssleep()
From: domen@xxxxxxxxxxxx
Date: Sun, 06 Mar 2005 11:33:18 +0100
Cc: netdev@xxxxxxxxxxx, domen@xxxxxxxxxxxx, nacc@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx

Use msleep()/ssleep() instead of schedule_timeout() to guarantee the task 
delays as expected.

Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
Signed-off-by: Domen Puncer <domen@xxxxxxxxxxxx>
---


 kj-domen/drivers/net/wireless/airo.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff -puN drivers/net/wireless/airo.c~msleep_ssleep-drivers_net_wireless_airo 
drivers/net/wireless/airo.c
--- kj/drivers/net/wireless/airo.c~msleep_ssleep-drivers_net_wireless_airo      
2005-03-05 16:10:27.000000000 +0100
+++ kj-domen/drivers/net/wireless/airo.c        2005-03-05 16:10:27.000000000 
+0100
@@ -1698,9 +1698,8 @@ static int readBSSListRid(struct airo_in
                        issuecommand(ai, &cmd, &rsp);
                        up(&ai->sem);
                        /* Let the command take effect */
-                       set_current_state (TASK_INTERRUPTIBLE);
                        ai->task = current;
-                       schedule_timeout (3*HZ);
+                       ssleep(3);
                        ai->task = NULL;
                }
        rc = PC4500_readrid(ai, first ? RID_BSSLISTFIRST : RID_BSSLISTNEXT,
@@ -2685,11 +2684,9 @@ int reset_card( struct net_device *dev ,
                return -1;
        waitbusy (ai);
        OUT4500(ai,COMMAND,CMD_SOFTRESET);
-       set_current_state (TASK_UNINTERRUPTIBLE);
-       schedule_timeout (HZ/5);
+       msleep(200);
        waitbusy (ai);
-       set_current_state (TASK_UNINTERRUPTIBLE);
-       schedule_timeout (HZ/5);
+       msleep(200);
        if (lock)
                up(&ai->sem);
        return 0;
@@ -5516,12 +5513,12 @@ static int airo_pci_resume(struct pci_de
        } else {
                OUT4500(ai, EVACK, EV_AWAKEN);
                OUT4500(ai, EVACK, EV_AWAKEN);
-               schedule_timeout(HZ/10);
+               msleep(100);
        }
 
        set_bit (FLAG_COMMIT, &ai->flags);
        disable_MAC(ai, 0);
-        schedule_timeout (HZ/5);
+       msleep(200);
        if (ai->SSID) {
                writeSsidRid(ai, ai->SSID, 0);
                kfree(ai->SSID);
@@ -7470,8 +7467,7 @@ int cmdreset(struct airo_info *ai) {
 
        OUT4500(ai,COMMAND,CMD_SOFTRESET);
 
-       set_current_state (TASK_UNINTERRUPTIBLE);
-       schedule_timeout (HZ);          /* WAS 600 12/7/00 */
+       ssleep(1);                      /* WAS 600 12/7/00 */
 
        if(!waitbusy (ai)){
                printk(KERN_INFO "Waitbusy hang AFTER RESET\n");
@@ -7498,8 +7494,7 @@ int setflashmode (struct airo_info *ai) 
                OUT4500(ai, SWS3, FLASH_COMMAND);
                OUT4500(ai, COMMAND,0);
        }
-       set_current_state (TASK_UNINTERRUPTIBLE);
-       schedule_timeout (HZ/2); /* 500ms delay */
+       msleep(500);            /* 500ms delay */
 
        if(!waitbusy(ai)) {
                clear_bit (FLAG_FLASHING, &ai->flags);
@@ -7609,8 +7604,7 @@ int flashputbuf(struct airo_info *ai){
 int flashrestart(struct airo_info *ai,struct net_device *dev){
        int    i,status;
 
-       set_current_state (TASK_UNINTERRUPTIBLE);
-       schedule_timeout (HZ);          /* Added 12/7/00 */
+       ssleep(1);                      /* Added 12/7/00 */
        clear_bit (FLAG_FLASHING, &ai->flags);
        if (test_bit(FLAG_MPI, &ai->flags)) {
                status = mpi_init_descriptors(ai);
@@ -7625,8 +7619,7 @@ int flashrestart(struct airo_info *ai,st
                                ( ai, 2312, i >= MAX_FIDS / 2 );
                }
 
-       set_current_state (TASK_UNINTERRUPTIBLE);
-       schedule_timeout (HZ);          /* Added 12/7/00 */
+       ssleep(1);                      /* Added 12/7/00 */
        return status;
 }
 #endif /* CISCO_EXT */
_

<Prev in Thread] Current Thread [Next in Thread>
  • [patch 13/26] net/airo: replace schedule_timeout() with msleep()/ssleep(), domen <=