]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/libertas/assoc.c
libertas: convert GET_LOG to a direct command
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / libertas / assoc.c
index c622e9b63cd1cc62a0233e9fb30a8d6ae1853440..95d98203eb4ebdccbf9936b7a29a745a8715161e 100644 (file)
 #include "cmd.h"
 
 
-static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
-static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+static const u8 bssid_any[ETH_ALEN]  __attribute__ ((aligned (2))) =
+       { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+static const u8 bssid_off[ETH_ALEN]  __attribute__ ((aligned (2))) =
+       { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
 
 static int assoc_helper_essid(struct lbs_private *priv,
@@ -36,7 +38,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
                      escape_essid(assoc_req->ssid, assoc_req->ssid_len));
        if (assoc_req->mode == IW_MODE_INFRA) {
                lbs_send_specific_ssid_scan(priv, assoc_req->ssid,
-                       assoc_req->ssid_len, 0);
+                       assoc_req->ssid_len);
 
                bss = lbs_find_ssid_in_list(priv, assoc_req->ssid,
                                assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel);
@@ -51,7 +53,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
                 *   scan data will cause us to join a non-existant adhoc network
                 */
                lbs_send_specific_ssid_scan(priv, assoc_req->ssid,
-                       assoc_req->ssid_len, 1);
+                       assoc_req->ssid_len);
 
                /* Search for the requested SSID in the scan table */
                bss = lbs_find_ssid_in_list(priv, assoc_req->ssid,
@@ -179,17 +181,6 @@ int lbs_update_channel(struct lbs_private *priv)
        return ret;
 }
 
-void lbs_sync_channel(struct work_struct *work)
-{
-       struct lbs_private *priv = container_of(work, struct lbs_private,
-               sync_channel);
-
-       lbs_deb_enter(LBS_DEB_ASSOC);
-       if (lbs_update_channel(priv))
-               lbs_pr_info("Channel synchronization failed.");
-       lbs_deb_leave(LBS_DEB_ASSOC);
-}
-
 static int assoc_helper_channel(struct lbs_private *priv,
                                 struct assoc_request * assoc_req)
 {
@@ -277,13 +268,11 @@ static int assoc_helper_wep_keys(struct lbs_private *priv,
 
        /* enable/disable the MAC's WEP packet filter */
        if (assoc_req->secinfo.wep_enabled)
-               priv->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE;
+               priv->mac_control |= CMD_ACT_MAC_WEP_ENABLE;
        else
-               priv->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE;
+               priv->mac_control &= ~CMD_ACT_MAC_WEP_ENABLE;
 
-       ret = lbs_set_mac_packet_filter(priv);
-       if (ret)
-               goto out;
+       lbs_set_mac_control(priv);
 
        mutex_lock(&priv->lock);
 
@@ -313,9 +302,7 @@ static int assoc_helper_secinfo(struct lbs_private *priv,
        memcpy(&priv->secinfo, &assoc_req->secinfo,
                sizeof(struct lbs_802_11_security));
 
-       ret = lbs_set_mac_packet_filter(priv);
-       if (ret)
-               goto out;
+       lbs_set_mac_control(priv);
 
        /* If RSN is already enabled, don't try to enable it again, since
         * ENABLE_RSN resets internal state machines and will clobber the
@@ -358,11 +345,7 @@ static int assoc_helper_wpa_keys(struct lbs_private *priv,
 
        if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) {
                clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags);
-               ret = lbs_prepare_and_send_command(priv,
-                                       CMD_802_11_KEY_MATERIAL,
-                                       CMD_ACT_SET,
-                                       CMD_OPTION_WAITFORRSP,
-                                       0, assoc_req);
+               ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req);
                assoc_req->flags = flags;
        }
 
@@ -372,11 +355,7 @@ static int assoc_helper_wpa_keys(struct lbs_private *priv,
        if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
                clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
 
-               ret = lbs_prepare_and_send_command(priv,
-                                       CMD_802_11_KEY_MATERIAL,
-                                       CMD_ACT_SET,
-                                       CMD_OPTION_WAITFORRSP,
-                                       0, assoc_req);
+               ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req);
                assoc_req->flags = flags;
        }
 
@@ -411,11 +390,10 @@ static int should_deauth_infrastructure(struct lbs_private *priv,
 {
        int ret = 0;
 
-       lbs_deb_enter(LBS_DEB_ASSOC);
-
        if (priv->connect_status != LBS_CONNECTED)
                return 0;
 
+       lbs_deb_enter(LBS_DEB_ASSOC);
        if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
                lbs_deb_assoc("Deauthenticating due to new SSID\n");
                ret = 1;
@@ -454,7 +432,7 @@ static int should_deauth_infrastructure(struct lbs_private *priv,
 
 out:
        lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
-       return 0;
+       return ret;
 }
 
 
@@ -641,17 +619,11 @@ void lbs_association_worker(struct work_struct *work)
                }
 
                if (success) {
-                       lbs_deb_assoc("ASSOC: associated to '%s', %s\n",
-                               escape_essid(priv->curbssparams.ssid,
-                                            priv->curbssparams.ssid_len),
+                       lbs_deb_assoc("associated to %s\n",
                                print_mac(mac, priv->curbssparams.bssid));
                        lbs_prepare_and_send_command(priv,
                                CMD_802_11_RSSI,
                                0, CMD_OPTION_WAITFORRSP, 0, NULL);
-
-                       lbs_prepare_and_send_command(priv,
-                               CMD_802_11_GET_LOG,
-                               0, CMD_OPTION_WAITFORRSP, 0, NULL);
                } else {
                        ret = -1;
                }