Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ne2k/dp8390.c

    r6d8455d r80099c19  
    142142static void ne2k_upload(ne2k_t *ne2k, void *buf, size_t addr, size_t size)
    143143{
    144         size_t esize_ru = (size + 1) & ~1;
    145144        size_t esize = size & ~1;
    146145       
    147         pio_write_8(ne2k->port + DP_RBCR0, esize_ru & 0xff);
    148         pio_write_8(ne2k->port + DP_RBCR1, (esize_ru >> 8) & 0xff);
     146        pio_write_8(ne2k->port + DP_RBCR0, esize & 0xff);
     147        pio_write_8(ne2k->port + DP_RBCR1, (esize >> 8) & 0xff);
    149148        pio_write_8(ne2k->port + DP_RSAR0, addr & 0xff);
    150149        pio_write_8(ne2k->port + DP_RSAR1, (addr >> 8) & 0xff);
     
    404403 *
    405404 * @param[in,out] ne2k   Network interface structure.
    406  * @param[in]     data   Pointer to frame data
    407  * @param[in]     size   Frame size in bytes
    408  *
    409  */
    410 void ne2k_send(nic_t *nic_data, void *data, size_t size)
     405 * @param[in]     packet Frame to be sent.
     406 *
     407 */
     408void ne2k_send(nic_t *nic_data, packet_t *packet)
    411409{
    412410        ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
     
    420418                fibril_condvar_wait(&ne2k->sq_cv, &ne2k->sq_mutex);
    421419        }
     420        void *buf = packet_get_data(packet);
     421        size_t size = packet_get_data_length(packet);
    422422       
    423423        if ((size < ETH_MIN_PACK_SIZE) || (size > ETH_MAX_PACK_SIZE_TAGGED)) {
     
    427427
    428428        /* Upload the frame to the ethernet card */
    429         ne2k_upload(ne2k, data, ne2k->sq.page * DP_PAGE, size);
     429        ne2k_upload(ne2k, buf, ne2k->sq.page * DP_PAGE, size);
    430430        ne2k->sq.dirty = true;
    431431        ne2k->sq.size = size;
     
    437437        pio_write_8(ne2k->port + DP_CR, CR_TXP | CR_STA);
    438438        fibril_mutex_unlock(&ne2k->sq_mutex);
     439
     440        /* Relase packet */
     441        nic_release_packet(nic_data, packet);
    439442}
    440443
Note: See TracChangeset for help on using the changeset viewer.