Changes in uspace/drv/nic/ne2k/dp8390.c [80099c19:6d8455d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ne2k/dp8390.c
r80099c19 r6d8455d 142 142 static void ne2k_upload(ne2k_t *ne2k, void *buf, size_t addr, size_t size) 143 143 { 144 size_t esize_ru = (size + 1) & ~1; 144 145 size_t esize = size & ~1; 145 146 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); 148 149 pio_write_8(ne2k->port + DP_RSAR0, addr & 0xff); 149 150 pio_write_8(ne2k->port + DP_RSAR1, (addr >> 8) & 0xff); … … 403 404 * 404 405 * @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 */ 410 void ne2k_send(nic_t *nic_data, void *data, size_t size) 409 411 { 410 412 ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data); … … 418 420 fibril_condvar_wait(&ne2k->sq_cv, &ne2k->sq_mutex); 419 421 } 420 void *buf = packet_get_data(packet);421 size_t size = packet_get_data_length(packet);422 422 423 423 if ((size < ETH_MIN_PACK_SIZE) || (size > ETH_MAX_PACK_SIZE_TAGGED)) { … … 427 427 428 428 /* 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); 430 430 ne2k->sq.dirty = true; 431 431 ne2k->sq.size = size; … … 437 437 pio_write_8(ne2k->port + DP_CR, CR_TXP | CR_STA); 438 438 fibril_mutex_unlock(&ne2k->sq_mutex); 439 440 /* Relase packet */441 nic_release_packet(nic_data, packet);442 439 } 443 440
Note:
See TracChangeset
for help on using the changeset viewer.