Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Dave <kilroyd@googlemail.com>,
	linux-wireless@vger.kernel.org, proski@gnu.org
Subject: [PATCH] orinoco: always use latest BSS info when caching scan results
Date: Wed, 05 Dec 2007 11:01:23 -0500	[thread overview]
Message-ID: <1196870483.2519.32.camel@localhost.localdomain> (raw)

Always copy the latest BSS information from the firmware's results to
the driver's BSS table to ensure that everything is up-to-date (IEs,
supported rates, encryption status, etc).

Signed-off-by: Dan Williams <dcbw@redhat.com>

diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 100ae33..cd9e0c7 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1194,7 +1208,7 @@ static int orinoco_process_scan_results(struct net_device *dev,
 	/* Read the entries one by one */
 	for (; offset + atom_len <= len; offset += atom_len) {
 		int found = 0;
-		bss_element *bss;
+		bss_element *bss = NULL;
 
 		/* Get next atom */
 		atom = (union hermes_scan_info *) (buf + offset);
@@ -1209,7 +1223,6 @@ static int orinoco_process_scan_results(struct net_device *dev,
 			if (memcmp(bss->bss.a.essid, atom->a.essid,
 			      le16_to_cpu(atom->a.essid_len)))
 				continue;
-			bss->last_scanned = jiffies;
 			found = 1;
 			break;
 		}
@@ -1220,10 +1233,14 @@ static int orinoco_process_scan_results(struct net_device *dev,
 					 bss_element, list);
 			list_del(priv->bss_free_list.next);
 
-			memcpy(bss, atom, sizeof(bss->bss));
-			bss->last_scanned = jiffies;
 			list_add_tail(&bss->list, &priv->bss_list);
 		}
+
+		if (bss) {
+			/* Always update the BSS to get latest beacon info */
+			memcpy(&bss->bss, atom, sizeof(bss->bss));
+			bss->last_scanned = jiffies;
+		}
 	}
 
 	return 0;


                 reply	other threads:[~2007-12-05 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1196870483.2519.32.camel@localhost.localdomain \
    --to=dcbw@redhat.com \
    --cc=kilroyd@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=proski@gnu.org \
    /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