From: Quytelda Kahja <quytelda@tamalin.org>
To: gregkh@linuxfoundation.org, wsa@the-dreams.de
Cc: devel@driverdev.osuosl.org,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org,
Quytelda Kahja <quytelda@tamalin.org>
Subject: [PATCH 7/7] staging: ks7010: Remove hostif_infrastructure_set2_request_t.
Date: Thu, 22 Mar 2018 22:07:45 -0700 [thread overview]
Message-ID: <20180323050745.28903-7-quytelda@tamalin.org> (raw)
In-Reply-To: <20180323050745.28903-1-quytelda@tamalin.org>
The handling of hostif_infrastructure_set_request_t and
hostif_infrastructure_set2_request_t is identical, with the exception
of the event type value. Merge the two structs so they can be handled
by a single function ('hostif_infrastructure_set_request').
Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
drivers/staging/ks7010/ks_hostif.c | 50 +++-----------------------------------
drivers/staging/ks7010/ks_hostif.h | 16 ------------
2 files changed, 4 insertions(+), 62 deletions(-)
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 21219d0bbb6a..143413c3cae2 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1345,11 +1345,11 @@ void hostif_ps_adhoc_set_request(struct ks_wlan_private *priv)
}
static
-void hostif_infrastructure_set_request(struct ks_wlan_private *priv)
+void hostif_infrastructure_set_request(struct ks_wlan_private *priv, int event)
{
struct hostif_infrastructure_set_request_t *pp;
- pp = hostif_generic_request(sizeof(*pp), HIF_INFRA_SET_REQ);
+ pp = hostif_generic_request(sizeof(*pp), event);
if (!pp)
return;
@@ -1385,48 +1385,6 @@ void hostif_infrastructure_set_request(struct ks_wlan_private *priv)
ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp)), NULL, NULL);
}
-static void hostif_infrastructure_set2_request(struct ks_wlan_private *priv)
-{
- struct hostif_infrastructure_set2_request_t *pp;
-
- pp = hostif_generic_request(sizeof(*pp), HIF_INFRA_SET2_REQ);
- if (!pp)
- return;
-
- init_request(priv, &pp->request);
- pp->ssid.size = priv->reg.ssid.size;
- memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
- pp->beacon_lost_count =
- cpu_to_le16((uint16_t)(priv->reg.beacon_lost_count));
- pp->auth_type = cpu_to_le16((uint16_t)(priv->reg.authenticate_type));
-
- pp->channel_list.body[0] = 1;
- pp->channel_list.body[1] = 8;
- pp->channel_list.body[2] = 2;
- pp->channel_list.body[3] = 9;
- pp->channel_list.body[4] = 3;
- pp->channel_list.body[5] = 10;
- pp->channel_list.body[6] = 4;
- pp->channel_list.body[7] = 11;
- pp->channel_list.body[8] = 5;
- pp->channel_list.body[9] = 12;
- pp->channel_list.body[10] = 6;
- pp->channel_list.body[11] = 13;
- pp->channel_list.body[12] = 7;
- if (priv->reg.phy_type == D_11G_ONLY_MODE) {
- pp->channel_list.size = 13;
- } else {
- pp->channel_list.body[13] = 14;
- pp->channel_list.size = 14;
- }
-
- memcpy(pp->bssid, priv->reg.bssid, ETH_ALEN);
-
- /* send to device request */
- ps_confirm_wait_inc(priv);
- ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp)), NULL, NULL);
-}
-
static
void hostif_adhoc_set_request(struct ks_wlan_private *priv)
{
@@ -1974,9 +1932,9 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
case MODE_INFRASTRUCTURE:
/* Infrastructure mode */
if (!is_valid_ether_addr((u8 *)priv->reg.bssid)) {
- hostif_infrastructure_set_request(priv);
+ hostif_infrastructure_set_request(priv, HIF_INFRA_SET_REQ);
} else {
- hostif_infrastructure_set2_request(priv);
+ hostif_infrastructure_set_request(priv, HIF_INFRA_SET2_REQ);
netdev_dbg(priv->net_dev,
"Infra bssid = %pM\n", priv->reg.bssid);
}
diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
index fde89bafd7fa..c262fef72806 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -386,22 +386,6 @@ struct hostif_infrastructure_set_request_t {
__le16 beacon_lost_count;
__le16 auth_type;
struct channel_list_t channel_list;
-} __packed;
-
-/**
- * struct hostif_infrastructure_set2_request_t
- * @capability: bit5 : preamble
- * bit6 : pbcc - Not supported always 0
- * bit10 : ShortSlotTime
- * bit13 : DSSS-OFDM - Not supported always 0
- */
-struct hostif_infrastructure_set2_request_t {
- struct hostif_hdr header;
- struct hostif_request_t request;
- struct ssid_t ssid;
- __le16 beacon_lost_count;
- __le16 auth_type;
- struct channel_list_t channel_list;
u8 bssid[ETH_ALEN];
} __packed;
--
2.16.2
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
prev parent reply other threads:[~2018-03-23 5:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-16 6:26 [PATCH 1/6] staging: ks7010: Factor out repeated code Quytelda Kahja
2018-03-19 18:51 ` Greg KH
2018-03-20 5:58 ` Quytelda Kahja
2018-03-20 5:58 ` [PATCH 2/6] staging: ks7010: Factor out code into helper methods Quytelda Kahja
2018-03-20 5:58 ` [PATCH 3/6] staging: ks7010: Remove unnecessary parentheses Quytelda Kahja
2018-03-22 17:19 ` Greg KH
2018-03-20 5:58 ` [PATCH 4/6] staging: ks7010: Remove unnecessary braces Quytelda Kahja
2018-03-20 5:58 ` [PATCH 5/6] staging: ks7010: Fix line over 80 characters Quytelda Kahja
2018-03-20 6:08 ` Joe Perches
2018-03-20 5:58 ` [PATCH 6/6] staging: ks7010: Factor out repeated request initialization code Quytelda Kahja
2018-03-22 17:19 ` Greg KH
2018-03-22 17:20 ` [PATCH 1/6] staging: ks7010: Factor out repeated code Greg KH
2018-03-23 5:07 ` [PATCH 1/7] staging: ks7010: Fix line over 80 characters Quytelda Kahja
2018-03-23 5:07 ` [PATCH 2/7] staging: ks7010: Fix lines over 80 characters due to comments Quytelda Kahja
2018-03-23 5:07 ` [PATCH 3/7] staging: ks7010: Factor out common members in request structs Quytelda Kahja
2018-03-23 14:58 ` Greg KH
2018-03-24 6:40 ` [PATCH 1/2] staging: ks7010: Remove trailing "_t" from all structure names Quytelda Kahja
2018-03-24 6:40 ` [PATCH 2/2] staging: ks7010: Fix spelling mistakes Quytelda Kahja
2018-03-28 11:50 ` [PATCH 1/2] staging: ks7010: Remove trailing "_t" from all structure names Greg KH
2018-03-23 5:07 ` [PATCH 4/7] staging: ks7010: Remove duplicate #define's Quytelda Kahja
2018-03-23 5:07 ` [PATCH 5/7] staging: ks7010: Replace memcmp() operation with ether_addr_equal() Quytelda Kahja
2018-03-23 5:07 ` [PATCH 6/7] staging: ks7010: Factor out repeated code for reading IEs Quytelda Kahja
2018-03-23 5:07 ` Quytelda Kahja [this message]
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=20180323050745.28903-7-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®