cleaned up formatting

This commit is contained in:
Markus Fröschle
2014-01-01 21:53:39 +00:00
parent 40c89dd900
commit 225c53cf57

View File

@@ -1,101 +1,93 @@
/* /*
* File: fecbd.h * File: fecbd.h
* Purpose: * Purpose:
* *
* Purpose: Provide a simple buffer management driver * Purpose: Provide a simple buffer management driver
*/ */
#ifndef _FECBD_H_ #ifndef _FECBD_H_
#define _FECBD_H_ #define _FECBD_H_
#include "bas_types.h" #include "bas_types.h"
/********************************************************************/ /********************************************************************/
#define Rx 1 #define Rx 1
#define Tx 0 #define Tx 0
/* /*
* Buffer sizes in bytes * Buffer sizes in bytes
*/ */
#ifndef RX_BUF_SZ #ifndef RX_BUF_SZ
#define RX_BUF_SZ NBUF_SZ #define RX_BUF_SZ NBUF_SZ
#endif #endif
#ifndef TX_BUF_SZ #ifndef TX_BUF_SZ
#define TX_BUF_SZ NBUF_SZ #define TX_BUF_SZ NBUF_SZ
#endif #endif
/* /*
* Number of Rx and Tx Buffers and Buffer Descriptors * Number of Rx and Tx Buffers and Buffer Descriptors
*/ */
#ifndef NRXBD #ifndef NRXBD
#define NRXBD 20 #define NRXBD 20
#endif #endif
#ifndef NTXBD #ifndef NTXBD
#define NTXBD 20 #define NTXBD 20
#endif #endif
/* /*
* Buffer Descriptor Format * Buffer Descriptor Format
*/ */
typedef struct typedef struct
{ {
uint16_t status; /* control and status */ uint16_t status; /* control and status */
uint16_t length; /* transfer length */ uint16_t length; /* transfer length */
uint8_t *data; /* buffer address */ uint8_t *data; /* buffer address */
} FECBD; } FECBD;
/* /*
* Bit level definitions for status field of buffer descriptors * Bit level definitions for status field of buffer descriptors
*/ */
#define TX_BD_R 0x8000 #define TX_BD_R 0x8000
#define TX_BD_TO1 0x4000 #define TX_BD_TO1 0x4000
#define TX_BD_W 0x2000 #define TX_BD_W 0x2000
#define TX_BD_TO2 0x1000 #define TX_BD_TO2 0x1000
#define TX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */ #define TX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */
#define TX_BD_L 0x0800 #define TX_BD_L 0x0800
#define TX_BD_TC 0x0400 #define TX_BD_TC 0x0400
#define TX_BD_DEF 0x0200 /* MCF5272 Only */ #define TX_BD_DEF 0x0200 /* MCF5272 Only */
#define TX_BD_ABC 0x0200 #define TX_BD_ABC 0x0200
#define TX_BD_HB 0x0100 /* MCF5272 Only */ #define TX_BD_HB 0x0100 /* MCF5272 Only */
#define TX_BD_LC 0x0080 /* MCF5272 Only */ #define TX_BD_LC 0x0080 /* MCF5272 Only */
#define TX_BD_RL 0x0040 /* MCF5272 Only */ #define TX_BD_RL 0x0040 /* MCF5272 Only */
#define TX_BD_UN 0x0002 /* MCF5272 Only */ #define TX_BD_UN 0x0002 /* MCF5272 Only */
#define TX_BD_CSL 0x0001 /* MCF5272 Only */ #define TX_BD_CSL 0x0001 /* MCF5272 Only */
#define RX_BD_E 0x8000 #define RX_BD_E 0x8000
#define RX_BD_R01 0x4000 #define RX_BD_R01 0x4000
#define RX_BD_W 0x2000 #define RX_BD_W 0x2000
#define RX_BD_R02 0x1000 #define RX_BD_R02 0x1000
#define RX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */ #define RX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */
#define RX_BD_L 0x0800 #define RX_BD_L 0x0800
#define RX_BD_M 0x0100 #define RX_BD_M 0x0100
#define RX_BD_BC 0x0080 #define RX_BD_BC 0x0080
#define RX_BD_MC 0x0040 #define RX_BD_MC 0x0040
#define RX_BD_LG 0x0020 #define RX_BD_LG 0x0020
#define RX_BD_NO 0x0010 #define RX_BD_NO 0x0010
#define RX_BD_CR 0x0004 #define RX_BD_CR 0x0004
#define RX_BD_OV 0x0002 #define RX_BD_OV 0x0002
#define RX_BD_TR 0x0001 #define RX_BD_TR 0x0001
#define RX_BD_ERROR (RX_BD_NO | RX_BD_CR | RX_BD_OV | RX_BD_TR) #define RX_BD_ERROR (RX_BD_NO | RX_BD_CR | RX_BD_OV | RX_BD_TR)
/* /*
* Functions provided in fec_bd.c * Functions provided in fec_bd.c
*/ */
void extern void fecbd_init(uint8_t);
fecbd_init(uint8_t); extern uint32_t fecbd_get_start(uint8_t, uint8_t);
extern FECBD *fecbd_rx_alloc(uint8_t);
uint32_t fecbd_get_start(uint8_t, uint8_t); extern FECBD *fecbd_tx_alloc(uint8_t);
extern FECBD *fecbd_tx_free(uint8_t);
FECBD *
fecbd_rx_alloc(uint8_t); /*******************************************************************/
FECBD * #endif /* _FECBD_H_ */
fecbd_tx_alloc(uint8_t);
FECBD *
fecbd_tx_free(uint8_t);
/*******************************************************************/
#endif /* _FECBD_H_ */