Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4755 → Rev 4756

/branches/network/uspace/srv/net/netif/dp8390/ne2000.c
21,7 → 21,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes:
* 2009 Lukas Mejdrech ported to HelenOS
* 2009 ported to HelenOS, Lukas Mejdrech
*/
 
/** @addtogroup ne2k
29,7 → 29,7
*/
 
/** @file
* \todo
* NE1000 and NE2000 network interface initialization and probe functions implementation.
*/
 
#include <stdio.h>
60,26 → 60,66
 
#if ENABLE_NE2000
 
/** Number of bytes to transfer.
*/
#define N 100
 
//#define MILLIS_TO_TICKS(m) (((m)*HZ/1000)+1)
 
/** Sleeps for the defined millicesonds.
* @param[in] millis The number of milliseconds to sleep.
*/
#define milli_delay( millis ) usleep(( millis ) * 1000 )
 
/** Type definition of the testing function.
*/
_PROTOTYPE( typedef int (*testf_t), (dpeth_t *dep, int pos, u8_t *pat) );
 
/** First data pattern.
*/
u8_t pat0[]= { 0x00, 0x00, 0x00, 0x00 };
 
/** Second data pattern.
*/
u8_t pat1[]= { 0xFF, 0xFF, 0xFF, 0xFF };
 
/** Third data pattern.
*/
u8_t pat2[]= { 0xA5, 0x5A, 0x69, 0x96 };
 
/** Fourth data pattern.
*/
u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 };
 
_PROTOTYPE( static int test_8, (dpeth_t *dep, int pos, u8_t *pat) );
_PROTOTYPE( static int test_16, (dpeth_t *dep, int pos, u8_t *pat) );
_PROTOTYPE( static void ne_stop, (dpeth_t *dep) );
/** Tests 8 bit NE2000 network interface.
* @param[in,out] dep The network interface structure.
* @param[in] pos The starting position.
* @param[in] pat The data pattern to be written.
* @returns True on success.
* @returns FALSE otherwise.
*/
static int test_8(dpeth_t *dep, int pos, u8_t *pat);
 
/** Tests 16 bit NE2000 network interface.
* @param[in,out] dep The network interface structure.
* @param[in] pos The starting position.
* @param[in] pat The data pattern to be written.
* @returns True on success.
* @returns FALSE otherwise.
*/
static int test_16(dpeth_t *dep, int pos, u8_t *pat);
 
/** Stops the NE2000 network interface.
* @param[in,out] dep The network interface structure.
*/
static void ne_stop(dpeth_t *dep);
//_PROTOTYPE( static void milli_delay, (unsigned long millis) );
 
#define milli_delay( millis ) usleep(( millis ) * 1000 )
/** Initializes the NE2000 network interface.
* @param[in,out] dep The network interface structure.
*/
void ne_init(struct dpeth *dep);
 
_PROTOTYPE( void ne_init, (struct dpeth *dep) );
 
/*===========================================================================*
* ne_probe *
*===========================================================================*/