Changes in uspace/drv/nic/ne2k/dp8390.c [6d8455d:80099c19] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ne2k/dp8390.c
r6d8455d r80099c19 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;145 144 size_t esize = size & ~1; 146 145 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); 149 148 pio_write_8(ne2k->port + DP_RSAR0, addr & 0xff); 150 149 pio_write_8(ne2k->port + DP_RSAR1, (addr >> 8) & 0xff); … … 404 403 * 405 404 * @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 */ 408 void ne2k_send(nic_t *nic_data, packet_t *packet) 411 409 { 412 410 ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data); … … 420 418 fibril_condvar_wait(&ne2k->sq_cv, &ne2k->sq_mutex); 421 419 } 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, data, ne2k->sq.page * DP_PAGE, size);429 ne2k_upload(ne2k, buf, 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); 439 442 } 440 443
Note:
See TracChangeset
for help on using the changeset viewer.