Rev 3991 | Rev 4163 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3991 | Rev 4075 | ||
---|---|---|---|
Line 165... | Line 165... | ||
165 | size_t length; |
165 | size_t length; |
166 | packet_t next; |
166 | packet_t next; |
167 | 167 | ||
168 | ERROR_PROPAGATE( find_device( device_id, & device )); |
168 | ERROR_PROPAGATE( find_device( device_id, & device )); |
169 | if( device->state != NETIF_ACTIVE ) return EPERM; |
169 | if( device->state != NETIF_ACTIVE ) return EPERM; |
- | 170 | next = packet; |
|
170 | do{ |
171 | do{ |
171 | ++ device->stats.tx_packets; |
172 | ++ device->stats.tx_packets; |
172 | ++ device->stats.rx_packets; |
173 | ++ device->stats.rx_packets; |
173 | length = packet_get_data_length( packet ); |
174 | length = packet_get_data_length( next ); |
174 | device->stats.tx_bytes += length; |
175 | device->stats.tx_bytes += length; |
175 | device->stats.rx_bytes += length; |
176 | device->stats.rx_bytes += length; |
176 | next = pq_detach( packet ); |
177 | next = pq_next( next ); |
- | 178 | }while( next ); |
|
177 | nil_message( device, NET_NIL_RECEIVED, packet_get_id( packet ), PACKET_SELF ); |
179 | nil_message( device, NET_NIL_RECEIVED, packet_get_id( packet ), PACKET_SELF ); |
178 | packet = next; |
- | |
179 | }while( packet ); |
- | |
180 | return EOK; |
180 | return EOK; |
181 | } |
181 | } |
182 | 182 | ||
183 | int start_message( device_id_t device_id ){ |
183 | int start_message( device_id_t device_id ){ |
184 | return change_state_message( device_id, NETIF_ACTIVE ); |
184 | return change_state_message( device_id, NETIF_ACTIVE ); |