nss-packages-LiBwrt/qca-nss-clients/patches-11.4/0020-capwapmgr-fix-compile-error.patch
2025-11-04 13:19:44 +08:00

170 lines
6.8 KiB
Diff

--- a/capwapmgr/nss_capwapmgr.c
+++ b/capwapmgr/nss_capwapmgr.c
@@ -331,7 +331,7 @@ static struct rtnl_link_stats64 *nss_cap
* Netdev seems to be incrementing rx_dropped because we don't give IP header.
* So reset it as it's of no use for us.
*/
- atomic_long_set(&dev->rx_dropped, 0);
+ dev->stats.rx_dropped = 0;
memset(stats, 0, sizeof (struct rtnl_link_stats64));
nss_capwapmgr_fill_up_stats(stats, &global.tunneld);
@@ -376,7 +376,6 @@ static const struct net_device_ops nss_c
.ndo_stop = nss_capwapmgr_close,
.ndo_start_xmit = nss_capwapmgr_start_xmit,
.ndo_set_mac_address = eth_mac_addr,
- .ndo_change_mtu = eth_change_mtu,
.ndo_get_stats64 = nss_capwapmgr_dev_tunnel_stats,
};
@@ -400,7 +399,7 @@ static void nss_capwapmgr_dummpy_netdev_
#else
dev->priv_destructor = NULL;
#endif
- memcpy(dev->dev_addr, "\x00\x00\x00\x00\x00\x00", dev->addr_len);
+ memcpy((u8 *)dev->dev_addr, "\x00\x00\x00\x00\x00\x00", dev->addr_len);
memset(dev->broadcast, 0xff, dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
}
@@ -569,7 +568,7 @@ static struct nss_capwapmgr_tunnel *nss_
* nss_capwapmgr_netdev_create()
* API to create a CAPWAP netdev
*/
-struct net_device *nss_capwapmgr_netdev_create()
+struct net_device *nss_capwapmgr_netdev_create(void)
{
struct nss_capwapmgr_priv *priv;
struct nss_capwapmgr_response *r;
@@ -1168,7 +1167,7 @@ static nss_capwapmgr_status_t nss_capwap
/*
* Call NSS driver
*/
- status = nss_capwap_tx_msg(ctx, msg);
+ status = (nss_capwapmgr_status_t)nss_capwap_tx_msg(ctx, msg);
if (status != NSS_CAPWAPMGR_SUCCESS) {
up(&r->sem);
dev_put(dev);
@@ -1209,7 +1208,7 @@ static nss_capwapmgr_status_t nss_capwap
struct nss_ctx_instance *ctx = nss_capwap_get_ctx();
struct nss_capwap_msg capwapmsg;
struct nss_capwap_rule_msg *capwapcfg;
- nss_tx_status_t status;
+ nss_capwapmgr_status_t status;
nss_capwapmgr_info("%px: ctx: CAPWAP Rule src_port: 0x%d dest_port:0x%d\n", ctx,
ntohl(msg->encap.src_port), ntohl(msg->encap.dest_port));
@@ -1274,7 +1273,7 @@ static nss_capwapmgr_status_t nss_capwap
nss_capwapmgr_msg_event_receive, dev);
status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
- if (status != NSS_TX_SUCCESS) {
+ if (status != NSS_CAPWAPMGR_SUCCESS) {
nss_capwapmgr_warn("%px: ctx: create encap data tunnel error %d \n", ctx, status);
return status;
}
@@ -1286,10 +1285,10 @@ static nss_capwapmgr_status_t nss_capwap
* nss_capwapmgr_tx_msg_enable_tunnel()
* Common function to send CAPWAP tunnel enable msg
*/
-static nss_tx_status_t nss_capwapmgr_tx_msg_enable_tunnel(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, uint32_t sibling_if_num)
+static nss_capwapmgr_status_t nss_capwapmgr_tx_msg_enable_tunnel(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, uint32_t sibling_if_num)
{
struct nss_capwap_msg capwapmsg;
- nss_tx_status_t status;
+ nss_capwapmgr_status_t status;
/*
* Prepare the tunnel configuration parameter to send to NSS FW
@@ -1303,7 +1302,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
nss_capwap_msg_init(&capwapmsg, if_num, NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, sizeof(struct nss_capwap_enable_tunnel_msg), nss_capwapmgr_msg_event_receive, dev);
status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
- if (status != NSS_TX_SUCCESS) {
+ if (status != NSS_CAPWAPMGR_SUCCESS) {
nss_capwapmgr_warn("%px: ctx: CMD: %d Tunnel error : %d \n", ctx, NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, status);
}
@@ -1315,7 +1314,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
* Common function for CAPWAP tunnel operation messages without
* any message data structures.
*/
-static nss_tx_status_t nss_capwapmgr_tunnel_action(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, nss_capwap_msg_type_t cmd)
+static nss_capwapmgr_status_t nss_capwapmgr_tunnel_action(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, nss_capwap_msg_type_t cmd)
{
struct nss_capwap_msg capwapmsg;
nss_tx_status_t status;
@@ -1330,12 +1329,12 @@ static nss_tx_status_t nss_capwapmgr_tun
*/
nss_capwap_msg_init(&capwapmsg, if_num, cmd, 0, nss_capwapmgr_msg_event_receive, dev);
- status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
+ status = (nss_tx_status_t)nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
if (status != NSS_TX_SUCCESS) {
nss_capwapmgr_warn("%px: ctx: CMD: %d Tunnel error : %d \n", ctx, cmd, status);
}
- return status;
+ return (nss_capwapmgr_status_t)status;
}
/*
@@ -1460,7 +1459,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_path_
*/
nss_capwapmgr_status_t nss_capwapmgr_update_dest_mac_addr(struct net_device *dev, uint8_t tunnel_id, uint8_t *mac_addr)
{
- struct nss_capwapmgr_priv *priv;
struct nss_capwapmgr_tunnel *t;
nss_tx_status_t nss_status;
nss_capwapmgr_status_t status = NSS_CAPWAPMGR_SUCCESS;
@@ -1476,7 +1474,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
}
- priv = netdev_priv(dev);
nss_capwapmgr_info("%px: %d: tunnel update mac Addr is being called\n", dev, tunnel_id);
/*
@@ -1523,7 +1520,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_dest_
*/
nss_capwapmgr_status_t nss_capwapmgr_update_src_interface(struct net_device *dev, uint8_t tunnel_id, uint32_t src_interface_num)
{
- struct nss_capwapmgr_priv *priv;
struct nss_capwapmgr_tunnel *t;
nss_tx_status_t nss_status;
uint32_t outer_trustsec_enabled, dtls_enabled, forward_if_num, src_interface_num_temp;
@@ -1537,7 +1533,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
}
- priv = netdev_priv(dev);
nss_capwapmgr_info("%px: %d: tunnel update source interface is being called\n", dev, tunnel_id);
outer_trustsec_enabled = t->capwap_rule.enabled_features & NSS_CAPWAPMGR_FEATURE_OUTER_TRUSTSEC_ENABLED;
dtls_enabled = t->capwap_rule.enabled_features & NSS_CAPWAPMGR_FEATURE_DTLS_ENABLED;
@@ -1576,7 +1571,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
/*
* Destroy the IP rule only if it already exist.
*/
- if (t->tunnel_state & NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
+ if (NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
struct nss_ipv4_destroy v4_destroy;
v4_destroy.protocol = IPPROTO_UDP;
v4_destroy.src_ip = t->ip_rule.v4.src_ip;
@@ -1606,7 +1601,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
/*
* Destroy the IP rule only if it already exist.
*/
- if (t->tunnel_state & NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
+ if (NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
struct nss_ipv6_destroy v6_destroy;
if (t->capwap_rule.which_udp == NSS_CAPWAP_TUNNEL_UDP) {
@@ -1750,7 +1745,7 @@ nss_capwapmgr_status_t nss_capwapmgr_dsc
uint8_t rule_nr = NSS_CAPWAPMGR_RULE_NR;
uint8_t list_id, v4_rule_id, v6_rule_id;
uint8_t lid, rid, i, j;
- int8_t err, fail_dscp;
+ uint8_t err, fail_dscp;
int8_t uid = -1;
nss_capwapmgr_info("Setting priority %u for dscp %u mask %u\n", pri, dscp_value, dscp_mask);