]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: ks7010: Remove hostif_infrastructure_set2_request_t.
authorQuytelda Kahja <quytelda@tamalin.org>
Fri, 23 Mar 2018 05:07:45 +0000 (22:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Mar 2018 14:58:32 +0000 (15:58 +0100)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c
drivers/staging/ks7010/ks_hostif.h

index 21219d0bbb6a95bb8f4fd518f312bba33cf98a2f..143413c3cae2cfa7bc6354e2bc9323489f8419c4 100644 (file)
@@ -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);
                }
index fde89bafd7fa68f43d792fb0f4a4c7309bda074c..c262fef72806eeb92bd54e722ae0105b8d57d799 100644 (file)
@@ -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;