[PATCH] libertas: specific mesh scan for mshX interface
Luis Carlos Cobo
luisca at cozybit.com
Fri May 25 13:15:55 EDT 2007
With this patch, scanning with mshX interface will only return mesh networks. To
differentiate them, a specific mesh IE in beacons/probe responses is used. This
IE has been introduced in firmware release 5.110.14. Note:
Even though there can be at most a single mesh per channel, this scan might
return several networks in the same channel.
If all nodes in a mesh network are associated to an AP, they won't produce
beacons/probe responses, thus the network will not be listed. This will be fixed
in future firmware releases.
Scan on ethX interface is not filtered, so it will list both mesh and non-mesh
networks.
Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
---
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 3297cda..15f1659 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -19,6 +19,7 @@
extern struct ethtool_ops libertas_ethtool_ops;
#define MAX_BSSID_PER_CHANNEL 16
+#define MARVELL_MESH_IE_LENGTH 9
#define NR_TX_QUEUE 3
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index f2532cf..37b2729 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -944,8 +944,10 @@ static int libertas_process_bss(struct bss_descriptor * bss,
int bytesleftforcurrentbeacon;
int ret;
+ struct WLAN_802_11_VARIABLE_IEs * pVie;
struct IE_WPA *pIe;
const u8 oui01[4] = { 0x00, 0x50, 0xf2, 0x01 };
+ const u8 marvell_mesh_ie[4] = {0x00, 0x50, 0x43, 0x04 };
struct ieeetypes_countryinfoset *pcountryinfo;
@@ -1151,6 +1153,14 @@ static int libertas_process_bss(struct bss_descriptor * bss,
case VENDOR_SPECIFIC_221:
#define IE_ID_LEN_FIELDS_BYTES 2
+ pVie = (struct WLAN_802_11_VARIABLE_IEs * )pcurrentptr;
+ if (pVie->length >= MARVELL_MESH_IE_LENGTH &&
+ memcmp(pVie->data, marvell_mesh_ie,
+ sizeof(marvell_mesh_ie))==0) {
+ bss->mesh = 1;
+ break;
+ }
+
pIe = (struct IE_WPA *)pcurrentptr;
if (memcmp(pIe->oui, oui01, sizeof(oui01)))
@@ -1679,6 +1689,11 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
break;
}
+ /* For mesh device, list only mesh networks */
+ if (dev==priv->mesh_dev && !iter_bss->mesh) {
+ continue;
+ }
+
/* Prune old an old scan result */
stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE;
if (time_after(jiffies, stale_time)) {
diff --git a/drivers/net/wireless/libertas/scan.h b/drivers/net/wireless/libertas/scan.h
index 7697feb..335b59d 100644
--- a/drivers/net/wireless/libertas/scan.h
+++ b/drivers/net/wireless/libertas/scan.h
@@ -170,6 +170,7 @@ struct bss_descriptor {
size_t wpa_ie_len;
u8 rsn_ie[MAX_WPA_IE_LEN];
size_t rsn_ie_len;
+ u8 mesh;
struct list_head list;
};
More information about the libertas-dev
mailing list