Skip to contentSkip to conversation

libertas: cfg80211 support for WEP, WPA, WPA2 and NO-ENCRYPTION

RFC New Holger Schurig 1 participant 1 message Oct 16, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

RFC 1/1 libertas: cfg80211 support for WEP, WPA, WPA2 and NO-ENCRYPTION

[WIP, RFC] libertas: scanning and basic WEP support via cfg80211

Things that I tested:

* iw eth1 scan / scan trigger / scan dump, including passive-scanning, scan-for-ssid, scan-on-specified-freq

* "iw eth1 connect SSID 2437 00:11:22:33:44:55 key 0:99999" (the mentions MAC address must be in the bss list that you get via "iw scan dump")

* "iw eth1 connect SSID 2437 00:11:22:33:44:55" (that is, to connect to some AP without any encryption at all.

* "./wpa_supplicant -D nl80211" with WEP, WPA and WPA2.

* "iw link" gives some output

* make C=2 CF=-D__CHECK_ENDIAN__ and checkpatch.pl (only one warning that I want to keep)

Nice stuff:

* scan.{h,c}, wext.{h,c}, 11d.{h,c}, assoc.{h,c} and hostcmd.h are now all history.

* no more #include <linux/wireless.h> :-)

Now, that's the nice stuff. Now to the ugly stuff:

* This is a very intrusive patch, I cared for function, and will create little patchlets once we know if and how this function should become of the Kernel

* There are some open points, all marked as TODO

* scan.{h,c}, wext.{h,c}, 11d.{h,c}, assoc.{h,c} are just disabled. The will go for good. But for now I kept them -> easier grepping

* no suport for IBSS yet

* no support for MESH yet (and won't be implemented by me)

* no support for monitor mode yet

* no support for RTS threshold etc

* formula for calculation of dBm migth be wrong

* no AUTH TLV for newer libertas' firmware

* still some fields in "struct libertas_private" that I want to get rid of, e.g. priv->connect_status. I think I can re-use something from struct wireless_dev for that?

* "iw eth1 connect SSID" doesn't work, you HAVE to specify the BSSID of an access-point: "iw eth1 connect SSID 00:11:22:33:44:55". And the AP has to be in cfg80211's BSS list.

This is because of a impedance mismatch of cfg80211's .connect/.disconnect API and libertas firmware.

Ah, and cfg80211's .auth/.deauth .assoc/.disassoc API doesn't suit the libertas firmware that much better.

* no short preamble support yet (easy to add)

* should probably sent some IE with cfg80211_disconnected()

* No support to get TX rate out of the firmware and into "iw link". I'm quite unsure if the firmware allows this at all.

Do not apply, but please look at the code and comment harshly :-)

drivers/net/wireless/libertas/cfg.h new file +16 -0
@@ -0,0 +1,16 @@
+#ifndef __LBS_CFG80211_H__
+#define __LBS_CFG80211_H__
+
+
+struct lbs_private;
+
+
+struct wireless_dev *lbs_cfg_alloc(struct device *dev);
+int lbs_cfg_register(struct lbs_private *priv);
+void lbs_cfg_free(struct lbs_private *priv);
+
+
+void lbs_cfg_scan_worker(struct work_struct *work);
+
+
+#endif
drivers/net/wireless/libertas/cfg.c +1352 -19

1,418 lines not on this page · raw message

drivers/net/wireless/libertas/dev.h +73 -320

477 lines not on this page · raw message

drivers/net/wireless/libertas/Makefile +0 -4
@@ -1,5 +1,3 @@
-libertas-y += 11d.o
-libertas-y += assoc.o
 libertas-y += cfg.o
 libertas-y += cmd.o
 libertas-y += cmdresp.o
@@ -8,9 +6,7 @@
 libertas-y += main.o
 libertas-y += persistcfg.o
 libertas-y += rx.o
-libertas-y += scan.o
 libertas-y += tx.o
-libertas-y += wext.o
 
 usb8xxx-objs += if_usb.o
 libertas_cs-objs += if_cs.o
drivers/net/wireless/libertas/main.c +15 -328

508 lines not on this page · raw message

drivers/net/wireless/libertas/persistcfg.c +5 -10
@@ -6,15 +6,10 @@
 #include <linux/kthread.h>
 #include <linux/kfifo.h>
 
-#include "host.h"
 #include "decl.h"
-#include "dev.h"
-#include "wext.h"
-#include "debugfs.h"
-#include "scan.h"
-#include "assoc.h"
 #include "cmd.h"
 
+
 static int mesh_get_default_parameters(struct device *dev,
 				       struct mrvl_mesh_defaults *defs)
 {
@@ -187,9 +182,9 @@
 	if (ret)
 		return ret;
 
-	if (defs.meshie.val.mesh_id_len > IW_ESSID_MAX_SIZE) {
+	if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) {
 		lbs_pr_err("inconsistent mesh ID length");
-		defs.meshie.val.mesh_id_len = IW_ESSID_MAX_SIZE;
+		defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;
 	}
 
 	/* SSID not null terminated: reserve room for \0 + \n */
@@ -214,7 +209,7 @@
 	int len;
 	int ret;
 
-	if (count < 2 || count > IW_ESSID_MAX_SIZE + 1)
+	if (count < 2 || count > IEEE80211_MAX_SSID_LEN)
 		return -EINVAL;
 
 	memset(&cmd, 0, sizeof(struct cmd_ds_mesh_config));
@@ -233,7 +228,7 @@
 	/* SSID len */
 	ie->val.mesh_id_len = len;
 	/* IE len */
-	ie->len = sizeof(struct mrvl_meshie_val) - IW_ESSID_MAX_SIZE + len;
+	ie->len = sizeof(struct mrvl_meshie_val) - IEEE80211_MAX_SSID_LEN + len;
 
 	ret = lbs_mesh_config_send(priv, &cmd, CMD_ACT_MESH_CONFIG_SET,
 				   CMD_TYPE_MESH_SET_MESH_IE);
drivers/net/wireless/libertas/cmd.c +66 -758

524 lines not on this page · raw message

drivers/net/wireless/libertas/cmdresp.c +12 -126

138 lines not on this page · raw message

drivers/net/wireless/libertas/ethtool.c +2 -5

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/rx.c +3 -112

115 lines not on this page · raw message

drivers/net/wireless/libertas/tx.c +3 -4

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/cmd.h +62 -38

100 lines not on this page · raw message

drivers/net/wireless/libertas/debugfs.c +10 -57

67 lines not on this page · raw message

drivers/net/wireless/libertas/decl.h +5 -42

47 lines not on this page · raw message

drivers/net/wireless/libertas/defs.h +0 -3

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/types.h +2 -2

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/host.h +472 -21

493 lines not on this page · raw message

drivers/net/wireless/libertas/if_cs.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/if_sdio.c +0 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/if_spi.c +3 -3

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/if_usb.c +0 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/libertas/debugfs.h +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
http://www.holgerschurig.de

Part of the diff is not shown here. View the raw message.