Changeset f300523 in mainline for uspace/drv/nic


Ignore:
Timestamp:
2017-11-29T18:43:10Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
39026d7c
Parents:
48b77ed
Message:

Eliminate uses of thread_usleep() in favor of async_usleep(). Obvious cases are in components that don't explicitly create threads.

Location:
uspace/drv/nic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/e1k/e1k.c

    r48b77ed rf300523  
    3333 */
    3434
     35#include <async.h>
    3536#include <assert.h>
    3637#include <stdio.h>
     
    3839#include <adt/list.h>
    3940#include <align.h>
    40 #include <thread.h>
    4141#include <byteorder.h>
    4242#include <as.h>
     
    372372                fibril_mutex_unlock(&e1000->ctrl_lock);
    373373               
    374                 thread_usleep(10);
     374                async_usleep(10);
    375375               
    376376                fibril_mutex_lock(&e1000->ctrl_lock);
     
    17241724       
    17251725        /* Wait for the reset */
    1726         thread_usleep(20);
     1726        async_usleep(20);
    17271727       
    17281728        /* check if RST_BIT cleared */
     
    18121812         * transfers to descriptors.
    18131813         */
    1814         thread_usleep(100);
     1814        async_usleep(100);
    18151815       
    18161816        return EOK;
     
    22382238        uint32_t eerd = E1000_REG_READ(e1000, E1000_EERD);
    22392239        while ((eerd & e1000->info.eerd_done) == 0) {
    2240                 thread_usleep(1);
     2240                async_usleep(1);
    22412241                eerd = E1000_REG_READ(e1000, E1000_EERD);
    22422242        }
  • uspace/drv/nic/ne2k/dp8390.c

    r48b77ed rf300523  
    5555
    5656#include <assert.h>
     57#include <async.h>
    5758#include <byteorder.h>
    5859#include <errno.h>
    5960#include <stdio.h>
    6061#include <ddi.h>
    61 #include <thread.h>
    6262#include "dp8390.h"
    6363
     
    172172        /* Reset the ethernet card */
    173173        uint8_t val = pio_read_8(ne2k->port + NE2K_RESET);
    174         thread_usleep(2000);
     174        async_usleep(2000);
    175175        pio_write_8(ne2k->port + NE2K_RESET, val);
    176         thread_usleep(2000);
     176        async_usleep(2000);
    177177       
    178178        /* Reset the DP8390 */
  • uspace/drv/nic/rtl8139/driver.c

    r48b77ed rf300523  
    2828
    2929#include <assert.h>
     30#include <async.h>
    3031#include <errno.h>
    3132#include <align.h>
    32 #include <thread.h>
    3333#include <byteorder.h>
    3434#include <libarch/barrier.h>
     
    435435        memory_barrier();
    436436        while(pio_read_8(io_base + CR) & CR_RST) {
    437                 thread_usleep(1);
     437                async_usleep(1);
    438438                read_barrier();
    439439        }
  • uspace/drv/nic/rtl8169/driver.c

    r48b77ed rf300523  
    2828
    2929#include <assert.h>
     30#include <async.h>
    3031#include <errno.h>
    3132#include <align.h>
     
    3435
    3536#include <as.h>
    36 #include <thread.h>
    3737#include <ddf/log.h>
    3838#include <ddf/interrupt.h>
     
    763763        memory_barrier();
    764764        while (pio_read_8(rtl8169->regs + CR) & CR_RST) {
    765                 thread_usleep(1);
     765                async_usleep(1);
    766766                read_barrier();
    767767        }
     
    11761176        do {
    11771177                phyar = pio_read_32(rtl8169->regs + PHYAR);
    1178                 thread_usleep(20);
     1178                async_usleep(20);
    11791179        } while ((phyar & PHYAR_RW_WRITE) == 0);
    11801180
     
    11941194        do {
    11951195                phyar = pio_read_32(rtl8169->regs + PHYAR);
    1196                 thread_usleep(20);
     1196                async_usleep(20);
    11971197        } while ((phyar & PHYAR_RW_WRITE) != 0);
    11981198
    1199         thread_usleep(20);
     1199        async_usleep(20);
    12001200}
    12011201
Note: See TracChangeset for help on using the changeset viewer.