137#if (DRIVERIF_DEBUG & LWIP_DBG_OFF)
139 struct eth_hdr* ethhdr = NULL;
143 struct eth_hdr *ethhdr = NULL;
147 LWIP_ERROR(
"driverif_input : invalid arguments", ((netif != NULL) && (p != NULL)),
return);
149 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input : going to receive input packet. netif 0x%p, pbuf 0x%p, \
150 packet_length %"U16_F
"\n", (
void *)netif, (
void *)p, p->tot_len));
153 MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len);
154 if (p->len < SIZEOF_ETH_HDR) {
156 LINK_STATS_INC(link.drop);
157 LINK_STATS_INC(link.link_rx_drop);
162#if (DRIVERIF_DEBUG & LWIP_DBG_OFF)
163 ethhdr = (
struct eth_hdr *)p->payload;
164 ethhdr_type = ntohs(ethhdr->type);
165 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input : received packet of type %"U16_F
" netif->input=%p\n", ethhdr_type, netif->input));
170 ret = netif->input(p, netif);
173 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input: IP input error\n"));
175 LINK_STATS_INC(link.drop);
176 LINK_STATS_INC(link.link_rx_drop);
177 if (ret == ERR_MEM) {
178 LINK_STATS_INC(link.link_rx_overrun);
181 LINK_STATS_INC(link.recv);
185 ethhdr = (
struct eth_hdr *)p->payload;
186 ethhdr_type = ntohs(ethhdr->type);
188 switch (ethhdr_type) {
193#if ETHARP_SUPPORT_VLAN
196 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input : received packet of type %"U16_F
"\n", ethhdr_type));
198 if (netif->input != NULL) {
199 ret = netif->input(p, netif);
203 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input: IP input error\n"));
205 LINK_STATS_INC(link.drop);
206 LINK_STATS_INC(link.link_rx_drop);
207 if (ret == ERR_MEM) {
208 MIB2_STATS_NETIF_INC(netif, ifinoverruns);
209 LINK_STATS_INC(link.link_rx_overrun);
212 LINK_STATS_INC(link.recv);
217 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input : received packet is of unsupported type %"U16_F
"\n", ethhdr_type));
219 LINK_STATS_INC(link.drop);
220 LINK_STATS_INC(link.link_rx_drop);
225 LWIP_DEBUGF(DRIVERIF_DEBUG, (
"driverif_input : received packet is processed\n"));
ARG_NUM_3 ARG_NUM_1 ARG_NUM_2 ARG_NUM_2 ARG_NUM_3 ARG_NUM_1 ARG_NUM_4 ARG_NUM_2 ARG_NUM_2 ARG_NUM_5 ARG_NUM_2 void