Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Dan Williams @ 2009-10-21 18:39 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <1256150184.5010.45.camel@localhost.localdomain>

On Wed, 2009-10-21 at 11:36 -0700, Dan Williams wrote:
> On Mon, 2009-10-19 at 14:49 +0200, Holger Schurig wrote:
> > This is a monster patch that makes CFG80211/WEXT operation
> > configurable. My cfg80211-RFC/WIP-Patch would come on top of it,
> > but would then be quite small, e.g. almost only changed to
> > cfg.c/cfg.h.
> > 
> > As there's no mesh/adhoc/monitor mode implemented in cfg80211-
> > mode, I added many, many #ifdef/#endif pairs. Maybe too many.
> > Is this too ugly?   Or would this patch be applyable as-is ?
> 
> For the mesh interface stuff, especially in tx/rx paths, would you mind
> not ifdefing that?  Since with cfg80211, priv->mesh_dev will always be
> NULL, those checks will be just fine and you still don't have to care
> about mesh.
> 
> I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be converted
> to use lib80211 or cfg80211 values instead of WEXT ones; I just picked
> WEXT at the time because we had no cfg80211 yet.
> 
> Stuff like lbs_cmd_bt_access doesn't need to be ifdefed either, because
> it simply won't be called if the debugfs bits are disabled.
> 
> I'm sure the WEXT-specific lbs_mac_event_disconnected bits could also be
> abstracted like you did with the IWAP stuff a few patches ago too.

I just saw the v2 patch from earlier that did this.  Thanks.

> Basically, I don't mind having some ifdefs; but I think there are way
> too many in that patch.  Not all the mesh stuff needs to be disabled
> just for cfg80211.
> 
> > If the patch is perceived to be too ugly, I could create an
> > monitor.h/monitor.c file and singleout everything related to
> > monitoring in it, where monitor.h would resolv to dummy static
> > functions in the cfg80211-case ... at least as long as we don't
> > have monitor suppport in libertas+cfg80211. The same for mesh
> > support, e.g. here I could create a mesh.h/mesh.c and do the
> > same.
> > 
> > Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
> > 
> > --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
> > +++ linux-wl/drivers/net/wireless/libertas/Kconfig
> > @@ -37,3 +37,29 @@
> >  	depends on LIBERTAS
> >  	---help---
> >  	  Debugging support.
> > +
> > +choice
> > +	prompt "interface to user-space"
> > +	depends on LIBERTAS
> > +	default LIBERTAS_WEXT
> > +
> > +config LIBERTAS_WEXT
> > +	bool "WEXT"
> > +	help
> > +	  This is the old Libertas code as it always used to be:
> > +	  configuration done via "iwconfig" or "wpa_supplicant -Dwext",
> > +	  associating via libertas-internal code. This is currently the only
> > +	  way to support:
> > +
> > +	  * AD-HOC
> > +	  * Libertas' MESH
> > +	  * Monitor interface ("rtap")
> > +
> > +config LIBERTAS_CFG80211
> > +	bool "CFG80211"
> > +	depends on EXPERIMENTAL
> > +	help
> > +	  This is new new way of wireless: use cfg80211 for all, e.g.
> > +	  "iw" or "wpa_supplicant -Dnl80211".
> > +
> > +endchoice
> > --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> > +++ linux-wl/drivers/net/wireless/libertas/Makefile
> > @@ -1,15 +1,15 @@
> > -libertas-y += assoc.o
> >  libertas-y += cfg.o
> >  libertas-y += cmd.o
> >  libertas-y += cmdresp.o
> >  libertas-y += debugfs.o
> > -libertas-y += ethtool.o
> >  libertas-y += main.o
> > -libertas-y += persistcfg.o
> >  libertas-y += rx.o
> > -libertas-y += scan.o
> >  libertas-y += tx.o
> > -libertas-y += wext.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += assoc.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += ethtool.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += persistcfg.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += scan.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += wext.o
> >  
> >  usb8xxx-objs += if_usb.o
> >  libertas_cs-objs += if_cs.o
> > --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> > +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> > @@ -3,7 +3,6 @@
> >    * It prepares command and sends it to firmware when it is ready.
> >    */
> >  
> > -#include <net/iw_handler.h>
> >  #include <net/lib80211.h>
> >  #include <linux/kfifo.h>
> >  #include <linux/sched.h>
> > @@ -184,6 +183,8 @@
> >  		memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN);
> >  
> >  	memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN);
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev)
> >  		memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
> >  
> > @@ -191,6 +192,7 @@
> >  		ret = -1;
> >  		goto out;
> >  	}
> > +#endif
> >  
> >  out:
> >  	lbs_deb_leave(LBS_DEB_CMD);
> > @@ -387,10 +389,12 @@
> >  	cmd.oid = cpu_to_le16((u16) oid);
> >  
> >  	switch (oid) {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	case SNMP_MIB_OID_BSS_TYPE:
> >  		cmd.bufsize = cpu_to_le16(sizeof(u8));
> >  		cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
> >  		break;
> > +#endif
> >  	case SNMP_MIB_OID_11D_ENABLE:
> >  	case SNMP_MIB_OID_FRAG_THRESHOLD:
> >  	case SNMP_MIB_OID_RTS_THRESHOLD:
> > @@ -442,12 +446,14 @@
> >  
> >  	switch (le16_to_cpu(cmd.bufsize)) {
> >  	case sizeof(u8):
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  		if (oid == SNMP_MIB_OID_BSS_TYPE) {
> >  			if (cmd.value[0] == 2)
> >  				*out_val = IW_MODE_ADHOC;
> >  			else
> >  				*out_val = IW_MODE_INFRA;
> >  		} else
> > +#endif
> >  			*out_val = cmd.value[0];
> >  		break;
> >  	case sizeof(u16):
> > @@ -702,6 +708,7 @@
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
> >  			       u16 cmd_action, void *pdata_buf)
> >  {
> > @@ -868,6 +875,7 @@
> >  
> >  	return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
> >  }
> > +#endif
> >  
> >  static void lbs_queue_cmd(struct lbs_private *priv,
> >  			  struct cmd_ctrl_node *cmdnode)
> > @@ -1155,10 +1163,6 @@
> >  				          cmd_action, pdata_buf);
> >  		break;
> >  
> > -	case CMD_802_11_RSSI:
> > -		ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> > -		break;
> > -
> >  	case CMD_802_11_SET_AFC:
> >  	case CMD_802_11_GET_AFC:
> >  
> > @@ -1184,6 +1188,11 @@
> >  		ret = 0;
> >  		break;
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +	case CMD_802_11_RSSI:
> > +		ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> > +		break;
> > +
> >  	case CMD_BT_ACCESS:
> >  		ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> >  		break;
> > @@ -1195,6 +1204,8 @@
> >  	case CMD_802_11_BEACON_CTRL:
> >  		ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
> >  		break;
> > +#endif
> > +
> >  	case CMD_802_11_DEEP_SLEEP:
> >  		cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
> >  		cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
> > @@ -1487,6 +1498,7 @@
> >  		 * check if in power save mode, if yes, put the device back
> >  		 * to PS mode
> >  		 */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  		if ((priv->psmode != LBS802_11POWERMODECAM) &&
> >  		    (priv->psstate == PS_STATE_FULL_POWER) &&
> >  		    ((priv->connect_status == LBS_CONNECTED) ||
> > @@ -1508,6 +1520,9 @@
> >  				lbs_ps_sleep(priv, 0);
> >  			}
> >  		}
> > +#else
> > +	/* TODO: we need to figure out what to do here in cfg80211-mode */
> > +#endif
> >  	}
> >  
> >  	ret = 0;
> > --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> > +++ linux-wl/drivers/net/wireless/libertas/dev.h
> > @@ -6,8 +6,10 @@
> >  #ifndef _LBS_DEV_H_
> >  #define _LBS_DEV_H_
> >  
> > +#include "defs.h"
> >  #include "scan.h"
> >  #include "assoc.h"
> > +#include "host.h"
> >  
> > 
> > 
> > @@ -21,6 +23,9 @@
> >  	uint16_t sp_reserved;
> >  };
> >  
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> >  /* Mesh statistics */
> >  struct lbs_mesh_stats {
> >  	u32	fwd_bcast_cnt;		/* Fwd: Broadcast counter */
> > @@ -32,6 +37,8 @@
> >  	u32	drop_blind;		/* Rx:  Dropped by blinding table */
> >  	u32	tx_failed_cnt;		/* Tx:  Failed transmissions */
> >  };
> > +#endif
> > +
> >  
> >  /** Private structure for the MV device */
> >  struct lbs_private {
> > @@ -48,11 +55,11 @@
> >  	struct wireless_dev *wdev;
> >  
> >  	/* Mesh */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	struct net_device *mesh_dev; /* Virtual device */
> >  	u32 mesh_connect_status;
> >  	struct lbs_mesh_stats mstats;
> >  	int mesh_open;
> > -	int mesh_fw_ver;
> >  	int mesh_autostart_enabled;
> >  	uint16_t mesh_tlv;
> >  	u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> > @@ -62,6 +69,7 @@
> >  	/* Monitor mode */
> >  	struct net_device *rtap_net_dev;
> >  	u32 monitormode;
> > +#endif
> >  
> >  	/* Debugfs */
> >  	struct dentry *debugfs_dir;
> > @@ -103,6 +111,7 @@
> >  	int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
> >  
> >  	/* Adapter info (from EEPROM) */
> > +	int mesh_fw_ver;
> >  	u32 fwrelease;
> >  	u32 fwcapinfo;
> >  	u16 regioncode;
> > @@ -138,11 +147,13 @@
> >  	struct workqueue_struct *work_thread;
> >  
> >  	/** Encryption stuff */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	struct lbs_802_11_security secinfo;
> >  	struct enc_key wpa_mcast_key;
> >  	struct enc_key wpa_unicast_key;
> >  	u8 wpa_ie[MAX_WPA_IE_LEN];
> >  	u8 wpa_ie_len;
> > +#endif
> >  	u16 wep_tx_keyidx;
> >  	struct enc_key wep_keys[4];
> >  
> > @@ -163,6 +174,7 @@
> >  	spinlock_t driver_lock;
> >  
> >  	/* NIC/link operation characteristics */
> > +	u16 capability;
> >  	u16 mac_control;
> >  	u8 radio_on;
> >  	u8 channel;
> > @@ -174,6 +186,7 @@
> >  	struct delayed_work scan_work;
> >  	int scan_channel;
> >  	/* remember which channel was scanned last, != 0 if currently scanning */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
> >  	u8 scan_ssid_len;
> >  
> > @@ -186,7 +199,6 @@
> >  	struct bss_descriptor *networks;
> >  	struct assoc_request * pending_assoc_req;
> >  	struct assoc_request * in_progress_assoc_req;
> > -	u16 capability;
> >  	uint16_t enablehwauto;
> >  	uint16_t ratebitmap;
> >  
> > @@ -211,6 +223,7 @@
> >  	u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
> >  	u16 nextSNRNF;
> >  	u16 numSNRNF;
> > +#endif
> >  };
> >  
> >  extern struct cmd_confirm_sleep confirm_sleep;
> > --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> > +++ linux-wl/drivers/net/wireless/libertas/main.c
> > @@ -13,7 +13,6 @@
> >  #include <linux/kfifo.h>
> >  #include <linux/stddef.h>
> >  #include <linux/ieee80211.h>
> > -#include <net/iw_handler.h>
> >  #include <net/cfg80211.h>
> >  
> >  #include "host.h"
> > @@ -98,6 +97,7 @@
> >   * Attributes exported through sysfs
> >   */
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  /**
> >   * @brief Get function for sysfs attribute anycast_mask
> >   */
> > @@ -325,6 +325,8 @@
> >  static struct attribute_group lbs_mesh_attr_group = {
> >  	.attrs = lbs_mesh_sysfs_entries,
> >  };
> > +#endif
> > +
> >  
> >  /**
> >   *  @brief This function opens the ethX or mshX interface
> > @@ -341,6 +343,7 @@
> >  
> >  	spin_lock_irq(&priv->driver_lock);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->monitormode) {
> >  		ret = -EBUSY;
> >  		goto out;
> > @@ -351,6 +354,9 @@
> >  		priv->mesh_connect_status = LBS_CONNECTED;
> >  		netif_carrier_on(dev);
> >  	} else {
> > +#else
> > +	if (1) {
> > +#endif
> >  		priv->infra_open = 1;
> >  
> >  		if (priv->connect_status == LBS_CONNECTED)
> > @@ -361,13 +367,16 @@
> >  
> >  	if (!priv->tx_pending_len)
> >  		netif_wake_queue(dev);
> > - out:
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + out:
> > +#endif
> >  	spin_unlock_irq(&priv->driver_lock);
> >  	lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> >  	return ret;
> >  }
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  /**
> >   *  @brief This function closes the mshX interface
> >   *
> > @@ -383,7 +392,6 @@
> >  
> >  	priv->mesh_open = 0;
> >  	priv->mesh_connect_status = LBS_DISCONNECTED;
> > -
> >  	netif_stop_queue(dev);
> >  	netif_carrier_off(dev);
> >  
> > @@ -394,6 +402,7 @@
> >  	lbs_deb_leave(LBS_DEB_MESH);
> >  	return 0;
> >  }
> > +#endif
> >  
> >  /**
> >   *  @brief This function closes the ethX interface
> > @@ -428,8 +437,10 @@
> >  
> >  	dev->trans_start = jiffies;
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->currenttxskb)
> >  		lbs_send_tx_feedback(priv, 0);
> > +#endif
> >  
> >  	/* XX: Shouldn't we also call into the hw-specific driver
> >  	   to kick it somehow? */
> > @@ -490,8 +501,10 @@
> >  
> >  	memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
> >  	memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev)
> >  		memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> > +#endif
> >  
> >  done:
> >  	lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> > @@ -554,8 +567,10 @@
> >  	lbs_deb_enter(LBS_DEB_NET);
> >  
> >  	dev_flags = priv->dev->flags;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev)
> >  		dev_flags |= priv->mesh_dev->flags;
> > +#endif
> >  
> >  	if (dev_flags & IFF_PROMISC) {
> >  		priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
> > @@ -572,8 +587,10 @@
> >  
> >  	/* Once for priv->dev, again for priv->mesh_dev if it exists */
> >  	nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (nr_addrs >= 0 && priv->mesh_dev)
> >  		nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs);
> > +#endif
> >  	if (nr_addrs < 0)
> >  		goto do_allmulti;
> >  
> > @@ -816,9 +833,11 @@
> >  				   waiting for TX feedback */
> >  				if (priv->connect_status == LBS_CONNECTED)
> >  					netif_wake_queue(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  				if (priv->mesh_dev &&
> >  				    priv->mesh_connect_status == LBS_CONNECTED)
> >  					netif_wake_queue(priv->mesh_dev);
> > +#endif
> >  			}
> >  		}
> >  		spin_unlock_irq(&priv->driver_lock);
> > @@ -838,8 +857,10 @@
> >  	lbs_deb_enter(LBS_DEB_FW);
> >  
> >  	netif_device_detach(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev)
> >  		netif_device_detach(priv->mesh_dev);
> > +#endif
> >  
> >  	priv->fw_ready = 0;
> >  	lbs_deb_leave(LBS_DEB_FW);
> > @@ -882,8 +903,10 @@
> >  				     0, 0, NULL);
> >  
> >  	netif_device_attach(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev)
> >  		netif_device_attach(priv->mesh_dev);
> > +#endif
> >  
> >  	lbs_deb_leave(LBS_DEB_FW);
> >  }
> > @@ -1004,6 +1027,7 @@
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  static void lbs_sync_channel_worker(struct work_struct *work)
> >  {
> >  	struct lbs_private *priv = container_of(work, struct lbs_private,
> > @@ -1014,15 +1038,19 @@
> >  		lbs_pr_info("Channel synchronization failed.");
> >  	lbs_deb_leave(LBS_DEB_MAIN);
> >  }
> > -
> > +#endif
> >  
> >  static int lbs_init_adapter(struct lbs_private *priv)
> >  {
> > +	int ret = 0;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	size_t bufsize;
> > -	int i, ret = 0;
> > +	int i;
> > +#endif
> >  
> >  	lbs_deb_enter(LBS_DEB_MAIN);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	/* Allocate buffer to store the BSSID list */
> >  	bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor);
> >  	priv->networks = kzalloc(bufsize, GFP_KERNEL);
> > @@ -1039,17 +1067,18 @@
> >  		list_add_tail(&priv->networks[i].list,
> >  			      &priv->network_free_list);
> >  	}
> > +	priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> > +	priv->mode = IW_MODE_INFRA;
> > +	priv->enablehwauto = 1;
> > +	priv->mesh_connect_status = LBS_DISCONNECTED;
> > +#endif
> >  
> >  	memset(priv->current_addr, 0xff, ETH_ALEN);
> >  
> >  	priv->connect_status = LBS_DISCONNECTED;
> > -	priv->mesh_connect_status = LBS_DISCONNECTED;
> > -	priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> > -	priv->mode = IW_MODE_INFRA;
> >  	priv->channel = DEFAULT_AD_HOC_CHANNEL;
> >  	priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
> >  	priv->radio_on = 1;
> > -	priv->enablehwauto = 1;
> >  	priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
> >  	priv->psmode = LBS802_11POWERMODECAM;
> >  	priv->psstate = PS_STATE_FULL_POWER;
> > @@ -1103,8 +1132,10 @@
> >  		kfifo_free(priv->event_fifo);
> >  	del_timer(&priv->command_timer);
> >  	del_timer(&priv->auto_deepsleep_timer);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	kfree(priv->networks);
> >  	priv->networks = NULL;
> > +#endif
> >  
> >  	lbs_deb_leave(LBS_DEB_MAIN);
> >  }
> > @@ -1166,8 +1197,8 @@
> >  
> >   	dev->netdev_ops = &lbs_netdev_ops;
> >  	dev->watchdog_timeo = 5 * HZ;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	dev->ethtool_ops = &lbs_ethtool_ops;
> > -#ifdef	WIRELESS_EXT
> >  	dev->wireless_handlers = &lbs_handler_def;
> >  #endif
> >  	dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> > @@ -1177,11 +1208,8 @@
> >  
> > 
> >  	priv->card = card;
> > -	priv->mesh_open = 0;
> >  	priv->infra_open = 0;
> >  
> > -
> > -	priv->rtap_net_dev = NULL;
> >  	strcpy(dev->name, "wlan%d");
> >  
> >  	lbs_deb_thread("Starting main thread...\n");
> > @@ -1193,13 +1221,18 @@
> >  	}
> >  
> >  	priv->work_thread = create_singlethread_workqueue("lbs_worker");
> > -	INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> > -	INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> > -	INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> > -	INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +	priv->rtap_net_dev = NULL;
> >  
> >  	sprintf(priv->mesh_ssid, "mesh");
> >  	priv->mesh_ssid_len = 4;
> > +	priv->mesh_open = 0;
> > +
> > +	INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> > +	INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> > +	INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> > +#endif
> > +	INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> >  
> >  	priv->wol_criteria = 0xffffffff;
> >  	priv->wol_gpio = 0xff;
> > @@ -1231,13 +1264,15 @@
> >  
> >  	lbs_deb_enter(LBS_DEB_MAIN);
> >  
> > +	dev = priv->dev;
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	lbs_remove_mesh(priv);
> >  	lbs_remove_rtap(priv);
> >  
> > -	dev = priv->dev;
> > -
> >  	cancel_delayed_work_sync(&priv->scan_work);
> >  	cancel_delayed_work_sync(&priv->assoc_work);
> > +#endif
> >  	cancel_work_sync(&priv->mcast_work);
> >  
> >  	/* worker thread destruction blocks on the in-flight command which
> > @@ -1295,6 +1330,7 @@
> >  
> >  	lbs_update_channel(priv);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	/* Check mesh FW version and appropriately send the mesh start
> >  	 * command
> >  	 */
> > @@ -1342,6 +1378,7 @@
> >  		if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
> >  			lbs_pr_err("cannot register lbs_rtap attribute\n");
> >  	}
> > +#endif
> >  
> >  	lbs_debugfs_init_one(priv, dev);
> >  
> > @@ -1372,10 +1409,12 @@
> >  	netif_carrier_off(dev);
> >  
> >  	lbs_debugfs_remove_one(priv);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_tlv) {
> >  		device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
> >  		device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
> >  	}
> > +#endif
> >  
> >  	/* Delete the timeout of the currently processing command */
> >  	del_timer_sync(&priv->command_timer);
> > @@ -1408,6 +1447,7 @@
> >  EXPORT_SYMBOL_GPL(lbs_stop_card);
> >  
> > 
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  static const struct net_device_ops mesh_netdev_ops = {
> >  	.ndo_open		= lbs_dev_open,
> >  	.ndo_stop 		= lbs_mesh_stop,
> > @@ -1445,7 +1485,7 @@
> >  
> >  	SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
> >  
> > -#ifdef	WIRELESS_EXT
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
> >  #endif
> >  	mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> > @@ -1496,6 +1536,7 @@
> >  	free_netdev(mesh_dev);
> >  	lbs_deb_leave(LBS_DEB_MESH);
> >  }
> > +#endif
> >  
> >  void lbs_queue_event(struct lbs_private *priv, u32 event)
> >  {
> > @@ -1556,6 +1597,7 @@
> >   * rtap interface support fuctions
> >   */
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  static int lbs_rtap_open(struct net_device *dev)
> >  {
> >  	/* Yes, _stop_ the queue. Because we don't support injection */
> > @@ -1632,6 +1674,7 @@
> >  	lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
> >  	return ret;
> >  }
> > +#endif
> >  
> >  module_init(lbs_init_module);
> >  module_exit(lbs_exit_module);
> > --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> > +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> > @@ -7,7 +7,6 @@
> >  #include <linux/if_arp.h>
> >  #include <linux/netdevice.h>
> >  #include <asm/unaligned.h>
> > -#include <net/iw_handler.h>
> >  
> >  #include "host.h"
> >  #include "decl.h"
> > @@ -27,13 +26,16 @@
> >   */
> >  void lbs_mac_event_disconnected(struct lbs_private *priv)
> >  {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	union iwreq_data wrqu;
> > +#endif
> >  
> >  	if (priv->connect_status != LBS_CONNECTED)
> >  		return;
> >  
> >  	lbs_deb_enter(LBS_DEB_ASSOC);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
> >  	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
> >  
> > @@ -44,6 +46,9 @@
> >  
> >  	msleep_interruptible(1000);
> >  	wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
> > +#else
> > +	/* TODO: find out what to do in the cfg80211 case */
> > +#endif
> >  
> >  	/* report disconnect to upper layer */
> >  	netif_stop_queue(priv->dev);
> > @@ -55,6 +60,7 @@
> >  	priv->tx_pending_len = 0;
> >  
> >  	/* reset SNR/NF/RSSI values */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	memset(priv->SNR, 0x00, sizeof(priv->SNR));
> >  	memset(priv->NF, 0x00, sizeof(priv->NF));
> >  	memset(priv->RSSI, 0x00, sizeof(priv->RSSI));
> > @@ -62,7 +68,6 @@
> >  	memset(priv->rawNF, 0x00, sizeof(priv->rawNF));
> >  	priv->nextSNRNF = 0;
> >  	priv->numSNRNF = 0;
> > -	priv->connect_status = LBS_DISCONNECTED;
> >  
> >  	/* Clear out associated SSID and BSSID since connection is
> >  	 * no longer valid.
> > @@ -70,6 +75,9 @@
> >  	memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> >  	memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
> >  	priv->curbssparams.ssid_len = 0;
> > +#endif
> > +	priv->connect_status = LBS_DISCONNECTED;
> > +
> >  
> >  	if (priv->psstate != PS_STATE_FULL_POWER) {
> >  		/* make firmware to exit PS mode */
> > @@ -88,9 +96,12 @@
> >   */
> >  static void handle_mic_failureevent(struct lbs_private *priv, u32 event)
> >  {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	char buf[50];
> > +#endif
> >  
> >  	lbs_deb_enter(LBS_DEB_CMD);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	memset(buf, 0, sizeof(buf));
> >  
> >  	sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication ");
> > @@ -102,6 +113,7 @@
> >  	}
> >  
> >  	lbs_send_iwevcustom_event(priv, buf);
> > +#endif
> >  	lbs_deb_leave(LBS_DEB_CMD);
> >  }
> >  
> > @@ -177,10 +189,6 @@
> >  	case CMD_RET(CMD_802_11_BEACON_STOP):
> >  		break;
> >  
> > -	case CMD_RET(CMD_802_11_RSSI):
> > -		ret = lbs_ret_802_11_rssi(priv, resp);
> > -		break;
> > -
> >  	case CMD_RET(CMD_802_11_TPC_CFG):
> >  		spin_lock_irqsave(&priv->driver_lock, flags);
> >  		memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> > @@ -202,9 +210,16 @@
> >  			       sizeof(resp->params.fwt));
> >  		spin_unlock_irqrestore(&priv->driver_lock, flags);
> >  		break;
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +	case CMD_RET(CMD_802_11_RSSI):
> > +		ret = lbs_ret_802_11_rssi(priv, resp);
> > +		break;
> > +
> >  	case CMD_RET(CMD_802_11_BEACON_CTRL):
> >  		ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
> >  		break;
> > +#endif
> >  
> >  	default:
> >  		lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
> > @@ -297,9 +312,13 @@
> >  			 * ad-hoc mode. It takes place in
> >  			 * lbs_execute_next_command().
> >  			 */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  			if (priv->mode == IW_MODE_ADHOC &&
> >  			    action == CMD_SUBCMD_ENTER_PS)
> >  				priv->psmode = LBS802_11POWERMODECAM;
> > +#else
> > +		/* TODO: we need to figure out what to do here in cfg80211-mode */
> > +#endif
> >  		} else if (action == CMD_SUBCMD_ENTER_PS) {
> >  			priv->needtowakeup = 0;
> >  			priv->psstate = PS_STATE_AWAKE;
> > @@ -516,6 +535,7 @@
> >  		lbs_pr_alert("EVENT: snr high\n");
> >  		break;
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	case MACREG_INT_CODE_MESH_AUTO_STARTED:
> >  		/* Ignore spurious autostart events if autostart is disabled */
> >  		if (!priv->mesh_autostart_enabled) {
> > @@ -532,6 +552,7 @@
> >  		priv->mode = IW_MODE_ADHOC;
> >  		schedule_work(&priv->sync_channel);
> >  		break;
> > +#endif
> >  
> >  	default:
> >  		lbs_pr_alert("EVENT: unknown event id %d\n", event);
> > --- linux-wl.orig/drivers/net/wireless/libertas/debugfs.c
> > +++ linux-wl/drivers/net/wireless/libertas/debugfs.c
> > @@ -4,7 +4,6 @@
> >  #include <linux/delay.h>
> >  #include <linux/mm.h>
> >  #include <linux/string.h>
> > -#include <net/iw_handler.h>
> >  #include <net/lib80211.h>
> >  
> >  #include "dev.h"
> > @@ -60,6 +59,7 @@
> >  }
> >  
> > 
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
> >  				  size_t count, loff_t *ppos)
> >  {
> > @@ -103,6 +103,7 @@
> >  	free_page(addr);
> >  	return res;
> >  }
> > +#endif
> >  
> >  static ssize_t lbs_sleepparams_write(struct file *file,
> >  				const char __user *user_buf, size_t count,
> > @@ -722,8 +723,10 @@
> >  
> >  static const struct lbs_debugfs_files debugfs_files[] = {
> >  	{ "info", 0444, FOPS(lbs_dev_info, write_file_dummy), },
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	{ "getscantable", 0444, FOPS(lbs_getscantable,
> >  					write_file_dummy), },
> > +#endif
> >  	{ "sleepparams", 0644, FOPS(lbs_sleepparams_read,
> >  				lbs_sleepparams_write), },
> >  };
> > --- linux-wl.orig/drivers/net/wireless/libertas/rx.c
> > +++ linux-wl/drivers/net/wireless/libertas/rx.c
> > @@ -34,6 +34,7 @@
> >  	void *eth80211_hdr;
> >  } __attribute__ ((packed));
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  static int process_rxed_802_11_packet(struct lbs_private *priv,
> >  	struct sk_buff *skb);
> >  
> > @@ -129,6 +130,7 @@
> >  
> >  	lbs_deb_leave(LBS_DEB_RX);
> >  }
> > +#endif
> >  
> >  /**
> >   *  @brief This function processes received packet and forwards it
> > @@ -154,12 +156,15 @@
> >  
> >  	skb->ip_summed = CHECKSUM_NONE;
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->monitormode)
> >  		return process_rxed_802_11_packet(priv, skb);
> > +#endif
> >  
> >  	p_rx_pd = (struct rxpd *) skb->data;
> >  	p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
> >  		le32_to_cpu(p_rx_pd->pkt_ptr));
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev) {
> >  		if (priv->mesh_fw_ver == MESH_FW_OLD) {
> >  			if (p_rx_pd->rx_control & RxPD_MESH_FRAME)
> > @@ -169,6 +174,7 @@
> >  				dev = priv->mesh_dev;
> >  		}
> >  	}
> > +#endif
> >  
> >  	lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data,
> >  		 min_t(unsigned int, skb->len, 100));
> > @@ -232,6 +238,7 @@
> >  	 */
> >  	skb_pull(skb, hdrchop);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	/* Take the data rate from the rxpd structure
> >  	 * only if the rate is auto
> >  	 */
> > @@ -239,6 +246,7 @@
> >  		priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
> >  
> >  	lbs_compute_rssi(priv, p_rx_pd);
> > +#endif
> >  
> >  	lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
> >  	dev->stats.rx_bytes += skb->len;
> > @@ -257,6 +265,7 @@
> >  }
> >  EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  /**
> >   *  @brief This function converts Tx/Rx rates from the Marvell WLAN format
> >   *  (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
> > @@ -381,3 +390,4 @@
> >  	lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
> >  	return ret;
> >  }
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/tx.c
> > +++ linux-wl/drivers/net/wireless/libertas/tx.c
> > @@ -12,6 +12,7 @@
> >  #include "dev.h"
> >  #include "wext.h"
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  /**
> >   *  @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE
> >   *  units (500 Kb/s) into Marvell WLAN format (see Table 8 in Section 3.2.1)
> > @@ -49,6 +50,7 @@
> >  	}
> >  	return 0;
> >  }
> > +#endif
> >  
> >  /**
> >   *  @brief This function checks the conditions and sends packet to IF
> > @@ -88,8 +90,10 @@
> >  
> > 
> >  	netif_stop_queue(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->mesh_dev)
> >  		netif_stop_queue(priv->mesh_dev);
> > +#endif
> >  
> >  	if (priv->tx_pending_len) {
> >  		/* This can happen if packets come in on the mesh and eth
> > @@ -111,6 +115,7 @@
> >  	p802x_hdr = skb->data;
> >  	pkt_len = skb->len;
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (dev == priv->rtap_net_dev) {
> >  		struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
> >  
> > @@ -123,6 +128,9 @@
> >  
> >  		/* copy destination address from 802.11 header */
> >  		memcpy(txpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN);
> > +#else
> > +	if (0) {
> > +#endif
> >  	} else {
> >  		/* copy destination address from 802.3 header */
> >  		memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN);
> > @@ -131,12 +139,14 @@
> >  	txpd->tx_packet_length = cpu_to_le16(pkt_len);
> >  	txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (dev == priv->mesh_dev) {
> >  		if (priv->mesh_fw_ver == MESH_FW_OLD)
> >  			txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
> >  		else if (priv->mesh_fw_ver == MESH_FW_NEW)
> >  			txpd->u.bss.bss_num = MESH_IFACE_ID;
> >  	}
> > +#endif
> >  
> >  	lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd));
> >  
> > @@ -154,6 +164,7 @@
> >  
> >  	dev->trans_start = jiffies;
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  	if (priv->monitormode) {
> >  		/* Keep the skb to echo it back once Tx feedback is
> >  		   received from FW */
> > @@ -161,6 +172,9 @@
> >  
> >  		/* Keep the skb around for when we get feedback */
> >  		priv->currenttxskb = skb;
> > +#else
> > +	if (0) {
> > +#endif
> >  	} else {
> >   free:
> >  		dev_kfree_skb_any(skb);
> > @@ -173,6 +187,7 @@
> >  	return ret;
> >  }
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  /**
> >   *  @brief This function sends to the host the last transmitted packet,
> >   *  filling the radiotap headers with transmission information.
> > @@ -207,3 +222,4 @@
> >  		netif_wake_queue(priv->mesh_dev);
> >  }
> >  EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/if_usb.c
> > +++ linux-wl/drivers/net/wireless/libertas/if_usb.c
> > @@ -757,6 +757,7 @@
> >  		lbs_deb_usbd(&cardp->udev->dev, "**EVENT** 0x%X\n", event);
> >  		kfree_skb(skb);
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  		/* Icky undocumented magic special case */
> >  		if (event & 0xffff0000) {
> >  			u32 trycount = (event & 0xffff0000) >> 16;
> > @@ -764,6 +765,7 @@
> >  			lbs_send_tx_feedback(priv, trycount);
> >  		} else
> >  			lbs_queue_event(priv, event & 0xFF);
> > +#endif
> >  		break;
> >  
> >  	default:
> > --- linux-wl.orig/drivers/net/wireless/libertas/assoc.h
> > +++ linux-wl/drivers/net/wireless/libertas/assoc.h
> > @@ -3,6 +3,7 @@
> >  #ifndef _LBS_ASSOC_H_
> >  #define _LBS_ASSOC_H_
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >  
> >  #include "defs.h"
> >  #include "host.h"
> > @@ -152,4 +153,6 @@
> >  int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
> >  				struct assoc_request *assoc);
> >  
> > +#endif
> > +
> >  #endif /* _LBS_ASSOC_H */
> > --- linux-wl.orig/drivers/net/wireless/libertas/scan.h
> > +++ linux-wl/drivers/net/wireless/libertas/scan.h
> > @@ -7,6 +7,8 @@
> >  #ifndef _LBS_SCAN_H
> >  #define _LBS_SCAN_H
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> >  #include <net/iw_handler.h>
> >  
> >  struct lbs_private;
> > @@ -61,3 +63,5 @@
> >  void lbs_scan_worker(struct work_struct *work);
> >  
> >  #endif
> > +
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/wext.h
> > +++ linux-wl/drivers/net/wireless/libertas/wext.h
> > @@ -4,9 +4,13 @@
> >  #ifndef	_LBS_WEXT_H_
> >  #define	_LBS_WEXT_H_
> >  
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> >  void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
> >  
> >  extern struct iw_handler_def lbs_handler_def;
> >  extern struct iw_handler_def mesh_handler_def;
> >  
> >  #endif
> > +
> > +#endif
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply

* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Dan Williams @ 2009-10-21 18:36 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <200910191449.18915.hs4233@mail.mn-solutions.de>

On Mon, 2009-10-19 at 14:49 +0200, Holger Schurig wrote:
> This is a monster patch that makes CFG80211/WEXT operation
> configurable. My cfg80211-RFC/WIP-Patch would come on top of it,
> but would then be quite small, e.g. almost only changed to
> cfg.c/cfg.h.
> 
> As there's no mesh/adhoc/monitor mode implemented in cfg80211-
> mode, I added many, many #ifdef/#endif pairs. Maybe too many.
> Is this too ugly?   Or would this patch be applyable as-is ?

For the mesh interface stuff, especially in tx/rx paths, would you mind
not ifdefing that?  Since with cfg80211, priv->mesh_dev will always be
NULL, those checks will be just fine and you still don't have to care
about mesh.

I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be converted
to use lib80211 or cfg80211 values instead of WEXT ones; I just picked
WEXT at the time because we had no cfg80211 yet.

Stuff like lbs_cmd_bt_access doesn't need to be ifdefed either, because
it simply won't be called if the debugfs bits are disabled.

I'm sure the WEXT-specific lbs_mac_event_disconnected bits could also be
abstracted like you did with the IWAP stuff a few patches ago too.

Basically, I don't mind having some ifdefs; but I think there are way
too many in that patch.  Not all the mesh stuff needs to be disabled
just for cfg80211.

> If the patch is perceived to be too ugly, I could create an
> monitor.h/monitor.c file and singleout everything related to
> monitoring in it, where monitor.h would resolv to dummy static
> functions in the cfg80211-case ... at least as long as we don't
> have monitor suppport in libertas+cfg80211. The same for mesh
> support, e.g. here I could create a mesh.h/mesh.c and do the
> same.
> 
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
> 
> --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
> +++ linux-wl/drivers/net/wireless/libertas/Kconfig
> @@ -37,3 +37,29 @@
>  	depends on LIBERTAS
>  	---help---
>  	  Debugging support.
> +
> +choice
> +	prompt "interface to user-space"
> +	depends on LIBERTAS
> +	default LIBERTAS_WEXT
> +
> +config LIBERTAS_WEXT
> +	bool "WEXT"
> +	help
> +	  This is the old Libertas code as it always used to be:
> +	  configuration done via "iwconfig" or "wpa_supplicant -Dwext",
> +	  associating via libertas-internal code. This is currently the only
> +	  way to support:
> +
> +	  * AD-HOC
> +	  * Libertas' MESH
> +	  * Monitor interface ("rtap")
> +
> +config LIBERTAS_CFG80211
> +	bool "CFG80211"
> +	depends on EXPERIMENTAL
> +	help
> +	  This is new new way of wireless: use cfg80211 for all, e.g.
> +	  "iw" or "wpa_supplicant -Dnl80211".
> +
> +endchoice
> --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> +++ linux-wl/drivers/net/wireless/libertas/Makefile
> @@ -1,15 +1,15 @@
> -libertas-y += assoc.o
>  libertas-y += cfg.o
>  libertas-y += cmd.o
>  libertas-y += cmdresp.o
>  libertas-y += debugfs.o
> -libertas-y += ethtool.o
>  libertas-y += main.o
> -libertas-y += persistcfg.o
>  libertas-y += rx.o
> -libertas-y += scan.o
>  libertas-y += tx.o
> -libertas-y += wext.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += assoc.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += ethtool.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += persistcfg.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += scan.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += wext.o
>  
>  usb8xxx-objs += if_usb.o
>  libertas_cs-objs += if_cs.o
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -3,7 +3,6 @@
>    * It prepares command and sends it to firmware when it is ready.
>    */
>  
> -#include <net/iw_handler.h>
>  #include <net/lib80211.h>
>  #include <linux/kfifo.h>
>  #include <linux/sched.h>
> @@ -184,6 +183,8 @@
>  		memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN);
>  
>  	memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN);
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev)
>  		memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
>  
> @@ -191,6 +192,7 @@
>  		ret = -1;
>  		goto out;
>  	}
> +#endif
>  
>  out:
>  	lbs_deb_leave(LBS_DEB_CMD);
> @@ -387,10 +389,12 @@
>  	cmd.oid = cpu_to_le16((u16) oid);
>  
>  	switch (oid) {
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	case SNMP_MIB_OID_BSS_TYPE:
>  		cmd.bufsize = cpu_to_le16(sizeof(u8));
>  		cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
>  		break;
> +#endif
>  	case SNMP_MIB_OID_11D_ENABLE:
>  	case SNMP_MIB_OID_FRAG_THRESHOLD:
>  	case SNMP_MIB_OID_RTS_THRESHOLD:
> @@ -442,12 +446,14 @@
>  
>  	switch (le16_to_cpu(cmd.bufsize)) {
>  	case sizeof(u8):
> +#ifdef CONFIG_LIBERTAS_WEXT
>  		if (oid == SNMP_MIB_OID_BSS_TYPE) {
>  			if (cmd.value[0] == 2)
>  				*out_val = IW_MODE_ADHOC;
>  			else
>  				*out_val = IW_MODE_INFRA;
>  		} else
> +#endif
>  			*out_val = cmd.value[0];
>  		break;
>  	case sizeof(u16):
> @@ -702,6 +708,7 @@
>  	return 0;
>  }
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
>  			       u16 cmd_action, void *pdata_buf)
>  {
> @@ -868,6 +875,7 @@
>  
>  	return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
>  }
> +#endif
>  
>  static void lbs_queue_cmd(struct lbs_private *priv,
>  			  struct cmd_ctrl_node *cmdnode)
> @@ -1155,10 +1163,6 @@
>  				          cmd_action, pdata_buf);
>  		break;
>  
> -	case CMD_802_11_RSSI:
> -		ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> -		break;
> -
>  	case CMD_802_11_SET_AFC:
>  	case CMD_802_11_GET_AFC:
>  
> @@ -1184,6 +1188,11 @@
>  		ret = 0;
>  		break;
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
> +	case CMD_802_11_RSSI:
> +		ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> +		break;
> +
>  	case CMD_BT_ACCESS:
>  		ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
>  		break;
> @@ -1195,6 +1204,8 @@
>  	case CMD_802_11_BEACON_CTRL:
>  		ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
>  		break;
> +#endif
> +
>  	case CMD_802_11_DEEP_SLEEP:
>  		cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
>  		cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
> @@ -1487,6 +1498,7 @@
>  		 * check if in power save mode, if yes, put the device back
>  		 * to PS mode
>  		 */
> +#ifdef CONFIG_LIBERTAS_WEXT
>  		if ((priv->psmode != LBS802_11POWERMODECAM) &&
>  		    (priv->psstate == PS_STATE_FULL_POWER) &&
>  		    ((priv->connect_status == LBS_CONNECTED) ||
> @@ -1508,6 +1520,9 @@
>  				lbs_ps_sleep(priv, 0);
>  			}
>  		}
> +#else
> +	/* TODO: we need to figure out what to do here in cfg80211-mode */
> +#endif
>  	}
>  
>  	ret = 0;
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -6,8 +6,10 @@
>  #ifndef _LBS_DEV_H_
>  #define _LBS_DEV_H_
>  
> +#include "defs.h"
>  #include "scan.h"
>  #include "assoc.h"
> +#include "host.h"
>  
> 
> 
> @@ -21,6 +23,9 @@
>  	uint16_t sp_reserved;
>  };
>  
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
>  /* Mesh statistics */
>  struct lbs_mesh_stats {
>  	u32	fwd_bcast_cnt;		/* Fwd: Broadcast counter */
> @@ -32,6 +37,8 @@
>  	u32	drop_blind;		/* Rx:  Dropped by blinding table */
>  	u32	tx_failed_cnt;		/* Tx:  Failed transmissions */
>  };
> +#endif
> +
>  
>  /** Private structure for the MV device */
>  struct lbs_private {
> @@ -48,11 +55,11 @@
>  	struct wireless_dev *wdev;
>  
>  	/* Mesh */
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	struct net_device *mesh_dev; /* Virtual device */
>  	u32 mesh_connect_status;
>  	struct lbs_mesh_stats mstats;
>  	int mesh_open;
> -	int mesh_fw_ver;
>  	int mesh_autostart_enabled;
>  	uint16_t mesh_tlv;
>  	u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> @@ -62,6 +69,7 @@
>  	/* Monitor mode */
>  	struct net_device *rtap_net_dev;
>  	u32 monitormode;
> +#endif
>  
>  	/* Debugfs */
>  	struct dentry *debugfs_dir;
> @@ -103,6 +111,7 @@
>  	int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
>  
>  	/* Adapter info (from EEPROM) */
> +	int mesh_fw_ver;
>  	u32 fwrelease;
>  	u32 fwcapinfo;
>  	u16 regioncode;
> @@ -138,11 +147,13 @@
>  	struct workqueue_struct *work_thread;
>  
>  	/** Encryption stuff */
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	struct lbs_802_11_security secinfo;
>  	struct enc_key wpa_mcast_key;
>  	struct enc_key wpa_unicast_key;
>  	u8 wpa_ie[MAX_WPA_IE_LEN];
>  	u8 wpa_ie_len;
> +#endif
>  	u16 wep_tx_keyidx;
>  	struct enc_key wep_keys[4];
>  
> @@ -163,6 +174,7 @@
>  	spinlock_t driver_lock;
>  
>  	/* NIC/link operation characteristics */
> +	u16 capability;
>  	u16 mac_control;
>  	u8 radio_on;
>  	u8 channel;
> @@ -174,6 +186,7 @@
>  	struct delayed_work scan_work;
>  	int scan_channel;
>  	/* remember which channel was scanned last, != 0 if currently scanning */
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
>  	u8 scan_ssid_len;
>  
> @@ -186,7 +199,6 @@
>  	struct bss_descriptor *networks;
>  	struct assoc_request * pending_assoc_req;
>  	struct assoc_request * in_progress_assoc_req;
> -	u16 capability;
>  	uint16_t enablehwauto;
>  	uint16_t ratebitmap;
>  
> @@ -211,6 +223,7 @@
>  	u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
>  	u16 nextSNRNF;
>  	u16 numSNRNF;
> +#endif
>  };
>  
>  extern struct cmd_confirm_sleep confirm_sleep;
> --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> +++ linux-wl/drivers/net/wireless/libertas/main.c
> @@ -13,7 +13,6 @@
>  #include <linux/kfifo.h>
>  #include <linux/stddef.h>
>  #include <linux/ieee80211.h>
> -#include <net/iw_handler.h>
>  #include <net/cfg80211.h>
>  
>  #include "host.h"
> @@ -98,6 +97,7 @@
>   * Attributes exported through sysfs
>   */
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  /**
>   * @brief Get function for sysfs attribute anycast_mask
>   */
> @@ -325,6 +325,8 @@
>  static struct attribute_group lbs_mesh_attr_group = {
>  	.attrs = lbs_mesh_sysfs_entries,
>  };
> +#endif
> +
>  
>  /**
>   *  @brief This function opens the ethX or mshX interface
> @@ -341,6 +343,7 @@
>  
>  	spin_lock_irq(&priv->driver_lock);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->monitormode) {
>  		ret = -EBUSY;
>  		goto out;
> @@ -351,6 +354,9 @@
>  		priv->mesh_connect_status = LBS_CONNECTED;
>  		netif_carrier_on(dev);
>  	} else {
> +#else
> +	if (1) {
> +#endif
>  		priv->infra_open = 1;
>  
>  		if (priv->connect_status == LBS_CONNECTED)
> @@ -361,13 +367,16 @@
>  
>  	if (!priv->tx_pending_len)
>  		netif_wake_queue(dev);
> - out:
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
> + out:
> +#endif
>  	spin_unlock_irq(&priv->driver_lock);
>  	lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
>  	return ret;
>  }
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  /**
>   *  @brief This function closes the mshX interface
>   *
> @@ -383,7 +392,6 @@
>  
>  	priv->mesh_open = 0;
>  	priv->mesh_connect_status = LBS_DISCONNECTED;
> -
>  	netif_stop_queue(dev);
>  	netif_carrier_off(dev);
>  
> @@ -394,6 +402,7 @@
>  	lbs_deb_leave(LBS_DEB_MESH);
>  	return 0;
>  }
> +#endif
>  
>  /**
>   *  @brief This function closes the ethX interface
> @@ -428,8 +437,10 @@
>  
>  	dev->trans_start = jiffies;
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->currenttxskb)
>  		lbs_send_tx_feedback(priv, 0);
> +#endif
>  
>  	/* XX: Shouldn't we also call into the hw-specific driver
>  	   to kick it somehow? */
> @@ -490,8 +501,10 @@
>  
>  	memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
>  	memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev)
>  		memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> +#endif
>  
>  done:
>  	lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> @@ -554,8 +567,10 @@
>  	lbs_deb_enter(LBS_DEB_NET);
>  
>  	dev_flags = priv->dev->flags;
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev)
>  		dev_flags |= priv->mesh_dev->flags;
> +#endif
>  
>  	if (dev_flags & IFF_PROMISC) {
>  		priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
> @@ -572,8 +587,10 @@
>  
>  	/* Once for priv->dev, again for priv->mesh_dev if it exists */
>  	nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (nr_addrs >= 0 && priv->mesh_dev)
>  		nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs);
> +#endif
>  	if (nr_addrs < 0)
>  		goto do_allmulti;
>  
> @@ -816,9 +833,11 @@
>  				   waiting for TX feedback */
>  				if (priv->connect_status == LBS_CONNECTED)
>  					netif_wake_queue(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  				if (priv->mesh_dev &&
>  				    priv->mesh_connect_status == LBS_CONNECTED)
>  					netif_wake_queue(priv->mesh_dev);
> +#endif
>  			}
>  		}
>  		spin_unlock_irq(&priv->driver_lock);
> @@ -838,8 +857,10 @@
>  	lbs_deb_enter(LBS_DEB_FW);
>  
>  	netif_device_detach(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev)
>  		netif_device_detach(priv->mesh_dev);
> +#endif
>  
>  	priv->fw_ready = 0;
>  	lbs_deb_leave(LBS_DEB_FW);
> @@ -882,8 +903,10 @@
>  				     0, 0, NULL);
>  
>  	netif_device_attach(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev)
>  		netif_device_attach(priv->mesh_dev);
> +#endif
>  
>  	lbs_deb_leave(LBS_DEB_FW);
>  }
> @@ -1004,6 +1027,7 @@
>  	return 0;
>  }
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  static void lbs_sync_channel_worker(struct work_struct *work)
>  {
>  	struct lbs_private *priv = container_of(work, struct lbs_private,
> @@ -1014,15 +1038,19 @@
>  		lbs_pr_info("Channel synchronization failed.");
>  	lbs_deb_leave(LBS_DEB_MAIN);
>  }
> -
> +#endif
>  
>  static int lbs_init_adapter(struct lbs_private *priv)
>  {
> +	int ret = 0;
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	size_t bufsize;
> -	int i, ret = 0;
> +	int i;
> +#endif
>  
>  	lbs_deb_enter(LBS_DEB_MAIN);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	/* Allocate buffer to store the BSSID list */
>  	bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor);
>  	priv->networks = kzalloc(bufsize, GFP_KERNEL);
> @@ -1039,17 +1067,18 @@
>  		list_add_tail(&priv->networks[i].list,
>  			      &priv->network_free_list);
>  	}
> +	priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> +	priv->mode = IW_MODE_INFRA;
> +	priv->enablehwauto = 1;
> +	priv->mesh_connect_status = LBS_DISCONNECTED;
> +#endif
>  
>  	memset(priv->current_addr, 0xff, ETH_ALEN);
>  
>  	priv->connect_status = LBS_DISCONNECTED;
> -	priv->mesh_connect_status = LBS_DISCONNECTED;
> -	priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> -	priv->mode = IW_MODE_INFRA;
>  	priv->channel = DEFAULT_AD_HOC_CHANNEL;
>  	priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
>  	priv->radio_on = 1;
> -	priv->enablehwauto = 1;
>  	priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
>  	priv->psmode = LBS802_11POWERMODECAM;
>  	priv->psstate = PS_STATE_FULL_POWER;
> @@ -1103,8 +1132,10 @@
>  		kfifo_free(priv->event_fifo);
>  	del_timer(&priv->command_timer);
>  	del_timer(&priv->auto_deepsleep_timer);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	kfree(priv->networks);
>  	priv->networks = NULL;
> +#endif
>  
>  	lbs_deb_leave(LBS_DEB_MAIN);
>  }
> @@ -1166,8 +1197,8 @@
>  
>   	dev->netdev_ops = &lbs_netdev_ops;
>  	dev->watchdog_timeo = 5 * HZ;
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	dev->ethtool_ops = &lbs_ethtool_ops;
> -#ifdef	WIRELESS_EXT
>  	dev->wireless_handlers = &lbs_handler_def;
>  #endif
>  	dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> @@ -1177,11 +1208,8 @@
>  
> 
>  	priv->card = card;
> -	priv->mesh_open = 0;
>  	priv->infra_open = 0;
>  
> -
> -	priv->rtap_net_dev = NULL;
>  	strcpy(dev->name, "wlan%d");
>  
>  	lbs_deb_thread("Starting main thread...\n");
> @@ -1193,13 +1221,18 @@
>  	}
>  
>  	priv->work_thread = create_singlethread_workqueue("lbs_worker");
> -	INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> -	INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> -	INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> -	INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> +#ifdef CONFIG_LIBERTAS_WEXT
> +	priv->rtap_net_dev = NULL;
>  
>  	sprintf(priv->mesh_ssid, "mesh");
>  	priv->mesh_ssid_len = 4;
> +	priv->mesh_open = 0;
> +
> +	INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> +	INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> +	INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> +#endif
> +	INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
>  
>  	priv->wol_criteria = 0xffffffff;
>  	priv->wol_gpio = 0xff;
> @@ -1231,13 +1264,15 @@
>  
>  	lbs_deb_enter(LBS_DEB_MAIN);
>  
> +	dev = priv->dev;
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	lbs_remove_mesh(priv);
>  	lbs_remove_rtap(priv);
>  
> -	dev = priv->dev;
> -
>  	cancel_delayed_work_sync(&priv->scan_work);
>  	cancel_delayed_work_sync(&priv->assoc_work);
> +#endif
>  	cancel_work_sync(&priv->mcast_work);
>  
>  	/* worker thread destruction blocks on the in-flight command which
> @@ -1295,6 +1330,7 @@
>  
>  	lbs_update_channel(priv);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	/* Check mesh FW version and appropriately send the mesh start
>  	 * command
>  	 */
> @@ -1342,6 +1378,7 @@
>  		if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
>  			lbs_pr_err("cannot register lbs_rtap attribute\n");
>  	}
> +#endif
>  
>  	lbs_debugfs_init_one(priv, dev);
>  
> @@ -1372,10 +1409,12 @@
>  	netif_carrier_off(dev);
>  
>  	lbs_debugfs_remove_one(priv);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_tlv) {
>  		device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
>  		device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
>  	}
> +#endif
>  
>  	/* Delete the timeout of the currently processing command */
>  	del_timer_sync(&priv->command_timer);
> @@ -1408,6 +1447,7 @@
>  EXPORT_SYMBOL_GPL(lbs_stop_card);
>  
> 
> +#ifdef CONFIG_LIBERTAS_WEXT
>  static const struct net_device_ops mesh_netdev_ops = {
>  	.ndo_open		= lbs_dev_open,
>  	.ndo_stop 		= lbs_mesh_stop,
> @@ -1445,7 +1485,7 @@
>  
>  	SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
>  
> -#ifdef	WIRELESS_EXT
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
>  #endif
>  	mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> @@ -1496,6 +1536,7 @@
>  	free_netdev(mesh_dev);
>  	lbs_deb_leave(LBS_DEB_MESH);
>  }
> +#endif
>  
>  void lbs_queue_event(struct lbs_private *priv, u32 event)
>  {
> @@ -1556,6 +1597,7 @@
>   * rtap interface support fuctions
>   */
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  static int lbs_rtap_open(struct net_device *dev)
>  {
>  	/* Yes, _stop_ the queue. Because we don't support injection */
> @@ -1632,6 +1674,7 @@
>  	lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
>  	return ret;
>  }
> +#endif
>  
>  module_init(lbs_init_module);
>  module_exit(lbs_exit_module);
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -7,7 +7,6 @@
>  #include <linux/if_arp.h>
>  #include <linux/netdevice.h>
>  #include <asm/unaligned.h>
> -#include <net/iw_handler.h>
>  
>  #include "host.h"
>  #include "decl.h"
> @@ -27,13 +26,16 @@
>   */
>  void lbs_mac_event_disconnected(struct lbs_private *priv)
>  {
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	union iwreq_data wrqu;
> +#endif
>  
>  	if (priv->connect_status != LBS_CONNECTED)
>  		return;
>  
>  	lbs_deb_enter(LBS_DEB_ASSOC);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
>  	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
>  
> @@ -44,6 +46,9 @@
>  
>  	msleep_interruptible(1000);
>  	wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
> +#else
> +	/* TODO: find out what to do in the cfg80211 case */
> +#endif
>  
>  	/* report disconnect to upper layer */
>  	netif_stop_queue(priv->dev);
> @@ -55,6 +60,7 @@
>  	priv->tx_pending_len = 0;
>  
>  	/* reset SNR/NF/RSSI values */
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	memset(priv->SNR, 0x00, sizeof(priv->SNR));
>  	memset(priv->NF, 0x00, sizeof(priv->NF));
>  	memset(priv->RSSI, 0x00, sizeof(priv->RSSI));
> @@ -62,7 +68,6 @@
>  	memset(priv->rawNF, 0x00, sizeof(priv->rawNF));
>  	priv->nextSNRNF = 0;
>  	priv->numSNRNF = 0;
> -	priv->connect_status = LBS_DISCONNECTED;
>  
>  	/* Clear out associated SSID and BSSID since connection is
>  	 * no longer valid.
> @@ -70,6 +75,9 @@
>  	memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
>  	memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
>  	priv->curbssparams.ssid_len = 0;
> +#endif
> +	priv->connect_status = LBS_DISCONNECTED;
> +
>  
>  	if (priv->psstate != PS_STATE_FULL_POWER) {
>  		/* make firmware to exit PS mode */
> @@ -88,9 +96,12 @@
>   */
>  static void handle_mic_failureevent(struct lbs_private *priv, u32 event)
>  {
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	char buf[50];
> +#endif
>  
>  	lbs_deb_enter(LBS_DEB_CMD);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	memset(buf, 0, sizeof(buf));
>  
>  	sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication ");
> @@ -102,6 +113,7 @@
>  	}
>  
>  	lbs_send_iwevcustom_event(priv, buf);
> +#endif
>  	lbs_deb_leave(LBS_DEB_CMD);
>  }
>  
> @@ -177,10 +189,6 @@
>  	case CMD_RET(CMD_802_11_BEACON_STOP):
>  		break;
>  
> -	case CMD_RET(CMD_802_11_RSSI):
> -		ret = lbs_ret_802_11_rssi(priv, resp);
> -		break;
> -
>  	case CMD_RET(CMD_802_11_TPC_CFG):
>  		spin_lock_irqsave(&priv->driver_lock, flags);
>  		memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> @@ -202,9 +210,16 @@
>  			       sizeof(resp->params.fwt));
>  		spin_unlock_irqrestore(&priv->driver_lock, flags);
>  		break;
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> +	case CMD_RET(CMD_802_11_RSSI):
> +		ret = lbs_ret_802_11_rssi(priv, resp);
> +		break;
> +
>  	case CMD_RET(CMD_802_11_BEACON_CTRL):
>  		ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
>  		break;
> +#endif
>  
>  	default:
>  		lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
> @@ -297,9 +312,13 @@
>  			 * ad-hoc mode. It takes place in
>  			 * lbs_execute_next_command().
>  			 */
> +#ifdef CONFIG_LIBERTAS_WEXT
>  			if (priv->mode == IW_MODE_ADHOC &&
>  			    action == CMD_SUBCMD_ENTER_PS)
>  				priv->psmode = LBS802_11POWERMODECAM;
> +#else
> +		/* TODO: we need to figure out what to do here in cfg80211-mode */
> +#endif
>  		} else if (action == CMD_SUBCMD_ENTER_PS) {
>  			priv->needtowakeup = 0;
>  			priv->psstate = PS_STATE_AWAKE;
> @@ -516,6 +535,7 @@
>  		lbs_pr_alert("EVENT: snr high\n");
>  		break;
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	case MACREG_INT_CODE_MESH_AUTO_STARTED:
>  		/* Ignore spurious autostart events if autostart is disabled */
>  		if (!priv->mesh_autostart_enabled) {
> @@ -532,6 +552,7 @@
>  		priv->mode = IW_MODE_ADHOC;
>  		schedule_work(&priv->sync_channel);
>  		break;
> +#endif
>  
>  	default:
>  		lbs_pr_alert("EVENT: unknown event id %d\n", event);
> --- linux-wl.orig/drivers/net/wireless/libertas/debugfs.c
> +++ linux-wl/drivers/net/wireless/libertas/debugfs.c
> @@ -4,7 +4,6 @@
>  #include <linux/delay.h>
>  #include <linux/mm.h>
>  #include <linux/string.h>
> -#include <net/iw_handler.h>
>  #include <net/lib80211.h>
>  
>  #include "dev.h"
> @@ -60,6 +59,7 @@
>  }
>  
> 
> +#ifdef CONFIG_LIBERTAS_WEXT
>  static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
>  				  size_t count, loff_t *ppos)
>  {
> @@ -103,6 +103,7 @@
>  	free_page(addr);
>  	return res;
>  }
> +#endif
>  
>  static ssize_t lbs_sleepparams_write(struct file *file,
>  				const char __user *user_buf, size_t count,
> @@ -722,8 +723,10 @@
>  
>  static const struct lbs_debugfs_files debugfs_files[] = {
>  	{ "info", 0444, FOPS(lbs_dev_info, write_file_dummy), },
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	{ "getscantable", 0444, FOPS(lbs_getscantable,
>  					write_file_dummy), },
> +#endif
>  	{ "sleepparams", 0644, FOPS(lbs_sleepparams_read,
>  				lbs_sleepparams_write), },
>  };
> --- linux-wl.orig/drivers/net/wireless/libertas/rx.c
> +++ linux-wl/drivers/net/wireless/libertas/rx.c
> @@ -34,6 +34,7 @@
>  	void *eth80211_hdr;
>  } __attribute__ ((packed));
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  static int process_rxed_802_11_packet(struct lbs_private *priv,
>  	struct sk_buff *skb);
>  
> @@ -129,6 +130,7 @@
>  
>  	lbs_deb_leave(LBS_DEB_RX);
>  }
> +#endif
>  
>  /**
>   *  @brief This function processes received packet and forwards it
> @@ -154,12 +156,15 @@
>  
>  	skb->ip_summed = CHECKSUM_NONE;
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->monitormode)
>  		return process_rxed_802_11_packet(priv, skb);
> +#endif
>  
>  	p_rx_pd = (struct rxpd *) skb->data;
>  	p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
>  		le32_to_cpu(p_rx_pd->pkt_ptr));
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev) {
>  		if (priv->mesh_fw_ver == MESH_FW_OLD) {
>  			if (p_rx_pd->rx_control & RxPD_MESH_FRAME)
> @@ -169,6 +174,7 @@
>  				dev = priv->mesh_dev;
>  		}
>  	}
> +#endif
>  
>  	lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data,
>  		 min_t(unsigned int, skb->len, 100));
> @@ -232,6 +238,7 @@
>  	 */
>  	skb_pull(skb, hdrchop);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	/* Take the data rate from the rxpd structure
>  	 * only if the rate is auto
>  	 */
> @@ -239,6 +246,7 @@
>  		priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
>  
>  	lbs_compute_rssi(priv, p_rx_pd);
> +#endif
>  
>  	lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
>  	dev->stats.rx_bytes += skb->len;
> @@ -257,6 +265,7 @@
>  }
>  EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  /**
>   *  @brief This function converts Tx/Rx rates from the Marvell WLAN format
>   *  (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
> @@ -381,3 +390,4 @@
>  	lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
>  	return ret;
>  }
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/tx.c
> +++ linux-wl/drivers/net/wireless/libertas/tx.c
> @@ -12,6 +12,7 @@
>  #include "dev.h"
>  #include "wext.h"
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  /**
>   *  @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE
>   *  units (500 Kb/s) into Marvell WLAN format (see Table 8 in Section 3.2.1)
> @@ -49,6 +50,7 @@
>  	}
>  	return 0;
>  }
> +#endif
>  
>  /**
>   *  @brief This function checks the conditions and sends packet to IF
> @@ -88,8 +90,10 @@
>  
> 
>  	netif_stop_queue(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->mesh_dev)
>  		netif_stop_queue(priv->mesh_dev);
> +#endif
>  
>  	if (priv->tx_pending_len) {
>  		/* This can happen if packets come in on the mesh and eth
> @@ -111,6 +115,7 @@
>  	p802x_hdr = skb->data;
>  	pkt_len = skb->len;
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (dev == priv->rtap_net_dev) {
>  		struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
>  
> @@ -123,6 +128,9 @@
>  
>  		/* copy destination address from 802.11 header */
>  		memcpy(txpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN);
> +#else
> +	if (0) {
> +#endif
>  	} else {
>  		/* copy destination address from 802.3 header */
>  		memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN);
> @@ -131,12 +139,14 @@
>  	txpd->tx_packet_length = cpu_to_le16(pkt_len);
>  	txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (dev == priv->mesh_dev) {
>  		if (priv->mesh_fw_ver == MESH_FW_OLD)
>  			txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
>  		else if (priv->mesh_fw_ver == MESH_FW_NEW)
>  			txpd->u.bss.bss_num = MESH_IFACE_ID;
>  	}
> +#endif
>  
>  	lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd));
>  
> @@ -154,6 +164,7 @@
>  
>  	dev->trans_start = jiffies;
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  	if (priv->monitormode) {
>  		/* Keep the skb to echo it back once Tx feedback is
>  		   received from FW */
> @@ -161,6 +172,9 @@
>  
>  		/* Keep the skb around for when we get feedback */
>  		priv->currenttxskb = skb;
> +#else
> +	if (0) {
> +#endif
>  	} else {
>   free:
>  		dev_kfree_skb_any(skb);
> @@ -173,6 +187,7 @@
>  	return ret;
>  }
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  /**
>   *  @brief This function sends to the host the last transmitted packet,
>   *  filling the radiotap headers with transmission information.
> @@ -207,3 +222,4 @@
>  		netif_wake_queue(priv->mesh_dev);
>  }
>  EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/if_usb.c
> +++ linux-wl/drivers/net/wireless/libertas/if_usb.c
> @@ -757,6 +757,7 @@
>  		lbs_deb_usbd(&cardp->udev->dev, "**EVENT** 0x%X\n", event);
>  		kfree_skb(skb);
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  		/* Icky undocumented magic special case */
>  		if (event & 0xffff0000) {
>  			u32 trycount = (event & 0xffff0000) >> 16;
> @@ -764,6 +765,7 @@
>  			lbs_send_tx_feedback(priv, trycount);
>  		} else
>  			lbs_queue_event(priv, event & 0xFF);
> +#endif
>  		break;
>  
>  	default:
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.h
> +++ linux-wl/drivers/net/wireless/libertas/assoc.h
> @@ -3,6 +3,7 @@
>  #ifndef _LBS_ASSOC_H_
>  #define _LBS_ASSOC_H_
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
>  
>  #include "defs.h"
>  #include "host.h"
> @@ -152,4 +153,6 @@
>  int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
>  				struct assoc_request *assoc);
>  
> +#endif
> +
>  #endif /* _LBS_ASSOC_H */
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.h
> +++ linux-wl/drivers/net/wireless/libertas/scan.h
> @@ -7,6 +7,8 @@
>  #ifndef _LBS_SCAN_H
>  #define _LBS_SCAN_H
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
>  #include <net/iw_handler.h>
>  
>  struct lbs_private;
> @@ -61,3 +63,5 @@
>  void lbs_scan_worker(struct work_struct *work);
>  
>  #endif
> +
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.h
> +++ linux-wl/drivers/net/wireless/libertas/wext.h
> @@ -4,9 +4,13 @@
>  #ifndef	_LBS_WEXT_H_
>  #define	_LBS_WEXT_H_
>  
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
>  void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
>  
>  extern struct iw_handler_def lbs_handler_def;
>  extern struct iw_handler_def mesh_handler_def;
>  
>  #endif
> +
> +#endif


^ permalink raw reply

* Re: [PATCH] libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
From: Dan Williams @ 2009-10-21 18:28 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191331.20476.hs4233@mail.mn-solutions.de>

On Mon, 2009-10-19 at 13:31 +0200, Holger Schurig wrote:
> ... which just resided as an old-style command in cmd/cmdresp, but
> was nowhere useed. If we ever need it, we can re-add it as a newstyle
> command.

It's actually used by the OLPC folks; but right now there's simply no
mechanism to configure that ability via WEXT.  Is there some way to do
this via the kernel LED  framework instead that libertas should be
using?

Dan

> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
> 
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -1181,29 +1181,6 @@
>  
>  		ret = 0;
>  		break;
> -	case CMD_802_11_LED_GPIO_CTRL:
> -		{
> -			struct mrvl_ie_ledgpio *gpio =
> -			    (struct mrvl_ie_ledgpio*)
> -			    cmdptr->params.ledgpio.data;
> -
> -			memmove(&cmdptr->params.ledgpio,
> -				pdata_buf,
> -				sizeof(struct cmd_ds_802_11_led_ctrl));
> -
> -			cmdptr->command =
> -			    cpu_to_le16(CMD_802_11_LED_GPIO_CTRL);
> -
> -#define ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN 8
> -			cmdptr->size =
> -			    cpu_to_le16(le16_to_cpu(gpio->header.len)
> -				+ S_DS_GEN
> -				+ ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN);
> -			gpio->header.len = gpio->header.len;
> -
> -			ret = 0;
> -			break;
> -		}
>  
>  	case CMD_BT_ACCESS:
>  		ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -187,12 +187,6 @@
>  			sizeof(struct cmd_ds_802_11_tpc_cfg));
>  		spin_unlock_irqrestore(&priv->driver_lock, flags);
>  		break;
> -	case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
> -		spin_lock_irqsave(&priv->driver_lock, flags);
> -		memmove((void *)priv->cur_cmd->callback_arg, &resp->params.ledgpio,
> -			sizeof(struct cmd_ds_802_11_led_ctrl));
> -		spin_unlock_irqrestore(&priv->driver_lock, flags);
> -		break;
>  
>  	case CMD_RET(CMD_GET_TSF):
>  		spin_lock_irqsave(&priv->driver_lock, flags);
> 


^ permalink raw reply

* Re: l
From: Andrey Yurovsky @ 2009-10-21 18:23 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless, Dan Williams, John Linville
In-Reply-To: <200910201513.10880.hs4233@mail.mn-solutions.de>

On Tue, Oct 20, 2009 at 6:13 AM, Holger Schurig
<hs4233@mail.mn-solutions.de> wrote:
> [PATCH] libertas spi: fix sparse errors
>
> This fixes the following sparse warnings:
>
> $ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
> make: Entering directory `/usr/src/linux-wl'
>  CHECK   drivers/net/wireless/libertas/if_spi.c
> drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
> drivers/net/wireless/libertas/if_spi.c:137:16:    expected unsigned short [unsigned] [usertype] reg_out
> drivers/net/wireless/libertas/if_spi.c:137:16:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
> drivers/net/wireless/libertas/if_spi.c:191:16:    expected unsigned short [unsigned] [usertype] reg_out
> drivers/net/wireless/libertas/if_spi.c:191:16:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:256:24:    expected restricted __le32 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:256:24:    got unsigned int *<noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> ---
>
> Andrey, can you test this?
>
> Dan, John: this is completely unrelated to my other libertas patches
>
> --- linux-wl.orig/drivers/net/wireless/libertas/if_spi.c
> +++ linux-wl/drivers/net/wireless/libertas/if_spi.c
> @@ -134,7 +134,7 @@
>  static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
>  {
>        int err = 0;
> -       u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
> +       __le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
>        struct spi_message m;
>        struct spi_transfer reg_trans;
>        struct spi_transfer data_trans;
> @@ -166,7 +166,7 @@
>
>  static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
>  {
> -       u16 buff;
> +       __le16 buff;
>
>        buff = cpu_to_le16(val);
>        return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
> @@ -188,7 +188,7 @@
>  {
>        unsigned int delay;
>        int err = 0;
> -       u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
> +       __le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
>        struct spi_message m;
>        struct spi_transfer reg_trans;
>        struct spi_transfer dummy_trans;
> @@ -235,7 +235,7 @@
>  /* Read 16 bits from an SPI register */
>  static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
>  {
> -       u16 buf;
> +       __le16 buf;
>        int ret;
>
>        ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
> @@ -248,7 +248,7 @@
>  * The low 16 bits are read first. */
>  static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
>  {
> -       u32 buf;
> +       __le32 buf;
>        int err;
>
>        err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
>
> --
> http://www.holgerschurig.de
>

Tested-by: Andrey Yurovsky <andrey@cozybit.com>

On a Blackfin (LE) machine.  Also, please fix the subject line : )

^ permalink raw reply

* Re: [PATCH] libertas: remove unused 11d.h as well, priv->countryinfo
From: Dan Williams @ 2009-10-21 18:16 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191014.05320.hs4233@mail.mn-solutions.de>

On Mon, 2009-10-19 at 10:14 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

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

> --- linux-wl.orig/drivers/net/wireless/libertas/11d.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -/**
> -  * This header file contains data structures and
> -  * function declarations of 802.11d
> -  */
> -#ifndef _LBS_11D_
> -#define _LBS_11D_
> -
> -#include "types.h"
> -#include "defs.h"
> -
> -#define UNIVERSAL_REGION_CODE			0xff
> -
> -/** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr)
> - */
> -#define MRVDRV_MAX_SUBBAND_802_11D		83
> -
> -#define COUNTRY_CODE_LEN			3
> -#define MAX_NO_OF_CHAN 				40
> -
> -struct cmd_ds_command;
> -
> -/** Data structure for Country IE*/
> -struct ieee_subbandset {
> -	u8 firstchan;
> -	u8 nrchan;
> -	u8 maxtxpwr;
> -} __attribute__ ((packed));
> -
> -struct ieee_ie_country_info_set {
> -	struct ieee_ie_header header;
> -
> -	u8 countrycode[COUNTRY_CODE_LEN];
> -	struct ieee_subbandset subband[1];
> -};
> -
> -struct ieee_ie_country_info_full_set {
> -	struct ieee_ie_header header;
> -
> -	u8 countrycode[COUNTRY_CODE_LEN];
> -	struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
> -} __attribute__ ((packed));
> -
> -struct mrvl_ie_domain_param_set {
> -	struct mrvl_ie_header header;
> -
> -	u8 countrycode[COUNTRY_CODE_LEN];
> -	struct ieee_subbandset subband[1];
> -} __attribute__ ((packed));
> -
> -struct cmd_ds_802_11d_domain_info {
> -	__le16 action;
> -	struct mrvl_ie_domain_param_set domain;
> -} __attribute__ ((packed));
> -
> -/** domain regulatory information */
> -struct lbs_802_11d_domain_reg {
> -	/** country Code*/
> -	u8 countrycode[COUNTRY_CODE_LEN];
> -	/** No. of subband*/
> -	u8 nr_subband;
> -	struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
> -};
> -
> -struct chan_power_11d {
> -	u8 chan;
> -	u8 pwr;
> -} __attribute__ ((packed));
> -
> -struct parsed_region_chan_11d {
> -	u8 band;
> -	u8 region;
> -	s8 countrycode[COUNTRY_CODE_LEN];
> -	struct chan_power_11d chanpwr[MAX_NO_OF_CHAN];
> -	u8 nr_chan;
> -} __attribute__ ((packed));
> -
> -struct region_code_mapping {
> -	u8 region[COUNTRY_CODE_LEN];
> -	u8 code;
> -};
> -
> -#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -360,8 +360,6 @@
>  	union ieee_phy_param_set phy;
>  	union ieee_ss_param_set ss;
>  
> -	struct ieee_ie_country_info_full_set countryinfo;
> -
>  	u8 wpa_ie[MAX_WPA_IE_LEN];
>  	size_t wpa_ie_len;
>  	u8 rsn_ie[MAX_WPA_IE_LEN];
> --- linux-wl.orig/drivers/net/wireless/libertas/host.h
> +++ linux-wl/drivers/net/wireless/libertas/host.h
> @@ -6,7 +6,8 @@
>  #ifndef _LBS_HOST_H_
>  #define _LBS_HOST_H_
>  
> -#include "11d.h"
> +#include "types.h"
> +#include "defs.h"
>  
>  #define DEFAULT_AD_HOC_CHANNEL                  6
>  
> @@ -961,9 +962,6 @@
>  		struct cmd_ds_bbp_reg_access bbpreg;
>  		struct cmd_ds_rf_reg_access rfreg;
>  
> -		struct cmd_ds_802_11d_domain_info domaininfo;
> -		struct cmd_ds_802_11d_domain_info domaininforesp;
> -
>  		struct cmd_ds_802_11_tpc_cfg tpccfg;
>  		struct cmd_ds_802_11_afc afc;
>  		struct cmd_ds_802_11_led_ctrl ledgpio;
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -503,7 +503,6 @@
>  	struct ieee_ie_cf_param_set *cf;
>  	struct ieee_ie_ibss_param_set *ibss;
>  	DECLARE_SSID_BUF(ssid);
> -	struct ieee_ie_country_info_set *pcountryinfo;
>  	uint8_t *pos, *end, *p;
>  	uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
>  	uint16_t beaconsize = 0;
> @@ -626,26 +625,6 @@
>  			lbs_deb_scan("got IBSS IE\n");
>  			break;
>  
> -		case WLAN_EID_COUNTRY:
> -			pcountryinfo = (struct ieee_ie_country_info_set *) pos;
> -			lbs_deb_scan("got COUNTRY IE\n");
> -			if (pcountryinfo->header.len < sizeof(pcountryinfo->countrycode)
> -			    || pcountryinfo->header.len > 254) {
> -				lbs_deb_scan("%s: 11D- Err CountryInfo len %d, min %zd, max 254\n",
> -					     __func__,
> -					     pcountryinfo->header.len,
> -					     sizeof(pcountryinfo->countrycode));
> -				ret = -1;
> -				goto done;
> -			}
> -
> -			memcpy(&bss->countryinfo, pcountryinfo,
> -				pcountryinfo->header.len + 2);
> -			lbs_deb_hex(LBS_DEB_SCAN, "process_bss: 11d countryinfo",
> -				    (uint8_t *) pcountryinfo,
> -				    (int) (pcountryinfo->header.len + 2));
> -			break;
> -
>  		case WLAN_EID_EXT_SUPP_RATES:
>  			/* only process extended supported rate if data rate is
>  			 * already found. Data rate IE should come before
> 


^ permalink raw reply

* Re: [PATCH] libertas: change IW_ESSID_MAX_SIZE -> IEEE80211_MAX_SSID_LEN
From: Dan Williams @ 2009-10-21 18:15 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191023.41565.hs4233@mail.mn-solutions.de>

On Mon, 2009-10-19 at 10:23 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

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

> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.c
> +++ linux-wl/drivers/net/wireless/libertas/assoc.c
> @@ -226,7 +226,7 @@
>  	priv->connect_status = LBS_CONNECTED;
>  
>  	/* Update current SSID and BSSID */
> -	memcpy(&priv->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE);
> +	memcpy(&priv->curbssparams.ssid, &bss->ssid, IEEE80211_MAX_SSID_LEN);
>  	priv->curbssparams.ssid_len = bss->ssid_len;
>  	memcpy(priv->curbssparams.bssid, bss->bssid, ETH_ALEN);
>  
> @@ -467,7 +467,7 @@
>  	memcpy(&priv->curbssparams.bssid, bss->bssid, ETH_ALEN);
>  
>  	/* Set the new SSID to current SSID */
> -	memcpy(&priv->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE);
> +	memcpy(&priv->curbssparams.ssid, &bss->ssid, IEEE80211_MAX_SSID_LEN);
>  	priv->curbssparams.ssid_len = bss->ssid_len;
>  
>  	netif_carrier_on(priv->dev);
> @@ -1083,7 +1083,7 @@
>  			/* else send START command */
>  			lbs_deb_assoc("SSID not found, creating adhoc network\n");
>  			memcpy(&assoc_req->bss.ssid, &assoc_req->ssid,
> -				IW_ESSID_MAX_SIZE);
> +				IEEE80211_MAX_SSID_LEN);
>  			assoc_req->bss.ssid_len = assoc_req->ssid_len;
>  			lbs_adhoc_start(priv, assoc_req);
>  		}
> @@ -1541,7 +1541,7 @@
>  
>  	found = lbs_find_best_ssid_in_list(priv, preferred_mode);
>  	if (found && (found->ssid_len > 0)) {
> -		memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE);
> +		memcpy(out_ssid, &found->ssid, IEEE80211_MAX_SSID_LEN);
>  		*out_ssid_len = found->ssid_len;
>  		*out_mode = found->mode;
>  		ret = 0;
> @@ -1759,7 +1759,7 @@
>  	assoc_req = priv->pending_assoc_req;
>  	if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
>  		memcpy(&assoc_req->ssid, &priv->curbssparams.ssid,
> -		       IW_ESSID_MAX_SIZE);
> +		       IEEE80211_MAX_SSID_LEN);
>  		assoc_req->ssid_len = priv->curbssparams.ssid_len;
>  	}
>  
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -1168,7 +1168,7 @@
>  		ie->val.mesh_id_len = priv->mesh_ssid_len;
>  		memcpy(ie->val.mesh_id, priv->mesh_ssid, priv->mesh_ssid_len);
>  		ie->len = sizeof(struct mrvl_meshie_val) -
> -			IW_ESSID_MAX_SIZE + priv->mesh_ssid_len;
> +			IEEE80211_MAX_SSID_LEN + priv->mesh_ssid_len;
>  		cmd.length = cpu_to_le16(sizeof(struct mrvl_meshie_val));
>  		break;
>  	case CMD_ACT_MESH_CONFIG_STOP:
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -68,7 +68,7 @@
>  	 * no longer valid.
>  	 */
>  	memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> -	memset(&priv->curbssparams.ssid, 0, IW_ESSID_MAX_SIZE);
> +	memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
>  	priv->curbssparams.ssid_len = 0;
>  
>  	if (priv->psstate != PS_STATE_FULL_POWER) {
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -65,7 +65,7 @@
>  	/** bssid */
>  	u8 bssid[ETH_ALEN];
>  	/** ssid */
> -	u8 ssid[IW_ESSID_MAX_SIZE + 1];
> +	u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
>  	u8 ssid_len;
>  
>  	/** band */
> @@ -163,7 +163,7 @@
>  	struct work_struct sync_channel;
>  	/* remember which channel was scanned last, != 0 if currently scanning */
>  	int scan_channel;
> -	u8 scan_ssid[IW_ESSID_MAX_SIZE + 1];
> +	u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
>  	u8 scan_ssid_len;
>  
>  	/** Hardware access */
> @@ -230,7 +230,7 @@
>  	struct current_bss_params curbssparams;
>  
>  	uint16_t mesh_tlv;
> -	u8 mesh_ssid[IW_ESSID_MAX_SIZE + 1];
> +	u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
>  	u8 mesh_ssid_len;
>  
>  	/* IW_MODE_* */
> @@ -340,7 +340,7 @@
>  struct bss_descriptor {
>  	u8 bssid[ETH_ALEN];
>  
> -	u8 ssid[IW_ESSID_MAX_SIZE + 1];
> +	u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
>  	u8 ssid_len;
>  
>  	u16 capability;
> @@ -389,7 +389,7 @@
>  #define ASSOC_FLAG_WPA_IE		11
>  	unsigned long flags;
>  
> -	u8 ssid[IW_ESSID_MAX_SIZE + 1];
> +	u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
>  	u8 ssid_len;
>  	u8 channel;
>  	u8 band;
> --- linux-wl.orig/drivers/net/wireless/libertas/host.h
> +++ linux-wl/drivers/net/wireless/libertas/host.h
> @@ -719,7 +719,7 @@
>  struct cmd_ds_802_11_ad_hoc_start {
>  	struct cmd_header hdr;
>  
> -	u8 ssid[IW_ESSID_MAX_SIZE];
> +	u8 ssid[IEEE80211_MAX_SSID_LEN];
>  	u8 bsstype;
>  	__le16 beaconperiod;
>  	u8 dtimperiod;   /* Reserved on v9 and later */
> @@ -742,7 +742,7 @@
>  
>  struct adhoc_bssdesc {
>  	u8 bssid[ETH_ALEN];
> -	u8 ssid[IW_ESSID_MAX_SIZE];
> +	u8 ssid[IEEE80211_MAX_SSID_LEN];
>  	u8 type;
>  	__le16 beaconperiod;
>  	u8 dtimperiod;
> --- linux-wl.orig/drivers/net/wireless/libertas/persistcfg.c
> +++ linux-wl/drivers/net/wireless/libertas/persistcfg.c
> @@ -187,9 +187,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 +214,7 @@
>  	int len;
>  	int ret;
>  
> -	if (count < 2 || count > IW_ESSID_MAX_SIZE + 1)
> +	if (count < 2 || count > IEEE80211_MAX_SSID_LEN + 1)
>  		return -EINVAL;
>  
>  	memset(&cmd, 0, sizeof(struct cmd_ds_mesh_config));
> @@ -233,7 +233,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);
> --- linux-wl.orig/drivers/net/wireless/libertas/types.h
> +++ linux-wl/drivers/net/wireless/libertas/types.h
> @@ -5,8 +5,8 @@
>  #define _LBS_TYPES_H_
>  
>  #include <linux/if_ether.h>
> +#include <linux/ieee80211.h>
>  #include <asm/byteorder.h>
> -#include <linux/wireless.h>
>  
>  struct ieee_ie_header {
>  	u8 id;
> @@ -247,7 +247,7 @@
>  	uint8_t active_metric_id;
>  	uint8_t mesh_capability;
>  	uint8_t mesh_id_len;
> -	uint8_t mesh_id[IW_ESSID_MAX_SIZE];
> +	uint8_t mesh_id[IEEE80211_MAX_SSID_LEN];
>  } __attribute__ ((packed));
>  
>  struct mrvl_meshie {
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -19,11 +19,11 @@
>  
>  //! Approximate amount of data needed to pass a scan result back to iwlist
>  #define MAX_SCAN_CELL_SIZE  (IW_EV_ADDR_LEN             \
> -                             + IW_ESSID_MAX_SIZE        \
> +                             + IEEE80211_MAX_SSID_LEN   \
>                               + IW_EV_UINT_LEN           \
>                               + IW_EV_FREQ_LEN           \
>                               + IW_EV_QUAL_LEN           \
> -                             + IW_ESSID_MAX_SIZE        \
> +                             + IEEE80211_MAX_SSID_LEN   \
>                               + IW_EV_PARAM_LEN          \
>                               + 40)	/* 40 for WPAIE */
>  
> @@ -775,7 +775,7 @@
>  	/* SSID */
>  	iwe.cmd = SIOCGIWESSID;
>  	iwe.u.data.flags = 1;
> -	iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IW_ESSID_MAX_SIZE);
> +	iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IEEE80211_MAX_SSID_LEN);
>  	start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid);
>  
>  	/* Mode */
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.c
> +++ linux-wl/drivers/net/wireless/libertas/wext.c
> @@ -1989,7 +1989,7 @@
>  {
>  	struct lbs_private *priv = dev->ml_priv;
>  	int ret = 0;
> -	u8 ssid[IW_ESSID_MAX_SIZE];
> +	u8 ssid[IEEE80211_MAX_SSID_LEN];
>  	u8 ssid_len = 0;
>  	struct assoc_request * assoc_req;
>  	int in_ssid_len = dwrq->length;
> @@ -2003,7 +2003,7 @@
>  	}
>  
>  	/* Check the size of the string */
> -	if (in_ssid_len > IW_ESSID_MAX_SIZE) {
> +	if (in_ssid_len > IEEE80211_MAX_SSID_LEN) {
>  		ret = -E2BIG;
>  		goto out;
>  	}
> @@ -2034,7 +2034,7 @@
>  			ret = -ENOMEM;
>  		} else {
>  			/* Copy the SSID to the association request */
> -			memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE);
> +			memcpy(&assoc_req->ssid, &ssid, IEEE80211_MAX_SSID_LEN);
>  			assoc_req->ssid_len = ssid_len;
>  			set_bit(ASSOC_FLAG_SSID, &assoc_req->flags);
>  			lbs_postpone_association_work(priv);
> @@ -2085,7 +2085,7 @@
>  	}
>  
>  	/* Check the size of the string */
> -	if (dwrq->length > IW_ESSID_MAX_SIZE) {
> +	if (dwrq->length > IEEE80211_MAX_SSID_LEN) {
>  		ret = -E2BIG;
>  		goto out;
>  	}
> 


^ permalink raw reply

* Re: [PATCH] libertas: remove unused 11d code
From: Dan Williams @ 2009-10-21 18:13 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910190940.52830.hs4233@mail.mn-solutions.de>

On Mon, 2009-10-19 at 09:40 +0200, Holger Schurig wrote:
> Most of the 11d code was protected with an "if (priv->enable11d)" clause.
> But there was no code that anywhere that was able to set this
> variable to true. So all 11d code was dead for almost a year and no one
> complained. That's enought incentive to remove this code.
> 
> Besides removing old cruft, we gain back the 11d capability in a common way
> when we merge the cfg80211 functionality.
> 
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

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

Can add this back when somebody cares.  Nobody has touched it in at
least 3 years.

> ---
> 
> First I removed all protected with "if (priv->enable11d)".
> 
> Then I removed the now empty functions because of the first step (e.g.
> lbs_create_dnld_countryinfo_11d() and lbs_parse_dnld_countryinfo_11d()
> became empty.
> 
> Then there was no code that could invoke CMD_802_11D_DOMAIN_INFO, so I
> removed the parts from cmd.c and cmdresp.c that handled this.
> 
> Then I removed the functions and variables that were unused.
> 
> Then I removed priv->parsed_region_chan and it's initialisation code. It was
> only initialized and not used at all.
> 
> And suddenly 11d. was empty, so I removed that as well.
> 
> 
> --- linux-wl.orig/drivers/net/wireless/libertas/11d.h
> +++ linux-wl/drivers/net/wireless/libertas/11d.h
> @@ -79,27 +79,4 @@
>  	u8 code;
>  };
>  
> -struct lbs_private;
> -
> -u8 lbs_get_scan_type_11d(u8 chan,
> -			  struct parsed_region_chan_11d *parsed_region_chan);
> -
> -u32 lbs_chan_2_freq(u8 chan);
> -
> -void lbs_init_11d(struct lbs_private *priv);
> -
> -int lbs_set_universaltable(struct lbs_private *priv, u8 band);
> -
> -int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
> -				 struct cmd_ds_command *cmd, u16 cmdno,
> -				 u16 cmdOption);
> -
> -int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
> -
> -struct bss_descriptor;
> -int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
> -                                        struct bss_descriptor * bss);
> -
> -int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
> -
>  #endif
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.c
> +++ linux-wl/drivers/net/wireless/libertas/assoc.c
> @@ -371,11 +371,6 @@
>  	/* update curbssparams */
>  	priv->curbssparams.channel = bss->phy.ds.channel;
>  
> -	if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
> -		ret = -1;
> -		goto done;
> -	}
> -
>  	ret = lbs_cmd_with_response(priv, command, &cmd);
>  	if (ret == 0) {
>  		ret = lbs_assoc_post(priv,
> @@ -650,11 +645,6 @@
>  		}
>  	}
>  
> -	if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
> -		ret = -1;
> -		goto out;
> -	}
> -
>  	ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_JOIN, &cmd);
>  	if (ret == 0) {
>  		ret = lbs_adhoc_post(priv,
> @@ -754,12 +744,6 @@
>  	lbs_deb_join("ADHOC_START: rates=%02x %02x %02x %02x\n",
>  	       cmd.rates[0], cmd.rates[1], cmd.rates[2], cmd.rates[3]);
>  
> -	if (lbs_create_dnld_countryinfo_11d(priv)) {
> -		lbs_deb_join("ADHOC_START: dnld_countryinfo_11d failed\n");
> -		ret = -1;
> -		goto out;
> -	}
> -
>  	lbs_deb_join("ADHOC_START: Starting Ad-Hoc BSS on channel %d, band %d\n",
>  		     assoc_req->channel, assoc_req->band);
>  
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -144,31 +144,15 @@
>  	scantype = CMD_SCAN_TYPE_ACTIVE;
>  
>  	for (rgnidx = 0; rgnidx < ARRAY_SIZE(priv->region_channel); rgnidx++) {
> -		if (priv->enable11d && (priv->connect_status != LBS_CONNECTED)
> -		    && (priv->mesh_connect_status != LBS_CONNECTED)) {
> -			/* Scan all the supported chan for the first scan */
> -			if (!priv->universal_channel[rgnidx].valid)
> -				continue;
> -			scanregion = &priv->universal_channel[rgnidx];
> -
> -			/* clear the parsed_region_chan for the first scan */
> -			memset(&priv->parsed_region_chan, 0x00,
> -			       sizeof(priv->parsed_region_chan));
> -		} else {
> -			if (!priv->region_channel[rgnidx].valid)
> -				continue;
> -			scanregion = &priv->region_channel[rgnidx];
> -		}
> +		if (!priv->region_channel[rgnidx].valid)
> +			continue;
> +		scanregion = &priv->region_channel[rgnidx];
>  
>  		for (nextchan = 0; nextchan < scanregion->nrcfp; nextchan++, chanidx++) {
>  			struct chanscanparamset *chan = &scanchanlist[chanidx];
>  
>  			cfp = scanregion->CFP + nextchan;
>  
> -			if (priv->enable11d)
> -				scantype = lbs_get_scan_type_11d(cfp->channel,
> -								 &priv->parsed_region_chan);
> -
>  			if (scanregion->band == BAND_B || scanregion->band == BAND_G)
>  				chan->radiotype = CMD_SCAN_RADIO_TYPE_BG;
>  
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.c
> +++ linux-wl/drivers/net/wireless/libertas/wext.c
> @@ -65,8 +65,6 @@
>  	for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
>  		rc = &priv->region_channel[j];
>  
> -		if (priv->enable11d)
> -			rc = &priv->universal_channel[j];
>  		if (!rc->valid || !rc->CFP)
>  			continue;
>  		if (rc->band != band)
> @@ -106,8 +104,6 @@
>  	for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
>  		rc = &priv->region_channel[j];
>  
> -		if (priv->enable11d)
> -			rc = &priv->universal_channel[j];
>  		if (!rc->valid || !rc->CFP)
>  			continue;
>  		if (rc->band != band)
> @@ -546,8 +542,6 @@
>  	struct chan_freq_power *cfp;
>  	u8 rates[MAX_RATES + 1];
>  
> -	u8 flag = 0;
> -
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
>  	dwrq->length = sizeof(struct iw_range);
> @@ -569,52 +563,21 @@
>  
>  	range->scan_capa = IW_SCAN_CAPA_ESSID;
>  
> -	if (priv->enable11d &&
> -	    (priv->connect_status == LBS_CONNECTED ||
> -	    priv->mesh_connect_status == LBS_CONNECTED)) {
> -		u8 chan_no;
> -		u8 band;
> -
> -		struct parsed_region_chan_11d *parsed_region_chan =
> -		    &priv->parsed_region_chan;
> -
> -		if (parsed_region_chan == NULL) {
> -			lbs_deb_wext("11d: parsed_region_chan is NULL\n");
> -			goto out;
> -		}
> -		band = parsed_region_chan->band;
> -		lbs_deb_wext("band %d, nr_char %d\n", band,
> -		       parsed_region_chan->nr_chan);
> -
> +	for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> +	     && (j < ARRAY_SIZE(priv->region_channel)); j++) {
> +		cfp = priv->region_channel[j].CFP;
>  		for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> -		     && (i < parsed_region_chan->nr_chan); i++) {
> -			chan_no = parsed_region_chan->chanpwr[i].chan;
> -			lbs_deb_wext("chan_no %d\n", chan_no);
> -			range->freq[range->num_frequency].i = (long)chan_no;
> +		     && priv->region_channel[j].valid
> +		     && cfp
> +		     && (i < priv->region_channel[j].nrcfp); i++) {
> +			range->freq[range->num_frequency].i =
> +			    (long)cfp->channel;
>  			range->freq[range->num_frequency].m =
> -			    (long)lbs_chan_2_freq(chan_no) * 100000;
> +			    (long)cfp->freq * 100000;
>  			range->freq[range->num_frequency].e = 1;
> +			cfp++;
>  			range->num_frequency++;
>  		}
> -		flag = 1;
> -	}
> -	if (!flag) {
> -		for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> -		     && (j < ARRAY_SIZE(priv->region_channel)); j++) {
> -			cfp = priv->region_channel[j].CFP;
> -			for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> -			     && priv->region_channel[j].valid
> -			     && cfp
> -			     && (i < priv->region_channel[j].nrcfp); i++) {
> -				range->freq[range->num_frequency].i =
> -				    (long)cfp->channel;
> -				range->freq[range->num_frequency].m =
> -				    (long)cfp->freq * 100000;
> -				range->freq[range->num_frequency].e = 1;
> -				cfp++;
> -				range->num_frequency++;
> -			}
> -		}
>  	}
>  
>  	lbs_deb_wext("IW_MAX_FREQUENCIES %d, num_frequency %d\n",
> @@ -699,7 +662,6 @@
>  		                  | IW_ENC_CAPA_CIPHER_CCMP;
>  	}
>  
> -out:
>  	lbs_deb_leave(LBS_DEB_WEXT);
>  	return 0;
>  }
> --- linux-wl.orig/drivers/net/wireless/libertas/11d.c
> +++ /dev/null
> @@ -1,697 +0,0 @@
> -/**
> -  * This file contains functions for 802.11D.
> -  */
> -#include <linux/ctype.h>
> -#include <linux/kernel.h>
> -#include <linux/wireless.h>
> -
> -#include "host.h"
> -#include "cmd.h"
> -#include "decl.h"
> -#include "11d.h"
> -#include "dev.h"
> -#include "wext.h"
> -
> -#define TX_PWR_DEFAULT	10
> -
> -static struct region_code_mapping region_code_mapping[] = {
> -	{"US ", 0x10},		/* US FCC      */
> -	{"CA ", 0x10},		/* IC Canada   */
> -	{"SG ", 0x10},		/* Singapore   */
> -	{"EU ", 0x30},		/* ETSI        */
> -	{"AU ", 0x30},		/* Australia   */
> -	{"KR ", 0x30},		/* Republic Of Korea */
> -	{"ES ", 0x31},		/* Spain       */
> -	{"FR ", 0x32},		/* France      */
> -	{"JP ", 0x40},		/* Japan       */
> -};
> -
> -/* Following 2 structure defines the supported channels */
> -static struct chan_freq_power channel_freq_power_UN_BG[] = {
> -	{1, 2412, TX_PWR_DEFAULT},
> -	{2, 2417, TX_PWR_DEFAULT},
> -	{3, 2422, TX_PWR_DEFAULT},
> -	{4, 2427, TX_PWR_DEFAULT},
> -	{5, 2432, TX_PWR_DEFAULT},
> -	{6, 2437, TX_PWR_DEFAULT},
> -	{7, 2442, TX_PWR_DEFAULT},
> -	{8, 2447, TX_PWR_DEFAULT},
> -	{9, 2452, TX_PWR_DEFAULT},
> -	{10, 2457, TX_PWR_DEFAULT},
> -	{11, 2462, TX_PWR_DEFAULT},
> -	{12, 2467, TX_PWR_DEFAULT},
> -	{13, 2472, TX_PWR_DEFAULT},
> -	{14, 2484, TX_PWR_DEFAULT}
> -};
> -
> -static u8 lbs_region_2_code(u8 *region)
> -{
> -	u8 i;
> -
> -	for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++)
> -		region[i] = toupper(region[i]);
> -
> -	for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
> -		if (!memcmp(region, region_code_mapping[i].region,
> -			    COUNTRY_CODE_LEN))
> -			return (region_code_mapping[i].code);
> -	}
> -
> -	/* default is US */
> -	return (region_code_mapping[0].code);
> -}
> -
> -static u8 *lbs_code_2_region(u8 code)
> -{
> -	u8 i;
> -
> -	for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
> -		if (region_code_mapping[i].code == code)
> -			return (region_code_mapping[i].region);
> -	}
> -	/* default is US */
> -	return (region_code_mapping[0].region);
> -}
> -
> -/**
> - *  @brief This function finds the nrchan-th chan after the firstchan
> - *  @param band       band
> - *  @param firstchan  first channel number
> - *  @param nrchan   number of channels
> - *  @return 	      the nrchan-th chan number
> -*/
> -static u8 lbs_get_chan_11d(u8 firstchan, u8 nrchan, u8 *chan)
> -/*find the nrchan-th chan after the firstchan*/
> -{
> -	u8 i;
> -	struct chan_freq_power *cfp;
> -	u8 cfp_no;
> -
> -	cfp = channel_freq_power_UN_BG;
> -	cfp_no = ARRAY_SIZE(channel_freq_power_UN_BG);
> -
> -	for (i = 0; i < cfp_no; i++) {
> -		if ((cfp + i)->channel == firstchan) {
> -			lbs_deb_11d("firstchan found\n");
> -			break;
> -		}
> -	}
> -
> -	if (i < cfp_no) {
> -		/*if beyond the boundary */
> -		if (i + nrchan < cfp_no) {
> -			*chan = (cfp + i + nrchan)->channel;
> -			return 1;
> -		}
> -	}
> -
> -	return 0;
> -}
> -
> -/**
> - *  @brief This function Checks if chan txpwr is learned from AP/IBSS
> - *  @param chan                 chan number
> - *  @param parsed_region_chan   pointer to parsed_region_chan_11d
> - *  @return 	                TRUE; FALSE
> -*/
> -static u8 lbs_channel_known_11d(u8 chan,
> -			  struct parsed_region_chan_11d * parsed_region_chan)
> -{
> -	struct chan_power_11d *chanpwr = parsed_region_chan->chanpwr;
> -	u8 nr_chan = parsed_region_chan->nr_chan;
> -	u8 i = 0;
> -
> -	lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)chanpwr,
> -		sizeof(struct chan_power_11d) * nr_chan);
> -
> -	for (i = 0; i < nr_chan; i++) {
> -		if (chan == chanpwr[i].chan) {
> -			lbs_deb_11d("found chan %d\n", chan);
> -			return 1;
> -		}
> -	}
> -
> -	lbs_deb_11d("chan %d not found\n", chan);
> -	return 0;
> -}
> -
> -u32 lbs_chan_2_freq(u8 chan)
> -{
> -	struct chan_freq_power *cf;
> -	u16 i;
> -	u32 freq = 0;
> -
> -	cf = channel_freq_power_UN_BG;
> -
> -	for (i = 0; i < ARRAY_SIZE(channel_freq_power_UN_BG); i++) {
> -		if (chan == cf[i].channel)
> -			freq = cf[i].freq;
> -	}
> -
> -	return freq;
> -}
> -
> -static int generate_domain_info_11d(struct parsed_region_chan_11d
> -				  *parsed_region_chan,
> -				  struct lbs_802_11d_domain_reg *domaininfo)
> -{
> -	u8 nr_subband = 0;
> -
> -	u8 nr_chan = parsed_region_chan->nr_chan;
> -	u8 nr_parsedchan = 0;
> -
> -	u8 firstchan = 0, nextchan = 0, maxpwr = 0;
> -
> -	u8 i, flag = 0;
> -
> -	memcpy(domaininfo->countrycode, parsed_region_chan->countrycode,
> -	       COUNTRY_CODE_LEN);
> -
> -	lbs_deb_11d("nrchan %d\n", nr_chan);
> -	lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)parsed_region_chan,
> -		sizeof(struct parsed_region_chan_11d));
> -
> -	for (i = 0; i < nr_chan; i++) {
> -		if (!flag) {
> -			flag = 1;
> -			nextchan = firstchan =
> -			    parsed_region_chan->chanpwr[i].chan;
> -			maxpwr = parsed_region_chan->chanpwr[i].pwr;
> -			nr_parsedchan = 1;
> -			continue;
> -		}
> -
> -		if (parsed_region_chan->chanpwr[i].chan == nextchan + 1 &&
> -		    parsed_region_chan->chanpwr[i].pwr == maxpwr) {
> -			nextchan++;
> -			nr_parsedchan++;
> -		} else {
> -			domaininfo->subband[nr_subband].firstchan = firstchan;
> -			domaininfo->subband[nr_subband].nrchan =
> -			    nr_parsedchan;
> -			domaininfo->subband[nr_subband].maxtxpwr = maxpwr;
> -			nr_subband++;
> -			nextchan = firstchan =
> -			    parsed_region_chan->chanpwr[i].chan;
> -			maxpwr = parsed_region_chan->chanpwr[i].pwr;
> -		}
> -	}
> -
> -	if (flag) {
> -		domaininfo->subband[nr_subband].firstchan = firstchan;
> -		domaininfo->subband[nr_subband].nrchan = nr_parsedchan;
> -		domaininfo->subband[nr_subband].maxtxpwr = maxpwr;
> -		nr_subband++;
> -	}
> -	domaininfo->nr_subband = nr_subband;
> -
> -	lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband);
> -	lbs_deb_hex(LBS_DEB_11D, "domaininfo", (char *)domaininfo,
> -		COUNTRY_CODE_LEN + 1 +
> -		sizeof(struct ieee_subbandset) * nr_subband);
> -	return 0;
> -}
> -
> -/**
> - *  @brief This function generates parsed_region_chan from Domain Info learned from AP/IBSS
> - *  @param region_chan          pointer to struct region_channel
> - *  @param *parsed_region_chan  pointer to parsed_region_chan_11d
> - *  @return 	                N/A
> -*/
> -static void lbs_generate_parsed_region_chan_11d(struct region_channel *region_chan,
> -					  struct parsed_region_chan_11d *
> -					  parsed_region_chan)
> -{
> -	u8 i;
> -	struct chan_freq_power *cfp;
> -
> -	if (region_chan == NULL) {
> -		lbs_deb_11d("region_chan is NULL\n");
> -		return;
> -	}
> -
> -	cfp = region_chan->CFP;
> -	if (cfp == NULL) {
> -		lbs_deb_11d("cfp is NULL \n");
> -		return;
> -	}
> -
> -	parsed_region_chan->band = region_chan->band;
> -	parsed_region_chan->region = region_chan->region;
> -	memcpy(parsed_region_chan->countrycode,
> -	       lbs_code_2_region(region_chan->region), COUNTRY_CODE_LEN);
> -
> -	lbs_deb_11d("region 0x%x, band %d\n", parsed_region_chan->region,
> -	       parsed_region_chan->band);
> -
> -	for (i = 0; i < region_chan->nrcfp; i++, cfp++) {
> -		parsed_region_chan->chanpwr[i].chan = cfp->channel;
> -		parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower;
> -		lbs_deb_11d("chan %d, pwr %d\n",
> -		       parsed_region_chan->chanpwr[i].chan,
> -		       parsed_region_chan->chanpwr[i].pwr);
> -	}
> -	parsed_region_chan->nr_chan = region_chan->nrcfp;
> -
> -	lbs_deb_11d("nrchan %d\n", parsed_region_chan->nr_chan);
> -
> -	return;
> -}
> -
> -/**
> - *  @brief generate parsed_region_chan from Domain Info learned from AP/IBSS
> - *  @param region               region ID
> - *  @param band                 band
> - *  @param chan                 chan
> - *  @return 	                TRUE;FALSE
> -*/
> -static u8 lbs_region_chan_supported_11d(u8 region, u8 chan)
> -{
> -	struct chan_freq_power *cfp;
> -	int cfp_no;
> -	u8 idx;
> -	int ret = 0;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -
> -	cfp = lbs_get_region_cfp_table(region, &cfp_no);
> -	if (cfp == NULL)
> -		return 0;
> -
> -	for (idx = 0; idx < cfp_no; idx++) {
> -		if (chan == (cfp + idx)->channel) {
> -			/* If Mrvl Chip Supported? */
> -			if ((cfp + idx)->unsupported) {
> -				ret = 0;
> -			} else {
> -				ret = 1;
> -			}
> -			goto done;
> -		}
> -	}
> -
> -	/*chan is not in the region table */
> -
> -done:
> -	lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> -	return ret;
> -}
> -
> -/**
> - *  @brief This function checks if chan txpwr is learned from AP/IBSS
> - *  @param chan                 chan number
> - *  @param parsed_region_chan   pointer to parsed_region_chan_11d
> - *  @return 	                0
> -*/
> -static int parse_domain_info_11d(struct ieee_ie_country_info_full_set *countryinfo,
> -				 u8 band,
> -				 struct parsed_region_chan_11d *parsed_region_chan)
> -{
> -	u8 nr_subband, nrchan;
> -	u8 lastchan, firstchan;
> -	u8 region;
> -	u8 curchan = 0;
> -
> -	u8 idx = 0;		/*chan index in parsed_region_chan */
> -
> -	u8 j, i;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -
> -	/*validation Rules:
> -	   1. valid region Code
> -	   2. First Chan increment
> -	   3. channel range no overlap
> -	   4. channel is valid?
> -	   5. channel is supported by region?
> -	   6. Others
> -	 */
> -
> -	lbs_deb_hex(LBS_DEB_11D, "countryinfo", (u8 *) countryinfo, 30);
> -
> -	if ((*(countryinfo->countrycode)) == 0
> -	    || (countryinfo->header.len <= COUNTRY_CODE_LEN)) {
> -		/* No region Info or Wrong region info: treat as No 11D info */
> -		goto done;
> -	}
> -
> -	/*Step1: check region_code */
> -	parsed_region_chan->region = region =
> -	    lbs_region_2_code(countryinfo->countrycode);
> -
> -	lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region);
> -	lbs_deb_hex(LBS_DEB_11D, "countrycode", (char *)countryinfo->countrycode,
> -		COUNTRY_CODE_LEN);
> -
> -	parsed_region_chan->band = band;
> -
> -	memcpy(parsed_region_chan->countrycode, countryinfo->countrycode,
> -	       COUNTRY_CODE_LEN);
> -
> -	nr_subband = (countryinfo->header.len - COUNTRY_CODE_LEN) /
> -	    sizeof(struct ieee_subbandset);
> -
> -	for (j = 0, lastchan = 0; j < nr_subband; j++) {
> -
> -		if (countryinfo->subband[j].firstchan <= lastchan) {
> -			/*Step2&3. Check First Chan Num increment and no overlap */
> -			lbs_deb_11d("chan %d>%d, overlap\n",
> -			       countryinfo->subband[j].firstchan, lastchan);
> -			continue;
> -		}
> -
> -		firstchan = countryinfo->subband[j].firstchan;
> -		nrchan = countryinfo->subband[j].nrchan;
> -
> -		for (i = 0; idx < MAX_NO_OF_CHAN && i < nrchan; i++) {
> -			/*step4: channel is supported? */
> -
> -			if (!lbs_get_chan_11d(firstchan, i, &curchan)) {
> -				/* Chan is not found in UN table */
> -				lbs_deb_11d("chan is not supported: %d \n", i);
> -				break;
> -			}
> -
> -			lastchan = curchan;
> -
> -			if (lbs_region_chan_supported_11d(region, curchan)) {
> -				/*step5: Check if curchan is supported by mrvl in region */
> -				parsed_region_chan->chanpwr[idx].chan = curchan;
> -				parsed_region_chan->chanpwr[idx].pwr =
> -				    countryinfo->subband[j].maxtxpwr;
> -				idx++;
> -			} else {
> -				/*not supported and ignore the chan */
> -				lbs_deb_11d(
> -				       "i %d, chan %d unsupported in region %x, band %d\n",
> -				       i, curchan, region, band);
> -			}
> -		}
> -
> -		/*Step6: Add other checking if any */
> -
> -	}
> -
> -	parsed_region_chan->nr_chan = idx;
> -
> -	lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan);
> -	lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (u8 *) parsed_region_chan,
> -		2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx);
> -
> -done:
> -	lbs_deb_enter(LBS_DEB_11D);
> -	return 0;
> -}
> -
> -/**
> - *  @brief This function calculates the scan type for channels
> - *  @param chan                 chan number
> - *  @param parsed_region_chan   pointer to parsed_region_chan_11d
> - *  @return 	                PASSIVE if chan is unknown; ACTIVE if chan is known
> -*/
> -u8 lbs_get_scan_type_11d(u8 chan,
> -			  struct parsed_region_chan_11d * parsed_region_chan)
> -{
> -	u8 scan_type = CMD_SCAN_TYPE_PASSIVE;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -
> -	if (lbs_channel_known_11d(chan, parsed_region_chan)) {
> -		lbs_deb_11d("found, do active scan\n");
> -		scan_type = CMD_SCAN_TYPE_ACTIVE;
> -	} else {
> -		lbs_deb_11d("not found, do passive scan\n");
> -	}
> -
> -	lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type);
> -	return scan_type;
> -
> -}
> -
> -void lbs_init_11d(struct lbs_private *priv)
> -{
> -	priv->enable11d = 0;
> -	memset(&(priv->parsed_region_chan), 0,
> -	       sizeof(struct parsed_region_chan_11d));
> -	return;
> -}
> -
> -/**
> - *  @brief This function sets DOMAIN INFO to FW
> - *  @param priv       pointer to struct lbs_private
> - *  @return 	      0; -1
> -*/
> -static int set_domain_info_11d(struct lbs_private *priv)
> -{
> -	int ret;
> -
> -	if (!priv->enable11d) {
> -		lbs_deb_11d("dnld domain Info with 11d disabled\n");
> -		return 0;
> -	}
> -
> -	ret = lbs_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO,
> -				    CMD_ACT_SET,
> -				    CMD_OPTION_WAITFORRSP, 0, NULL);
> -	if (ret)
> -		lbs_deb_11d("fail to dnld domain info\n");
> -
> -	return ret;
> -}
> -
> -/**
> - *  @brief This function setups scan channels
> - *  @param priv       pointer to struct lbs_private
> - *  @param band       band
> - *  @return 	      0
> -*/
> -int lbs_set_universaltable(struct lbs_private *priv, u8 band)
> -{
> -	u16 size = sizeof(struct chan_freq_power);
> -	u16 i = 0;
> -
> -	memset(priv->universal_channel, 0,
> -	       sizeof(priv->universal_channel));
> -
> -	priv->universal_channel[i].nrcfp =
> -	    sizeof(channel_freq_power_UN_BG) / size;
> -	lbs_deb_11d("BG-band nrcfp %d\n",
> -	       priv->universal_channel[i].nrcfp);
> -
> -	priv->universal_channel[i].CFP = channel_freq_power_UN_BG;
> -	priv->universal_channel[i].valid = 1;
> -	priv->universal_channel[i].region = UNIVERSAL_REGION_CODE;
> -	priv->universal_channel[i].band = band;
> -	i++;
> -
> -	return 0;
> -}
> -
> -/**
> - *  @brief This function implements command CMD_802_11D_DOMAIN_INFO
> - *  @param priv       pointer to struct lbs_private
> - *  @param cmd        pointer to cmd buffer
> - *  @param cmdno      cmd ID
> - *  @param cmdOption  cmd action
> - *  @return 	      0
> -*/
> -int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
> -				 struct cmd_ds_command *cmd, u16 cmdno,
> -				 u16 cmdoption)
> -{
> -	struct cmd_ds_802_11d_domain_info *pdomaininfo =
> -	    &cmd->params.domaininfo;
> -	struct mrvl_ie_domain_param_set *domain = &pdomaininfo->domain;
> -	u8 nr_subband = priv->domainreg.nr_subband;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -
> -	lbs_deb_11d("nr_subband=%x\n", nr_subband);
> -
> -	cmd->command = cpu_to_le16(cmdno);
> -	pdomaininfo->action = cpu_to_le16(cmdoption);
> -	if (cmdoption == CMD_ACT_GET) {
> -		cmd->size =
> -		    cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
> -		lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
> -			le16_to_cpu(cmd->size));
> -		goto done;
> -	}
> -
> -	domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
> -	memcpy(domain->countrycode, priv->domainreg.countrycode,
> -	       sizeof(domain->countrycode));
> -
> -	domain->header.len =
> -	    cpu_to_le16(nr_subband * sizeof(struct ieee_subbandset) +
> -			     sizeof(domain->countrycode));
> -
> -	if (nr_subband) {
> -		memcpy(domain->subband, priv->domainreg.subband,
> -		       nr_subband * sizeof(struct ieee_subbandset));
> -
> -		cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
> -					     le16_to_cpu(domain->header.len) +
> -					     sizeof(struct mrvl_ie_header) +
> -					     S_DS_GEN);
> -	} else {
> -		cmd->size =
> -		    cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
> -	}
> -
> -	lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd, le16_to_cpu(cmd->size));
> -
> -done:
> -	lbs_deb_enter(LBS_DEB_11D);
> -	return 0;
> -}
> -
> -/**
> - *  @brief This function parses countryinfo from AP and download country info to FW
> - *  @param priv    pointer to struct lbs_private
> - *  @param resp    pointer to command response buffer
> - *  @return 	   0; -1
> - */
> -int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp)
> -{
> -	struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp;
> -	struct mrvl_ie_domain_param_set *domain = &domaininfo->domain;
> -	u16 action = le16_to_cpu(domaininfo->action);
> -	s16 ret = 0;
> -	u8 nr_subband = 0;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -
> -	lbs_deb_hex(LBS_DEB_11D, "domain info resp", (u8 *) resp,
> -		(int)le16_to_cpu(resp->size));
> -
> -	nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
> -		      sizeof(struct ieee_subbandset);
> -
> -	lbs_deb_11d("domain info resp: nr_subband %d\n", nr_subband);
> -
> -	if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) {
> -		lbs_deb_11d("Invalid Numrer of Subband returned!!\n");
> -		return -1;
> -	}
> -
> -	switch (action) {
> -	case CMD_ACT_SET:	/*Proc Set action */
> -		break;
> -
> -	case CMD_ACT_GET:
> -		break;
> -	default:
> -		lbs_deb_11d("Invalid action:%d\n", domaininfo->action);
> -		ret = -1;
> -		break;
> -	}
> -
> -	lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> -	return ret;
> -}
> -
> -/**
> - *  @brief This function parses countryinfo from AP and download country info to FW
> - *  @param priv    pointer to struct lbs_private
> - *  @return 	   0; -1
> - */
> -int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
> -                                        struct bss_descriptor * bss)
> -{
> -	int ret;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -	if (priv->enable11d) {
> -		memset(&priv->parsed_region_chan, 0,
> -		       sizeof(struct parsed_region_chan_11d));
> -		ret = parse_domain_info_11d(&bss->countryinfo, 0,
> -					       &priv->parsed_region_chan);
> -
> -		if (ret == -1) {
> -			lbs_deb_11d("error parsing domain_info from AP\n");
> -			goto done;
> -		}
> -
> -		memset(&priv->domainreg, 0,
> -		       sizeof(struct lbs_802_11d_domain_reg));
> -		generate_domain_info_11d(&priv->parsed_region_chan,
> -				      &priv->domainreg);
> -
> -		ret = set_domain_info_11d(priv);
> -
> -		if (ret) {
> -			lbs_deb_11d("error setting domain info\n");
> -			goto done;
> -		}
> -	}
> -	ret = 0;
> -
> -done:
> -	lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> -	return ret;
> -}
> -
> -/**
> - *  @brief This function generates 11D info from user specified regioncode and download to FW
> - *  @param priv    pointer to struct lbs_private
> - *  @return 	   0; -1
> - */
> -int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv)
> -{
> -	int ret;
> -	struct region_channel *region_chan;
> -	u8 j;
> -
> -	lbs_deb_enter(LBS_DEB_11D);
> -	lbs_deb_11d("curbssparams.band %d\n", priv->curbssparams.band);
> -
> -	if (priv->enable11d) {
> -		/* update parsed_region_chan_11; dnld domaininf to FW */
> -
> -		for (j = 0; j < ARRAY_SIZE(priv->region_channel); j++) {
> -			region_chan = &priv->region_channel[j];
> -
> -			lbs_deb_11d("%d region_chan->band %d\n", j,
> -			       region_chan->band);
> -
> -			if (!region_chan || !region_chan->valid
> -			    || !region_chan->CFP)
> -				continue;
> -			if (region_chan->band != priv->curbssparams.band)
> -				continue;
> -			break;
> -		}
> -
> -		if (j >= ARRAY_SIZE(priv->region_channel)) {
> -			lbs_deb_11d("region_chan not found, band %d\n",
> -			       priv->curbssparams.band);
> -			ret = -1;
> -			goto done;
> -		}
> -
> -		memset(&priv->parsed_region_chan, 0,
> -		       sizeof(struct parsed_region_chan_11d));
> -		lbs_generate_parsed_region_chan_11d(region_chan,
> -						     &priv->
> -						     parsed_region_chan);
> -
> -		memset(&priv->domainreg, 0,
> -		       sizeof(struct lbs_802_11d_domain_reg));
> -		generate_domain_info_11d(&priv->parsed_region_chan,
> -					 &priv->domainreg);
> -
> -		ret = set_domain_info_11d(priv);
> -
> -		if (ret) {
> -			lbs_deb_11d("error setting domain info\n");
> -			goto done;
> -		}
> -
> -	}
> -	ret = 0;
> -
> -done:
> -	lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> -	return ret;
> -}
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -191,11 +191,6 @@
>  		goto out;
>  	}
>  
> -	if (lbs_set_universaltable(priv, 0)) {
> -		ret = -1;
> -		goto out;
> -	}
> -
>  out:
>  	lbs_deb_leave(LBS_DEB_CMD);
>  	return ret;
> @@ -1512,11 +1507,6 @@
>  		ret = 0;
>  		goto done;
>  
> -	case CMD_802_11D_DOMAIN_INFO:
> -		ret = lbs_cmd_802_11d_domain_info(priv, cmdptr,
> -						   cmd_no, cmd_action);
> -		break;
> -
>  	case CMD_802_11_TPC_CFG:
>  		cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
>  		cmdptr->size =
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -228,10 +228,6 @@
>  		ret = lbs_ret_802_11_rssi(priv, resp);
>  		break;
>  
> -	case CMD_RET(CMD_802_11D_DOMAIN_INFO):
> -		ret = lbs_ret_802_11d_domain_info(resp);
> -		break;
> -
>  	case CMD_RET(CMD_802_11_TPC_CFG):
>  		spin_lock_irqsave(&priv->driver_lock, flags);
>  		memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -325,15 +325,6 @@
>  	/** region channel data */
>  	struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
>  
> -	struct region_channel universal_channel[MAX_REGION_CHANNEL_NUM];
> -
> -	/** 11D and Domain Regulatory Data */
> -	struct lbs_802_11d_domain_reg domainreg;
> -	struct parsed_region_chan_11d parsed_region_chan;
> -
> -	/** FSM variable for 11d support */
> -	u32 enable11d;
> -
>  	/**	MISCELLANEOUS */
>  	struct lbs_offset_value offsetvalue;
>  
> --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> +++ linux-wl/drivers/net/wireless/libertas/Makefile
> @@ -1,4 +1,3 @@
> -libertas-y += 11d.o
>  libertas-y += assoc.o
>  libertas-y += cfg.o
>  libertas-y += cmd.o
>  #define CMD_OPTION_WAITFORRSP                   0x0002
> --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> +++ linux-wl/drivers/net/wireless/libertas/main.c
> @@ -1408,9 +1408,6 @@
>  	if (ret)
>  		goto done;
>  
> -	/* init 802.11d */
> -	lbs_init_11d(priv);
> -
>  	if (lbs_cfg_register(priv)) {
>  		lbs_pr_err("cannot register device\n");
>  		goto done;
> 


^ permalink raw reply

* Re: [PATCH] libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
From: Dan Williams @ 2009-10-21 18:12 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910190854.19967.hs4233@mail.mn-solutions.de>

On Mon, 2009-10-19 at 08:54 +0200, Holger Schurig wrote:
> > We were going to use this at one point, but we haven't yet, so we can
> > add it back when we do.
> 
> So, what does this actually do?

Pretty much like it sounds; it lets the device go to into powersave at
user-specified interval after the last TX or RX, instead of having to
wait one full beacon of inactivity.

Dan



^ permalink raw reply

* rt2500pci master mode and hostapd
From: Janne Tanskanen @ 2009-10-21 17:19 UTC (permalink / raw)
  To: linux-wireless

Hi! I build a wireless access point using a-link wl54pc (pcmcia card, 
rt2500pci module) and hostapd 0.6.9 with kernel version 2.6.32-rc5. 
Problem is that even tho hostapd starts and iwconfig shows wlan0 in 
master mode, other computers cant find the wireless network.

I found a working patch from here: 
http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?p=32632#p32632 and 
all works now with it applied to vanilla kernel. Just wanted to post 
this to the mailing list and ask why it's not added to mainline rt2x00 
kernel tree yet? Patch on forum is from May, almost half year ago. 
Hopefully it'll be included to mainline kernel asap.

--
Janne Tanskanen

^ permalink raw reply

* Re: Broadcom 4318 not working with bleeding edge kernels
From: Pavel Roskin @ 2009-10-21 15:29 UTC (permalink / raw)
  To: Celejar; +Cc: linux-wireless
In-Reply-To: <20091020214702.a76fa4aa.celejar@gmail.com>

On Tue, 2009-10-20 at 21:47 -0400, Celejar wrote:

> Oct 17 19:44:19 localhost wpa_supplicant[3477]: Trying to associate with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz)
> Oct 17 19:44:19 localhost wpa_supplicant[3477]: Association request to the driver failed

Since the message is from wpa_supplicant, it must be something between
wpa_supplicant and mac80211.  I don't think any code in b43 is involved.

Perhaps you should include some information about wpa_supplicant, i.e.
its version and the command line.  Please try the latest wpa_supplicant.
Please try both wext and nl80211 drivers.  That would help understand
the extent of the problem.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: [ath9k-devel] Test for N-mode from userspace?
From: Kunal Gangakhedkar @ 2009-10-21 14:17 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: austinxxh-ath9k, ath9k-devel, linux-wireless
In-Reply-To: <43e72e890910202349g474a79fehf3fcc4d66837e70b@mail.gmail.com>

On Wednesday 21 Oct 2009 12:19:44 pm Luis R. Rodriguez wrote:
> On Wed, Oct 21, 2009 at 2:37 PM, Kunal Gangakhedkar
>
> <kunal.gangakhedkar@gmail.com> wrote:
> > On Wednesday 21 Oct 2009 4:50:18 am Luis R. Rodriguez wrote:
> >> On Wed, Oct 21, 2009 at 2:28 AM, xxiao <austinxxh-ath9k@yahoo.com> wrote:
> >> > interesting, why is MCS range just 0-7, which means no HT?
> >>
> >> MCS 1-7 is for single stream devices.
> >>
> >> http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
> >
> > So, does this mean that I can use N-mode on this device?
>
> Yes, MCS 7 is your highest rate on your card.
>

Great.. that is really sweet :)

Thanks,
Kunal

^ permalink raw reply

* Re: [PATCH net-next V2 1/3] iwmc3200top: Add Intel Wireless MultiCom  3200 top driver.
From: Marcel Holtmann @ 2009-10-21 12:52 UTC (permalink / raw)
  To: Tomas Winkler
  Cc: David Miller, linville, netdev, linux-wireless, linux-mmc, yi.zhu,
	inaky.perez-gonzalez, cindy.h.kao, guy.cohen, ron.rindjunsky
In-Reply-To: <1ba2fa240910200453k4638dc6cm8c8911353ea85b60@mail.gmail.com>

Hi Tomas,

> >> This patch adds Intel Wireless MultiCom 3200 top driver.
> >> IWMC3200 is 4Wireless Com CHIP (GPS/BT/WiFi/WiMAX).
> >> Top driver is responsible for device initialization and firmware download.
> >> Firmware handled by top is responsible for top itself and
> >> as well as bluetooth and GPS coms. (Wifi and WiMax provide their own firmware)
> >> In addition top driver is used to retrieve firmware logs
> >> and supports other debugging features
> >>
> >> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> >
> > Applied to net-next-2.6
> 
> Thanks Dave
> 
> Marcel
> I want to send out now the BT driver, would like the patch against
> bluetooth-next-2.6.git, then I wait till you sync or can you also pick
> it from net-next if Dave is OK with that?

send it against net-next since you are working in drivers/bluetooth/, we
will have not conflicts.

Regards

Marcel



^ permalink raw reply

* [PATCH] Staging: update TODO files
From: Bartlomiej Zolnierkiewicz @ 2009-10-21 12:42 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, linux-wireless

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] Staging: update TODO files

Remove my mail address.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/staging/rtl8187se/TODO |    3 +--
 drivers/staging/rtl8192su/TODO |    3 +--
 drivers/staging/vt6655/TODO    |    5 ++---
 drivers/staging/vt6656/TODO    |    5 ++---
 4 files changed, 6 insertions(+), 10 deletions(-)

Index: b/drivers/staging/rtl8187se/TODO
===================================================================
--- a/drivers/staging/rtl8187se/TODO
+++ b/drivers/staging/rtl8187se/TODO
@@ -11,5 +11,4 @@ TODO:
 - sparse fixes
 - integrate with drivers/net/wireless/rtl818x
 
-Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and
-Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>.
+Please send any patches to Greg Kroah-Hartman <greg@kroah.com>.
Index: b/drivers/staging/rtl8192su/TODO
===================================================================
--- a/drivers/staging/rtl8192su/TODO
+++ b/drivers/staging/rtl8192su/TODO
@@ -14,5 +14,4 @@ TODO:
 - sparse fixes
 - integrate with drivers/net/wireless/rtl818x
 
-Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and
-Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>.
+Please send any patches to Greg Kroah-Hartman <greg@kroah.com>.
Index: b/drivers/staging/vt6655/TODO
===================================================================
--- a/drivers/staging/vt6655/TODO
+++ b/drivers/staging/vt6655/TODO
@@ -16,6 +16,5 @@ TODO:
 - sparse fixes
 - integrate with drivers/net/wireless
 
-Please send any patches to Greg Kroah-Hartman <greg@kroah.com>,
-Forest Bond <forest@alittletooquiet.net> and Bartlomiej Zolnierkiewicz
-<bzolnier@gmail.com>.
+Please send any patches to Greg Kroah-Hartman <greg@kroah.com>
+and Forest Bond <forest@alittletooquiet.net>.
Index: b/drivers/staging/vt6656/TODO
===================================================================
--- a/drivers/staging/vt6656/TODO
+++ b/drivers/staging/vt6656/TODO
@@ -15,6 +15,5 @@ TODO:
 - sparse fixes
 - integrate with drivers/net/wireless
 
-Please send any patches to Greg Kroah-Hartman <greg@kroah.com>,
-Forest Bond <forest@alittletooquiet.net> and Bartlomiej Zolnierkiewicz
-<bzolnier@gmail.com>.
+Please send any patches to Greg Kroah-Hartman <greg@kroah.com>
+and Forest Bond <forest@alittletooquiet.net>.

^ permalink raw reply

* Re: mac80211/ath9k/hostapd: Some clients unable to associate with AP
From: Björn Smedman @ 2009-10-21 11:48 UTC (permalink / raw)
  To: linux-wireless, ath9k-devel
In-Reply-To: <133e8d7e0910200711s7c44b899nbcd5f1037cc5ee49@mail.gmail.com>

Hi again,

I've now checked the latest compat-wireless snapshot (2009-10-21) and
it has the same problem: Windows based clients with 11g or 11b cards
cannot connect to a mac80211/ath9k/hostapd based AP. It used to work
with compat-wireless-2009-06-02.

I've tried an Intel PRO Wireless 3945ABG card and an older 3Com
3CRWE62092B card. The Intel card seems to accept the auth response but
chokes on the assoc response while the 3Com card ignores the auth
response and just sends auth request indefinitely. This time I used
hostapd 0.6.9 in all tests.

All the non-windows 11g clients I've tried all work (an iPhone and a
Google Dev G1). I only have access to one 11n capable windows based
client (Ralink noname card) but that one works just fine and connects
to the AP on the first attempt.

Any ideas on how to track this down? I can enable some logs and hack
together some patches to track this down, I'm just not sure where to
start. Bisecting is difficult for me as I can only build
compat-wireless and only on OpenWrt... Thanx for any help in advance.

/Björn

2009/10/20 Björn Smedman <bjorn.smedman@venatech.se>:
> Hi all,
>
> I'm trying to update from compat-wireless-2009-06-02 to
> compat-wireless-2.6.32-rc1. After the update some clients can
> no-longer associate with the access point (mac80211/ath9k/hostapd).
> Specifically, it seems windows based clients do not accept the new
> association response frame and choke or send deauth.
>
> A tcpdump from a separate machine shows the story. After the update
> with compat-wireless-2.6.32-rc1 the dump locks like this (notice the
> deauth frame from the XP laptop at the end):
>
>        19:59:18.973699 1573025241us tsft 1.0 Mb/s 2412 MHz (0x0080) -53dB
> signal 0dB noise antenna 0 BSSID:ff:ff:ff:ff:ff:ff
> DA:ff:ff:ff:ff:ff:ff SA:00:13:02:36:ab:37 Probe Request
> (demo.venatech.net) [1.0 2.0 5.5 11.0 6.0 9.0 12.0 18.0 Mbit]
>        19:59:18.975919 1573026699us tsft 1.0 Mb/s 2412 MHz (0x0080) -57dB
> signal 0dB noise antenna 0 BSSID:00:23:cd:de:2f:c5
> DA:00:13:02:36:ab:37 SA:00:23:cd:de:2f:c5 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        19:59:18.977723 1573028524us tsft 1.0 Mb/s 2412 MHz (0x0080) -43dB
> signal 0dB noise antenna 0 BSSID:00:23:cd:da:3c:05
> DA:00:13:02:36:ab:37 SA:00:23:cd:da:3c:05 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        19:59:18.981060 1573031853us tsft 1.0 Mb/s 2412 MHz (0x0080) -67dB
> signal 0dB noise antenna 0 BSSID:00:23:cd:c7:c3:fd
> DA:00:13:02:36:ab:37 SA:00:23:cd:c7:c3:fd Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        19:59:19.019827 1573071924us tsft short preamble 54.0 Mb/s 2412 MHz
> (0x0080) -53dB signal 0dB noise antenna 0 BSSID:00:23:cd:da:3c:05
> DA:00:23:cd:da:3c:05 SA:00:13:02:36:ab:37 Authentication (Open
> System)-1: Succesful
>        19:59:19.022448 1573074291us tsft 1.0 Mb/s 2412 MHz (0x0080) -42dB
> signal 0dB noise antenna 0 BSSID:00:23:cd:da:3c:05
> DA:00:13:02:36:ab:37 SA:00:23:cd:da:3c:05 Authentication (Open
> System)-2:
>        19:59:19.022963 1573075062us tsft short preamble 54.0 Mb/s 2412 MHz
> (0x0080) -52dB signal 0dB noise antenna 0 BSSID:00:23:cd:da:3c:05
> DA:00:23:cd:da:3c:05 SA:00:13:02:36:ab:37 Assoc Request
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit]
>        19:59:19.096487 1573147524us tsft 1.0 Mb/s 2412 MHz (0x0080) -42dB
> signal 0dB noise antenna 0 BSSID:00:23:cd:da:3c:05
> DA:00:13:02:36:ab:37 SA:00:23:cd:da:3c:05 Assoc Response AID(2) ::
> Succesful
>        19:59:19.227409 1573279582us tsft short preamble 54.0 Mb/s 2412 MHz
> (0x0080) -52dB signal 0dB noise antenna 0 BSSID:00:23:cd:da:3c:05
> DA:00:23:cd:da:3c:05 SA:00:13:02:36:ab:37 DeAuthentication:
> Unspecified reason
>
> With compat-wireless-2009-06-02 the (successful) dump locks like this:
>
>        20:01:56.525502 433315165us tsft 1.0 Mb/s 2412 MHz (0x0080) -42dB
> signal 0dB noise antenna 0 BSSID:ff:ff:ff:ff:ff:ff
> DA:ff:ff:ff:ff:ff:ff SA:00:13:02:36:ab:37 Probe Request
> (demo.venatech.net) [1.0 2.0 5.5 11.0 6.0 9.0 12.0 18.0 Mbit]
>        20:01:56.527462 433316613us tsft 1.0 Mb/s 2412 MHz (0x0080) -44dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        20:01:56.541231 433330271us tsft 1.0 Mb/s 2412 MHz (0x0080) -44dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        20:01:56.542509 433331546us tsft 1.0 Mb/s 2412 MHz (0x0080) -43dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        20:01:56.543874 433332939us tsft 1.0 Mb/s 2412 MHz (0x0080) -43dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        20:01:56.545297 433334332us tsft 1.0 Mb/s 2412 MHz (0x0080) -43dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Probe Response
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] CH:
> 1
>        20:01:56.556071 433346142us tsft short preamble 54.0 Mb/s 2412 MHz
> (0x0080) -41dB signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:25:86:d9:61:a7 SA:00:13:02:36:ab:37 Authentication (Open
> System)-1: Succesful
>        20:01:56.558199 433347993us tsft 1.0 Mb/s 2412 MHz (0x0080) -42dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Authentication (Open
> System)-2:
>        20:01:56.558653 433348766us tsft short preamble 54.0 Mb/s 2412 MHz
> (0x0080) -41dB signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:25:86:d9:61:a7 SA:00:13:02:36:ab:37 Assoc Request
> (demo.venatech.net) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit]
>        20:01:56.634096 433423226us tsft 1.0 Mb/s 2412 MHz (0x0080) -42dB
> signal 0dB noise antenna 0 BSSID:00:25:86:d9:61:a7
> DA:00:13:02:36:ab:37 SA:00:25:86:d9:61:a7 Assoc Response AID(2) ::
> Succesful
>
> I've also tried some other windows based clients, e.g. a laptop with
> an old 11b 3Com PCMCIA card. Most seem to choke from the auth response
> or assoc response frame. The hostapd/syslog on the AP side looks
> something like this:
>
>        MGMT
>        mgmt::auth
>        authentication: STA=00:04:75:c4:1e:a5 auth_alg=0 auth_transaction=1
> status_code=0 wep=0
>        ap0: STA 00:04:75:c4:1e:a5 IEEE 802.11: authentication OK (open system)
>        ap0: STA 00:04:75:c4:1e:a5 MLME:
> MLME-AUTHENTICATE.indication(00:04:75:c4:1e:a5, OPEN_SYSTEM)
>        ap0: STA 00:04:75:c4:1e:a5 MLME: MLME-DELETEKEYS.request(00:04:75:c4:1e:a5)
>        authentication reply: STA=00:04:75:c4:1e:a5 auth_alg=0
> auth_transaction=2 resp=0 (IE len=0)
>        MGMT (TX callback) ACK
>        mgmt::auth cb
>        ap0: STA 00:04:75:c4:1e:a5 IEEE 802.11: authenticated
>        Jan  1 03:33:12 00:23:CD:DA:3C:04 daemon.info hostapd: ap0: STA
> 00:04:75:c4:1e:a5 IEEE 802.11: authenticated
>        STA 00:04:75:c4:1e:a5 sent probe request for broadcast SSID
>        STA 00:04:75:c4:1e:a5 sent probe request for our SSID
>        MGMT (TX callback) fail
>        mgmt::proberesp cb
>        MGMT (TX callback) fail
>        mgmt::proberesp cb
>        MGMT
>        mgmt::auth
>        authentication: STA=00:04:75:c4:1e:a5 auth_alg=0 auth_transaction=1
> status_code=0 wep=0
>        ap0: STA 00:04:75:c4:1e:a5 IEEE 802.11: authentication OK (open system)
>        ap0: STA 00:04:75:c4:1e:a5 MLME:
> MLME-AUTHENTICATE.indication(00:04:75:c4:1e:a5, OPEN_SYSTEM)
>        ap0: STA 00:04:75:c4:1e:a5 MLME: MLME-DELETEKEYS.request(00:04:75:c4:1e:a5)
>        authentication reply: STA=00:04:75:c4:1e:a5 auth_alg=0
> auth_transaction=2 resp=0 (IE len=0)
>        STA 00:22:fa:f8:17:c8 sent probe request for broadcast SSID
>        MGMT (TX callback) ACK
>        mgmt::auth cb
>        ap0: STA 00:04:75:c4:1e:a5 IEEE 802.11: authenticated
>
>        [And so on over and over...]
>
> I've also tried some different versions of hostapd: 0.6.9 and two
> different git snapshots from 0.7-branch (a35187e71a1dd23653fc03ed5
> and 6d6f4bb87f33278aed133875d0d561eb55d7ae59) but it doesn't seem to
> make any difference. My configuration file is really simple:
>
>        driver=nl80211
>        interface=ap0
>        ctrl_interface=/var/run/
>        hostapd-vtmd
>        hw_mode=g
>        channel=1
>        ssid=demo.venatech.net
>        ieee80211n=1
>        ht_capab=
>
> Does anybody recognize this? Any ideas on what to try next? Any help
> would be greatly appreciated.
>
> /Björn
>



-- 
Venatech AB
Ideon Innovation
Ole Römers väg 12
SE-22370 LUND
Sweden

+46 (0) 46 286 86 20
info@venatech.se
http://www.venatech.se

^ permalink raw reply

* [PATCH] wl1271: use ieee80211_rx_ni()
From: Luciano Coelho @ 2009-10-21 11:03 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Kalle Valo

Use the new ieee80211_rx_ni() function instead of ieee80211_rx().  Since we
use a workqueue to handle the RX path, we need to call the new function,
which disables bottom half handling.  This patch fixes the NOHZ:
local_softirq_pending messages.

CC: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_rx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index dbf07be..37d81ab 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -184,7 +184,7 @@ static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)
 		     beacon ? "beacon" : "");
 
 	memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
-	ieee80211_rx(wl->hw, skb);
+	ieee80211_rx_ni(wl->hw, skb);
 }
 
 void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status)
-- 
1.5.6.5


^ permalink raw reply related

* ath5k with two NICs runing IBSS and AP mode simultaneously causes error
From: Joerg Pommnitz @ 2009-10-21 11:01 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath5k-devel

Hello all,
I have a configuration with two Atheros NICs (AR5212). To evaluate whether ath5k is now good enough to replace Madwifi I run the current wireless-testing branch and did some tests:
One interface (wlan0) is in IBSS mode joined to another host. I run iperf in both directions simultaneously over night. This worked very well (except for the known IBSS join bug).
Additionally I built hostapd 0.6.9 and run it with a very minmal configuration (interface=wlan1, driver=nl80211, ssid=MyNetwork, hw_mode=g, channel=1) and tried to connect from a WinXP client. I had not yet setup a DHCP server, so this was not actually expected to succeed.
I think immediately after starting hostapd the iperf run stopped and I got the following error message:
ath5k phy0: no further txbuf available, dropping packet.
The timing makes it very likely that the hostapd on wlan1 disturbed the iperf run on wlan0. Is this a known problem? Is there something I can do to help track this down?

 -- 
Regards 
Joerg 


      

^ permalink raw reply

* Re: [PATCH] cfg80211: allow driver to signal noise level
From: Henning Rogge @ 2009-10-21  9:24 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Holger Schurig, John Linville, linux-wireless
In-Reply-To: <1256080691.4475.8.camel@johannes.local>

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

Am Wed October 21 2009 01:18:11 schrieb Johannes Berg:
> On Tue, 2009-10-20 at 14:13 +0200, Holger Schurig wrote:
> > Allows a WLAN driver to signal current noise level:
> >
> > # iw eth1 link
> > Connected to 00:13:19:80:da:30 (on eth1)
> >         SSID: SSID
> >         freq: 2437
> >         RX: 424 bytes (5 packets)
> >         TX: 0 bytes (0 packets)
> >         signal: -49 dBm
> >         noise: -93 dBm
> >         tx bitrate: 11.0 MBit/s
> >
> > Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> NACKed-by: Johannes Berg <johannes@sipsolutions.net>
>
> As discussed previously, noise is not a property of a station.
Noise it not a property of a link between two stations, but a property of the 
local station alone (the point where the noise was measured).

Do we have a netlink part to put in properties like this ?

Henning Rogge

-- 
Diplom-Informatiker Henning Rogge , Fraunhofer-Institut für
Kommunikation, Informationsverarbeitung und Ergonomie FKIE
Kommunikationssysteme (KOM)
Neuenahrer Straße 20, 53343 Wachtberg, Germany
Telefon +49 228 9435-263,   Fax +49 228 9435 685
mailto:henning.rogge@fkie.fraunhofer.de http://www.fkie.fraunhofer.de
GPG: E1C6 0914 490B 3909 D944 F80D 4487 C67C 55EC CFE0


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: Question about "txrate: current unicast bitrate to this station"
From: Johannes Berg @ 2009-10-21  7:25 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <200910201005.57862.hs4233@mail.mn-solutions.de>

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Tue, 2009-10-20 at 10:05 +0200, Holger Schurig wrote:
> So, this is the TX rate if the WLAN card is operating in AP mode, 
> but it is really a RXRATE (despite the name) if the WLAN card is 
> working in STATION mode?

Umm? No, it's the "current unicast bitrate to this station", as it says.
An AP is also a station, and if you're an AP you have various bitrates
to different associated stations.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [ath9k-devel] Test for N-mode from userspace?
From: Luis R. Rodriguez @ 2009-10-21  6:49 UTC (permalink / raw)
  To: Kunal Gangakhedkar; +Cc: austinxxh-ath9k, ath9k-devel, linux-wireless
In-Reply-To: <200910211107.58111.kunal.gangakhedkar@gmail.com>

On Wed, Oct 21, 2009 at 2:37 PM, Kunal Gangakhedkar
<kunal.gangakhedkar@gmail.com> wrote:
> On Wednesday 21 Oct 2009 4:50:18 am Luis R. Rodriguez wrote:
>> On Wed, Oct 21, 2009 at 2:28 AM, xxiao <austinxxh-ath9k@yahoo.com> wrote:
>> > interesting, why is MCS range just 0-7, which means no HT?
>>
>> MCS 1-7 is for single stream devices.
>>
>> http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
>
> So, does this mean that I can use N-mode on this device?

Yes, MCS 7 is your highest rate on your card.

  Luis

^ permalink raw reply

* Re: [ath9k-devel] Test for N-mode from userspace?
From: Kunal Gangakhedkar @ 2009-10-21  5:37 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: austinxxh-ath9k, ath9k-devel, linux-wireless
In-Reply-To: <43e72e890910201620l3e475630wbde71f34fca3b6df@mail.gmail.com>

On Wednesday 21 Oct 2009 4:50:18 am Luis R. Rodriguez wrote:
> On Wed, Oct 21, 2009 at 2:28 AM, xxiao <austinxxh-ath9k@yahoo.com> wrote:
> > interesting, why is MCS range just 0-7, which means no HT?
>
> MCS 1-7 is for single stream devices.
>
> http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n

So, does this mean that I can use N-mode on this device?
That would be really great, if possible :)

Thanks,
Kunal

^ permalink raw reply

* Broadcom 4318 not working with bleeding edge kernels
From: Celejar @ 2009-10-21  1:47 UTC (permalink / raw)
  To: linux-wireless

[A version of this message was originally posted to the bcm43xx-dev
ML:

https://lists.berlios.de/pipermail/bcm43xx-dev/2009-October/006197.html

I received no response there, so I thought I'd try here.]

My Broadcom 4318 (details below) has been working fine for quite some
time with b43 in mainline.  As recently as 2.6.31, it was still working:

Oct 18 20:30:06 localhost wpa_supplicant[2892]: CTRL-EVENT-SCAN-RESULTS 
Oct 18 20:30:06 localhost wpa_supplicant[2892]: Trying to associate with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz)
Oct 18 20:30:06 localhost wpa_supplicant[2892]: Association request to the driver failed
Oct 18 20:30:07 localhost kernel: [   78.196304] wlan0: authenticate with AP 00:14:d1:3e:ff:30
Oct 18 20:30:07 localhost kernel: [   78.197716] wlan0: authenticated
Oct 18 20:30:07 localhost kernel: [   78.197719] wlan0: associate with AP 00:14:d1:3e:ff:30
Oct 18 20:30:07 localhost kernel: [   78.200084] wlan0: RX AssocResp from 00:14:d1:3e:ff:30 (capab=0x431 status=43 aid=0)
Oct 18 20:30:07 localhost kernel: [   78.200088] wlan0: AP denied association (code=43)
Oct 18 20:30:07 localhost kernel: [   78.397059] wlan0: associate with AP 00:14:d1:3e:ff:30
Oct 18 20:30:07 localhost wpa_supplicant[2892]: Associated with 00:14:d1:3e:ff:30
Oct 18 20:30:07 localhost kernel: [   78.399232] wlan0: RX AssocResp from 00:14:d1:3e:ff:30 (capab=0x431 status=0 aid=2)
Oct 18 20:30:07 localhost kernel: [   78.399237] wlan0: associated
Oct 18 20:30:07 localhost kernel: [   78.400055] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Oct 18 20:30:08 localhost dnsmasq[1968]: reading /var/run/dnsmasq/resolv.conf
Oct 18 20:30:08 localhost dnsmasq[1968]: using nameserver 192.168.0.1#53
Oct 18 20:30:09 localhost wpa_supplicant[2892]: WPA: Key negotiation completed with 00:14:d1:3e:ff:30 [PTK=CCMP GTK=CCMP]
Oct 18 20:30:09 localhost wpa_supplicant[2892]: CTRL-EVENT-CONNECTED - Connection to 00:14:d1:3e:ff:30 completed (auth) [id=0 id_str=]
Oct 18 20:30:09 localhost kernel: [   80.263676] b43-phy0 debug: Using hardware based encryption for keyidx: 0, mac: 00:14:d1:3e:ff:30
Oct 18 20:30:09 localhost kernel: [   80.263699] b43-phy0 debug: Using hardware based encryption for keyidx: 1, mac: ff:ff:ff:ff:ff:ff

The early 2.6.32 rc kernels were giving oopses, apparently because of
this:

https://lists.berlios.de/pipermail/bcm43xx-dev/2009-October/006129.html

The patch is apparently in -rc5, but that kernel, while it doesn't
oops, fails to authenticate:

Oct 17 19:44:05 localhost wpa_supplicant[3477]: CTRL-EVENT-SCAN-RESULTS 
Oct 17 19:44:07 localhost wpa_supplicant[3477]: CTRL-EVENT-SCAN-RESULTS 
Oct 17 19:44:07 localhost wpa_supplicant[3477]: Trying to associate with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz)
Oct 17 19:44:07 localhost kernel: [  198.914180] wlan0: deauthenticating from 00:14:d1:3e:ff:30 by local choice (reason=3)
Oct 17 19:44:07 localhost kernel: [  198.914320] wlan0: direct probe to AP 00:14:d1:3e:ff:30 (try 1)
Oct 17 19:44:07 localhost kernel: [  198.917136] wlan0: direct probe responded
Oct 17 19:44:07 localhost kernel: [  198.917141] wlan0: authenticate with AP 00:14:d1:3e:ff:30 (try 1)
Oct 17 19:44:07 localhost kernel: [  198.918857] wlan0: authenticated
Oct 17 19:44:07 localhost kernel: [  198.918873] wlan0: associate with AP 00:14:d1:3e:ff:30 (try 1)
Oct 17 19:44:07 localhost kernel: [  198.921192] wlan0: RX AssocResp from 00:14:d1:3e:ff:30 (capab=0x431 status=43 aid=0)
Oct 17 19:44:07 localhost kernel: [  198.921196] wlan0: AP denied association (code=43)
Oct 17 19:44:17 localhost wpa_supplicant[3477]: Authentication with 00:14:d1:3e:ff:30 timed out.
Oct 17 19:44:19 localhost wpa_supplicant[3477]: CTRL-EVENT-SCAN-RESULTS 
Oct 17 19:44:19 localhost wpa_supplicant[3477]: Trying to associate with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz)
Oct 17 19:44:19 localhost wpa_supplicant[3477]: Association request to the driver failed
Oct 17 19:44:24 localhost wpa_supplicant[3477]: Authentication with 00:14:d1:3e:ff:30 timed out.
Oct 17 19:44:25 localhost wpa_supplicant[3477]: CTRL-EVENT-SCAN-RESULTS 
Oct 17 19:44:25 localhost wpa_supplicant[3477]: Trying to associate with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz)
Oct 17 19:44:25 localhost wpa_supplicant[3477]: Association request to the driver failed
Oct 17 19:44:30 localhost wpa_supplicant[3477]: Authentication with 00:14:d1:3e:ff:30 timed out.
Oct 17 19:44:31 localhost wpa_supplicant[3477]: CTRL-EVENT-SCAN-RESULTS 
Oct 17 19:44:31 localhost wpa_supplicant[3477]: Trying to associate with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz)
Oct 17 19:44:31 localhost wpa_supplicant[3477]: Association request to the driver failed

Any idea what's going on here?  I can, of course, do a bisection if
necessary, but I'm asking first in case there's a known or suspected
issue that someone can point me to.

[Please cc me on responses.]

Celejar
-- 
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


^ permalink raw reply

* Re: question: "possible recursive locking detected" with cfg80211 + monitor mode
From: Johannes Berg @ 2009-10-21  1:21 UTC (permalink / raw)
  To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <200910201236.25871.hs4233@mail.mn-solutions.de>

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

On Tue, 2009-10-20 at 12:36 +0200, Holger Schurig wrote:
> Hi !
> 
> I'm about to add monitor mode to my cfg80211 code. I wanted to
> keep as much of the monitor mode code from libertas that I could,
> mainly
> 
> * priv->rtap_net_dev
> * lbs_rtap_XXX() in main.c
> * process_rxed_802_11_packet() in rx.c.
> 
> 
> So my code is quite simply currently:
> 
> static struct cfg80211_ops lbs_cfg80211_ops = {
> 	// ...
>         .change_virtual_intf = lbs_change_intf,
> };
> 
> static int lbs_change_intf(struct wiphy *wiphy, struct net_device *dev,
>         enum nl80211_iftype type, u32 *flags,
>         struct vif_params *params)
> {
>         struct lbs_private *priv = wiphy_priv(wiphy);
>         int ret = 0;
> 
>         lbs_deb_enter(LBS_DEB_CFG80211);
> 
>         switch(type) {
>         case NL80211_IFTYPE_MONITOR:
>                 ret = lbs_enable_monitor_mode(priv, type == NL80211_IFTYPE_MONITOR);
>                 if (!priv->rtap_net_dev)
>                         lbs_add_rtap(priv);

check what that calls -- probably register_netdev vs.
register_netdevice.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: Rate information in ad-hoc and mesh mode
From: Johannes Berg @ 2009-10-21  1:10 UTC (permalink / raw)
  To: Charles Gordon; +Cc: linux-wireless
In-Reply-To: <86201b3f0910200710u36557bf8uf5bc014b32b14d33@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

On Tue, 2009-10-20 at 10:10 -0400, Charles Gordon wrote:
> I notice that the ieee80211_ioctl_giwrate function in wext.c only
> returns rate information for stations associated to an AP.  It does
> not return rate information for stations operating in ad-hoc mode or
> as a mesh point.  Is there a reason this function is not supported in
> those modes?  Is this a deliberate decision or just an oversight?

The former -- there's no single rate when you're talking to multiple
peers. "iw wlan0 station dump" would show you the information for each
station.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: No support for Fritz!WLAN USB N2.4
From: Luis R. Rodriguez @ 2009-10-20 23:21 UTC (permalink / raw)
  To: Ed Vaessen; +Cc: LKML, linux-wireless
In-Reply-To: <e3511b0c31dd03889a221c947dec2c80.squirrel@webmail.xs4all.nl>

On Wed, Oct 21, 2009 at 7:10 AM, Ed Vaessen <evaessen@xs4all.nl> wrote:
> To my surprise I found that it seems that the driver for Fritz!WLAN USB
> N2.4 is not longer supported. At least, the last tarballs I got do not
> compile them anymore. Their code is still there but no module with the
> name ar9170 is built. Modules from the same group, like ath5k and ath9k
> are built.
> Am I missing something?

What kernel are you on? ar9170 only builds on >= 2.6.29 due to some
difficulty in backporting some USB code which ar9170 uses.

  Luis

^ permalink raw reply

* Re: [ath9k-devel] Test for N-mode from userspace?
From: Luis R. Rodriguez @ 2009-10-20 23:20 UTC (permalink / raw)
  To: austinxxh-ath9k; +Cc: ath9k-devel, Kunal Gangakhedkar, linux-wireless
In-Reply-To: <411169.20125.qm@web55305.mail.re4.yahoo.com>

On Wed, Oct 21, 2009 at 2:28 AM, xxiao <austinxxh-ath9k@yahoo.com> wrote:
> interesting, why is MCS range just 0-7, which means no HT?

MCS 1-7 is for single stream devices.

http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n

  Luis

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox