|
@@ -1053,8 +1053,9 @@ static void orinoco_join_ap(struct net_device *dev)
|
|
u16 channel;
|
|
u16 channel;
|
|
} __attribute__ ((packed)) req;
|
|
} __attribute__ ((packed)) req;
|
|
const int atom_len = offsetof(struct prism2_scan_apinfo, atim);
|
|
const int atom_len = offsetof(struct prism2_scan_apinfo, atim);
|
|
- struct prism2_scan_apinfo *atom;
|
|
|
|
|
|
+ struct prism2_scan_apinfo *atom = NULL;
|
|
int offset = 4;
|
|
int offset = 4;
|
|
|
|
+ int found = 0;
|
|
u8 *buf;
|
|
u8 *buf;
|
|
u16 len;
|
|
u16 len;
|
|
|
|
|
|
@@ -1089,15 +1090,18 @@ static void orinoco_join_ap(struct net_device *dev)
|
|
* we were requested to join */
|
|
* we were requested to join */
|
|
for (; offset + atom_len <= len; offset += atom_len) {
|
|
for (; offset + atom_len <= len; offset += atom_len) {
|
|
atom = (struct prism2_scan_apinfo *) (buf + offset);
|
|
atom = (struct prism2_scan_apinfo *) (buf + offset);
|
|
- if (memcmp(&atom->bssid, priv->desired_bssid, ETH_ALEN) == 0)
|
|
|
|
- goto found;
|
|
|
|
|
|
+ if (memcmp(&atom->bssid, priv->desired_bssid, ETH_ALEN) == 0) {
|
|
|
|
+ found = 1;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- DEBUG(1, "%s: Requested AP not found in scan results\n",
|
|
|
|
- dev->name);
|
|
|
|
- goto out;
|
|
|
|
|
|
+ if (! found) {
|
|
|
|
+ DEBUG(1, "%s: Requested AP not found in scan results\n",
|
|
|
|
+ dev->name);
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
|
|
- found:
|
|
|
|
memcpy(req.bssid, priv->desired_bssid, ETH_ALEN);
|
|
memcpy(req.bssid, priv->desired_bssid, ETH_ALEN);
|
|
req.channel = atom->channel; /* both are little-endian */
|
|
req.channel = atom->channel; /* both are little-endian */
|
|
err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST,
|
|
err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST,
|