Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 1 | /* Copyright (C) 2006, Red Hat, Inc. */ |
| 2 | |
| 3 | #include <linux/bitops.h> |
| 4 | #include <net/ieee80211.h> |
Dan Williams | 3cf20931 | 2007-05-25 17:28:30 -0400 | [diff] [blame] | 5 | #include <linux/etherdevice.h> |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 6 | |
| 7 | #include "assoc.h" |
| 8 | #include "join.h" |
| 9 | #include "decl.h" |
| 10 | #include "hostcmd.h" |
| 11 | #include "host.h" |
| 12 | |
| 13 | |
| 14 | static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
| 15 | static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 16 | |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 17 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 18 | static int assoc_helper_essid(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 19 | struct assoc_request * assoc_req) |
| 20 | { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 21 | int ret = 0; |
Dan Williams | fcdb53d | 2007-05-25 16:15:56 -0400 | [diff] [blame] | 22 | struct bss_descriptor * bss; |
Dan Williams | aeea0ab | 2007-05-25 22:30:48 -0400 | [diff] [blame] | 23 | int channel = -1; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 24 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 25 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 26 | |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 27 | /* FIXME: take channel into account when picking SSIDs if a channel |
| 28 | * is set. |
| 29 | */ |
| 30 | |
Dan Williams | aeea0ab | 2007-05-25 22:30:48 -0400 | [diff] [blame] | 31 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) |
| 32 | channel = assoc_req->channel; |
| 33 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 34 | lbs_deb_assoc("SSID '%s' requested\n", |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 35 | escape_essid(assoc_req->ssid, assoc_req->ssid_len)); |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 36 | if (assoc_req->mode == IW_MODE_INFRA) { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 37 | lbs_send_specific_ssid_scan(priv, assoc_req->ssid, |
Holger Schurig | 6e22a85 | 2007-08-02 13:05:32 -0400 | [diff] [blame] | 38 | assoc_req->ssid_len, 0); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 39 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 40 | bss = lbs_find_ssid_in_list(priv, assoc_req->ssid, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 41 | assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); |
Dan Williams | fcdb53d | 2007-05-25 16:15:56 -0400 | [diff] [blame] | 42 | if (bss != NULL) { |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 43 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 44 | ret = lbs_associate(priv, assoc_req); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 45 | } else { |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 46 | lbs_deb_assoc("SSID not found; cannot associate\n"); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 47 | } |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 48 | } else if (assoc_req->mode == IW_MODE_ADHOC) { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 49 | /* Scan for the network, do not save previous results. Stale |
| 50 | * scan data will cause us to join a non-existant adhoc network |
| 51 | */ |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 52 | lbs_send_specific_ssid_scan(priv, assoc_req->ssid, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 53 | assoc_req->ssid_len, 1); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 54 | |
| 55 | /* Search for the requested SSID in the scan table */ |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 56 | bss = lbs_find_ssid_in_list(priv, assoc_req->ssid, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 57 | assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel); |
Dan Williams | fcdb53d | 2007-05-25 16:15:56 -0400 | [diff] [blame] | 58 | if (bss != NULL) { |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 59 | lbs_deb_assoc("SSID found, will join\n"); |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 60 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 61 | lbs_join_adhoc_network(priv, assoc_req); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 62 | } else { |
| 63 | /* else send START command */ |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 64 | lbs_deb_assoc("SSID not found, creating adhoc network\n"); |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 65 | memcpy(&assoc_req->bss.ssid, &assoc_req->ssid, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 66 | IW_ESSID_MAX_SIZE); |
| 67 | assoc_req->bss.ssid_len = assoc_req->ssid_len; |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 68 | lbs_start_adhoc_network(priv, assoc_req); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 69 | } |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 70 | } |
| 71 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 72 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 73 | return ret; |
| 74 | } |
| 75 | |
| 76 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 77 | static int assoc_helper_bssid(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 78 | struct assoc_request * assoc_req) |
| 79 | { |
Dan Williams | fcdb53d | 2007-05-25 16:15:56 -0400 | [diff] [blame] | 80 | int ret = 0; |
| 81 | struct bss_descriptor * bss; |
Joe Perches | 0795af5 | 2007-10-03 17:59:30 -0700 | [diff] [blame] | 82 | DECLARE_MAC_BUF(mac); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 83 | |
Joe Perches | 0795af5 | 2007-10-03 17:59:30 -0700 | [diff] [blame] | 84 | lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID %s", |
| 85 | print_mac(mac, assoc_req->bssid)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 86 | |
| 87 | /* Search for index position in list for requested MAC */ |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 88 | bss = lbs_find_bssid_in_list(priv, assoc_req->bssid, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 89 | assoc_req->mode); |
Dan Williams | fcdb53d | 2007-05-25 16:15:56 -0400 | [diff] [blame] | 90 | if (bss == NULL) { |
Joe Perches | 0795af5 | 2007-10-03 17:59:30 -0700 | [diff] [blame] | 91 | lbs_deb_assoc("ASSOC: WAP: BSSID %s not found, " |
| 92 | "cannot associate.\n", print_mac(mac, assoc_req->bssid)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 93 | goto out; |
| 94 | } |
| 95 | |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 96 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 97 | if (assoc_req->mode == IW_MODE_INFRA) { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 98 | ret = lbs_associate(priv, assoc_req); |
| 99 | lbs_deb_assoc("ASSOC: lbs_associate(bssid) returned %d\n", ret); |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 100 | } else if (assoc_req->mode == IW_MODE_ADHOC) { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 101 | lbs_join_adhoc_network(priv, assoc_req); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 102 | } |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 103 | |
| 104 | out: |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 105 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 106 | return ret; |
| 107 | } |
| 108 | |
| 109 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 110 | static int assoc_helper_associate(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 111 | struct assoc_request * assoc_req) |
| 112 | { |
| 113 | int ret = 0, done = 0; |
| 114 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 115 | lbs_deb_enter(LBS_DEB_ASSOC); |
| 116 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 117 | /* If we're given and 'any' BSSID, try associating based on SSID */ |
| 118 | |
| 119 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
Dan Williams | 3cf20931 | 2007-05-25 17:28:30 -0400 | [diff] [blame] | 120 | if (compare_ether_addr(bssid_any, assoc_req->bssid) |
| 121 | && compare_ether_addr(bssid_off, assoc_req->bssid)) { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 122 | ret = assoc_helper_bssid(priv, assoc_req); |
| 123 | done = 1; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | |
| 127 | if (!done && test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { |
| 128 | ret = assoc_helper_essid(priv, assoc_req); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 129 | } |
| 130 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 131 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 132 | return ret; |
| 133 | } |
| 134 | |
| 135 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 136 | static int assoc_helper_mode(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 137 | struct assoc_request * assoc_req) |
| 138 | { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 139 | int ret = 0; |
| 140 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 141 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 142 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 143 | if (assoc_req->mode == priv->mode) |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 144 | goto done; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 145 | |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 146 | if (assoc_req->mode == IW_MODE_INFRA) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 147 | if (priv->psstate != PS_STATE_FULL_POWER) |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 148 | lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 149 | priv->psmode = LBS802_11POWERMODECAM; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 150 | } |
| 151 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 152 | priv->mode = assoc_req->mode; |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 153 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 154 | CMD_802_11_SNMP_MIB, |
| 155 | 0, CMD_OPTION_WAITFORRSP, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 156 | OID_802_11_INFRASTRUCTURE_MODE, |
David Woodhouse | 981f187 | 2007-05-25 23:36:54 -0400 | [diff] [blame] | 157 | /* Shoot me now */ (void *) (size_t) assoc_req->mode); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 158 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 159 | done: |
| 160 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 161 | return ret; |
| 162 | } |
| 163 | |
| 164 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 165 | static int update_channel(struct lbs_private *priv) |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 166 | { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 167 | int ret; |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 168 | /* the channel in f/w could be out of sync, get the current channel */ |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 169 | lbs_deb_enter(LBS_DEB_ASSOC); |
| 170 | ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 171 | CMD_OPT_802_11_RF_CHANNEL_GET, |
| 172 | CMD_OPTION_WAITFORRSP, 0, NULL); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 173 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
| 174 | return ret; |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 175 | } |
| 176 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 177 | void lbs_sync_channel(struct work_struct *work) |
Luis Carlos Cobo Rus | b8bedef | 2007-05-30 12:14:34 -0400 | [diff] [blame] | 178 | { |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 179 | struct lbs_private *priv = container_of(work, struct lbs_private, |
| 180 | sync_channel); |
Luis Carlos Cobo Rus | b8bedef | 2007-05-30 12:14:34 -0400 | [diff] [blame] | 181 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 182 | lbs_deb_enter(LBS_DEB_ASSOC); |
Luis Carlos Cobo Rus | b8bedef | 2007-05-30 12:14:34 -0400 | [diff] [blame] | 183 | if (update_channel(priv) != 0) |
| 184 | lbs_pr_info("Channel synchronization failed."); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 185 | lbs_deb_leave(LBS_DEB_ASSOC); |
Luis Carlos Cobo Rus | b8bedef | 2007-05-30 12:14:34 -0400 | [diff] [blame] | 186 | } |
| 187 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 188 | static int assoc_helper_channel(struct lbs_private *priv, |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 189 | struct assoc_request * assoc_req) |
| 190 | { |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 191 | int ret = 0; |
| 192 | |
| 193 | lbs_deb_enter(LBS_DEB_ASSOC); |
| 194 | |
| 195 | ret = update_channel(priv); |
| 196 | if (ret < 0) { |
| 197 | lbs_deb_assoc("ASSOC: channel: error getting channel."); |
| 198 | } |
| 199 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 200 | if (assoc_req->channel == priv->curbssparams.channel) |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 201 | goto done; |
| 202 | |
| 203 | lbs_deb_assoc("ASSOC: channel: %d -> %d\n", |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 204 | priv->curbssparams.channel, assoc_req->channel); |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 205 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 206 | ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 207 | CMD_OPT_802_11_RF_CHANNEL_SET, |
| 208 | CMD_OPTION_WAITFORRSP, 0, &assoc_req->channel); |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 209 | if (ret < 0) { |
| 210 | lbs_deb_assoc("ASSOC: channel: error setting channel."); |
| 211 | } |
| 212 | |
| 213 | ret = update_channel(priv); |
| 214 | if (ret < 0) { |
| 215 | lbs_deb_assoc("ASSOC: channel: error getting channel."); |
| 216 | } |
| 217 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 218 | if (assoc_req->channel != priv->curbssparams.channel) { |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 219 | lbs_deb_assoc("ASSOC: channel: failed to update channel to %d", |
| 220 | assoc_req->channel); |
| 221 | goto done; |
| 222 | } |
| 223 | |
| 224 | if ( assoc_req->secinfo.wep_enabled |
| 225 | && (assoc_req->wep_keys[0].len |
| 226 | || assoc_req->wep_keys[1].len |
| 227 | || assoc_req->wep_keys[2].len |
| 228 | || assoc_req->wep_keys[3].len)) { |
| 229 | /* Make sure WEP keys are re-sent to firmware */ |
| 230 | set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); |
| 231 | } |
| 232 | |
| 233 | /* Must restart/rejoin adhoc networks after channel change */ |
| 234 | set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); |
| 235 | |
| 236 | done: |
| 237 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
| 238 | return ret; |
| 239 | } |
| 240 | |
| 241 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 242 | static int assoc_helper_wep_keys(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 243 | struct assoc_request * assoc_req) |
| 244 | { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 245 | int i; |
| 246 | int ret = 0; |
| 247 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 248 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 249 | |
| 250 | /* Set or remove WEP keys */ |
| 251 | if ( assoc_req->wep_keys[0].len |
| 252 | || assoc_req->wep_keys[1].len |
| 253 | || assoc_req->wep_keys[2].len |
| 254 | || assoc_req->wep_keys[3].len) { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 255 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 256 | CMD_802_11_SET_WEP, |
| 257 | CMD_ACT_ADD, |
| 258 | CMD_OPTION_WAITFORRSP, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 259 | 0, assoc_req); |
| 260 | } else { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 261 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 262 | CMD_802_11_SET_WEP, |
| 263 | CMD_ACT_REMOVE, |
| 264 | CMD_OPTION_WAITFORRSP, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 265 | 0, NULL); |
| 266 | } |
| 267 | |
| 268 | if (ret) |
| 269 | goto out; |
| 270 | |
| 271 | /* enable/disable the MAC's WEP packet filter */ |
Dan Williams | 889c05b | 2007-05-10 22:57:23 -0400 | [diff] [blame] | 272 | if (assoc_req->secinfo.wep_enabled) |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 273 | priv->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 274 | else |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 275 | priv->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE; |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 276 | ret = lbs_set_mac_packet_filter(priv); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 277 | if (ret) |
| 278 | goto out; |
| 279 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 280 | mutex_lock(&priv->lock); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 281 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 282 | /* Copy WEP keys into priv wep key fields */ |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 283 | for (i = 0; i < 4; i++) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 284 | memcpy(&priv->wep_keys[i], &assoc_req->wep_keys[i], |
Dan Williams | 1443b65 | 2007-08-02 10:45:55 -0400 | [diff] [blame] | 285 | sizeof(struct enc_key)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 286 | } |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 287 | priv->wep_tx_keyidx = assoc_req->wep_tx_keyidx; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 288 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 289 | mutex_unlock(&priv->lock); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 290 | |
| 291 | out: |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 292 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 293 | return ret; |
| 294 | } |
| 295 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 296 | static int assoc_helper_secinfo(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 297 | struct assoc_request * assoc_req) |
| 298 | { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 299 | int ret = 0; |
Dan Williams | 18c96c34 | 2007-06-18 12:01:12 -0400 | [diff] [blame] | 300 | u32 do_wpa; |
| 301 | u32 rsn = 0; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 302 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 303 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 304 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 305 | memcpy(&priv->secinfo, &assoc_req->secinfo, |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 306 | sizeof(struct lbs_802_11_security)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 307 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 308 | ret = lbs_set_mac_packet_filter(priv); |
Dan Williams | 90a4221 | 2007-05-25 23:01:24 -0400 | [diff] [blame] | 309 | if (ret) |
| 310 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 311 | |
Dan Williams | 18c96c34 | 2007-06-18 12:01:12 -0400 | [diff] [blame] | 312 | /* If RSN is already enabled, don't try to enable it again, since |
| 313 | * ENABLE_RSN resets internal state machines and will clobber the |
| 314 | * 4-way WPA handshake. |
| 315 | */ |
| 316 | |
| 317 | /* Get RSN enabled/disabled */ |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 318 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 319 | CMD_802_11_ENABLE_RSN, |
| 320 | CMD_ACT_GET, |
| 321 | CMD_OPTION_WAITFORRSP, |
Dan Williams | 18c96c34 | 2007-06-18 12:01:12 -0400 | [diff] [blame] | 322 | 0, &rsn); |
| 323 | if (ret) { |
| 324 | lbs_deb_assoc("Failed to get RSN status: %d", ret); |
| 325 | goto out; |
| 326 | } |
| 327 | |
| 328 | /* Don't re-enable RSN if it's already enabled */ |
| 329 | do_wpa = (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled); |
| 330 | if (do_wpa == rsn) |
| 331 | goto out; |
| 332 | |
| 333 | /* Set RSN enabled/disabled */ |
| 334 | rsn = do_wpa; |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 335 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 336 | CMD_802_11_ENABLE_RSN, |
| 337 | CMD_ACT_SET, |
| 338 | CMD_OPTION_WAITFORRSP, |
Dan Williams | 18c96c34 | 2007-06-18 12:01:12 -0400 | [diff] [blame] | 339 | 0, &rsn); |
Dan Williams | 90a4221 | 2007-05-25 23:01:24 -0400 | [diff] [blame] | 340 | |
| 341 | out: |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 342 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 343 | return ret; |
| 344 | } |
| 345 | |
| 346 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 347 | static int assoc_helper_wpa_keys(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 348 | struct assoc_request * assoc_req) |
| 349 | { |
| 350 | int ret = 0; |
Dan Williams | 2bcde51 | 2007-10-03 10:37:45 -0400 | [diff] [blame] | 351 | unsigned int flags = assoc_req->flags; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 352 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 353 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 354 | |
Dan Williams | 2bcde51 | 2007-10-03 10:37:45 -0400 | [diff] [blame] | 355 | /* Work around older firmware bug where WPA unicast and multicast |
| 356 | * keys must be set independently. Seen in SDIO parts with firmware |
| 357 | * version 5.0.11p0. |
| 358 | */ |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 359 | |
Dan Williams | 2bcde51 | 2007-10-03 10:37:45 -0400 | [diff] [blame] | 360 | if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { |
| 361 | clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 362 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 2bcde51 | 2007-10-03 10:37:45 -0400 | [diff] [blame] | 363 | CMD_802_11_KEY_MATERIAL, |
| 364 | CMD_ACT_SET, |
| 365 | CMD_OPTION_WAITFORRSP, |
| 366 | 0, assoc_req); |
| 367 | assoc_req->flags = flags; |
| 368 | } |
| 369 | |
| 370 | if (ret) |
| 371 | goto out; |
| 372 | |
| 373 | if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { |
| 374 | clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); |
| 375 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 376 | ret = lbs_prepare_and_send_command(priv, |
Dan Williams | 2bcde51 | 2007-10-03 10:37:45 -0400 | [diff] [blame] | 377 | CMD_802_11_KEY_MATERIAL, |
| 378 | CMD_ACT_SET, |
| 379 | CMD_OPTION_WAITFORRSP, |
| 380 | 0, assoc_req); |
| 381 | assoc_req->flags = flags; |
| 382 | } |
| 383 | |
| 384 | out: |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 385 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 386 | return ret; |
| 387 | } |
| 388 | |
| 389 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 390 | static int assoc_helper_wpa_ie(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 391 | struct assoc_request * assoc_req) |
| 392 | { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 393 | int ret = 0; |
| 394 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 395 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 396 | |
| 397 | if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 398 | memcpy(&priv->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len); |
| 399 | priv->wpa_ie_len = assoc_req->wpa_ie_len; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 400 | } else { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 401 | memset(&priv->wpa_ie, 0, MAX_WPA_IE_LEN); |
| 402 | priv->wpa_ie_len = 0; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 403 | } |
| 404 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 405 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 406 | return ret; |
| 407 | } |
| 408 | |
| 409 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 410 | static int should_deauth_infrastructure(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 411 | struct assoc_request * assoc_req) |
| 412 | { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 413 | int ret = 0; |
| 414 | |
| 415 | lbs_deb_enter(LBS_DEB_ASSOC); |
| 416 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 417 | if (priv->connect_status != LBS_CONNECTED) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 418 | return 0; |
| 419 | |
| 420 | if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 421 | lbs_deb_assoc("Deauthenticating due to new SSID\n"); |
| 422 | ret = 1; |
| 423 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 427 | if (priv->secinfo.auth_mode != assoc_req->secinfo.auth_mode) { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 428 | lbs_deb_assoc("Deauthenticating due to new security\n"); |
| 429 | ret = 1; |
| 430 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 431 | } |
| 432 | } |
| 433 | |
| 434 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 435 | lbs_deb_assoc("Deauthenticating due to new BSSID\n"); |
| 436 | ret = 1; |
| 437 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 438 | } |
| 439 | |
Luis Carlos Cobo Rus | fff47f1 | 2007-05-30 12:16:13 -0400 | [diff] [blame] | 440 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 441 | lbs_deb_assoc("Deauthenticating due to channel switch\n"); |
| 442 | ret = 1; |
| 443 | goto out; |
Luis Carlos Cobo Rus | fff47f1 | 2007-05-30 12:16:13 -0400 | [diff] [blame] | 444 | } |
| 445 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 446 | /* FIXME: deal with 'auto' mode somehow */ |
| 447 | if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 448 | if (assoc_req->mode != IW_MODE_INFRA) { |
| 449 | lbs_deb_assoc("Deauthenticating due to leaving " |
| 450 | "infra mode\n"); |
| 451 | ret = 1; |
| 452 | goto out; |
| 453 | } |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 454 | } |
| 455 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 456 | out: |
| 457 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 458 | return 0; |
| 459 | } |
| 460 | |
| 461 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 462 | static int should_stop_adhoc(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 463 | struct assoc_request * assoc_req) |
| 464 | { |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 465 | lbs_deb_enter(LBS_DEB_ASSOC); |
| 466 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 467 | if (priv->connect_status != LBS_CONNECTED) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 468 | return 0; |
| 469 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 470 | if (lbs_ssid_cmp(priv->curbssparams.ssid, |
| 471 | priv->curbssparams.ssid_len, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 472 | assoc_req->ssid, assoc_req->ssid_len) != 0) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 473 | return 1; |
| 474 | |
| 475 | /* FIXME: deal with 'auto' mode somehow */ |
| 476 | if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 477 | if (assoc_req->mode != IW_MODE_ADHOC) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 478 | return 1; |
| 479 | } |
| 480 | |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 481 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 482 | if (assoc_req->channel != priv->curbssparams.channel) |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 483 | return 1; |
| 484 | } |
| 485 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 486 | lbs_deb_leave(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 487 | return 0; |
| 488 | } |
| 489 | |
| 490 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 491 | void lbs_association_worker(struct work_struct *work) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 492 | { |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 493 | struct lbs_private *priv = container_of(work, struct lbs_private, |
| 494 | assoc_work.work); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 495 | struct assoc_request * assoc_req = NULL; |
| 496 | int ret = 0; |
| 497 | int find_any_ssid = 0; |
Joe Perches | 0795af5 | 2007-10-03 17:59:30 -0700 | [diff] [blame] | 498 | DECLARE_MAC_BUF(mac); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 499 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 500 | lbs_deb_enter(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 501 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 502 | mutex_lock(&priv->lock); |
| 503 | assoc_req = priv->pending_assoc_req; |
| 504 | priv->pending_assoc_req = NULL; |
| 505 | priv->in_progress_assoc_req = assoc_req; |
| 506 | mutex_unlock(&priv->lock); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 507 | |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 508 | if (!assoc_req) |
| 509 | goto done; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 510 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 511 | lbs_deb_assoc( |
| 512 | "Association Request:\n" |
| 513 | " flags: 0x%08lx\n" |
| 514 | " SSID: '%s'\n" |
| 515 | " chann: %d\n" |
| 516 | " band: %d\n" |
| 517 | " mode: %d\n" |
| 518 | " BSSID: %s\n" |
| 519 | " secinfo: %s%s%s\n" |
| 520 | " auth_mode: %d\n", |
| 521 | assoc_req->flags, |
| 522 | escape_essid(assoc_req->ssid, assoc_req->ssid_len), |
| 523 | assoc_req->channel, assoc_req->band, assoc_req->mode, |
| 524 | print_mac(mac, assoc_req->bssid), |
| 525 | assoc_req->secinfo.WPAenabled ? " WPA" : "", |
| 526 | assoc_req->secinfo.WPA2enabled ? " WPA2" : "", |
| 527 | assoc_req->secinfo.wep_enabled ? " WEP" : "", |
| 528 | assoc_req->secinfo.auth_mode); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 529 | |
| 530 | /* If 'any' SSID was specified, find an SSID to associate with */ |
| 531 | if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags) |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 532 | && !assoc_req->ssid_len) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 533 | find_any_ssid = 1; |
| 534 | |
| 535 | /* But don't use 'any' SSID if there's a valid locked BSSID to use */ |
| 536 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
Dan Williams | 3cf20931 | 2007-05-25 17:28:30 -0400 | [diff] [blame] | 537 | if (compare_ether_addr(assoc_req->bssid, bssid_any) |
| 538 | && compare_ether_addr(assoc_req->bssid, bssid_off)) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 539 | find_any_ssid = 0; |
| 540 | } |
| 541 | |
| 542 | if (find_any_ssid) { |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 543 | u8 new_mode; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 544 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 545 | ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 546 | &assoc_req->ssid_len, assoc_req->mode, &new_mode); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 547 | if (ret) { |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 548 | lbs_deb_assoc("Could not find best network\n"); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 549 | ret = -ENETUNREACH; |
| 550 | goto out; |
| 551 | } |
| 552 | |
| 553 | /* Ensure we switch to the mode of the AP */ |
Dan Williams | 0dc5a29 | 2007-05-10 22:58:02 -0400 | [diff] [blame] | 554 | if (assoc_req->mode == IW_MODE_AUTO) { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 555 | set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); |
| 556 | assoc_req->mode = new_mode; |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | /* |
| 561 | * Check if the attributes being changing require deauthentication |
| 562 | * from the currently associated infrastructure access point. |
| 563 | */ |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 564 | if (priv->mode == IW_MODE_INFRA) { |
| 565 | if (should_deauth_infrastructure(priv, assoc_req)) { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 566 | ret = lbs_send_deauthentication(priv); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 567 | if (ret) { |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 568 | lbs_deb_assoc("Deauthentication due to new " |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 569 | "configuration request failed: %d\n", |
| 570 | ret); |
| 571 | } |
| 572 | } |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 573 | } else if (priv->mode == IW_MODE_ADHOC) { |
| 574 | if (should_stop_adhoc(priv, assoc_req)) { |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 575 | ret = lbs_stop_adhoc_network(priv); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 576 | if (ret) { |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 577 | lbs_deb_assoc("Teardown of AdHoc network due to " |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 578 | "new configuration request failed: %d\n", |
| 579 | ret); |
| 580 | } |
| 581 | |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | /* Send the various configuration bits to the firmware */ |
| 586 | if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { |
| 587 | ret = assoc_helper_mode(priv, assoc_req); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 588 | if (ret) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 589 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 590 | } |
| 591 | |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 592 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { |
| 593 | ret = assoc_helper_channel(priv, assoc_req); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 594 | if (ret) |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 595 | goto out; |
Dan Williams | ef9a264 | 2007-05-25 16:46:33 -0400 | [diff] [blame] | 596 | } |
| 597 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 598 | if ( test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags) |
| 599 | || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { |
| 600 | ret = assoc_helper_wep_keys(priv, assoc_req); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 601 | if (ret) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 602 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 603 | } |
| 604 | |
| 605 | if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { |
| 606 | ret = assoc_helper_secinfo(priv, assoc_req); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 607 | if (ret) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 608 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 609 | } |
| 610 | |
| 611 | if (test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { |
| 612 | ret = assoc_helper_wpa_ie(priv, assoc_req); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 613 | if (ret) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 614 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 615 | } |
| 616 | |
| 617 | if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags) |
| 618 | || test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { |
| 619 | ret = assoc_helper_wpa_keys(priv, assoc_req); |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 620 | if (ret) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 621 | goto out; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | /* SSID/BSSID should be the _last_ config option set, because they |
| 625 | * trigger the association attempt. |
| 626 | */ |
| 627 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags) |
| 628 | || test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { |
| 629 | int success = 1; |
| 630 | |
| 631 | ret = assoc_helper_associate(priv, assoc_req); |
| 632 | if (ret) { |
Holger Schurig | 9184346 | 2007-11-28 14:05:02 +0100 | [diff] [blame] | 633 | lbs_deb_assoc("ASSOC: association unsuccessful: %d\n", |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 634 | ret); |
| 635 | success = 0; |
| 636 | } |
| 637 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 638 | if (priv->connect_status != LBS_CONNECTED) { |
Holger Schurig | 9184346 | 2007-11-28 14:05:02 +0100 | [diff] [blame] | 639 | lbs_deb_assoc("ASSOC: association unsuccessful, " |
| 640 | "not connected\n"); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 641 | success = 0; |
| 642 | } |
| 643 | |
| 644 | if (success) { |
Holger Schurig | 9184346 | 2007-11-28 14:05:02 +0100 | [diff] [blame] | 645 | lbs_deb_assoc("ASSOC: associated to '%s', %s\n", |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 646 | escape_essid(priv->curbssparams.ssid, |
| 647 | priv->curbssparams.ssid_len), |
| 648 | print_mac(mac, priv->curbssparams.bssid)); |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 649 | lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 650 | CMD_802_11_RSSI, |
| 651 | 0, CMD_OPTION_WAITFORRSP, 0, NULL); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 652 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 653 | lbs_prepare_and_send_command(priv, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 654 | CMD_802_11_GET_LOG, |
| 655 | 0, CMD_OPTION_WAITFORRSP, 0, NULL); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 656 | } else { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 657 | ret = -1; |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | out: |
| 662 | if (ret) { |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 663 | lbs_deb_assoc("ASSOC: reconfiguration attempt unsuccessful: %d\n", |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 664 | ret); |
| 665 | } |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 666 | |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 667 | mutex_lock(&priv->lock); |
| 668 | priv->in_progress_assoc_req = NULL; |
| 669 | mutex_unlock(&priv->lock); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 670 | kfree(assoc_req); |
Holger Schurig | 9012b28 | 2007-05-25 11:27:16 -0400 | [diff] [blame] | 671 | |
| 672 | done: |
| 673 | lbs_deb_leave(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 674 | } |
| 675 | |
| 676 | |
| 677 | /* |
| 678 | * Caller MUST hold any necessary locks |
| 679 | */ |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 680 | struct assoc_request *lbs_get_association_request(struct lbs_private *priv) |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 681 | { |
| 682 | struct assoc_request * assoc_req; |
| 683 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 684 | lbs_deb_enter(LBS_DEB_ASSOC); |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 685 | if (!priv->pending_assoc_req) { |
| 686 | priv->pending_assoc_req = kzalloc(sizeof(struct assoc_request), |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 687 | GFP_KERNEL); |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 688 | if (!priv->pending_assoc_req) { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 689 | lbs_pr_info("Not enough memory to allocate association" |
| 690 | " request!\n"); |
| 691 | return NULL; |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | /* Copy current configuration attributes to the association request, |
| 696 | * but don't overwrite any that are already set. |
| 697 | */ |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 698 | assoc_req = priv->pending_assoc_req; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 699 | if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 700 | memcpy(&assoc_req->ssid, &priv->curbssparams.ssid, |
Dan Williams | d8efea2 | 2007-05-28 23:54:55 -0400 | [diff] [blame] | 701 | IW_ESSID_MAX_SIZE); |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 702 | assoc_req->ssid_len = priv->curbssparams.ssid_len; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 706 | assoc_req->channel = priv->curbssparams.channel; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 707 | |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 708 | if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 709 | assoc_req->band = priv->curbssparams.band; |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 710 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 711 | if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 712 | assoc_req->mode = priv->mode; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 713 | |
| 714 | if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 715 | memcpy(&assoc_req->bssid, priv->curbssparams.bssid, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 716 | ETH_ALEN); |
| 717 | } |
| 718 | |
| 719 | if (!test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags)) { |
| 720 | int i; |
| 721 | for (i = 0; i < 4; i++) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 722 | memcpy(&assoc_req->wep_keys[i], &priv->wep_keys[i], |
Dan Williams | 1443b65 | 2007-08-02 10:45:55 -0400 | [diff] [blame] | 723 | sizeof(struct enc_key)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 724 | } |
| 725 | } |
| 726 | |
| 727 | if (!test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 728 | assoc_req->wep_tx_keyidx = priv->wep_tx_keyidx; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 729 | |
| 730 | if (!test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 731 | memcpy(&assoc_req->wpa_mcast_key, &priv->wpa_mcast_key, |
Dan Williams | 1443b65 | 2007-08-02 10:45:55 -0400 | [diff] [blame] | 732 | sizeof(struct enc_key)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | if (!test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 736 | memcpy(&assoc_req->wpa_unicast_key, &priv->wpa_unicast_key, |
Dan Williams | 1443b65 | 2007-08-02 10:45:55 -0400 | [diff] [blame] | 737 | sizeof(struct enc_key)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 738 | } |
| 739 | |
| 740 | if (!test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 741 | memcpy(&assoc_req->secinfo, &priv->secinfo, |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 742 | sizeof(struct lbs_802_11_security)); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 743 | } |
| 744 | |
| 745 | if (!test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 746 | memcpy(&assoc_req->wpa_ie, &priv->wpa_ie, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 747 | MAX_WPA_IE_LEN); |
David Woodhouse | aa21c00 | 2007-12-08 20:04:36 +0000 | [diff] [blame^] | 748 | assoc_req->wpa_ie_len = priv->wpa_ie_len; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 749 | } |
| 750 | |
Holger Schurig | 0765af4 | 2007-10-15 12:55:56 +0200 | [diff] [blame] | 751 | lbs_deb_leave(LBS_DEB_ASSOC); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 752 | return assoc_req; |
| 753 | } |