Skip to contentSkip to conversation

libertas: don't depend on IEEE80211

PATCH In review Holger Schurig 2 participants 7 messages Mar 26, 2008 – Mar 27, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libertas: don't depend on IEEE80211

Runtime-wise we only need escape_ssid from the deprecated IEEE80211 subsystem. However, it's easy to provide our own copy.

drivers/net/wireless/Kconfig +0 -1
Index: wireless-testing/drivers/net/wireless/Kconfig
===================================================================
@@ -271,7 +271,6 @@ config LIBERTAS
 	tristate "Marvell 8xxx Libertas WLAN driver support"
 	depends on WLAN_80211
 	select WIRELESS_EXT
-	select IEEE80211
 	select FW_LOADER
 	---help---
 	  A library for Marvell Libertas 8xxx devices.
drivers/net/wireless/libertas/decl.h +5 -0
Index: wireless-testing/drivers/net/wireless/libertas/decl.h
===================================================================
@@ -71,4 +71,9 @@ int lbs_stop_card(struct lbs_private *pr
 void lbs_host_to_card_done(struct lbs_private *priv);
 
 int lbs_update_channel(struct lbs_private *priv);
+
+#if !defined(CONFIG_IEEE80211) && defined(CONFIG_LIBERTAS_DEBUG)
+const char *escape_essid(const char *essid, u8 essid_len);
+#endif
+
 #endif
drivers/net/wireless/libertas/main.c +27 -0
Index: wireless-testing/drivers/net/wireless/libertas/main.c
===================================================================
@@ -1559,6 +1559,33 @@ out:
 	return ret;
 }
 
+#if !defined(CONFIG_IEEE80211) && defined(CONFIG_LIBERTAS_DEBUG)
+const char *escape_essid(const char *essid, u8 essid_len)
+{
+	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
+	const char *s = essid;
+	char *d = escaped;
+
+	if (ieee80211_is_empty_essid(essid, essid_len)) {
+		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
+		return escaped;
+	}
+
+	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
+	while (essid_len--) {
+		if (*s == '\0') {
+			*d++ = '\\';
+			*d++ = '0';
+			s++;
+		} else {
+			*d++ = *s++;
+		}
+	}
+	*d = '\0';
+	return escaped;
+}
+EXPORT_SYMBOL(escape_essid);
+#endif
 
 module_init(lbs_init_module);
 module_exit(lbs_exit_module);
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Holger Schurig

Runtime-wise we only need escape_ssid from the deprecated IEEE80211 subsystem. However, it's easy to provide our own copy.

Quoted 64 lines

Index: wireless-testing/drivers/net/wireless/Kconfig
===================================================================

drivers/net/wireless/Kconfig +0 -1
@@ -271,7 +271,6 @@ config LIBERTAS
 	tristate "Marvell 8xxx Libertas WLAN driver support"
 	depends on WLAN_80211
 	select WIRELESS_EXT
-	select IEEE80211
 	select FW_LOADER
 	---help---
 	  A library for Marvell Libertas 8xxx devices.

Index: wireless-testing/drivers/net/wireless/libertas/decl.h
===================================================================

drivers/net/wireless/libertas/decl.h +5 -0
@@ -71,4 +71,9 @@ int lbs_stop_card(struct lbs_private *pr
 void lbs_host_to_card_done(struct lbs_private *priv);
 
 int lbs_update_channel(struct lbs_private *priv);
+
+#if !defined(CONFIG_IEEE80211) && defined(CONFIG_LIBERTAS_DEBUG)
+const char *escape_essid(const char *essid, u8 essid_len);
+#endif
+
 #endif

Index: wireless-testing/drivers/net/wireless/libertas/main.c
===================================================================

drivers/net/wireless/libertas/main.c +27 -0
@@ -1559,6 +1559,33 @@ out:
 	return ret;
 }
 
+#if !defined(CONFIG_IEEE80211) && defined(CONFIG_LIBERTAS_DEBUG)
+const char *escape_essid(const char *essid, u8 essid_len)
+{
+	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
+	const char *s = essid;
+	char *d = escaped;
+
+	if (ieee80211_is_empty_essid(essid, essid_len)) {
+		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
+		return escaped;
+	}
+
+	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
+	while (essid_len--) {
+		if (*s == '\0') {
+			*d++ = '\\';
+			*d++ = '0';
+			s++;
+		} else {
+			*d++ = *s++;
+		}
+	}
+	*d = '\0';
+	return escaped;
+}
+EXPORT_SYMBOL(escape_essid);
+#endif
 
 module_init(lbs_init_module);
 module_exit(lbs_exit_module);
#3 lore raw

[PATCH] libertas: don't depend on IEEE80211

Runtime-wise we only need escape_ssid from the deprecated IEEE80211 subsystem. However, it's easy to provide our own copy.

---

The previous patch also exported this as GPL. However, there is no need to to is. Actually there is no need to export this at all. It's only used inside libertas.ko.

drivers/net/wireless/Kconfig +0 -1
Index: wireless-testing/drivers/net/wireless/Kconfig
===================================================================
@@ -271,7 +271,6 @@ config LIBERTAS
 	tristate "Marvell 8xxx Libertas WLAN driver support"
 	depends on WLAN_80211
 	select WIRELESS_EXT
-	select IEEE80211
 	select FW_LOADER
 	---help---
 	  A library for Marvell Libertas 8xxx devices.
drivers/net/wireless/libertas/decl.h +5 -0
Index: wireless-testing/drivers/net/wireless/libertas/decl.h
===================================================================
@@ -71,4 +71,9 @@ int lbs_stop_card(struct lbs_private *pr
 void lbs_host_to_card_done(struct lbs_private *priv);
 
 int lbs_update_channel(struct lbs_private *priv);
+
+#ifndef CONFIG_IEEE80211
+const char *escape_essid(const char *essid, u8 essid_len);
+#endif
+
 #endif
drivers/net/wireless/libertas/main.c +26 -0
Index: wireless-testing/drivers/net/wireless/libertas/main.c
===================================================================
@@ -1565,6 +1565,32 @@ out:
 	return ret;
 }
 
+#ifndef CONFIG_IEEE80211
+const char *escape_essid(const char *essid, u8 essid_len)
+{
+	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
+	const char *s = essid;
+	char *d = escaped;
+
+	if (ieee80211_is_empty_essid(essid, essid_len)) {
+		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
+		return escaped;
+	}
+
+	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
+	while (essid_len--) {
+		if (*s == '\0') {
+			*d++ = '\\';
+			*d++ = '0';
+			s++;
+		} else {
+			*d++ = *s++;
+		}
+	}
+	*d = '\0';
+	return escaped;
+}
+#endif
 
 module_init(lbs_init_module);
 module_exit(lbs_exit_module);
#5 lore raw
In reply to Holger Schurig
Quoted 3 lines · Holger Schurig

John, please wait with applying this. I just saw that escape_essid is also used in debugfs.c, even when CONFIG_LIBERTAS_DEBUG is off.

Yeah, but from lbs_getscantable() which is utterly pointless since the only thing it provides beyond 'iwlist eth1 scan' is CAP_SPECTRUM_MGMT, which if people really care, we can shove out in custom WEXT scan result
tags. I'd just kill lbs_getscantable() completely.

Dan

#6 lore raw
Quoted 5 lines · On Wednesday 26 March 2008 18:37:54 Dan Williams wrote:

Yeah, but from lbs_getscantable() which is utterly pointless since the only thing it provides beyond 'iwlist eth1 scan' is CAP_SPECTRUM_MGMT, which if people really care, we can shove
out in custom WEXT scan result tags. I'd just kill
lbs_getscantable() completely.

That is the only thing from debugfs that I regularly "cat". The reason is that I get the current version, if I do "iwlist eth1 scan", I get a new version of what's there.

Acked-by
#4 lore raw
In reply to Holger Schurig
Quoted 6 lines · Holger Schurig

[PATCH] libertas: don't depend on IEEE80211

Runtime-wise we only need escape_ssid from the deprecated IEEE80211 subsystem. However, it's easy to provide our own copy.

Quoted 69 lines

---

The previous patch also exported this as GPL. However, there is no need to to is. Actually there is no need to export this at all. It's only used inside libertas.ko.

Index: wireless-testing/drivers/net/wireless/Kconfig
===================================================================

drivers/net/wireless/Kconfig +0 -1
@@ -271,7 +271,6 @@ config LIBERTAS
 	tristate "Marvell 8xxx Libertas WLAN driver support"
 	depends on WLAN_80211
 	select WIRELESS_EXT
-	select IEEE80211
 	select FW_LOADER
 	---help---
 	  A library for Marvell Libertas 8xxx devices.

Index: wireless-testing/drivers/net/wireless/libertas/decl.h
===================================================================

drivers/net/wireless/libertas/decl.h +5 -0
@@ -71,4 +71,9 @@ int lbs_stop_card(struct lbs_private *pr
 void lbs_host_to_card_done(struct lbs_private *priv);
 
 int lbs_update_channel(struct lbs_private *priv);
+
+#ifndef CONFIG_IEEE80211
+const char *escape_essid(const char *essid, u8 essid_len);
+#endif
+
 #endif

Index: wireless-testing/drivers/net/wireless/libertas/main.c
===================================================================

drivers/net/wireless/libertas/main.c +26 -0
@@ -1565,6 +1565,32 @@ out:
 	return ret;
 }
 
+#ifndef CONFIG_IEEE80211
+const char *escape_essid(const char *essid, u8 essid_len)
+{
+	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
+	const char *s = essid;
+	char *d = escaped;
+
+	if (ieee80211_is_empty_essid(essid, essid_len)) {
+		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
+		return escaped;
+	}
+
+	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
+	while (essid_len--) {
+		if (*s == '\0') {
+			*d++ = '\\';
+			*d++ = '0';
+			s++;
+		} else {
+			*d++ = *s++;
+		}
+	}
+	*d = '\0';
+	return escaped;
+}
+#endif
 
 module_init(lbs_init_module);
 module_exit(lbs_exit_module);