diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2007-08-02 10:51:27 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:40 -0400 |
commit | 1e838bf31c3a24596621026c7d1ca69da068af83 (patch) | |
tree | e2aaa723eb599fed8ee30f526b543f52b0d797ca | |
parent | ab6179711a5e46ed1db739bef7752d65ce836dce (diff) |
[PATCH] libertas: specific mesh scan for mshX interface
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@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/defs.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.h | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h index de0756ee15ad..a5d70c19768b 100644 --- a/drivers/net/wireless/libertas/defs.h +++ b/drivers/net/wireless/libertas/defs.h | |||
@@ -156,6 +156,8 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len) | |||
156 | #define MRVDRV_MAX_BEACON_INTERVAL 1000 | 156 | #define MRVDRV_MAX_BEACON_INTERVAL 1000 |
157 | #define MRVDRV_BEACON_INTERVAL 100 | 157 | #define MRVDRV_BEACON_INTERVAL 100 |
158 | 158 | ||
159 | #define MARVELL_MESH_IE_LENGTH 9 | ||
160 | |||
159 | /** INT status Bit Definition*/ | 161 | /** INT status Bit Definition*/ |
160 | #define his_cmddnldrdy 0x01 | 162 | #define his_cmddnldrdy 0x01 |
161 | #define his_cardevent 0x02 | 163 | #define his_cardevent 0x02 |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 2d6bc7811b27..a98feedf001c 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -1099,6 +1099,12 @@ static int libertas_process_bss(struct bss_descriptor * bss, | |||
1099 | memcpy(bss->wpa_ie, elem, bss->wpa_ie_len); | 1099 | memcpy(bss->wpa_ie, elem, bss->wpa_ie_len); |
1100 | lbs_dbg_hex("process_bss: WPA IE", bss->wpa_ie, | 1100 | lbs_dbg_hex("process_bss: WPA IE", bss->wpa_ie, |
1101 | elem->len); | 1101 | elem->len); |
1102 | } else if (elem->len >= MARVELL_MESH_IE_LENGTH && | ||
1103 | elem->data[0] == 0x00 && | ||
1104 | elem->data[1] == 0x50 && | ||
1105 | elem->data[2] == 0x43 && | ||
1106 | elem->data[3] == 0x04) { | ||
1107 | bss->mesh = 1; | ||
1102 | } | 1108 | } |
1103 | break; | 1109 | break; |
1104 | 1110 | ||
@@ -1611,6 +1617,10 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, | |||
1611 | break; | 1617 | break; |
1612 | } | 1618 | } |
1613 | 1619 | ||
1620 | /* For mesh device, list only mesh networks */ | ||
1621 | if (dev == priv->mesh_dev && !iter_bss->mesh) | ||
1622 | continue; | ||
1623 | |||
1614 | /* Prune old an old scan result */ | 1624 | /* Prune old an old scan result */ |
1615 | stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; | 1625 | stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; |
1616 | if (time_after(jiffies, stale_time)) { | 1626 | if (time_after(jiffies, stale_time)) { |
diff --git a/drivers/net/wireless/libertas/scan.h b/drivers/net/wireless/libertas/scan.h index 2a095733f194..23c539c22634 100644 --- a/drivers/net/wireless/libertas/scan.h +++ b/drivers/net/wireless/libertas/scan.h | |||
@@ -170,6 +170,8 @@ struct bss_descriptor { | |||
170 | u8 rsn_ie[MAX_WPA_IE_LEN]; | 170 | u8 rsn_ie[MAX_WPA_IE_LEN]; |
171 | size_t rsn_ie_len; | 171 | size_t rsn_ie_len; |
172 | 172 | ||
173 | u8 mesh; | ||
174 | |||
173 | struct list_head list; | 175 | struct list_head list; |
174 | }; | 176 | }; |
175 | 177 | ||