Ignore:
File:
1 edited

Legend:

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

    r80099c19 r6d8455d  
    142142static void ne2k_upload(ne2k_t *ne2k, void *buf, size_t addr, size_t size)
    143143{
     144        size_t esize_ru = (size + 1) & ~1;
    144145        size_t esize = size & ~1;
    145146       
    146         pio_write_8(ne2k->port + DP_RBCR0, esize & 0xff);
    147         pio_write_8(ne2k->port + DP_RBCR1, (esize >> 8) & 0xff);
     147        pio_write_8(ne2k->port + DP_RBCR0, esize_ru & 0xff);
     148        pio_write_8(ne2k->port + DP_RBCR1, (esize_ru >> 8) & 0xff);
    148149        pio_write_8(ne2k->port + DP_RSAR0, addr & 0xff);
    149150        pio_write_8(ne2k->port + DP_RSAR1, (addr >> 8) & 0xff);
     
    403404 *
    404405 * @param[in,out] ne2k   Network interface structure.
    405  * @param[in]     packet Frame to be sent.
    406  *
    407  */
    408 void ne2k_send(nic_t *nic_data, packet_t *packet)
     406 * @param[in]     data   Pointer to frame data
     407 * @param[in]     size   Frame size in bytes
     408 *
     409 */
     410void ne2k_send(nic_t *nic_data, void *data, size_t size)
    409411{
    410412        ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
     
    418420                fibril_condvar_wait(&ne2k->sq_cv, &ne2k->sq_mutex);
    419421        }
    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, buf, ne2k->sq.page * DP_PAGE, size);
     429        ne2k_upload(ne2k, data, 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);
    442439}
    443440
Note: See TracChangeset for help on using the changeset viewer.