checkpatch: converting from __FUNCTION__ to __func__
Change-Id: I2f28a4dd2b1b372905638cbccdf987396999d7ec Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com> Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
da67b29569
commit
d8a30896f4
12 changed files with 86 additions and 86 deletions
|
@ -44,7 +44,7 @@
|
|||
do { \
|
||||
if (buf->in_use) { \
|
||||
NET_ERR("**ERROR** buf %p in use (%s:%s():%d)\n", \
|
||||
buf, __FILE__, __FUNCTION__, __LINE__); \
|
||||
buf, __FILE__, __func__, __LINE__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
do { \
|
||||
if (!buf->in_use) { \
|
||||
NET_ERR("**ERROR** buf %p not in use (%s:%s():%d)\n",\
|
||||
buf, __FILE__, __FUNCTION__, __LINE__); \
|
||||
buf, __FILE__, __func__, __LINE__); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
|
@ -199,8 +199,8 @@ struct net_buf {
|
|||
*/
|
||||
/* Get buffer from the available buffers pool */
|
||||
#ifdef DEBUG_NET_BUFS
|
||||
#define net_buf_get_rx(context) net_buf_get_rx_debug(context, __FUNCTION__, __LINE__)
|
||||
#define net_buf_get_tx(context) net_buf_get_tx_debug(context, __FUNCTION__, __LINE__)
|
||||
#define net_buf_get_rx(context) net_buf_get_rx_debug(context, __func__, __LINE__)
|
||||
#define net_buf_get_tx(context) net_buf_get_tx_debug(context, __func__, __LINE__)
|
||||
struct net_buf *net_buf_get_rx_debug(struct net_context *context, const char *caller, int line);
|
||||
struct net_buf *net_buf_get_tx_debug(struct net_context *context, const char *caller, int line);
|
||||
#else
|
||||
|
@ -221,8 +221,8 @@ struct net_buf *net_buf_get_tx(struct net_context *context);
|
|||
*/
|
||||
/* Same as net_buf_get, but also reserve headroom for potential headers */
|
||||
#ifdef DEBUG_NET_BUFS
|
||||
#define net_buf_get_reserve_rx(res) net_buf_get_reserve_rx_debug(res, __FUNCTION__, __LINE__)
|
||||
#define net_buf_get_reserve_tx(res) net_buf_get_reserve_tx_debug(res, __FUNCTION__, __LINE__)
|
||||
#define net_buf_get_reserve_rx(res) net_buf_get_reserve_rx_debug(res, __func__, __LINE__)
|
||||
#define net_buf_get_reserve_tx(res) net_buf_get_reserve_tx_debug(res, __func__, __LINE__)
|
||||
struct net_buf *net_buf_get_reserve_rx_debug(uint16_t reserve_head, const char *caller, int line);
|
||||
struct net_buf *net_buf_get_reserve_tx_debug(uint16_t reserve_head, const char *caller, int line);
|
||||
#else
|
||||
|
@ -242,7 +242,7 @@ struct net_buf *net_buf_get_reserve_tx(uint16_t reserve_head);
|
|||
*/
|
||||
/* Place buffer back into the available buffers pool */
|
||||
#ifdef DEBUG_NET_BUFS
|
||||
#define net_buf_put(buf) net_buf_put_debug(buf, __FUNCTION__, __LINE__)
|
||||
#define net_buf_put(buf) net_buf_put_debug(buf, __func__, __LINE__)
|
||||
void net_buf_put_debug(struct net_buf *buf, const char *caller, int line);
|
||||
#else
|
||||
void net_buf_put(struct net_buf *buf);
|
||||
|
@ -344,7 +344,7 @@ struct net_mbuf {
|
|||
* @return Network buffer if successful, NULL otherwise.
|
||||
*/
|
||||
#ifdef DEBUG_NET_BUFS
|
||||
#define net_mbuf_get_reserve(res) net_mbuf_get_reserve_debug(res, __FUNCTION__, __LINE__)
|
||||
#define net_mbuf_get_reserve(res) net_mbuf_get_reserve_debug(res, __func__, __LINE__)
|
||||
struct net_mbuf *net_mbuf_get_reserve_debug(uint16_t reserve_head, const char *caller, int line);
|
||||
#else
|
||||
struct net_mbuf *net_mbuf_get_reserve(uint16_t reserve_head);
|
||||
|
@ -360,7 +360,7 @@ struct net_mbuf *net_mbuf_get_reserve(uint16_t reserve_head);
|
|||
* @param buf Network buffer to release.
|
||||
*/
|
||||
#ifdef DEBUG_NET_BUFS
|
||||
#define net_mbuf_put(buf) net_mbuf_put_debug(buf, __FUNCTION__, __LINE__)
|
||||
#define net_mbuf_put(buf) net_mbuf_put_debug(buf, __func__, __LINE__)
|
||||
void net_mbuf_put_debug(struct net_mbuf *buf, const char *caller, int line);
|
||||
#else
|
||||
void net_mbuf_put(struct net_mbuf *buf);
|
||||
|
|
|
@ -66,13 +66,13 @@ void taskA(void)
|
|||
task_sem_give(TASKASEM);
|
||||
|
||||
/* invoke routine that allows task to ping-pong hello messages with taskB */
|
||||
helloLoop(__FUNCTION__, TASKASEM, TASKBSEM);
|
||||
helloLoop(__func__, TASKASEM, TASKBSEM);
|
||||
}
|
||||
|
||||
void taskB(void)
|
||||
{
|
||||
/* invoke routine that allows task to ping-pong hello messages with taskA */
|
||||
helloLoop(__FUNCTION__, TASKBSEM, TASKASEM);
|
||||
helloLoop(__func__, TASKBSEM, TASKASEM);
|
||||
}
|
||||
|
||||
#else /* CONFIG_NANOKERNEL */
|
||||
|
@ -111,7 +111,7 @@ void fiberEntry(void)
|
|||
nano_fiber_sem_take_wait(&nanoSemFiber);
|
||||
|
||||
/* say "hello" */
|
||||
PRINT("%s: Hello World!\n", __FUNCTION__);
|
||||
PRINT("%s: Hello World!\n", __func__);
|
||||
|
||||
/* wait a while, then let task have a turn */
|
||||
nano_fiber_timer_start(&timer, SLEEPTICKS);
|
||||
|
@ -133,7 +133,7 @@ void main(void)
|
|||
|
||||
while (1) {
|
||||
/* say "hello" */
|
||||
PRINT("%s: Hello World!\n", __FUNCTION__);
|
||||
PRINT("%s: Hello World!\n", __func__);
|
||||
|
||||
/* wait a while, then let fiber have a turn */
|
||||
nano_task_timer_start(&timer, SLEEPTICKS);
|
||||
|
|
|
@ -44,7 +44,7 @@ struct nano_sem sem[3];
|
|||
|
||||
void isr0(void)
|
||||
{
|
||||
printk("%s ran!\n", __FUNCTION__);
|
||||
printk("%s ran!\n", __func__);
|
||||
nano_isr_sem_give(&sem[0]);
|
||||
_IntExit();
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ void isr0(void)
|
|||
|
||||
void isr1(void)
|
||||
{
|
||||
printk("%s ran!\n", __FUNCTION__);
|
||||
printk("%s ran!\n", __func__);
|
||||
nano_isr_sem_give(&sem[1]);
|
||||
_IntExit();
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void isr1(void)
|
|||
|
||||
void isr2(void)
|
||||
{
|
||||
printk("%s ran!\n", __FUNCTION__);
|
||||
printk("%s ran!\n", __func__);
|
||||
nano_isr_sem_give(&sem[2]);
|
||||
_IntExit();
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ static struct in_addr in4addr_my = MY_IPADDR;
|
|||
|
||||
static inline void init_server()
|
||||
{
|
||||
PRINT("%s: run coap observe client\n", __FUNCTION__);
|
||||
PRINT("%s: run coap observe client\n", __func__);
|
||||
|
||||
net_set_mac(my_mac, sizeof(my_mac));
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ static struct in_addr in4addr_my = MY_IPADDR;
|
|||
|
||||
static inline void init_server()
|
||||
{
|
||||
PRINT("%s: run coap server\n", __FUNCTION__);
|
||||
PRINT("%s: run coap server\n", __func__);
|
||||
|
||||
net_set_mac(my_mac, sizeof(my_mac));
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ static struct in_addr in4addr_my = MY_IPADDR;
|
|||
|
||||
static inline void init_server()
|
||||
{
|
||||
PRINT("%s: run echo server\n", __FUNCTION__);
|
||||
PRINT("%s: run echo server\n", __func__);
|
||||
|
||||
net_set_mac(my_mac, sizeof(my_mac));
|
||||
|
||||
|
@ -238,7 +238,7 @@ static inline struct net_context *get_context(void)
|
|||
&peer_addr, PEER_PORT,
|
||||
&my_addr, MY_PORT);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -252,11 +252,11 @@ static int read_from_peer(struct dtls_context_t *ctx,
|
|||
struct data *user_data = (struct data *)dtls_get_app_data(ctx);
|
||||
int pos;
|
||||
|
||||
PRINT("%s: read from peer %p len %d\n", __FUNCTION__, data, len);
|
||||
PRINT("%s: read from peer %p len %d\n", __func__, data, len);
|
||||
|
||||
if (user_data->expecting != len) {
|
||||
PRINT("%s: received %d bytes, expected %d\n",
|
||||
__FUNCTION__, len, user_data->expecting);
|
||||
__func__, len, user_data->expecting);
|
||||
user_data->fail = true;
|
||||
return 0;
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ static int read_from_peer(struct dtls_context_t *ctx,
|
|||
pos = user_data->ipsum_len - user_data->expecting;
|
||||
|
||||
if (memcmp(lorem_ipsum + pos, data, user_data->expecting)) {
|
||||
PRINT("%s: received data mismatch.\n", __FUNCTION__);
|
||||
PRINT("%s: received data mismatch.\n", __func__);
|
||||
user_data->fail = true;
|
||||
}
|
||||
|
||||
|
@ -295,11 +295,11 @@ static int send_to_peer(struct dtls_context_t *ctx,
|
|||
max_data_len = sizeof(buf->buf) - sizeof(struct uip_udp_hdr) -
|
||||
sizeof(struct uip_ip_hdr);
|
||||
|
||||
PRINT("%s: send to peer data %p len %d\n", __FUNCTION__, data, len);
|
||||
PRINT("%s: send to peer data %p len %d\n", __func__, data, len);
|
||||
|
||||
if (len > max_data_len) {
|
||||
PRINT("%s: too much (%d bytes) data to send (max %d bytes)\n",
|
||||
__FUNCTION__, len, max_data_len);
|
||||
__func__, len, max_data_len);
|
||||
net_buf_put(buf);
|
||||
len = -EINVAL;
|
||||
goto out;
|
||||
|
@ -458,13 +458,13 @@ void startup(void)
|
|||
|
||||
user_data.ctx = get_context();
|
||||
if (!user_data.ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
init_dtls(&user_data, &dtls);
|
||||
if (!dtls) {
|
||||
PRINT("%s: Cannot get DTLS context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get DTLS context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -481,9 +481,9 @@ void startup(void)
|
|||
|
||||
while (!user_data.fail) {
|
||||
if (user_data.connected) {
|
||||
send_message(__FUNCTION__, dtls, &session);
|
||||
send_message(__func__, dtls, &session);
|
||||
}
|
||||
if (!wait_reply(__FUNCTION__, dtls, &session)) {
|
||||
if (!wait_reply(__func__, dtls, &session)) {
|
||||
if (user_data.connected) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ static struct in_addr in4addr_my = MY_IPADDR;
|
|||
|
||||
static inline void init_server()
|
||||
{
|
||||
PRINT("%s: run dtls server\n", __FUNCTION__);
|
||||
PRINT("%s: run dtls server\n", __func__);
|
||||
|
||||
net_set_mac(my_mac, sizeof(my_mac));
|
||||
|
||||
|
@ -179,7 +179,7 @@ static inline struct net_context *get_context(void)
|
|||
&any_addr, 0,
|
||||
&my_addr, MY_PORT);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ static int read_from_peer(struct dtls_context_t *ctx,
|
|||
session_t *session,
|
||||
uint8 *data, size_t len)
|
||||
{
|
||||
PRINT("%s: read from peer %p len %d\n", __FUNCTION__, data, len);
|
||||
PRINT("%s: read from peer %p len %d\n", __func__, data, len);
|
||||
|
||||
/* In this test we reverse the received bytes.
|
||||
* We could also just pass the data back as is.
|
||||
|
@ -219,11 +219,11 @@ static int send_to_peer(struct dtls_context_t *ctx,
|
|||
max_data_len = sizeof(buf->buf) - sizeof(struct uip_udp_hdr) -
|
||||
sizeof(struct uip_ip_hdr);
|
||||
|
||||
PRINT("%s: reply to peer data %p len %d\n", __FUNCTION__, data, len);
|
||||
PRINT("%s: reply to peer data %p len %d\n", __func__, data, len);
|
||||
|
||||
if (len > max_data_len) {
|
||||
PRINT("%s: too much (%d bytes) data to send (max %d bytes)\n",
|
||||
__FUNCTION__, len, max_data_len);
|
||||
__func__, len, max_data_len);
|
||||
net_buf_put(buf);
|
||||
len = -EINVAL;
|
||||
goto out;
|
||||
|
@ -392,18 +392,18 @@ void startup(void)
|
|||
|
||||
recv = get_context();
|
||||
if (!recv) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
init_dtls(recv, &dtls);
|
||||
if (!dtls) {
|
||||
PRINT("%s: Cannot get DTLS context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get DTLS context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
receive_message(__FUNCTION__, recv, dtls);
|
||||
receive_message(__func__, recv, dtls);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ static struct net_context *unicast, *multicast;
|
|||
|
||||
static inline void init_server()
|
||||
{
|
||||
PRINT("%s: run mcast tester\n", __FUNCTION__);
|
||||
PRINT("%s: run mcast tester\n", __func__);
|
||||
|
||||
sys_rand32_init();
|
||||
|
||||
|
@ -191,12 +191,12 @@ static inline bool send_packet(const char *name,
|
|||
|
||||
if (net_send(buf) < 0) {
|
||||
PRINT("%s: sending %d bytes failed\n",
|
||||
__FUNCTION__, sending_len);
|
||||
__func__, sending_len);
|
||||
net_buf_put(buf);
|
||||
fail = true;
|
||||
goto out;
|
||||
} else {
|
||||
PRINT("%s: sent %d bytes\n", __FUNCTION__,
|
||||
PRINT("%s: sent %d bytes\n", __func__,
|
||||
sending_len);
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ static inline bool wait_reply(const char *name,
|
|||
goto free_buf;
|
||||
}
|
||||
|
||||
PRINT("%s: received %d bytes\n", __FUNCTION__,
|
||||
PRINT("%s: received %d bytes\n", __func__,
|
||||
expected_len);
|
||||
|
||||
free_buf:
|
||||
|
@ -301,7 +301,7 @@ static inline bool get_context(struct net_context **unicast,
|
|||
&my_addr, MY_PORT);
|
||||
if (!*unicast) {
|
||||
PRINT("%s: Cannot get sending network context\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ static inline bool get_context(struct net_context **unicast,
|
|||
&my_addr, MY_PORT);
|
||||
if (!*multicast) {
|
||||
PRINT("%s: Cannot get mcast sending network context\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -338,18 +338,18 @@ void sending_loop(const char *taskname, ksem_t mySem, ksem_t otherSem)
|
|||
while (1) {
|
||||
task_sem_take_wait(mySem);
|
||||
|
||||
PRINT("%s: Sending packet\n", __FUNCTION__);
|
||||
PRINT("%s: Sending packet\n", __func__);
|
||||
|
||||
expecting = sys_rand32_get() % ipsum_len;
|
||||
|
||||
if (send_unicast) {
|
||||
if (send_packet(__FUNCTION__, unicast, ipsum_len,
|
||||
if (send_packet(__func__, unicast, ipsum_len,
|
||||
expecting)) {
|
||||
PRINT("Unicast sending %d bytes FAIL\n",
|
||||
ipsum_len - expecting);
|
||||
}
|
||||
} else {
|
||||
if (send_packet(__FUNCTION__, multicast, ipsum_len,
|
||||
if (send_packet(__func__, multicast, ipsum_len,
|
||||
expecting)) {
|
||||
PRINT("Multicast sending %d bytes FAIL\n",
|
||||
ipsum_len - expecting);
|
||||
|
@ -369,9 +369,9 @@ void receiving_loop(const char *taskname, ksem_t mySem, ksem_t otherSem)
|
|||
while (1) {
|
||||
task_sem_take_wait(mySem);
|
||||
|
||||
PRINT("%s: Waiting packet\n", __FUNCTION__);
|
||||
PRINT("%s: Waiting packet\n", __func__);
|
||||
|
||||
if (wait_reply(__FUNCTION__, unicast, ipsum_len, expecting)) {
|
||||
if (wait_reply(__func__, unicast, ipsum_len, expecting)) {
|
||||
PRINT("Waiting %d bytes -> FAIL\n",
|
||||
ipsum_len - expecting);
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ void taskA(void)
|
|||
nano_sem_init(&flag);
|
||||
|
||||
if (!get_context(&unicast, &multicast)) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -401,13 +401,13 @@ void taskA(void)
|
|||
task_sem_give(TASKASEM);
|
||||
|
||||
/* invoke routine that allows task to ping-pong hello messages with taskB */
|
||||
sending_loop(__FUNCTION__, TASKASEM, TASKBSEM);
|
||||
sending_loop(__func__, TASKASEM, TASKBSEM);
|
||||
}
|
||||
|
||||
void taskB(void)
|
||||
{
|
||||
/* invoke routine that allows task to ping-pong hello messages with taskA */
|
||||
receiving_loop(__FUNCTION__, TASKBSEM, TASKASEM);
|
||||
receiving_loop(__func__, TASKBSEM, TASKASEM);
|
||||
}
|
||||
|
||||
#else /* CONFIG_NANOKERNEL */
|
||||
|
@ -433,18 +433,18 @@ void fiber_sending(void)
|
|||
nano_timer_init(&timer, data);
|
||||
|
||||
while (1) {
|
||||
PRINT("%s: Sending packet\n", __FUNCTION__);
|
||||
PRINT("%s: Sending packet\n", __func__);
|
||||
|
||||
expecting = sys_rand32_get() % ipsum_len;
|
||||
|
||||
if (send_unicast) {
|
||||
if (send_packet(__FUNCTION__, unicast, ipsum_len,
|
||||
if (send_packet(__func__, unicast, ipsum_len,
|
||||
expecting)) {
|
||||
PRINT("Unicast sending %d bytes FAIL\n",
|
||||
ipsum_len - expecting);
|
||||
}
|
||||
} else {
|
||||
if (send_packet(__FUNCTION__, multicast, ipsum_len,
|
||||
if (send_packet(__func__, multicast, ipsum_len,
|
||||
expecting)) {
|
||||
PRINT("Multicast sending %d bytes FAIL\n",
|
||||
ipsum_len - expecting);
|
||||
|
@ -464,9 +464,9 @@ void fiber_receiving(void)
|
|||
nano_timer_init(&timer, data);
|
||||
|
||||
while (1) {
|
||||
PRINT("%s: Waiting packet\n", __FUNCTION__);
|
||||
PRINT("%s: Waiting packet\n", __func__);
|
||||
|
||||
if (wait_reply(__FUNCTION__, unicast,
|
||||
if (wait_reply(__func__, unicast,
|
||||
ipsum_len, expecting)) {
|
||||
PRINT("Waiting %d bytes -> FAIL\n",
|
||||
ipsum_len - expecting);
|
||||
|
@ -488,7 +488,7 @@ void main(void)
|
|||
nano_sem_init(&flag);
|
||||
|
||||
if (!get_context(&unicast, &multicast)) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ static uint8_t my_mac[] = { 0x0a, 0xbe, 0xef, 0x15, 0xf0, 0x0d };
|
|||
|
||||
static inline void init_server()
|
||||
{
|
||||
PRINT("%s: run echo server\n", __FUNCTION__);
|
||||
PRINT("%s: run echo server\n", __func__);
|
||||
|
||||
net_set_mac(my_mac, sizeof(my_mac));
|
||||
|
||||
|
@ -185,7 +185,7 @@ static inline bool get_context(struct net_context **recv,
|
|||
&any_addr, 0,
|
||||
&my_addr, MY_PORT);
|
||||
if (!*recv) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ static inline bool get_context(struct net_context **recv,
|
|||
&mcast_addr, MY_PORT);
|
||||
if (!*mcast_recv) {
|
||||
PRINT("%s: Cannot get receiving mcast network context\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -213,12 +213,12 @@ void task_receive(void)
|
|||
init_server();
|
||||
|
||||
if (!get_context(&recv, &mcast_recv)) {
|
||||
PRINT("%s: Cannot get network contexts\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network contexts\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
receive_and_reply(__FUNCTION__, recv, mcast_recv);
|
||||
receive_and_reply(__func__, recv, mcast_recv);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -234,12 +234,12 @@ void fiber_receive(void)
|
|||
static struct net_context *mcast_recv;
|
||||
|
||||
if (!get_context(&recv, &mcast_recv)) {
|
||||
PRINT("%s: Cannot get network contexts\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network contexts\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
receive_and_reply(__FUNCTION__, recv, mcast_recv);
|
||||
receive_and_reply(__func__, recv, mcast_recv);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ static struct net_context *get_context(void)
|
|||
&any_addr, 0,
|
||||
&my_addr, 4242);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -141,13 +141,13 @@ void taskA(void)
|
|||
task_sem_give(TASKASEM);
|
||||
|
||||
/* invoke routine that allows task to ping-pong hello messages with taskB */
|
||||
helloLoop(__FUNCTION__, TASKASEM, TASKBSEM);
|
||||
helloLoop(__func__, TASKASEM, TASKBSEM);
|
||||
}
|
||||
|
||||
void taskB(void)
|
||||
{
|
||||
/* invoke routine that allows task to ping-pong hello messages with taskA */
|
||||
helloLoop(__FUNCTION__, TASKBSEM, TASKASEM);
|
||||
helloLoop(__func__, TASKBSEM, TASKASEM);
|
||||
}
|
||||
|
||||
#else /* CONFIG_NANOKERNEL */
|
||||
|
@ -181,7 +181,7 @@ void fiberEntry(void)
|
|||
|
||||
ctx = get_context();
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ void fiberEntry(void)
|
|||
|
||||
buf = net_receive(ctx, TICKS_NONE);
|
||||
if (buf) {
|
||||
PRINT("%s: received %d bytes\n", __FUNCTION__,
|
||||
PRINT("%s: received %d bytes\n", __func__,
|
||||
net_buf_datalen(buf));
|
||||
net_buf_put(buf);
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ void main(void)
|
|||
|
||||
net_init();
|
||||
|
||||
PRINT("%s: run listener\n", __FUNCTION__);
|
||||
PRINT("%s: run listener\n", __func__);
|
||||
|
||||
set_mac();
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ void fiberEntry(void)
|
|||
&any_addr, 0,
|
||||
&loopback_addr, 4242);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void fiberEntry(void)
|
|||
|
||||
buf = net_receive(ctx, TICKS_NONE);
|
||||
if (buf) {
|
||||
PRINT("%s: received %d bytes\n", __FUNCTION__,
|
||||
PRINT("%s: received %d bytes\n", __func__,
|
||||
net_buf_datalen(buf));
|
||||
net_buf_put(buf);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ void main(void)
|
|||
/* Pretend to be ethernet with 6 byte mac */
|
||||
uint8_t mac[] = { 0x0a, 0xbe, 0xef, 0x15, 0xf0, 0x0d };
|
||||
|
||||
PRINT("%s: run net_loopback_test\n", __FUNCTION__);
|
||||
PRINT("%s: run net_loopback_test\n", __func__);
|
||||
|
||||
net_init();
|
||||
net_driver_loopback_init();
|
||||
|
@ -181,10 +181,10 @@ void main(void)
|
|||
|
||||
if (net_send(buf) < 0) {
|
||||
PRINT("%s: sending %d bytes failed\n",
|
||||
__FUNCTION__, len);
|
||||
__func__, len);
|
||||
net_buf_put(buf);
|
||||
} else
|
||||
PRINT("%s: sent %d bytes\n", __FUNCTION__,
|
||||
PRINT("%s: sent %d bytes\n", __func__,
|
||||
sent_len);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ static const char *lorem_ipsum =
|
|||
|
||||
static inline void init_test()
|
||||
{
|
||||
PRINT("%s: run 802.15.4 loopback tester\n", __FUNCTION__);
|
||||
PRINT("%s: run 802.15.4 loopback tester\n", __func__);
|
||||
|
||||
net_set_mac(src_mac, sizeof(src_mac));
|
||||
|
||||
|
@ -133,11 +133,11 @@ static void send_data(const char *taskname, struct net_context *ctx)
|
|||
|
||||
if (net_send(buf) < 0) {
|
||||
PRINT("%s: %s(): sending %d bytes failed\n",
|
||||
taskname, __FUNCTION__, len);
|
||||
taskname, __func__, len);
|
||||
net_buf_put(buf);
|
||||
} else {
|
||||
PRINT("%s: %s(): sent %d bytes\n", taskname,
|
||||
__FUNCTION__, sent_len);
|
||||
__func__, sent_len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ static void receive_data(const char *taskname, struct net_context *ctx)
|
|||
buf = net_receive(ctx, TICKS_NONE);
|
||||
if (buf) {
|
||||
PRINT("%s: %s(): received %d bytes\n", taskname,
|
||||
__FUNCTION__, net_buf_datalen(buf));
|
||||
__func__, net_buf_datalen(buf));
|
||||
if (memcmp(net_buf_data(buf), lorem_ipsum, sizeof(lorem_ipsum))) {
|
||||
PRINT("ERROR: data does not match\n");
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ static struct net_context *get_context(const struct net_addr *remote,
|
|||
remote, remote_port,
|
||||
local, local_port);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -223,14 +223,14 @@ void taskA(void)
|
|||
|
||||
ctx = get_context(&any_addr, SRC_PORT, &loopback_addr, DEST_PORT);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
/* taskA gives its own semaphore, allowing it to say hello right away */
|
||||
task_sem_give(TASKASEM);
|
||||
|
||||
listen(__FUNCTION__, TASKASEM, TASKBSEM, ctx);
|
||||
listen(__func__, TASKASEM, TASKBSEM, ctx);
|
||||
}
|
||||
|
||||
static void send(const char *taskname, ksem_t mySem, ksem_t otherSem,
|
||||
|
@ -253,13 +253,13 @@ void taskB(void)
|
|||
|
||||
ctx = get_context(&loopback_addr, DEST_PORT, &any_addr, SRC_PORT);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
set_routes();
|
||||
|
||||
send(__FUNCTION__, TASKBSEM, TASKASEM, ctx);
|
||||
send(__func__, TASKBSEM, TASKASEM, ctx);
|
||||
}
|
||||
|
||||
#else /* CONFIG_NANOKERNEL */
|
||||
|
@ -298,7 +298,7 @@ void fiber_receiving(void)
|
|||
|
||||
ctx = get_context(&any_addr, SRC_PORT, &loopback_addr, DEST_PORT);
|
||||
if (!ctx) {
|
||||
PRINT("%s: Cannot get network context\n", __FUNCTION__);
|
||||
PRINT("%s: Cannot get network context\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ void fiber_sending(void)
|
|||
|
||||
void main(void)
|
||||
{
|
||||
PRINT("%s: run test_15_4\n", __FUNCTION__);
|
||||
PRINT("%s: run test_15_4\n", __func__);
|
||||
|
||||
net_init();
|
||||
init_test();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue