mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Quytelda Kahja <quytelda@tamalin.org>
To: gregkh@linuxfoundation.org, wsa@the-dreams.de
Cc: driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Quytelda Kahja <quytelda@tamalin.org>
Subject: [PATCH 4/5] staging: ks7010: Replace local capability constants with kernel constants.
Date: Wed, 28 Feb 2018 21:19:10 -0800	[thread overview]
Message-ID: <20180301051911.1314-4-quytelda@tamalin.org> (raw)
In-Reply-To: <20180301051911.1314-1-quytelda@tamalin.org>

This driver defined constants BSS_CAP_* to represent WLAN capability
codes; however, these constants are already defined in the header
'linux/ieee80211.h' as WLAN_CAPABILITY_*.  This change removes the locally
defined constants and substitutes the kernel's constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>

---
 drivers/staging/ks7010/ks_hostif.c   |  8 ++++----
 drivers/staging/ks7010/ks_hostif.h   | 10 ----------
 drivers/staging/ks7010/ks_wlan_net.c |  6 +++---
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 4d11627a3d72..f425975fbcbc 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1386,14 +1386,14 @@ static __le16 ks_wlan_cap(struct ks_wlan_private *priv)
 	u16 capability = 0x0000;
 
 	if (priv->reg.preamble == SHORT_PREAMBLE) {
-		capability |= BSS_CAP_SHORT_PREAMBLE;
+		capability |= WLAN_CAPABILITY_SHORT_PREAMBLE;
 	}
 
-	capability &= ~(BSS_CAP_PBCC);	/* pbcc not support */
+	capability &= ~(WLAN_CAPABILITY_PBCC);	/* pbcc not support */
 
 	if (priv->reg.phy_type != D_11B_ONLY_MODE) {
-		capability |= BSS_CAP_SHORT_SLOT_TIME;
-		capability &= ~(BSS_CAP_DSSS_OFDM);
+		capability |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
+		capability &= ~(WLAN_CAPABILITY_DSSS_OFDM);
 	}
 
 	return cpu_to_le16((uint16_t)capability);
diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
index b46aa94c0d48..8f08e1e58991 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -284,16 +284,6 @@ struct ap_info_t {
 	u8 pad0;	/* +09 */
 	__le16 beacon_period;	/* +10 */
 	__le16 capability;	/* +12 */
-#define BSS_CAP_ESS             BIT(0)
-#define BSS_CAP_IBSS            BIT(1)
-#define BSS_CAP_CF_POLABLE      BIT(2)
-#define BSS_CAP_CF_POLL_REQ     BIT(3)
-#define BSS_CAP_PRIVACY         BIT(4)
-#define BSS_CAP_SHORT_PREAMBLE  BIT(5)
-#define BSS_CAP_PBCC            BIT(6)
-#define BSS_CAP_CHANNEL_AGILITY BIT(7)
-#define BSS_CAP_SHORT_SLOT_TIME BIT(10)
-#define BSS_CAP_DSSS_OFDM       BIT(13)
 	u8 frame_type;	/* +14 */
 	u8 ch_info;	/* +15 */
 #define FRAME_TYPE_BEACON	0x80
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index e48c55769c94..91acf87ab8dd 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1366,8 +1366,8 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 	/* Add mode */
 	iwe.cmd = SIOCGIWMODE;
 	capabilities = ap->capability;
-	if (capabilities & (BSS_CAP_ESS | BSS_CAP_IBSS)) {
-		if (capabilities & BSS_CAP_ESS)
+	if (capabilities & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)) {
+		if (capabilities & WLAN_CAPABILITY_ESS)
 			iwe.u.mode = IW_MODE_INFRA;
 		else
 			iwe.u.mode = IW_MODE_ADHOC;
@@ -1396,7 +1396,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 
 	/* Add encryption capability */
 	iwe.cmd = SIOCGIWENCODE;
-	if (capabilities & BSS_CAP_PRIVACY)
+	if (capabilities & WLAN_CAPABILITY_PRIVACY)
 		iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
 	else
 		iwe.u.data.flags = IW_ENCODE_DISABLED;
-- 
2.16.2

  parent reply	other threads:[~2018-03-01  5:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  5:19 [PATCH 1/5] staging: ks7010: Use constants from ieee80211_eid instead of literal ints Quytelda Kahja
2018-03-01  5:19 ` [PATCH 2/5] staging: ks7010: Replace SSID_MAX_SIZE with IEEE80211_MAX_SSID_LEN Quytelda Kahja
2018-03-01  5:19 ` [PATCH 3/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()' Quytelda Kahja
2018-03-01  6:37   ` Tobin C. Harding
2018-03-01 11:15     ` Dan Carpenter
2018-03-01 20:54       ` Tobin C. Harding
2018-03-02  1:28         ` Quytelda Kahja
2018-03-02  2:21           ` Tobin C. Harding
2018-03-02  9:07           ` Dan Carpenter
2018-03-02  9:05         ` Dan Carpenter
2018-03-04 22:57           ` Tobin C. Harding
2018-03-01  5:19 ` Quytelda Kahja [this message]
2018-03-01  5:19 ` [PATCH 5/5] staging: ks7010: Replace local frame type constants with kernel constants Quytelda Kahja
2018-03-01  6:33 ` [PATCH 1/5] staging: ks7010: Use constants from ieee80211_eid instead of literal ints Tobin C. Harding
2018-03-01  6:34 ` Tobin C. Harding

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=20180301051911.1314-4-quytelda@tamalin.org \
    --to=quytelda@tamalin.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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®