--- zzzz-none-000/linux-4.1.52/net/core/dev_ioctl.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/net/core/dev_ioctl.c 2022-03-02 11:37:13.000000000 +0000 @@ -39,6 +39,7 @@ return 0; } + static gifconf_func_t *gifconf_list[NPROTO]; /** @@ -173,6 +174,20 @@ ifr->ifr_qlen = dev->tx_queue_len; return 0; +#if defined(CONFIG_BCM_KF_WANDEV) + case SIOCDEVISWANDEV: + if (dev->priv_flags & IFF_WANDEV) + ifr->ifr_flags = 1; + else + ifr->ifr_flags = 0; + return 0; +#endif +#if defined(CONFIG_BCM_KF_MISC_IOCTLS) + case SIOCGIFTRANSSTART: + ifr->ifr_ifru.ifru_ivalue = dev->trans_start; + return 0; +#endif + default: /* dev_ioctl() should ensure this case * is never reached @@ -307,6 +322,38 @@ ifr->ifr_newname[IFNAMSIZ-1] = '\0'; return dev_change_name(dev, ifr->ifr_newname); +#if defined(CONFIG_BCM_KF_MISC_IOCTLS) + case SIOCCIFSTATS: /* Clear stats of a device */ +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + if ( dev->clr_stats ) + { + dev->clr_stats( dev ); + } + else +#endif + { + struct net_device_stats * pStats; + if (dev->netdev_ops == NULL || dev->netdev_ops->ndo_get_stats == NULL) + { + printk("[%s.%d]: dev->netdev_ops->ndo_get_stats is %p (%s)\n", __func__, __LINE__, dev->netdev_ops->ndo_get_stats, dev->name); + return 0; + } + else + { + pStats = dev->netdev_ops->ndo_get_stats(dev); + } + if (pStats) + { + memset(pStats, 0, sizeof(struct net_device_stats)); + } + else + { + printk("ERROR: [%s.%d]: could not reset stats for device %s\n", __func__, __LINE__, dev->name); + } + } + return 0; +#endif + case SIOCSHWTSTAMP: err = net_hwtstamp_validate(ifr); if (err) @@ -359,6 +406,7 @@ void dev_load(struct net *net, const char *name) { +#ifdef CONFIG_NET_DEV_LOAD struct net_device *dev; int no_module; @@ -371,6 +419,7 @@ no_module = request_module("netdev-%s", name); if (no_module && capable(CAP_SYS_MODULE)) request_module("%s", name); +#endif /*--- #ifdef CONFIG_NET_DEV_LOAD ---*/ } EXPORT_SYMBOL(dev_load); @@ -439,6 +488,12 @@ case SIOCGIFMAP: case SIOCGIFINDEX: case SIOCGIFTXQLEN: +#if defined(CONFIG_BCM_KF_MISC_IOCTLS) + case SIOCGIFTRANSSTART: +#endif +#if defined(CONFIG_BCM_KF_WANDEV) + case SIOCDEVISWANDEV: +#endif dev_load(net, ifr.ifr_name); rcu_read_lock(); ret = dev_ifsioc_locked(net, &ifr, cmd); @@ -548,6 +603,9 @@ */ default: if (cmd == SIOCWANDEV || +#if defined(CONFIG_BCM_KF_MISC_IOCTLS) + cmd == SIOCCIFSTATS || +#endif cmd == SIOCGHWTSTAMP || (cmd >= SIOCDEVPRIVATE && cmd <= SIOCDEVPRIVATE + 15)) {