rem: dprintf( "rtl8139_nielx write: transmitdescription = %lu\n" , transmitdescription );
add: TRACE( "rtl8139_nielx write: transmitdescription = %lu\n" , transmitdescription );
context: write_hook (void* cookie, off_t position, const void* buffer, size_t* num_bytes){	rtl8139_properties_t *data =/* (rtl8139_properties_t *)*/cookie;	int buflen = *num_bytes;	int transmitid = 0;	uint32 transmitdescription = 0;	dprintf( "rtl8139_nielx write_hook()\n" );		acquire_sem_etc( data->lock , 1 , B_CAN_INTERRUPT, 0);		if ( data->writes == 4 )	{		dprintf( "rtl8139_nielx write_hook(): already doing four writes\n" );		release_sem_etc( data->lock , 1 , B_DO_NOT_RESCHEDULE );		return B_INTERRUPTED;	}	if ( buflen > 1792 ) //Maximum of 1792 bytes	{		dprintf( "rtl8139_nielx write_hook(): packet is too long\n" );		release_sem_etc( data->lock , 1 , B_DO_NOT_RESCHEDULE );		return B_IO_ERROR;	}			// We need to determine a free transmit descriptor	if ( data->transmitstatus[ data->nexttransmitstatus ] == 1 )	{		//No free descriptor]		release_sem_etc( data->lock , 1 , B_DO_NOT_RESCHEDULE );		return B_IO_ERROR;	}		//Update our current transmit id	transmitid = data->nexttransmitstatus;	if ( data->nexttransmitstatus == 3 )		data->nexttransmitstatus = 0;	else		data->nexttransmitstatus++;		dprintf( "rtl8139_nielx write_hook(): TransmitID: %u Packagelen: %u Register: %lx\n" , transmitid , buflen , TSD0 + (sizeof(uint32) * transmitid ) );		if ( transmitid == -1 )	{		dprintf( "rtl8139_nielx_write_hook(): no free buffer ?!?\n" );		return B_IO_ERROR;	}		data->writes++;	// Set the buffer as used	data->transmitstatus[transmitid] = 1;		release_sem_etc( data->lock , 1 , B_DO_NOT_RESCHEDULE );		//Copy the packet into the buffer	memcpy( data->transmitbufferlog[transmitid] , buffer , buflen );		if ( buflen < 60 )		buflen = 60;		//Clear OWN and start transfer Create transmit description with early Tx FIFO, size	transmitdescription = ( buflen | 0x80000 | transmitdescription ) ^OWN; //0x80000 = early tx treshold	dprintf( "rtl8139_nielx write: transmitdescription = %lu\n" , transmitdescription );	WRITE_32( TSD0 + (sizeof(uint32) * transmitid ) , transmitdescription );	dprintf( "rtl8139_nielx write: TSAD: %u\n" , READ_16( TSAD ) );	//Done	return B_OK;}