Changeset 582a0b8 in mainline for uspace/drv/nic


Ignore:
Timestamp:
2017-05-08T19:20:39Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d2c8533
Parents:
73db198
Message:

Remove unistd.h

  • Rename usleep() and sleep() to thread_usleep() and thread_sleep() and move to thread.[hc].
  • Include stddef.h in order to provide NULL.
  • Move getpagesize() to libposix.
  • Sync uspace/dist/src/c/demos with originals.
Location:
uspace/drv/nic
Files:
8 edited

Legend:

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

    r73db198 r582a0b8  
    4343#include <nic.h>
    4444#include <macros.h>
     45#include <thread.h>
    4546#include "ath_usb.h"
    4647#include "wmi.h"
     
    817818       
    818819        /* Wait until firmware is ready - wait for 1 second to be sure. */
    819         sleep(1);
     820        thread_sleep(1);
    820821       
    821822        return rc;
  • uspace/drv/nic/ar9271/hw.c

    r73db198 r582a0b8  
    3535#include <macros.h>
    3636#include <usb/debug.h>
    37 #include <unistd.h>
    3837#include <errno.h>
    3938#include <nic.h>
  • uspace/drv/nic/e1k/e1k.c

    r73db198 r582a0b8  
    3838#include <adt/list.h>
    3939#include <align.h>
     40#include <thread.h>
    4041#include <byteorder.h>
    4142#include <irc.h>
     
    365366                ctrl &= ~(CTRL_SLU);
    366367                fibril_mutex_unlock(&e1000->ctrl_lock);
    367                 usleep(10);
     368                thread_usleep(10);
    368369                fibril_mutex_lock(&e1000->ctrl_lock);
    369370                ctrl |= CTRL_SLU;
     
    17171718       
    17181719        /* Wait for the reset */
    1719         usleep(20);
     1720        thread_usleep(20);
    17201721       
    17211722        /* check if RST_BIT cleared */
     
    18051806         * transfers to descriptors.
    18061807         */
    1807         usleep(100);
     1808        thread_usleep(100);
    18081809       
    18091810        return EOK;
     
    22232224        uint32_t eerd = E1000_REG_READ(e1000, E1000_EERD);
    22242225        while ((eerd & e1000->info.eerd_done) == 0) {
    2225                 usleep(1);
     2226                thread_usleep(1);
    22262227                eerd = E1000_REG_READ(e1000, E1000_EERD);
    22272228        }
  • uspace/drv/nic/ne2k/dp8390.c

    r73db198 r582a0b8  
    5959#include <stdio.h>
    6060#include <ddi.h>
     61#include <thread.h>
    6162#include "dp8390.h"
    6263
     
    171172        /* Reset the ethernet card */
    172173        uint8_t val = pio_read_8(ne2k->port + NE2K_RESET);
    173         usleep(2000);
     174        thread_usleep(2000);
    174175        pio_write_8(ne2k->port + NE2K_RESET, val);
    175         usleep(2000);
     176        thread_usleep(2000);
    176177       
    177178        /* Reset the DP8390 */
  • uspace/drv/nic/rtl8139/driver.c

    r73db198 r582a0b8  
    3030#include <errno.h>
    3131#include <align.h>
     32#include <thread.h>
    3233#include <byteorder.h>
    3334#include <libarch/barrier.h>
     
    471472        memory_barrier();
    472473        while(pio_read_8(io_base + CR) & CR_RST) {
    473                 usleep(1);
     474                thread_usleep(1);
    474475                read_barrier();
    475476        }
  • uspace/drv/nic/rtl8139/general.c

    r73db198 r582a0b8  
    3535
    3636#include <mem.h>
    37 #include <unistd.h>
    3837#include <errno.h>
    3938#include <stdint.h>
  • uspace/drv/nic/rtl8139/general.h

    r73db198 r582a0b8  
    3535#define RTL8139_GENERAL_H_
    3636
    37 #include <unistd.h>
     37#include <stddef.h>
     38#include <time.h>
    3839
    3940/** Number of microseconds in second */
  • uspace/drv/nic/rtl8169/driver.c

    r73db198 r582a0b8  
    3535
    3636#include <as.h>
     37#include <thread.h>
    3738#include <ddf/log.h>
    3839#include <ddf/interrupt.h>
     
    760761        memory_barrier();
    761762        while (pio_read_8(rtl8169->regs + CR) & CR_RST) {
    762                 usleep(1);
     763                thread_usleep(1);
    763764                read_barrier();
    764765        }
     
    11741175        do {
    11751176                phyar = pio_read_32(rtl8169->regs + PHYAR);
    1176                 usleep(20);
     1177                thread_usleep(20);
    11771178        } while ((phyar & PHYAR_RW_WRITE) == 0);
    11781179
     
    11921193        do {
    11931194                phyar = pio_read_32(rtl8169->regs + PHYAR);
    1194                 usleep(20);
     1195                thread_usleep(20);
    11951196        } while ((phyar & PHYAR_RW_WRITE) != 0);
    11961197
    1197         usleep(20);
     1198        thread_usleep(20);
    11981199}
    11991200
Note: See TracChangeset for help on using the changeset viewer.