2014-08-19 05:24:51 +08:00
|
|
|
/****************************************************************************
|
|
|
|
* net/arp/arp_poll.c
|
|
|
|
*
|
2021-02-19 19:45:37 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2014-08-19 05:24:51 +08:00
|
|
|
*
|
2021-02-19 19:45:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2014-08-19 05:24:51 +08:00
|
|
|
*
|
2021-02-19 19:45:37 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2014-08-19 05:24:51 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <nuttx/net/netdev.h>
|
|
|
|
|
|
|
|
#include "devif/devif.h"
|
|
|
|
#include "arp/arp.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ARP_SEND
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2017-04-22 06:33:14 +08:00
|
|
|
* Name: arp_poll
|
2014-08-19 05:24:51 +08:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Poll all pending transfer for ARP requests to send.
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* This function is called from the MAC device driver indirectly through
|
2022-06-05 23:34:03 +08:00
|
|
|
* devif_poll() and may be called from the timer interrupt/watchdog
|
|
|
|
* handler level.
|
2014-08-19 05:24:51 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int arp_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
|
|
|
{
|
|
|
|
/* Setup for the ARP callback (most of these do not apply) */
|
|
|
|
|
|
|
|
dev->d_appdata = NULL;
|
|
|
|
dev->d_len = 0;
|
|
|
|
dev->d_sndlen = 0;
|
|
|
|
|
|
|
|
/* Perform the ARP callbacks */
|
|
|
|
|
2022-08-25 21:17:57 +08:00
|
|
|
devif_conn_event(dev, ARP_POLL, dev->d_conncb);
|
2014-08-19 05:24:51 +08:00
|
|
|
|
|
|
|
/* Call back into the driver */
|
|
|
|
|
|
|
|
return callback(dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_NET_ARP_SEND */
|