rem: write16(device->addr + ChipCmd, CmdTxDemand | device->cmd);
add: entry++; entry %= TX_BUFFERS; device->cur_tx = entry;
context: status_t hook_write(void *_data, off_t pos, const void *buf, size_t *len){	viarhine_private *device = (viarhine_private*)_data;	ulong             buflen;	status_t          status;	unsigned int      entry;	unsigned int      i, j;	void             *addr;	buflen = *len;	atomic_add(&device->inrw, 1);	do	{		if (device->interrupted)		{			atomic_add(&device->inrw, -1);			return B_INTERRUPTED;		}		status = output_wait(device, ETHER_TRANSMIT_TIMEOUT);		if (status < B_NO_ERROR)		{			atomic_add(&device->inrw, -1);			return status;		}	} while (device->tx_desc[device->cur_tx].tx_status & DescOwn);	entry = device->cur_tx;	device->cur_tx++;	device->cur_tx %= TX_BUFFERS;	device->tx_desc[entry].tx_status = DescOwn;	addr = &device->tx_buf[entry * BUFFER_SIZE];	memcpy(addr, buf, buflen);	if (buflen < 60)	{		buflen = 60;	}	if (buflen & 3)	{		buflen &= (~3);		buflen += 4;	}		device->tx_desc[entry].desc_length = 0x00E08000 | buflen;	write16(device->addr + ChipCmd, CmdTxDemand | device->cmd);#ifdef __VIARHINE_DEBUG__	debug_printf("hook_write: sent (%u)(%u)\n", buflen, device->cur_tx);#endif	atomic_add(&device->inrw, -1);	*len = buflen;	return B_OK;}