Changeset bf9cb2f in mainline for uspace/drv/nic/e1k/e1k.c


Ignore:
Timestamp:
2014-05-19T01:01:27Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10ef47ba
Parents:
527f1ca
Message:

complete the desired API semantics of physmem_map() and dmamem_map_anonymous() to be compatible with as_area_create()
(the user is allowed to request a specific virtual memory base address, the kernel uses an available base address if AS_AREA_ANY is used)

File:
1 edited

Legend:

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

    r527f1ca rbf9cb2f  
    13751375        fibril_mutex_lock(&e1000->rx_lock);
    13761376       
     1377        e1000->rx_ring_virt = AS_AREA_ANY;
    13771378        int rc = dmamem_map_anonymous(
    13781379            E1000_RX_FRAME_COUNT * sizeof(e1000_rx_descriptor_t),
     
    13961397        }
    13971398       
    1398         size_t i;
    1399         uintptr_t frame_phys;
    1400         void *frame_virt;
    1401        
    1402         for (i = 0; i < E1000_RX_FRAME_COUNT; i++) {
     1399        for (size_t i = 0; i < E1000_RX_FRAME_COUNT; i++) {
     1400                uintptr_t frame_phys;
     1401                void *frame_virt = AS_AREA_ANY;
     1402               
    14031403                rc = dmamem_map_anonymous(E1000_MAX_SEND_FRAME_SIZE,
    14041404                    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0,
     
    14121412       
    14131413        /* Write descriptor */
    1414         for (i = 0; i < E1000_RX_FRAME_COUNT; i++)
     1414        for (size_t i = 0; i < E1000_RX_FRAME_COUNT; i++)
    14151415                e1000_fill_new_rx_descriptor(nic, i);
    14161416       
     
    14211421       
    14221422error:
    1423         for (i = 0; i < E1000_RX_FRAME_COUNT; i++) {
     1423        for (size_t i = 0; i < E1000_RX_FRAME_COUNT; i++) {
    14241424                if (e1000->rx_frame_virt[i] != NULL) {
    14251425                        dmamem_unmap_anonymous(e1000->rx_frame_virt[i]);
     
    15711571       
    15721572        e1000->tx_ring_phys = 0;
    1573         e1000->tx_ring_virt = NULL;
     1573        e1000->tx_ring_virt = AS_AREA_ANY;
    15741574       
    15751575        e1000->tx_frame_phys = NULL;
     
    15971597       
    15981598        for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
     1599                e1000->tx_frame_virt[i] = AS_AREA_ANY;
    15991600                rc = dmamem_map_anonymous(E1000_MAX_SEND_FRAME_SIZE,
    16001601                    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE,
Note: See TracChangeset for help on using the changeset viewer.