Changeset View
Changeset View
Standalone View
Standalone View
sys/ofed/drivers/infiniband/core/ib_cma.c
Show All 34 Lines | |||||
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#define LINUXKPI_PARAM_PREFIX ibcore_ | #define LINUXKPI_PARAM_PREFIX ibcore_ | ||||
#include "opt_inet.h" | |||||
#include "opt_inet6.h" | |||||
#include <linux/completion.h> | #include <linux/completion.h> | ||||
#include <linux/in.h> | #include <linux/in.h> | ||||
#include <linux/in6.h> | #include <linux/in6.h> | ||||
#include <linux/mutex.h> | #include <linux/mutex.h> | ||||
#include <linux/random.h> | #include <linux/random.h> | ||||
#include <linux/idr.h> | #include <linux/idr.h> | ||||
#include <linux/slab.h> | #include <linux/slab.h> | ||||
#include <linux/module.h> | #include <linux/module.h> | ||||
▲ Show 20 Lines • Show All 992 Lines • ▼ Show 20 Lines | static inline int cma_zero_addr(struct sockaddr *addr) | ||||
default: | default: | ||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
static inline int cma_loopback_addr(struct sockaddr *addr) | static inline int cma_loopback_addr(struct sockaddr *addr) | ||||
{ | { | ||||
switch (addr->sa_family) { | switch (addr->sa_family) { | ||||
#ifdef INET | |||||
/* | |||||
* ipv4_is_loopback() requires an inet variable via vnet, | |||||
* not present if INET is not included. | |||||
*/ | |||||
bz: Do we need this comment? | |||||
Done Inline ActionsI thought it was worth an explanation of why this particular code has ifdefs. karels: I thought it was worth an explanation of why this particular code has ifdefs. | |||||
case AF_INET: | case AF_INET: | ||||
return ipv4_is_loopback(((struct sockaddr_in *) addr)->sin_addr.s_addr); | return ipv4_is_loopback(((struct sockaddr_in *) addr)->sin_addr.s_addr); | ||||
#endif | |||||
#ifdef INET6 | |||||
case AF_INET6: | case AF_INET6: | ||||
return ipv6_addr_loopback(&((struct sockaddr_in6 *) addr)->sin6_addr); | return ipv6_addr_loopback(&((struct sockaddr_in6 *) addr)->sin6_addr); | ||||
#endif | |||||
case AF_IB: | case AF_IB: | ||||
return ib_addr_loopback(&((struct sockaddr_ib *) addr)->sib_addr); | return ib_addr_loopback(&((struct sockaddr_ib *) addr)->sib_addr); | ||||
default: | default: | ||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
static inline int cma_any_addr(struct sockaddr *addr) | static inline int cma_any_addr(struct sockaddr *addr) | ||||
▲ Show 20 Lines • Show All 3,603 Lines • Show Last 20 Lines |
Do we need this comment?