staging: rtl8192e: Remove constant variable net_promiscuous_md
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Tue, 3 Oct 2023 19:34:07 +0000 (21:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2023 07:59:39 +0000 (09:59 +0200)
Remove variable net_promiscuous_md as it is set to 0 and unchanged. The
equations result accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/84a9865f763feeaaa51ce9abecf76c848e13580e.1696360404.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
drivers/staging/rtl8192e/rtllib.h
drivers/staging/rtl8192e/rtllib_rx.c

index ef17472bea05e03eba16a57693f7d50a34c26277..f46cb152930a78a39ea1f9a5b98bf7a271e242b8 100644 (file)
@@ -739,7 +739,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
        priv->chan = 1;
        priv->rtllib->mode = WIRELESS_MODE_AUTO;
        priv->rtllib->iw_mode = IW_MODE_INFRA;
-       priv->rtllib->net_promiscuous_md = false;
        priv->rtllib->ieee_up = 0;
        priv->retry_rts = DEFAULT_RETRY_RTS;
        priv->retry_data = DEFAULT_RETRY_DATA;
@@ -1030,15 +1029,12 @@ static void _rtl92e_watchdog_wq_cb(void *data)
                     MAC80211_NOLINK) &&
                     (ieee->rf_power_state == rf_on) && !ieee->is_set_key &&
                     (!ieee->proto_stoppping) && !ieee->wx_set_enc) {
-                       if ((ieee->pwr_save_ctrl.ReturnPoint ==
-                            IPS_CALLBACK_NONE) &&
-                            (!ieee->net_promiscuous_md)) {
+                       if (ieee->pwr_save_ctrl.ReturnPoint == IPS_CALLBACK_NONE) {
                                rtl92e_ips_enter(dev);
                        }
                }
        }
-       if ((ieee->link_state == MAC80211_LINKED) && (ieee->iw_mode ==
-            IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) {
+       if ((ieee->link_state == MAC80211_LINKED) && (ieee->iw_mode == IW_MODE_INFRA)) {
                if (ieee->link_detect_info.NumRxOkInPeriod > 100 ||
                ieee->link_detect_info.NumTxOkInPeriod > 100)
                        bBusyTraffic = true;
index d0b68b258af769cf90ae178e84c20cfeb249ca94..c367e4fa2af19344f36e3895155626037c0abdc2 100644 (file)
@@ -209,7 +209,6 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
                               union iwreq_data *wrqu, char *b)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rtllib_device *ieee = netdev_priv_rsl(dev);
 
        enum rt_rf_power_state rt_state;
        int ret;
@@ -218,8 +217,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
                return 0;
        rt_state = priv->rtllib->rf_power_state;
        mutex_lock(&priv->wx_mutex);
-       if (wrqu->mode == IW_MODE_MONITOR ||
-           ieee->net_promiscuous_md) {
+       if (wrqu->mode == IW_MODE_MONITOR) {
                if (rt_state == rf_off) {
                        if (priv->rtllib->rf_off_reason >
                            RF_CHANGE_BY_IPS) {
index 97bb00bdbf4d8e67cd2a2dac0519002f288b3957..6d54c03f56808468665a9b67cfc1acb2a181a9a3 100644 (file)
@@ -1253,7 +1253,6 @@ struct rtllib_device {
        int scan_age;
 
        int iw_mode; /* operating mode (IW_MODE_*) */
-       bool net_promiscuous_md;
 
        spinlock_t lock;
        spinlock_t wpax_suitlist_lock;
index f03ec5f53b3471f85508aa8ebd39bf3c435bfe99..9a5fdf16f6a18cf1ad583c17a94437bcdc36f03b 100644 (file)
@@ -1255,12 +1255,8 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
        /*Filter pkt not to me*/
        multicast = is_multicast_ether_addr(hdr->addr1);
        unicast = !multicast;
-       if (unicast && !ether_addr_equal(dev->dev_addr, hdr->addr1)) {
-               if (ieee->net_promiscuous_md)
-                       bToOtherSTA = true;
-               else
-                       goto rx_dropped;
-       }
+       if (unicast && !ether_addr_equal(dev->dev_addr, hdr->addr1))
+               goto rx_dropped;
 
        /*Filter pkt has too small length */
        hdrlen = rtllib_rx_get_hdrlen(ieee, skb, rx_stats);