Temporarily export leaf functions that will be moved to netconsole. The upcoming patch will move the setup function to netconsole, and continue to call these leaf functions here in netpoll, then other patches will move these exports functions to netconsole (and make them statics). In summary, these exports are temporary in order to make the patchset digestible. Signed-off-by: Breno Leitao --- include/linux/netpoll.h | 5 +++++ net/core/netpoll.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index d426d1844cac7..0877515fa7442 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -73,6 +73,11 @@ void do_netpoll_cleanup(struct netpoll *np); netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); void netpoll_zap_completion_queue(void); unsigned int netpoll_get_carrier_timeout(void); +void netpoll_wait_carrier(struct netpoll *np, struct net_device *ndev); +char *egress_dev(struct netpoll *np, char *buf, size_t bufsz); +int netpoll_take_ipv4(struct netpoll *np, struct net_device *ndev); +int netpoll_take_ipv6(struct netpoll *np, struct net_device *ndev); +bool netpoll_local_ip_unset(const struct netpoll *np); #ifdef CONFIG_NETPOLL static inline void *netpoll_poll_lock(struct napi_struct *napi) diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 9b9fcc307958f..6a545063223ba 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -399,7 +399,7 @@ EXPORT_SYMBOL_GPL(__netpoll_setup); * be at least MAC_ADDR_STR_LEN + 1 to fit the formatted MAC address * and its NUL terminator. */ -static char *egress_dev(struct netpoll *np, char *buf, size_t bufsz) +char *egress_dev(struct netpoll *np, char *buf, size_t bufsz) { if (np->dev_name[0]) return np->dev_name; @@ -407,8 +407,9 @@ static char *egress_dev(struct netpoll *np, char *buf, size_t bufsz) snprintf(buf, bufsz, "%pM", np->dev_mac); return buf; } +EXPORT_SYMBOL_GPL(egress_dev); -static void netpoll_wait_carrier(struct netpoll *np, struct net_device *ndev) +void netpoll_wait_carrier(struct netpoll *np, struct net_device *ndev) { unsigned long atmost; @@ -421,11 +422,12 @@ static void netpoll_wait_carrier(struct netpoll *np, struct net_device *ndev) msleep(1); } } +EXPORT_SYMBOL_GPL(netpoll_wait_carrier); /* * Take the IPv6 from ndev and populate local_ip structure in netpoll */ -static int netpoll_take_ipv6(struct netpoll *np, struct net_device *ndev) +int netpoll_take_ipv6(struct netpoll *np, struct net_device *ndev) { char buf[MAC_ADDR_STR_LEN + 1]; int err = -EDESTADDRREQ; @@ -462,11 +464,12 @@ static int netpoll_take_ipv6(struct netpoll *np, struct net_device *ndev) np_info(np, "local IPv6 %pI6c\n", &np->local_ip.in6); return 0; } +EXPORT_SYMBOL_GPL(netpoll_take_ipv6); /* * Take the IPv4 from ndev and populate local_ip structure in netpoll */ -static int netpoll_take_ipv4(struct netpoll *np, struct net_device *ndev) +int netpoll_take_ipv4(struct netpoll *np, struct net_device *ndev) { char buf[MAC_ADDR_STR_LEN + 1]; const struct in_ifaddr *ifa; @@ -491,6 +494,7 @@ static int netpoll_take_ipv4(struct netpoll *np, struct net_device *ndev) return 0; } +EXPORT_SYMBOL_GPL(netpoll_take_ipv4); /* * Test whether the caller left np->local_ip unset, so that @@ -502,12 +506,13 @@ static int netpoll_take_ipv4(struct netpoll *np, struct net_device *ndev) * doing so would misclassify a caller-supplied address as unset and * silently overwrite it with whatever address the device exposes. */ -static bool netpoll_local_ip_unset(const struct netpoll *np) +bool netpoll_local_ip_unset(const struct netpoll *np) { if (np->ipv6) return ipv6_addr_any(&np->local_ip.in6); return !np->local_ip.ip; } +EXPORT_SYMBOL_GPL(netpoll_local_ip_unset); int netpoll_setup(struct netpoll *np) { -- 2.53.0-Meta