Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/src/nic_driver.c

    r49bd793b rc6ae4c2  
    4646#include <ipc/irc.h>
    4747#include <sysinfo.h>
    48 
     48#include <as.h>
    4949#include <devman.h>
    5050#include <ddf/interrupt.h>
     
    13291329}
    13301330
    1331 // FIXME: Later
    1332 #if 0
    1333 
    13341331/** Lock packet for DMA usage
    13351332 *
     
    13371334 * @return physical address of packet
    13381335 */
    1339 void *nic_dma_lock_packet(packet_t *packet)
    1340 {
    1341         void *phys_addr;
    1342         size_t locked;
    1343         int rc = dma_lock(packet, &phys_addr, 1, &locked);
    1344         if (rc != EOK)
    1345                 return NULL;
    1346        
    1347         assert(locked == 1);
    1348         return phys_addr;
     1336int nic_dma_lock_packet(packet_t *packet, size_t size, void **phys)
     1337{
     1338        return dmamem_map(packet, SIZE2PAGES(size), 0, 0, phys);
    13491339}
    13501340
     
    13531343 * @param packet
    13541344 */
    1355 void nic_dma_unlock_packet(packet_t *packet)
    1356 {
    1357         size_t unlocked;
    1358         int rc = dma_unlock(packet, 1, &unlocked);
    1359         if (rc != EOK)
    1360                 return;
    1361        
    1362         assert(unlocked == 1);
    1363 }
    1364 
    1365 #endif
     1345int nic_dma_unlock_packet(packet_t *packet, size_t size)
     1346{
     1347        return dmamem_unmap(packet, size, 0);
     1348}
    13661349
    13671350/** @}
Note: See TracChangeset for help on using the changeset viewer.