From 9fd3210602877d0909886387157386f65cfba415 Mon Sep 17 00:00:00 2001 From: Luke Koch Date: Thu, 20 Apr 2023 18:50:00 +0200 Subject: [PATCH 01/62] staging: wlan-ng: replace rate macros Change p80211msg_dot11req_scan_results rate members to struct arrays instead of individually numbered member structs. Replace macros to set rates with loops to avoid checkpatch warning and adhere to linux coding style. Reported by checkpatch: CHECK: Macro argument reuse 'N' - possible side-effects? Signed-off-by: Luke Koch Link: https://lore.kernel.org/r/ZEFtOH83frrrireN@kernelhacking.kernelhacking.example.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211metastruct.h | 18 +------- drivers/staging/wlan-ng/prism2mgmt.c | 50 +++++++--------------- 2 files changed, 17 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211metastruct.h b/drivers/staging/wlan-ng/p80211metastruct.h index 4adc64580185..e963227f797c 100644 --- a/drivers/staging/wlan-ng/p80211metastruct.h +++ b/drivers/staging/wlan-ng/p80211metastruct.h @@ -114,22 +114,8 @@ struct p80211msg_dot11req_scan_results { struct p80211item_uint32 cfpollreq; struct p80211item_uint32 privacy; struct p80211item_uint32 capinfo; - struct p80211item_uint32 basicrate1; - struct p80211item_uint32 basicrate2; - struct p80211item_uint32 basicrate3; - struct p80211item_uint32 basicrate4; - struct p80211item_uint32 basicrate5; - struct p80211item_uint32 basicrate6; - struct p80211item_uint32 basicrate7; - struct p80211item_uint32 basicrate8; - struct p80211item_uint32 supprate1; - struct p80211item_uint32 supprate2; - struct p80211item_uint32 supprate3; - struct p80211item_uint32 supprate4; - struct p80211item_uint32 supprate5; - struct p80211item_uint32 supprate6; - struct p80211item_uint32 supprate7; - struct p80211item_uint32 supprate8; + struct p80211item_uint32 basicrate[8]; + struct p80211item_uint32 supprate[8]; } __packed; struct p80211msg_dot11req_start { diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index 9030a8939a9b..fc465261baa1 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -437,42 +437,22 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp) if (item->supprates[count] == 0) break; -#define REQBASICRATE(N) \ - do { \ - if ((count >= (N)) && DOT11_RATE5_ISBASIC_GET( \ - item->supprates[(N) - 1])) { \ - req->basicrate ## N .data = item->supprates[(N) - 1]; \ - req->basicrate ## N .status = \ - P80211ENUM_msgitem_status_data_ok; \ - } \ - } while (0) + for (int i = 0; i < 8; i++) { + if (count > i && + DOT11_RATE5_ISBASIC_GET(item->supprates[i])) { + req->basicrate[i].data = item->supprates[i]; + req->basicrate[i].status = + P80211ENUM_msgitem_status_data_ok; + } + } - REQBASICRATE(1); - REQBASICRATE(2); - REQBASICRATE(3); - REQBASICRATE(4); - REQBASICRATE(5); - REQBASICRATE(6); - REQBASICRATE(7); - REQBASICRATE(8); - -#define REQSUPPRATE(N) \ - do { \ - if (count >= (N)) { \ - req->supprate ## N .data = item->supprates[(N) - 1]; \ - req->supprate ## N .status = \ - P80211ENUM_msgitem_status_data_ok; \ - } \ - } while (0) - - REQSUPPRATE(1); - REQSUPPRATE(2); - REQSUPPRATE(3); - REQSUPPRATE(4); - REQSUPPRATE(5); - REQSUPPRATE(6); - REQSUPPRATE(7); - REQSUPPRATE(8); + for (int i = 0; i < 8; i++) { + if (count > i) { + req->supprate[i].data = item->supprates[i]; + req->supprate[i].status = + P80211ENUM_msgitem_status_data_ok; + } + } /* beacon period */ req->beaconperiod.status = P80211ENUM_msgitem_status_data_ok; From 77f2760e7111ddcfb3ab1eb7d242ec38ed9480e2 Mon Sep 17 00:00:00 2001 From: Stephan Snyman Date: Thu, 20 Apr 2023 15:32:09 +0200 Subject: [PATCH 02/62] staging: rtl8192e: add missing braces {} Add missing braces to if/else statements to adhere to the Linux kernel coding-style guidelines. These issues were reported by checkpatch.pl "CHECK: braces {} should be used on all arms of this statement" Signed-off-by: Stephan Snyman Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230420133209.4661-1-rooiratel@tinyglitch.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_rx.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index b649d02dc5c8..d44bf261de54 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -264,8 +264,9 @@ static int rtllib_is_eapol_frame(struct rtllib_device *ieee, RTLLIB_FCTL_FROMDS && memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) { /* FromDS frame with own addr as DA */ - } else + } else { return 0; + } if (skb->len < 24 + 8) return 0; @@ -433,8 +434,9 @@ static int is_duplicate_packet(struct rtllib_device *ieee, if (*last_frag + 1 != frag) /* out-of-order fragment */ goto drop; - } else + } else { *last_seq = seq; + } *last_frag = frag; *last_time = jiffies; @@ -2314,8 +2316,9 @@ static inline int rtllib_network_init( if (stats->freq == RTLLIB_52GHZ_BAND) { /* for A band (No DS info) */ network->channel = stats->received_channel; - } else + } else { network->flags |= NETWORK_HAS_CCK; + } network->wpa_ie_len = 0; network->rsn_ie_len = 0; @@ -2329,9 +2332,10 @@ static inline int rtllib_network_init( return 1; network->mode = 0; - if (stats->freq == RTLLIB_52GHZ_BAND) + + if (stats->freq == RTLLIB_52GHZ_BAND) { network->mode = IEEE_A; - else { + } else { if (network->flags & NETWORK_HAS_OFDM) network->mode |= IEEE_G; if (network->flags & NETWORK_HAS_CCK) From 3a4d000ae7fefe8d85fe54db373624dfb9b64c66 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 24 Apr 2023 23:34:07 +0530 Subject: [PATCH 03/62] staging: rtl8192e: Remove unused rf_set_sens variable The rf_set_sens variable is declared but never set, so it is always NULL. This commit cleans up the unused rf_set_sens variable and removes the associated code that relied on it. Specifically, the following changes have been made: - Removed the `range->sensitivity` assignment, which was never used. - Removed the sensitivity level get implementation, which always returns an error code. - Removed the sensitivity level set implementation, which always returns an error code. - Removed the `rf_set_sens` variable. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/5a9767fab76b1836ea7881994ffb3593c1ab12bf.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 19 ++----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 285dac32c074..08145e1f814c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -231,7 +231,6 @@ struct r8192_priv { struct rt_stats stats; struct iw_statistics wstats; - short (*rf_set_sens)(struct net_device *dev, short sens); u8 (*rf_set_chan)(struct net_device *dev, u8 ch); struct rx_desc *rx_ring[MAX_RX_QUEUE]; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index cb28288a618b..cc1af367f37d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -311,10 +311,6 @@ static int _rtl92e_wx_get_range(struct net_device *dev, /* ~130 Mb/s real (802.11n) */ range->throughput = 130 * 1000 * 1000; - if (priv->rf_set_sens != NULL) - /* signal level threshold range */ - range->sensitivity = priv->max_sens; - range->max_qual.qual = 100; range->max_qual.level = 0; range->max_qual.noise = 0; @@ -813,10 +809,7 @@ static int _rtl92e_wx_get_sens(struct net_device *dev, { struct r8192_priv *priv = rtllib_priv(dev); - if (priv->rf_set_sens == NULL) - return -1; /* we have not this support for this radio */ - wrqu->sens.value = priv->sens; - return 0; + return -1; } static int _rtl92e_wx_set_sens(struct net_device *dev, @@ -831,15 +824,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev, return 0; mutex_lock(&priv->wx_mutex); - if (priv->rf_set_sens == NULL) { - err = -1; /* we have not this support for this radio */ - goto exit; - } - if (priv->rf_set_sens(dev, wrqu->sens.value) == 0) - priv->sens = wrqu->sens.value; - else - err = -EINVAL; - + err = -1; exit: mutex_unlock(&priv->wx_mutex); From 03b9a1ab7cebd4db01cfd719a294c8f6a7bae922 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 24 Apr 2023 23:34:38 +0530 Subject: [PATCH 04/62] staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function After removal of rf_set_sens variable, the _rtl92e_wx_get_sens function always returns an error code. This commit removes the unused function and the respective ioctl. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/eae80c4e2ac7f386c853cf824135b988c3666031.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index cc1af367f37d..f0c590064def 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -803,15 +803,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev, return 0; } -static int _rtl92e_wx_get_sens(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - - return -1; -} - static int _rtl92e_wx_set_sens(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -1052,7 +1043,6 @@ static iw_handler r8192_wx_handlers[] = { [IW_IOCTL(SIOCSIWMODE)] = _rtl92e_wx_set_mode, [IW_IOCTL(SIOCGIWMODE)] = _rtl92e_wx_get_mode, [IW_IOCTL(SIOCSIWSENS)] = _rtl92e_wx_set_sens, - [IW_IOCTL(SIOCGIWSENS)] = _rtl92e_wx_get_sens, [IW_IOCTL(SIOCGIWRANGE)] = _rtl92e_wx_get_range, [IW_IOCTL(SIOCSIWAP)] = _rtl92e_wx_set_wap, [IW_IOCTL(SIOCGIWAP)] = _rtl92e_wx_get_wap, From 3877f73207c3a3d9ed033de5d627769595e324b5 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 24 Apr 2023 23:35:07 +0530 Subject: [PATCH 05/62] staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function After removal of rf_set_sens variable, the _rtl92e_wx_set_sens function always returns an error code. This commit removes the unused function and the respective ioctl. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/439386d2940fe70ec2092e87211df5e7946aab82.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index f0c590064def..0bb657fda06c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -803,25 +803,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev, return 0; } -static int _rtl92e_wx_set_sens(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - - short err = 0; - - if (priv->hw_radio_off) - return 0; - - mutex_lock(&priv->wx_mutex); - err = -1; -exit: - mutex_unlock(&priv->wx_mutex); - - return err; -} - static int _rtl92e_wx_set_encode_ext(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -1042,7 +1023,6 @@ static iw_handler r8192_wx_handlers[] = { [IW_IOCTL(SIOCGIWFREQ)] = _rtl92e_wx_get_freq, [IW_IOCTL(SIOCSIWMODE)] = _rtl92e_wx_set_mode, [IW_IOCTL(SIOCGIWMODE)] = _rtl92e_wx_get_mode, - [IW_IOCTL(SIOCSIWSENS)] = _rtl92e_wx_set_sens, [IW_IOCTL(SIOCGIWRANGE)] = _rtl92e_wx_get_range, [IW_IOCTL(SIOCSIWAP)] = _rtl92e_wx_set_wap, [IW_IOCTL(SIOCGIWAP)] = _rtl92e_wx_get_wap, From e7e0b078c9b396fc3de5f105c63235e70b876e5f Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 24 Apr 2023 23:35:25 +0530 Subject: [PATCH 06/62] staging: rtl8192e: Remove unused sens and max_sens from r8192_priv struct The 'sens' and 'max_sens' fields in the 'r8192_priv' structure are no longer used by the driver. This commit removes these fields. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/e117e958ada5695975deecfcd442703fd11bba3f.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 08145e1f814c..ec9e454299a8 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -270,8 +270,6 @@ struct r8192_priv { short promisc; short chan; - short sens; - short max_sens; bool ps_force; u32 irq_mask[2]; From 718ac8c8bd6a87d5fa2554089acb8c4f65dd5304 Mon Sep 17 00:00:00 2001 From: John Grace Date: Mon, 24 Apr 2023 20:48:53 -0400 Subject: [PATCH 07/62] staging: rtl8192e: avoid CamelCase Linux kernel coding-style suggests to not use mixed-case names. Fix checkpatch issue by changing the variable name from camel case to snake case. Signed-off-by: John Grace Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/ZEcjdUR/bnln7Z1J@iris Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ++-- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++-- drivers/staging/rtl8192e/rtllib_tx.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index aed53fedeb61..c612e31d1a84 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -1008,7 +1008,7 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, pdesc->PktSize = skb->len - sizeof(struct tx_fwinfo_8190pci); pdesc->SecCAMID = 0; - pdesc->RATid = cb_desc->RATRIndex; + pdesc->RATid = cb_desc->ratr_index; pdesc->NoEnc = 1; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 27040d1e3230..b58a30d68f2f 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -466,7 +466,7 @@ static void _rtl92e_prepare_beacon(struct tasklet_struct *t) tcb_desc = (struct cb_desc *)(pnewskb->cb + 8); tcb_desc->queue_index = BEACON_QUEUE; tcb_desc->data_rate = 2; - tcb_desc->RATRIndex = 7; + tcb_desc->ratr_index = 7; tcb_desc->tx_dis_rate_fallback = 1; tcb_desc->tx_use_drv_assinged_rate = 1; skb_push(pnewskb, priv->rtllib->tx_headroom); @@ -1440,7 +1440,7 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) return 0; } - tcb_desc->RATRIndex = 7; + tcb_desc->ratr_index = 7; tcb_desc->tx_dis_rate_fallback = 1; tcb_desc->tx_use_drv_assinged_rate = 1; tcb_desc->bTxEnableFwCalcDur = 1; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 6e665e866f1f..d5f5ea5615fc 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -139,7 +139,7 @@ struct cb_desc { u8 rata_index; u8 queue_index; u16 txbuf_size; - u8 RATRIndex; + u8 ratr_index; u8 bAMSDU:1; u8 bFromAggrQ:1; u8 reserved6:6; diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index b9886e83a6dc..1ca77cdbafa3 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -219,7 +219,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) tcb_desc->queue_index = HIGH_QUEUE; tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); - tcb_desc->RATRIndex = 7; + tcb_desc->ratr_index = 7; tcb_desc->tx_dis_rate_fallback = 1; tcb_desc->tx_use_drv_assinged_rate = 1; if (single) { @@ -297,7 +297,7 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); - tcb_desc->RATRIndex = 7; + tcb_desc->ratr_index = 7; tcb_desc->tx_dis_rate_fallback = 1; tcb_desc->tx_use_drv_assinged_rate = 1; if (single) { diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index 9ab8ee46ef66..54119fba8a57 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -486,7 +486,7 @@ static void rtllib_txrate_selectmode(struct rtllib_device *ieee, !tcb_desc->tx_use_drv_assinged_rate) { if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) - tcb_desc->RATRIndex = 0; + tcb_desc->ratr_index = 0; } } @@ -892,7 +892,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) tcb_desc->tx_dis_rate_fallback = 1; } - tcb_desc->RATRIndex = 7; + tcb_desc->ratr_index = 7; tcb_desc->tx_use_drv_assinged_rate = 1; } else { if (is_multicast_ether_addr(header.addr1)) @@ -916,7 +916,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) tcb_desc->tx_dis_rate_fallback = 1; } - tcb_desc->RATRIndex = 7; + tcb_desc->ratr_index = 7; tcb_desc->tx_use_drv_assinged_rate = 1; tcb_desc->bdhcp = 1; } From e7e444dfc2fa195deb4ae5cc5d67de51caa98fc4 Mon Sep 17 00:00:00 2001 From: Daniel Watson Date: Fri, 28 Apr 2023 19:26:48 -0700 Subject: [PATCH 08/62] staging: rtl8723bs: use tabs for indentation Use tabs for indentation to conform to styleguide. Signed-off-by: Daniel Watson Link: https://lore.kernel.org/r/ZEyAaC0riuuBJO14@trent-reznor Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/sta_info.h | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/sta_info.h b/drivers/staging/rtl8723bs/include/sta_info.h index 69c377eeeaf0..1ea3fe22b99a 100644 --- a/drivers/staging/rtl8723bs/include/sta_info.h +++ b/drivers/staging/rtl8723bs/include/sta_info.h @@ -16,9 +16,9 @@ /* if mode == 0, then the sta is allowed once the addr is hit. */ /* if mode == 1, then the sta is rejected once the addr is non-hit. */ struct rtw_wlan_acl_node { - struct list_head list; - u8 addr[ETH_ALEN]; - u8 valid; + struct list_head list; + u8 addr[ETH_ALEN]; + u8 valid; }; /* mode = 0, disable */ @@ -340,19 +340,19 @@ struct sta_priv { static inline u32 wifi_mac_hash(u8 *mac) { - u32 x; + u32 x; - x = mac[0]; - x = (x << 2) ^ mac[1]; - x = (x << 2) ^ mac[2]; - x = (x << 2) ^ mac[3]; - x = (x << 2) ^ mac[4]; - x = (x << 2) ^ mac[5]; + x = mac[0]; + x = (x << 2) ^ mac[1]; + x = (x << 2) ^ mac[2]; + x = (x << 2) ^ mac[3]; + x = (x << 2) ^ mac[4]; + x = (x << 2) ^ mac[5]; - x ^= x >> 8; - x = x & (NUM_STA - 1); + x ^= x >> 8; + x = x & (NUM_STA - 1); - return x; + return x; } From 2151bbbdf7529ce21b96e084ec2f0973412f79b2 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Wed, 10 May 2023 20:39:07 +0530 Subject: [PATCH 09/62] staging: rtl8192e: Rename tmpRegA and TempCCk Rename variable tmpRegA to tmp_reg, TempCCk to tmp_cck to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/c9c67f832db3a776c04f26e0afb083ae3ba99c07.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 56a8ec517c06..af136abc595c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -657,21 +657,21 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) { #define ThermalMeterVal 9 struct r8192_priv *priv = rtllib_priv(dev); - u32 tmpRegA, TempCCk; + u32 tmp_reg, tmp_cck; u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval; int i = 0, CCKSwingNeedUpdate = 0; if (!priv->tx_pwr_tracking_init) { - tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, + tmp_reg = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, bMaskDWord); for (i = 0; i < OFDM_TABLE_LEN; i++) { - if (tmpRegA == OFDMSwingTable[i]) + if (tmp_reg == OFDMSwingTable[i]) priv->ofdm_index[0] = i; } - TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); + tmp_cck = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); for (i = 0; i < CCK_TABLE_LEN; i++) { - if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) { + if (tmp_cck == (u32)CCKSwingTable_Ch1_Ch13[i][0]) { priv->cck_index = i; break; } @@ -680,17 +680,17 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) return; } - tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078); - if (tmpRegA < 3 || tmpRegA > 13) + tmp_reg = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078); + if (tmp_reg < 3 || tmp_reg > 13) return; - if (tmpRegA >= 12) - tmpRegA = 12; + if (tmp_reg >= 12) + tmp_reg = 12; priv->thermal_meter[0] = ThermalMeterVal; priv->thermal_meter[1] = ThermalMeterVal; - if (priv->thermal_meter[0] >= (u8)tmpRegA) { + if (priv->thermal_meter[0] >= (u8)tmp_reg) { tmpOFDMindex = tmpCCK20Mindex = 6+(priv->thermal_meter[0] - - (u8)tmpRegA); + (u8)tmp_reg); tmpCCK40Mindex = tmpCCK20Mindex - 6; if (tmpOFDMindex >= OFDM_TABLE_LEN) tmpOFDMindex = OFDM_TABLE_LEN - 1; @@ -699,7 +699,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) if (tmpCCK40Mindex >= CCK_TABLE_LEN) tmpCCK40Mindex = CCK_TABLE_LEN - 1; } else { - tmpval = (u8)tmpRegA - priv->thermal_meter[0]; + tmpval = (u8)tmp_reg - priv->thermal_meter[0]; if (tmpval >= 6) { tmpOFDMindex = 0; tmpCCK20Mindex = 0; From 9c2501d68eaf9e9e550079e5d48d99bcd3687918 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Wed, 10 May 2023 20:39:25 +0530 Subject: [PATCH 10/62] staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex Rename variable tmpOFDMindex to tmp_ofdm_index and tmpCCKindex to tmp_cck_index to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/48098479094e4562fe196cbce813476041a664df.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index af136abc595c..117c0538cf5f 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -658,7 +658,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) #define ThermalMeterVal 9 struct r8192_priv *priv = rtllib_priv(dev); u32 tmp_reg, tmp_cck; - u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval; + u8 tmp_ofdm_index, tmp_cck_index, tmpCCK20Mindex, tmpCCK40Mindex, tmpval; int i = 0, CCKSwingNeedUpdate = 0; if (!priv->tx_pwr_tracking_init) { @@ -689,11 +689,11 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) priv->thermal_meter[1] = ThermalMeterVal; if (priv->thermal_meter[0] >= (u8)tmp_reg) { - tmpOFDMindex = tmpCCK20Mindex = 6+(priv->thermal_meter[0] - + tmp_ofdm_index = tmpCCK20Mindex = 6+(priv->thermal_meter[0] - (u8)tmp_reg); tmpCCK40Mindex = tmpCCK20Mindex - 6; - if (tmpOFDMindex >= OFDM_TABLE_LEN) - tmpOFDMindex = OFDM_TABLE_LEN - 1; + if (tmp_ofdm_index >= OFDM_TABLE_LEN) + tmp_ofdm_index = OFDM_TABLE_LEN - 1; if (tmpCCK20Mindex >= CCK_TABLE_LEN) tmpCCK20Mindex = CCK_TABLE_LEN - 1; if (tmpCCK40Mindex >= CCK_TABLE_LEN) @@ -701,18 +701,18 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) } else { tmpval = (u8)tmp_reg - priv->thermal_meter[0]; if (tmpval >= 6) { - tmpOFDMindex = 0; + tmp_ofdm_index = 0; tmpCCK20Mindex = 0; } else { - tmpOFDMindex = 6 - tmpval; + tmp_ofdm_index = 6 - tmpval; tmpCCK20Mindex = 6 - tmpval; } tmpCCK40Mindex = 0; } if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - tmpCCKindex = tmpCCK40Mindex; + tmp_cck_index = tmpCCK40Mindex; else - tmpCCKindex = tmpCCK20Mindex; + tmp_cck_index = tmpCCK20Mindex; priv->rec_cck_20m_idx = tmpCCK20Mindex; priv->rec_cck_40m_idx = tmpCCK40Mindex; @@ -727,15 +727,15 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) CCKSwingNeedUpdate = 1; } - if (priv->cck_index != tmpCCKindex) { - priv->cck_index = tmpCCKindex; + if (priv->cck_index != tmp_cck_index) { + priv->cck_index = tmp_cck_index; CCKSwingNeedUpdate = 1; } if (CCKSwingNeedUpdate) rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); - if (priv->ofdm_index[0] != tmpOFDMindex) { - priv->ofdm_index[0] = tmpOFDMindex; + if (priv->ofdm_index[0] != tmp_ofdm_index) { + priv->ofdm_index[0] = tmp_ofdm_index; rtl92e_set_bb_reg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, OFDMSwingTable[priv->ofdm_index[0]]); } From 94c41266111b66c6c6de621bafde0c8fafcd6f7d Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Wed, 10 May 2023 20:39:42 +0530 Subject: [PATCH 11/62] staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex Rename variable tmpCCK20Mindex to tmp_cck_20m_index and tmpCCK40Mindex to tmp_cck_40m_index to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/3e8b6cd85e6e4fcc934cc1d813f5f594cef8ff92.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 117c0538cf5f..a44be3f810ab 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -658,7 +658,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) #define ThermalMeterVal 9 struct r8192_priv *priv = rtllib_priv(dev); u32 tmp_reg, tmp_cck; - u8 tmp_ofdm_index, tmp_cck_index, tmpCCK20Mindex, tmpCCK40Mindex, tmpval; + u8 tmp_ofdm_index, tmp_cck_index, tmp_cck_20m_index, tmp_cck_40m_index, tmpval; int i = 0, CCKSwingNeedUpdate = 0; if (!priv->tx_pwr_tracking_init) { @@ -689,33 +689,33 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) priv->thermal_meter[1] = ThermalMeterVal; if (priv->thermal_meter[0] >= (u8)tmp_reg) { - tmp_ofdm_index = tmpCCK20Mindex = 6+(priv->thermal_meter[0] - + tmp_ofdm_index = tmp_cck_20m_index = 6+(priv->thermal_meter[0] - (u8)tmp_reg); - tmpCCK40Mindex = tmpCCK20Mindex - 6; + tmp_cck_40m_index = tmp_cck_20m_index - 6; if (tmp_ofdm_index >= OFDM_TABLE_LEN) tmp_ofdm_index = OFDM_TABLE_LEN - 1; - if (tmpCCK20Mindex >= CCK_TABLE_LEN) - tmpCCK20Mindex = CCK_TABLE_LEN - 1; - if (tmpCCK40Mindex >= CCK_TABLE_LEN) - tmpCCK40Mindex = CCK_TABLE_LEN - 1; + if (tmp_cck_20m_index >= CCK_TABLE_LEN) + tmp_cck_20m_index = CCK_TABLE_LEN - 1; + if (tmp_cck_40m_index >= CCK_TABLE_LEN) + tmp_cck_40m_index = CCK_TABLE_LEN - 1; } else { tmpval = (u8)tmp_reg - priv->thermal_meter[0]; if (tmpval >= 6) { tmp_ofdm_index = 0; - tmpCCK20Mindex = 0; + tmp_cck_20m_index = 0; } else { tmp_ofdm_index = 6 - tmpval; - tmpCCK20Mindex = 6 - tmpval; + tmp_cck_20m_index = 6 - tmpval; } - tmpCCK40Mindex = 0; + tmp_cck_40m_index = 0; } if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - tmp_cck_index = tmpCCK40Mindex; + tmp_cck_index = tmp_cck_40m_index; else - tmp_cck_index = tmpCCK20Mindex; + tmp_cck_index = tmp_cck_20m_index; - priv->rec_cck_20m_idx = tmpCCK20Mindex; - priv->rec_cck_40m_idx = tmpCCK40Mindex; + priv->rec_cck_20m_idx = tmp_cck_20m_index; + priv->rec_cck_40m_idx = tmp_cck_40m_index; if (priv->rtllib->current_network.channel == 14 && !priv->bcck_in_ch14) { From 1f3413dc8eb0de023c5ec5994aef8225262d0f19 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Wed, 10 May 2023 20:40:04 +0530 Subject: [PATCH 12/62] staging: rtl8192e: Refactor tmp_ofdm_index variable assignment Refactor tmp_ofdm_index variable assignment to avoid multiple assignments which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/af7bc22ec142c33cf7346c1ab13d192b55095d1e.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index a44be3f810ab..feac50cd8fa0 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -689,8 +689,8 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) priv->thermal_meter[1] = ThermalMeterVal; if (priv->thermal_meter[0] >= (u8)tmp_reg) { - tmp_ofdm_index = tmp_cck_20m_index = 6+(priv->thermal_meter[0] - - (u8)tmp_reg); + tmp_ofdm_index = 6 + (priv->thermal_meter[0] - (u8)tmp_reg); + tmp_cck_20m_index = tmp_ofdm_index; tmp_cck_40m_index = tmp_cck_20m_index - 6; if (tmp_ofdm_index >= OFDM_TABLE_LEN) tmp_ofdm_index = OFDM_TABLE_LEN - 1; From da812f15af4f9e0096f8932178e9192fcb0329d3 Mon Sep 17 00:00:00 2001 From: Niklas Schnelle Date: Mon, 22 May 2023 12:50:39 +0200 Subject: [PATCH 13/62] staging: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-35-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/Kconfig | 2 +- drivers/staging/vt6655/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig index 1461c89701c3..ab3d9b057d56 100644 --- a/drivers/staging/sm750fb/Kconfig +++ b/drivers/staging/sm750fb/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 config FB_SM750 tristate "Silicon Motion SM750 framebuffer support" - depends on FB && PCI + depends on FB && PCI && HAS_IOPORT select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA diff --git a/drivers/staging/vt6655/Kconfig b/drivers/staging/vt6655/Kconfig index d1cd5de46dcf..077f62ebe80c 100644 --- a/drivers/staging/vt6655/Kconfig +++ b/drivers/staging/vt6655/Kconfig @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 config VT6655 tristate "VIA Technologies VT6655 support" - depends on PCI && MAC80211 && m + depends on PCI && HAS_IOPORT && MAC80211 && m help This is a vendor-written driver for VIA VT6655. From a634e894981abbfec0ce3981803fb95a641b9aef Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:08:43 +0200 Subject: [PATCH 14/62] staging: rtl8192e: Remove undefined function data_hard_stop Remove function data_hard_stop as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4cc180b9538d6c9c32ff0f56646a642fa217a4a4.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 6 ------ drivers/staging/rtl8192e/rtllib_softmac.c | 5 ----- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 3 --- 3 files changed, 14 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index d5f5ea5615fc..b356cde80f84 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1682,12 +1682,6 @@ struct rtllib_device { void (*softmac_data_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev, int rate); - /* stops the HW queue for DATA frames. Useful to avoid - * waste time to TX data frame when we are reassociating - * This function can sleep. - */ - void (*data_hard_stop)(struct net_device *dev); - /* OK this is complementing to data_poll_hard_stop */ void (*data_hard_resume)(struct net_device *dev); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 1ca77cdbafa3..65eecbc94b93 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1575,9 +1575,6 @@ static void rtllib_associate_procedure_wq(void *data) ieee->rtllib_ips_leave(ieee->dev); mutex_lock(&ieee->wx_mutex); - if (ieee->data_hard_stop) - ieee->data_hard_stop(ieee->dev); - rtllib_stop_scan(ieee); HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); if (ieee->rf_power_state == rf_off) { @@ -2734,8 +2731,6 @@ void rtllib_disassociate(struct rtllib_device *ieee) if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) rtllib_reset_queue(ieee); - if (ieee->data_hard_stop) - ieee->data_hard_stop(ieee->dev); if (IS_DOT11D_ENABLE(ieee)) dot11d_reset(ieee); ieee->state = RTLLIB_NOLINK; diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 1f2fa711e60b..d7166d6772df 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -345,9 +345,6 @@ void rtllib_wx_sync_scan_wq(void *data) rtllib_sta_ps_send_null_frame(ieee, 1); rtllib_stop_all_queues(ieee); - - if (ieee->data_hard_stop) - ieee->data_hard_stop(ieee->dev); rtllib_stop_send_beacons(ieee); ieee->state = RTLLIB_LINKED_SCANNING; ieee->link_change(ieee->dev); From 27b644c575287ce815eb3decab538aad47f762a4 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:08:50 +0200 Subject: [PATCH 15/62] staging: rtl8192e: Remove undefined function data_hard_resume Remove function data_hard_resume as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/07048d775759fffe1d1c63d0416214da8311129a.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 3 --- drivers/staging/rtl8192e/rtllib_softmac.c | 18 +----------------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 10 +--------- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index b356cde80f84..9b49a15de889 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1682,9 +1682,6 @@ struct rtllib_device { void (*softmac_data_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev, int rate); - /* OK this is complementing to data_poll_hard_stop */ - void (*data_hard_resume)(struct net_device *dev); - /* ask to the driver to retune the radio. * This function can sleep. the driver should ensure * the radio has been switched before return. diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 65eecbc94b93..fe36a52b4c91 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1546,10 +1546,6 @@ static void rtllib_associate_complete_wq(void *data) netdev_info(ieee->dev, "silent reset associate\n"); ieee->is_silent_reset = false; } - - if (ieee->data_hard_resume) - ieee->data_hard_resume(ieee->dev); - } static void rtllib_sta_send_associnfo(struct rtllib_device *ieee) @@ -2534,22 +2530,14 @@ static void rtllib_start_master_bss(struct rtllib_device *ieee) ieee->state = RTLLIB_LINKED; ieee->link_change(ieee->dev); notify_wx_assoc_event(ieee); - - if (ieee->data_hard_resume) - ieee->data_hard_resume(ieee->dev); - netif_carrier_on(ieee->dev); } static void rtllib_start_monitor_mode(struct rtllib_device *ieee) { /* reset hardware status */ - if (ieee->raw_tx) { - if (ieee->data_hard_resume) - ieee->data_hard_resume(ieee->dev); - + if (ieee->raw_tx) netif_carrier_on(ieee->dev); - } } static void rtllib_start_ibss_wq(void *data) @@ -2674,10 +2662,6 @@ static void rtllib_start_ibss_wq(void *data) rtllib_start_send_beacons(ieee); notify_wx_assoc_event(ieee); - - if (ieee->data_hard_resume) - ieee->data_hard_resume(ieee->dev); - netif_carrier_on(ieee->dev); mutex_unlock(&ieee->wx_mutex); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d7166d6772df..371864f0087f 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -389,10 +389,6 @@ void rtllib_wx_sync_scan_wq(void *data) ieee->link_detect_info.NumRecvBcnInPeriod = 1; ieee->link_detect_info.NumRecvDataInPeriod = 1; } - - if (ieee->data_hard_resume) - ieee->data_hard_resume(ieee->dev); - if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) rtllib_start_send_beacons(ieee); @@ -505,12 +501,8 @@ int rtllib_wx_set_rawtx(struct rtllib_device *ieee, ieee->raw_tx ? "enabled" : "disabled"); if (ieee->iw_mode == IW_MODE_MONITOR) { - if (prev == 0 && ieee->raw_tx) { - if (ieee->data_hard_resume) - ieee->data_hard_resume(ieee->dev); - + if (prev == 0 && ieee->raw_tx) netif_carrier_on(ieee->dev); - } if (prev && ieee->raw_tx == 1) netif_carrier_off(ieee->dev); From 03477a4641373c4496a2e93f5f45e3fb5fc6d6c8 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:08:56 +0200 Subject: [PATCH 16/62] staging: rtl8192e: Remove functions rtllib_start_hw_scan and stop Remove functions rtllib_start_hw_scan and rtllib_stop_hw_scan as they are not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/868524470321b8936f63d3ea06ba86c34fc89bb7.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 3 --- drivers/staging/rtl8192e/rtllib_softmac.c | 21 +++------------------ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 9b49a15de889..aac71fda4541 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1688,9 +1688,6 @@ struct rtllib_device { */ void (*set_chan)(struct net_device *dev, short ch); - void (*rtllib_start_hw_scan)(struct net_device *dev); - void (*rtllib_stop_hw_scan)(struct net_device *dev); - /* indicate the driver that the link state is changed * for example it may indicate the card is associated now. * Driver might be interested in this to apply RX filter diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index fe36a52b4c91..bb28414b88bc 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -691,23 +691,15 @@ static void rtllib_softmac_stop_scan(struct rtllib_device *ieee) void rtllib_stop_scan(struct rtllib_device *ieee) { - if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { + if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) rtllib_softmac_stop_scan(ieee); - } else { - if (ieee->rtllib_stop_hw_scan) - ieee->rtllib_stop_hw_scan(ieee->dev); - } } EXPORT_SYMBOL(rtllib_stop_scan); void rtllib_stop_scan_syncro(struct rtllib_device *ieee) { - if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { + if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) ieee->sync_scan_hurryup = 1; - } else { - if (ieee->rtllib_stop_hw_scan) - ieee->rtllib_stop_hw_scan(ieee->dev); - } } EXPORT_SYMBOL(rtllib_stop_scan_syncro); @@ -739,9 +731,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee) ieee->scanning_continue = 1; schedule_delayed_work(&ieee->softmac_scan_wq, 0); } - } else { - if (ieee->rtllib_start_hw_scan) - ieee->rtllib_start_hw_scan(ieee->dev); } } @@ -753,12 +742,8 @@ void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) RESET_CIE_WATCHDOG(ieee); } ieee->sync_scan_hurryup = 0; - if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { + if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) rtllib_softmac_scan_syncro(ieee, is_mesh); - } else { - if (ieee->rtllib_start_hw_scan) - ieee->rtllib_start_hw_scan(ieee->dev); - } } EXPORT_SYMBOL(rtllib_start_scan_syncro); From 42618f6fbde5212b3b6d378e2419d691f7912605 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:09:03 +0200 Subject: [PATCH 17/62] staging: rtl8192e: Remove undefined function reset_port Remove function reset_port as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/faa1fa979b214f709012a8bd65debbcc2bb59049.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 2 -- drivers/staging/rtl8192e/rtllib_wx.c | 19 ------------------- 2 files changed, 21 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index aac71fda4541..cc4247ebea6b 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1661,8 +1661,6 @@ struct rtllib_device { int (*hard_start_xmit)(struct rtllib_txb *txb, struct net_device *dev); - int (*reset_port)(struct net_device *dev); - /* Softmac-generated frames (management) are TXed via this * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is * not set. As some cards may have different HW queues that diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index d6691f3c7c70..1876ff75c31c 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -420,18 +420,6 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, if (ieee->set_security) ieee->set_security(dev, &sec); - /* Do not reset port if card is in Managed mode since resetting will - * generate new IEEE 802.11 authentication which may end up in looping - * with IEEE 802.1X. If your hardware requires a reset after WEP - * configuration (for example... Prism2), implement the reset_port in - * the callbacks structures used to initialize the 802.11 stack. - */ - if (ieee->reset_on_keychange && - ieee->iw_mode != IW_MODE_INFRA && - ieee->reset_port && ieee->reset_port(dev)) { - netdev_dbg(dev, "%s: reset_port failed\n", dev->name); - return -EINVAL; - } return 0; } EXPORT_SYMBOL(rtllib_wx_set_encode); @@ -625,13 +613,6 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, done: if (ieee->set_security) ieee->set_security(ieee->dev, &sec); - - if (ieee->reset_on_keychange && - ieee->iw_mode != IW_MODE_INFRA && - ieee->reset_port && ieee->reset_port(dev)) { - netdev_dbg(ieee->dev, "Port reset failed\n"); - return -EINVAL; - } return ret; } EXPORT_SYMBOL(rtllib_wx_set_encode_ext); From ab2f13f29038a42528de55d45e06e98c36083246 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:09:09 +0200 Subject: [PATCH 18/62] staging: rtl8192e: Remove undefined function hard_start_xmit Remove function hard_start_xmit as it is not defined. Equation !ieee->hard_start_xmit always evaluates to true. When (*ieee->hard_start_xmit)(txb, dev) == 0 is called the my computer is freezing. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/603a143ba506ca031d7bd70a844b9f080872d601.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 7 ------- drivers/staging/rtl8192e/rtllib_tx.c | 8 +------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index cc4247ebea6b..7be02cfe56fe 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1654,13 +1654,6 @@ struct rtllib_device { void (*set_security)(struct net_device *dev, struct rtllib_security *sec); - /* Used to TX data frame by using txb structs. - * this is not used if in the softmac_features - * is set the flag IEEE_SOFTMAC_TX_QUEUE - */ - int (*hard_start_xmit)(struct rtllib_txb *txb, - struct net_device *dev); - /* Softmac-generated frames (management) are TXed via this * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is * not set. As some cards may have different HW queues that diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index 54119fba8a57..c3f1910d9f58 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -572,8 +572,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) /* If there is no driver handler to take the TXB, don't bother * creating it... */ - if ((!ieee->hard_start_xmit && !(ieee->softmac_features & - IEEE_SOFTMAC_TX_QUEUE)) || + if (!(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) || ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) { netdev_warn(ieee->dev, "No xmit handler.\n"); @@ -938,11 +937,6 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) dev->stats.tx_bytes += le16_to_cpu(txb->payload_size); rtllib_softmac_xmit(txb, ieee); } else { - if ((*ieee->hard_start_xmit)(txb, dev) == 0) { - stats->tx_packets++; - stats->tx_bytes += le16_to_cpu(txb->payload_size); - return 0; - } rtllib_txb_free(txb); } } From ccffcebb7783ddd3cc9b6791bcc79c5eb64b8bb3 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:09:17 +0200 Subject: [PATCH 19/62] staging: rtl8192e: Remove undefined function set_security Remove function set_security as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/bdc9bc3a70ca2b5d86bdd2cb5c815d0b3c67972f.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 2 -- drivers/staging/rtl8192e/rtllib_wx.c | 6 ------ 2 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 7be02cfe56fe..cc1ce106678c 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1651,8 +1651,6 @@ struct rtllib_device { }; /* Callback functions */ - void (*set_security)(struct net_device *dev, - struct rtllib_security *sec); /* Softmac-generated frames (management) are TXed via this * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 1876ff75c31c..82b537da8b21 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -416,10 +416,6 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, */ sec.flags |= SEC_LEVEL; sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */ - - if (ieee->set_security) - ieee->set_security(dev, &sec); - return 0; } EXPORT_SYMBOL(rtllib_wx_set_encode); @@ -611,8 +607,6 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, sec.flags &= ~SEC_LEVEL; } done: - if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); return ret; } EXPORT_SYMBOL(rtllib_wx_set_encode_ext); From 4e2ae4fffd96f0e1aa31988a8ae4d0ca93cd64f1 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:09:23 +0200 Subject: [PATCH 20/62] staging: rtl8192e: Remove undefined function SetFwCmdHandler Remove function SetFwCmdHandler as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e141f44176aab38e11d7211ed79cebda68aea5ed.1683960685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 13 +++---------- drivers/staging/rtl8192e/rtllib.h | 2 -- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index b58a30d68f2f..3f8a58e32930 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -734,7 +734,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->SetHwRegHandler = rtl92e_set_reg; priv->rtllib->AllowAllDestAddrHandler = rtl92e_set_monitor_mode; - priv->rtllib->SetFwCmdHandler = NULL; priv->rtllib->InitialGainHandler = rtl92e_init_gain; priv->rtllib->rtllib_ips_leave_wq = rtl92e_rtllib_ips_leave_wq; priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c index 5a1cd22f5e25..54a21c14cc75 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c @@ -217,12 +217,8 @@ void rtl92e_leisure_ps_enter(struct net_device *dev) if (psc->bLeisurePs) { if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) { - if (priv->rtllib->ps == RTLLIB_PS_DISABLED) { - if (priv->rtllib->SetFwCmdHandler) - priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER); - _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | - RTLLIB_PS_UNICAST); - } + if (priv->rtllib->ps == RTLLIB_PS_DISABLED) + _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | RTLLIB_PS_UNICAST); } else psc->LpsIdleCount++; } @@ -235,10 +231,7 @@ void rtl92e_leisure_ps_leave(struct net_device *dev) &priv->rtllib->pwr_save_ctrl; if (psc->bLeisurePs) { - if (priv->rtllib->ps != RTLLIB_PS_DISABLED) { + if (priv->rtllib->ps != RTLLIB_PS_DISABLED) _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED); - if (priv->rtllib->SetFwCmdHandler) - priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE); - } } } diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index cc1ce106678c..6c1f56324bd6 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1714,8 +1714,6 @@ struct rtllib_device { bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); void (*InitialGainHandler)(struct net_device *dev, u8 Operation); - bool (*SetFwCmdHandler)(struct net_device *dev, - enum fw_cmd_io_type FwCmdIO); void (*UpdateBeaconInterruptHandler)(struct net_device *dev, bool start); void (*ScanOperationBackupHandler)(struct net_device *dev, From b17bbcfbf3c80650a8e4e51389e00c4a3d9a6367 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:09:34 +0200 Subject: [PATCH 21/62] staging: rtl8192e: Remove undefined function UpdateBeaconInterruptHandler Remove function UpdateBeaconInterruptHandler as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7cc71096fb1e6fee755dd96de0095ef1fb6d51e1.1683960685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 -- drivers/staging/rtl8192e/rtllib.h | 2 -- drivers/staging/rtl8192e/rtllib_softmac.c | 6 ------ 3 files changed, 10 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 3f8a58e32930..5fdee7b54f24 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -739,8 +739,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave; priv->rtllib->LedControlHandler = NULL; - priv->rtllib->UpdateBeaconInterruptHandler = NULL; - priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup; } diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 6c1f56324bd6..8bafee31e50c 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1714,8 +1714,6 @@ struct rtllib_device { bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); void (*InitialGainHandler)(struct net_device *dev, u8 Operation); - void (*UpdateBeaconInterruptHandler)(struct net_device *dev, - bool start); void (*ScanOperationBackupHandler)(struct net_device *dev, u8 Operation); void (*LedControlHandler)(struct net_device *dev, diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index bb28414b88bc..1fe0675033cb 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -2882,9 +2882,6 @@ void rtllib_start_protocol(struct rtllib_device *ieee) ieee->last_packet_time[i] = 0; } - if (ieee->UpdateBeaconInterruptHandler) - ieee->UpdateBeaconInterruptHandler(ieee->dev, false); - ieee->wmm_acm = 0; /* if the user set the MAC of the ad-hoc cell and then * switch to managed mode, shall we make sure that association @@ -2894,9 +2891,6 @@ void rtllib_start_protocol(struct rtllib_device *ieee) if (ieee->iw_mode == IW_MODE_INFRA) { rtllib_start_bss(ieee); } else if (ieee->iw_mode == IW_MODE_ADHOC) { - if (ieee->UpdateBeaconInterruptHandler) - ieee->UpdateBeaconInterruptHandler(ieee->dev, true); - rtllib_start_ibss(ieee); } else if (ieee->iw_mode == IW_MODE_MASTER) { From 09201af57ca4d98a992413b39d51aa1f70beb98c Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 13 May 2023 20:09:40 +0200 Subject: [PATCH 22/62] staging: rtl8192e: Remove undefined function LedControlHandler Remove function LedControlHandler as it is not defined. Remove resulting unused local variables bLedBlinking, type, fc and LedAction. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e3c29c3db33d314dffb673f8e563da0fb1f2b22f.1683960685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 4 --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 26 ------------------- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 4 --- drivers/staging/rtl8192e/rtllib.h | 2 -- drivers/staging/rtl8192e/rtllib_softmac.c | 10 ------- 5 files changed, 46 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index c612e31d1a84..d9d056d18fa3 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -46,7 +46,6 @@ static void _rtl92e_update_msr(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); u8 msr; - enum led_ctl_mode LedAction = LED_CTL_NO_LINK; msr = rtl92e_readb(dev, MSR); msr &= ~MSR_LINK_MASK; @@ -55,7 +54,6 @@ static void _rtl92e_update_msr(struct net_device *dev) case IW_MODE_INFRA: if (priv->rtllib->state == RTLLIB_LINKED) msr |= MSR_LINK_MANAGED; - LedAction = LED_CTL_LINK; break; case IW_MODE_ADHOC: if (priv->rtllib->state == RTLLIB_LINKED) @@ -70,8 +68,6 @@ static void _rtl92e_update_msr(struct net_device *dev) } rtl92e_writeb(dev, MSR, msr); - if (priv->rtllib->LedControlHandler) - priv->rtllib->LedControlHandler(dev, LedAction); } void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 5fdee7b54f24..17b70dde7eeb 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -737,8 +737,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->InitialGainHandler = rtl92e_init_gain; priv->rtllib->rtllib_ips_leave_wq = rtl92e_rtllib_ips_leave_wq; priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave; - - priv->rtllib->LedControlHandler = NULL; priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup; } @@ -1272,10 +1270,6 @@ static void _rtl92e_watchdog_wq_cb(void *data) ieee->is_roaming = true; ieee->is_set_key = false; ieee->link_change(dev); - if (ieee->LedControlHandler) - ieee->LedControlHandler(ieee->dev, - LED_CTL_START_TO_LINK); - notify_wx_assoc_event(ieee); if (!(ieee->rtllib_ap_sec_type(ieee) & @@ -1506,7 +1500,6 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb) MAX_DEV_ADDR_SIZE); struct tx_desc *pdesc = NULL; struct rtllib_hdr_1addr *header = NULL; - u16 fc = 0, type = 0; u8 *pda_addr = NULL; int idx; u32 fwinfo_size = 0; @@ -1522,8 +1515,6 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb) fwinfo_size = sizeof(struct tx_fwinfo_8190pci); header = (struct rtllib_hdr_1addr *)(((u8 *)skb->data) + fwinfo_size); - fc = le16_to_cpu(header->frame_ctl); - type = WLAN_FC_GET_TYPE(fc); pda_addr = header->addr1; if (!is_broadcast_ether_addr(pda_addr) && !is_multicast_ether_addr(pda_addr)) @@ -1545,11 +1536,6 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb) spin_unlock_irqrestore(&priv->irq_th_lock, flags); return skb->len; } - - if (type == RTLLIB_FTYPE_DATA) { - if (priv->rtllib->LedControlHandler) - priv->rtllib->LedControlHandler(dev, LED_CTL_TX); - } rtl92e_fill_tx_desc(dev, pdesc, tcb_desc, skb); __skb_queue_tail(&ring->queue, skb); pdesc->OWN = 1; @@ -1776,8 +1762,6 @@ static void _rtl92e_rx_normal(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); struct rtllib_hdr_1addr *rtllib_hdr = NULL; bool unicast_packet = false; - bool bLedBlinking = true; - u16 fc = 0, type = 0; u32 skb_len = 0; int rx_queue_idx = RX_MPDU_QUEUE; @@ -1821,16 +1805,6 @@ static void _rtl92e_rx_normal(struct net_device *dev) /* unicast packet */ unicast_packet = true; } - fc = le16_to_cpu(rtllib_hdr->frame_ctl); - type = WLAN_FC_GET_TYPE(fc); - if (type == RTLLIB_FTYPE_MGMT) - bLedBlinking = false; - - if (bLedBlinking) - if (priv->rtllib->LedControlHandler) - priv->rtllib->LedControlHandler(dev, - LED_CTL_RX); - skb_len = skb->len; if (!rtllib_rx(priv->rtllib, skb, &stats)) { diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 0bb657fda06c..8b656980ee25 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -421,10 +421,6 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, mutex_unlock(&priv->rtllib->ips_mutex); } rtllib_stop_scan(priv->rtllib); - if (priv->rtllib->LedControlHandler) - priv->rtllib->LedControlHandler(dev, - LED_CTL_SITE_SURVEY); - if (priv->rtllib->rf_power_state != rf_off) { priv->rtllib->actscanning = true; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 8bafee31e50c..4aa5ce9f7792 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1716,8 +1716,6 @@ struct rtllib_device { void (*InitialGainHandler)(struct net_device *dev, u8 Operation); void (*ScanOperationBackupHandler)(struct net_device *dev, u8 Operation); - void (*LedControlHandler)(struct net_device *dev, - enum led_ctl_mode LedAction); void (*SetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val); void (*AllowAllDestAddrHandler)(struct net_device *dev, diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 1fe0675033cb..18885cda60f6 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1680,9 +1680,6 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, false; ieee->state = RTLLIB_ASSOCIATING; - if (ieee->LedControlHandler != NULL) - ieee->LedControlHandler(ieee->dev, - LED_CTL_START_TO_LINK); schedule_delayed_work( &ieee->associate_procedure_wq, 0); } else { @@ -2343,10 +2340,6 @@ rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) ieee->link_detect_info.bBusyTraffic = false; rtllib_disassociate(ieee); RemovePeerTS(ieee, header->addr2); - if (ieee->LedControlHandler != NULL) - ieee->LedControlHandler(ieee->dev, - LED_CTL_START_TO_LINK); - if (!(ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_CCMP|SEC_ALG_TKIP))) schedule_delayed_work( @@ -2641,9 +2634,6 @@ static void rtllib_start_ibss_wq(void *data) ieee->link_change(ieee->dev); HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); - if (ieee->LedControlHandler != NULL) - ieee->LedControlHandler(ieee->dev, LED_CTL_LINK); - rtllib_start_send_beacons(ieee); notify_wx_assoc_event(ieee); From dffef6de4db2ddbf1d456e618d06b128b9d0018b Mon Sep 17 00:00:00 2001 From: Atin Bainada Date: Sat, 13 May 2023 21:44:31 +0000 Subject: [PATCH 23/62] staging: rtl8723bs: replace ternary operator with if-else block replace the ternary operator used for assignment of pHalData->ant_path with an if-else block for better readability Signed-off-by: Atin Bainada Link: https://lore.kernel.org/r/20230513214338.79833-1-hi@atinb.me Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index c3c1b49674d3..1e9e1089032b 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -2275,7 +2275,10 @@ void Hal_EfuseParseBTCoexistInfo_8723B( pHalData->EEPROMBluetoothAntNum = tempval & BIT(0); /* EFUSE_0xC3[6] == 0, S1(Main)-RF_PATH_A; */ /* EFUSE_0xC3[6] == 1, S0(Aux)-RF_PATH_B */ - pHalData->ant_path = (tempval & BIT(6))? RF_PATH_B : RF_PATH_A; + if (tempval & BIT(6)) + pHalData->ant_path = RF_PATH_B; + else + pHalData->ant_path = RF_PATH_A; } else { pHalData->EEPROMBluetoothAntNum = Ant_x1; if (pHalData->PackageType == PACKAGE_QFN68) From 35a70c0305f5e0805006b91a995610ef881e2091 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sun, 14 May 2023 22:40:33 +0200 Subject: [PATCH 24/62] staging: rtl8192e: Exclude scan_mutex in rtllib_softmac_stop_scan Exclude scan_mutex from cancel_delayed_work_sync(&ieee->softmac_scan_wq) as ieee->softmac_scan_wq takes scan_mutex as well. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230514204033.GA20187@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 18885cda60f6..cb2dd18fa14b 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -682,11 +682,11 @@ static void rtllib_softmac_stop_scan(struct rtllib_device *ieee) if (ieee->scanning_continue == 1) { ieee->scanning_continue = 0; ieee->actscanning = false; - + mutex_unlock(&ieee->scan_mutex); cancel_delayed_work_sync(&ieee->softmac_scan_wq); + } else { + mutex_unlock(&ieee->scan_mutex); } - - mutex_unlock(&ieee->scan_mutex); } void rtllib_stop_scan(struct rtllib_device *ieee) From 2305232c94d2fcefa9e26ba68af73586508ba555 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Tue, 16 May 2023 21:22:06 +0200 Subject: [PATCH 25/62] staging: rtl8192e: Unlock wx_mutex not in rtllib_wx_set_scan On start of rtllib_wx_set_scan lock was taken with mutex_lock(&ieee->wx_mutex). Unlocking was done at the end of schedule_work(&ieee->wx_sync_scan_wq) which lead to the error "lock held when returning to user space!". Pushing lock to beginning of ieee->wx_sync_scan_wq to improve overview. Removed lock from rtllib_wx_set_scan as ieee->state, ieee->iw_mode and ieee->proto_started are not protected in many other places. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230516192206.GA7710@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 371864f0087f..e93da95f175b 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -332,6 +332,7 @@ void rtllib_wx_sync_scan_wq(void *data) enum ht_channel_width bandwidth = 0; int b40M = 0; + mutex_lock(&ieee->wx_mutex); if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { rtllib_start_scan_syncro(ieee, 0); goto out; @@ -404,8 +405,6 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, { int ret = 0; - mutex_lock(&ieee->wx_mutex); - if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)) { ret = -1; goto out; @@ -418,7 +417,6 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, } out: - mutex_unlock(&ieee->wx_mutex); return ret; } EXPORT_SYMBOL(rtllib_wx_set_scan); From 8942c3f19b3f6cbe5b74ee610d6b5e3ec1ec13fa Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Thu, 18 May 2023 18:32:01 +0200 Subject: [PATCH 26/62] staging: rtl8192e: add missing spaces around operators Add missing spaces around operators to improve readability and clear checkpatch issues. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20230518163201.14463-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../rtl8192e/rtl8192e/r8190P_rtl8256.c | 6 +-- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 54 +++++++++---------- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 24 ++++----- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 50 ++++++++--------- drivers/staging/rtl8192e/rtllib_softmac.c | 50 ++++++++--------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 +- 6 files changed, 94 insertions(+), 94 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c index bb4539e337c8..7061f1cf4d3a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c @@ -73,11 +73,11 @@ bool rtl92e_config_rf(struct net_device *dev) break; case RF90_PATH_B: u4RegValue = rtl92e_get_bb_reg(dev, pPhyReg->rfintfs, - bRFSI_RFENV<<16); + bRFSI_RFENV << 16); break; } - rtl92e_set_bb_reg(dev, pPhyReg->rfintfe, bRFSI_RFENV<<16, 0x1); + rtl92e_set_bb_reg(dev, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1); rtl92e_set_bb_reg(dev, pPhyReg->rfintfo, bRFSI_RFENV, 0x1); @@ -117,7 +117,7 @@ bool rtl92e_config_rf(struct net_device *dev) break; case RF90_PATH_B: rtl92e_set_bb_reg(dev, pPhyReg->rfintfs, - bRFSI_RFENV<<16, u4RegValue); + bRFSI_RFENV << 16, u4RegValue); break; } diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index d9d056d18fa3..f9b6c3069b30 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -36,8 +36,8 @@ void rtl92e_start_beacon(struct net_device *dev) rtl92e_writeb(dev, BCN_ERR_THRESH, 100); - BcnTimeCfg |= BcnCW<rtllib->current_network.qos_data.parameters; u1bAIFS = qop->aifs[pAcParam] * - ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime; + ((mode & (IEEE_G | IEEE_N_24G)) ? 9 : 20) + aSifsTime; rtl92e_dm_init_edca_turbo(dev); @@ -252,7 +252,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) case HW_VAR_SIFS: rtl92e_writeb(dev, SIFS, val[0]); - rtl92e_writeb(dev, SIFS+1, val[0]); + rtl92e_writeb(dev, SIFS + 1, val[0]); break; case HW_VAR_RF_TIMING: @@ -295,12 +295,12 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) (EEPROM_Customer_ID >> 1)) >> 8; priv->eeprom_customer_id = usValue & 0xff; usValue = rtl92e_eeprom_read(dev, - EEPROM_ICVersion_ChannelPlan>>1); - priv->eeprom_chnl_plan = usValue&0xff; - IC_Version = (usValue & 0xff00)>>8; + EEPROM_ICVersion_ChannelPlan >> 1); + priv->eeprom_chnl_plan = usValue & 0xff; + IC_Version = (usValue & 0xff00) >> 8; ICVer8192 = IC_Version & 0xf; - ICVer8256 = (IC_Version & 0xf0)>>4; + ICVer8256 = (IC_Version & 0xf0) >> 4; if (ICVer8192 == 0x2) { if (ICVer8256 == 0x5) priv->card_8192_version = VERSION_8190_BE; @@ -350,7 +350,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) if (!priv->autoload_fail_flag) priv->eeprom_thermal_meter = ((rtl92e_eeprom_read(dev, - (EEPROM_ThermalMeter>>1))) & + (EEPROM_ThermalMeter >> 1))) & 0xff00) >> 8; else priv->eeprom_thermal_meter = EEPROM_Default_ThermalMeter; @@ -592,7 +592,7 @@ start: RSVD_FW_QUEUE_PAGE_MGNT_SHIFT); rtl92e_writel(dev, RQPN3, APPLIED_RESERVED_QUEUE_IN_FW | NUM_OF_PAGE_IN_FW_QUEUE_BCN << - RSVD_FW_QUEUE_PAGE_BCN_SHIFT| + RSVD_FW_QUEUE_PAGE_BCN_SHIFT | NUM_OF_PAGE_IN_FW_QUEUE_PUB << RSVD_FW_QUEUE_PAGE_PUB_SHIFT); @@ -601,7 +601,7 @@ start: ulRegRead = (0xFFF00000 & rtl92e_readl(dev, RRSR)) | RATE_ALL_OFDM_AG | RATE_ALL_CCK; rtl92e_writel(dev, RRSR, ulRegRead); - rtl92e_writel(dev, RATR0+4*7, (RATE_ALL_OFDM_AG | RATE_ALL_CCK)); + rtl92e_writel(dev, RATR0 + 4 * 7, (RATE_ALL_OFDM_AG | RATE_ALL_CCK)); rtl92e_writeb(dev, ACK_TIMEOUT, 0x30); @@ -734,8 +734,8 @@ static void _rtl92e_net_update(struct net_device *dev) rtl92e_writew(dev, BCN_DRV_EARLY_INT, 10); rtl92e_writeb(dev, BCN_ERR_THRESH, 100); - BcnTimeCfg |= (BcnCW<RtsEnable = (cb_desc->bRTSEnable) ? 1 : 0; pTxFwInfo->CtsEnable = (cb_desc->bCTSEnable) ? 1 : 0; pTxFwInfo->RtsSTBC = (cb_desc->bRTSSTBC) ? 1 : 0; - pTxFwInfo->RtsHT = (cb_desc->rts_rate&0x80) ? 1 : 0; + pTxFwInfo->RtsHT = (cb_desc->rts_rate & 0x80) ? 1 : 0; pTxFwInfo->RtsRate = _rtl92e_rate_mgn_to_hw(cb_desc->rts_rate); pTxFwInfo->RtsBandwidth = 0; pTxFwInfo->RtsSubcarrier = cb_desc->RTSSC; @@ -1341,7 +1341,7 @@ static void _rtl92e_query_rxphystatus( else if (pcck_buf->sq_rpt < 20) sq = 100; else - sq = ((64-sq) * 100) / 44; + sq = ((64 - sq) * 100) / 44; } pstats->SignalQuality = sq; precord_stats->SignalQuality = sq; @@ -1448,7 +1448,7 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer, if (slide_rssi_index >= PHY_RSSI_SLID_WIN_MAX) slide_rssi_index = 0; - tmp_val = priv->stats.slide_rssi_total/slide_rssi_statistics; + tmp_val = priv->stats.slide_rssi_total / slide_rssi_statistics; priv->stats.signal_strength = rtl92e_translate_to_dbm(priv, tmp_val); curr_st->rssi = priv->stats.signal_strength; if (!prev_st->bPacketMatchBSSID) { @@ -1478,7 +1478,7 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer, } else { priv->stats.rx_rssi_percentage[rfpath] = ((priv->stats.rx_rssi_percentage[rfpath] * - (RX_SMOOTH-1)) + + (RX_SMOOTH - 1)) + (prev_st->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH); } @@ -1513,14 +1513,14 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer, if (prev_st->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) { priv->undecorated_smoothed_pwdb = (((priv->undecorated_smoothed_pwdb) * - (RX_SMOOTH-1)) + + (RX_SMOOTH - 1)) + (prev_st->RxPWDBAll)) / (RX_SMOOTH); priv->undecorated_smoothed_pwdb = priv->undecorated_smoothed_pwdb + 1; } else { priv->undecorated_smoothed_pwdb = (((priv->undecorated_smoothed_pwdb) * - (RX_SMOOTH-1)) + + (RX_SMOOTH - 1)) + (prev_st->RxPWDBAll)) / (RX_SMOOTH); } rtl92e_update_rx_statistics(priv, prev_st); @@ -1749,7 +1749,7 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats, (pDrvInfo->FirstAGGR == 1); stats->TimeStampLow = pDrvInfo->TSFL; - stats->TimeStampHigh = rtl92e_readl(dev, TSFR+4); + stats->TimeStampHigh = rtl92e_readl(dev, TSFR + 4); rtl92e_update_rx_pkt_timestamp(dev, stats); @@ -1762,7 +1762,7 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats, skb_trim(skb, skb->len - S_CRC_LEN); - stats->packetlength = stats->Length-4; + stats->packetlength = stats->Length - 4; stats->fraglength = stats->packetlength; stats->fragoffset = 0; stats->ntotalfrag = 1; @@ -1833,7 +1833,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) ratr_value &= 0x0000000F; break; case IEEE_G: - case IEEE_G|IEEE_B: + case IEEE_G | IEEE_B: ratr_value &= 0x00000FF7; break; case IEEE_N_24G: @@ -1853,7 +1853,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) else if (!ieee->ht_info->cur_tx_bw40mhz && ieee->ht_info->bCurShortGI20MHz) ratr_value |= 0x80000000; - rtl92e_writel(dev, RATR0+rate_index*4, ratr_value); + rtl92e_writel(dev, RATR0 + rate_index * 4, ratr_value); rtl92e_writeb(dev, UFWP, 1); } @@ -1877,7 +1877,7 @@ rtl92e_init_variables(struct net_device *dev) RCR_AMF | RCR_ADF | RCR_AICV | RCR_AB | RCR_AM | RCR_APM | - RCR_AAP | ((u32)7<irq_mask[0] = (u32)(IMR_ROK | IMR_VODOK | IMR_VIDOK | @@ -1972,7 +1972,7 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) } - SlotIndex = (priv->silent_reset_rx_slot_index++)%SilentResetRxSoltNum; + SlotIndex = (priv->silent_reset_rx_slot_index++) % SilentResetRxSoltNum; if (priv->rx_ctr == RegRxCounter) { priv->silent_reset_rx_stuck_event[SlotIndex] = 1; @@ -2017,7 +2017,7 @@ bool rtl92e_get_nmode_support_by_sec(struct net_device *dev) struct rtllib_device *ieee = priv->rtllib; if (ieee->rtllib_ap_sec_type && - (ieee->rtllib_ap_sec_type(priv->rtllib)&(SEC_ALG_WEP | + (ieee->rtllib_ap_sec_type(priv->rtllib) & (SEC_ALG_WEP | SEC_ALG_TKIP))) { return false; } else { diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 4b0ebe96302e..61fd84ca58d2 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -267,9 +267,9 @@ void rtl92e_config_mac(struct net_device *dev) } for (i = 0; i < dwArrayLen; i += 3) { if (pdwArray[i] == 0x318) - pdwArray[i+2] = 0x00000800; - rtl92e_set_bb_reg(dev, pdwArray[i], pdwArray[i+1], - pdwArray[i+2]); + pdwArray[i + 2] = 0x00000800; + rtl92e_set_bb_reg(dev, pdwArray[i], pdwArray[i + 1], + pdwArray[i + 2]); } return; @@ -291,13 +291,13 @@ static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType) for (i = 0; i < PHY_REGArrayLen; i += 2) { rtl92e_set_bb_reg(dev, Rtl819XPHY_REGArray_Table[i], bMaskDWord, - Rtl819XPHY_REGArray_Table[i+1]); + Rtl819XPHY_REGArray_Table[i + 1]); } } else if (ConfigType == BB_CONFIG_AGC_TAB) { for (i = 0; i < AGCTAB_ArrayLen; i += 2) { rtl92e_set_bb_reg(dev, Rtl819XAGCTAB_Array_Table[i], bMaskDWord, - Rtl819XAGCTAB_Array_Table[i+1]); + Rtl819XAGCTAB_Array_Table[i + 1]); } } } @@ -389,10 +389,10 @@ static bool _rtl92e_bb_config_para_file(struct net_device *dev) u32 dwRegValue = 0; bRegValue = rtl92e_readb(dev, BB_GLOBAL_RESET); - rtl92e_writeb(dev, BB_GLOBAL_RESET, (bRegValue|BB_GLOBAL_RESET_BIT)); + rtl92e_writeb(dev, BB_GLOBAL_RESET, (bRegValue | BB_GLOBAL_RESET_BIT)); dwRegValue = rtl92e_readl(dev, CPU_GEN); - rtl92e_writel(dev, CPU_GEN, (dwRegValue&(~CPU_GEN_BB_RST))); + rtl92e_writel(dev, CPU_GEN, (dwRegValue & (~CPU_GEN_BB_RST))); for (eCheckItem = (enum hw90_block)HW90_BLOCK_PHY0; eCheckItem <= HW90_BLOCK_PHY1; eCheckItem++) { @@ -402,18 +402,18 @@ static bool _rtl92e_bb_config_para_file(struct net_device *dev) if (!rtStatus) return rtStatus; } - rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0); + rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn | bOFDMEn, 0x0); _rtl92e_phy_config_bb(dev, BB_CONFIG_PHY_REG); dwRegValue = rtl92e_readl(dev, CPU_GEN); - rtl92e_writel(dev, CPU_GEN, (dwRegValue|CPU_GEN_BB_RST)); + rtl92e_writel(dev, CPU_GEN, (dwRegValue | CPU_GEN_BB_RST)); _rtl92e_phy_config_bb(dev, BB_CONFIG_AGC_TAB); if (priv->ic_cut > VERSION_8190_BD) { dwRegValue = 0x0; rtl92e_set_bb_reg(dev, rFPGA0_TxGainStage, - (bXBTxAGC|bXCTxAGC|bXDTxAGC), dwRegValue); + (bXBTxAGC | bXCTxAGC | bXDTxAGC), dwRegValue); dwRegValue = priv->crystal_cap; @@ -645,7 +645,7 @@ static u8 _rtl92e_phy_switch_channel_step(struct net_device *dev, u8 channel, rtl92e_set_rf_reg(dev, (enum rf90_radio_path)eRFPath, CurrentCmd->Para1, bMask12Bits, - CurrentCmd->Para2<<7); + CurrentCmd->Para2 << 7); break; default: break; @@ -880,7 +880,7 @@ static void _rtl92e_set_bw_mode_work_item(struct net_device *dev) } rtl92e_set_bb_reg(dev, rCCK0_System, bCCKSideBand, - (priv->n_cur_40mhz_prime_sc>>1)); + (priv->n_cur_40mhz_prime_sc >> 1)); rtl92e_set_bb_reg(dev, rOFDM1_LSTF, 0xC00, priv->n_cur_40mhz_prime_sc); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index feac50cd8fa0..893614bf32aa 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -353,7 +353,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) if (pra->ping_rssi_enable) { if (priv->undecorated_smoothed_pwdb < - (long)(pra->ping_rssi_thresh_for_ra+5)) { + (long)(pra->ping_rssi_thresh_for_ra + 5)) { if ((priv->undecorated_smoothed_pwdb < (long)pra->ping_rssi_thresh_for_ra) || ping_rssi_state) { @@ -562,7 +562,7 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) for (k = 0; k < 5; k++) { if (k != 4) tmp_report[k] = rtl92e_readb(dev, - Tssi_Report_Value1+k); + Tssi_Report_Value1 + k); else tmp_report[k] = rtl92e_readb(dev, Tssi_Report_Value2); @@ -861,7 +861,7 @@ static void _rtl92e_dm_cck_tx_power_adjust_tssi(struct net_device *dev, rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); TempVal = (u32)((dm_cck_tx_bb_gain[attenuation][2]) + (dm_cck_tx_bb_gain[attenuation][3] << 8) + - (dm_cck_tx_bb_gain[attenuation][4] << 16)+ + (dm_cck_tx_bb_gain[attenuation][4] << 16) + (dm_cck_tx_bb_gain[attenuation][5] << 24)); rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); TempVal = (u32)(dm_cck_tx_bb_gain[attenuation][6] + @@ -875,7 +875,7 @@ static void _rtl92e_dm_cck_tx_power_adjust_tssi(struct net_device *dev, rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); TempVal = (u32)((dm_cck_tx_bb_gain_ch14[attenuation][2]) + (dm_cck_tx_bb_gain_ch14[attenuation][3] << 8) + - (dm_cck_tx_bb_gain_ch14[attenuation][4] << 16)+ + (dm_cck_tx_bb_gain_ch14[attenuation][4] << 16) + (dm_cck_tx_bb_gain_ch14[attenuation][5] << 24)); rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); TempVal = (u32)((dm_cck_tx_bb_gain_ch14[attenuation][6]) + @@ -898,7 +898,7 @@ static void _rtl92e_dm_cck_tx_power_adjust_thermal_meter(struct net_device *dev, rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); TempVal = CCKSwingTable_Ch1_Ch13[priv->cck_index][2] + (CCKSwingTable_Ch1_Ch13[priv->cck_index][3] << 8) + - (CCKSwingTable_Ch1_Ch13[priv->cck_index][4] << 16)+ + (CCKSwingTable_Ch1_Ch13[priv->cck_index][4] << 16) + (CCKSwingTable_Ch1_Ch13[priv->cck_index][5] << 24); rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); TempVal = CCKSwingTable_Ch1_Ch13[priv->cck_index][6] + @@ -912,11 +912,11 @@ static void _rtl92e_dm_cck_tx_power_adjust_thermal_meter(struct net_device *dev, rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); TempVal = CCKSwingTable_Ch14[priv->cck_index][2] + (CCKSwingTable_Ch14[priv->cck_index][3] << 8) + - (CCKSwingTable_Ch14[priv->cck_index][4] << 16)+ + (CCKSwingTable_Ch14[priv->cck_index][4] << 16) + (CCKSwingTable_Ch14[priv->cck_index][5] << 24); rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); TempVal = CCKSwingTable_Ch14[priv->cck_index][6] + - (CCKSwingTable_Ch14[priv->cck_index][7]<<8); + (CCKSwingTable_Ch14[priv->cck_index][7] << 8); rtl92e_set_bb_reg(dev, rCCK0_DebugPort, bMaskLWord, TempVal); } @@ -1146,7 +1146,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) rtl92e_writeb(dev, rOFDM0_XDAGCCore1, 0x17); if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x00); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x00); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x42); @@ -1183,7 +1183,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) } if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x20); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44); @@ -1214,7 +1214,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev) dm_digtable.dig_highpwr_state = DM_STA_DIG_ON; if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x10); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x10); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x43); } else { @@ -1228,7 +1228,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev) (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh)) { if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x20); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44); } @@ -1339,18 +1339,18 @@ static void _rtl92e_dm_pd_th(struct net_device *dev) (initialized <= 3) || force_write) { if (dm_digtable.curpd_thstate == DIG_PD_AT_LOW_POWER) { if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x00); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x00); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x42); } else if (dm_digtable.curpd_thstate == DIG_PD_AT_NORMAL_POWER) { if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x20); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44); } else if (dm_digtable.curpd_thstate == DIG_PD_AT_HIGH_POWER) { if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x10); + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x10); else rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x43); } @@ -1435,7 +1435,7 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; if (ht_info->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) { - if (curTxOkCnt > 4*curRxOkCnt) { + if (curTxOkCnt > 4 * curRxOkCnt) { if (priv->bis_cur_rdlstate || !priv->bcurrent_turbo_EDCA) { rtl92e_writel(dev, EDCAPARA_BE, @@ -1456,7 +1456,7 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) } priv->bcurrent_turbo_EDCA = true; } else { - if (curRxOkCnt > 4*curTxOkCnt) { + if (curRxOkCnt > 4 * curTxOkCnt) { if (!priv->bis_cur_rdlstate || !priv->bcurrent_turbo_EDCA) { if (priv->rtllib->mode == WIRELESS_MODE_G) @@ -1519,7 +1519,7 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev) if (ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; - if (curRxOkCnt > 4*curTxOkCnt) + if (curRxOkCnt > 4 * curTxOkCnt) ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; else ht_info->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF; @@ -1546,7 +1546,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) tmp1byte = rtl92e_readb(dev, GPI); - rf_power_state_to_set = (tmp1byte&BIT1) ? rf_on : rf_off; + rf_power_state_to_set = (tmp1byte & BIT1) ? rf_on : rf_off; if (priv->hw_radio_off && (rf_power_state_to_set == rf_on)) { netdev_info(dev, "gpiochangeRF - HW Radio ON\n"); @@ -1576,7 +1576,7 @@ void rtl92e_dm_rf_pathcheck_wq(void *data) rfpath = rtl92e_readb(dev, 0xc04); for (i = 0; i < RF90_PATH_MAX; i++) { - if (rfpath & (0x01<brfpath_rxenable[i] = true; else priv->brfpath_rxenable[i] = false; @@ -1627,7 +1627,7 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) u8 update_cck_rx_path; if (!cck_Rx_Path_initialized) { - dm_rx_path_sel_table.cck_rx_path = (rtl92e_readb(dev, 0xa07)&0xf); + dm_rx_path_sel_table.cck_rx_path = (rtl92e_readb(dev, 0xa07) & 0xf); cck_Rx_Path_initialized = 1; } @@ -1763,11 +1763,11 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) if ((tmp_max_rssi - tmp_min_rssi) >= dm_rx_path_sel_table.diff_th) { dm_rx_path_sel_table.rf_enable_rssi_th[min_rssi_index] = - tmp_max_rssi+5; + tmp_max_rssi + 5; rtl92e_set_bb_reg(dev, rOFDM0_TRxPathEnable, - 0x1<undecorated_smoothed_pwdb >= - (RegC38_TH+5)) { + (RegC38_TH + 5)) { if (reg_c38_State) { rtl92e_writeb(dev, rOFDM0_RxDetector3, diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index cb2dd18fa14b..7c4cba6dcf46 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -156,7 +156,7 @@ u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) for (i = 0; i < ieee->current_network.rates_len; i++) { - BasicRate = ieee->current_network.rates[i]&0x7F; + BasicRate = ieee->current_network.rates[i] & 0x7F; if (!rtllib_is_cck_rate(BasicRate)) { if (QueryRate == 0) { QueryRate = BasicRate; @@ -226,7 +226,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) if (ieee->queue_stop) { enqueue_mgmt(ieee, skb); } else { - header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4); + header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); if (ieee->seq_ctrl[0] == 0xFFF) ieee->seq_ctrl[0] = 0; @@ -494,7 +494,7 @@ static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh) static void rtllib_update_active_chan_map(struct rtllib_device *ieee) { memcpy(ieee->active_channel_map, GET_DOT11D_INFO(ieee)->channel_map, - MAX_CHANNEL_NUMBER+1); + MAX_CHANNEL_NUMBER + 1); } /* this performs syncro scan blocking the caller until all channels @@ -802,7 +802,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, char *ssid = ieee->current_network.ssid; int ssid_len = ieee->current_network.ssid_len; - int rate_len = ieee->current_network.rates_len+2; + int rate_len = ieee->current_network.rates_len + 2; int rate_ex_len = ieee->current_network.rates_ex_len; int wpa_ie_len = ieee->wpa_ie_len; u8 erpinfo_content = 0; @@ -855,7 +855,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, } } - beacon_size = sizeof(struct rtllib_probe_response)+2+ + beacon_size = sizeof(struct rtllib_probe_response) + 2 + ssid_len + 3 + rate_len + rate_ex_len + atim_len + erp_len + wpa_ie_len + ieee->tx_headroom; skb = dev_alloc_skb(beacon_size); @@ -900,9 +900,9 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, tag += ssid_len; *(tag++) = MFIE_TYPE_RATES; - *(tag++) = rate_len-2; - memcpy(tag, ieee->current_network.rates, rate_len-2); - tag += rate_len-2; + *(tag++) = rate_len - 2; + memcpy(tag, ieee->current_network.rates, rate_len - 2); + tag += rate_len - 2; *(tag++) = MFIE_TYPE_DS_SET; *(tag++) = 1; @@ -924,9 +924,9 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, } if (rate_ex_len) { *(tag++) = MFIE_TYPE_RATES_EX; - *(tag++) = rate_ex_len-2; - memcpy(tag, ieee->current_network.rates_ex, rate_ex_len-2); - tag += rate_ex_len-2; + *(tag++) = rate_ex_len - 2; + memcpy(tag, ieee->current_network.rates_ex, rate_ex_len - 2); + tag += rate_ex_len - 2; } if (wpa_ie_len) { @@ -1031,7 +1031,7 @@ static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr) struct sk_buff *skb; struct rtllib_hdr_3addr *hdr; - skb = dev_alloc_skb(sizeof(struct rtllib_hdr_3addr)+ieee->tx_headroom); + skb = dev_alloc_skb(sizeof(struct rtllib_hdr_3addr) + ieee->tx_headroom); if (!skb) return NULL; @@ -1057,7 +1057,7 @@ static struct sk_buff *rtllib_pspoll_func(struct rtllib_device *ieee) struct sk_buff *skb; struct rtllib_pspoll_hdr *hdr; - skb = dev_alloc_skb(sizeof(struct rtllib_pspoll_hdr)+ieee->tx_headroom); + skb = dev_alloc_skb(sizeof(struct rtllib_pspoll_hdr) + ieee->tx_headroom); if (!skb) return NULL; @@ -1180,11 +1180,11 @@ rtllib_association_req(struct rtllib_network *beacon, } if (beacon->bCkipSupported) - ckip_ie_len = 30+2; + ckip_ie_len = 30 + 2; if (beacon->bCcxRmEnable) - ccxrm_ie_len = 6+2; + ccxrm_ie_len = 6 + 2; if (beacon->BssCcxVerNumber >= 2) - cxvernum_ie_len = 5+2; + cxvernum_ie_len = 5 + 2; PMKCacheIdx = SecIsInPMKIDList(ieee, ieee->current_network.bssid); if (PMKCacheIdx >= 0) { @@ -1232,7 +1232,7 @@ rtllib_association_req(struct rtllib_network *beacon, hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); if (ieee->short_slot && - (beacon->capability&WLAN_CAPABILITY_SHORT_SLOT_TIME)) + (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); @@ -1271,7 +1271,7 @@ rtllib_association_req(struct rtllib_network *beacon, sizeof(AironetIeOui)); osCcxAironetIE.Octet[IE_CISCO_FLAG_POSITION] |= - (SUPPORT_CKIP_PK|SUPPORT_CKIP_MIC); + (SUPPORT_CKIP_PK | SUPPORT_CKIP_MIC); tag = skb_put(skb, ckip_ie_len); *tag++ = MFIE_TYPE_AIRONET; *tag++ = osCcxAironetIE.Length; @@ -1444,7 +1444,7 @@ static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge, if (!skb) rtllib_associate_abort(ieee); else { - c = skb_put(skb, chlen+2); + c = skb_put(skb, chlen + 2); *(c++) = MFIE_TYPE_CHALLENGE; *(c++) = chlen; memcpy(c, challenge, chlen); @@ -1456,7 +1456,7 @@ static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge, sizeof(struct rtllib_hdr_3addr)); softmac_mgmt_xmit(skb, ieee); - mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); + mod_timer(&ieee->associate_timer, jiffies + (HZ / 2)); } kfree(challenge); } @@ -1476,7 +1476,7 @@ static void rtllib_associate_step2(struct rtllib_device *ieee) rtllib_associate_abort(ieee); else { softmac_mgmt_xmit(skb, ieee); - mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); + mod_timer(&ieee->associate_timer, jiffies + (HZ / 2)); } } @@ -1862,7 +1862,7 @@ static inline u16 assoc_parse(struct rtllib_device *ieee, struct sk_buff *skb, status_code == WLAN_STATUS_CAPS_UNSUPPORTED) && ((ieee->mode == IEEE_G) && (ieee->current_network.mode == IEEE_N_24G) && - (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { + (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT - 1)))) { ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE; } else { ieee->AsocRetryCount = 0; @@ -1986,7 +1986,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) LPSAwakeIntvl_tmp = period + (psc->LPSAwakeIntvl - period) - - ((psc->LPSAwakeIntvl-period) % + ((psc->LPSAwakeIntvl - period) % period); else LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; @@ -1996,7 +1996,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) ieee->current_network.tim.tim_count) LPSAwakeIntvl_tmp = count + (psc->LPSAwakeIntvl - count) - - ((psc->LPSAwakeIntvl-count)%period); + ((psc->LPSAwakeIntvl - count) % period); else LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; } @@ -2341,7 +2341,7 @@ rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) rtllib_disassociate(ieee); RemovePeerTS(ieee, header->addr2); if (!(ieee->rtllib_ap_sec_type(ieee) & - (SEC_ALG_CCMP|SEC_ALG_TKIP))) + (SEC_ALG_CCMP | SEC_ALG_TKIP))) schedule_delayed_work( &ieee->associate_procedure_wq, 5); } diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index e93da95f175b..d85a32d2d050 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -92,7 +92,7 @@ int rtllib_wx_get_freq(struct rtllib_device *ieee, if (ieee->current_network.channel == 0) return -1; - fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel-1] * + fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel - 1] * 100000; fwrq->e = 1; return 0; @@ -231,7 +231,7 @@ int rtllib_wx_set_rate(struct rtllib_device *ieee, u32 target_rate = wrqu->bitrate.value; - ieee->rate = target_rate/100000; + ieee->rate = target_rate / 100000; return 0; } EXPORT_SYMBOL(rtllib_wx_set_rate); From e152c58d7a48194d6b530d8e004d650fd01568b6 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 16 May 2023 22:25:55 +0200 Subject: [PATCH 27/62] staging: vchiq_arm: mark vchiq_platform_init() static This function has no callers from other files, and the declaration was removed a while ago, causing a W=1 warning: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for 'vchiq_platform_init' Marking it static solves this problem but introduces a new warning since gcc determines that 'g_fragments_base' is never initialized in some kernel configurations: In file included from include/linux/string.h:254, from include/linux/bitmap.h:11, from include/linux/cpumask.h:12, from include/linux/mm_types_task.h:14, from include/linux/mm_types.h:5, from include/linux/buildid.h:5, from include/linux/module.h:14, from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8: In function 'memcpy_to_page', inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:433:4: include/linux/fortify-string.h:57:33: error: argument 2 null where non-null expected [-Werror=nonnull] include/linux/highmem.h:427:9: note: in expansion of macro 'memcpy' 427 | memcpy(to + offset, from, len); | ^~~~~~ Add a NULL pointer check for this in addition to the static annotation to avoid both. Fixes: 89cc4218f640 ("staging: vchiq_arm: drop unnecessary declarations") Signed-off-by: Arnd Bergmann Reviewed-by: Florian Fainelli Reviewed-by: Umang Jain Link: https://lore.kernel.org/r/20230516202603.560554-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 90a3958d1f29..aa2313f3bcab 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -415,7 +415,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel pagelistinfo->scatterlist_mapped = 0; /* Deal with any partial cache lines (fragments) */ - if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) { + if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS && g_fragments_base) { char *fragments = g_fragments_base + (pagelist->type - PAGELIST_READ_WITH_FRAGMENTS) * g_fragments_size; @@ -462,7 +462,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel cleanup_pagelistinfo(instance, pagelistinfo); } -int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) +static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) { struct device *dev = &pdev->dev; struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev); From 5d88ce5052d2dcac3e4192f7280ab075a544828a Mon Sep 17 00:00:00 2001 From: Bagas Sanjaya Date: Wed, 17 May 2023 16:04:17 +0700 Subject: [PATCH 28/62] drivers: staging: wlan-ng: Remove GPL/MPL boilerplate Remove the license boilerplate as there is already SPDX license identifier added in b24413180f5600 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license") which fulfills the same intention as the boilerplate. Cc: Dan Carpenter Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Thomas Gleixner Reviewed-by: Simon Horman Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230517090418.1093091-4-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 21 --------------------- drivers/staging/wlan-ng/hfa384x_usb.c | 21 --------------------- drivers/staging/wlan-ng/p80211conv.c | 21 --------------------- drivers/staging/wlan-ng/p80211conv.h | 21 --------------------- drivers/staging/wlan-ng/p80211hdr.h | 21 --------------------- drivers/staging/wlan-ng/p80211ioctl.h | 21 --------------------- drivers/staging/wlan-ng/p80211metadef.h | 21 --------------------- drivers/staging/wlan-ng/p80211metastruct.h | 21 --------------------- drivers/staging/wlan-ng/p80211mgmt.h | 21 --------------------- drivers/staging/wlan-ng/p80211msg.h | 21 --------------------- drivers/staging/wlan-ng/p80211netdev.c | 21 --------------------- drivers/staging/wlan-ng/p80211netdev.h | 21 --------------------- drivers/staging/wlan-ng/p80211req.c | 21 --------------------- drivers/staging/wlan-ng/p80211req.h | 21 --------------------- drivers/staging/wlan-ng/p80211types.h | 21 --------------------- drivers/staging/wlan-ng/p80211wep.c | 21 --------------------- drivers/staging/wlan-ng/prism2fw.c | 21 --------------------- drivers/staging/wlan-ng/prism2mgmt.c | 21 --------------------- drivers/staging/wlan-ng/prism2mgmt.h | 21 --------------------- drivers/staging/wlan-ng/prism2mib.c | 21 --------------------- drivers/staging/wlan-ng/prism2sta.c | 21 --------------------- 21 files changed, 441 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index e33dd1b9c40e..a4799589e469 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index c7cd54171d99..3e8c92675c82 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index cd271b1da69f..048e1c3fe19b 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h index dfb762bce84d..45234769f45d 100644 --- a/drivers/staging/wlan-ng/p80211conv.h +++ b/drivers/staging/wlan-ng/p80211conv.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h index 93195a4c5b01..7ea1c8ec05ed 100644 --- a/drivers/staging/wlan-ng/p80211hdr.h +++ b/drivers/staging/wlan-ng/p80211hdr.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211ioctl.h b/drivers/staging/wlan-ng/p80211ioctl.h index b50ce11147dd..176e327a45bc 100644 --- a/drivers/staging/wlan-ng/p80211ioctl.h +++ b/drivers/staging/wlan-ng/p80211ioctl.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211metadef.h b/drivers/staging/wlan-ng/p80211metadef.h index 1b91b64c12ed..1cbb4b67a9a6 100644 --- a/drivers/staging/wlan-ng/p80211metadef.h +++ b/drivers/staging/wlan-ng/p80211metadef.h @@ -6,27 +6,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211metastruct.h b/drivers/staging/wlan-ng/p80211metastruct.h index e963227f797c..a52217c9b953 100644 --- a/drivers/staging/wlan-ng/p80211metastruct.h +++ b/drivers/staging/wlan-ng/p80211metastruct.h @@ -6,27 +6,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211mgmt.h b/drivers/staging/wlan-ng/p80211mgmt.h index fc23fae5651b..7ffc202d9007 100644 --- a/drivers/staging/wlan-ng/p80211mgmt.h +++ b/drivers/staging/wlan-ng/p80211mgmt.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211msg.h b/drivers/staging/wlan-ng/p80211msg.h index f68d8b7d5ad8..d56bc6079ed4 100644 --- a/drivers/staging/wlan-ng/p80211msg.h +++ b/drivers/staging/wlan-ng/p80211msg.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 6bef419e8ad0..8634fc89a6c2 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211netdev.h b/drivers/staging/wlan-ng/p80211netdev.h index 1cee51a1075e..f5186380b629 100644 --- a/drivers/staging/wlan-ng/p80211netdev.h +++ b/drivers/staging/wlan-ng/p80211netdev.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c index 809cf3d480e9..6ec559ffd2f9 100644 --- a/drivers/staging/wlan-ng/p80211req.c +++ b/drivers/staging/wlan-ng/p80211req.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211req.h b/drivers/staging/wlan-ng/p80211req.h index bc45cd5f91e4..39213f73913c 100644 --- a/drivers/staging/wlan-ng/p80211req.h +++ b/drivers/staging/wlan-ng/p80211req.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211types.h b/drivers/staging/wlan-ng/p80211types.h index b2ed96960413..5e4ea5f92058 100644 --- a/drivers/staging/wlan-ng/p80211types.h +++ b/drivers/staging/wlan-ng/p80211types.h @@ -9,27 +9,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c index 3ff7ee7011df..e7b26b057124 100644 --- a/drivers/staging/wlan-ng/p80211wep.c +++ b/drivers/staging/wlan-ng/p80211wep.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 11658865ca50..5d03b2b9aab4 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index fc465261baa1..d5737166564e 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/prism2mgmt.h b/drivers/staging/wlan-ng/prism2mgmt.h index 7132cec2d7eb..083a055ee986 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.h +++ b/drivers/staging/wlan-ng/prism2mgmt.h @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index fcf8313870af..4346b90c1a77 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index daa7cc4e897c..57180bb71699 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -8,27 +8,6 @@ * * linux-wlan * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision - * by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the MPL or the GPL. - * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be From 28f5930b66ed12a4729be0a507460c191460cb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 24 May 2023 17:16:45 +0200 Subject: [PATCH 29/62] staging: olpc_dcon: Switch i2c driver back to use .probe() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230524151646.486847-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman --- drivers/staging/olpc_dcon/olpc_dcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 2fba52e0bd7b..d5271eac14f6 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -779,7 +779,7 @@ static struct i2c_driver dcon_driver = { }, .class = I2C_CLASS_DDC | I2C_CLASS_HWMON, .id_table = dcon_idtable, - .probe_new = dcon_probe, + .probe = dcon_probe, .remove = dcon_remove, .detect = dcon_detect, .address_list = normal_i2c, From b36be72b5a7bf607c3e3c771bce4c41d99483038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 24 May 2023 17:16:46 +0200 Subject: [PATCH 30/62] staging: most: Switch i2c driver back to use .probe() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230524151646.486847-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/i2c/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c index 4e85e681922f..ce869280a056 100644 --- a/drivers/staging/most/i2c/i2c.c +++ b/drivers/staging/most/i2c/i2c.c @@ -362,7 +362,7 @@ static struct i2c_driver i2c_driver = { .driver = { .name = "hdm_i2c", }, - .probe_new = i2c_probe, + .probe = i2c_probe, .remove = i2c_remove, .id_table = i2c_id, }; From 71b6b438f301733c150508f656e1cdb5285067e6 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Sun, 28 May 2023 17:01:47 +0300 Subject: [PATCH 31/62] staging: pi433: Remove stray gpiod_unexport() call There is no gpiod_export() and gpiod_unexport() looks pretty much stray. If user space tools somehow belong to that, they should be fixed, the gpiod_export() and gpiod_unexport() shouldn't be used in a new code, GPIO sysfs is deprecated. That said, and taking into account staging state of the driver, simply drop the stray call. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230528140147.32427-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/pi433/pi433_if.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index f08fdf06d566..220e157d4a5e 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -1019,7 +1019,6 @@ static int setup_gpio(struct pi433_device *device) } /* configure the pin */ - gpiod_unexport(device->gpiod[i]); retval = gpiod_direction_input(device->gpiod[i]); if (retval) return retval; From c6e9da9d556673b07e0ba4f00580904286787f22 Mon Sep 17 00:00:00 2001 From: David Tadokoro Date: Sun, 28 May 2023 12:40:10 -0300 Subject: [PATCH 32/62] staging: rtl8192e: clean unnecessary braces warning on r8192E_phy.c Clean a checkpatch.pl warning of type "braces {} are not necessary for single statement blocks" on r8192E_phy.c file. Signed-off-by: David Tadokoro Link: https://lore.kernel.org/r/20230528154010.3068-1-davidbtadokoro@usp.br Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 61fd84ca58d2..641e993aaa86 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -1099,9 +1099,8 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, break; } - if (bResult) { + if (bResult) priv->rtllib->rf_power_state = rf_power_state; - } priv->set_rf_pwr_state_in_progress = false; return bResult; From 00eca57d6521a14c9257049ad8d029ac6601c4a3 Mon Sep 17 00:00:00 2001 From: Deepanshu Kartikey Date: Tue, 30 May 2023 19:21:20 +0530 Subject: [PATCH 33/62] Staging: rts5208: rtsx: Removed new line in else and else if Removed new line in else and else if, this warning was given by checkpatch.pl Signed-off-by: Deepanshu Kartikey Reviewed-by: Dan Carpenter Message-ID: <20230530135120.37637-1-kartikey406@gmail.com> Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rts5208/rtsx.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index db2dd0baa8be..08543a3936da 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -382,27 +382,21 @@ static int rtsx_control_thread(void *__dev) if (chip->srb->sc_data_direction == DMA_BIDIRECTIONAL) { dev_err(&dev->pci->dev, "UNKNOWN data direction\n"); chip->srb->result = DID_ERROR << 16; - } - - /* reject if target != 0 or if LUN is higher than - * the maximum known LUN - */ - else if (chip->srb->device->id) { + } else if (chip->srb->device->id) { + /* reject if target != 0 or if LUN is higher than + * the maximum known LUN + */ dev_err(&dev->pci->dev, "Bad target number (%d:%d)\n", chip->srb->device->id, (u8)chip->srb->device->lun); chip->srb->result = DID_BAD_TARGET << 16; - } - - else if (chip->srb->device->lun > chip->max_lun) { + } else if (chip->srb->device->lun > chip->max_lun) { dev_err(&dev->pci->dev, "Bad LUN (%d:%d)\n", chip->srb->device->id, (u8)chip->srb->device->lun); chip->srb->result = DID_BAD_TARGET << 16; - } - - /* we've got a command, let's do it! */ - else { + } else { + /* we've got a command, let's do it! */ scsi_show_command(chip); rtsx_invoke_transport(chip->srb, chip); } From c88af76f71c5459852ed959af5ab7afbbf2c4411 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Wed, 31 May 2023 07:31:18 +0200 Subject: [PATCH 34/62] staging: rtl8192e: remove blank lines Remove unnecessary blank lines reported by checkpatch. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Message-ID: <20230531053118.17053-1-straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/rtl8192e/r8190P_def.h | 8 --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 14 ----- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 20 ------- .../staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 4 -- drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 2 - drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 29 ----------- drivers/staging/rtl8192e/rtl8192e/rtl_pm.c | 2 - drivers/staging/rtl8192e/rtl819x_HT.h | 6 --- drivers/staging/rtl8192e/rtl819x_Qos.h | 1 - drivers/staging/rtl8192e/rtl819x_TS.h | 2 - drivers/staging/rtl8192e/rtllib.h | 3 -- drivers/staging/rtl8192e/rtllib_softmac.c | 52 ------------------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 16 ------ 13 files changed, 159 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h b/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h index 385cca79f484..c229fd244a48 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_def.h @@ -85,7 +85,6 @@ enum rtl819x_loopback { #define HAL_PRIME_CHNL_OFFSET_LOWER 1 #define HAL_PRIME_CHNL_OFFSET_UPPER 2 - enum version_8190_loopback { VERSION_8190_BD = 0x3, VERSION_8190_BE @@ -139,8 +138,6 @@ struct tx_fwinfo_8190pci { u32 Retry_Limit:4; u32 Reserved2:1; u32 PacketID:13; - - }; struct phy_ofdm_rx_status_rxsc_sgien_exintfflag { @@ -172,7 +169,6 @@ struct phy_sts_cck_819xpci { u8 cck_agc_rpt; }; - #define PHY_RSSI_SLID_WIN_MAX 100 #define PHY_Beacon_RSSI_SLID_WIN_MAX 10 @@ -214,7 +210,6 @@ struct tx_desc { u32 Reserved7; }; - struct tx_desc_cmd { u16 PktSize; u8 Reserved1; @@ -256,10 +251,8 @@ struct rx_desc { u32 Reserved3; u32 BufferAddress; - }; - struct rx_fwinfo { u16 Reserved1:12; u16 PartAggr:1; @@ -278,7 +271,6 @@ struct rx_fwinfo { u8 Reserved4:1; u32 TSFL; - }; #endif diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index f9b6c3069b30..f030e06f16f6 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -107,7 +107,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) } rtl92e_writeb(dev, MSR, btMsr); - } break; @@ -126,7 +125,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) rtl92e_writel(dev, RCR, RegRCR); priv->receive_config = RegRCR; - } break; @@ -266,7 +264,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) default: break; } - } static void _rtl92e_read_eeprom_info(struct net_device *dev) @@ -714,7 +711,6 @@ end: static void _rtl92e_net_update(struct net_device *dev) { - struct r8192_priv *priv = rtllib_priv(dev); struct rtllib_network *net; u16 BcnTimeCfg = 0, BcnCW = 6, BcnIFS = 0xf; @@ -1006,7 +1002,6 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, pdesc->SecCAMID = 0; pdesc->RATid = cb_desc->ratr_index; - pdesc->NoEnc = 1; pdesc->SecType = 0x0; if (cb_desc->bHwSec) { @@ -1213,7 +1208,6 @@ static long _rtl92e_signal_scale_mapping(struct r8192_priv *priv, long currsig) return retsig; } - #define rx_hal_is_cck_rate(_pdrvinfo)\ ((_pdrvinfo->RxRate == DESC90_RATE1M ||\ _pdrvinfo->RxRate == DESC90_RATE2M ||\ @@ -1261,7 +1255,6 @@ static void _rtl92e_query_rxphystatus( check_reg824 = 1; } - prxpkt = (u8 *)pdrvinfo; prxpkt += sizeof(struct rx_fwinfo); @@ -1368,7 +1361,6 @@ static void _rtl92e_query_rxphystatus( } } - rx_pwr_all = (((pofdm_buf->pwdb_all) >> 1) & 0x7f) - 106; pwdb_all = rtl92e_rx_db_to_percent(rx_pwr_all); @@ -1485,7 +1477,6 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer, } } - if (prev_st->bPacketBeacon) { if (slide_beacon_adc_pwdb_statistics++ >= PHY_Beacon_RSSI_SLID_WIN_MAX) { @@ -1802,7 +1793,6 @@ void rtl92e_stop_adapter(struct net_device *dev, bool reset) rtl92e_writel(dev, WFCRC1, 0xffffffff); rtl92e_writel(dev, WFCRC2, 0xffffffff); - rtl92e_writeb(dev, PMR, 0x5); rtl92e_writeb(dev, MAC_BLK_CTRL, 0xa); } @@ -1897,7 +1887,6 @@ void rtl92e_enable_irq(struct net_device *dev) priv->irq_enabled = 1; rtl92e_writel(dev, INTA_MASK, priv->irq_mask[0]); - } void rtl92e_disable_irq(struct net_device *dev) @@ -1929,7 +1918,6 @@ void rtl92e_enable_tx(struct net_device *dev) rtl92e_writel(dev, TX_DESC_BASE[i], priv->tx_ring[i].dma); } - void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta, u32 *p_intb) { *p_inta = rtl92e_readl(dev, ISR); @@ -1986,8 +1974,6 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) TotalRxStuckCount += priv->silent_reset_rx_stuck_event[i]; } - - } else { priv->silent_reset_rx_stuck_event[SlotIndex] = 0; } diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 641e993aaa86..7b0da55fa7aa 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -32,7 +32,6 @@ static u32 _rtl92e_calculate_bit_shift(u32 dwBitMask) void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask, u32 dwData) { - u32 OriginalValue, BitShift, NewValue; if (dwBitMask != bMaskDWord) { @@ -99,7 +98,6 @@ static u32 _rtl92e_phy_rf_read(struct net_device *dev, rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter4, 0x300, 0x3); return ret; - } static void _rtl92e_phy_rf_write(struct net_device *dev, @@ -226,7 +224,6 @@ static u32 _rtl92e_phy_rf_fw_read(struct net_device *dev, return 0; } return rtl92e_readl(dev, RF_DATA); - } static void _rtl92e_phy_rf_fw_write(struct net_device *dev, @@ -247,10 +244,8 @@ static void _rtl92e_phy_rf_fw_write(struct net_device *dev, break; } rtl92e_writel(dev, QPNR, Data); - } - void rtl92e_config_mac(struct net_device *dev) { u32 dwArrayLen = 0, i = 0; @@ -272,7 +267,6 @@ void rtl92e_config_mac(struct net_device *dev) pdwArray[i + 2]); } return; - } static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType) @@ -370,7 +364,6 @@ bool rtl92e_check_bb_and_rf(struct net_device *dev, enum hw90_block CheckBlock, break; } - if (dwRegRead != WriteData[i]) { netdev_warn(dev, "%s(): Check failed.\n", __func__); ret = false; @@ -415,7 +408,6 @@ static bool _rtl92e_bb_config_para_file(struct net_device *dev) rtl92e_set_bb_reg(dev, rFPGA0_TxGainStage, (bXBTxAGC | bXCTxAGC | bXDTxAGC), dwRegValue); - dwRegValue = priv->crystal_cap; rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, bXtalCap92x, dwRegValue); @@ -470,7 +462,6 @@ void rtl92e_set_tx_power(struct net_device *dev, u8 channel) u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath) { - int i; switch (eRFPath) { @@ -483,7 +474,6 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath) rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIO_A_ARR[i], bMask12Bits, RTL8192E_RADIO_A_ARR[i + 1]); - } break; case RF90_PATH_B: @@ -495,7 +485,6 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath) rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIO_B_ARR[i], bMask12Bits, RTL8192E_RADIO_B_ARR[i + 1]); - } break; default: @@ -503,7 +492,6 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath) } return 0; - } static void _rtl92e_set_tx_power_level(struct net_device *dev, u8 channel) @@ -677,7 +665,6 @@ static void _rtl92e_phy_switch_channel(struct net_device *dev, u8 channel) static void _rtl92e_phy_switch_channel_work_item(struct net_device *dev) { - struct r8192_priv *priv = rtllib_priv(dev); _rtl92e_phy_switch_channel(dev, priv->chan); @@ -694,7 +681,6 @@ u8 rtl92e_set_channel(struct net_device *dev, u8 channel) if (priv->sw_chnl_in_progress) return false; - switch (priv->rtllib->mode) { case WIRELESS_MODE_B: if (channel > 14) { @@ -824,7 +810,6 @@ static void _rtl92e_cck_tx_power_track_bw_switch(struct net_device *dev) static void _rtl92e_set_bw_mode_work_item(struct net_device *dev) { - struct r8192_priv *priv = rtllib_priv(dev); u8 regBwOpMode; @@ -890,7 +875,6 @@ static void _rtl92e_set_bw_mode_work_item(struct net_device *dev) netdev_err(dev, "%s(): unknown Bandwidth: %#X\n", __func__, priv->current_chnl_bw); break; - } rtl92e_set_bandwidth(dev, priv->current_chnl_bw); @@ -904,7 +888,6 @@ void rtl92e_set_bw_mode(struct net_device *dev, enum ht_channel_width bandwidth, { struct r8192_priv *priv = rtllib_priv(dev); - if (priv->set_bw_mode_in_progress) return; @@ -921,7 +904,6 @@ void rtl92e_set_bw_mode(struct net_device *dev, enum ht_channel_width bandwidth, priv->n_cur_40mhz_prime_sc = HAL_PRIME_CHNL_OFFSET_DONT_CARE; _rtl92e_set_bw_mode_work_item(dev); - } void rtl92e_init_gain(struct net_device *dev, u8 Operation) @@ -993,7 +975,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation) void rtl92e_set_rf_off(struct net_device *dev) { - rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter4, 0x300, 0x0); rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x18, 0x0); @@ -1002,7 +983,6 @@ void rtl92e_set_rf_off(struct net_device *dev) rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x60, 0x0); rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x4, 0x0); rtl92e_writeb(dev, ANAPAR_FOR_8192PCIE, 0x07); - } static bool _rtl92e_set_rf_power_state(struct net_device *dev, diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h index e1b30fbdf8cc..65365ebe4e85 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h @@ -7,7 +7,6 @@ #ifndef _R819XU_PHYREG_H #define _R819XU_PHYREG_H - #define RF_DATA 0x1d4 #define rPMAC_Reset 0x100 @@ -125,7 +124,6 @@ #define rOFDM0_TxCoeff5 0xcb4 #define rOFDM0_TxCoeff6 0xcb8 - #define rOFDM1_LSTF 0xd00 #define rOFDM1_TRxPathEnable 0xd04 #define rOFDM1_CFO 0xd08 @@ -163,7 +161,6 @@ #define rTxAGC_Mcs11_Mcs08 0xe18 #define rTxAGC_Mcs15_Mcs12 0xe1c - #define rZebra1_HSSIEnable 0x0 #define rZebra1_TRxEnable1 0x1 #define rZebra1_TRxEnable2 0x2 @@ -819,7 +816,6 @@ #define bOFDMPHY0_End 0xcff #define bOFDMPHY1_End 0xdff - #define bPMACControl 0x0 #define bWMACControl 0x1 #define bWNICControl 0x2 diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c index a4d65b4d99c2..6d9e5c27017d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c @@ -101,7 +101,6 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, else usConfig |= BIT15 | (KeyType << 2) | KeyIndex; - for (i = 0; i < CAM_CONTENT_COUNT; i++) { TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; TargetCommand |= BIT31 | BIT16; @@ -149,7 +148,6 @@ void rtl92e_cam_restore(struct net_device *dev) if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) || (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) { - for (EntryId = 0; EntryId < 4; EntryId++) { MacAddr = CAM_CONST_ADDR[EntryId]; if (priv->rtllib->swcamtable[EntryId].bused) { diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 893614bf32aa..219ff7685c15 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -159,7 +159,6 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev); static void _rtl92e_dm_init_bandwidth_autoswitch(struct net_device *dev); static void _rtl92e_dm_bandwidth_autoswitch(struct net_device *dev); - static void _rtl92e_dm_check_tx_power_tracking(struct net_device *dev); static void _rtl92e_dm_bb_initialgain_restore(struct net_device *dev); @@ -179,7 +178,6 @@ static void _rtl92e_dm_check_rx_path_selection(struct net_device *dev); static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev); static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev); - static void _rtl92e_dm_init_fsync(struct net_device *dev); static void _rtl92e_dm_deinit_fsync(struct net_device *dev); @@ -219,9 +217,7 @@ void rtl92e_dm_init(struct net_device *dev) void rtl92e_dm_deinit(struct net_device *dev) { - _rtl92e_dm_deinit_fsync(dev); - } void rtl92e_dm_watchdog(struct net_device *dev) @@ -250,7 +246,6 @@ void rtl92e_dm_watchdog(struct net_device *dev) void rtl92e_init_adaptive_rate(struct net_device *dev) { - struct r8192_priv *priv = rtllib_priv(dev); struct rate_adaptive *pra = &priv->rate_adaptive; @@ -297,7 +292,6 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) return; if (priv->rtllib->state == RTLLIB_LINKED) { - bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && ht_info->bCurShortGI40MHz) || (!ht_info->cur_tx_bw40mhz && @@ -524,7 +518,6 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) priv->rtllib->bdynamic_txpower_enable = false; for (j = 0; j <= 30; j++) { - tx_cmd.op = TXCMD_SET_TX_PWR_TRACKING; tx_cmd.length = 4; tx_cmd.value = priv->pwr_track >> 24; @@ -756,20 +749,17 @@ void rtl92e_dm_txpower_tracking_wq(void *data) static void _rtl92e_dm_initialize_tx_power_tracking_tssi(struct net_device *dev) { - struct r8192_priv *priv = rtllib_priv(dev); priv->btxpower_tracking = true; priv->txpower_count = 0; priv->tx_pwr_tracking_init = false; - } static void _rtl92e_dm_init_tx_power_tracking_thermal(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - if (priv->rtllib->FwRWRF) priv->btxpower_tracking = true; else @@ -799,12 +789,10 @@ static void _rtl92e_dm_check_tx_power_tracking_tssi(struct net_device *dev) return; tx_power_track_counter++; - if (tx_power_track_counter >= 180) { schedule_delayed_work(&priv->txpower_tracking_wq, 0); tx_power_track_counter = 0; } - } static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev) @@ -833,7 +821,6 @@ static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev) netdev_info(dev, "===============>Schedule TxPowerTrackingWorkItem\n"); schedule_delayed_work(&priv->txpower_tracking_wq, 0); TM_Trigger = 0; - } static void _rtl92e_dm_check_tx_power_tracking(struct net_device *dev) @@ -965,7 +952,6 @@ void rtl92e_dm_restore_state(struct net_device *dev) _rtl92e_dm_tx_power_reset_recovery(dev); _rtl92e_dm_bb_initialgain_restore(dev); - } static void _rtl92e_dm_bb_initialgain_restore(struct net_device *dev) @@ -989,7 +975,6 @@ static void _rtl92e_dm_bb_initialgain_restore(struct net_device *dev) rtl92e_set_bb_reg(dev, rCCK0_CCA, bit_mask, (u32)priv->initgain_backup.cca); rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1); - } void rtl92e_dm_backup_state(struct net_device *dev) @@ -1043,7 +1028,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev) static void _rtl92e_dm_ctrl_initgain_byrssi(struct net_device *dev) { - if (!dm_digtable.dig_enable_flag) return; @@ -1096,7 +1080,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) else dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; - dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; _rtl92e_dm_initial_gain(dev); _rtl92e_dm_pd_th(dev); @@ -1104,7 +1087,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) if (dm_digtable.dig_algorithm_switch) dm_digtable.dig_algorithm_switch = 0; dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state; - } static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) @@ -1194,7 +1176,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) _rtl92e_dm_ctrl_initgain_byrssi_highpwr(dev); } - static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); @@ -1392,7 +1373,6 @@ static void _rtl92e_dm_cs_ratio(struct net_device *dev) reset_cnt = priv->reset_count; } - if ((dm_digtable.precs_ratio_state != dm_digtable.curcs_ratio_state) || !initialized || force_write) { if (dm_digtable.curcs_ratio_state == DIG_CS_RATIO_LOWER) @@ -1474,7 +1454,6 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) edca_setting_UL[ht_info->IOTPeer]); priv->bis_cur_rdlstate = false; } - } priv->bcurrent_turbo_EDCA = true; @@ -1489,7 +1468,6 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) } } - dm_CheckEdcaTurbo_EXIT: priv->rtllib->bis_any_nonbepkts = false; lastTxOkCnt = priv->stats.txbytesunicast; @@ -1746,7 +1724,6 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) tmp_cck_min_pwdb = cur_cck_pwdb; } } - } } } @@ -1812,7 +1789,6 @@ static void _rtl92e_dm_check_rx_path_selection(struct net_device *dev) schedule_delayed_work(&priv->rfpath_check_wq, 0); } - static void _rtl92e_dm_init_fsync(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); @@ -1829,7 +1805,6 @@ static void _rtl92e_dm_init_fsync(struct net_device *dev) timer_setup(&priv->fsync_timer, _rtl92e_dm_fsync_timer_callback, 0); } - static void _rtl92e_dm_deinit_fsync(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); @@ -1864,7 +1839,6 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t) else rate_count_diff = rate_count - priv->rate_record; if (rate_count_diff < priv->rate_count_diff_rec) { - u32 DiffNum = priv->rate_count_diff_rec - rate_count_diff; if (DiffNum >= @@ -2005,7 +1979,6 @@ static void _rtl92e_dm_start_sw_fsync(struct net_device *dev) add_timer(&priv->fsync_timer); rtl92e_writel(dev, rOFDM0_RxDetector2, 0x465c12cd); - } static void _rtl92e_dm_check_fsync(struct net_device *dev) @@ -2048,7 +2021,6 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) case SW_Fsync: default: break; - } } if (reg_c38_State != RegC38_Fsync_AP_BCM) { @@ -2164,7 +2136,6 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) } priv->last_dtp_flag_high = priv->dynamic_tx_high_pwr; priv->last_dtp_flag_low = priv->dynamic_tx_low_pwr; - } static void _rtl92e_dm_check_txrateandretrycount(struct net_device *dev) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c index 9c80dc1b6e12..d124b5eee0cc 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c @@ -9,7 +9,6 @@ #include "r8190P_rtl8256.h" #include "rtl_pm.h" - int rtl92e_suspend(struct device *dev_d) { struct net_device *dev = dev_get_drvdata(dev_d); @@ -62,7 +61,6 @@ int rtl92e_resume(struct device *dev_d) netdev_info(dev, "================>r8192E resume call.\n"); - pci_read_config_dword(pdev, 0x40, &val); if ((val & 0x0000ff00) != 0) pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index f4e9fa849796..3e601537412a 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -24,7 +24,6 @@ enum ht_extchnl_offset { }; struct ht_capab_ele { - u8 AdvCoding:1; u8 ChlWidth:1; u8 MimoPwrSave:2; @@ -46,7 +45,6 @@ struct ht_capab_ele { u8 MCS[16]; - u16 ExtHTCapInfo; u8 TxBFCap[4]; @@ -55,7 +53,6 @@ struct ht_capab_ele { } __packed; - struct ht_info_ele { u8 ControlChl; @@ -94,7 +91,6 @@ enum ht_aggre_mode { HT_AGG_FORCE_DISABLE = 2, }; - struct rt_hi_throughput { u8 enable_ht; u8 bCurrentHTSupport; @@ -113,14 +109,12 @@ struct rt_hi_throughput { enum ht_spec_ver ePeerHTSpecVer; - struct ht_capab_ele SelfHTCap; struct ht_info_ele SelfHTInfo; u8 PeerHTCapBuf[32]; u8 PeerHTInfoBuf[32]; - u8 bAMSDU_Support; u16 nAMSDU_MaxSize; u8 bCurrent_AMSDU_Support; diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h index c010eb0d6036..0499711ea2bf 100644 --- a/drivers/staging/rtl8192e/rtl819x_Qos.h +++ b/drivers/staging/rtl8192e/rtl819x_Qos.h @@ -104,7 +104,6 @@ struct acm { }; union qos_tclas { - struct _TYPE_GENERAL { u8 Priority; u8 ClassifierType; diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h index 4aa9b12a2dd5..37760d0bc35d 100644 --- a/drivers/staging/rtl8192e/rtl819x_TS.h +++ b/drivers/staging/rtl8192e/rtl819x_TS.h @@ -53,6 +53,4 @@ struct rx_ts_record { u8 num; }; - - #endif diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 4aa5ce9f7792..f2903b14b793 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1137,7 +1137,6 @@ struct rtllib_network { }; enum rtllib_state { - /* the card is not linked at all */ RTLLIB_NOLINK = 0, @@ -1298,7 +1297,6 @@ enum fw_cmd_io_type { #define RT_MAX_LD_SLOT_NUM 10 struct rt_link_detect { - u32 NumRecvBcnInPeriod; u32 NumRecvDataInPeriod; @@ -1316,7 +1314,6 @@ struct rt_link_detect { }; struct sw_cam_table { - u8 macaddr[ETH_ALEN]; bool bused; u8 key_buf[16]; diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 7c4cba6dcf46..821ca86b8bcd 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -22,7 +22,6 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl); - static short rtllib_is_54g(struct rtllib_network *net) { return (net->rates_ex_len > 0) || (net->rates_len > 4); @@ -139,7 +138,6 @@ static void enqueue_mgmt(struct rtllib_device *ieee, struct sk_buff *skb) */ ieee->mgmt_queue_head = nh; ieee->mgmt_queue_ring[nh] = skb; - } static void init_mgmt_queue(struct rtllib_device *ieee) @@ -147,14 +145,12 @@ static void init_mgmt_queue(struct rtllib_device *ieee) ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; } - u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) { u16 i; u8 QueryRate = 0; u8 BasicRate; - for (i = 0; i < ieee->current_network.rates_len; i++) { BasicRate = ieee->current_network.rates[i] & 0x7F; if (!rtllib_is_cck_rate(BasicRate)) { @@ -286,7 +282,6 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, type = WLAN_FC_GET_TYPE(fc); stype = WLAN_FC_GET_STYPE(fc); - if (stype != RTLLIB_STYPE_PSPOLL) tcb_desc->queue_index = MGNT_QUEUE; else @@ -295,7 +290,6 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, if (ieee->disable_mgnt_queue) tcb_desc->queue_index = HIGH_QUEUE; - tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); tcb_desc->ratr_index = 7; tcb_desc->tx_dis_rate_fallback = 1; @@ -308,7 +302,6 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, ieee->seq_ctrl[0] = 0; else ieee->seq_ctrl[0]++; - } /* avoid watchdog triggers */ ieee->softmac_data_hard_start_xmit(skb, ieee->dev, @@ -324,7 +317,6 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, ieee->seq_ctrl[0]++; } ieee->softmac_hard_start_xmit(skb, ieee->dev); - } } @@ -388,7 +380,6 @@ static void rtllib_send_beacon(struct rtllib_device *ieee) (msecs_to_jiffies(ieee->current_network.beacon_interval - 5))); } - static void rtllib_send_beacon_cb(struct timer_list *t) { struct rtllib_device *ieee = @@ -411,7 +402,6 @@ void rtllib_EnableNetMonitorMode(struct net_device *dev, ieee->AllowAllDestAddrHandler(dev, true, !bInitState); } - /* Disables network monitor mode. Only packets destinated to * us will be received. */ @@ -425,7 +415,6 @@ void rtllib_DisableNetMonitorMode(struct net_device *dev, ieee->AllowAllDestAddrHandler(dev, false, !bInitState); } - /* Enables the specialized promiscuous mode required by Intel. * In this mode, Intel intends to hear traffics from/to other STAs in the * same BSS. Therefore we don't have to disable checking BSSID and we only need @@ -449,7 +438,6 @@ void rtllib_EnableIntelPromiscuousMode(struct net_device *dev, } EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); - /* Disables the specialized promiscuous mode required by Intel. * See MgntEnableIntelPromiscuousMode for detail. */ @@ -481,7 +469,6 @@ static void rtllib_send_probe(struct rtllib_device *ieee, u8 is_mesh) } } - static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh) { if (ieee->active_scan && (ieee->softmac_features & @@ -629,8 +616,6 @@ out1: mutex_unlock(&ieee->scan_mutex); } - - static void rtllib_beacons_start(struct rtllib_device *ieee) { unsigned long flags; @@ -653,10 +638,8 @@ static void rtllib_beacons_stop(struct rtllib_device *ieee) spin_unlock_irqrestore(&ieee->beacon_lock, flags); del_timer_sync(&ieee->beacon_timer); - } - void rtllib_stop_send_beacons(struct rtllib_device *ieee) { ieee->stop_send_beacons(ieee->dev); @@ -665,7 +648,6 @@ void rtllib_stop_send_beacons(struct rtllib_device *ieee) } EXPORT_SYMBOL(rtllib_stop_send_beacons); - void rtllib_start_send_beacons(struct rtllib_device *ieee) { ieee->start_send_beacons(ieee->dev); @@ -674,7 +656,6 @@ void rtllib_start_send_beacons(struct rtllib_device *ieee) } EXPORT_SYMBOL(rtllib_start_send_beacons); - static void rtllib_softmac_stop_scan(struct rtllib_device *ieee) { mutex_lock(&ieee->scan_mutex); @@ -888,7 +869,6 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, if (encrypt) beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); - beacon_buf->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_RESP); beacon_buf->info_element[0].id = MFIE_TYPE_SSID; beacon_buf->info_element[0].len = ssid_len; @@ -967,7 +947,6 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest) assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ? WLAN_CAPABILITY_ESS : WLAN_CAPABILITY_IBSS); - if (ieee->short_slot) assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); @@ -1022,8 +1001,6 @@ static struct sk_buff *rtllib_auth_resp(struct rtllib_device *ieee, int status, ether_addr_copy(auth->header.addr1, dest); auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH); return skb; - - } static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr) @@ -1048,8 +1025,6 @@ static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr) (pwr ? RTLLIB_FCTL_PM : 0)); return skb; - - } static struct sk_buff *rtllib_pspoll_func(struct rtllib_device *ieee) @@ -1073,7 +1048,6 @@ static struct sk_buff *rtllib_pspoll_func(struct rtllib_device *ieee) RTLLIB_FCTL_PM); return skb; - } static void rtllib_resp_to_assoc_rq(struct rtllib_device *ieee, u8 *dest) @@ -1084,7 +1058,6 @@ static void rtllib_resp_to_assoc_rq(struct rtllib_device *ieee, u8 *dest) softmac_mgmt_xmit(buf, ieee); } - static void rtllib_resp_to_auth(struct rtllib_device *ieee, int s, u8 *dest) { struct sk_buff *buf = rtllib_auth_resp(ieee, s, dest); @@ -1093,7 +1066,6 @@ static void rtllib_resp_to_auth(struct rtllib_device *ieee, int s, u8 *dest) softmac_mgmt_xmit(buf, ieee); } - static void rtllib_resp_to_probe(struct rtllib_device *ieee, u8 *dest) { struct sk_buff *buf = rtllib_probe_resp(ieee, dest); @@ -1102,7 +1074,6 @@ static void rtllib_resp_to_probe(struct rtllib_device *ieee, u8 *dest) softmac_mgmt_xmit(buf, ieee); } - static inline int SecIsInPMKIDList(struct rtllib_device *ieee, u8 *bssid) { int i = 0; @@ -1215,7 +1186,6 @@ rtllib_association_req(struct rtllib_network *beacon, hdr = skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2); - hdr->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ); hdr->header.duration_id = cpu_to_le16(37); ether_addr_copy(hdr->header.addr1, beacon->bssid); @@ -1235,7 +1205,6 @@ rtllib_association_req(struct rtllib_network *beacon, (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); - hdr->listen_interval = cpu_to_le16(beacon->listen_interval); hdr->info_element[0].id = MFIE_TYPE_SSID; @@ -1713,7 +1682,6 @@ static void rtllib_softmac_check_all_nets(struct rtllib_device *ieee) spin_lock_irqsave(&ieee->lock, flags); list_for_each_entry(target, &ieee->network_list, list) { - /* if the state become different that NOLINK means * we had found what we are searching for */ @@ -1900,7 +1868,6 @@ static inline void rtllib_rx_assoc_rq(struct rtllib_device *ieee, { u8 dest[ETH_ALEN]; - ieee->softmac_stats.rx_ass_rq++; if (assoc_rq_parse(ieee->dev, skb, dest) != -1) rtllib_resp_to_assoc_rq(ieee, dest); @@ -1910,7 +1877,6 @@ static inline void rtllib_rx_assoc_rq(struct rtllib_device *ieee, void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee, short pwr) { - struct sk_buff *buf = rtllib_null_func(ieee, pwr); if (buf) @@ -2008,8 +1974,6 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) } return 1; - - } static inline void rtllib_sta_ps(struct work_struct *work) @@ -2048,7 +2012,6 @@ static inline void rtllib_sta_ps(struct work_struct *work) ieee->ps_time = time; } spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); - } ieee->bAwakePktSent = false; @@ -2063,7 +2026,6 @@ static inline void rtllib_sta_ps(struct work_struct *work) out: spin_unlock_irqrestore(&ieee->lock, flags); - } static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) @@ -2080,7 +2042,6 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) } } return; - } if (ieee->sta_sleep == LPS_IS_SLEEP) @@ -2300,7 +2261,6 @@ static inline int rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb, struct rtllib_rx_stats *rx_stats) { - if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) { if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING && (ieee->iw_mode == IW_MODE_INFRA)) { @@ -2408,7 +2368,6 @@ inline int rtllib_rx_frame_softmac(struct rtllib_device *ieee, */ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee) { - unsigned int queue_index = txb->queue_index; unsigned long flags; int i; @@ -2453,7 +2412,6 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee) rtllib_txb_free(txb); spin_unlock_irqrestore(&ieee->lock, flags); - } void rtllib_reset_queue(struct rtllib_device *ieee) @@ -2468,7 +2426,6 @@ void rtllib_reset_queue(struct rtllib_device *ieee) } ieee->queue_stop = 0; spin_unlock_irqrestore(&ieee->lock, flags); - } EXPORT_SYMBOL(rtllib_reset_queue); @@ -2547,7 +2504,6 @@ static void rtllib_start_ibss_wq(void *data) /* check if we have this cell in our network list */ rtllib_softmac_check_all_nets(ieee); - /* if not then the state is not linked. Maybe the user switched to * ad-hoc mode just after being in monitor mode, or just after * being very few time in managed mode (so the card have had no @@ -2573,7 +2529,6 @@ static void rtllib_start_ibss_wq(void *data) eth_random_addr(ieee->current_network.bssid); if (ieee->modulation & RTLLIB_CCK_MODULATION) { - ieee->current_network.rates_len = 4; ieee->current_network.rates[0] = @@ -2760,7 +2715,6 @@ static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee) b->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_BEACON); return skb; - } struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee) @@ -2794,7 +2748,6 @@ void rtllib_softmac_stop_protocol(struct rtllib_device *ieee, u8 mesh_flag, } EXPORT_SYMBOL(rtllib_softmac_stop_protocol); - void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown) { if (!ieee->proto_started) @@ -3103,7 +3056,6 @@ static void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib) rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_CECHK_BSSID, (u8 *)(&bFilterOutNonAssociatedBSSID)); notify_wx_assoc_event(rtllib); - } static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, @@ -3127,9 +3079,7 @@ static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_BSSID, rtllib->current_network.bssid); - } - } static void @@ -3159,7 +3109,6 @@ bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn) rtllib_MgntDisconnectIBSS(rtllib); if (rtllib->iw_mode == IW_MODE_INFRA) rtllib_MgntDisconnectAP(rtllib, asRsn); - } return true; @@ -3178,7 +3127,6 @@ void notify_wx_assoc_event(struct rtllib_device *ieee) memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); else { - netdev_info(ieee->dev, "%s(): Tell user space disconnected\n", __func__); eth_zero_addr(wrqu.ap_addr.sa_data); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d85a32d2d050..78a70e5f1974 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -25,7 +25,6 @@ const long rtllib_wlan_frequencies[] = { }; EXPORT_SYMBOL(rtllib_wlan_frequencies); - int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, union iwreq_data *wrqu, char *b) { @@ -83,7 +82,6 @@ out: } EXPORT_SYMBOL(rtllib_wx_set_freq); - int rtllib_wx_get_freq(struct rtllib_device *ieee, struct iw_request_info *a, union iwreq_data *wrqu, char *b) @@ -128,13 +126,11 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee, } EXPORT_SYMBOL(rtllib_wx_get_wap); - int rtllib_wx_set_wap(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *awrq, char *extra) { - int ret = 0; unsigned long flags; @@ -164,7 +160,6 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee, goto out; } - if (ifup) rtllib_stop_protocol(ieee, true); @@ -220,7 +215,6 @@ out: spin_unlock_irqrestore(&ieee->lock, flags); return ret; - } EXPORT_SYMBOL(rtllib_wx_get_essid); @@ -228,7 +222,6 @@ int rtllib_wx_set_rate(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - u32 target_rate = wrqu->bitrate.value; ieee->rate = target_rate / 100000; @@ -250,7 +243,6 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee, } EXPORT_SYMBOL(rtllib_wx_get_rate); - int rtllib_wx_set_rts(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -397,7 +389,6 @@ void rtllib_wx_sync_scan_wq(void *data) out: mutex_unlock(&ieee->wx_mutex); - } int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, @@ -425,7 +416,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - int ret = 0, len; short proto_started; unsigned long flags; @@ -445,7 +435,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, if (proto_started) rtllib_stop_protocol(ieee, true); - /* this is just to be sure that the GET wx callback * has consistent infos. not needed otherwise */ @@ -483,7 +472,6 @@ int rtllib_wx_set_rawtx(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - int *parms = (int *)extra; int enable = (parms[0] > 0); short prev = ieee->raw_tx; @@ -524,7 +512,6 @@ int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, } EXPORT_SYMBOL(rtllib_wx_get_name); - /* this is mostly stolen from hostap */ int rtllib_wx_set_power(struct rtllib_device *ieee, struct iw_request_info *info, @@ -570,12 +557,10 @@ int rtllib_wx_set_power(struct rtllib_device *ieee, default: ret = -EINVAL; goto exit; - } exit: mutex_unlock(&ieee->wx_mutex); return ret; - } EXPORT_SYMBOL(rtllib_wx_set_power); @@ -612,6 +597,5 @@ int rtllib_wx_get_power(struct rtllib_device *ieee, exit: mutex_unlock(&ieee->wx_mutex); return 0; - } EXPORT_SYMBOL(rtllib_wx_get_power); From d88b46ce5ab8160a3c5d4efde27197d7545ec19a Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 3 Jun 2023 10:52:51 +0200 Subject: [PATCH 35/62] staging: rtl8192e: Add cfg80211.h and remove defined variables Add cfg80211 and remove defined variables rfc1042_header and bridge_tunnel_header as they are then already defined. Usage of cfg80211 is required to merge driver into wireless subsystem. Signed-off-by: Philipp Hortmann Message-ID: <20230603085251.GA20230@matrix-ESPRIMO-P710> Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 1 + drivers/staging/rtl8192e/rtllib_rx.c | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index f2903b14b793..cdd7fdc5befe 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -38,6 +38,7 @@ #include #include /* ARPHRD_ETHER */ +#include #include #define MAX_PRECMD_CNT 16 diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index d44bf261de54..46c77ed335ab 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -225,18 +225,6 @@ rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb, return 0; } -/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation - * Ethernet-II snap header (RFC1042 for most EtherTypes) - */ -static unsigned char rfc1042_header[] = { - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 -}; - -/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ -static unsigned char bridge_tunnel_header[] = { - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 -}; - /* No encapsulation header if EtherType < 0x600 (=length) */ /* Called by rtllib_rx_frame_decrypt */ From 4e9e2c8026ff200e818928f818dde17a311fed86 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Thu, 8 Jun 2023 08:52:18 +0200 Subject: [PATCH 36/62] staging: rtl8192e: Use standard api to calculate frequency to channel Use ieee80211_freq_khz_to_channel() to calculate frequency to channel to omit proprietary code. Signed-off-by: Philipp Hortmann Message-ID: Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 78a70e5f1974..6fd2e94d5f8a 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -42,15 +42,8 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, if (fwrq->e == 1) { if ((fwrq->m >= (int)2.412e8 && fwrq->m <= (int)2.487e8)) { - int f = fwrq->m / 100000; - int c = 0; - - while ((c < 14) && (f != rtllib_wlan_frequencies[c])) - c++; - - /* hack to fall through */ + fwrq->m = ieee80211_freq_khz_to_channel(fwrq->m / 100); fwrq->e = 0; - fwrq->m = c + 1; } } From 01da3efafe060ba685fcd08f8db665e5a9f1f9fc Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Thu, 8 Jun 2023 08:52:34 +0200 Subject: [PATCH 37/62] staging: rtl8192e: Use standard api to calculate channel to frequency Use ieee80211_channel_to_freq_khz() to calculate channel to frequency to omit proprietary code. Signed-off-by: Philipp Hortmann Message-ID: Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 ++++-- drivers/staging/rtl8192e/rtllib.h | 2 -- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 13 ++----------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 8b656980ee25..3346c4d72c3e 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -342,9 +342,11 @@ static int _rtl92e_wx_get_range(struct net_device *dev, for (i = 0, val = 0; i < 14; i++) { if ((priv->rtllib->active_channel_map)[i + 1]) { + s32 freq_khz; + range->freq[val].i = i + 1; - range->freq[val].m = rtllib_wlan_frequencies[i] * - 100000; + freq_khz = ieee80211_channel_to_freq_khz(i + 1, NL80211_BAND_2GHZ); + range->freq[val].m = freq_khz * 100; range->freq[val].e = 1; val++; } diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index cdd7fdc5befe..87e9169214f6 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -2049,8 +2049,6 @@ void TsStartAddBaProcess(struct rtllib_device *ieee, void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr); void RemoveAllTS(struct rtllib_device *ieee); -extern const long rtllib_wlan_frequencies[]; - static inline const char *escape_essid(const char *essid, u8 essid_len) { static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 6fd2e94d5f8a..d6d90e6ba2d3 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -15,15 +15,6 @@ #include "rtllib.h" #include "dot11d.h" -/* FIXME: add A freqs */ - -const long rtllib_wlan_frequencies[] = { - 2412, 2417, 2422, 2427, - 2432, 2437, 2442, 2447, - 2452, 2457, 2462, 2467, - 2472, 2484 -}; -EXPORT_SYMBOL(rtllib_wlan_frequencies); int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, union iwreq_data *wrqu, char *b) @@ -83,8 +74,8 @@ int rtllib_wx_get_freq(struct rtllib_device *ieee, if (ieee->current_network.channel == 0) return -1; - fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel - 1] * - 100000; + fwrq->m = ieee80211_channel_to_freq_khz(ieee->current_network.channel, + NL80211_BAND_2GHZ) * 100; fwrq->e = 1; return 0; } From f99bbb4412ceffba7e85b9a9227de44c214c68ca Mon Sep 17 00:00:00 2001 From: Prathu Baronia Date: Fri, 16 Jun 2023 20:56:00 +0530 Subject: [PATCH 38/62] axis-fifo: remove the unnecessary dev_info() This dev_info() statement is not needed since drivers need to be quiet under normal operation and its not a good idea to print addresses in kernel log. Signed-off-by: Prathu Baronia Message-ID: <20230616152602.33232-2-prathubaronia2011@gmail.com> Signed-off-by: Greg Kroah-Hartman --- drivers/staging/axis-fifo/axis-fifo.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index 7a21f2423204..98db47cb4fa4 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -906,9 +906,6 @@ static int axis_fifo_probe(struct platform_device *pdev) if (rc < 0) goto err_initial; - dev_info(fifo->dt_device, "axis-fifo created at %pa mapped to 0x%pa, irq=%i\n", - &r_mem->start, &fifo->base_addr, fifo->irq); - return 0; err_initial: From 5dfc6a8ae297800e1edebc76163b0868d5314a4e Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sun, 18 Jun 2023 21:44:54 +0200 Subject: [PATCH 39/62] staging: rtl8192e: Add missing entry CFG80211 in Kconfig Add missing entry CFG80211 in Kconfig to ensure that CFG80211 is available when selecting hardware rtl8192e. Fixes: d88b46ce5ab8 ("staging: rtl8192e: Add cfg80211.h and remove defined variables") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306180620.Ew55XtKJ-lkp@intel.com/ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230618194454.GA10653@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8192e/rtl8192e/Kconfig b/drivers/staging/rtl8192e/rtl8192e/Kconfig index eae8167f79dd..f8f774a16295 100644 --- a/drivers/staging/rtl8192e/rtl8192e/Kconfig +++ b/drivers/staging/rtl8192e/rtl8192e/Kconfig @@ -3,6 +3,7 @@ config RTL8192E tristate "RealTek RTL8192E Wireless LAN NIC driver" depends on PCI && WLAN && RTLLIB depends on m + select CFG80211 select WIRELESS_EXT select WEXT_PRIV select CRYPTO From 90262a95b060b40684192acf3944084cf0ead7fd Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:56:41 +0200 Subject: [PATCH 40/62] staging: rtl8192e: Remove variable stats->freq as it is constant stats->freq is initialized with 1 and then unchanged. All evaluations will result accordingly. Remove resulting dead code and unused defines. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4d8801d37889e6af4f43dff10d1426fc7918f562.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtllib.h | 5 ----- drivers/staging/rtl8192e/rtllib_rx.c | 19 +++++-------------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 17b70dde7eeb..20c0308eb3c1 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1769,7 +1769,6 @@ static void _rtl92e_rx_normal(struct net_device *dev) .signal = 0, .noise = (u8)-98, .rate = 0, - .freq = RTLLIB_24GHZ_BAND, }; unsigned int count = priv->rxringcount; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 87e9169214f6..b4fad9bf0f03 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -500,9 +500,6 @@ enum _REG_PREAMBLE_MODE { #define RTLLIB_CCK_MODULATION (1<<0) #define RTLLIB_OFDM_MODULATION (1<<1) -#define RTLLIB_24GHZ_BAND (1<<0) -#define RTLLIB_52GHZ_BAND (1<<1) - #define RTLLIB_CCK_RATE_LEN 4 #define RTLLIB_CCK_RATE_1MB 0x02 #define RTLLIB_CCK_RATE_2MB 0x04 @@ -549,10 +546,8 @@ struct rtllib_rx_stats { u8 signal; u8 noise; u16 rate; /* in 100 kbps */ - u8 received_channel; u8 control; u8 mask; - u8 freq; u16 len; u64 tsf; u32 beacon_time; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 46c77ed335ab..36dace010203 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2301,12 +2301,7 @@ static inline int rtllib_network_init( network->CountryIeLen = 0; memset(network->CountryIeBuf, 0, MAX_IE_LEN); HTInitializeBssDesc(&network->bssht); - if (stats->freq == RTLLIB_52GHZ_BAND) { - /* for A band (No DS info) */ - network->channel = stats->received_channel; - } else { - network->flags |= NETWORK_HAS_CCK; - } + network->flags |= NETWORK_HAS_CCK; network->wpa_ie_len = 0; network->rsn_ie_len = 0; @@ -2321,14 +2316,10 @@ static inline int rtllib_network_init( network->mode = 0; - if (stats->freq == RTLLIB_52GHZ_BAND) { - network->mode = IEEE_A; - } else { - if (network->flags & NETWORK_HAS_OFDM) - network->mode |= IEEE_G; - if (network->flags & NETWORK_HAS_CCK) - network->mode |= IEEE_B; - } + if (network->flags & NETWORK_HAS_OFDM) + network->mode |= IEEE_G; + if (network->flags & NETWORK_HAS_CCK) + network->mode |= IEEE_B; if (network->mode == 0) { netdev_dbg(ieee->dev, "Filtered out '%s (%pM)' network.\n", From 26cdc2b7bdc9dd201b4920e598c5889aabde4691 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:56:49 +0200 Subject: [PATCH 41/62] staging: rtl8192e: Remove unsupported modes IEEE_N_5G and IEEE_A Remove unsupported modes IEEE_N_5G and IEEE_A as those are not supported by hardware and are not offered by user software. Remove resulting dead code and unused defines. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/40c5b21654376348144280dbe45203140c6e6807.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 4 ---- drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 -- drivers/staging/rtl8192e/rtllib.h | 8 ++------ drivers/staging/rtl8192e/rtllib_rx.c | 4 +--- drivers/staging/rtl8192e/rtllib_softmac.c | 6 ++---- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 2 +- 6 files changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index f030e06f16f6..10dc1c4e9913 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -1816,9 +1816,6 @@ void rtl92e_update_ratr_table(struct net_device *dev) rtl92e_config_rate(dev, &rate_config); ratr_value = rate_config | *pMcsRate << 12; switch (ieee->mode) { - case IEEE_A: - ratr_value &= 0x00000FF0; - break; case IEEE_B: ratr_value &= 0x0000000F; break; @@ -1827,7 +1824,6 @@ void rtl92e_update_ratr_table(struct net_device *dev) ratr_value &= 0x00000FF7; break; case IEEE_N_24G: - case IEEE_N_5G: if (ieee->ht_info->peer_mimo_ps == 0) ratr_value &= 0x0007F007; else diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index fe30a291e64c..9cbe229a601f 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -424,14 +424,12 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) } switch (ieee->mode) { - case IEEE_A: case IEEE_B: case IEEE_G: for (i = 0; i <= 15; i++) pOperateMCS[i] = 0; break; case IEEE_N_24G: - case IEEE_N_5G: pOperateMCS[0] &= RATE_ADPT_1SS_MASK; pOperateMCS[1] &= RATE_ADPT_2SS_MASK; pOperateMCS[3] &= RATE_ADPT_MCS32_MASK; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index b4fad9bf0f03..c789f7a9d3c6 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -309,9 +309,7 @@ enum rt_op_mode { }; #define aSifsTime \ - (((priv->rtllib->current_network.mode == IEEE_A) \ - || (priv->rtllib->current_network.mode == IEEE_N_24G) \ - || (priv->rtllib->current_network.mode == IEEE_N_5G)) ? 16 : 10) + ((priv->rtllib->current_network.mode == IEEE_N_24G) ? 16 : 10) #define MGMT_QUEUE_NUM 5 @@ -1724,12 +1722,10 @@ struct rtllib_device { u8 priv[]; }; -#define IEEE_A (1<<0) #define IEEE_B (1<<1) #define IEEE_G (1<<2) #define IEEE_N_24G (1<<4) -#define IEEE_N_5G (1<<5) -#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) +#define IEEE_MODE_MASK (IEEE_B | IEEE_G) /* Generate a 802.11 header */ diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 36dace010203..cb13964b5181 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2329,9 +2329,7 @@ static inline int rtllib_network_init( } if (network->bssht.bd_support_ht) { - if (network->mode == IEEE_A) - network->mode = IEEE_N_5G; - else if (network->mode & (IEEE_G | IEEE_B)) + if (network->mode & (IEEE_G | IEEE_B)) network->mode = IEEE_N_24G; } if (rtllib_is_empty_essid(network->ssid, network->ssid_len)) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 821ca86b8bcd..438bf0d48b75 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -181,9 +181,7 @@ static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) rate = ieee->basic_rate & 0x7f; if (rate == 0) { - if (ieee->mode == IEEE_A || - ieee->mode == IEEE_N_5G || - (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK)) + if (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK) rate = 0x0c; else rate = 0x02; @@ -2577,7 +2575,7 @@ static void rtllib_start_ibss_wq(void *data) } netdev_info(ieee->dev, "%s(): ieee->mode = %d\n", __func__, ieee->mode); - if ((ieee->mode == IEEE_N_24G) || (ieee->mode == IEEE_N_5G)) + if (ieee->mode == IEEE_N_24G) HTUseDefaultSetting(ieee); else ieee->ht_info->bCurrentHTSupport = false; diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d6d90e6ba2d3..6013ae7c6abf 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -489,7 +489,7 @@ int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, { const char *b = ieee->modulation & RTLLIB_CCK_MODULATION ? "b" : ""; const char *g = ieee->modulation & RTLLIB_OFDM_MODULATION ? "g" : ""; - const char *n = ieee->mode & (IEEE_N_24G | IEEE_N_5G) ? "n" : ""; + const char *n = ieee->mode & (IEEE_N_24G) ? "n" : ""; scnprintf(wrqu->name, sizeof(wrqu->name), "802.11%s%s%s", b, g, n); return 0; From 5cac011cf1e8aab1e43156dbb323818189c3fb90 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:56:56 +0200 Subject: [PATCH 42/62] staging: rtl8192e: Rename constant IEEE_x to WIRELESS_MODE_x Rename constant IEEE_B to WIRELESS_MODE_B, IEEE_G -> WIRELESS_MODE_G and IEEE_N_24G -> WIRELESS_MODE_N_24G to align with rtlwifi driver as requested in TODO. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/37d81ab3cbb0231868d75b11eaa2f65a0e6a9379.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 10 +++---- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 ++-- drivers/staging/rtl8192e/rtllib.h | 7 ++--- drivers/staging/rtl8192e/rtllib_rx.c | 12 ++++---- drivers/staging/rtl8192e/rtllib_softmac.c | 28 +++++++++---------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 2 +- drivers/staging/rtl8192e/rtllib_tx.c | 2 +- drivers/staging/rtl8192e/rtllib_wx.c | 2 +- 10 files changed, 34 insertions(+), 39 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index 10dc1c4e9913..c20dfc81d549 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -162,7 +162,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) &priv->rtllib->current_network.qos_data.parameters; u1bAIFS = qop->aifs[pAcParam] * - ((mode & (IEEE_G | IEEE_N_24G)) ? 9 : 20) + aSifsTime; + ((mode & (WIRELESS_MODE_G | WIRELESS_MODE_N_24G)) ? 9 : 20) + aSifsTime; rtl92e_dm_init_edca_turbo(dev); @@ -1816,14 +1816,14 @@ void rtl92e_update_ratr_table(struct net_device *dev) rtl92e_config_rate(dev, &rate_config); ratr_value = rate_config | *pMcsRate << 12; switch (ieee->mode) { - case IEEE_B: + case WIRELESS_MODE_B: ratr_value &= 0x0000000F; break; - case IEEE_G: - case IEEE_G | IEEE_B: + case WIRELESS_MODE_G: + case WIRELESS_MODE_G | WIRELESS_MODE_B: ratr_value &= 0x00000FF7; break; - case IEEE_N_24G: + case WIRELESS_MODE_N_24G: if (ieee->ht_info->peer_mimo_ps == 0) ratr_value &= 0x0007F007; else diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 20c0308eb3c1..777ee2509e7d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -277,7 +277,7 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap) } } - if (net->mode & (IEEE_G | IEEE_N_24G)) { + if (net->mode & (WIRELESS_MODE_G | WIRELESS_MODE_N_24G)) { u8 slot_time_val; u8 cur_slot_time = priv->slot_time; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 219ff7685c15..70b7d7825c6d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -2104,7 +2104,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) return; } if ((priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) && - (priv->rtllib->mode == IEEE_G)) { + (priv->rtllib->mode == WIRELESS_MODE_G)) { txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH; txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW; } else { diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 9cbe229a601f..7ee3cb846ca1 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -424,12 +424,12 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) } switch (ieee->mode) { - case IEEE_B: - case IEEE_G: + case WIRELESS_MODE_B: + case WIRELESS_MODE_G: for (i = 0; i <= 15; i++) pOperateMCS[i] = 0; break; - case IEEE_N_24G: + case WIRELESS_MODE_N_24G: pOperateMCS[0] &= RATE_ADPT_1SS_MASK; pOperateMCS[1] &= RATE_ADPT_2SS_MASK; pOperateMCS[3] &= RATE_ADPT_MCS32_MASK; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index c789f7a9d3c6..99a6501f615a 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -309,7 +309,7 @@ enum rt_op_mode { }; #define aSifsTime \ - ((priv->rtllib->current_network.mode == IEEE_N_24G) ? 16 : 10) + ((priv->rtllib->current_network.mode == WIRELESS_MODE_N_24G) ? 16 : 10) #define MGMT_QUEUE_NUM 5 @@ -1722,10 +1722,7 @@ struct rtllib_device { u8 priv[]; }; -#define IEEE_B (1<<1) -#define IEEE_G (1<<2) -#define IEEE_N_24G (1<<4) -#define IEEE_MODE_MASK (IEEE_B | IEEE_G) +#define IEEE_MODE_MASK (WIRELESS_MODE_B | WIRELESS_MODE_G) /* Generate a 802.11 header */ diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index cb13964b5181..08782336d390 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2317,9 +2317,9 @@ static inline int rtllib_network_init( network->mode = 0; if (network->flags & NETWORK_HAS_OFDM) - network->mode |= IEEE_G; + network->mode |= WIRELESS_MODE_G; if (network->flags & NETWORK_HAS_CCK) - network->mode |= IEEE_B; + network->mode |= WIRELESS_MODE_B; if (network->mode == 0) { netdev_dbg(ieee->dev, "Filtered out '%s (%pM)' network.\n", @@ -2329,8 +2329,8 @@ static inline int rtllib_network_init( } if (network->bssht.bd_support_ht) { - if (network->mode & (IEEE_G | IEEE_B)) - network->mode = IEEE_N_24G; + if (network->mode & (WIRELESS_MODE_G | WIRELESS_MODE_B)) + network->mode = WIRELESS_MODE_N_24G; } if (rtllib_is_empty_essid(network->ssid, network->ssid_len)) network->flags |= NETWORK_EMPTY_ESSID; @@ -2576,8 +2576,8 @@ static inline void rtllib_process_probe_response( if (is_same_network(&ieee->current_network, network, (network->ssid_len ? 1 : 0))) { update_network(ieee, &ieee->current_network, network); - if ((ieee->current_network.mode == IEEE_N_24G || - ieee->current_network.mode == IEEE_G) && + if ((ieee->current_network.mode == WIRELESS_MODE_N_24G || + ieee->current_network.mode == WIRELESS_MODE_G) && ieee->current_network.berp_info_valid) { if (ieee->current_network.erp_value & ERP_UseProtection) ieee->current_network.buseprotection = true; diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 438bf0d48b75..5609d1dbcf6a 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -181,7 +181,7 @@ static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) rate = ieee->basic_rate & 0x7f; if (rate == 0) { - if (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK) + if (ieee->mode == WIRELESS_MODE_N_24G && !ht_info->bCurSuppCCK) rate = 0x0c; else rate = 0x02; @@ -802,8 +802,8 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, else atim_len = 0; - if ((ieee->current_network.mode == IEEE_G) || - (ieee->current_network.mode == IEEE_N_24G && + if ((ieee->current_network.mode == WIRELESS_MODE_G) || + (ieee->current_network.mode == WIRELESS_MODE_N_24G && ieee->ht_info->bCurSuppCCK)) { erp_len = 3; erpinfo_content = 0; @@ -1470,7 +1470,7 @@ static void rtllib_associate_complete_wq(void *data) netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate); } else { ieee->rate = 22; - ieee->SetWirelessMode(ieee->dev, IEEE_B); + ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_B); netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); } if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { @@ -1654,14 +1654,12 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, (ieee->modulation & RTLLIB_OFDM_MODULATION)) { ieee->rate = 108; - ieee->SetWirelessMode(ieee->dev, - IEEE_G); + ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_G); netdev_info(ieee->dev, "Using G rates\n"); } else { ieee->rate = 22; - ieee->SetWirelessMode(ieee->dev, - IEEE_B); + ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_B); netdev_info(ieee->dev, "Using B rates\n"); } @@ -1826,8 +1824,8 @@ static inline u16 assoc_parse(struct rtllib_device *ieee, struct sk_buff *skb, status_code = le16_to_cpu(response_head->status); if ((status_code == WLAN_STATUS_ASSOC_DENIED_RATES || status_code == WLAN_STATUS_CAPS_UNSUPPORTED) && - ((ieee->mode == IEEE_G) && - (ieee->current_network.mode == IEEE_N_24G) && + ((ieee->mode == WIRELESS_MODE_G) && + (ieee->current_network.mode == WIRELESS_MODE_N_24G) && (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT - 1)))) { ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE; } else { @@ -2239,10 +2237,10 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) ieee->current_network.mode); } else { /*TODO*/ - ieee->SetWirelessMode(ieee->dev, IEEE_G); + ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_G); } - if ((ieee->current_network.mode == IEEE_N_24G) && + if ((ieee->current_network.mode == WIRELESS_MODE_N_24G) && bHalfSupportNmode) { netdev_info(ieee->dev, "======>enter half N mode\n"); ieee->bHalfWirelessN24GMode = true; @@ -2498,7 +2496,7 @@ static void rtllib_start_ibss_wq(void *data) } ieee->state = RTLLIB_NOLINK; - ieee->mode = IEEE_G; + ieee->mode = WIRELESS_MODE_G; /* check if we have this cell in our network list */ rtllib_softmac_check_all_nets(ieee); @@ -2568,14 +2566,14 @@ static void rtllib_start_ibss_wq(void *data) } ieee->current_network.qos_data.supported = 0; - ieee->SetWirelessMode(ieee->dev, IEEE_G); + ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_G); ieee->current_network.mode = ieee->mode; ieee->current_network.atim_window = 0; ieee->current_network.capability = WLAN_CAPABILITY_IBSS; } netdev_info(ieee->dev, "%s(): ieee->mode = %d\n", __func__, ieee->mode); - if (ieee->mode == IEEE_N_24G) + if (ieee->mode == WIRELESS_MODE_N_24G) HTUseDefaultSetting(ieee); else ieee->ht_info->bCurrentHTSupport = false; diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 6013ae7c6abf..8f2f0dca88e7 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -489,7 +489,7 @@ int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, { const char *b = ieee->modulation & RTLLIB_CCK_MODULATION ? "b" : ""; const char *g = ieee->modulation & RTLLIB_OFDM_MODULATION ? "g" : ""; - const char *n = ieee->mode & (IEEE_N_24G) ? "n" : ""; + const char *n = ieee->mode & (WIRELESS_MODE_N_24G) ? "n" : ""; scnprintf(wrqu->name, sizeof(wrqu->name), "802.11%s%s%s", b, g, n); return 0; diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index c3f1910d9f58..ec038ef806c3 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -406,7 +406,7 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, if (is_broadcast_ether_addr(skb->data + 16)) return; - if (ieee->mode < IEEE_N_24G) { + if (ieee->mode < WIRELESS_MODE_N_24G) { if (skb->len > ieee->rts) { tcb_desc->bRTSEnable = true; tcb_desc->rts_rate = MGN_24M; diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 82b537da8b21..184eba571741 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -118,7 +118,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee, max_rate = rate; } - if (network->mode >= IEEE_N_24G) { + if (network->mode >= WIRELESS_MODE_N_24G) { struct ht_capab_ele *ht_cap = NULL; bool is40M = false, isShortGI = false; u8 max_mcs = 0; From 0392ac23a943e7eb01a31844a1757e844c1720ce Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:57:02 +0200 Subject: [PATCH 43/62] staging: rtl8192e: Remove unused enum led_ctl_mode Remove unused enum led_ctl_mode to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/554729dba4d9358bdd6146ebd8fa17a0f525702e.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 99a6501f615a..2ebacd6720f1 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -420,17 +420,6 @@ enum init_gain_op_type { IG_Max }; -enum led_ctl_mode { - LED_CTL_POWER_ON = 1, - LED_CTL_LINK = 2, - LED_CTL_NO_LINK = 3, - LED_CTL_TX = 4, - LED_CTL_RX = 5, - LED_CTL_SITE_SURVEY = 6, - LED_CTL_POWER_OFF = 7, - LED_CTL_START_TO_LINK = 8, -}; - enum wireless_mode { WIRELESS_MODE_UNKNOWN = 0x00, WIRELESS_MODE_A = 0x01, From f6689808492d191b534e844a7db4890ca9ac4afe Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:57:10 +0200 Subject: [PATCH 44/62] staging: rtl8192e: Rename rtllib_state to rtl_link_state Rename rtllib_state to rtl_link_state to align with rtlwifi driver and to increase readability as state is to general. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f21541c16c83356e3cd1e08059847ef9a9eb2ef8.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 2ebacd6720f1..1aabbe11b484 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1119,7 +1119,7 @@ struct rtllib_network { struct list_head list; }; -enum rtllib_state { +enum rtl_link_state { /* the card is not linked at all */ RTLLIB_NOLINK = 0, @@ -1489,7 +1489,7 @@ struct rtllib_device { */ struct rtllib_network current_network; - enum rtllib_state state; + enum rtl_link_state state; int short_slot; int mode; /* A, B, G */ From 52ac3ff9d6418bb61ac9785d93cf0a8c8aacc1cd Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:57:17 +0200 Subject: [PATCH 45/62] staging: rtl8192e: Rename state to link_state Rename state to link_state to align with rtlwifi driver and to increase readability as state is to general. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/9cf4d0b01c6a84a11939099b628754d4c6d54839.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 10 +-- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 36 ++++---- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 16 ++-- .../staging/rtl8192e/rtl8192e/rtl_ethtool.c | 4 +- drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 4 +- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 12 +-- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 14 ++-- drivers/staging/rtl8192e/rtllib_softmac.c | 82 +++++++++---------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 16 ++-- drivers/staging/rtl8192e/rtllib_wx.c | 2 +- 11 files changed, 99 insertions(+), 99 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index c20dfc81d549..b6c086047841 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -52,15 +52,15 @@ static void _rtl92e_update_msr(struct net_device *dev) switch (priv->rtllib->iw_mode) { case IW_MODE_INFRA: - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) msr |= MSR_LINK_MANAGED; break; case IW_MODE_ADHOC: - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) msr |= MSR_LINK_ADHOC; break; case IW_MODE_MASTER: - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) msr |= MSR_LINK_MASTER; break; default: @@ -745,7 +745,7 @@ void rtl92e_link_change(struct net_device *dev) if (!priv->up) return; - if (ieee->state == RTLLIB_LINKED) { + if (ieee->link_state == RTLLIB_LINKED) { _rtl92e_net_update(dev); rtl92e_update_ratr_table(dev); if ((ieee->pairwise_key_type == KEY_TYPE_WEP40) || @@ -760,7 +760,7 @@ void rtl92e_link_change(struct net_device *dev) u32 reg; reg = rtl92e_readl(dev, RCR); - if (priv->rtllib->state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == RTLLIB_LINKED) { if (ieee->intel_promiscuous_md_info.promiscuous_on) ; else diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 777ee2509e7d..7b7500c6b181 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -169,7 +169,7 @@ bool rtl92e_set_rf_state(struct net_device *dev, (priv->rtllib->iw_mode == IW_MODE_ADHOC)) { if ((priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) || (change_source > RF_CHANGE_BY_IPS)) { - if (ieee->state == RTLLIB_LINKED) + if (ieee->link_state == RTLLIB_LINKED) priv->blinked_ingpio = true; else priv->blinked_ingpio = false; @@ -327,7 +327,7 @@ static void _rtl92e_qos_activate(void *data) int i; mutex_lock(&priv->mutex); - if (priv->rtllib->state != RTLLIB_LINKED) + if (priv->rtllib->link_state != RTLLIB_LINKED) goto success; for (i = 0; i < QOS_QUEUE_NUM; i++) @@ -344,7 +344,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv, int ret = 0; u32 size = sizeof(struct rtllib_qos_parameters); - if (priv->rtllib->state != RTLLIB_LINKED) + if (priv->rtllib->link_state != RTLLIB_LINKED) return ret; if (priv->rtllib->iw_mode != IW_MODE_INFRA) @@ -400,7 +400,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv, if (!priv || !network) return 0; - if (priv->rtllib->state != RTLLIB_LINKED) + if (priv->rtllib->link_state != RTLLIB_LINKED) return 0; if (priv->rtllib->iw_mode != IW_MODE_INFRA) @@ -635,7 +635,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) if (priv->polling_timer_on == 0) rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer); - if (priv->rtllib->state != RTLLIB_LINKED) + if (priv->rtllib->link_state != RTLLIB_LINKED) rtllib_softmac_start_protocol(priv->rtllib, 0); rtllib_reset_queue(priv->rtllib); _rtl92e_watchdog_timer_cb(&priv->watch_dog_timer); @@ -660,7 +660,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) priv->rtllib->rtllib_ips_leave(dev); - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) rtl92e_leisure_ps_leave(dev); priv->up = 0; @@ -1009,7 +1009,7 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev) if (rfState == rf_on && (priv->rtllib->iw_mode == IW_MODE_INFRA) && - (priv->rtllib->state == RTLLIB_LINKED)) + (priv->rtllib->link_state == RTLLIB_LINKED)) RxResetType = _rtl92e_rx_check_stuck(dev); if (TxResetType == RESET_TYPE_NORMAL || @@ -1051,7 +1051,7 @@ RESET_START: mutex_lock(&priv->wx_mutex); - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) rtl92e_leisure_ps_leave(dev); if (priv->up) { @@ -1073,9 +1073,9 @@ RESET_START: rtl92e_dm_deinit(dev); rtllib_stop_scan_syncro(ieee); - if (ieee->state == RTLLIB_LINKED) { + if (ieee->link_state == RTLLIB_LINKED) { mutex_lock(&ieee->wx_mutex); - netdev_info(dev, "ieee->state is RTLLIB_LINKED\n"); + netdev_info(dev, "ieee->link_state is RTLLIB_LINKED\n"); rtllib_stop_send_beacons(priv->rtllib); del_timer_sync(&ieee->associate_timer); cancel_delayed_work(&ieee->associate_retry_wq); @@ -1083,7 +1083,7 @@ RESET_START: netif_carrier_off(dev); mutex_unlock(&ieee->wx_mutex); } else { - netdev_info(dev, "ieee->state is NOT LINKED\n"); + netdev_info(dev, "ieee->link_state is NOT LINKED\n"); rtllib_softmac_stop_protocol(priv->rtllib, 0, true); } @@ -1110,14 +1110,14 @@ RESET_START: rtl92e_enable_hw_security_config(dev); - if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == + if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { ieee->set_chan(ieee->dev, ieee->current_network.channel); schedule_work(&ieee->associate_complete_wq); - } else if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == + } else if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_ADHOC) { ieee->set_chan(ieee->dev, ieee->current_network.channel); @@ -1181,7 +1181,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) if (!priv->up || priv->hw_radio_off) return; - if (priv->rtllib->state >= RTLLIB_LINKED) { + if (priv->rtllib->link_state >= RTLLIB_LINKED) { if (priv->rtllib->CntAfterLink < 2) priv->rtllib->CntAfterLink++; } else { @@ -1191,7 +1191,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) rtl92e_dm_watchdog(dev); if (!rtllib_act_scanning(priv->rtllib, false)) { - if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == + if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->link_state == RTLLIB_NOLINK) && (ieee->rf_power_state == rf_on) && !ieee->is_set_key && (!ieee->proto_stoppping) && !ieee->wx_set_enc) { @@ -1202,7 +1202,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) } } } - if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode == + if ((ieee->link_state == RTLLIB_LINKED) && (ieee->iw_mode == IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) { if (ieee->link_detect_info.NumRxOkInPeriod > 100 || ieee->link_detect_info.NumTxOkInPeriod > 100) @@ -1244,7 +1244,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic; ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic; - if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { + if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { u32 TotalRxBcnNum = 0; u32 TotalRxDataNum = 0; @@ -1263,7 +1263,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) "===>%s(): AP is power off, chan:%d, connect another one\n", __func__, priv->chan); - ieee->state = RTLLIB_ASSOCIATING; + ieee->link_state = RTLLIB_ASSOCIATING; RemovePeerTS(priv->rtllib, priv->rtllib->current_network.bssid); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 70b7d7825c6d..74715e254df3 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -291,7 +291,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) if (priv->rtllib->mode != WIRELESS_MODE_N_24G) return; - if (priv->rtllib->state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == RTLLIB_LINKED) { bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && ht_info->bCurShortGI40MHz) || (!ht_info->cur_tx_bw40mhz && @@ -1075,7 +1075,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) dm_digtable.dig_state = DM_STA_DIG_OFF; } - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT; else dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; @@ -1105,7 +1105,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) dm_digtable.dig_algorithm_switch = 0; } - if (priv->rtllib->state != RTLLIB_LINKED) + if (priv->rtllib->link_state != RTLLIB_LINKED) return; if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) && @@ -1406,7 +1406,7 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) if (priv->rtllib->iw_mode == IW_MODE_ADHOC) goto dm_CheckEdcaTurbo_EXIT; - if (priv->rtllib->state != RTLLIB_LINKED) + if (priv->rtllib->link_state != RTLLIB_LINKED) goto dm_CheckEdcaTurbo_EXIT; if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) goto dm_CheckEdcaTurbo_EXIT; @@ -1820,7 +1820,7 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t) bool bSwitchFromCountDiff = false; bool bDoubleTimeInterval = false; - if (priv->rtllib->state == RTLLIB_LINKED && + if (priv->rtllib->link_state == RTLLIB_LINKED && priv->rtllib->bfsync_enable && (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) { u32 rate_bitmap; @@ -1990,7 +1990,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) static u8 reg_c38_State = RegC38_Default; static u32 reset_cnt; - if (priv->rtllib->state == RTLLIB_LINKED && + if (priv->rtllib->link_state == RTLLIB_LINKED && priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { if (priv->rtllib->bfsync_enable == 0) { switch (priv->rtllib->fsync_state) { @@ -2043,7 +2043,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) break; } - if (priv->rtllib->state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == RTLLIB_LINKED) { if (priv->undecorated_smoothed_pwdb <= RegC38_TH) { if (reg_c38_State != @@ -2112,7 +2112,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) txlowpower_threshold = TX_POWER_NEAR_FIELD_THRESH_LOW; } - if (priv->rtllib->state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == RTLLIB_LINKED) { if (priv->undecorated_smoothed_pwdb >= txhipower_threshold) { priv->dynamic_tx_high_pwr = true; priv->dynamic_tx_low_pwr = false; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c index f4f7b74c8cd1..543b0e9dfa88 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c @@ -27,8 +27,8 @@ static u32 _rtl92e_ethtool_get_link(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - return ((priv->rtllib->state == RTLLIB_LINKED) || - (priv->rtllib->state == RTLLIB_LINKED_SCANNING)); + return ((priv->rtllib->link_state == RTLLIB_LINKED) || + (priv->rtllib->link_state == RTLLIB_LINKED_SCANNING)); } const struct ethtool_ops rtl819x_ethtool_ops = { diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c index 54a21c14cc75..bb52a595f75c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c @@ -118,7 +118,7 @@ void rtl92e_ips_enter(struct net_device *dev) rt_state = priv->rtllib->rf_power_state; if (rt_state == rf_on && !psc->bSwRfProcessing && - (priv->rtllib->state != RTLLIB_LINKED) && + (priv->rtllib->link_state != RTLLIB_LINKED) && (priv->rtllib->iw_mode != IW_MODE_MASTER)) { psc->eInactivePowerState = rf_off; _rtl92e_ps_update_rf_state(dev); @@ -209,7 +209,7 @@ void rtl92e_leisure_ps_enter(struct net_device *dev) &priv->rtllib->pwr_save_ctrl; if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && - (priv->rtllib->state == RTLLIB_LINKED)) + (priv->rtllib->link_state == RTLLIB_LINKED)) || (priv->rtllib->iw_mode == IW_MODE_ADHOC) || (priv->rtllib->iw_mode == IW_MODE_MASTER)) return; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 3346c4d72c3e..2d99badfb224 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -169,7 +169,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev, priv->ps_force = false; psc->bLeisurePs = true; } else { - if (priv->rtllib->state == RTLLIB_LINKED) + if (priv->rtllib->link_state == RTLLIB_LINKED) rtl92e_leisure_ps_leave(dev); priv->ps_force = true; @@ -375,10 +375,10 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, int ret; if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { - if ((ieee->state >= RTLLIB_ASSOCIATING) && - (ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED)) + if ((ieee->link_state >= RTLLIB_ASSOCIATING) && + (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED)) return 0; - if ((priv->rtllib->state == RTLLIB_LINKED) && + if ((priv->rtllib->link_state == RTLLIB_LINKED) && (priv->rtllib->CntAfterLink < 2)) return 0; } @@ -409,7 +409,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, priv->rtllib->FirstIe_InScan = true; - if (priv->rtllib->state != RTLLIB_LINKED) { + if (priv->rtllib->link_state != RTLLIB_LINKED) { if (rt_state == rf_off) { if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { @@ -1124,7 +1124,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev) int tmp_qual = 0; int tmp_noise = 0; - if (ieee->state < RTLLIB_LINKED) { + if (ieee->link_state < RTLLIB_LINKED) { wstats->qual.qual = 10; wstats->qual.level = 0; wstats->qual.noise = 0x100 - 100; /* -100 dBm */ diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 1aabbe11b484..933656e9fc8a 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1489,7 +1489,7 @@ struct rtllib_device { */ struct rtllib_network current_network; - enum rtl_link_state state; + enum rtl_link_state link_state; int short_slot; int mode; /* A, B, G */ diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 08782336d390..9beac92c613f 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1196,7 +1196,7 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, u8 nr_subframes) { if (unicast) { - if (ieee->state == RTLLIB_LINKED) { + if (ieee->link_state == RTLLIB_LINKED) { if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + ieee->link_detect_info.NumTxOkInPeriod) > 8) || (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { @@ -2117,7 +2117,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, network->tim.tim_period = info_element->data[1]; network->dtim_period = info_element->data[1]; - if (ieee->state != RTLLIB_LINKED) + if (ieee->link_state != RTLLIB_LINKED) break; network->last_dtim_sta_time = jiffies; @@ -2585,7 +2585,7 @@ static inline void rtllib_process_probe_response( ieee->current_network.buseprotection = false; } if (is_beacon(frame_ctl)) { - if (ieee->state >= RTLLIB_LINKED) + if (ieee->link_state >= RTLLIB_LINKED) ieee->link_detect_info.NumRecvBcnInPeriod++; } } @@ -2643,7 +2643,7 @@ static inline void rtllib_process_probe_response( || ((ieee->current_network.ssid_len == network->ssid_len) && (strncmp(ieee->current_network.ssid, network->ssid, network->ssid_len) == 0) && - (ieee->state == RTLLIB_NOLINK)))) + (ieee->link_state == RTLLIB_NOLINK)))) renew = 1; update_network(ieee, target, network); if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)) @@ -2654,7 +2654,7 @@ static inline void rtllib_process_probe_response( if (is_beacon(frame_ctl) && is_same_network(&ieee->current_network, network, (network->ssid_len ? 1 : 0)) && - (ieee->state == RTLLIB_LINKED)) { + (ieee->link_state == RTLLIB_LINKED)) { ieee->handle_beacon(ieee->dev, beacon, &ieee->current_network); } free_network: @@ -2683,7 +2683,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee, if (ieee->sta_sleep || (ieee->ps != RTLLIB_PS_DISABLED && ieee->iw_mode == IW_MODE_INFRA && - ieee->state == RTLLIB_LINKED)) + ieee->link_state == RTLLIB_LINKED)) schedule_work(&ieee->ps_task); break; @@ -2700,7 +2700,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee, if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && ((ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) && - ieee->state == RTLLIB_LINKED)) + ieee->link_state == RTLLIB_LINKED)) rtllib_rx_probe_rq(ieee, skb); break; } diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 5609d1dbcf6a..242bb5c633e9 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -522,7 +522,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) * if the state become LINKED because of the #1 situation */ - if (ieee->state == RTLLIB_LINKED) + if (ieee->link_state == RTLLIB_LINKED) goto out; if (ieee->sync_scan_hurryup) { netdev_info(ieee->dev, @@ -543,7 +543,7 @@ out: ieee->actscanning = false; ieee->sync_scan_hurryup = 0; - if (ieee->state >= RTLLIB_LINKED) { + if (ieee->link_state >= RTLLIB_LINKED) { if (IS_DOT11D_ENABLE(ieee)) dot11d_scan_complete(ieee); } @@ -1349,7 +1349,7 @@ static void rtllib_associate_abort(struct rtllib_device *ieee) * Here we will check if there are good nets to associate * with, so we retry or just get back to NO_LINK and scanning */ - if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING) { + if (ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATING) { netdev_dbg(ieee->dev, "Authentication failed\n"); ieee->softmac_stats.no_auth_rs++; } else { @@ -1357,7 +1357,7 @@ static void rtllib_associate_abort(struct rtllib_device *ieee) ieee->softmac_stats.no_ass_rs++; } - ieee->state = RTLLIB_ASSOCIATING_RETRY; + ieee->link_state = RTLLIB_ASSOCIATING_RETRY; schedule_delayed_work(&ieee->associate_retry_wq, RTLLIB_SOFTMAC_ASSOC_RETRY_TIME); @@ -1386,7 +1386,7 @@ static void rtllib_associate_step1(struct rtllib_device *ieee, u8 *daddr) if (!skb) rtllib_associate_abort(ieee); else { - ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATING; + ieee->link_state = RTLLIB_ASSOCIATING_AUTHENTICATING; netdev_dbg(ieee->dev, "Sending authentication request\n"); softmac_mgmt_xmit(skb, ieee); if (!timer_pending(&ieee->associate_timer)) { @@ -1508,7 +1508,7 @@ static void rtllib_associate_complete(struct rtllib_device *ieee) { del_timer_sync(&ieee->associate_timer); - ieee->state = RTLLIB_LINKED; + ieee->link_state = RTLLIB_LINKED; rtllib_sta_send_associnfo(ieee); schedule_work(&ieee->associate_complete_wq); @@ -1548,7 +1548,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, /* we are interested in new only if we are not associated * and we are not associating / authenticating */ - if (ieee->state != RTLLIB_NOLINK) + if (ieee->link_state != RTLLIB_NOLINK) return; if ((ieee->iw_mode == IW_MODE_INFRA) && !(net->capability & @@ -1646,7 +1646,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, ieee->ht_info->bCurrentHTSupport = false; - ieee->state = RTLLIB_ASSOCIATING; + ieee->link_state = RTLLIB_ASSOCIATING; schedule_delayed_work( &ieee->associate_procedure_wq, 0); } else { @@ -1664,7 +1664,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, "Using B rates\n"); } memset(ieee->dot11ht_oper_rate_set, 0, 16); - ieee->state = RTLLIB_LINKED; + ieee->link_state = RTLLIB_LINKED; } } } @@ -1682,7 +1682,7 @@ static void rtllib_softmac_check_all_nets(struct rtllib_device *ieee) * we had found what we are searching for */ - if (ieee->state != RTLLIB_NOLINK) + if (ieee->link_state != RTLLIB_NOLINK) break; if (ieee->scan_age == 0 || time_after(target->last_scanned + @@ -1985,7 +1985,7 @@ static inline void rtllib_sta_ps(struct work_struct *work) if ((ieee->ps == RTLLIB_PS_DISABLED || ieee->iw_mode != IW_MODE_INFRA || - ieee->state != RTLLIB_LINKED)) { + ieee->link_state != RTLLIB_LINKED)) { spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); rtllib_sta_wakeup(ieee, 1); @@ -2139,7 +2139,7 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, WLAN_FC_GET_STYPE(frame_ctl)); if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && - ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATED && + ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATED && (ieee->iw_mode == IW_MODE_INFRA)) { errcode = assoc_parse(ieee, skb, &aid); if (!errcode) { @@ -2149,7 +2149,7 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, if (!network) return 1; - ieee->state = RTLLIB_LINKED; + ieee->link_state = RTLLIB_LINKED; ieee->assoc_id = aid; ieee->softmac_stats.rx_ass_ok++; /* station support qos */ @@ -2218,7 +2218,7 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) } if (ieee->open_wep || !challenge) { - ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; + ieee->link_state = RTLLIB_ASSOCIATING_AUTHENTICATED; ieee->softmac_stats.rx_auth_rs_ok++; if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) { if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { @@ -2258,7 +2258,7 @@ rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb, struct rtllib_rx_stats *rx_stats) { if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) { - if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING && + if (ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATING && (ieee->iw_mode == IW_MODE_INFRA)) { netdev_dbg(ieee->dev, "Received authentication response"); @@ -2283,14 +2283,14 @@ rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) * both for disassociation and deauthentication */ if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && - ieee->state == RTLLIB_LINKED && + ieee->link_state == RTLLIB_LINKED && (ieee->iw_mode == IW_MODE_INFRA)) { frame_ctl = le16_to_cpu(header->frame_ctl); netdev_info(ieee->dev, "==========>received disassoc/deauth(%x) frame, reason code:%x\n", WLAN_FC_GET_STYPE(frame_ctl), ((struct rtllib_disassoc *)skb->data)->reason); - ieee->state = RTLLIB_ASSOCIATING; + ieee->link_state = RTLLIB_ASSOCIATING; ieee->softmac_stats.reassoc++; ieee->is_roaming = true; ieee->link_detect_info.bBusyTraffic = false; @@ -2458,7 +2458,7 @@ static void rtllib_start_master_bss(struct rtllib_device *ieee) ether_addr_copy(ieee->current_network.bssid, ieee->dev->dev_addr); ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->state = RTLLIB_LINKED; + ieee->link_state = RTLLIB_LINKED; ieee->link_change(ieee->dev); notify_wx_assoc_event(ieee); netif_carrier_on(ieee->dev); @@ -2495,7 +2495,7 @@ static void rtllib_start_ibss_wq(void *data) ieee->ssid_set = 1; } - ieee->state = RTLLIB_NOLINK; + ieee->link_state = RTLLIB_NOLINK; ieee->mode = WIRELESS_MODE_G; /* check if we have this cell in our network list */ rtllib_softmac_check_all_nets(ieee); @@ -2507,18 +2507,18 @@ static void rtllib_start_ibss_wq(void *data) * after setting ad-hoc mode. So we have to give another try.. * Here, in ibss mode, should be safe to do this without extra care * (in bss mode we had to make sure no-one tried to associate when - * we had just checked the ieee->state and we was going to start the + * we had just checked the ieee->link_state and we was going to start the * scan) because in ibss mode the rtllib_new_net function, when - * finds a good net, just set the ieee->state to RTLLIB_LINKED, + * finds a good net, just set the ieee->link_state to RTLLIB_LINKED, * so, at worst, we waste a bit of time to initiate an unneeded syncro * scan, that will stop at the first round because it sees the state * associated. */ - if (ieee->state == RTLLIB_NOLINK) + if (ieee->link_state == RTLLIB_NOLINK) rtllib_start_scan_syncro(ieee, 0); /* the network definitively is not here.. create a new cell */ - if (ieee->state == RTLLIB_NOLINK) { + if (ieee->link_state == RTLLIB_NOLINK) { netdev_info(ieee->dev, "creating new IBSS cell\n"); ieee->current_network.channel = ieee->bss_start_channel; if (!ieee->wap_set) @@ -2579,9 +2579,9 @@ static void rtllib_start_ibss_wq(void *data) ieee->ht_info->bCurrentHTSupport = false; ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS, - (u8 *)(&ieee->state)); + (u8 *)(&ieee->link_state)); - ieee->state = RTLLIB_LINKED; + ieee->link_state = RTLLIB_LINKED; ieee->link_change(ieee->dev); HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); @@ -2615,7 +2615,7 @@ static void rtllib_start_bss(struct rtllib_device *ieee) rtllib_softmac_check_all_nets(ieee); /* ensure no-one start an associating process (thus setting - * the ieee->state to rtllib_ASSOCIATING) while we + * the ieee->link_state to rtllib_ASSOCIATING) while we * have just checked it and we are going to enable scan. * The rtllib_new_net function is always called with * lock held (from both rtllib_softmac_check_all_nets and @@ -2623,7 +2623,7 @@ static void rtllib_start_bss(struct rtllib_device *ieee) */ spin_lock_irqsave(&ieee->lock, flags); - if (ieee->state == RTLLIB_NOLINK) + if (ieee->link_state == RTLLIB_NOLINK) rtllib_start_scan(ieee); spin_unlock_irqrestore(&ieee->lock, flags); } @@ -2643,7 +2643,7 @@ void rtllib_disassociate(struct rtllib_device *ieee) if (IS_DOT11D_ENABLE(ieee)) dot11d_reset(ieee); - ieee->state = RTLLIB_NOLINK; + ieee->link_state = RTLLIB_NOLINK; ieee->is_set_key = false; ieee->wap_set = 0; @@ -2662,13 +2662,13 @@ static void rtllib_associate_retry_wq(void *data) if (!ieee->proto_started) goto exit; - if (ieee->state != RTLLIB_ASSOCIATING_RETRY) + if (ieee->link_state != RTLLIB_ASSOCIATING_RETRY) goto exit; /* until we do not set the state to RTLLIB_NOLINK * there are no possibility to have someone else trying * to start an association procedure (we get here with - * ieee->state = RTLLIB_ASSOCIATING). + * ieee->link_state = RTLLIB_ASSOCIATING). * When we set the state to RTLLIB_NOLINK it is possible * that the RX path run an attempt to associate, but * both rtllib_softmac_check_all_nets and the @@ -2679,13 +2679,13 @@ static void rtllib_associate_retry_wq(void *data) * state and we are going to start the scan. */ ieee->beinretry = true; - ieee->state = RTLLIB_NOLINK; + ieee->link_state = RTLLIB_NOLINK; rtllib_softmac_check_all_nets(ieee); spin_lock_irqsave(&ieee->lock, flags); - if (ieee->state == RTLLIB_NOLINK) + if (ieee->link_state == RTLLIB_NOLINK) rtllib_start_scan(ieee); spin_unlock_irqrestore(&ieee->lock, flags); @@ -2762,10 +2762,10 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown) cancel_delayed_work_sync(&ieee->link_change_wq); rtllib_stop_scan(ieee); - if (ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED) - ieee->state = RTLLIB_NOLINK; + if (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED) + ieee->link_state = RTLLIB_NOLINK; - if (ieee->state == RTLLIB_LINKED) { + if (ieee->link_state == RTLLIB_LINKED) { if (ieee->iw_mode == IW_MODE_INFRA) SendDisassociation(ieee, 1, WLAN_REASON_DEAUTH_LEAVING); rtllib_disassociate(ieee); @@ -2845,7 +2845,7 @@ int rtllib_softmac_init(struct rtllib_device *ieee) memset(&ieee->current_network, 0, sizeof(struct rtllib_network)); - ieee->state = RTLLIB_NOLINK; + ieee->link_state = RTLLIB_NOLINK; for (i = 0; i < 5; i++) ieee->seq_ctrl[i] = 0; ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); @@ -3036,7 +3036,7 @@ static void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib) u8 i; bool bFilterOutNonAssociatedBSSID = false; - rtllib->state = RTLLIB_NOLINK; + rtllib->link_state = RTLLIB_NOLINK; for (i = 0; i < 6; i++) rtllib->current_network.bssid[i] = 0x55; @@ -3063,7 +3063,7 @@ static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, RemovePeerTS(rtllib, asSta); if (memcmp(rtllib->current_network.bssid, asSta, 6) == 0) { - rtllib->state = RTLLIB_NOLINK; + rtllib->link_state = RTLLIB_NOLINK; for (i = 0; i < 6; i++) rtllib->current_network.bssid[i] = 0x22; @@ -3092,7 +3092,7 @@ rtllib_MgntDisconnectAP( rtllib_MlmeDisassociateRequest(rtllib, rtllib->current_network.bssid, asRsn); - rtllib->state = RTLLIB_NOLINK; + rtllib->link_state = RTLLIB_NOLINK; } bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn) @@ -3100,7 +3100,7 @@ bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn) if (rtllib->ps != RTLLIB_PS_DISABLED) rtllib->sta_wake_up(rtllib->dev); - if (rtllib->state == RTLLIB_LINKED) { + if (rtllib->link_state == RTLLIB_LINKED) { if (rtllib->iw_mode == IW_MODE_ADHOC) rtllib_MgntDisconnectIBSS(rtllib); if (rtllib->iw_mode == IW_MODE_INFRA) @@ -3119,7 +3119,7 @@ void notify_wx_assoc_event(struct rtllib_device *ieee) return; wrqu.ap_addr.sa_family = ARPHRD_ETHER; - if (ieee->state == RTLLIB_LINKED) + if (ieee->link_state == RTLLIB_LINKED) memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); else { diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 8f2f0dca88e7..8e101b63ec75 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -53,7 +53,7 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) - if (ieee->state == RTLLIB_LINKED) { + if (ieee->link_state == RTLLIB_LINKED) { rtllib_stop_send_beacons(ieee); rtllib_start_send_beacons(ieee); } @@ -95,8 +95,8 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee, /* We want avoid to give to the user inconsistent infos*/ spin_lock_irqsave(&ieee->lock, flags); - if (ieee->state != RTLLIB_LINKED && - ieee->state != RTLLIB_LINKED_SCANNING && + if (ieee->link_state != RTLLIB_LINKED && + ieee->link_state != RTLLIB_LINKED_SCANNING && ieee->wap_set == 0) eth_zero_addr(wrqu->ap_addr.sa_data); @@ -184,8 +184,8 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a, goto out; } - if (ieee->state != RTLLIB_LINKED && - ieee->state != RTLLIB_LINKED_SCANNING && + if (ieee->link_state != RTLLIB_LINKED && + ieee->link_state != RTLLIB_LINKED_SCANNING && ieee->ssid_set == 0) { ret = -1; goto out; @@ -323,7 +323,7 @@ void rtllib_wx_sync_scan_wq(void *data) rtllib_stop_all_queues(ieee); rtllib_stop_send_beacons(ieee); - ieee->state = RTLLIB_LINKED_SCANNING; + ieee->link_state = RTLLIB_LINKED_SCANNING; ieee->link_change(ieee->dev); /* wait for ps packet to be kicked out successfully */ msleep(50); @@ -355,7 +355,7 @@ void rtllib_wx_sync_scan_wq(void *data) ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE); - ieee->state = RTLLIB_LINKED; + ieee->link_state = RTLLIB_LINKED; ieee->link_change(ieee->dev); /* Notify AP that I wake up again */ @@ -385,7 +385,7 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, goto out; } - if (ieee->state == RTLLIB_LINKED) { + if (ieee->link_state == RTLLIB_LINKED) { schedule_work(&ieee->wx_sync_scan_wq); /* intentionally forget to up sem */ return 0; diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 184eba571741..a82fd64dbdce 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -619,7 +619,7 @@ int rtllib_wx_set_mlme(struct rtllib_device *ieee, bool deauth = false; struct iw_mlme *mlme = (struct iw_mlme *)extra; - if (ieee->state != RTLLIB_LINKED) + if (ieee->link_state != RTLLIB_LINKED) return -ENOLINK; mutex_lock(&ieee->wx_mutex); From fff6e8699345c853440df4a66650a95f67809bda Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:57:23 +0200 Subject: [PATCH 46/62] staging: rtl8192e: Rename RTLLIB_NOLINK to MAC80211_NOLINK Rename RTLLIB_NOLINK to MAC80211_NOLINK to align with rtlwifi driver. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/74feefdf800304deaf918efbc04344865f7aa01d.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 34 ++++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 7b7500c6b181..b4c618d37a71 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1192,7 +1192,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) if (!rtllib_act_scanning(priv->rtllib, false)) { if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->link_state == - RTLLIB_NOLINK) && + 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 == diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 933656e9fc8a..68f0e1426b35 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1121,7 +1121,7 @@ struct rtllib_network { enum rtl_link_state { /* the card is not linked at all */ - RTLLIB_NOLINK = 0, + MAC80211_NOLINK = 0, /* RTLLIB_ASSOCIATING* are for BSS client mode * the driver shall not perform RX filtering unless diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 9beac92c613f..68f1393b1b63 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2643,7 +2643,7 @@ static inline void rtllib_process_probe_response( || ((ieee->current_network.ssid_len == network->ssid_len) && (strncmp(ieee->current_network.ssid, network->ssid, network->ssid_len) == 0) && - (ieee->link_state == RTLLIB_NOLINK)))) + (ieee->link_state == MAC80211_NOLINK)))) renew = 1; update_network(ieee, target, network); if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 242bb5c633e9..bbb0f61c851d 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -508,7 +508,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) * performing a complete syncro scan before conclude * there are no interesting cell and to create a * new one. In this case the link state is - * RTLLIB_NOLINK until we found an interesting cell. + * MAC80211_NOLINK until we found an interesting cell. * If so the ieee8021_new_net, called by the RX path * will set the state to RTLLIB_LINKED, so we stop * scanning @@ -1548,7 +1548,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, /* we are interested in new only if we are not associated * and we are not associating / authenticating */ - if (ieee->link_state != RTLLIB_NOLINK) + if (ieee->link_state != MAC80211_NOLINK) return; if ((ieee->iw_mode == IW_MODE_INFRA) && !(net->capability & @@ -1682,7 +1682,7 @@ static void rtllib_softmac_check_all_nets(struct rtllib_device *ieee) * we had found what we are searching for */ - if (ieee->link_state != RTLLIB_NOLINK) + if (ieee->link_state != MAC80211_NOLINK) break; if (ieee->scan_age == 0 || time_after(target->last_scanned + @@ -2495,7 +2495,7 @@ static void rtllib_start_ibss_wq(void *data) ieee->ssid_set = 1; } - ieee->link_state = RTLLIB_NOLINK; + ieee->link_state = MAC80211_NOLINK; ieee->mode = WIRELESS_MODE_G; /* check if we have this cell in our network list */ rtllib_softmac_check_all_nets(ieee); @@ -2514,11 +2514,11 @@ static void rtllib_start_ibss_wq(void *data) * scan, that will stop at the first round because it sees the state * associated. */ - if (ieee->link_state == RTLLIB_NOLINK) + if (ieee->link_state == MAC80211_NOLINK) rtllib_start_scan_syncro(ieee, 0); /* the network definitively is not here.. create a new cell */ - if (ieee->link_state == RTLLIB_NOLINK) { + if (ieee->link_state == MAC80211_NOLINK) { netdev_info(ieee->dev, "creating new IBSS cell\n"); ieee->current_network.channel = ieee->bss_start_channel; if (!ieee->wap_set) @@ -2623,7 +2623,7 @@ static void rtllib_start_bss(struct rtllib_device *ieee) */ spin_lock_irqsave(&ieee->lock, flags); - if (ieee->link_state == RTLLIB_NOLINK) + if (ieee->link_state == MAC80211_NOLINK) rtllib_start_scan(ieee); spin_unlock_irqrestore(&ieee->lock, flags); } @@ -2643,7 +2643,7 @@ void rtllib_disassociate(struct rtllib_device *ieee) if (IS_DOT11D_ENABLE(ieee)) dot11d_reset(ieee); - ieee->link_state = RTLLIB_NOLINK; + ieee->link_state = MAC80211_NOLINK; ieee->is_set_key = false; ieee->wap_set = 0; @@ -2665,11 +2665,11 @@ static void rtllib_associate_retry_wq(void *data) if (ieee->link_state != RTLLIB_ASSOCIATING_RETRY) goto exit; - /* until we do not set the state to RTLLIB_NOLINK + /* until we do not set the state to MAC80211_NOLINK * there are no possibility to have someone else trying * to start an association procedure (we get here with * ieee->link_state = RTLLIB_ASSOCIATING). - * When we set the state to RTLLIB_NOLINK it is possible + * When we set the state to MAC80211_NOLINK it is possible * that the RX path run an attempt to associate, but * both rtllib_softmac_check_all_nets and the * RX path works with ieee->lock held so there are no @@ -2679,13 +2679,13 @@ static void rtllib_associate_retry_wq(void *data) * state and we are going to start the scan. */ ieee->beinretry = true; - ieee->link_state = RTLLIB_NOLINK; + ieee->link_state = MAC80211_NOLINK; rtllib_softmac_check_all_nets(ieee); spin_lock_irqsave(&ieee->lock, flags); - if (ieee->link_state == RTLLIB_NOLINK) + if (ieee->link_state == MAC80211_NOLINK) rtllib_start_scan(ieee); spin_unlock_irqrestore(&ieee->lock, flags); @@ -2763,7 +2763,7 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown) rtllib_stop_scan(ieee); if (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED) - ieee->link_state = RTLLIB_NOLINK; + ieee->link_state = MAC80211_NOLINK; if (ieee->link_state == RTLLIB_LINKED) { if (ieee->iw_mode == IW_MODE_INFRA) @@ -2845,7 +2845,7 @@ int rtllib_softmac_init(struct rtllib_device *ieee) memset(&ieee->current_network, 0, sizeof(struct rtllib_network)); - ieee->link_state = RTLLIB_NOLINK; + ieee->link_state = MAC80211_NOLINK; for (i = 0; i < 5; i++) ieee->seq_ctrl[i] = 0; ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); @@ -3036,7 +3036,7 @@ static void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib) u8 i; bool bFilterOutNonAssociatedBSSID = false; - rtllib->link_state = RTLLIB_NOLINK; + rtllib->link_state = MAC80211_NOLINK; for (i = 0; i < 6; i++) rtllib->current_network.bssid[i] = 0x55; @@ -3063,7 +3063,7 @@ static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, RemovePeerTS(rtllib, asSta); if (memcmp(rtllib->current_network.bssid, asSta, 6) == 0) { - rtllib->link_state = RTLLIB_NOLINK; + rtllib->link_state = MAC80211_NOLINK; for (i = 0; i < 6; i++) rtllib->current_network.bssid[i] = 0x22; @@ -3092,7 +3092,7 @@ rtllib_MgntDisconnectAP( rtllib_MlmeDisassociateRequest(rtllib, rtllib->current_network.bssid, asRsn); - rtllib->link_state = RTLLIB_NOLINK; + rtllib->link_state = MAC80211_NOLINK; } bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn) From 2445e3a5822b70354764835380022a5b9d26afb0 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:57:29 +0200 Subject: [PATCH 47/62] staging: rtl8192e: Rename RTLLIB_LINKED to MAC80211_LINKED Rename RTLLIB_LINKED to MAC80211_LINKED to align with rtlwifi driver. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/532bd98301657b2a8329e95eccb993540ae9ba3f.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 10 +++---- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 30 +++++++++---------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 16 +++++----- .../staging/rtl8192e/rtl8192e/rtl_ethtool.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 4 +-- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 8 ++--- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 12 ++++---- drivers/staging/rtl8192e/rtllib_softmac.c | 28 ++++++++--------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 10 +++---- drivers/staging/rtl8192e/rtllib_wx.c | 2 +- 11 files changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index b6c086047841..7683853e7c46 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -52,15 +52,15 @@ static void _rtl92e_update_msr(struct net_device *dev) switch (priv->rtllib->iw_mode) { case IW_MODE_INFRA: - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) msr |= MSR_LINK_MANAGED; break; case IW_MODE_ADHOC: - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) msr |= MSR_LINK_ADHOC; break; case IW_MODE_MASTER: - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) msr |= MSR_LINK_MASTER; break; default: @@ -745,7 +745,7 @@ void rtl92e_link_change(struct net_device *dev) if (!priv->up) return; - if (ieee->link_state == RTLLIB_LINKED) { + if (ieee->link_state == MAC80211_LINKED) { _rtl92e_net_update(dev); rtl92e_update_ratr_table(dev); if ((ieee->pairwise_key_type == KEY_TYPE_WEP40) || @@ -760,7 +760,7 @@ void rtl92e_link_change(struct net_device *dev) u32 reg; reg = rtl92e_readl(dev, RCR); - if (priv->rtllib->link_state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == MAC80211_LINKED) { if (ieee->intel_promiscuous_md_info.promiscuous_on) ; else diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index b4c618d37a71..9cb4ae9ba970 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -169,7 +169,7 @@ bool rtl92e_set_rf_state(struct net_device *dev, (priv->rtllib->iw_mode == IW_MODE_ADHOC)) { if ((priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) || (change_source > RF_CHANGE_BY_IPS)) { - if (ieee->link_state == RTLLIB_LINKED) + if (ieee->link_state == MAC80211_LINKED) priv->blinked_ingpio = true; else priv->blinked_ingpio = false; @@ -327,7 +327,7 @@ static void _rtl92e_qos_activate(void *data) int i; mutex_lock(&priv->mutex); - if (priv->rtllib->link_state != RTLLIB_LINKED) + if (priv->rtllib->link_state != MAC80211_LINKED) goto success; for (i = 0; i < QOS_QUEUE_NUM; i++) @@ -344,7 +344,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv, int ret = 0; u32 size = sizeof(struct rtllib_qos_parameters); - if (priv->rtllib->link_state != RTLLIB_LINKED) + if (priv->rtllib->link_state != MAC80211_LINKED) return ret; if (priv->rtllib->iw_mode != IW_MODE_INFRA) @@ -400,7 +400,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv, if (!priv || !network) return 0; - if (priv->rtllib->link_state != RTLLIB_LINKED) + if (priv->rtllib->link_state != MAC80211_LINKED) return 0; if (priv->rtllib->iw_mode != IW_MODE_INFRA) @@ -635,7 +635,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) if (priv->polling_timer_on == 0) rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer); - if (priv->rtllib->link_state != RTLLIB_LINKED) + if (priv->rtllib->link_state != MAC80211_LINKED) rtllib_softmac_start_protocol(priv->rtllib, 0); rtllib_reset_queue(priv->rtllib); _rtl92e_watchdog_timer_cb(&priv->watch_dog_timer); @@ -660,7 +660,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) priv->rtllib->rtllib_ips_leave(dev); - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) rtl92e_leisure_ps_leave(dev); priv->up = 0; @@ -1009,7 +1009,7 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev) if (rfState == rf_on && (priv->rtllib->iw_mode == IW_MODE_INFRA) && - (priv->rtllib->link_state == RTLLIB_LINKED)) + (priv->rtllib->link_state == MAC80211_LINKED)) RxResetType = _rtl92e_rx_check_stuck(dev); if (TxResetType == RESET_TYPE_NORMAL || @@ -1051,7 +1051,7 @@ RESET_START: mutex_lock(&priv->wx_mutex); - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) rtl92e_leisure_ps_leave(dev); if (priv->up) { @@ -1073,9 +1073,9 @@ RESET_START: rtl92e_dm_deinit(dev); rtllib_stop_scan_syncro(ieee); - if (ieee->link_state == RTLLIB_LINKED) { + if (ieee->link_state == MAC80211_LINKED) { mutex_lock(&ieee->wx_mutex); - netdev_info(dev, "ieee->link_state is RTLLIB_LINKED\n"); + netdev_info(dev, "ieee->link_state is MAC80211_LINKED\n"); rtllib_stop_send_beacons(priv->rtllib); del_timer_sync(&ieee->associate_timer); cancel_delayed_work(&ieee->associate_retry_wq); @@ -1110,14 +1110,14 @@ RESET_START: rtl92e_enable_hw_security_config(dev); - if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == + if (ieee->link_state == MAC80211_LINKED && ieee->iw_mode == IW_MODE_INFRA) { ieee->set_chan(ieee->dev, ieee->current_network.channel); schedule_work(&ieee->associate_complete_wq); - } else if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == + } else if (ieee->link_state == MAC80211_LINKED && ieee->iw_mode == IW_MODE_ADHOC) { ieee->set_chan(ieee->dev, ieee->current_network.channel); @@ -1181,7 +1181,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) if (!priv->up || priv->hw_radio_off) return; - if (priv->rtllib->link_state >= RTLLIB_LINKED) { + if (priv->rtllib->link_state >= MAC80211_LINKED) { if (priv->rtllib->CntAfterLink < 2) priv->rtllib->CntAfterLink++; } else { @@ -1202,7 +1202,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) } } } - if ((ieee->link_state == RTLLIB_LINKED) && (ieee->iw_mode == + if ((ieee->link_state == MAC80211_LINKED) && (ieee->iw_mode == IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) { if (ieee->link_detect_info.NumRxOkInPeriod > 100 || ieee->link_detect_info.NumTxOkInPeriod > 100) @@ -1244,7 +1244,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic; ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic; - if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { + if (ieee->link_state == MAC80211_LINKED && ieee->iw_mode == IW_MODE_INFRA) { u32 TotalRxBcnNum = 0; u32 TotalRxDataNum = 0; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 74715e254df3..adb6f12c89d8 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -291,7 +291,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) if (priv->rtllib->mode != WIRELESS_MODE_N_24G) return; - if (priv->rtllib->link_state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == MAC80211_LINKED) { bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && ht_info->bCurShortGI40MHz) || (!ht_info->cur_tx_bw40mhz && @@ -1075,7 +1075,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) dm_digtable.dig_state = DM_STA_DIG_OFF; } - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT; else dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; @@ -1105,7 +1105,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) dm_digtable.dig_algorithm_switch = 0; } - if (priv->rtllib->link_state != RTLLIB_LINKED) + if (priv->rtllib->link_state != MAC80211_LINKED) return; if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) && @@ -1406,7 +1406,7 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) if (priv->rtllib->iw_mode == IW_MODE_ADHOC) goto dm_CheckEdcaTurbo_EXIT; - if (priv->rtllib->link_state != RTLLIB_LINKED) + if (priv->rtllib->link_state != MAC80211_LINKED) goto dm_CheckEdcaTurbo_EXIT; if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) goto dm_CheckEdcaTurbo_EXIT; @@ -1820,7 +1820,7 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t) bool bSwitchFromCountDiff = false; bool bDoubleTimeInterval = false; - if (priv->rtllib->link_state == RTLLIB_LINKED && + if (priv->rtllib->link_state == MAC80211_LINKED && priv->rtllib->bfsync_enable && (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) { u32 rate_bitmap; @@ -1990,7 +1990,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) static u8 reg_c38_State = RegC38_Default; static u32 reset_cnt; - if (priv->rtllib->link_state == RTLLIB_LINKED && + if (priv->rtllib->link_state == MAC80211_LINKED && priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { if (priv->rtllib->bfsync_enable == 0) { switch (priv->rtllib->fsync_state) { @@ -2043,7 +2043,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) break; } - if (priv->rtllib->link_state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == MAC80211_LINKED) { if (priv->undecorated_smoothed_pwdb <= RegC38_TH) { if (reg_c38_State != @@ -2112,7 +2112,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) txlowpower_threshold = TX_POWER_NEAR_FIELD_THRESH_LOW; } - if (priv->rtllib->link_state == RTLLIB_LINKED) { + if (priv->rtllib->link_state == MAC80211_LINKED) { if (priv->undecorated_smoothed_pwdb >= txhipower_threshold) { priv->dynamic_tx_high_pwr = true; priv->dynamic_tx_low_pwr = false; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c index 543b0e9dfa88..1625d1326599 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c @@ -27,7 +27,7 @@ static u32 _rtl92e_ethtool_get_link(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - return ((priv->rtllib->link_state == RTLLIB_LINKED) || + return ((priv->rtllib->link_state == MAC80211_LINKED) || (priv->rtllib->link_state == RTLLIB_LINKED_SCANNING)); } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c index bb52a595f75c..5ecade840d75 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c @@ -118,7 +118,7 @@ void rtl92e_ips_enter(struct net_device *dev) rt_state = priv->rtllib->rf_power_state; if (rt_state == rf_on && !psc->bSwRfProcessing && - (priv->rtllib->link_state != RTLLIB_LINKED) && + (priv->rtllib->link_state != MAC80211_LINKED) && (priv->rtllib->iw_mode != IW_MODE_MASTER)) { psc->eInactivePowerState = rf_off; _rtl92e_ps_update_rf_state(dev); @@ -209,7 +209,7 @@ void rtl92e_leisure_ps_enter(struct net_device *dev) &priv->rtllib->pwr_save_ctrl; if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && - (priv->rtllib->link_state == RTLLIB_LINKED)) + (priv->rtllib->link_state == MAC80211_LINKED)) || (priv->rtllib->iw_mode == IW_MODE_ADHOC) || (priv->rtllib->iw_mode == IW_MODE_MASTER)) return; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 2d99badfb224..4436442b56dd 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -169,7 +169,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev, priv->ps_force = false; psc->bLeisurePs = true; } else { - if (priv->rtllib->link_state == RTLLIB_LINKED) + if (priv->rtllib->link_state == MAC80211_LINKED) rtl92e_leisure_ps_leave(dev); priv->ps_force = true; @@ -378,7 +378,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, if ((ieee->link_state >= RTLLIB_ASSOCIATING) && (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED)) return 0; - if ((priv->rtllib->link_state == RTLLIB_LINKED) && + if ((priv->rtllib->link_state == MAC80211_LINKED) && (priv->rtllib->CntAfterLink < 2)) return 0; } @@ -409,7 +409,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, priv->rtllib->FirstIe_InScan = true; - if (priv->rtllib->link_state != RTLLIB_LINKED) { + if (priv->rtllib->link_state != MAC80211_LINKED) { if (rt_state == rf_off) { if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { @@ -1124,7 +1124,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev) int tmp_qual = 0; int tmp_noise = 0; - if (ieee->link_state < RTLLIB_LINKED) { + if (ieee->link_state < MAC80211_LINKED) { wstats->qual.qual = 10; wstats->qual.level = 0; wstats->qual.noise = 0x100 - 100; /* -100 dBm */ diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 68f0e1426b35..7758bfd90283 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1146,7 +1146,7 @@ enum rtl_link_state { /* the link is ok. the card associated to a BSS or linked * to a ibss cell or acting as an AP and creating the bss */ - RTLLIB_LINKED, + MAC80211_LINKED, /* same as LINKED, but the driver shall apply RX filter * rules as we are in NO_LINK mode. As the card is still diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 68f1393b1b63..78d13ff1f14e 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1196,7 +1196,7 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, u8 nr_subframes) { if (unicast) { - if (ieee->link_state == RTLLIB_LINKED) { + if (ieee->link_state == MAC80211_LINKED) { if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + ieee->link_detect_info.NumTxOkInPeriod) > 8) || (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { @@ -2117,7 +2117,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, network->tim.tim_period = info_element->data[1]; network->dtim_period = info_element->data[1]; - if (ieee->link_state != RTLLIB_LINKED) + if (ieee->link_state != MAC80211_LINKED) break; network->last_dtim_sta_time = jiffies; @@ -2585,7 +2585,7 @@ static inline void rtllib_process_probe_response( ieee->current_network.buseprotection = false; } if (is_beacon(frame_ctl)) { - if (ieee->link_state >= RTLLIB_LINKED) + if (ieee->link_state >= MAC80211_LINKED) ieee->link_detect_info.NumRecvBcnInPeriod++; } } @@ -2654,7 +2654,7 @@ static inline void rtllib_process_probe_response( if (is_beacon(frame_ctl) && is_same_network(&ieee->current_network, network, (network->ssid_len ? 1 : 0)) && - (ieee->link_state == RTLLIB_LINKED)) { + (ieee->link_state == MAC80211_LINKED)) { ieee->handle_beacon(ieee->dev, beacon, &ieee->current_network); } free_network: @@ -2683,7 +2683,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee, if (ieee->sta_sleep || (ieee->ps != RTLLIB_PS_DISABLED && ieee->iw_mode == IW_MODE_INFRA && - ieee->link_state == RTLLIB_LINKED)) + ieee->link_state == MAC80211_LINKED)) schedule_work(&ieee->ps_task); break; @@ -2700,7 +2700,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee, if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && ((ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) && - ieee->link_state == RTLLIB_LINKED)) + ieee->link_state == MAC80211_LINKED)) rtllib_rx_probe_rq(ieee, skb); break; } diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index bbb0f61c851d..d99b98a39cc7 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -510,7 +510,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) * new one. In this case the link state is * MAC80211_NOLINK until we found an interesting cell. * If so the ieee8021_new_net, called by the RX path - * will set the state to RTLLIB_LINKED, so we stop + * will set the state to MAC80211_LINKED, so we stop * scanning * 2- We are linked and the root uses run iwlist scan. * So we switch to RTLLIB_LINKED_SCANNING to remember @@ -522,7 +522,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) * if the state become LINKED because of the #1 situation */ - if (ieee->link_state == RTLLIB_LINKED) + if (ieee->link_state == MAC80211_LINKED) goto out; if (ieee->sync_scan_hurryup) { netdev_info(ieee->dev, @@ -543,7 +543,7 @@ out: ieee->actscanning = false; ieee->sync_scan_hurryup = 0; - if (ieee->link_state >= RTLLIB_LINKED) { + if (ieee->link_state >= MAC80211_LINKED) { if (IS_DOT11D_ENABLE(ieee)) dot11d_scan_complete(ieee); } @@ -1508,7 +1508,7 @@ static void rtllib_associate_complete(struct rtllib_device *ieee) { del_timer_sync(&ieee->associate_timer); - ieee->link_state = RTLLIB_LINKED; + ieee->link_state = MAC80211_LINKED; rtllib_sta_send_associnfo(ieee); schedule_work(&ieee->associate_complete_wq); @@ -1664,7 +1664,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, "Using B rates\n"); } memset(ieee->dot11ht_oper_rate_set, 0, 16); - ieee->link_state = RTLLIB_LINKED; + ieee->link_state = MAC80211_LINKED; } } } @@ -1985,7 +1985,7 @@ static inline void rtllib_sta_ps(struct work_struct *work) if ((ieee->ps == RTLLIB_PS_DISABLED || ieee->iw_mode != IW_MODE_INFRA || - ieee->link_state != RTLLIB_LINKED)) { + ieee->link_state != MAC80211_LINKED)) { spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); rtllib_sta_wakeup(ieee, 1); @@ -2149,7 +2149,7 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, if (!network) return 1; - ieee->link_state = RTLLIB_LINKED; + ieee->link_state = MAC80211_LINKED; ieee->assoc_id = aid; ieee->softmac_stats.rx_ass_ok++; /* station support qos */ @@ -2283,7 +2283,7 @@ rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) * both for disassociation and deauthentication */ if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && - ieee->link_state == RTLLIB_LINKED && + ieee->link_state == MAC80211_LINKED && (ieee->iw_mode == IW_MODE_INFRA)) { frame_ctl = le16_to_cpu(header->frame_ctl); netdev_info(ieee->dev, @@ -2458,7 +2458,7 @@ static void rtllib_start_master_bss(struct rtllib_device *ieee) ether_addr_copy(ieee->current_network.bssid, ieee->dev->dev_addr); ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->link_state = RTLLIB_LINKED; + ieee->link_state = MAC80211_LINKED; ieee->link_change(ieee->dev); notify_wx_assoc_event(ieee); netif_carrier_on(ieee->dev); @@ -2509,7 +2509,7 @@ static void rtllib_start_ibss_wq(void *data) * (in bss mode we had to make sure no-one tried to associate when * we had just checked the ieee->link_state and we was going to start the * scan) because in ibss mode the rtllib_new_net function, when - * finds a good net, just set the ieee->link_state to RTLLIB_LINKED, + * finds a good net, just set the ieee->link_state to MAC80211_LINKED, * so, at worst, we waste a bit of time to initiate an unneeded syncro * scan, that will stop at the first round because it sees the state * associated. @@ -2581,7 +2581,7 @@ static void rtllib_start_ibss_wq(void *data) ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS, (u8 *)(&ieee->link_state)); - ieee->link_state = RTLLIB_LINKED; + ieee->link_state = MAC80211_LINKED; ieee->link_change(ieee->dev); HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); @@ -2765,7 +2765,7 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown) if (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED) ieee->link_state = MAC80211_NOLINK; - if (ieee->link_state == RTLLIB_LINKED) { + if (ieee->link_state == MAC80211_LINKED) { if (ieee->iw_mode == IW_MODE_INFRA) SendDisassociation(ieee, 1, WLAN_REASON_DEAUTH_LEAVING); rtllib_disassociate(ieee); @@ -3100,7 +3100,7 @@ bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn) if (rtllib->ps != RTLLIB_PS_DISABLED) rtllib->sta_wake_up(rtllib->dev); - if (rtllib->link_state == RTLLIB_LINKED) { + if (rtllib->link_state == MAC80211_LINKED) { if (rtllib->iw_mode == IW_MODE_ADHOC) rtllib_MgntDisconnectIBSS(rtllib); if (rtllib->iw_mode == IW_MODE_INFRA) @@ -3119,7 +3119,7 @@ void notify_wx_assoc_event(struct rtllib_device *ieee) return; wrqu.ap_addr.sa_family = ARPHRD_ETHER; - if (ieee->link_state == RTLLIB_LINKED) + if (ieee->link_state == MAC80211_LINKED) memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); else { diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 8e101b63ec75..c1d1bf4d720a 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -53,7 +53,7 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) - if (ieee->link_state == RTLLIB_LINKED) { + if (ieee->link_state == MAC80211_LINKED) { rtllib_stop_send_beacons(ieee); rtllib_start_send_beacons(ieee); } @@ -95,7 +95,7 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee, /* We want avoid to give to the user inconsistent infos*/ spin_lock_irqsave(&ieee->lock, flags); - if (ieee->link_state != RTLLIB_LINKED && + if (ieee->link_state != MAC80211_LINKED && ieee->link_state != RTLLIB_LINKED_SCANNING && ieee->wap_set == 0) @@ -184,7 +184,7 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a, goto out; } - if (ieee->link_state != RTLLIB_LINKED && + if (ieee->link_state != MAC80211_LINKED && ieee->link_state != RTLLIB_LINKED_SCANNING && ieee->ssid_set == 0) { ret = -1; @@ -355,7 +355,7 @@ void rtllib_wx_sync_scan_wq(void *data) ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE); - ieee->link_state = RTLLIB_LINKED; + ieee->link_state = MAC80211_LINKED; ieee->link_change(ieee->dev); /* Notify AP that I wake up again */ @@ -385,7 +385,7 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, goto out; } - if (ieee->link_state == RTLLIB_LINKED) { + if (ieee->link_state == MAC80211_LINKED) { schedule_work(&ieee->wx_sync_scan_wq); /* intentionally forget to up sem */ return 0; diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index a82fd64dbdce..538cedb1dc02 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -619,7 +619,7 @@ int rtllib_wx_set_mlme(struct rtllib_device *ieee, bool deauth = false; struct iw_mlme *mlme = (struct iw_mlme *)extra; - if (ieee->link_state != RTLLIB_LINKED) + if (ieee->link_state != MAC80211_LINKED) return -ENOLINK; mutex_lock(&ieee->wx_mutex); From 57e2936e22ed166734e011abcd755dfce87aefbc Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sat, 17 Jun 2023 15:57:36 +0200 Subject: [PATCH 48/62] staging: rtl8192e: Rename RTLLIB_LINKED_SCANNING Rename RTLLIB_LINKED_SCANNING to MAC80211_LINKED_SCANNING to align with rtlwifi driver. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/25b97cd436c636e750c50f0c03386fcc46e56610.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c | 2 +- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c index 1625d1326599..fab8932e67da 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c @@ -28,7 +28,7 @@ static u32 _rtl92e_ethtool_get_link(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); return ((priv->rtllib->link_state == MAC80211_LINKED) || - (priv->rtllib->link_state == RTLLIB_LINKED_SCANNING)); + (priv->rtllib->link_state == MAC80211_LINKED_SCANNING)); } const struct ethtool_ops rtl819x_ethtool_ops = { diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 7758bfd90283..cdd167de127f 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1153,7 +1153,7 @@ enum rtl_link_state { * logically linked, but it is doing a syncro site survey * then it will be back to LINKED state. */ - RTLLIB_LINKED_SCANNING, + MAC80211_LINKED_SCANNING, }; #define DEFAULT_MAX_SCAN_AGE (15 * HZ) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index d99b98a39cc7..7494c7e6fff6 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -513,7 +513,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) * will set the state to MAC80211_LINKED, so we stop * scanning * 2- We are linked and the root uses run iwlist scan. - * So we switch to RTLLIB_LINKED_SCANNING to remember + * So we switch to MAC80211_LINKED_SCANNING to remember * that we are still logically linked (not interested in * new network events, despite for updating the net list, * but we are temporarly 'unlinked' as the driver shall diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index c1d1bf4d720a..be82f0a655e8 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -96,7 +96,7 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee, spin_lock_irqsave(&ieee->lock, flags); if (ieee->link_state != MAC80211_LINKED && - ieee->link_state != RTLLIB_LINKED_SCANNING && + ieee->link_state != MAC80211_LINKED_SCANNING && ieee->wap_set == 0) eth_zero_addr(wrqu->ap_addr.sa_data); @@ -185,7 +185,7 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a, } if (ieee->link_state != MAC80211_LINKED && - ieee->link_state != RTLLIB_LINKED_SCANNING && + ieee->link_state != MAC80211_LINKED_SCANNING && ieee->ssid_set == 0) { ret = -1; goto out; @@ -323,7 +323,7 @@ void rtllib_wx_sync_scan_wq(void *data) rtllib_stop_all_queues(ieee); rtllib_stop_send_beacons(ieee); - ieee->link_state = RTLLIB_LINKED_SCANNING; + ieee->link_state = MAC80211_LINKED_SCANNING; ieee->link_change(ieee->dev); /* wait for ps packet to be kicked out successfully */ msleep(50); From 413cc33f2742ea8a542a6841393f15a2db62aa20 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 19 Jun 2023 19:47:46 +0530 Subject: [PATCH 49/62] staging: rtl8192e: Rename variable SetWirelessMode Rename variable SetWirelessMode to set_wireless_mode to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/c0a65d217d272bf457917c89462c49e67bbfedb2.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 9cb4ae9ba970..51748166eecc 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -716,7 +716,7 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->check_nic_enough_desc = _rtl92e_check_nic_enough_desc; priv->rtllib->handle_assoc_response = _rtl92e_handle_assoc_response; priv->rtllib->handle_beacon = _rtl92e_handle_beacon; - priv->rtllib->SetWirelessMode = rtl92e_set_wireless_mode; + priv->rtllib->set_wireless_mode = rtl92e_set_wireless_mode; priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave; priv->rtllib->SetBWModeHandler = rtl92e_set_bw_mode; priv->rf_set_chan = rtl92e_set_channel; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index cdd167de127f..581d568476ce 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1690,7 +1690,7 @@ struct rtllib_device { enum ht_channel_width bandwidth, enum ht_extchnl_offset Offset); bool (*GetNmodeSupportBySecCfg)(struct net_device *dev); - void (*SetWirelessMode)(struct net_device *dev, u8 wireless_mode); + void (*set_wireless_mode)(struct net_device *dev, u8 wireless_mode); bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); void (*InitialGainHandler)(struct net_device *dev, u8 Operation); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 7494c7e6fff6..0eaff91d92bd 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1470,7 +1470,7 @@ static void rtllib_associate_complete_wq(void *data) netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate); } else { ieee->rate = 22; - ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_B); + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_B); netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); } if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { @@ -1654,12 +1654,12 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, (ieee->modulation & RTLLIB_OFDM_MODULATION)) { ieee->rate = 108; - ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_G); + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); netdev_info(ieee->dev, "Using G rates\n"); } else { ieee->rate = 22; - ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_B); + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_B); netdev_info(ieee->dev, "Using B rates\n"); } @@ -2233,11 +2233,11 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) } /* Dummy wirless mode setting to avoid encryption issue */ if (bSupportNmode) { - ieee->SetWirelessMode(ieee->dev, + ieee->set_wireless_mode(ieee->dev, ieee->current_network.mode); } else { /*TODO*/ - ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_G); + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); } if ((ieee->current_network.mode == WIRELESS_MODE_N_24G) && @@ -2566,7 +2566,7 @@ static void rtllib_start_ibss_wq(void *data) } ieee->current_network.qos_data.supported = 0; - ieee->SetWirelessMode(ieee->dev, WIRELESS_MODE_G); + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); ieee->current_network.mode = ieee->mode; ieee->current_network.atim_window = 0; ieee->current_network.capability = WLAN_CAPABILITY_IBSS; From 0ec908bc792c02b9ecf6c9f1b218be363d398b1c Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 19 Jun 2023 19:48:15 +0530 Subject: [PATCH 50/62] staging: rtl8192e: Rename variable SetBWModeHandler Rename variable SetBWModeHandler to set_bw_mode_handler to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/fe6c16cfe1d8f7ff41b5fce90fc63383fbfec4f5.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ++-- drivers/staging/rtl8192e/rtllib.h | 6 +++--- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 51748166eecc..a06d1c4e778a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -718,7 +718,7 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->handle_beacon = _rtl92e_handle_beacon; priv->rtllib->set_wireless_mode = rtl92e_set_wireless_mode; priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave; - priv->rtllib->SetBWModeHandler = rtl92e_set_bw_mode; + priv->rtllib->set_bw_mode_handler = rtl92e_set_bw_mode; priv->rf_set_chan = rtl92e_set_channel; priv->rtllib->start_send_beacons = rtl92e_start_beacon; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 7ee3cb846ca1..f9fa3f2bb728 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -833,11 +833,11 @@ static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, + ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20_40, ht_info->CurSTAExtChnlOffset); } else { ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, + ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); } diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 581d568476ce..b3d6699b31ed 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1686,9 +1686,9 @@ struct rtllib_device { /* check whether Tx hw resource available */ short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); - void (*SetBWModeHandler)(struct net_device *dev, - enum ht_channel_width bandwidth, - enum ht_extchnl_offset Offset); + void (*set_bw_mode_handler)(struct net_device *dev, + enum ht_channel_width bandwidth, + enum ht_extchnl_offset Offset); bool (*GetNmodeSupportBySecCfg)(struct net_device *dev); void (*set_wireless_mode)(struct net_device *dev, u8 wireless_mode); bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index be82f0a655e8..d8c7b7377132 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -335,7 +335,7 @@ void rtllib_wx_sync_scan_wq(void *data) b40M = 1; chan_offset = ieee->ht_info->CurSTAExtChnlOffset; bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz; - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, + ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); } @@ -348,7 +348,7 @@ void rtllib_wx_sync_scan_wq(void *data) ieee->set_chan(ieee->dev, chan - 2); else ieee->set_chan(ieee->dev, chan); - ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset); + ieee->set_bw_mode_handler(ieee->dev, bandwidth, chan_offset); } else { ieee->set_chan(ieee->dev, chan); } From a6efe935c7f8670496622156ae424d2acf6eef7d Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 19 Jun 2023 19:48:36 +0530 Subject: [PATCH 51/62] staging: rtl8192e: Rename variable LeisurePSLeave Rename variable LeisurePSLeave to leisure_ps_leave to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/3c63f4d750b7365f233c35c676325c5e4ca54a4c.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index a06d1c4e778a..631cbe016ea9 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -717,7 +717,7 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->handle_assoc_response = _rtl92e_handle_assoc_response; priv->rtllib->handle_beacon = _rtl92e_handle_beacon; priv->rtllib->set_wireless_mode = rtl92e_set_wireless_mode; - priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave; + priv->rtllib->leisure_ps_leave = rtl92e_leisure_ps_leave; priv->rtllib->set_bw_mode_handler = rtl92e_set_bw_mode; priv->rf_set_chan = rtl92e_set_channel; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index b3d6699b31ed..37e6fcd4b1ec 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1703,7 +1703,7 @@ struct rtllib_device { void (*rtllib_ips_leave_wq)(struct net_device *dev); void (*rtllib_ips_leave)(struct net_device *dev); - void (*LeisurePSLeave)(struct net_device *dev); + void (*leisure_ps_leave)(struct net_device *dev); /* This must be the last item so that it points to the data * allocated beyond this structure by alloc_rtllib diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 78d13ff1f14e..91dd3c373aef 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1200,7 +1200,7 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + ieee->link_detect_info.NumTxOkInPeriod) > 8) || (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { - ieee->LeisurePSLeave(ieee->dev); + ieee->leisure_ps_leave(ieee->dev); } } } diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d8c7b7377132..de3db873f305 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -316,7 +316,7 @@ void rtllib_wx_sync_scan_wq(void *data) chan = ieee->current_network.channel; - ieee->LeisurePSLeave(ieee->dev); + ieee->leisure_ps_leave(ieee->dev); /* notify AP to be in PS mode */ rtllib_sta_ps_send_null_frame(ieee, 1); rtllib_sta_ps_send_null_frame(ieee, 1); From 1e302984616bb8e547347ac62beaaca2ad5db053 Mon Sep 17 00:00:00 2001 From: Yogesh Hegde Date: Mon, 19 Jun 2023 19:48:57 +0530 Subject: [PATCH 52/62] staging: rtl8192e: Rename variable InitialGainHandler Rename variable InitialGainHandler to init_gain_handler to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/a2f37a6cb962e9775978ae5f4fde958b74806a4e.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 ++-- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtllib.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 7b0da55fa7aa..267fc6f8800e 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -1109,11 +1109,11 @@ void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation) if (priv->up) { switch (Operation) { case SCAN_OPT_BACKUP: - priv->rtllib->InitialGainHandler(dev, IG_Backup); + priv->rtllib->init_gain_handler(dev, IG_Backup); break; case SCAN_OPT_RESTORE: - priv->rtllib->InitialGainHandler(dev, IG_Restore); + priv->rtllib->init_gain_handler(dev, IG_Restore); break; } } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 631cbe016ea9..4447489a16ea 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -734,7 +734,7 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->SetHwRegHandler = rtl92e_set_reg; priv->rtllib->AllowAllDestAddrHandler = rtl92e_set_monitor_mode; - priv->rtllib->InitialGainHandler = rtl92e_init_gain; + priv->rtllib->init_gain_handler = rtl92e_init_gain; priv->rtllib->rtllib_ips_leave_wq = rtl92e_rtllib_ips_leave_wq; priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave; priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 37e6fcd4b1ec..dbf78b60dd78 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1693,7 +1693,7 @@ struct rtllib_device { void (*set_wireless_mode)(struct net_device *dev, u8 wireless_mode); bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); - void (*InitialGainHandler)(struct net_device *dev, u8 Operation); + void (*init_gain_handler)(struct net_device *dev, u8 Operation); void (*ScanOperationBackupHandler)(struct net_device *dev, u8 Operation); void (*SetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val); From 73bacecfb7dcd064814ee044ec3f1f3d8632bd6a Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Wed, 21 Dec 2022 13:10:47 +0530 Subject: [PATCH 53/62] staging: vchiq_arm: Remove extra struct vchiq_instance declaration Additional declaration of struct vchiq_instance was introduced in the commit 726e79f8a648 ("staging: vchiq_arm: pass vchiq instance to service callbacks"). Drop the extra declaration. Fixes: 726e79f8a648 ("staging: vchiq_arm: pass vchiq instance to service callbacks") Signed-off-by: Umang Jain Reviewed-by: Stefan Wahren Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20221221074047.233473-1-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h b/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h index 66965da11443..52e106f117da 100644 --- a/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h +++ b/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h @@ -78,8 +78,6 @@ struct vchiq_service_params_kernel { short version_min; /* Update for incompatible changes */ }; -struct vchiq_instance; - extern int vchiq_initialise(struct vchiq_instance **pinstance); extern int vchiq_shutdown(struct vchiq_instance *instance); extern int vchiq_connect(struct vchiq_instance *instance); From b59cba2309b16fa364df03e3693b8d45c3fadbd6 Mon Sep 17 00:00:00 2001 From: Franziska Naepelt Date: Mon, 19 Jun 2023 20:03:51 +0200 Subject: [PATCH 54/62] staging: rtl8723bs: Fix indentation issues Fix the following checkpatch indentation issues: - WARNING: suspect code indent for conditional statements (32, 48) - WARNING: suspect code indent for conditional statements (24, 24) - ERROR: code indent should use tabs where possible Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230619180351.18925-1-franziska.naepelt@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 84a9f4dd8f95..1afd1a93bcee 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -581,7 +581,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa psecuritypriv->dot118021XGrpPrivacy = _WEP40_; if (param->u.crypt.key_len == 13) - psecuritypriv->dot118021XGrpPrivacy = _WEP104_; + psecuritypriv->dot118021XGrpPrivacy = _WEP104_; } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { psecuritypriv->dot118021XGrpPrivacy = _TKIP_; @@ -1305,7 +1305,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy } else if (request->n_channels <= 4) { for (j = request->n_channels - 1; j >= 0; j--) for (i = 0; i < survey_times; i++) - memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel)); + memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel)); _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch, survey_times * request->n_channels); } else { _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NULL, 0); @@ -2810,7 +2810,7 @@ int rtw_wdev_alloc(struct adapter *padapter, struct device *dev) wdev->netdev = pnetdev; wdev->iftype = NL80211_IFTYPE_STATION; /* will be init in rtw_hal_init() */ - /* Must sync with _rtw_init_mlme_priv() */ + /* Must sync with _rtw_init_mlme_priv() */ /* pmlmepriv->fw_state = WIFI_STATION_STATE */ padapter->rtw_wdev = wdev; pnetdev->ieee80211_ptr = wdev; From 3b6401444b7b4e8aec0e1c3e069d24fd4baf3586 Mon Sep 17 00:00:00 2001 From: Franziska Naepelt Date: Mon, 19 Jun 2023 20:12:30 +0200 Subject: [PATCH 55/62] staging: rtl8723bs: Fix block comment issue Fix the following checkpatch block comment issue: - WARNING: Block comments use * on subsequent lines Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230619181230.19070-1-franziska.naepelt@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 1afd1a93bcee..3849d6706dfc 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -329,11 +329,11 @@ exit: } /* - Check the given bss is valid by kernel API cfg80211_get_bss() - @padapter : the given adapter - - return true if bss is valid, false for not found. -*/ + * Check the given bss is valid by kernel API cfg80211_get_bss() + * @padapter : the given adapter + * + * return true if bss is valid, false for not found. + */ int rtw_cfg80211_check_bss(struct adapter *padapter) { struct wlan_bssid_ex *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network); From 13904f991b3ab5a48342693e29a6b58fa8f20675 Mon Sep 17 00:00:00 2001 From: Franziska Naepelt Date: Mon, 19 Jun 2023 20:12:46 +0200 Subject: [PATCH 56/62] staging: rtl8723bs: Fix blank line issues Fix the following checkpatch blank line issues: - CHECK: Please don't use multiple blank lines - CHECK: Blank lines aren't necessary before a close brace '}' - CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230619181246.19112-1-franziska.naepelt@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 3849d6706dfc..2ae7843abdf7 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -305,7 +305,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl memcpy(pwlanhdr->addr2, pnetwork->network.mac_address, ETH_ALEN); memcpy(pwlanhdr->addr3, pnetwork->network.mac_address, ETH_ALEN); - pbuf += sizeof(struct ieee80211_hdr_3addr); len = sizeof(struct ieee80211_hdr_3addr); @@ -325,7 +324,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl exit: return bss; - } /* @@ -374,7 +372,6 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter) struct wlan_network *scanned = pmlmepriv->cur_network_scanned; if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) { - memcpy(&cur_network->network, pnetwork, sizeof(struct wlan_bssid_ex)); rtw_cfg80211_inform_bss(padapter, cur_network); } else { @@ -495,7 +492,6 @@ void rtw_cfg80211_indicate_disconnect(struct adapter *padapter) } } - static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) { int ret = 0; @@ -569,7 +565,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa rtw_ap_set_wep_key(padapter, param->u.crypt.key, wep_key_len, wep_key_idx, 1); goto exit; - } /* group key */ @@ -616,11 +611,9 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa pbcmc_sta->ieee8021x_blocked = false; pbcmc_sta->dot118021XPrivacy = psecuritypriv->dot118021XGrpPrivacy;/* rx will use bmc_sta's dot118021XPrivacy */ } - } goto exit; - } if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ @@ -643,7 +636,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa psecuritypriv->busetkipkey = true; } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { - psta->dot118021XPrivacy = _AES_; } else { psta->dot118021XPrivacy = _NO_PRIVACY_; @@ -695,17 +687,13 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa pbcmc_sta->ieee8021x_blocked = false; pbcmc_sta->dot118021XPrivacy = psecuritypriv->dot118021XGrpPrivacy;/* rx will use bmc_sta's dot118021XPrivacy */ } - } - } - } exit: return ret; - } static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) @@ -789,7 +777,6 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param if (strcmp(param->u.crypt.alg, "none") != 0) psta->ieee8021x_blocked = false; - if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; @@ -900,7 +887,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); - if (!mac_addr || is_broadcast_ether_addr(mac_addr)) param->u.crypt.set_tx = 0; /* for wpa/wpa2 group key */ else @@ -932,7 +918,6 @@ addkey_end: kfree(param); return ret; - } static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev, @@ -983,7 +968,6 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, } return 0; - } static int cfg80211_rtw_get_station(struct wiphy *wiphy, @@ -1168,7 +1152,6 @@ void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter) /* ev =translate_scan(padapter, a, pnetwork, ev, stop); */ rtw_cfg80211_inform_bss(padapter, pnetwork); } - } spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); @@ -1200,7 +1183,6 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *b } return ret; - } static int cfg80211_rtw_scan(struct wiphy *wiphy @@ -1312,7 +1294,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy } spin_unlock_bh(&pmlmepriv->lock); - if (_status == false) ret = -1; @@ -1327,7 +1308,6 @@ check_need_indicate_scan_done: exit: return ret; - } static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed) @@ -1342,12 +1322,10 @@ static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 return 0; } - if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2)) psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK; return 0; - } static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, @@ -1373,7 +1351,6 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; - break; default: psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; @@ -1381,7 +1358,6 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, } return 0; - } static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast) @@ -1391,7 +1367,6 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph u32 *profile_cipher = ucast ? &psecuritypriv->dot11PrivacyAlgrthm : &psecuritypriv->dot118021XGrpPrivacy; - if (!cipher) { *profile_cipher = _NO_PRIVACY_; psecuritypriv->ndisencryptstatus = ndisencryptstatus; @@ -1603,7 +1578,6 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev, } if (params->ssid_len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; goto exit; } @@ -1671,7 +1645,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, padapter->mlmepriv.not_indic_disco = true; - if (adapter_wdev_data(padapter)->block == true) { ret = -EBUSY; goto exit; @@ -1694,7 +1667,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, } if (sme->ssid_len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; goto exit; } @@ -1889,7 +1861,6 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, /* overwrite PMKID */ for (index = 0 ; index < NUM_PMKID_CACHE; index++) { if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN)) { - memcpy(psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); psecuritypriv->PMKIDList[index].bUsed = true; psecuritypriv->PMKIDIndex = index+1; @@ -1899,7 +1870,6 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, } if (!blInserted) { - memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, (u8 *)pmksa->bssid, ETH_ALEN); memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); @@ -2135,11 +2105,9 @@ static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc pattrib->seqnum = pmlmeext->mgnt_seq; pmlmeext->mgnt_seq++; - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); - } fail: @@ -2147,11 +2115,8 @@ fail: dev_kfree_skb_any(skb); return NETDEV_TX_OK; - } - - static const struct net_device_ops rtw_cfg80211_monitor_if_ops = { .ndo_start_xmit = rtw_cfg80211_monitor_if_xmit_entry, }; @@ -2324,7 +2289,6 @@ static int rtw_add_beacon(struct adapter *adapter, const u8 *head, size_t head_l else ret = -EINVAL; - kfree(pbuf); return ret; @@ -2404,7 +2368,6 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev return -EINVAL; } - spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; @@ -2423,9 +2386,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev break; } - } - } spin_unlock_bh(&pstapriv->asoc_list_lock); @@ -2433,7 +2394,6 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev associated_clients_update(padapter, updated); return ret; - } static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, @@ -2465,7 +2425,6 @@ static struct sta_info *rtw_sta_info_get_by_idx(const int idx, struct sta_priv * static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndev, int idx, u8 *mac, struct station_info *sinfo) { - int ret = 0; struct adapter *padapter = rtw_netdev_priv(ndev); struct sta_info *psta = NULL; @@ -2568,7 +2527,6 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b exit: return ret; - } static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, @@ -2640,7 +2598,6 @@ exit: static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum nl80211_band band) { - #define MAX_BIT_RATE_40MHZ_MCS15 300 /* Mbps */ #define MAX_BIT_RATE_40MHZ_MCS7 150 /* Mbps */ @@ -2692,12 +2649,10 @@ void rtw_cfg80211_init_wiphy(struct adapter *padapter) /* copy mac_addr to wiphy */ memcpy(wiphy->perm_addr, padapter->eeprompriv.mac_addr, ETH_ALEN); - } static void rtw_cfg80211_preinit_wiphy(struct adapter *padapter, struct wiphy *wiphy) { - wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wiphy->max_scan_ssids = RTW_SSID_SCAN_AMOUNT; @@ -2844,7 +2799,6 @@ unregister_wiphy: wiphy_free(wiphy); exit: return ret; - } void rtw_wdev_free(struct wireless_dev *wdev) From 56424246bbdcc358c3de3906a2a45fa37a559bb0 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 19 Jun 2023 17:09:50 +0200 Subject: [PATCH 57/62] staging: rtl8192e: clean up brace coding style issues Clean up brace coding style in if/else statements to improve readability and clear checkpatch issues. CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 3 ++- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 10 +++++--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 3 ++- drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 3 ++- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 4 +-- drivers/staging/rtl8192e/rtllib_softmac.c | 25 +++++++++++-------- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 +-- 7 files changed, 30 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index 7683853e7c46..e5925899402c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -765,8 +765,9 @@ void rtl92e_link_change(struct net_device *dev) ; else priv->receive_config = reg |= RCR_CBSSID; - } else + } else { priv->receive_config = reg &= ~RCR_CBSSID; + } rtl92e_writel(dev, RCR, reg); } diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 267fc6f8800e..4d7d5123c831 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -39,8 +39,9 @@ void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask, BitShift = _rtl92e_calculate_bit_shift(dwBitMask); NewValue = (OriginalValue & ~dwBitMask) | (dwData << BitShift); rtl92e_writel(dev, dwRegAddr, NewValue); - } else + } else { rtl92e_writel(dev, dwRegAddr, dwData); + } } u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask) @@ -163,10 +164,10 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, _rtl92e_phy_rf_fw_write(dev, eRFPath, RegAddr, New_Value); - } else + } else { _rtl92e_phy_rf_fw_write(dev, eRFPath, RegAddr, Data); + } udelay(200); - } else { if (BitMask != bMask12Bits) { Original_Value = _rtl92e_phy_rf_read(dev, eRFPath, @@ -175,8 +176,9 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, New_Value = (Original_Value & ~BitMask) | (Data << BitShift); _rtl92e_phy_rf_write(dev, eRFPath, RegAddr, New_Value); - } else + } else { _rtl92e_phy_rf_write(dev, eRFPath, RegAddr, Data); + } } } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index adb6f12c89d8..37c275cac40b 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -622,8 +622,9 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) } else if (priv->rtllib->current_network.channel != 14 && priv->bcck_in_ch14) { priv->bcck_in_ch14 = false; rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); - } else + } else { rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); + } } if (priv->cck_present_attn_diff <= -12 || diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c index 5ecade840d75..1c49d5da68eb 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c @@ -219,8 +219,9 @@ void rtl92e_leisure_ps_enter(struct net_device *dev) if (priv->rtllib->ps == RTLLIB_PS_DISABLED) _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | RTLLIB_PS_UNICAST); - } else + } else { psc->LpsIdleCount++; + } } } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 4436442b56dd..b680757cfcf6 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -568,9 +568,9 @@ static int _rtl92e_wx_set_frag(struct net_device *dev, if (priv->hw_radio_off) return 0; - if (wrqu->frag.disabled) + if (wrqu->frag.disabled) { priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD; - else { + } else { if (wrqu->frag.value < MIN_FRAG_THRESHOLD || wrqu->frag.value > MAX_FRAG_THRESHOLD) return -EINVAL; diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 0eaff91d92bd..863e559e552f 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -809,8 +809,9 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, erpinfo_content = 0; if (ieee->current_network.buseprotection) erpinfo_content |= ERP_UseProtection; - } else + } else { erp_len = 0; + } crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; encrypt = ieee->host_encrypt && crypt && crypt->ops && @@ -1383,9 +1384,9 @@ static void rtllib_associate_step1(struct rtllib_device *ieee, u8 *daddr) skb = rtllib_authentication_req(beacon, ieee, 0, daddr); - if (!skb) + if (!skb) { rtllib_associate_abort(ieee); - else { + } else { ieee->link_state = RTLLIB_ASSOCIATING_AUTHENTICATING; netdev_dbg(ieee->dev, "Sending authentication request\n"); softmac_mgmt_xmit(skb, ieee); @@ -1408,9 +1409,9 @@ static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge, skb = rtllib_authentication_req(beacon, ieee, chlen + 2, beacon->bssid); - if (!skb) + if (!skb) { rtllib_associate_abort(ieee); - else { + } else { c = skb_put(skb, chlen + 2); *(c++) = MFIE_TYPE_CHALLENGE; *(c++) = chlen; @@ -1439,9 +1440,9 @@ static void rtllib_associate_step2(struct rtllib_device *ieee) ieee->softmac_stats.tx_ass_rq++; skb = rtllib_association_req(beacon, ieee); - if (!skb) + if (!skb) { rtllib_associate_abort(ieee); - else { + } else { softmac_mgmt_xmit(skb, ieee); mod_timer(&ieee->associate_timer, jiffies + (HZ / 2)); } @@ -1583,11 +1584,12 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, net->ssid_len = net->hidden_ssid_len; ssidbroad = 1; } - } else + } else { ssidmatch = (ieee->current_network.ssid_len == net->ssid_len) && (!strncmp(ieee->current_network.ssid, net->ssid, net->ssid_len)); + } /* if the user set the AP check if match. * if the network does not broadcast essid we check the @@ -2536,8 +2538,9 @@ static void rtllib_start_ibss_wq(void *data) ieee->current_network.rates[3] = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; - } else + } else { ieee->current_network.rates_len = 0; + } if (ieee->modulation & RTLLIB_OFDM_MODULATION) { ieee->current_network.rates_ex_len = 8; @@ -3119,10 +3122,10 @@ void notify_wx_assoc_event(struct rtllib_device *ieee) return; wrqu.ap_addr.sa_family = ARPHRD_ETHER; - if (ieee->link_state == MAC80211_LINKED) + if (ieee->link_state == MAC80211_LINKED) { memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); - else { + } else { netdev_info(ieee->dev, "%s(): Tell user space disconnected\n", __func__); eth_zero_addr(wrqu.ap_addr.sa_data); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index de3db873f305..2de63d1f2009 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -231,9 +231,9 @@ int rtllib_wx_set_rts(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - if (wrqu->rts.disabled || !wrqu->rts.fixed) + if (wrqu->rts.disabled || !wrqu->rts.fixed) { ieee->rts = DEFAULT_RTS_THRESHOLD; - else { + } else { if (wrqu->rts.value < MIN_RTS_THRESHOLD || wrqu->rts.value > MAX_RTS_THRESHOLD) return -EINVAL; From 18b89d19238242147c3d00134329bb39b4ed33d1 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 19 Jun 2023 17:09:51 +0200 Subject: [PATCH 58/62] staging: rtl8192e: convert else if sequence to switch Convert a sequence of else if statements that all check the same variable to a single switch statement. With a switch statement it is easier to see what is going on. Additionally this clears a checkpatch warning. WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 863e559e552f..425d4acbcdf0 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -2830,15 +2830,19 @@ void rtllib_start_protocol(struct rtllib_device *ieee) * attempts does not fail just because the user provide the essid * and the nic is still checking for the AP MAC ?? */ - if (ieee->iw_mode == IW_MODE_INFRA) { + switch (ieee->iw_mode) { + case IW_MODE_INFRA: rtllib_start_bss(ieee); - } else if (ieee->iw_mode == IW_MODE_ADHOC) { + break; + case IW_MODE_ADHOC: rtllib_start_ibss(ieee); - - } else if (ieee->iw_mode == IW_MODE_MASTER) { + break; + case IW_MODE_MASTER: rtllib_start_master_bss(ieee); - } else if (ieee->iw_mode == IW_MODE_MONITOR) { + break; + case IW_MODE_MONITOR: rtllib_start_monitor_mode(ieee); + break; } } From d9902ac3a7cd3008057e8e4cde2688fcddecd68b Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 19 Jun 2023 17:09:52 +0200 Subject: [PATCH 59/62] staging: rtl8192e: remove return statement from void function Remove unnecessary return statement from the void function rtl92e_config_mac(). Issue found by checkpatch. WARNING: void function return statements are not generally useful Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 4d7d5123c831..875540a2079d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -268,7 +268,6 @@ void rtl92e_config_mac(struct net_device *dev) rtl92e_set_bb_reg(dev, pdwArray[i], pdwArray[i + 1], pdwArray[i + 2]); } - return; } static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType) From 910b5ee9b33a1acf91a6e4bbcc7861a19fb9603c Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 19 Jun 2023 17:09:53 +0200 Subject: [PATCH 60/62] staging: rtl8192e: remove comparison to true Remove a comparison to true reported by checkpatch. CHECK: Using comparison to true is error prone Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index b680757cfcf6..88975dc804c6 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -391,7 +391,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, rt_state = priv->rtllib->rf_power_state; if (!priv->up) return -ENETDOWN; - if (priv->rtllib->link_detect_info.bBusyTraffic == true) + if (priv->rtllib->link_detect_info.bBusyTraffic) return -EAGAIN; if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { From 32db98b92c8a204dcf3e178a1368f8320589c56e Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 19 Jun 2023 17:52:03 +0200 Subject: [PATCH 61/62] staging: rtl8192e: remove 5G related code In previous patches we removed 5G code since the hardware that uses this driver does not support 5G. There is still some 5G related code, remove it. All the removed defines are unused and we can safely remove "N-5G" from the rtllib_modes array. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619155203.6039-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 1 - drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 2 -- drivers/staging/rtl8192e/rtllib.h | 1 - drivers/staging/rtl8192e/rtllib_wx.c | 2 +- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h index f4d4b01630a2..09f8c76b7e65 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h @@ -159,7 +159,6 @@ enum _RTL8192PCI_HW { WFCRC2 = 0x2f8, BW_OPMODE = 0x300, -#define BW_OPMODE_5G BIT1 #define BW_OPMODE_20MHZ BIT2 IC_VERRSION = 0x301, MSR = 0x303, diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h index 65365ebe4e85..24fb0ca539ea 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h @@ -266,7 +266,6 @@ #define b3WireAddressLength 0x400 #define b3WireRFPowerDown 0x1 /*#define bHWSISelect 0x8 */ -#define b5GPAPEPolarity 0x40000000 #define b2GPAPEPolarity 0x80000000 #define bRFSW_TxDefaultAnt 0x3 #define bRFSW_TxOptionAnt 0x30 @@ -284,7 +283,6 @@ #define bRFSI_ANTSW 0x100 #define bRFSI_ANTSWB 0x200 #define bRFSI_PAPE 0x400 -#define bRFSI_PAPE5G 0x800 #define bBandSelect 0x1 #define bHTSIG2_GI 0x80 #define bHTSIG2_Smoothing 0x01 diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index dbf78b60dd78..e3ce4431d460 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -427,7 +427,6 @@ enum wireless_mode { WIRELESS_MODE_G = 0x04, WIRELESS_MODE_AUTO = 0x08, WIRELESS_MODE_N_24G = 0x10, - WIRELESS_MODE_N_5G = 0x20 }; #ifndef ETH_P_PAE diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 538cedb1dc02..e9469bfef3dd 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -19,7 +19,7 @@ #include "rtllib.h" static const char * const rtllib_modes[] = { - "a", "b", "g", "?", "N-24G", "N-5G" + "a", "b", "g", "?", "N-24G" }; #define MAX_CUSTOM_LEN 64 From 4a22870cede374d80c5d2f9c5b79253a5a667832 Mon Sep 17 00:00:00 2001 From: Tree Davies Date: Wed, 21 Jun 2023 16:09:35 -0700 Subject: [PATCH 62/62] staging: rtl8192e: Remove whitespace and blank lines This patch cleans up extraneous whitespace for the struct rt_hi_throughput definition. Signed-off-by: Tree Davies Message-ID: Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl819x_HT.h | 61 ++++++++++----------------- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 3e601537412a..2bbd01048561 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -92,68 +92,53 @@ enum ht_aggre_mode { }; struct rt_hi_throughput { - u8 enable_ht; - u8 bCurrentHTSupport; - - u8 bRegBW40MHz; - u8 bCurBW40MHz; - - u8 bRegShortGI40MHz; - u8 bCurShortGI40MHz; - - u8 bRegShortGI20MHz; - u8 bCurShortGI20MHz; - - u8 bRegSuppCCK; - u8 bCurSuppCCK; - + u8 enable_ht; + u8 bCurrentHTSupport; + u8 bRegBW40MHz; + u8 bCurBW40MHz; + u8 bRegShortGI40MHz; + u8 bCurShortGI40MHz; + u8 bRegShortGI20MHz; + u8 bCurShortGI20MHz; + u8 bRegSuppCCK; + u8 bCurSuppCCK; enum ht_spec_ver ePeerHTSpecVer; - struct ht_capab_ele SelfHTCap; struct ht_info_ele SelfHTInfo; - - u8 PeerHTCapBuf[32]; - u8 PeerHTInfoBuf[32]; - - u8 bAMSDU_Support; - u16 nAMSDU_MaxSize; - u8 bCurrent_AMSDU_Support; - u16 nCurrent_AMSDU_MaxSize; - - u8 bAMPDUEnable; - u8 bCurrentAMPDUEnable; - u8 AMPDU_Factor; - u8 CurrentAMPDUFactor; - u8 MPDU_Density; + u8 PeerHTCapBuf[32]; + u8 PeerHTInfoBuf[32]; + u8 bAMSDU_Support; + u16 nAMSDU_MaxSize; + u8 bCurrent_AMSDU_Support; + u16 nCurrent_AMSDU_MaxSize; + u8 bAMPDUEnable; + u8 bCurrentAMPDUEnable; + u8 AMPDU_Factor; + u8 CurrentAMPDUFactor; + u8 MPDU_Density; u8 current_mpdu_density; - enum ht_aggre_mode ForcedAMPDUMode; u8 forced_ampdu_factor; u8 forced_mpdu_density; - enum ht_aggre_mode ForcedAMSDUMode; u8 forced_short_gi; - u8 current_op_mode; - u8 self_mimo_ps; u8 peer_mimo_ps; - enum ht_extchnl_offset CurSTAExtChnlOffset; u8 cur_tx_bw40mhz; u8 sw_bw_in_progress; u8 reg_rt2rt_aggregation; - u8 RT2RT_HT_Mode; + u8 RT2RT_HT_Mode; u8 current_rt2rt_aggregation; u8 current_rt2rt_long_slot_time; u8 sz_rt2rt_agg_buf[10]; - u8 reg_rx_reorder_enable; u8 cur_rx_reorder_enable; u8 rx_reorder_win_size; u8 rx_reorder_pending_time; u16 rx_reorder_drop_counter; - u8 IOTPeer; + u8 IOTPeer; u32 iot_action; u8 iot_ra_func; } __packed;