From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] staging: rtl8192e: Use standard function in rtllib_process_probe_response()
Date: Sat, 9 Sep 2023 20:19:40 +0200 [thread overview]
Message-ID: <f06e976555d2f045effabb3ccfea1a2cf133088d.1694282907.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1694282907.git.philipp.g.hortmann@gmail.com>
Replace proprietary is_beacon() with ieee80211_is_beacon() and
proprietary "WLAN_FC_GET_STYPE(frame_ctl) == RTLLIB_STYPE_PROBE_RESP"
with standard function to increase readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtllib_rx.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 108238aa61d9..89c8d66765fe 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -2448,11 +2448,6 @@ static inline void update_network(struct rtllib_device *ieee,
dst->BssCcxVerNumber = src->BssCcxVerNumber;
}
-static inline int is_beacon(u16 fc)
-{
- return (WLAN_FC_GET_STYPE(fc) == RTLLIB_STYPE_BEACON);
-}
-
static int IsPassiveChannel(struct rtllib_device *rtllib, u8 channel)
{
if (channel > MAX_CHANNEL_NUMBER) {
@@ -2491,7 +2486,7 @@ static inline void rtllib_process_probe_response(
short renew;
struct rtllib_network *network = kzalloc(sizeof(struct rtllib_network),
GFP_ATOMIC);
- u16 frame_ctl = le16_to_cpu(beacon->header.frame_ctl);
+ __le16 frame_ctl = beacon->header.frame_ctl;
if (!network)
return;
@@ -2521,14 +2516,14 @@ static inline void rtllib_process_probe_response(
netdev_dbg(ieee->dev, "Dropped '%s' ( %pM) via %s.\n",
escape_essid(info_element->data, info_element->len),
beacon->header.addr3,
- is_beacon(frame_ctl) ? "BEACON" : "PROBE RESPONSE");
+ ieee80211_is_beacon(frame_ctl) ? "BEACON" : "PROBE RESPONSE");
goto free_network;
}
if (!rtllib_legal_channel(ieee, network->channel))
goto free_network;
- if (WLAN_FC_GET_STYPE(frame_ctl) == RTLLIB_STYPE_PROBE_RESP) {
+ if (ieee80211_is_probe_resp(frame_ctl)) {
if (IsPassiveChannel(ieee, network->channel)) {
netdev_info(ieee->dev,
"GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n",
@@ -2561,7 +2556,7 @@ static inline void rtllib_process_probe_response(
else
ieee->current_network.buseprotection = false;
}
- if (is_beacon(frame_ctl)) {
+ if (ieee80211_is_beacon(frame_ctl)) {
if (ieee->link_state >= MAC80211_LINKED)
ieee->link_detect_info.NumRecvBcnInPeriod++;
}
@@ -2597,7 +2592,7 @@ static inline void rtllib_process_probe_response(
netdev_dbg(ieee->dev, "Adding '%s' ( %pM) via %s.\n",
escape_essid(network->ssid, network->ssid_len),
network->bssid,
- is_beacon(frame_ctl) ? "BEACON" : "PROBE RESPONSE");
+ ieee80211_is_beacon(frame_ctl) ? "BEACON" : "PROBE RESPONSE");
memcpy(target, network, sizeof(*target));
list_add_tail(&target->list, &ieee->network_list);
@@ -2607,7 +2602,7 @@ static inline void rtllib_process_probe_response(
netdev_dbg(ieee->dev, "Updating '%s' ( %pM) via %s.\n",
escape_essid(target->ssid, target->ssid_len),
target->bssid,
- is_beacon(frame_ctl) ? "BEACON" : "PROBE RESPONSE");
+ ieee80211_is_beacon(frame_ctl) ? "BEACON" : "PROBE RESPONSE");
/* we have an entry and we are going to update it. But this
* entry may be already expired. In this case we do the same
@@ -2628,7 +2623,7 @@ static inline void rtllib_process_probe_response(
}
spin_unlock_irqrestore(&ieee->lock, flags);
- if (is_beacon(frame_ctl) &&
+ if (ieee80211_is_beacon(frame_ctl) &&
is_same_network(&ieee->current_network, network,
(network->ssid_len ? 1 : 0)) &&
(ieee->link_state == MAC80211_LINKED)) {
--
2.41.0
next prev parent reply other threads:[~2023-09-09 18:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-09 18:19 [PATCH 0/8] staging: rtl8192e: Use standard functions like ieee80211_is_beacon() Philipp Hortmann
2023-09-09 18:19 ` [PATCH 1/8] staging: rtl8192e: Remove useless equation in debug output Philipp Hortmann
2023-09-09 18:19 ` [PATCH 2/8] staging: rtl8192e: Use standard ieee80211 function in rtllib_rx_mgt() Philipp Hortmann
2023-09-09 18:19 ` Philipp Hortmann [this message]
2023-09-09 18:19 ` [PATCH 4/8] staging: rtl8192e: Use standard function in rtllib_rx_check_duplicate() Philipp Hortmann
2023-09-12 1:09 ` kernel test robot
2023-09-09 18:20 ` [PATCH 5/8] staging: rtl8192e: Use standard function in softmac_mgmt_xmit() Philipp Hortmann
2023-09-09 18:20 ` [PATCH 6/8] staging: rtl8192e: Replace rtl92e_disable_irq with rtl92e_irq_disable Philipp Hortmann
2023-09-09 18:20 ` [PATCH 7/8] staging: rtl8192e: Replace rtl92e_enable_irq with rtl92e_irq_enable Philipp Hortmann
2023-09-09 18:20 ` [PATCH 8/8] staging: rtl8192e: Remove rtllib_get_payload() Philipp Hortmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f06e976555d2f045effabb3ccfea1a2cf133088d.1694282907.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®