mirror of https://github.com/ARMmbed/mbed-os.git
lwipstack: fix astyle coding style
parent
e54ce88bca
commit
41c1901318
|
@ -186,7 +186,7 @@ void LWIP::Interface::netif_link_irq(struct netif *netif)
|
||||||
|
|
||||||
if (interface->client_callback && connectedStatusPrev != interface->connected
|
if (interface->client_callback && connectedStatusPrev != interface->connected
|
||||||
&& interface->connected != NSAPI_STATUS_GLOBAL_UP /* advertised by netif_status_irq */
|
&& interface->connected != NSAPI_STATUS_GLOBAL_UP /* advertised by netif_status_irq */
|
||||||
&& interface->connected != NSAPI_STATUS_DISCONNECTED) /* advertised by bring_down */ {
|
&& interface->connected != NSAPI_STATUS_DISCONNECTED) { /* advertised by bring_down */
|
||||||
interface->client_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, interface->connected);
|
interface->client_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, interface->connected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ void LWIP::Interface::netif_status_irq(struct netif *netif)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interface->client_callback && (connectedStatusPrev != interface->connected)
|
if (interface->client_callback && (connectedStatusPrev != interface->connected)
|
||||||
&& interface->connected != NSAPI_STATUS_DISCONNECTED) /* advertised by bring_down */ {
|
&& interface->connected != NSAPI_STATUS_DISCONNECTED) { /* advertised by bring_down */
|
||||||
interface->client_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, interface->connected);
|
interface->client_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, interface->connected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,7 @@ err_t LWIP::Interface::emac_igmp_mac_filter(struct netif *netif, const ip4_addr_
|
||||||
LWIP::Interface *mbed_if = static_cast<LWIP::Interface *>(netif->state);
|
LWIP::Interface *mbed_if = static_cast<LWIP::Interface *>(netif->state);
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case NETIF_ADD_MAC_FILTER:
|
case NETIF_ADD_MAC_FILTER: {
|
||||||
{
|
|
||||||
uint32_t group23 = ntohl(group->addr) & 0x007FFFFF;
|
uint32_t group23 = ntohl(group->addr) & 0x007FFFFF;
|
||||||
uint8_t addr[6];
|
uint8_t addr[6];
|
||||||
addr[0] = LL_IP4_MULTICAST_ADDR_0;
|
addr[0] = LL_IP4_MULTICAST_ADDR_0;
|
||||||
|
@ -112,8 +111,7 @@ err_t LWIP::Interface::emac_mld_mac_filter(struct netif *netif, const ip6_addr_t
|
||||||
LWIP::Interface *mbed_if = static_cast<LWIP::Interface *>(netif->state);
|
LWIP::Interface *mbed_if = static_cast<LWIP::Interface *>(netif->state);
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case NETIF_ADD_MAC_FILTER:
|
case NETIF_ADD_MAC_FILTER: {
|
||||||
{
|
|
||||||
uint32_t group32 = ntohl(group->addr[3]);
|
uint32_t group32 = ntohl(group->addr[3]);
|
||||||
uint8_t addr[6];
|
uint8_t addr[6];
|
||||||
addr[0] = LL_IP6_MULTICAST_ADDR_0;
|
addr[0] = LL_IP6_MULTICAST_ADDR_0;
|
||||||
|
|
|
@ -485,7 +485,8 @@ nsapi_size_or_error_t LWIP::socket_recvfrom(nsapi_socket_t handle, SocketAddress
|
||||||
return recv;
|
return recv;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LWIP::find_multicast_member(const struct mbed_lwip_socket *s, const nsapi_ip_mreq_t *imr) {
|
int32_t LWIP::find_multicast_member(const struct mbed_lwip_socket *s, const nsapi_ip_mreq_t *imr)
|
||||||
|
{
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
// Set upper limit on while loop, should break out when the membership pair is found
|
// Set upper limit on while loop, should break out when the membership pair is found
|
||||||
|
@ -662,7 +663,8 @@ void LWIP::socket_attach(nsapi_socket_t handle, void (*callback)(void *), void *
|
||||||
s->data = data;
|
s->data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
LWIP &LWIP::get_instance() {
|
LWIP &LWIP::get_instance()
|
||||||
|
{
|
||||||
static LWIP lwip;
|
static LWIP lwip;
|
||||||
return lwip;
|
return lwip;
|
||||||
}
|
}
|
||||||
|
@ -672,7 +674,8 @@ LWIP &LWIP::get_instance() {
|
||||||
#define LWIP 0x11991199
|
#define LWIP 0x11991199
|
||||||
#if MBED_CONF_NSAPI_DEFAULT_STACK == LWIP
|
#if MBED_CONF_NSAPI_DEFAULT_STACK == LWIP
|
||||||
#undef LWIP
|
#undef LWIP
|
||||||
OnboardNetworkStack &OnboardNetworkStack::get_default_instance() {
|
OnboardNetworkStack &OnboardNetworkStack::get_default_instance()
|
||||||
|
{
|
||||||
return LWIP::get_instance();
|
return LWIP::get_instance();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -487,21 +487,29 @@ private:
|
||||||
struct mbed_lwip_socket *arena_alloc();
|
struct mbed_lwip_socket *arena_alloc();
|
||||||
void arena_dealloc(struct mbed_lwip_socket *s);
|
void arena_dealloc(struct mbed_lwip_socket *s);
|
||||||
|
|
||||||
static uint32_t next_registered_multicast_member(const struct mbed_lwip_socket *s, uint32_t index) {
|
static uint32_t next_registered_multicast_member(const struct mbed_lwip_socket *s, uint32_t index)
|
||||||
while (!(s->multicast_memberships_registry & (0x0001 << index))) { index++; }
|
{
|
||||||
|
while (!(s->multicast_memberships_registry & (0x0001 << index))) {
|
||||||
|
index++;
|
||||||
|
}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t next_free_multicast_member(const struct mbed_lwip_socket *s, uint32_t index) {
|
static uint32_t next_free_multicast_member(const struct mbed_lwip_socket *s, uint32_t index)
|
||||||
while ((s->multicast_memberships_registry & (0x0001 << index))) { index++; }
|
{
|
||||||
|
while ((s->multicast_memberships_registry & (0x0001 << index))) {
|
||||||
|
index++;
|
||||||
|
}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_multicast_member_registry_bit(struct mbed_lwip_socket *s, uint32_t index) {
|
static void set_multicast_member_registry_bit(struct mbed_lwip_socket *s, uint32_t index)
|
||||||
|
{
|
||||||
s->multicast_memberships_registry |= (0x0001 << index);
|
s->multicast_memberships_registry |= (0x0001 << index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clear_multicast_member_registry_bit(struct mbed_lwip_socket *s, uint32_t index) {
|
static void clear_multicast_member_registry_bit(struct mbed_lwip_socket *s, uint32_t index)
|
||||||
|
{
|
||||||
s->multicast_memberships_registry &= ~(0x0001 << index);
|
s->multicast_memberships_registry &= ~(0x0001 << index);
|
||||||
}
|
}
|
||||||
static int32_t find_multicast_member(const struct mbed_lwip_socket *s, const nsapi_ip_mreq_t *imr);
|
static int32_t find_multicast_member(const struct mbed_lwip_socket *s, const nsapi_ip_mreq_t *imr);
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
#include "netsocket/nsapi_types.h"
|
#include "netsocket/nsapi_types.h"
|
||||||
|
|
||||||
/* LWIP error remapping */
|
/* LWIP error remapping */
|
||||||
nsapi_error_t LWIP::err_remap(err_t err) {
|
nsapi_error_t LWIP::err_remap(err_t err)
|
||||||
|
{
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case ERR_OK:
|
case ERR_OK:
|
||||||
case ERR_CLSD:
|
case ERR_CLSD:
|
||||||
|
|
|
@ -268,7 +268,8 @@ static void ppp_input()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stream_cb() {
|
static void stream_cb()
|
||||||
|
{
|
||||||
if (my_stream && !event_queued) {
|
if (my_stream && !event_queued) {
|
||||||
event_queued = true;
|
event_queued = true;
|
||||||
if (event_queue->call(callback(ppp_input)) == 0) {
|
if (event_queue->call(callback(ppp_input)) == 0) {
|
||||||
|
|
Loading…
Reference in New Issue