42 State of an EoE object. |
42 State of an EoE object. |
43 */ |
43 */ |
44 |
44 |
45 typedef enum |
45 typedef enum |
46 { |
46 { |
47 EC_EOE_IDLE, /**< Idle. The next step ist to check for data. */ |
47 EC_EOE_RX_START, /**< start receiving and check for data. */ |
48 EC_EOE_CHECKING, /**< Checking frame was sent. */ |
48 EC_EOE_RX_CHECK, /**< checking frame was sent. */ |
49 EC_EOE_FETCHING /**< There is new data. Fetching frame was sent. */ |
49 EC_EOE_RX_FETCH, /**< there is new data; fetching frame was sent. */ |
|
50 EC_EOE_TX_START, /**< start sending a queued frame. */ |
|
51 EC_EOE_TX_SENT, /**< queued frame was sent; start checking. */ |
|
52 EC_EOE_TX_CHECK, /**< check mailbox for acknowledgement. */ |
|
53 EC_EOE_TX_FETCH, /**< receive mailbox response */ |
50 } |
54 } |
51 ec_eoe_state_t; |
55 ec_eoe_state_t; |
52 |
56 |
53 /*****************************************************************************/ |
57 /*****************************************************************************/ |
54 |
58 |
60 |
64 |
61 typedef struct |
65 typedef struct |
62 { |
66 { |
63 struct list_head list; /**< list item */ |
67 struct list_head list; /**< list item */ |
64 ec_slave_t *slave; /**< pointer to the corresponding slave */ |
68 ec_slave_t *slave; /**< pointer to the corresponding slave */ |
65 ec_eoe_state_t rx_state; /**< state of the state machine */ |
69 ec_eoe_state_t state; /**< state of the state machine */ |
66 struct net_device *dev; /**< net_device for virtual ethernet device */ |
70 struct net_device *dev; /**< net_device for virtual ethernet device */ |
67 uint8_t opened; /**< net_device is opened */ |
71 uint8_t opened; /**< net_device is opened */ |
68 struct sk_buff *skb; /**< current rx socket buffer */ |
72 struct sk_buff *skb; /**< current rx socket buffer */ |
|
73 off_t skb_offset; /**< current write pointer in the socket buffer */ |
|
74 size_t skb_size; /**< size of the allocated socket buffer memory */ |
|
75 uint8_t expected_fragment; /**< expected fragment */ |
69 struct net_device_stats stats; /**< device statistics */ |
76 struct net_device_stats stats; /**< device statistics */ |
70 struct list_head tx_queue; /**< queue for frames to send */ |
77 struct list_head tx_queue; /**< queue for frames to send */ |
|
78 unsigned int tx_queue_active; /**< kernel netif queue started */ |
71 unsigned int queued_frames; /**< number of frames in the queue */ |
79 unsigned int queued_frames; /**< number of frames in the queue */ |
72 spinlock_t tx_queue_lock; /**< spinlock for the send queue */ |
80 spinlock_t tx_queue_lock; /**< spinlock for the send queue */ |
|
81 uint8_t tx_frame_number; /**< Number of the transmitted frame */ |
|
82 size_t last_tx_bytes; /**< number of bytes currently transmitted */ |
73 } |
83 } |
74 ec_eoe_t; |
84 ec_eoe_t; |
75 |
85 |
76 /*****************************************************************************/ |
86 /*****************************************************************************/ |
77 |
87 |