All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless-2.6 0/12] Host AP update
@ 2004-11-08  7:01 Jouni Malinen
  2004-11-08  7:10 ` [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages Jouni Malinen
                   ` (17 more replies)
  0 siblings, 18 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:01 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, jkmaline

Jeff,

Here's an update to Host AP code in wireless-2.6 tree. This brings in
number of small fixes from my CVS repository. This messages has the
changes in BitKeeper format from bksend and following 12 messages have
the patches one by one as unified diffs.

I have couple of additional patches pending for wireless-2.6 updates
(wireless extensions 17 and 18; changes to PCI API in Linux
2.6.10-rc1). I'll send WE17 and PCI changes once you update
wireless-2.6. WE18 change requires an update to wireless extensions,
so it may need to wait somewhat longer or we could start testing WE18
in wireless-2.6 if that is desired.

I keep getting questions about getting Host AP driver to linux-2.6
tree. What would be needed to make this happen? I would assume this
would be easiest to do this from wireless-2.6 tree once the new
patches are in. Any other changes that would be required to get the
driver in suitable state for merging into Linux 2.6 releases?



You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


ChangeSet@1.1873, 2004-11-07 22:28:31-08:00, jkmaline@cc.hut.fi
  Host AP: Fix netif_carrier_off() in non-client modes
  
  Connection status is reported properly only in client modes, so do not
  try to set netif_carrier_off() in non-client modes. Previously, Master
  mode may end up being in state where netif_carrier was left off and
  this may break things like bridging.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1872, 2004-11-07 22:25:11-08:00, jkmaline@cc.hut.fi
  Host AP: Fix PRISM2_IO_DEBUG
  
  From Mark Glines <mark@glines.org>:
  I just noticed PRISM2_IO_DEBUG doesn't work.  This patch gets it
  working again.  I checked the development CVS snapshot, looks like
  its still broken there.
  
  jkm: in addition, fix the other PRISM2_IO_DEBUG function
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1871, 2004-11-07 22:21:13-08:00, jkmaline@cc.hut.fi
  Host AP: Use void * instead of unsigned long with {read,write}{b,w}
  
  Start using void * instead of unsigned long with {read,write}{b,w} to
  silence compiler warning with Linux 2.6.9-rc2.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1870, 2004-11-07 22:17:27-08:00, jkmaline@cc.hut.fi
  Host AP: Fix card enabling after firmware download
  
  Fix card enabling after firmware download in case any of the
  netdevs were up when the download was started.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1869, 2004-11-07 22:13:57-08:00, jkmaline@cc.hut.fi
  Host AP: Do not bridge packets to unauthorized ports
  
  Fix inner-BSS bridge (ap_bridge_packets=1) not to bridge packets to
  unauthorized ports when IEEE 802.1X/WPA is used (i.e., require that
  the STA completes authentication before capturing packets in the inner
  bridge); previously, only association status was used and an attacker
  could have capture packets to any MAC address even without having
  proper credentials for using the network (although, the packets were
  dropped because the controlled port for the STA was unauthorized).
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1868, 2004-11-07 22:10:36-08:00, jkmaline@cc.hut.fi
  Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1867, 2004-11-07 22:03:38-08:00, jkmaline@cc.hut.fi
  Host AP: Prevent STAs from associating using AP address
  
  Prevent STAs from authenticating with AP address (i.e., spoofing AP
  MAC address). The inner bridge implementation intercepts packets
  before they are passed to Linux net stack, so using AP MAC address
  would prevent AP from seeing the packet properly.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1866, 2004-11-07 21:59:51-08:00, jkmaline@cc.hut.fi
  Host AP: Fix hw address changing for wifi# interface
   
  Update wifi# interface MAC address when changing addresses. Without
  this, MAC address change does not work correctly with the new
  interface design (wifi#/wlan0#).
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1865, 2004-11-07 21:56:29-08:00, jkmaline@cc.hut.fi
  Host AP: Remove ioctl debug messages
  
  Remove debug message from unsupported ioctls. Some of common ioctls
  triggered these (e.g., SIOCGMIIPHY, SIOCGMIIREG, SIOCSMIIREG,
  SIOCDEVPRIVATE) and filled debug logs with unwanted messages.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1864, 2004-11-07 21:49:46-08:00, jkmaline@cc.hut.fi
  Host AP: Ignore (Re)AssocResp messages silently
  
  Ignore (Re)AssocResp silently since these are not currently needed but
  are still received when WPA/RSN mode is enabled.
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1863, 2004-11-07 21:34:28-08:00, jkmaline@cc.hut.fi
  Host AP: Fix interface packet counters
  
  Fix wlan#/wifi# interface packet counters (both are supposed to see
  data packets once; wlan# was counting TX twice and wifi# did not count
  TX or RX at all for most cases).
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

ChangeSet@1.1862, 2004-11-07 20:24:23-08:00, jkmaline@cc.hut.fi
  Host AP: Disable EAPOL TX/RX debug messages
  
  Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


 hostap.c          |    1 +
 hostap_80211_rx.c |   12 +++++++++++-
 hostap_80211_tx.c |   12 ++++++------
 hostap_ap.c       |   22 +++++++++++++++++++++-
 hostap_ap.h       |    1 +
 hostap_hw.c       |   12 +++++++++---
 hostap_ioctl.c    |   20 +++++++++++---------
 hostap_pci.c      |   22 ++++++++++++----------
 hostap_plx.c      |   19 +++++++++----------
 hostap_wlan.h     |    8 +++++---
 10 files changed, 86 insertions(+), 43 deletions(-)


diff -Nru a/drivers/net/wireless/hostap/hostap.c b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c	2004-11-07 22:34:54 -08:00
+++ b/drivers/net/wireless/hostap/hostap.c	2004-11-07 22:34:54 -08:00
@@ -808,6 +808,7 @@
 		iface = list_entry(ptr, struct hostap_interface, list);
 		memcpy(iface->dev->dev_addr, addr->sa_data, ETH_ALEN);
 	}
+	memcpy(local->dev->dev_addr, addr->sa_data, ETH_ALEN);
 	read_unlock_bh(&local->iface_lock);
 
 	return 0;
diff -Nru a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:34:54 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:34:54 -08:00
@@ -475,6 +475,13 @@
 		    stype == WLAN_FC_STYPE_PROBE_RESP)) {
 		hostap_rx_sta_beacon(local, skb, stype);
 		return -1;
+	} else if (type == WLAN_FC_TYPE_MGMT &&
+		   (stype == WLAN_FC_STYPE_ASSOC_RESP ||
+		    stype == WLAN_FC_STYPE_REASSOC_RESP)) {
+		/* Ignore (Re)AssocResp silently since these are not currently
+		 * needed but are still received when WPA/RSN mode is enabled.
+		 */
+		return -1;
 	} else {
 		printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: dropped unhandled"
 		       " management frame in non-Host AP mode (type=%d:%d)\n",
@@ -689,6 +696,9 @@
 	void *sta = NULL;
 	int keyidx = 0;
 
+	iface->stats.rx_packets++;
+	iface->stats.rx_bytes += skb->len;
+
 	/* dev is the master radio device; change this to be the default
 	 * virtual interface (this may be changed to WDS device below) */
 	dev = local->ddev;
@@ -1025,7 +1035,7 @@
 			if (skb2 == NULL)
 				printk(KERN_DEBUG "%s: skb_clone failed for "
 				       "multicast frame\n", dev->name);
-		} else if (hostap_is_sta_assoc(local->ap, dst)) {
+		} else if (hostap_is_sta_authorized(local->ap, dst)) {
 			/* send frame directly to the associated STA using
 			 * wireless media and not passing to higher layers */
 			local->ap->bridged_unicast++;
diff -Nru a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-07 22:34:54 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-07 22:34:54 -08:00
@@ -379,7 +379,7 @@
 		printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb "
 		       "(len=%d)\n", dev->name, skb->len);
 		ret = 0;
-		meta->iface->stats.tx_dropped++;
+		iface->stats.tx_dropped++;
 		goto fail;
 	}
 
@@ -405,13 +405,13 @@
 			hostap_dump_tx_80211(dev->name, skb);
 
 			ret = 0; /* drop packet */
-			meta->iface->stats.tx_dropped++;
+			iface->stats.tx_dropped++;
 			goto fail;
 		}
 		break;
 	case AP_TX_DROP:
 		ret = 0; /* drop packet */
-		meta->iface->stats.tx_dropped++;
+		iface->stats.tx_dropped++;
 		goto fail;
 	case AP_TX_RETRY:
 		goto fail;
@@ -488,11 +488,11 @@
 
 	if (local->func->tx == NULL || local->func->tx(skb, dev)) {
 		ret = 0;
-		meta->iface->stats.tx_dropped++;
+		iface->stats.tx_dropped++;
 	} else {
 		ret = 0;
-		meta->iface->stats.tx_packets++;
-		meta->iface->stats.tx_bytes += skb->len;
+		iface->stats.tx_packets++;
+		iface->stats.tx_bytes += skb->len;
 	}
 
  fail:
diff -Nru a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c	2004-11-07 22:34:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.c	2004-11-07 22:34:53 -08:00
@@ -1329,7 +1329,8 @@
 	status_code = __le16_to_cpu(*pos);
 	pos++;
 
-	if (ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) {
+	if (memcmp(dev->dev_addr, hdr->addr2, ETH_ALEN) == 0 ||
+	    ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) {
 		txt = "authentication denied";
 		resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
 		goto fail;
@@ -3060,6 +3061,24 @@
 
 
 /* Called only as a tasklet (software IRQ) */
+int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr)
+{
+	struct sta_info *sta;
+	int ret = 0;
+
+	spin_lock(&ap->sta_table_lock);
+	sta = ap_get_sta(ap, sta_addr);
+	if (sta != NULL && (sta->flags & WLAN_STA_ASSOC) && !sta->ap &&
+	    ((sta->flags & WLAN_STA_AUTHORIZED) ||
+	     ap->local->ieee_802_1x == 0))
+		ret = 1;
+	spin_unlock(&ap->sta_table_lock);
+
+	return ret;
+}
+
+
+/* Called only as a tasklet (software IRQ) */
 int hostap_add_sta(struct ap_data *ap, u8 *sta_addr)
 {
 	struct sta_info *sta;
@@ -3218,6 +3237,7 @@
 EXPORT_SYMBOL(hostap_update_sta_ps);
 EXPORT_SYMBOL(hostap_handle_sta_rx);
 EXPORT_SYMBOL(hostap_is_sta_assoc);
+EXPORT_SYMBOL(hostap_is_sta_authorized);
 EXPORT_SYMBOL(hostap_add_sta);
 EXPORT_SYMBOL(hostap_update_rates);
 EXPORT_SYMBOL(hostap_add_wds_links);
diff -Nru a/drivers/net/wireless/hostap/hostap_ap.h b/drivers/net/wireless/hostap/hostap_ap.h
--- a/drivers/net/wireless/hostap/hostap_ap.h	2004-11-07 22:34:54 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.h	2004-11-07 22:34:54 -08:00
@@ -255,6 +255,7 @@
 			     struct hostap_ieee80211_hdr *hdr,
 			     struct prism2_crypt_data **crypt, void **sta_ptr);
 int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr);
+int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr);
 int hostap_add_sta(struct ap_data *ap, u8 *sta_addr);
 int hostap_update_rx_stats(struct ap_data *ap,
 			   struct hostap_ieee80211_hdr *hdr,
diff -Nru a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c	2004-11-07 22:34:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_hw.c	2004-11-07 22:34:53 -08:00
@@ -1483,7 +1483,10 @@
 	if (prism2_hw_init2(dev, initial))
 		return 1;
 
-	if (!local->pri_only && !initial) {
+	/* Enable firmware if secondary image is loaded and at least one of the
+	 * netdevices is up. */
+	if (!local->pri_only &&
+	    (initial == 0 || (initial == 2 && local->num_dev_open > 0))) {
 		if (!local->dev_enabled)
 			prism2_callback(local, PRISM2_CALLBACK_ENABLE);
 		local->dev_enabled = 1;
@@ -3396,8 +3399,11 @@
 					   "", dev_template);
 
 	if (local->ddev) {
-		netif_carrier_off(local->dev);
-		netif_carrier_off(local->ddev);
+		if (local->iw_mode == IW_MODE_INFRA ||
+		    local->iw_mode == IW_MODE_ADHOC) {
+			netif_carrier_off(local->dev);
+			netif_carrier_off(local->ddev);
+		}
 		hostap_init_proc(local);
 		hostap_init_ap_proc(local);
 		return 0;
diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:34:54 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:34:54 -08:00
@@ -597,6 +597,7 @@
 }
 
 
+#ifndef PRISM2_NO_STATION_MODES
 static int hostap_join_ap(struct net_device *dev)
 {
 	struct hostap_interface *iface = dev->priv;
@@ -634,6 +635,7 @@
 
 	return 0;
 }
+#endif /* PRISM2_NO_STATION_MODES */
 
 
 static int prism2_ioctl_siwap(struct net_device *dev,
@@ -1106,6 +1108,13 @@
 	if (double_reset && local->func->reset_port(dev))
 		return -EINVAL;
 
+	if (local->iw_mode != IW_MODE_INFRA && local->iw_mode != IW_MODE_ADHOC)
+	{
+		/* netif_carrier is used only in client modes for now, so make
+		 * sure carrier is on when moving to non-client modes. */
+		netif_carrier_on(local->dev);
+		netif_carrier_on(local->ddev);
+	}
 	return 0;
 }
 
@@ -1586,7 +1595,8 @@
 
 #else /* !PRISM2_NO_STATION_MODES */
 
-static inline int prism2_request_hostscan(struct net_device *dev)
+static inline int prism2_request_hostscan(struct net_device *dev,
+					  u8 *ssid, u8 ssid_len)
 {
 	return -EOPNOTSUPP;
 }
@@ -3452,14 +3462,6 @@
 		break;
 
 	default:
-		if (cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) {
-			/* unsupport wireless extensions get through here - do
-			 * not report these to debug log */
-			ret = -EOPNOTSUPP;
-			break;
-		}
-		printk(KERN_DEBUG "%s unsupported ioctl(0x%04x)\n",
-		       dev->name, cmd);
 		ret = -EOPNOTSUPP;
 		break;
 	}
diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c	2004-11-07 22:34:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_pci.c	2004-11-07 22:34:53 -08:00
@@ -56,7 +56,7 @@
 
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
-	writeb(v, dev->mem_start + a);
+	writeb(v, (void *) dev->mem_start + a);
 	spin_unlock_irqrestore(&local->lock, flags);
 }
 
@@ -68,7 +68,7 @@
 	u8 v;
 
 	spin_lock_irqsave(&local->lock, flags);
-	v = readb(dev->mem_start + a);
+	v = readb((void *) dev->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
 	spin_unlock_irqrestore(&local->lock, flags);
 	return v;
@@ -82,7 +82,7 @@
 
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
-	writew(v, dev->mem_start + a);
+	writew(v, (void *) dev->mem_start + a);
 	spin_unlock_irqrestore(&local->lock, flags);
 }
 
@@ -94,7 +94,7 @@
 	u16 v;
 
 	spin_lock_irqsave(&local->lock, flags);
-	v = readw(dev->mem_start + a);
+	v = readw((void *) dev->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
 	spin_unlock_irqrestore(&local->lock, flags);
 	return v;
@@ -109,12 +109,14 @@
 
 #else /* PRISM2_IO_DEBUG */
 
-#define HFA384X_OUTB(v,a) writeb((v), dev->mem_start + (a))
-#define HFA384X_INB(a) (u8) readb(dev->mem_start + (a))
-#define HFA384X_OUTW(v,a) writew((v), dev->mem_start + (a))
-#define HFA384X_INW(a) (u16) readw(dev->mem_start + (a))
-#define HFA384X_OUTW_DATA(v,a) writew(cpu_to_le16(v), dev->mem_start + (a))
-#define HFA384X_INW_DATA(a) (u16) le16_to_cpu(readw(dev->mem_start + (a)))
+#define HFA384X_OUTB(v,a) writeb((v), (void *) dev->mem_start + (a))
+#define HFA384X_INB(a) (u8) readb((void *) dev->mem_start + (a))
+#define HFA384X_OUTW(v,a) writew((v), (void *) dev->mem_start + (a))
+#define HFA384X_INW(a) (u16) readw((void *) dev->mem_start + (a))
+#define HFA384X_OUTW_DATA(v,a) \
+	writew(cpu_to_le16(v), (void *) dev->mem_start + (a))
+#define HFA384X_INW_DATA(a) (u16) \
+	le16_to_cpu(readw((void *) dev->mem_start + (a)))
 
 #endif /* PRISM2_IO_DEBUG */
 
diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-07 22:34:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-07 22:34:53 -08:00
@@ -247,7 +247,7 @@
 
 	/* Set sreset bit of COR and clear it after hold time */
 
-	if (local->attr_mem == 0) {
+	if (local->attr_mem == NULL) {
 		/* TMD7160 - COR at card's first I/O addr */
 		corsave = inb(local->cor_offset);
 		outb(corsave | COR_SRESET, local->cor_offset);
@@ -271,7 +271,7 @@
 {
 	unsigned char corsave;
 
-	if (local->attr_mem == 0) {
+	if (local->attr_mem == NULL) {
 		/* TMD7160 - COR at card's first I/O addr */
 		corsave = inb(local->cor_offset);
 		outb(corsave | COR_SRESET, local->cor_offset);
@@ -306,7 +306,7 @@
 };
 
 
-static int prism2_plx_check_cis(unsigned long attr_mem, int attr_len,
+static int prism2_plx_check_cis(void *attr_mem, int attr_len,
 				unsigned int *cor_offset,
 				unsigned int *cor_index)
 {
@@ -401,7 +401,7 @@
 	unsigned int pccard_ioaddr, plx_ioaddr;
 	unsigned long pccard_attr_mem;
 	unsigned int pccard_attr_len;
-	unsigned long attr_mem = 0;
+	void *attr_mem = NULL;
 	unsigned int cor_offset, cor_index;
 	u32 reg;
 	local_info_t *local = NULL;
@@ -422,7 +422,7 @@
 
 	if (tmd7160) {
 		/* TMD7160 */
-		attr_mem = 0; /* no access to PC Card attribute memory */
+		attr_mem = NULL; /* no access to PC Card attribute memory */
 
 		printk(KERN_INFO "TMD7160 PCI/PCMCIA adapter: io=0x%x, "
 		       "irq=%d, pccard_io=0x%x\n",
@@ -448,9 +448,8 @@
 			goto fail;
 
 
-		attr_mem = (unsigned long) ioremap(pccard_attr_mem,
-						   pccard_attr_len);
-		if (!attr_mem) {
+		attr_mem = ioremap(pccard_attr_mem, pccard_attr_len);
+		if (attr_mem == NULL) {
 			printk(KERN_ERR "%s: cannot remap attr_mem\n",
 			       dev_info);
 			goto fail;
@@ -532,7 +531,7 @@
 		free_irq(dev->irq, dev);
 
 	if (attr_mem)
-		iounmap((void *) attr_mem);
+		iounmap(attr_mem);
 
 	pci_disable_device(pdev);
 
@@ -550,7 +549,7 @@
 	hfa384x_disable_interrupts(dev);
 
 	if (iface->local->attr_mem)
-		iounmap((void *) iface->local->attr_mem);
+		iounmap(iface->local->attr_mem);
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 
diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:34:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:34:54 -08:00
@@ -895,7 +895,7 @@
 #endif /* PRISM2_PCCARD */
 
 #ifdef PRISM2_PLX
-	unsigned long attr_mem;
+	void *attr_mem;
 	unsigned int cor_offset;
 #endif /* PRISM2_PLX */
 
@@ -1006,7 +1006,8 @@
 static inline void prism2_io_debug_add(struct net_device *dev, int cmd,
 				       int reg, int value)
 {
-	local_info_t *local = dev->priv;
+	struct hostap_interface *iface = dev->priv;
+	local_info_t *local = iface->local;
 
 	if (!local->io_debug_enabled)
 		return;
@@ -1023,7 +1024,8 @@
 
 static inline void prism2_io_debug_error(struct net_device *dev, int err)
 {
-	local_info_t *local = dev->priv;
+	struct hostap_interface *iface = dev->priv;
+	local_info_t *local = iface->local;
 	unsigned long flags;
 
 	if (!local->io_debug_enabled)

===================================================================


This BitKeeper patch contains the following changesets:
1.1862..1.1873
## Wrapped with gzip_uu ##


M'XL( (X3CT$  ^U=87/:1K?^#+]BV\S-A<1@[:XD)/PF4\=V$V[BV-=VFO1.
M9S2+M!C5(/%*PL1OR7^_Y^P*# 9C#+:9-&T[R,!J=[5ZSG.><_:(/B.?4IG4
M"W]>=$4GC&3Q&7D7IUF]X/O5=C^KMD+XY"2.X9/M?V__V=UN7L!K91 FLB/3
MM,*J=A%:'(O,;Y-+F:3U JWR\2?954_6"R<';S]]V#TI%E^](GMM$9W+4YF1
M5Z^*69Q<BDZ0_B*R=B>.JEDBHK0K,U'UX^YPW'3(#(/!OQ:M<<.RA]0VS-K0
MIP&EPJ0R,)CIV&;QSW.1_">\^*47-^.OLSV8AL,I=9AIN4/N<(<6]PFM4L=F
MQ#"W*=TV:H09=6;6&:\83MTPR&A5?AFO!GG)2,4HOB$/._6]HJ_6G>P>U\E^
MF(IF1Y*#W>.C#^3LR_;)%Q+(9O^<=&')Q;E,H37\=QJ>1S*HQ*U6I7E5)_\3
M]Z.0'*H)1^1?LW-_77Q/N,.84SR^O@W%RCW_*18-811?D]%J)S)HBTQ==9"$
M"('M2&;;(X1LM^&R1"\_>([!*/42N#WZEM@&-SBM,7=(7=NPAZ9/><T5EE]C
MW#0#9\XM6&$82@W',!D@8,A=^&O-Z6=SIL\,EYE#V7*9S:VF*63 N#37FGXV
M9_HPFN$4BW.ZG<;ZZ!3&A_J6YUCG$UBG=0Y8=S:*]5_#KR2,,IFTA"])3_@7
MP P^(!D^RF&.308=$3V#U6J%SVYO3DK-.&L3D4B2]GN].)4!3)VD4D(O@<A$
M?D)*XLB7.[I3,A"I[B&,SL'82#8(H6L1!40/%X0!B>)\%.@(FL0) 9,4&1&=
M#FG!NRY>CB]2F9:K:]DF_T%MT^(FY4/3XI;S/=JFGKYMF0#O)6T33F'.4-_R
MW#;-*=LTW;II+[!-^NBVV3B/8K"ETHDL[Z9I[)_(M#=V020-.S+*.E<:[W/;
MCIK 'V!P)&O+5"KS5/;43Q+];21E *;:[*-Y*>O-0C"L1/H2[@;881MLYO/Q
M[O;)Z4<PM4"2,"4R0A\9K&EN_ <U-]/E;&A0[AI+X]5T37NHURS'JS6%5\NN
M,W>C>#V1W?@2P!'[66>N8,H;3'U%6DG<)?U(>8PD [BI\],J.8V[DL0M(/YN
M-X[RCZ&7+ G/SV6"SD4!NB2KY]4M<MHXVGM[V&@<O_O]^@TH7_WF-'^#6(6W
M^P>_'9\T?ML].R@K5],"P$.'>F:=^#P%YP.NK!\-1(1S&EW'6G"G-;I!N*OU
MNX%U;@P-Q^'V4!J6XW+NLI8C FK[*V)]<@R-6LNF;,B98[E+ ]VR&08(N%HY
MT.UIH+MUBVX4Z*B(V@,B@B"!-2 ^]H7J!:7(#8T$IR%@/O5 _\B;7Y+#W;UQ
M+XIEQUWEGP+BR&= 8JRX.6N'Z=;42:H]6%0,#@%)?1 G%V PP.P^,KL",5@)
M4/P SK\>.) I0)B4U(2V48@9S]:33M38()?/D1R6:=2&MFT%PF5-G[*F:S"Y
M&JRG >UR0"=0M[4\H%V+#O4*Y8"N30":U0U>YXNB@,<']'$B+T$+D-.SW503
MLD 1$0HEROLIONX>CU"G83+GG#Y #72\KT]3X+L^BY3"J@2>3GMQW-(=0B\3
M8"Y7R1E -8PBF9!F$@8 [+#;Z\@N= I=H@]  /NR!R%$'DI %TW90ND#8U\I
M]=*#N>O(XT,8];\"]C-0-- <QHZO+V9B9.AD$/<[ >GEUP1?JRN"T 5;HP7E
ML4XOB7LRZ5RM92L&MS?H".::"Z.6.>2UE@Q<"0X!-(_;FH?&>PV@X ^#,'L(
M_H4M;3%P"D=MCNN46XPS93'4J//-:G-T =!)+^QH9"JP@Z0X/63>QR,/C.*L
M<?31.SS:/S@%M@7 KZF5C8V&IAL1#S:%E1]RUW7LI9$#)&L/]6KER'&GD</K
M5FT!<OCC9Q=CY:ES@AME1("M^A$2:)R$_P'V0BT\D7]1I%AY<WHZ.J\$"Z;_
M]/(N7M&RZAAZFND;>IGM72N.QL'! 8$8I4J_;$.,AZ%='^DS9^M$_KL?*G85
M6H%()'P%_8[,0'5,DC[804[&ONAE_02Y<S2),%(GJPM!TE93+.\HR@WC?MJY
MVB)Q!)IE['F@-\!%UD]5BDA-"J6ZB(C(D,Y5/[[B[;:X'(TYM:0BNIJ22\CN
MRE1!3^%),$'H0W,Z\<$D\$I$)U5*3GL*K9XR):Q*HH.GGK>W)EP"3 ^"$<QP
M03<]C*.E+V"VJHD?1UD2J]@"UUSU.UI#=543=V4M_55S;?9CQM(VY2:'6-HU
MUW*)[1F7:%*7#WE@U5PN+$8Y\QUGU:35>(")*=O,H-9WX\75E$WF.GQY+N96
M;:B1J;FX9DQS<:W.%G'Q$WEQD00ZFZ7BKA8H3-(*D^X M600#Z).+()K)EZJ
M.;(=IJ,5 <4M-'DX'18[D)>:+TB_I_D7V6!\&E("+#ZF0=8B \>Q-D@&[<$<
MI6"9-3YL6;:TI67[IA\X9FU5I3 >(,=9C5I#P^3W@6:-(31QG7)HTBEH,@I*
M8:,RX1.@YS(. _("P)1F$M !0.I'J0($@='R".NO!+[;&B1A)K_]U=P:?,N!
M@S#*?=AJ_6C=H'+(OLS%+H =@!Z-PSL=8;&J774KB<_6 JWM;#(]UO/#6=12
MHT;MH3!;0;-IFL+P?=-P:BNB]GH$C4' @SNTF 7J=N5)=VYZ7)PT@_!I:+N<
M4M\R.8"..J*YZJ0[7V<G#3Z<K3YIS#;=<+<X:[-6LX92V@XX>;OFF(;P^:JS
MGAAB:MJ6N?3^D U* ]R_0F5.$6R:(JPZW7P:,@\Y&T?>_L&;3V]S/X6YBT,!
MBO4MSBHE_^K"FU_.U9MJG)R_KN.6$?FS#SU!S!#ZP 0W>E(YQ>B_=4JQ2LA9
M.\2D"Q:5G"L]GZFL27*AW."Y""-HU"!^6X(H#K1; [G=B7N8OB%[OYV2-!*]
MM!UG6\ Z\45*.N$%NL4P2_,=IV827VB7F,B<2F!EZ^A-0<&'&!)L@;/]JGJ/
ML=G,K%O]R,=VZQ'1)K>E-F(>JB:'48<M;QX6I4.]5KEY\&GS<.I\D7D\36D#
M+$+8\D"S):%,/,!!J8QHBN*HXG="!";N9^:!]EX,P:D_&7@"Y!.9;TN-,G\Z
M2D6!-]&!2BT&*K)7.U17NO A6W8"595.'<7!AP(<-4:W:K.U*ZY < :H&)LJ
M'1GJ^4D4D(F<'D))R(YL9>#E6Q@OY]L&JI<FN/@+?!N=:^O383B\7=-Q&S]<
M:HHYU(4(#DSQNY'):LH44V2J$'"9?0^L$7S4#9D'Z1W6#7HW745$[.9>(=_(
MIOAWLN$'YJNVLHY()1FH_\ <CY?"Q@IFWG"H06BQT)5=OW=5ZL2^Z%1>@TQ0
M+QY>XY:ZTLKK5'A8,;9%#L[>>;L?#CZ6=Y9$[422:&7XWCN?];## *"YZ[C.
M#*!5=:QQ1\4@>Q1 WUT4J]"DJCOOC::)A5@!5OLNKP&L&OI0*!2.E18LJ5?O
MX,O9R2[;(C__5UHG)U_JDQEO4E&[A6A_/T,WMJVZ48=[==-*1%?^$?V\-5<^
M/4"]+ )AIG1T,QF*[ZT<]#W198U/#,J&[5+"BX40EP;X# 1;6DV^CG9K7K[<
MF?VN>84[*B]?D?2B67G=D=%.\8^'1-1DE2<B:J;@D;,%B*H]%J(V5[OXGJ@2
MO*>&!L1RI%8L?".R Q<5MD@)G], ;T4^?]C]Z/VZYYW]?GS@';X]/"//GP,5
M$4)*Z<TVIZK1[NGIT9YW<G!Z3(9#W93<TO3DX+IQN4S^@M;;+]99?1SNQ<0M
MN/\-P ZVX36163^)2(7N/"C>)\HL$>_6S:U@<Q&#@C:DC\:@_VSH_A ;ND P
MN"_YU(*(&MQ!*9,?"Y-4,PII4P^.WO5L1W)<]+9(D&:*(.ZEN+,'4-S+/SWP
ML,-@Z,VI9:V@N!^-)I94W/@\TJKXRE;$EVE:""]]6"24SQ;H[;6(_O9GL^XO
ME6U2L?^1RHJM]",T3PTG[C"$DSX4IF5Q]M7+>1@E\S[<9X4\0_/:XK;45&W5
MX8ZF(-:QJ3K<U=0D#)M:<)AM.JGO9[Z<(_"7I-BULG'W*!9YJ &04*'_V@RA
MJG)GMJAXDST6H?[H%<OOB2K"O;]UKYCNVZ><*\-61X;Q+BEA[J_;*]U(^K4Q
MYX=_LHF,'T8PAHIJ,*B!>>3BR^L*WP-E=U5Z+GJ5U_@.UB1+0K5WDT[VIE7,
M0Y<QWW0Q2\02[F.F8_X))GZ08$+7WSV9 3>X87-"G2*P&+DU;@#+Z_L9VJ=2
M*B\P@.@[Y(5J!DM;+OY5+.2-\+,P:L7J6\R 0<<)_A8%,3#754A[8>1!('*A
M31N;9RB"U6?E'>Q'0&,8ZUQF.)$2CC8>:4=S##;ZZ17Y^.G#!_+\N7I?>=WJ
MB/.4/-<Y$5AAG3DI8X.?5 /14\D6Y)K2;:=\.GMW=-+XOX/]\IB7"$XTCYU"
M*25J(8]^5>15+NO<!DR9[N17UX\67!\L09X*@<-.\1M\\$=Q^P79$PHEN0D0
M03*17H")P;7%K4S5'C9._K>,R90&!\\.K'OPY?CHY,P[_?WPS=&'6Z.^Y;=5
ML(1U+06R9(7M0PT "L2R#=N<HT"6R/S\0];_D/6:9*WKNU<BZ_8J9,TLW/Y:
MCZJ79@.L+5B=#98O?7BP >C0JMGF;()'E:%3:P$;F(^9!WZZ<G)0#WPE\8!K
MN9+ZAPM5ZA^/9A'W&@Y4WO_Z L%9IQ(,*Q#)%41.^', 0%HX]Q%#9*0C19H!
MG\C1E>L]![SVT)>J1JO?JZIM!/3]/^6NN)>$GB*AL4\/HQ 981153'W 4 ;D
M9T;]KH>1"3!)1%ZC$U\CB+B]5'TVB&!.G2XJ5K$>:V__ARY\>T]T3=33&08W
M#0R'&W#DQ%)I(C+*OH<#3UT[8++Q63T^ZC4^_GJR>[VY=WO#W?UW*&AQ7Z\P
MN_S7U38HDQ>U&#7YMJPSR,OC5O<']ZKA>\@QP"LPNV;,JQRSZW31;KA!*LZC
M&./?X4=2WA/]DQ_WMZG\+JUF5I9%YO\VV[H_73(GX8,;0QL3#?=^\!PKL_ Q
MZJ>\(0W+=<'_/PM;$<SCMCD6&S9'F? ,F!YX$$3";1<#'GZ? A4H38%'5D1O
M$&*9(RX_YEK!685IEWD8Z\@T\_ B4E]$(^4+%^IIX4!>P'$+B1!I58G@- R4
M',8_O(Z,R@^&I<DGV6\6WMSM]Q^M\.8']_NZ?/M)38("'+#T9X['_^FFQ[]6
MI'.::%]?+.1%/--+,@K\Y]TX%;=&\4#=P*ZXD+J()^VK4']\/C(+QA/@BU3H
M',^Y@ZIRY\;]CF[JC%N_SQLL+3+4XW.K2XQ[/-_W<"/0H6E3:UX*BAEU:V%A
M.NZ"/8[5GV[FR=#W1#_K>'][4PN[BB*PE*]0KP4U_6;I<HN4]$67B=J#ZLJN
MIV)D\I(( .1^3>T$J]?")7E%\.*;I3M.<E0]A'K5(PV6&,G55<NUR9$&=XU$
M 1DV$DD-M,XS[>#)NU]WN6-^\8X^G;V!@469Y)=;NBPOFD9)E,LSG30^OH'/
M2:GOE.^\^+D=P"P^3\QBL.(L/NM94+M\Y\K<.@UO?_=L5\_EC_&=\7M]+XO!
MPU-[Q9GI;L?3@ZZQ,^P4^BXM,]ORTK376:NLZAY/"#_<"'3(;.[:*]">^_=C
M/?VP] JLUUFQFH99^)!-0Q\FE8;(LL0#(&+. /?&,%6PSVJJ2$8?[FS-#46I
M^C!6WV/9#7/VU!/ GA^FN0&,^ME2#=4[6,$M+.71Y3GJ4)AN3/286&[#=*D9
MTZ5F-QM@P!#%1/@^;@J 3#G>(WN84\6&8;,/HA%:QZ!/,7PP+:S);Y@65[4[
M$YV%<2*[HE?J^9B1]:XG/?D!Q@0[>;YF[O)87$U6'Z!=W(^PTU%;Y&\+QL8F
MZG#=)*\4NK'VR^?C]2.]J_/$?9XZ?L A@"E,[O)5!-)C!=@;) K\>8+[$X5>
MUU68PG%5,9T^W+# E0OQ%_WVPIR<M[GX-IN/E?.^^S<2]"/1?^]?2<!$'3[U
M_Y2HHX9V(NK(QJ4AH^!Z7"/[0G$B<+,24.!A+H%[%4&J$A(O(R_4.V3O"?9$
CC0QDI4> XV.,,/[_JZ@;F?:[KX0%\!)!K?C_9BI#-M%E    
 

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
@ 2004-11-08  7:10 ` Jouni Malinen
  2004-11-09  7:40   ` Jeff Garzik
  2004-11-08  7:11 ` [PATCH wireless-2.6 2/12] Host AP: Fix interface packet counters Jouni Malinen
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:10 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:37:51 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:37:51 -08:00
@@ -934,7 +934,7 @@
 		    hostap_is_eapol_frame(local, skb)) {
 			/* pass unencrypted EAPOL frames even if encryption is
 			 * configured */
-			printk(KERN_DEBUG "%s: RX: IEEE 802.1X - passing "
+			PDEBUG(DEBUG_EXTRA2, "%s: RX: IEEE 802.1X - passing "
 			       "unencrypted EAPOL frame\n", local->dev->name);
 		} else {
 			printk(KERN_DEBUG "%s: encryption configured, but RX "
@@ -963,7 +963,7 @@
 	 * the received frame. */
 	if (local->ieee_802_1x && local->iw_mode == IW_MODE_MASTER) {
 		if (ethertype == ETH_P_PAE) {
-			printk(KERN_DEBUG "%s: RX: IEEE 802.1X frame\n",
+			PDEBUG(DEBUG_EXTRA2, "%s: RX: IEEE 802.1X frame\n",
 			       dev->name);
 			if (local->hostapd && local->apdev) {
 				/* Send IEEE 802.1X frames to the user
diff -Nru a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-07 22:37:51 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-07 22:37:51 -08:00
@@ -442,7 +442,7 @@
 	if (local->ieee_802_1x && meta->ethertype == ETH_P_PAE && tx.crypt &&
 	    !(fc & WLAN_FC_ISWEP)) {
 		no_encrypt = 1;
-		printk(KERN_DEBUG "%s: TX: IEEE 802.1X - passing "
+		PDEBUG(DEBUG_EXTRA2, "%s: TX: IEEE 802.1X - passing "
 		       "unencrypted EAPOL frame\n", dev->name);
 		tx.crypt = NULL; /* no encryption for IEEE 802.1X frames */
 	}


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 2/12] Host AP: Fix interface packet counters
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
  2004-11-08  7:10 ` [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages Jouni Malinen
@ 2004-11-08  7:11 ` Jouni Malinen
  2004-11-08  7:12 ` [PATCH wireless-2.6 3/12] Host AP: Ignore (Re)AssocResp messages silently Jouni Malinen
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:11 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Fix wlan#/wifi# interface packet counters (both are supposed to see
data packets once; wlan# was counting TX twice and wifi# did not count
TX or RX at all for most cases).

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:37:59 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:37:59 -08:00
@@ -689,6 +689,9 @@
 	void *sta = NULL;
 	int keyidx = 0;
 
+	iface->stats.rx_packets++;
+	iface->stats.rx_bytes += skb->len;
+
 	/* dev is the master radio device; change this to be the default
 	 * virtual interface (this may be changed to WDS device below) */
 	dev = local->ddev;
diff -Nru a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-07 22:37:59 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-07 22:37:59 -08:00
@@ -379,7 +379,7 @@
 		printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb "
 		       "(len=%d)\n", dev->name, skb->len);
 		ret = 0;
-		meta->iface->stats.tx_dropped++;
+		iface->stats.tx_dropped++;
 		goto fail;
 	}
 
@@ -405,13 +405,13 @@
 			hostap_dump_tx_80211(dev->name, skb);
 
 			ret = 0; /* drop packet */
-			meta->iface->stats.tx_dropped++;
+			iface->stats.tx_dropped++;
 			goto fail;
 		}
 		break;
 	case AP_TX_DROP:
 		ret = 0; /* drop packet */
-		meta->iface->stats.tx_dropped++;
+		iface->stats.tx_dropped++;
 		goto fail;
 	case AP_TX_RETRY:
 		goto fail;
@@ -488,11 +488,11 @@
 
 	if (local->func->tx == NULL || local->func->tx(skb, dev)) {
 		ret = 0;
-		meta->iface->stats.tx_dropped++;
+		iface->stats.tx_dropped++;
 	} else {
 		ret = 0;
-		meta->iface->stats.tx_packets++;
-		meta->iface->stats.tx_bytes += skb->len;
+		iface->stats.tx_packets++;
+		iface->stats.tx_bytes += skb->len;
 	}
 
  fail:


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 3/12] Host AP: Ignore (Re)AssocResp messages silently
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
  2004-11-08  7:10 ` [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages Jouni Malinen
  2004-11-08  7:11 ` [PATCH wireless-2.6 2/12] Host AP: Fix interface packet counters Jouni Malinen
@ 2004-11-08  7:12 ` Jouni Malinen
  2004-11-08  7:12 ` [PATCH wireless-2.6 4/12] Host AP: Remove ioctl debug messages Jouni Malinen
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:12 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Ignore (Re)AssocResp silently since these are not currently needed but
are still received when WPA/RSN mode is enabled.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:38:11 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:38:11 -08:00
@@ -475,6 +475,13 @@
 		    stype == WLAN_FC_STYPE_PROBE_RESP)) {
 		hostap_rx_sta_beacon(local, skb, stype);
 		return -1;
+	} else if (type == WLAN_FC_TYPE_MGMT &&
+		   (stype == WLAN_FC_STYPE_ASSOC_RESP ||
+		    stype == WLAN_FC_STYPE_REASSOC_RESP)) {
+		/* Ignore (Re)AssocResp silently since these are not currently
+		 * needed but are still received when WPA/RSN mode is enabled.
+		 */
+		return -1;
 	} else {
 		printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: dropped unhandled"
 		       " management frame in non-Host AP mode (type=%d:%d)\n",


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 4/12] Host AP: Remove ioctl debug messages
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (2 preceding siblings ...)
  2004-11-08  7:12 ` [PATCH wireless-2.6 3/12] Host AP: Ignore (Re)AssocResp messages silently Jouni Malinen
@ 2004-11-08  7:12 ` Jouni Malinen
  2004-11-08  7:13 ` [PATCH wireless-2.6 5/12] Host AP: Fix hw address changing for wifi# interface Jouni Malinen
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:12 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Remove debug message from unsupported ioctls. Some of common ioctls
triggered these (e.g., SIOCGMIIPHY, SIOCGMIIREG, SIOCSMIIREG,
SIOCDEVPRIVATE) and filled debug logs with unwanted messages.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:38:18 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:38:18 -08:00
@@ -3452,14 +3452,6 @@
 		break;
 
 	default:
-		if (cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) {
-			/* unsupport wireless extensions get through here - do
-			 * not report these to debug log */
-			ret = -EOPNOTSUPP;
-			break;
-		}
-		printk(KERN_DEBUG "%s unsupported ioctl(0x%04x)\n",
-		       dev->name, cmd);
 		ret = -EOPNOTSUPP;
 		break;
 	}

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 5/12] Host AP: Fix hw address changing for wifi# interface
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (3 preceding siblings ...)
  2004-11-08  7:12 ` [PATCH wireless-2.6 4/12] Host AP: Remove ioctl debug messages Jouni Malinen
@ 2004-11-08  7:13 ` Jouni Malinen
  2004-11-08  7:13 ` [PATCH wireless-2.6 6/12] Host AP: Prevent STAs from associating using AP address Jouni Malinen
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:13 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Update wifi# interface MAC address when changing addresses. Without
this, MAC address change does not work correctly with the new
interface design (wifi#/wlan0#).

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap.c b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c	2004-11-07 22:38:26 -08:00
+++ b/drivers/net/wireless/hostap/hostap.c	2004-11-07 22:38:26 -08:00
@@ -808,6 +808,7 @@
 		iface = list_entry(ptr, struct hostap_interface, list);
 		memcpy(iface->dev->dev_addr, addr->sa_data, ETH_ALEN);
 	}
+	memcpy(local->dev->dev_addr, addr->sa_data, ETH_ALEN);
 	read_unlock_bh(&local->iface_lock);
 
 	return 0;


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 6/12] Host AP: Prevent STAs from associating using AP address
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (4 preceding siblings ...)
  2004-11-08  7:13 ` [PATCH wireless-2.6 5/12] Host AP: Fix hw address changing for wifi# interface Jouni Malinen
@ 2004-11-08  7:13 ` Jouni Malinen
  2004-11-08  7:14 ` [PATCH wireless-2.6 7/12] Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined Jouni Malinen
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:13 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Prevent STAs from authenticating with AP address (i.e., spoofing AP
MAC address). The inner bridge implementation intercepts packets
before they are passed to Linux net stack, so using AP MAC address
would prevent AP from seeing the packet properly.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c	2004-11-07 22:38:35 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.c	2004-11-07 22:38:35 -08:00
@@ -1329,7 +1329,8 @@
 	status_code = __le16_to_cpu(*pos);
 	pos++;
 
-	if (ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) {
+	if (memcmp(dev->dev_addr, hdr->addr2, ETH_ALEN) == 0 ||
+	    ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) {
 		txt = "authentication denied";
 		resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
 		goto fail;


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 7/12] Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined.
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (5 preceding siblings ...)
  2004-11-08  7:13 ` [PATCH wireless-2.6 6/12] Host AP: Prevent STAs from associating using AP address Jouni Malinen
@ 2004-11-08  7:14 ` Jouni Malinen
  2004-11-08  7:14 ` [PATCH wireless-2.6 8/12] Host AP: Do not bridge packets to unauthorized ports Jouni Malinen
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:14 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:38:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:38:44 -08:00
@@ -597,6 +597,7 @@
 }
 
 
+#ifndef PRISM2_NO_STATION_MODES
 static int hostap_join_ap(struct net_device *dev)
 {
 	struct hostap_interface *iface = dev->priv;
@@ -634,6 +635,7 @@
 
 	return 0;
 }
+#endif /* PRISM2_NO_STATION_MODES */
 
 
 static int prism2_ioctl_siwap(struct net_device *dev,
@@ -1586,7 +1588,8 @@
 
 #else /* !PRISM2_NO_STATION_MODES */
 
-static inline int prism2_request_hostscan(struct net_device *dev)
+static inline int prism2_request_hostscan(struct net_device *dev,
+					  u8 *ssid, u8 ssid_len)
 {
 	return -EOPNOTSUPP;
 }


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 8/12] Host AP: Do not bridge packets to unauthorized ports
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (6 preceding siblings ...)
  2004-11-08  7:14 ` [PATCH wireless-2.6 7/12] Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined Jouni Malinen
@ 2004-11-08  7:14 ` Jouni Malinen
  2004-11-08  7:15 ` [PATCH wireless-2.6 9/12] Host AP: Fix card enabling after firmware download Jouni Malinen
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:14 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Fix inner-BSS bridge (ap_bridge_packets=1) not to bridge packets to
unauthorized ports when IEEE 802.1X/WPA is used (i.e., require that
the STA completes authentication before capturing packets in the inner
bridge); previously, only association status was used and an attacker
could have capture packets to any MAC address even without having
proper credentials for using the network (although, the packets were
dropped because the controlled port for the STA was unauthorized).

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:38:51 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-07 22:38:51 -08:00
@@ -1035,7 +1035,7 @@
 			if (skb2 == NULL)
 				printk(KERN_DEBUG "%s: skb_clone failed for "
 				       "multicast frame\n", dev->name);
-		} else if (hostap_is_sta_assoc(local->ap, dst)) {
+		} else if (hostap_is_sta_authorized(local->ap, dst)) {
 			/* send frame directly to the associated STA using
 			 * wireless media and not passing to higher layers */
 			local->ap->bridged_unicast++;
diff -Nru a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c	2004-11-07 22:38:51 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.c	2004-11-07 22:38:51 -08:00
@@ -3061,6 +3061,24 @@
 
 
 /* Called only as a tasklet (software IRQ) */
+int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr)
+{
+	struct sta_info *sta;
+	int ret = 0;
+
+	spin_lock(&ap->sta_table_lock);
+	sta = ap_get_sta(ap, sta_addr);
+	if (sta != NULL && (sta->flags & WLAN_STA_ASSOC) && !sta->ap &&
+	    ((sta->flags & WLAN_STA_AUTHORIZED) ||
+	     ap->local->ieee_802_1x == 0))
+		ret = 1;
+	spin_unlock(&ap->sta_table_lock);
+
+	return ret;
+}
+
+
+/* Called only as a tasklet (software IRQ) */
 int hostap_add_sta(struct ap_data *ap, u8 *sta_addr)
 {
 	struct sta_info *sta;
@@ -3219,6 +3237,7 @@
 EXPORT_SYMBOL(hostap_update_sta_ps);
 EXPORT_SYMBOL(hostap_handle_sta_rx);
 EXPORT_SYMBOL(hostap_is_sta_assoc);
+EXPORT_SYMBOL(hostap_is_sta_authorized);
 EXPORT_SYMBOL(hostap_add_sta);
 EXPORT_SYMBOL(hostap_update_rates);
 EXPORT_SYMBOL(hostap_add_wds_links);
diff -Nru a/drivers/net/wireless/hostap/hostap_ap.h b/drivers/net/wireless/hostap/hostap_ap.h
--- a/drivers/net/wireless/hostap/hostap_ap.h	2004-11-07 22:38:51 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.h	2004-11-07 22:38:51 -08:00
@@ -255,6 +255,7 @@
 			     struct hostap_ieee80211_hdr *hdr,
 			     struct prism2_crypt_data **crypt, void **sta_ptr);
 int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr);
+int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr);
 int hostap_add_sta(struct ap_data *ap, u8 *sta_addr);
 int hostap_update_rx_stats(struct ap_data *ap,
 			   struct hostap_ieee80211_hdr *hdr,



-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 9/12] Host AP: Fix card enabling after firmware download
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (7 preceding siblings ...)
  2004-11-08  7:14 ` [PATCH wireless-2.6 8/12] Host AP: Do not bridge packets to unauthorized ports Jouni Malinen
@ 2004-11-08  7:15 ` Jouni Malinen
  2004-11-08  7:16 ` [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w} Jouni Malinen
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:15 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Fix card enabling after firmware download in case any of the
netdevs were up when the download was started.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c	2004-11-07 22:39:00 -08:00
+++ b/drivers/net/wireless/hostap/hostap_hw.c	2004-11-07 22:39:00 -08:00
@@ -1483,7 +1483,10 @@
 	if (prism2_hw_init2(dev, initial))
 		return 1;
 
-	if (!local->pri_only && !initial) {
+	/* Enable firmware if secondary image is loaded and at least one of the
+	 * netdevices is up. */
+	if (!local->pri_only &&
+	    (initial == 0 || (initial == 2 && local->num_dev_open > 0))) {
 		if (!local->dev_enabled)
 			prism2_callback(local, PRISM2_CALLBACK_ENABLE);
 		local->dev_enabled = 1;


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w}
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (8 preceding siblings ...)
  2004-11-08  7:15 ` [PATCH wireless-2.6 9/12] Host AP: Fix card enabling after firmware download Jouni Malinen
@ 2004-11-08  7:16 ` Jouni Malinen
  2004-11-09  7:29   ` Jeff Garzik
  2004-11-08  7:17 ` [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG Jouni Malinen
                   ` (7 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:16 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Start using void * instead of unsigned long with {read,write}{b,w} to
silence compiler warning with Linux 2.6.9-rc2.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c	2004-11-07 22:39:06 -08:00
+++ b/drivers/net/wireless/hostap/hostap_pci.c	2004-11-07 22:39:06 -08:00
@@ -56,7 +56,7 @@
 
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
-	writeb(v, dev->mem_start + a);
+	writeb(v, (void *) dev->mem_start + a);
 	spin_unlock_irqrestore(&local->lock, flags);
 }
 
@@ -68,7 +68,7 @@
 	u8 v;
 
 	spin_lock_irqsave(&local->lock, flags);
-	v = readb(dev->mem_start + a);
+	v = readb((void *) dev->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
 	spin_unlock_irqrestore(&local->lock, flags);
 	return v;
@@ -82,7 +82,7 @@
 
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
-	writew(v, dev->mem_start + a);
+	writew(v, (void *) dev->mem_start + a);
 	spin_unlock_irqrestore(&local->lock, flags);
 }
 
@@ -94,7 +94,7 @@
 	u16 v;
 
 	spin_lock_irqsave(&local->lock, flags);
-	v = readw(dev->mem_start + a);
+	v = readw((void *) dev->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
 	spin_unlock_irqrestore(&local->lock, flags);
 	return v;
@@ -109,12 +109,14 @@
 
 #else /* PRISM2_IO_DEBUG */
 
-#define HFA384X_OUTB(v,a) writeb((v), dev->mem_start + (a))
-#define HFA384X_INB(a) (u8) readb(dev->mem_start + (a))
-#define HFA384X_OUTW(v,a) writew((v), dev->mem_start + (a))
-#define HFA384X_INW(a) (u16) readw(dev->mem_start + (a))
-#define HFA384X_OUTW_DATA(v,a) writew(cpu_to_le16(v), dev->mem_start + (a))
-#define HFA384X_INW_DATA(a) (u16) le16_to_cpu(readw(dev->mem_start + (a)))
+#define HFA384X_OUTB(v,a) writeb((v), (void *) dev->mem_start + (a))
+#define HFA384X_INB(a) (u8) readb((void *) dev->mem_start + (a))
+#define HFA384X_OUTW(v,a) writew((v), (void *) dev->mem_start + (a))
+#define HFA384X_INW(a) (u16) readw((void *) dev->mem_start + (a))
+#define HFA384X_OUTW_DATA(v,a) \
+	writew(cpu_to_le16(v), (void *) dev->mem_start + (a))
+#define HFA384X_INW_DATA(a) (u16) \
+	le16_to_cpu(readw((void *) dev->mem_start + (a)))
 
 #endif /* PRISM2_IO_DEBUG */
 
diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-07 22:39:06 -08:00
+++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-07 22:39:06 -08:00
@@ -247,7 +247,7 @@
 
 	/* Set sreset bit of COR and clear it after hold time */
 
-	if (local->attr_mem == 0) {
+	if (local->attr_mem == NULL) {
 		/* TMD7160 - COR at card's first I/O addr */
 		corsave = inb(local->cor_offset);
 		outb(corsave | COR_SRESET, local->cor_offset);
@@ -271,7 +271,7 @@
 {
 	unsigned char corsave;
 
-	if (local->attr_mem == 0) {
+	if (local->attr_mem == NULL) {
 		/* TMD7160 - COR at card's first I/O addr */
 		corsave = inb(local->cor_offset);
 		outb(corsave | COR_SRESET, local->cor_offset);
@@ -306,7 +306,7 @@
 };
 
 
-static int prism2_plx_check_cis(unsigned long attr_mem, int attr_len,
+static int prism2_plx_check_cis(void *attr_mem, int attr_len,
 				unsigned int *cor_offset,
 				unsigned int *cor_index)
 {
@@ -401,7 +401,7 @@
 	unsigned int pccard_ioaddr, plx_ioaddr;
 	unsigned long pccard_attr_mem;
 	unsigned int pccard_attr_len;
-	unsigned long attr_mem = 0;
+	void *attr_mem = NULL;
 	unsigned int cor_offset, cor_index;
 	u32 reg;
 	local_info_t *local = NULL;
@@ -422,7 +422,7 @@
 
 	if (tmd7160) {
 		/* TMD7160 */
-		attr_mem = 0; /* no access to PC Card attribute memory */
+		attr_mem = NULL; /* no access to PC Card attribute memory */
 
 		printk(KERN_INFO "TMD7160 PCI/PCMCIA adapter: io=0x%x, "
 		       "irq=%d, pccard_io=0x%x\n",
@@ -448,9 +448,8 @@
 			goto fail;
 
 
-		attr_mem = (unsigned long) ioremap(pccard_attr_mem,
-						   pccard_attr_len);
-		if (!attr_mem) {
+		attr_mem = ioremap(pccard_attr_mem, pccard_attr_len);
+		if (attr_mem == NULL) {
 			printk(KERN_ERR "%s: cannot remap attr_mem\n",
 			       dev_info);
 			goto fail;
@@ -532,7 +531,7 @@
 		free_irq(dev->irq, dev);
 
 	if (attr_mem)
-		iounmap((void *) attr_mem);
+		iounmap(attr_mem);
 
 	pci_disable_device(pdev);
 
@@ -550,7 +549,7 @@
 	hfa384x_disable_interrupts(dev);
 
 	if (iface->local->attr_mem)
-		iounmap((void *) iface->local->attr_mem);
+		iounmap(iface->local->attr_mem);
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 
diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:06 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:06 -08:00
@@ -895,7 +895,7 @@
 #endif /* PRISM2_PCCARD */
 
 #ifdef PRISM2_PLX
-	unsigned long attr_mem;
+	void *attr_mem;
 	unsigned int cor_offset;
 #endif /* PRISM2_PLX */
 


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (9 preceding siblings ...)
  2004-11-08  7:16 ` [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w} Jouni Malinen
@ 2004-11-08  7:17 ` Jouni Malinen
  2004-11-09  7:29   ` Jeff Garzik
  2004-11-08  7:17 ` [PATCH wireless-2.6 12/12] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
                   ` (6 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:17 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

>From Mark Glines <mark@glines.org>:
I just noticed PRISM2_IO_DEBUG doesn't work.  This patch gets it
working again.  I checked the development CVS snapshot, looks like
its still broken there.

jkm: in addition, fix the other PRISM2_IO_DEBUG function

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:16 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:16 -08:00
@@ -1006,7 +1006,8 @@
 static inline void prism2_io_debug_add(struct net_device *dev, int cmd,
 				       int reg, int value)
 {
-	local_info_t *local = dev->priv;
+	struct hostap_interface *iface = dev->priv;
+	local_info_t *local = iface->local;
 
 	if (!local->io_debug_enabled)
 		return;
@@ -1023,7 +1024,8 @@
 
 static inline void prism2_io_debug_error(struct net_device *dev, int err)
 {
-	local_info_t *local = dev->priv;
+	struct hostap_interface *iface = dev->priv;
+	local_info_t *local = iface->local;
 	unsigned long flags;
 
 	if (!local->io_debug_enabled)


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 12/12] Host AP: Fix netif_carrier_off() in non-client modes
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (10 preceding siblings ...)
  2004-11-08  7:17 ` [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG Jouni Malinen
@ 2004-11-08  7:17 ` Jouni Malinen
  2004-11-09  8:04 ` [PATCH wireless-2.6 0/12] Host AP update Jeff Garzik
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-08  7:17 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Connection status is reported properly only in client modes, so do not
try to set netif_carrier_off() in non-client modes. Previously, Master
mode may end up being in state where netif_carrier was left off and
this may break things like bridging.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c	2004-11-07 22:39:25 -08:00
+++ b/drivers/net/wireless/hostap/hostap_hw.c	2004-11-07 22:39:25 -08:00
@@ -3399,8 +3399,11 @@
 					   "", dev_template);
 
 	if (local->ddev) {
-		netif_carrier_off(local->dev);
-		netif_carrier_off(local->ddev);
+		if (local->iw_mode == IW_MODE_INFRA ||
+		    local->iw_mode == IW_MODE_ADHOC) {
+			netif_carrier_off(local->dev);
+			netif_carrier_off(local->ddev);
+		}
 		hostap_init_proc(local);
 		hostap_init_ap_proc(local);
 		return 0;
diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:39:25 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-07 22:39:25 -08:00
@@ -1108,6 +1108,13 @@
 	if (double_reset && local->func->reset_port(dev))
 		return -EINVAL;
 
+	if (local->iw_mode != IW_MODE_INFRA && local->iw_mode != IW_MODE_ADHOC)
+	{
+		/* netif_carrier is used only in client modes for now, so make
+		 * sure carrier is on when moving to non-client modes. */
+		netif_carrier_on(local->dev);
+		netif_carrier_on(local->ddev);
+	}
 	return 0;
 }
 


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w}
  2004-11-08  7:16 ` [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w} Jouni Malinen
@ 2004-11-09  7:29   ` Jeff Garzik
  2004-11-14  5:18     ` [PATCH wireless-2.6 10/16] Host AP: Use void __iomem * " Jouni Malinen
  0 siblings, 1 reply; 29+ messages in thread
From: Jeff Garzik @ 2004-11-09  7:29 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev

Jouni Malinen wrote:
> Start using void * instead of unsigned long with {read,write}{b,w} to
> silence compiler warning with Linux 2.6.9-rc2.
> 
> Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
> 
> 
> diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
> --- a/drivers/net/wireless/hostap/hostap_pci.c	2004-11-07 22:39:06 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_pci.c	2004-11-07 22:39:06 -08:00
> @@ -56,7 +56,7 @@
>  
>  	spin_lock_irqsave(&local->lock, flags);
>  	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
> -	writeb(v, dev->mem_start + a);
> +	writeb(v, (void *) dev->mem_start + a);
>  	spin_unlock_irqrestore(&local->lock, flags);
>  }
>  
> @@ -68,7 +68,7 @@
>  	u8 v;
>  
>  	spin_lock_irqsave(&local->lock, flags);
> -	v = readb(dev->mem_start + a);
> +	v = readb((void *) dev->mem_start + a);
>  	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
>  	spin_unlock_irqrestore(&local->lock, flags);
>  	return v;
> @@ -82,7 +82,7 @@
>  
>  	spin_lock_irqsave(&local->lock, flags);
>  	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
> -	writew(v, dev->mem_start + a);
> +	writew(v, (void *) dev->mem_start + a);
>  	spin_unlock_irqrestore(&local->lock, flags);
>  }
>  
> @@ -94,7 +94,7 @@
>  	u16 v;
>  
>  	spin_lock_irqsave(&local->lock, flags);
> -	v = readw(dev->mem_start + a);
> +	v = readw((void *) dev->mem_start + a);
>  	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
>  	spin_unlock_irqrestore(&local->lock, flags);
>  	return v;
> @@ -109,12 +109,14 @@
>  
>  #else /* PRISM2_IO_DEBUG */
>  
> -#define HFA384X_OUTB(v,a) writeb((v), dev->mem_start + (a))
> -#define HFA384X_INB(a) (u8) readb(dev->mem_start + (a))
> -#define HFA384X_OUTW(v,a) writew((v), dev->mem_start + (a))
> -#define HFA384X_INW(a) (u16) readw(dev->mem_start + (a))
> -#define HFA384X_OUTW_DATA(v,a) writew(cpu_to_le16(v), dev->mem_start + (a))
> -#define HFA384X_INW_DATA(a) (u16) le16_to_cpu(readw(dev->mem_start + (a)))
> +#define HFA384X_OUTB(v,a) writeb((v), (void *) dev->mem_start + (a))
> +#define HFA384X_INB(a) (u8) readb((void *) dev->mem_start + (a))
> +#define HFA384X_OUTW(v,a) writew((v), (void *) dev->mem_start + (a))
> +#define HFA384X_INW(a) (u16) readw((void *) dev->mem_start + (a))
> +#define HFA384X_OUTW_DATA(v,a) \
> +	writew(cpu_to_le16(v), (void *) dev->mem_start + (a))
> +#define HFA384X_INW_DATA(a) (u16) \
> +	le16_to_cpu(readw((void *) dev->mem_start + (a)))

Two comments:

1) that should be "void __iomem *" not "void *" for MMIO memory pointers

2) don't bother using dev->mem_start, that is normally used for passing 
options or an ISA memory address from userland to the kernel.  Store the 
result of ioremap() in a private 'void __iomem *' pointer instead.



> diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
> --- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-07 22:39:06 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-07 22:39:06 -08:00
> @@ -247,7 +247,7 @@
>  
>  	/* Set sreset bit of COR and clear it after hold time */
>  
> -	if (local->attr_mem == 0) {
> +	if (local->attr_mem == NULL) {
>  		/* TMD7160 - COR at card's first I/O addr */
>  		corsave = inb(local->cor_offset);
>  		outb(corsave | COR_SRESET, local->cor_offset);
> @@ -271,7 +271,7 @@
>  {
>  	unsigned char corsave;
>  
> -	if (local->attr_mem == 0) {
> +	if (local->attr_mem == NULL) {
>  		/* TMD7160 - COR at card's first I/O addr */
>  		corsave = inb(local->cor_offset);
>  		outb(corsave | COR_SRESET, local->cor_offset);
> @@ -306,7 +306,7 @@
>  };
>  
>  
> -static int prism2_plx_check_cis(unsigned long attr_mem, int attr_len,
> +static int prism2_plx_check_cis(void *attr_mem, int attr_len,
>  				unsigned int *cor_offset,
>  				unsigned int *cor_index)
>  {
> @@ -401,7 +401,7 @@
>  	unsigned int pccard_ioaddr, plx_ioaddr;
>  	unsigned long pccard_attr_mem;
>  	unsigned int pccard_attr_len;
> -	unsigned long attr_mem = 0;
> +	void *attr_mem = NULL;
>  	unsigned int cor_offset, cor_index;
>  	u32 reg;
>  	local_info_t *local = NULL;

void __iomem *


> @@ -422,7 +422,7 @@
>  
>  	if (tmd7160) {
>  		/* TMD7160 */
> -		attr_mem = 0; /* no access to PC Card attribute memory */
> +		attr_mem = NULL; /* no access to PC Card attribute memory */
>  
>  		printk(KERN_INFO "TMD7160 PCI/PCMCIA adapter: io=0x%x, "
>  		       "irq=%d, pccard_io=0x%x\n",
> @@ -448,9 +448,8 @@
>  			goto fail;
>  
>  
> -		attr_mem = (unsigned long) ioremap(pccard_attr_mem,
> -						   pccard_attr_len);
> -		if (!attr_mem) {
> +		attr_mem = ioremap(pccard_attr_mem, pccard_attr_len);
> +		if (attr_mem == NULL) {
>  			printk(KERN_ERR "%s: cannot remap attr_mem\n",
>  			       dev_info);
>  			goto fail;
> @@ -532,7 +531,7 @@
>  		free_irq(dev->irq, dev);
>  
>  	if (attr_mem)
> -		iounmap((void *) attr_mem);
> +		iounmap(attr_mem);
>  
>  	pci_disable_device(pdev);
>  
> @@ -550,7 +549,7 @@
>  	hfa384x_disable_interrupts(dev);
>  
>  	if (iface->local->attr_mem)
> -		iounmap((void *) iface->local->attr_mem);
> +		iounmap(iface->local->attr_mem);
>  	if (dev->irq)
>  		free_irq(dev->irq, dev);
>  
> diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
> --- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:06 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:06 -08:00
> @@ -895,7 +895,7 @@
>  #endif /* PRISM2_PCCARD */
>  
>  #ifdef PRISM2_PLX
> -	unsigned long attr_mem;
> +	void *attr_mem;
>  	unsigned int cor_offset;
>  #endif /* PRISM2_PLX */

void __iomem *

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG
  2004-11-08  7:17 ` [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG Jouni Malinen
@ 2004-11-09  7:29   ` Jeff Garzik
  2004-11-14  5:20     ` [PATCH wireless-2.6 11/16] " Jouni Malinen
  0 siblings, 1 reply; 29+ messages in thread
From: Jeff Garzik @ 2004-11-09  7:29 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev

Jouni Malinen wrote:
>>From Mark Glines <mark@glines.org>:
> I just noticed PRISM2_IO_DEBUG doesn't work.  This patch gets it
> working again.  I checked the development CVS snapshot, looks like
> its still broken there.
> 
> jkm: in addition, fix the other PRISM2_IO_DEBUG function
> 
> Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
> 
> 
> diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
> --- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:16 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-07 22:39:16 -08:00
> @@ -1006,7 +1006,8 @@
>  static inline void prism2_io_debug_add(struct net_device *dev, int cmd,
>  				       int reg, int value)
>  {
> -	local_info_t *local = dev->priv;
> +	struct hostap_interface *iface = dev->priv;
> +	local_info_t *local = iface->local;
>  
>  	if (!local->io_debug_enabled)
>  		return;
> @@ -1023,7 +1024,8 @@
>  
>  static inline void prism2_io_debug_error(struct net_device *dev, int err)
>  {
> -	local_info_t *local = dev->priv;
> +	struct hostap_interface *iface = dev->priv;
> +	local_info_t *local = iface->local;
>  	unsigned long flags;

it is preferred to use netdev_priv() rather than directly referring to 
dev->priv.

	Jeff

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages
  2004-11-08  7:10 ` [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages Jouni Malinen
@ 2004-11-09  7:40   ` Jeff Garzik
  0 siblings, 0 replies; 29+ messages in thread
From: Jeff Garzik @ 2004-11-09  7:40 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev

applied patches 1-9

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 0/12] Host AP update
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (11 preceding siblings ...)
  2004-11-08  7:17 ` [PATCH wireless-2.6 12/12] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
@ 2004-11-09  8:04 ` Jeff Garzik
  2004-11-09  9:09   ` Michael Renzmann
  2004-11-14  5:15   ` Jouni Malinen
  2004-11-14  5:21 ` [PATCH wireless-2.6 12/16] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
                   ` (4 subsequent siblings)
  17 siblings, 2 replies; 29+ messages in thread
From: Jeff Garzik @ 2004-11-09  8:04 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev, Andrew Morton, James Ketrenos

Jouni Malinen wrote:
> Jeff,
> 
> Here's an update to Host AP code in wireless-2.6 tree. This brings in
> number of small fixes from my CVS repository. This messages has the
> changes in BitKeeper format from bksend and following 12 messages have
> the patches one by one as unified diffs.
> 
> I have couple of additional patches pending for wireless-2.6 updates
> (wireless extensions 17 and 18; changes to PCI API in Linux
> 2.6.10-rc1). I'll send WE17 and PCI changes once you update
> wireless-2.6. WE18 change requires an update to wireless extensions,
> so it may need to wait somewhat longer or we could start testing WE18
> in wireless-2.6 if that is desired.

Feel free to push experimental (but tested!) code to wireless-2.6.


> I keep getting questions about getting Host AP driver to linux-2.6
> tree. What would be needed to make this happen? I would assume this

Andrew Morton's "-mm" kernels are essentially a staging area for pushing 
changes to the upstream kernel.  I pulled the latest wireless-2.6 tree 
(includes your latest patches #1 - #9) into my netdev-2.6 queue. 
netdev-2.6, in turn, is automatically pulled by Andrew, into his -mm 
tree.  It will get wider review and testing here.


> would be easiest to do this from wireless-2.6 tree once the new
> patches are in. Any other changes that would be required to get the
> driver in suitable state for merging into Linux 2.6 releases?

A key goal I have for HostAP is that portions of HostAP code should be 
bundled into a generic "lib80211" kernel module, for use by various 
low-level and "softmac" 802.11 device drivers.

The Intel Centrino driver folks are already using HostAP in this 
capacity, and I _think_ their changes were fairly minimal and cosmetic. 
    If the changes are indeed minimal, I think it's better to merge 
those changes before sending HostAP stuff upstream.

To emphasize that the upstream-bound HostAP code is a generic library 
(well, parts of it), I would prefer that the kernel module name, and API 
prefixes, use some name other than 'hostap_'.  'wifi_' or 'ieee80211_' 
or whatever, I don't care.  Just something "more generic".

I would rather perform mass renaming of functions and files before 
merging upstream.


> You can import this changeset into BK by piping this whole message to:
> '| bk receive [path to repository]' or apply the patch as usual.

IMHO the bksend stuff is useless.  I prefer "plain ole patches", like 
the ones you sent in emails '1/12' through '12/12' in this thread.


WRT the patches you sent, as I mentioned, #1 - #9 were applied.  Please 
update #10 and #11 per comments, and then resend #10 - #12.

	Jeff

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 0/12] Host AP update
  2004-11-09  8:04 ` [PATCH wireless-2.6 0/12] Host AP update Jeff Garzik
@ 2004-11-09  9:09   ` Michael Renzmann
  2004-11-09 15:26     ` Jeff Garzik
  2004-11-14  5:15   ` Jouni Malinen
  1 sibling, 1 reply; 29+ messages in thread
From: Michael Renzmann @ 2004-11-09  9:09 UTC (permalink / raw)
  To: netdev

Hi.

(I cutted down the CC list.)

Jeff Garzik wrote:
> A key goal I have for HostAP is that portions of HostAP code should be 
> bundled into a generic "lib80211" kernel module, for use by various 
> low-level and "softmac" 802.11 device drivers.

This sentence made me curious... does that mean the efforts which 
recently have been discussed here (to bring a generic 802.11 stack to 
the kernel) are going to be replaced by the described goal? Or is it an 
addition to Vladimir's work?

Bye, Mike

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 0/12] Host AP update
  2004-11-09  9:09   ` Michael Renzmann
@ 2004-11-09 15:26     ` Jeff Garzik
  2004-11-09 21:32       ` Vladimir Kondratiev
  0 siblings, 1 reply; 29+ messages in thread
From: Jeff Garzik @ 2004-11-09 15:26 UTC (permalink / raw)
  To: Michael Renzmann; +Cc: netdev

Michael Renzmann wrote:
> Hi.
> 
> (I cutted down the CC list.)
> 
> Jeff Garzik wrote:
> 
>> A key goal I have for HostAP is that portions of HostAP code should be 
>> bundled into a generic "lib80211" kernel module, for use by various 
>> low-level and "softmac" 802.11 device drivers.
> 
> 
> This sentence made me curious... does that mean the efforts which 
> recently have been discussed here (to bring a generic 802.11 stack to 
> the kernel) are going to be replaced by the described goal? Or is it an 
> addition to Vladimir's work?

Hopefully Vladmir's work will plug right in..  I hope he's still working 
on it!

	Jeff

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 0/12] Host AP update
  2004-11-09 15:26     ` Jeff Garzik
@ 2004-11-09 21:32       ` Vladimir Kondratiev
  0 siblings, 0 replies; 29+ messages in thread
From: Vladimir Kondratiev @ 2004-11-09 21:32 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Michael Renzmann, netdev

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

On Tuesday 09 November 2004 17:26, Jeff Garzik wrote:
JG> Michael Renzmann wrote:
JG> > Hi.
JG> >
JG> > (I cutted down the CC list.)
JG> >
JG> > Jeff Garzik wrote:
JG> >
JG> >> A key goal I have for HostAP is that portions of HostAP code should be
JG> >> bundled into a generic "lib80211" kernel module, for use by various
JG> >> low-level and "softmac" 802.11 device drivers.
JG> >
JG> >
JG> > This sentence made me curious... does that mean the efforts which
JG> > recently have been discussed here (to bring a generic 802.11 stack to
JG> > the kernel) are going to be replaced by the described goal? Or is it an
JG> > addition to Vladimir's work?
JG>
JG> Hopefully Vladmir's work will plug right in..  I hope he's still working
JG> on it!
JG>
JG>  Jeff

I do, but I had some very long interrupt - sometimes I should also do my 
primary job. I'll be back shortly.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 0/12] Host AP update
  2004-11-09  8:04 ` [PATCH wireless-2.6 0/12] Host AP update Jeff Garzik
  2004-11-09  9:09   ` Michael Renzmann
@ 2004-11-14  5:15   ` Jouni Malinen
  1 sibling, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:15 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, Andrew Morton, James Ketrenos

On Tue, Nov 09, 2004 at 03:04:22AM -0500, Jeff Garzik wrote:

> Andrew Morton's "-mm" kernels are essentially a staging area for pushing 
> changes to the upstream kernel.  I pulled the latest wireless-2.6 tree 
> (includes your latest patches #1 - #9) into my netdev-2.6 queue. 
> netdev-2.6, in turn, is automatically pulled by Andrew, into his -mm 
> tree.  It will get wider review and testing here.

Thanks! I'll send couple of more patches to update the driver to Linux
2.6.10-rc1.

> A key goal I have for HostAP is that portions of HostAP code should be 
> bundled into a generic "lib80211" kernel module, for use by various 
> low-level and "softmac" 802.11 device drivers.

Agreed.

> The Intel Centrino driver folks are already using HostAP in this 
> capacity, and I _think_ their changes were fairly minimal and cosmetic. 
>    If the changes are indeed minimal, I think it's better to merge 
> those changes before sending HostAP stuff upstream.

I haven't went through all the changes in Intel driver, but at least
IEEE 802.11g support is going to require quite a bit more work and IEEE
802.11a and Atheros-like hardware even more.

> To emphasize that the upstream-bound HostAP code is a generic library 
> (well, parts of it), I would prefer that the kernel module name, and API 
> prefixes, use some name other than 'hostap_'.  'wifi_' or 'ieee80211_' 
> or whatever, I don't care.  Just something "more generic".
> 
> I would rather perform mass renaming of functions and files before 
> merging upstream.

I can start cleaning up some of the functions and renaming them in the
code. However, I still want to finalize couple of things in my
employment agreement before starting doing more "non-Host AP" things.
I would thus prefer to be able to get current Host AP driver merged
upstream before doing full merge with other drivers (I would add at
least net80211/madwifi to the list with Intel drivers). This would allow
me to maintain stable version of Host AP driver without having to do too
much work with an external CVS repository and start working on
wireless-2.6 for the generic library and merging.

> IMHO the bksend stuff is useless.  I prefer "plain ole patches", like 
> the ones you sent in emails '1/12' through '12/12' in this thread.

OK.

> WRT the patches you sent, as I mentioned, #1 - #9 were applied.  Please 
> update #10 and #11 per comments, and then resend #10 - #12.

I have updated #10 and #11 and added couple of more patches (13..16) to
match with the Linux 2.6.10-rc1 pull into wireless-2.6. I'll re-send
10..12 and send 13..16.

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 10/16] Host AP: Use void __iomem * with {read,write}{b,w}
  2004-11-09  7:29   ` Jeff Garzik
@ 2004-11-14  5:18     ` Jouni Malinen
  2004-11-14 23:49       ` Jeff Garzik
  0 siblings, 1 reply; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:18 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Start using void __iomem * instead of unsigned long with {read,write}{b,w}
to silence compiler warning with Linux 2.6.9-rc2 and newer.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c	2004-11-13 20:55:58 -08:00
+++ b/drivers/net/wireless/hostap/hostap_pci.c	2004-11-13 20:55:58 -08:00
@@ -50,25 +50,25 @@
 
 static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface = netdev_priv(dev);
 	local_info_t *local = iface->local;
 	unsigned long flags;
 
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
-	writeb(v, dev->mem_start + a);
+	writeb(v, local->mem_start + a);
 	spin_unlock_irqrestore(&local->lock, flags);
 }
 
 static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface = netdev_priv(dev);
 	local_info_t *local = iface->local;
 	unsigned long flags;
 	u8 v;
 
 	spin_lock_irqsave(&local->lock, flags);
-	v = readb(dev->mem_start + a);
+	v = readb(local->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
 	spin_unlock_irqrestore(&local->lock, flags);
 	return v;
@@ -76,25 +76,25 @@
 
 static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface = netdev_priv(dev);
 	local_info_t *local = iface->local;
 	unsigned long flags;
 
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
-	writew(v, dev->mem_start + a);
+	writew(v, local->mem_start + a);
 	spin_unlock_irqrestore(&local->lock, flags);
 }
 
 static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface = netdev_priv(dev);
 	local_info_t *local = iface->local;
 	unsigned long flags;
 	u16 v;
 
 	spin_lock_irqsave(&local->lock, flags);
-	v = readw(dev->mem_start + a);
+	v = readw(local->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
 	spin_unlock_irqrestore(&local->lock, flags);
 	return v;
@@ -109,12 +109,40 @@
 
 #else /* PRISM2_IO_DEBUG */
 
-#define HFA384X_OUTB(v,a) writeb((v), dev->mem_start + (a))
-#define HFA384X_INB(a) (u8) readb(dev->mem_start + (a))
-#define HFA384X_OUTW(v,a) writew((v), dev->mem_start + (a))
-#define HFA384X_INW(a) (u16) readw(dev->mem_start + (a))
-#define HFA384X_OUTW_DATA(v,a) writew(cpu_to_le16(v), dev->mem_start + (a))
-#define HFA384X_INW_DATA(a) (u16) le16_to_cpu(readw(dev->mem_start + (a)))
+static inline void hfa384x_outb(struct net_device *dev, int a, u8 v)
+{
+	struct hostap_interface *iface = netdev_priv(dev);
+	local_info_t *local = iface->local;
+	writeb(v, local->mem_start + a);
+}
+
+static inline u8 hfa384x_inb(struct net_device *dev, int a)
+{
+	struct hostap_interface *iface = netdev_priv(dev);
+	local_info_t *local = iface->local;
+	return readb(local->mem_start + a);
+}
+
+static inline void hfa384x_outw(struct net_device *dev, int a, u16 v)
+{
+	struct hostap_interface *iface = netdev_priv(dev);
+	local_info_t *local = iface->local;
+	writew(v, local->mem_start + a);
+}
+
+static inline u16 hfa384x_inw(struct net_device *dev, int a)
+{
+	struct hostap_interface *iface = netdev_priv(dev);
+	local_info_t *local = iface->local;
+	return readw(local->mem_start + a);
+}
+
+#define HFA384X_OUTB(v,a) hfa384x_outb(dev, (a), (v))
+#define HFA384X_INB(a) hfa384x_inb(dev, (a))
+#define HFA384X_OUTW(v,a) hfa384x_outw(dev, (a), (v))
+#define HFA384X_INW(a) hfa384x_inw(dev, (a))
+#define HFA384X_OUTW_DATA(v,a) hfa384x_outw(dev, (a), cpu_to_le16((v)))
+#define HFA384X_INW_DATA(a) (u16) le16_to_cpu(hfa384x_inw(dev, (a)))
 
 #endif /* PRISM2_IO_DEBUG */
 
@@ -232,7 +260,7 @@
 			    const struct pci_device_id *id)
 {
 	unsigned long phymem;
-	unsigned long mem = 0;
+	void __iomem *mem = NULL;
 	local_info_t *local = NULL;
 	struct net_device *dev = NULL;
 	static int cards_found /* = 0 */;
@@ -249,8 +277,8 @@
 		goto err_out_disable;
 	}
 
-	mem = (unsigned long) ioremap(phymem, pci_resource_len(pdev, 0));
-	if (!mem) {
+	mem = ioremap(phymem, pci_resource_len(pdev, 0));
+	if (mem == NULL) {
 		printk(KERN_ERR "prism2: Cannot remap PCI memory region\n") ;
 		goto fail;
 	}
@@ -267,8 +295,7 @@
 	cards_found++;
 
         dev->irq = pdev->irq;
-        dev->mem_start = mem;
-        dev->mem_end = mem + pci_resource_len(pdev, 0);
+        local->mem_start = mem;
 
 	prism2_pci_cor_sreset(local);
 
@@ -297,7 +324,7 @@
 		free_irq(dev->irq, dev);
 
 	if (mem)
-		iounmap((void *) mem);
+		iounmap(mem);
 
 	release_mem_region(phymem, pci_resource_len(pdev, 0));
 
@@ -312,8 +339,8 @@
 static void prism2_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct hostap_interface *iface = dev->priv;
-	unsigned long mem_start;
+	struct hostap_interface *iface = netdev_priv(dev);
+	void __iomem *mem_start;
 
 	/* Reset the hardware, and ensure interrupts are disabled. */
 	prism2_pci_cor_sreset(iface->local);
@@ -322,10 +349,10 @@
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 
-	mem_start = dev->mem_start;
+	mem_start = iface->local->mem_start;
 	prism2_free_local_data(dev);
 
-	iounmap((void *) mem_start);
+	iounmap(mem_start);
 
 	release_mem_region(pci_resource_start(pdev, 0),
 			   pci_resource_len(pdev, 0));
diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:55:58 -08:00
+++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:55:58 -08:00
@@ -247,7 +247,7 @@
 
 	/* Set sreset bit of COR and clear it after hold time */
 
-	if (local->attr_mem == 0) {
+	if (local->attr_mem == NULL) {
 		/* TMD7160 - COR at card's first I/O addr */
 		corsave = inb(local->cor_offset);
 		outb(corsave | COR_SRESET, local->cor_offset);
@@ -271,7 +271,7 @@
 {
 	unsigned char corsave;
 
-	if (local->attr_mem == 0) {
+	if (local->attr_mem == NULL) {
 		/* TMD7160 - COR at card's first I/O addr */
 		corsave = inb(local->cor_offset);
 		outb(corsave | COR_SRESET, local->cor_offset);
@@ -306,7 +306,7 @@
 };
 
 
-static int prism2_plx_check_cis(unsigned long attr_mem, int attr_len,
+static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
 				unsigned int *cor_offset,
 				unsigned int *cor_index)
 {
@@ -401,7 +401,7 @@
 	unsigned int pccard_ioaddr, plx_ioaddr;
 	unsigned long pccard_attr_mem;
 	unsigned int pccard_attr_len;
-	unsigned long attr_mem = 0;
+	void __iomem *attr_mem = NULL;
 	unsigned int cor_offset, cor_index;
 	u32 reg;
 	local_info_t *local = NULL;
@@ -422,7 +422,7 @@
 
 	if (tmd7160) {
 		/* TMD7160 */
-		attr_mem = 0; /* no access to PC Card attribute memory */
+		attr_mem = NULL; /* no access to PC Card attribute memory */
 
 		printk(KERN_INFO "TMD7160 PCI/PCMCIA adapter: io=0x%x, "
 		       "irq=%d, pccard_io=0x%x\n",
@@ -448,9 +448,8 @@
 			goto fail;
 
 
-		attr_mem = (unsigned long) ioremap(pccard_attr_mem,
-						   pccard_attr_len);
-		if (!attr_mem) {
+		attr_mem = ioremap(pccard_attr_mem, pccard_attr_len);
+		if (attr_mem == NULL) {
 			printk(KERN_ERR "%s: cannot remap attr_mem\n",
 			       dev_info);
 			goto fail;
@@ -532,7 +531,7 @@
 		free_irq(dev->irq, dev);
 
 	if (attr_mem)
-		iounmap((void *) attr_mem);
+		iounmap(attr_mem);
 
 	pci_disable_device(pdev);
 
@@ -550,7 +549,7 @@
 	hfa384x_disable_interrupts(dev);
 
 	if (iface->local->attr_mem)
-		iounmap((void *) iface->local->attr_mem);
+		iounmap(iface->local->attr_mem);
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 
diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:55:58 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:55:58 -08:00
@@ -895,11 +895,12 @@
 #endif /* PRISM2_PCCARD */
 
 #ifdef PRISM2_PLX
-	unsigned long attr_mem;
+	void __iomem *attr_mem;
 	unsigned int cor_offset;
 #endif /* PRISM2_PLX */
 
 #ifdef PRISM2_PCI
+	void __iomem *mem_start;
 #ifdef PRISM2_BUS_MASTER
 	/* bus master for BAP0 (TX) */
 	int bus_m0_tx_idx;


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 11/16] Host AP: Fix PRISM2_IO_DEBUG
  2004-11-09  7:29   ` Jeff Garzik
@ 2004-11-14  5:20     ` Jouni Malinen
  0 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:20 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

>From Mark Glines <mark@glines.org>:

I just noticed PRISM2_IO_DEBUG doesn't work.  This patch gets it
working again.  I checked the development CVS snapshot, looks like
its still broken there.

jkm: in addition, fix the other PRISM2_IO_DEBUG function

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:56:09 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:56:09 -08:00
@@ -1004,7 +1004,8 @@
 static inline void prism2_io_debug_add(struct net_device *dev, int cmd,
 				       int reg, int value)
 {
-	local_info_t *local = dev->priv;
+	struct hostap_interface *iface = netdev_priv(dev);
+	local_info_t *local = iface->local;
 
 	if (!local->io_debug_enabled)
 		return;
@@ -1021,7 +1022,8 @@
 
 static inline void prism2_io_debug_error(struct net_device *dev, int err)
 {
-	local_info_t *local = dev->priv;
+	struct hostap_interface *iface = netdev_priv(dev);
+	local_info_t *local = iface->local;
 	unsigned long flags;
 
 	if (!local->io_debug_enabled)


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 12/16] Host AP: Fix netif_carrier_off() in non-client modes
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (12 preceding siblings ...)
  2004-11-09  8:04 ` [PATCH wireless-2.6 0/12] Host AP update Jeff Garzik
@ 2004-11-14  5:21 ` Jouni Malinen
  2004-11-14  5:22 ` [PATCH wireless-2.6 13/16] Host AP: pci_register_driver() return value changes Jouni Malinen
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Connection status is reported properly only in client modes, so do not
try to set netif_carrier_off() in non-client modes. Previously, Master
mode may end up being in state where netif_carrier was left off and
this may break things like bridging.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c	2004-11-13 20:56:17 -08:00
+++ b/drivers/net/wireless/hostap/hostap_hw.c	2004-11-13 20:56:17 -08:00
@@ -3399,8 +3399,11 @@
 					   "", dev_template);
 
 	if (local->ddev) {
-		netif_carrier_off(local->dev);
-		netif_carrier_off(local->ddev);
+		if (local->iw_mode == IW_MODE_INFRA ||
+		    local->iw_mode == IW_MODE_ADHOC) {
+			netif_carrier_off(local->dev);
+			netif_carrier_off(local->ddev);
+		}
 		hostap_init_proc(local);
 		hostap_init_ap_proc(local);
 		return 0;
diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-13 20:56:17 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-13 20:56:17 -08:00
@@ -1108,6 +1108,13 @@
 	if (double_reset && local->func->reset_port(dev))
 		return -EINVAL;
 
+	if (local->iw_mode != IW_MODE_INFRA && local->iw_mode != IW_MODE_ADHOC)
+	{
+		/* netif_carrier is used only in client modes for now, so make
+		 * sure carrier is on when moving to non-client modes. */
+		netif_carrier_on(local->dev);
+		netif_carrier_on(local->ddev);
+	}
 	return 0;
 }
 


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 13/16] Host AP: pci_register_driver() return value changes
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (13 preceding siblings ...)
  2004-11-14  5:21 ` [PATCH wireless-2.6 12/16] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
@ 2004-11-14  5:22 ` Jouni Malinen
  2004-11-14  5:23 ` [PATCH wireless-2.6 14/16] Host AP: Updated to use Linux wireless extensions v17 Jouni Malinen
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:22 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Changed pci_register_driver() calls to match with the new behavior
in Linux 2.6.10-rc1.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c	2004-11-13 20:56:25 -08:00
+++ b/drivers/net/wireless/hostap/hostap_pci.c	2004-11-13 20:56:25 -08:00
@@ -414,14 +414,7 @@
 {
 	printk(KERN_INFO "%s: %s\n", dev_info, version);
 
-	if (pci_register_driver(&prism2_pci_drv_id) <= 0) {
-		printk("hostap_pci: No devices found, driver not "
-		       "installed.\n");
-		pci_unregister_driver(&prism2_pci_drv_id);
-		return -ENODEV;
-	}
-
-	return 0;
+	return pci_register_driver(&prism2_pci_drv_id);
 }
 
 
diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:56:25 -08:00
+++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:56:25 -08:00
@@ -575,14 +575,7 @@
 {
 	printk(KERN_INFO "%s: %s\n", dev_info, version);
 
-	if (pci_register_driver(&prism2_plx_drv_id) <= 0) {
-		printk("hostap_plx: No devices found, driver not "
-		       "installed.\n");
-		pci_unregister_driver(&prism2_plx_drv_id);
-		return -ENODEV;
-	}
-
-	return 0;
+	return pci_register_driver(&prism2_plx_drv_id);
 }
 
 

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 14/16] Host AP: Updated to use Linux wireless extensions v17
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (14 preceding siblings ...)
  2004-11-14  5:22 ` [PATCH wireless-2.6 13/16] Host AP: pci_register_driver() return value changes Jouni Malinen
@ 2004-11-14  5:23 ` Jouni Malinen
  2004-11-14  5:24 ` [PATCH wireless-2.6 15/16] Host AP: Replaced direct dev->priv references with netdev_priv(dev) Jouni Malinen
  2004-11-14  5:25 ` [PATCH wireless-2.6 16/16] Host AP: Replaced MODULE_PARM with module_param* Jouni Malinen
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:23 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Patch from Jean Tourrilhes <jt@hpl.hp.com>:

HostAP WE-17 support:
- allow large scan requests
- export event capability
- new spy data handling

jkm: removed support for old WE versions (ifdefs)

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap.c b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c	2004-11-13 20:56:35 -08:00
+++ b/drivers/net/wireless/hostap/hostap.c	2004-11-13 20:56:35 -08:00
@@ -890,8 +890,12 @@
 
 	/* kernel callbacks */
 	dev->get_stats = hostap_get_stats;
-	if (main_dev || (iface && iface->type == HOSTAP_INTERFACE_MAIN))
-		dev->get_wireless_stats =  hostap_get_wireless_stats;
+	if (iface) {
+		/* Currently, we point to the proper spy_data only on
+		 * the main_dev. This could be fixed. Jean II */
+		iface->wireless_data.spy_data = &iface->spy_data;
+		dev->wireless_data = &iface->wireless_data;
+	}
 	dev->wireless_handlers =
 		(struct iw_handler_def *) &hostap_iw_handler_def;
 	dev->do_ioctl = hostap_ioctl;
diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-13 20:56:35 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-13 20:56:35 -08:00
@@ -13,6 +13,10 @@
 	local_info_t *local = iface->local;
 	struct iw_statistics *wstats;
 
+	/* Why are we doing that ? Jean II */
+	if (iface->type != HOSTAP_INTERFACE_MAIN)
+		return NULL;
+
 	wstats = &local->wstats;
 
 	wstats->status = 0;
@@ -989,6 +993,17 @@
 	range->min_frag = 256;
 	range->max_frag = 2346;
 
+	/* Event capability (kernel + driver) */
+	range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
+				IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) |
+				IW_EVENT_CAPA_MASK(SIOCGIWAP) |
+				IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
+	range->event_capa[1] = IW_EVENT_CAPA_K_1;
+	range->event_capa[4] = (IW_EVENT_CAPA_MASK(IWEVTXDROP) |
+				IW_EVENT_CAPA_MASK(IWEVCUSTOM) |
+				IW_EVENT_CAPA_MASK(IWEVREGISTERED) |
+				IW_EVENT_CAPA_MASK(IWEVEXPIRED));
+
 	return 0;
 }
 
@@ -1818,13 +1833,14 @@
 
 /* Translate scan data returned from the card to a card independant
  * format that the Wireless Tools will understand - Jean II */
-static inline int prism2_translate_scan(local_info_t *local, char *buffer)
+static inline int prism2_translate_scan(local_info_t *local,
+					char *buffer, int buflen)
 {
 	struct hfa384x_scan_result *scan;
 	struct hfa384x_hostscan_result *hscan;
 	int entries, entry, hostscan;
 	char *current_ev = buffer;
-	char *end_buf = buffer + IW_SCAN_MAX_DATA;
+	char *end_buf = buffer + buflen;
 	u8 *bssid;
 	struct list_head *ptr;
 
@@ -1858,6 +1874,12 @@
 				local, scan, hscan, hostscan, NULL, bssid,
 				current_ev, end_buf);
 		}
+		/* Check if there is space for one more entry */
+		if ((end_buf - current_ev) <= IW_EV_ADDR_LEN) {
+			/* Ask user space to try again with a bigger buffer */
+			spin_unlock_bh(&local->lock);
+			return -E2BIG;
+		}
 	}
 
 	spin_unlock_bh(&local->lock);
@@ -1894,7 +1916,7 @@
 	}
 	local->scan_timestamp = 0;
 
-	res = prism2_translate_scan(local, extra);
+	res = prism2_translate_scan(local, extra, data->length);
 
 	if (res >= 0) {
 		data->length = res;
@@ -3372,7 +3394,7 @@
 	.standard	= (iw_handler *) prism2_handler,
 	.private	= (iw_handler *) prism2_private_handler,
 	.private_args	= (struct iw_priv_args *) prism2_priv,
-	.spy_offset	= offsetof(struct hostap_interface, spy_data),
+	.get_wireless_stats = hostap_get_wireless_stats,
 };
 
 
diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:56:35 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:56:35 -08:00
@@ -924,12 +924,8 @@
 	struct net_device *dev; /* pointer to this device */
 	struct local_info *local; /* pointer to shared private data */
 	struct net_device_stats stats;
-	/* Note: this data area must be at a fixed offset from dev->priv.
-	 * Unfortunately, this model does not fit the current Host AP netdev
-	 * data structure because this should really be in local_into_t that is
-	 * shared by all virtual interfaces. Currently, only the main data
-	 * device (wlan#) is used for iwspy entries. */
 	struct iw_spy_data spy_data; /* iwspy support */
+	struct iw_public_data wireless_data;
 
 	enum {
 		HOSTAP_INTERFACE_MASTER,


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 15/16] Host AP: Replaced direct dev->priv references with netdev_priv(dev).
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (15 preceding siblings ...)
  2004-11-14  5:23 ` [PATCH wireless-2.6 14/16] Host AP: Updated to use Linux wireless extensions v17 Jouni Malinen
@ 2004-11-14  5:24 ` Jouni Malinen
  2004-11-14  5:25 ` [PATCH wireless-2.6 16/16] Host AP: Replaced MODULE_PARM with module_param* Jouni Malinen
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:24 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap.c b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap.c	2004-11-13 20:56:44 -08:00
@@ -117,7 +117,7 @@
 	if (dev == NULL)
 		return NULL;
 
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	iface->dev = dev;
 	iface->local = local;
 	iface->type = type;
@@ -169,7 +169,7 @@
 	if (!dev)
 		return;
 
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 
 	if (remove_from_list) {
 		list_del(&iface->list);
@@ -254,7 +254,7 @@
 	if (dev == NULL)
 		return -ENOMEM;
 
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	memcpy(iface->u.wds.remote_addr, remote_addr, ETH_ALEN);
 
 	local->wds_connections++;
@@ -351,18 +351,20 @@
 /* val is in host byte order */
 int hostap_set_word(struct net_device *dev, int rid, u16 val)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface;
 	u16 tmp = cpu_to_le16(val);
+	iface = netdev_priv(dev);
 	return iface->local->func->set_rid(dev, rid, &tmp, 2);
 }
 
 
 int hostap_set_string(struct net_device *dev, int rid, const char *val)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface;
 	char buf[MAX_SSID_LEN + 2];
 	int len;
 
+	iface = netdev_priv(dev);
 	len = strlen(val);
 	if (len > MAX_SSID_LEN)
 		return -1;
@@ -692,18 +694,22 @@
 
 struct net_device_stats *hostap_get_stats(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface;
+	iface = netdev_priv(dev);
 	return &iface->stats;
 }
 
 
 static int prism2_close(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 
 	PDEBUG(DEBUG_FLOW, "%s: prism2_close\n", dev->name);
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (dev == local->ddev) {
 		prism2_sta_deauth(local, WLAN_REASON_DEAUTH_LEAVING);
 	}
@@ -746,11 +752,14 @@
 
 static int prism2_open(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 
 	PDEBUG(DEBUG_FLOW, "%s: prism2_open\n", dev->name);
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->no_pri) {
 		printk(KERN_DEBUG "%s: could not set interface UP - no PRI "
 		       "f/w\n", dev->name);
@@ -794,11 +803,14 @@
 
 static int prism2_set_mac_address(struct net_device *dev, void *p)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct list_head *ptr;
 	struct sockaddr *addr = p;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->set_rid(dev, HFA384X_RID_CNFOWNMACADDR, addr->sa_data,
 				 ETH_ALEN) < 0 || local->func->reset_port(dev))
 		return -EINVAL;
@@ -820,9 +832,11 @@
 void hostap_set_multicast_list_queue(void *data)
 {
 	struct net_device *dev = (struct net_device *) data;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE,
 			    local->is_promisc)) {
 		printk(KERN_INFO "%s: %sabling promiscuous mode failed\n",
@@ -838,9 +852,11 @@
 	 * some station firmware versions (FCSErr frames, invalid MACPort, etc.
 	 * corrupted incoming frames). This code is now commented out while the
 	 * problems are investigated. */
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	if ((dev->flags & IFF_ALLMULTI) || (dev->flags & IFF_PROMISC)) {
 		local->is_promisc = 1;
 	} else {
@@ -864,10 +880,13 @@
 
 static void prism2_tx_timeout(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hfa384x_regs regs;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	printk(KERN_WARNING "%s Tx timed out! Resetting card\n", dev->name);
 	netif_stop_queue(local->dev);
 
@@ -884,8 +903,9 @@
 void hostap_setup_dev(struct net_device *dev, local_info_t *local,
 		      int main_dev)
 {
-	struct hostap_interface *iface = dev->priv;
+	struct hostap_interface *iface;
 
+	iface = netdev_priv(dev);
 	ether_setup(dev);
 
 	/* kernel callbacks */
@@ -1039,11 +1059,13 @@
 
 int prism2_update_comms_qual(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret = 0;
 	struct hfa384x_comms_quality sq;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	if (!local->sta_fw_ver)
 		ret = -1;
 	else if (local->sta_fw_ver >= PRISM2_FW_VER(1,3,1)) {
@@ -1099,7 +1121,7 @@
 	meta = (struct hostap_skb_tx_data *) skb->cb;
 	memset(meta, 0, sizeof(*meta));
 	meta->magic = HOSTAP_SKB_TX_DATA_MAGIC;
-	meta->iface = dev->priv;
+	meta->iface = netdev_priv(dev);
 
 	skb->dev = dev;
 	skb->mac.raw = skb->nh.raw = skb->data;
diff -Nru a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c	2004-11-13 20:56:44 -08:00
@@ -46,13 +46,15 @@
 int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
 		    struct hostap_80211_rx_status *rx_stats, int type)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int hdrlen, phdrlen, head_need, tail_need;
 	u16 fc;
 	int prism_header, ret;
 	struct hostap_ieee80211_hdr *hdr;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	dev->last_rx = jiffies;
 
 	if (dev->type == ARPHRD_IEEE80211_PRISM) {
@@ -677,8 +679,8 @@
 void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 		     struct hostap_80211_rx_status *rx_stats)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hostap_ieee80211_hdr *hdr;
 	size_t hdrlen;
 	u16 fc, type, stype, sc;
@@ -696,13 +698,15 @@
 	void *sta = NULL;
 	int keyidx = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	iface->stats.rx_packets++;
 	iface->stats.rx_bytes += skb->len;
 
 	/* dev is the master radio device; change this to be the default
 	 * virtual interface (this may be changed to WDS device below) */
 	dev = local->ddev;
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 
 	hdr = (struct hostap_ieee80211_hdr *) skb->data;
 	stats = hostap_get_stats(dev);
diff -Nru a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c	2004-11-13 20:56:44 -08:00
@@ -38,8 +38,8 @@
  * device configuration. */
 int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int need_headroom, need_tailroom = 0;
 	struct hostap_ieee80211_hdr hdr;
 	u16 fc, ethertype = 0;
@@ -51,6 +51,9 @@
 	int to_assoc_ap = 0;
 	struct hostap_skb_tx_data *meta;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (skb->len < ETH_HLEN) {
 		printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb "
 		       "(len=%d)\n", dev->name, skb->len);
@@ -237,12 +240,15 @@
 /* hard_start_xmit function for hostapd wlan#ap interfaces */
 int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hostap_skb_tx_data *meta;
 	struct hostap_ieee80211_hdr *hdr;
 	u16 fc;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (skb->len < 10) {
 		printk(KERN_DEBUG "%s: hostap_mgmt_start_xmit: short skb "
 		       "(len=%d)\n", dev->name, skb->len);
@@ -280,12 +286,15 @@
 struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
 				   struct prism2_crypt_data *crypt)
 {
-	struct hostap_interface *iface = skb->dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hostap_ieee80211_hdr *hdr;
 	u16 fc;
 	int hdr_len, res;
 
+	iface = netdev_priv(skb->dev);
+	local = iface->local;
+
 	if (skb->len < IEEE80211_DATA_HDR3_LEN) {
 		kfree_skb(skb);
 		return NULL;
@@ -342,8 +351,8 @@
  * Use hardware TX function to send the frame. */
 int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret = 1;
 	u16 fc;
 	struct hostap_tx_data tx;
@@ -351,6 +360,9 @@
 	struct hostap_skb_tx_data *meta;
 	int no_encrypt = 0;
 	struct hostap_ieee80211_hdr *hdr;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	tx.skb = skb;
 	tx.sta_ptr = NULL;
diff -Nru a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.c	2004-11-13 20:56:44 -08:00
@@ -915,16 +915,18 @@
 			     int type, int subtype, char *body,
 			     int body_len, u8 *addr, u16 tx_cb_idx)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hostap_ieee80211_hdr *hdr;
 	u16 fc;
 	struct sk_buff *skb;
 	struct hostap_skb_tx_data *meta;
 	int hdrlen;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	dev = local->dev; /* always use master radio device */
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 
 	if (!(dev->flags & IFF_UP)) {
 		PDEBUG(DEBUG_AP, "%s: prism2_send_mgmt - device is not UP - "
@@ -2252,11 +2254,14 @@
 void hostap_rx(struct net_device *dev, struct sk_buff *skb,
 	       struct hostap_80211_rx_status *rx_stats)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 fc;
 	struct hostap_ieee80211_hdr *hdr;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (skb->len < 16)
 		goto drop;
 
@@ -2359,9 +2364,9 @@
  * format that the Wireless Tools will understand - Jean II */
 static int prism2_ap_translate_scan(struct net_device *dev, char *buffer)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
-	struct ap_data *ap = local->ap;
+	struct hostap_interface *iface;
+	local_info_t *local;
+	struct ap_data *ap;
 	struct list_head *ptr;
 	struct iw_event iwe;
 	char *current_ev = buffer;
@@ -2370,6 +2375,10 @@
 	char buf[64];
 #endif
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+	ap = local->ap;
+
 	spin_lock_bh(&ap->sta_table_lock);
 
 	for (ptr = ap->sta_list.next; ptr != NULL && ptr != &ap->sta_list;
@@ -2601,8 +2610,11 @@
 static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
 {
 	int ret = sta->tx_rate;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	sta->tx_count[sta->tx_rate_idx]++;
 	sta->tx_since_last_failure++;
diff -Nru a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_cs.c	2004-11-13 20:56:44 -08:00
@@ -51,10 +51,12 @@
 
 static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
 	outb(v, dev->base_addr + a);
@@ -63,11 +65,13 @@
 
 static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 	u8 v;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	spin_lock_irqsave(&local->lock, flags);
 	v = inb(dev->base_addr + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
@@ -77,10 +81,12 @@
 
 static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
 	outw(v, dev->base_addr + a);
@@ -89,11 +95,13 @@
 
 static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 	u16 v;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	spin_lock_irqsave(&local->lock, flags);
 	v = inw(dev->base_addr + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
@@ -104,10 +112,12 @@
 static inline void hfa384x_outsw_debug(struct net_device *dev, int a,
 				       u8 *buf, int wc)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTSW, a, wc);
 	outsw(dev->base_addr + a, buf, wc);
@@ -117,10 +127,12 @@
 static inline void hfa384x_insw_debug(struct net_device *dev, int a,
 				      u8 *buf, int wc)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INSW, a, wc);
 	insw(dev->base_addr + a, buf, wc);
@@ -623,7 +635,7 @@
 	link->state |= DEV_CONFIG;
 	link->state &= ~DEV_CONFIG_PENDING;
 
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	local = iface->local;
 	local->link = link;
 	strcpy(local->node.dev_name, dev->name);
@@ -656,7 +668,9 @@
 
 	if (link->priv) {
 		struct net_device *dev = link->priv;
-		struct hostap_interface *iface = dev->priv;
+		struct hostap_interface *iface;
+
+		iface = netdev_priv(dev);
 		if (link->state & DEV_CONFIG)
 			prism2_hw_shutdown(dev, 0);
 		iface->local->shutdown = 1;
diff -Nru a/drivers/net/wireless/hostap/hostap_download.c b/drivers/net/wireless/hostap/hostap_download.c
--- a/drivers/net/wireless/hostap/hostap_download.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_download.c	2004-11-13 20:56:44 -08:00
@@ -3,8 +3,11 @@
 	u16 val, reg;
 	int i, tries;
 	unsigned long flags;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	if (local->no_pri) {
 		if (enable) {
diff -Nru a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_hw.c	2004-11-13 20:56:44 -08:00
@@ -274,12 +274,15 @@
 static inline int hfa384x_cmd_issue(struct net_device *dev,
 				    struct hostap_cmd_queue *entry)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int tries;
 	u16 reg;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->card_present && !local->func->card_present(local))
 		return -ENODEV;
 
@@ -338,13 +341,16 @@
 static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
 		       u16 *param1, u16 *resp0)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int err, res, issue, issued = 0;
 	unsigned long flags;
 	struct hostap_cmd_queue *entry;
 	DECLARE_WAITQUEUE(wait, current);
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (in_interrupt()) {
 		printk(KERN_DEBUG "%s: hfa384x_cmd called from interrupt "
 		       "context\n", dev->name);
@@ -515,12 +521,15 @@
 						 u16 status),
 				void *context)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int issue, ret;
 	unsigned long flags;
 	struct hostap_cmd_queue *entry;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->cmd_queue_len >= HOSTAP_CMD_QUEUE_MAX_LEN + 2) {
 		printk(KERN_DEBUG "%s: hfa384x_cmd: cmd_queue full\n",
 		       dev->name);
@@ -674,10 +683,13 @@
  */
 static void prism2_cmd_ev(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hostap_cmd_queue *entry = NULL;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock(&local->cmdlock);
 	if (!list_empty(&local->cmd_queue)) {
 		entry = list_entry(local->cmd_queue.next,
@@ -817,11 +829,14 @@
 static int hfa384x_get_rid(struct net_device *dev, u16 rid, void *buf, int len,
 			   int exact_len)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int res, rlen = 0;
 	struct hfa384x_rid_hdr rec;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->no_pri) {
 		printk(KERN_DEBUG "%s: cannot get RID %04x (len=%d) - no PRI "
 		       "f/w\n", dev->name, rid, len);
@@ -887,11 +902,14 @@
 
 static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hfa384x_rid_hdr rec;
 	int res;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->no_pri) {
 		printk(KERN_DEBUG "%s: cannot set RID %04x (len=%d) - no PRI "
 		       "f/w\n", dev->name, rid, len);
@@ -1009,10 +1027,13 @@
 
 static int prism2_reset_port(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int res;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (!local->dev_enabled)
 		return 0;
 
@@ -1048,8 +1069,11 @@
 				   const char *txt)
 {
 	struct hfa384x_comp_ident comp;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	if (local->no_pri) {
 		/* PRI f/w not yet available - cannot read RIDs */
@@ -1069,11 +1093,14 @@
 
 static int prism2_setup_rids(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 tmp;
 	int ret = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	hostap_set_word(dev, HFA384X_RID_TICKTIME, 2000);
 
 	if (!local->fw_ap) {
@@ -1288,13 +1315,16 @@
 
 static int prism2_hw_init(struct net_device *dev, int initial)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret, first = 1;
 	unsigned long start, delay;
 
 	PDEBUG(DEBUG_FLOW, "prism2_hw_init()\n");
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	clear_bit(HOSTAP_BITS_TRANSMIT, &local->bits);
 
  init:
@@ -1341,10 +1371,13 @@
 
 static int prism2_hw_init2(struct net_device *dev, int initial)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int i;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 #ifdef PRISM2_DOWNLOAD_SUPPORT
 	kfree(local->pda);
 	if (local->no_pri)
@@ -1436,9 +1469,13 @@
 
 static int prism2_hw_enable(struct net_device *dev, int initial)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
-	int was_resetting = local->hw_resetting;
+	struct hostap_interface *iface;
+	local_info_t *local;
+	int was_resetting;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
+	was_resetting = local->hw_resetting;
 
 	if (hfa384x_cmd(dev, HFA384X_CMDCODE_ENABLE, 0, NULL, NULL)) {
 		printk("%s: MAC port 0 enabling failed\n", dev->name);
@@ -1471,8 +1508,12 @@
 
 static int prism2_hw_config(struct net_device *dev, int initial)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->hw_downloading)
 		return 1;
 
@@ -1499,8 +1540,11 @@
 
 static void prism2_hw_shutdown(struct net_device *dev, int no_disable)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	/* Allow only command completion events during disable */
 	hfa384x_events_only_cmd(dev);
@@ -1531,8 +1575,8 @@
 
 static void prism2_hw_reset(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 
 #if 0
 	static long last_reset = 0;
@@ -1544,6 +1588,9 @@
 	last_reset = jiffies;
 #endif
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (in_interrupt()) {
 		printk(KERN_DEBUG "%s: driver bug - prism2_hw_reset() called "
 		       "in interrupt context\n", dev->name);
@@ -1666,10 +1713,13 @@
 static void prism2_transmit_cb(struct net_device *dev, void *context,
 			       u16 resp0, u16 res)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int idx = (int) context;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (res) {
 		printk(KERN_DEBUG "%s: prism2_transmit_cb - res=0x%02x\n",
 		       dev->name, res);
@@ -1730,10 +1780,13 @@
  * this can be called both from software and hardware IRQ) */
 static int prism2_transmit(struct net_device *dev, int idx)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int res;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	/* The driver tries to stop netif queue so that there would not be
 	 * more than one attempt to transmit frames going on; check that this
 	 * is really the case */
@@ -1778,11 +1831,14 @@
 static void prism2_tx_cb(struct net_device *dev, void *context,
 			 u16 resp0, u16 res)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long addr;
 	int buf_len = (int) context;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (res) {
 		printk(KERN_DEBUG "%s: prism2_tx_cb - res=0x%02x\n",
 		       dev->name, res);
@@ -1803,14 +1859,17 @@
 /* Called only from software IRQ */
 static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hfa384x_tx_frame txdesc;
 	struct hostap_ieee80211_hdr *hdr;
 	struct hostap_skb_tx_data *meta;
 	int hdr_len, data_len, idx, res, ret = -1;
 	u16 tx_control, fc;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	meta = (struct hostap_skb_tx_data *) skb->cb;
 	hdr = (struct hostap_ieee80211_hdr *) skb->data;
 
@@ -2179,11 +2238,14 @@
 /* Called only from hardware IRQ */
 static void prism2_alloc_ev(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int idx;
 	u16 fid;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	fid = prism2_read_fid_reg(dev, HFA384X_ALLOCFID_OFF);
 
 	PDEBUG(DEBUG_FID, "FID: interrupt: ALLOC - fid=0x%04x\n", fid);
@@ -2595,8 +2657,12 @@
 /* Called only from hardware IRQ */
 static void prism2_bus_master_ev(struct net_device *dev, int bap)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (bap == BAP1) {
 		/* FIX: frame payload was DMA'd to skb->data; might need to
 		 * invalidate data cache for that memory area */
@@ -2640,11 +2706,14 @@
 /* Called only from hardware IRQ */
 static void prism2_ev_tick(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 evstat, inten;
 	static int prev_stuck = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (time_after(jiffies, local->last_tick_timer + 5 * HZ) &&
 	    local->last_tick_timer) {
 		evstat = HFA384X_INW(HFA384X_EVSTAT_OFF);
@@ -2710,11 +2779,14 @@
 static irqreturn_t prism2_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int events = 0;
 	u16 ev;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INTERRUPT, 0, 0);
 
 	if (local->func->card_present && !local->func->card_present(local)) {
@@ -3104,8 +3176,11 @@
 {
 	struct list_head *ptr;
 	struct set_tim_data *new_entry;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	new_entry = (struct set_tim_data *)
 		kmalloc(sizeof(*new_entry), GFP_ATOMIC);
@@ -3216,7 +3291,7 @@
 	if (dev == NULL)
 		return NULL;
 
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	local = (struct local_info *) ((((long) (iface + 1)) + 3) & ~3);
 	local->ap = (struct ap_data *) ((((long) (local + 1)) + 3) & ~3);
 	local->dev = iface->dev = dev;
@@ -3392,9 +3467,11 @@
 
 static int hostap_hw_ready(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	struct local_info *local = iface->local;
+	struct hostap_interface *iface;
+	struct local_info *local;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
 	local->ddev = hostap_add_interface(local, HOSTAP_INTERFACE_MAIN, 0,
 					   "", dev_template);
 
@@ -3424,7 +3501,7 @@
 	if (dev == NULL)
 		return;
 
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	local = iface->local;
 
 	flush_scheduled_work();
diff -Nru a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c	2004-11-13 20:56:44 -08:00
@@ -9,10 +9,13 @@
 
 static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct iw_statistics *wstats;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	/* Why are we doing that ? Jean II */
 	if (iface->type != HOSTAP_INTERFACE_MAIN)
 		return NULL;
@@ -65,12 +68,15 @@
 
 static int prism2_get_datarates(struct net_device *dev, u8 *rates)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u8 buf[12];
 	int len;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	len = local->func->get_rid(dev, HFA384X_RID_SUPPORTEDDATARATES, buf,
 				   sizeof(buf), 0);
 	if (len < 2)
@@ -138,11 +144,14 @@
 				  struct iw_request_info *info,
 				  struct iw_point *erq, char *keybuf)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int i;
 	struct prism2_crypt_data **crypt;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	i = erq->flags & IW_ENCODE_INDEX;
 	if (i < 1 || i > 4)
 		i = local->tx_keyidx;
@@ -238,12 +247,15 @@
 				  struct iw_request_info *info,
 				  struct iw_point *erq, char *key)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int i, len;
 	u16 val;
 	struct prism2_crypt_data *crypt;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	i = erq->flags & IW_ENCODE_INDEX;
 	if (i < 1 || i > 4)
 		i = local->tx_keyidx;
@@ -295,10 +307,13 @@
 
 static int hostap_set_rate(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret, basic_rates;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	basic_rates = local->basic_rates & local->tx_rate_control;
 	if (!basic_rates || basic_rates != local->basic_rates) {
 		printk(KERN_INFO "%s: updating basic rate set automatically "
@@ -338,8 +353,11 @@
 				struct iw_request_info *info,
 				struct iw_param *rrq, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	if (rrq->fixed) {
 		switch (rrq->value) {
@@ -396,10 +414,13 @@
 				struct iw_param *rrq, char *extra)
 {
 	u16 val;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->get_rid(dev, HFA384X_RID_TXRATECONTROL, &val, 2, 1) <
 	    0)
 		return -EINVAL;
@@ -451,8 +472,11 @@
 				struct iw_request_info *info,
 				struct iw_param *sens, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	/* Set the desired AP density */
 	if (sens->value < 1 || sens->value > 3)
@@ -469,10 +493,13 @@
 				struct iw_request_info *info,
 				struct iw_param *sens, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	/* Get the current AP density */
 	if (local->func->get_rid(dev, HFA384X_RID_CNFSYSTEMSCALE, &val, 2, 1) <
 	    0)
@@ -490,11 +517,14 @@
 				  struct iw_request_info *info,
 				  struct iw_point *data, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct sockaddr addr[IW_MAX_AP];
 	struct iw_quality qual[IW_MAX_AP];
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->iw_mode != IW_MODE_MASTER) {
 		printk(KERN_DEBUG "SIOCGIWAPLIST is currently only supported "
 		       "in Host AP mode\n");
@@ -517,10 +547,13 @@
 			       struct iw_request_info *info,
 			       struct iw_param *rts, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (rts->disabled)
 		val = __constant_cpu_to_le16(2347);
 	else if (rts->value < 0 || rts->value > 2347)
@@ -541,10 +574,13 @@
 			       struct iw_request_info *info,
 			       struct iw_param *rts, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->get_rid(dev, HFA384X_RID_RTSTHRESHOLD, &val, 2, 1) <
 	    0)
 		return -EINVAL;
@@ -561,10 +597,13 @@
 				struct iw_request_info *info,
 				struct iw_param *rts, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (rts->disabled)
 		val = __constant_cpu_to_le16(2346);
 	else if (rts->value < 256 || rts->value > 2346)
@@ -585,10 +624,13 @@
 				struct iw_request_info *info,
 				struct iw_param *rts, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->get_rid(dev, HFA384X_RID_FRAGMENTATIONTHRESHOLD,
 				 &val, 2, 1) < 0)
 		return -EINVAL;
@@ -604,13 +646,16 @@
 #ifndef PRISM2_NO_STATION_MODES
 static int hostap_join_ap(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hfa384x_join_request req;
 	unsigned long flags;
 	int i;
 	struct hfa384x_scan_result *entry;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	memcpy(req.bssid, local->preferred_ap, ETH_ALEN);
 	req.channel = 0;
 
@@ -649,8 +694,11 @@
 #ifdef PRISM2_NO_STATION_MODES
 	return -EOPNOTSUPP;
 #else /* PRISM2_NO_STATION_MODES */
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	memcpy(local->preferred_ap, &ap_addr->sa_data, ETH_ALEN);
 
@@ -683,8 +731,11 @@
 			      struct iw_request_info *info,
 			      struct sockaddr *ap_addr, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	ap_addr->sa_family = ARPHRD_ETHER;
 	switch (iface->type) {
@@ -716,8 +767,11 @@
 				 struct iw_request_info *info,
 				 struct iw_point *data, char *nickname)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	memset(local->name, 0, sizeof(local->name));
 	memcpy(local->name, nickname, data->length);
@@ -734,12 +788,15 @@
 				 struct iw_request_info *info,
 				 struct iw_point *data, char *nickname)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int len;
 	char name[MAX_NAME_LEN + 3];
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	len = local->func->get_rid(dev, HFA384X_RID_CNFOWNNAME,
 				   &name, MAX_NAME_LEN + 2, 0);
 	val = __le16_to_cpu(*(u16 *) name);
@@ -758,8 +815,11 @@
 				struct iw_request_info *info,
 				struct iw_freq *freq, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	/* freq => chan. */
 	if (freq->e == 1 &&
@@ -792,10 +852,13 @@
 				struct iw_request_info *info,
 				struct iw_freq *freq, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->get_rid(dev, HFA384X_RID_CURRENTCHANNEL, &val, 2, 1) <
 	    0)
 		return -EINVAL;
@@ -834,8 +897,11 @@
 				 struct iw_request_info *info,
 				 struct iw_point *data, char *ssid)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	if (iface->type == HOSTAP_INTERFACE_WDS)
 		return -EOPNOTSUPP;
@@ -867,10 +933,13 @@
 				 struct iw_request_info *info,
 				 struct iw_point *data, char *essid)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (iface->type == HOSTAP_INTERFACE_WDS)
 		return -EOPNOTSUPP;
 
@@ -900,13 +969,16 @@
 				 struct iw_request_info *info,
 				 struct iw_point *data, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct iw_range *range = (struct iw_range *) extra;
 	u8 rates[10];
 	u16 val;
 	int i, len, over2;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	data->length = sizeof(struct iw_range);
 	memset(range, 0, sizeof(struct iw_range));
 
@@ -1066,10 +1138,13 @@
 				struct iw_request_info *info,
 				__u32 *mode, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int double_reset = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (*mode != IW_MODE_ADHOC && *mode != IW_MODE_INFRA &&
 	    *mode != IW_MODE_MASTER && *mode != IW_MODE_REPEAT &&
 	    *mode != IW_MODE_MONITOR)
@@ -1138,8 +1213,11 @@
 				struct iw_request_info *info,
 				__u32 *mode, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	switch (iface->type) {
 	case HOSTAP_INTERFACE_STA:
@@ -1222,10 +1300,13 @@
 #ifdef PRISM2_NO_STATION_MODES
 	return -EOPNOTSUPP;
 #else /* PRISM2_NO_STATION_MODES */
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 enable, mcast;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->get_rid(dev, HFA384X_RID_CNFPMENABLED, &enable, 2, 1)
 	    < 0)
 		return -EINVAL;
@@ -1274,8 +1355,11 @@
 				 struct iw_request_info *info,
 				 struct iw_param *rrq, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	if (rrq->disabled)
 		return -EINVAL;
@@ -1332,10 +1416,13 @@
 				 struct iw_request_info *info,
 				 struct iw_param *rrq, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 shortretry, longretry, lifetime, altretry;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->get_rid(dev, HFA384X_RID_SHORTRETRYLIMIT, &shortretry,
 				 2, 1) < 0 ||
 	    local->func->get_rid(dev, HFA384X_RID_LONGRETRYLIMIT, &longretry,
@@ -1427,14 +1514,17 @@
 				 struct iw_request_info *info,
 				 struct iw_param *rrq, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 #ifdef RAW_TXPOWER_SETTING
 	char *tmp;
 #endif
 	u16 val;
 	int ret = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (rrq->disabled) {
 		if (local->txpower_type != PRISM2_TXPOWER_OFF) {
 			val = 0xff; /* use all standby and sleep modes */
@@ -1506,10 +1596,13 @@
 				 struct iw_param *rrq, char *extra)
 {
 #ifdef RAW_TXPOWER_SETTING
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 resp0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	rrq->flags = IW_TXPOW_DBM;
 	rrq->disabled = 0;
 	rrq->fixed = 0;
@@ -1548,10 +1641,13 @@
 static int prism2_request_hostscan(struct net_device *dev,
 				   u8 *ssid, u8 ssid_len)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hfa384x_hostscan_request scan_req;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	memset(&scan_req, 0, sizeof(scan_req));
 	scan_req.channel_list = __constant_cpu_to_le16(local->channel_mask);
 	scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS);
@@ -1573,11 +1669,14 @@
 
 static int prism2_request_scan(struct net_device *dev)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	struct hfa384x_scan_request scan_req;
 	int ret = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	memset(&scan_req, 0, sizeof(scan_req));
 	scan_req.channel_list = __constant_cpu_to_le16(local->channel_mask);
 	scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS);
@@ -1629,10 +1728,13 @@
 				struct iw_request_info *info,
 				struct iw_point *data, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->iw_mode == IW_MODE_MASTER) {
 		/* In master mode, we just return the results of our local
 		 * tables, so we don't need to start anything...
@@ -1896,10 +1998,13 @@
 #ifdef PRISM2_NO_STATION_MODES
 	return -EOPNOTSUPP;
 #else /* PRISM2_NO_STATION_MODES */
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int res;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	/* Wait until the scan is finished. We can probably do better
 	 * than that - Jean II */
 	if (local->scan_timestamp &&
@@ -1933,10 +2038,13 @@
 				struct iw_request_info *info,
 				struct iw_point *data, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int res;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->iw_mode == IW_MODE_MASTER) {
 		/* In MASTER mode, it doesn't make sense to go around
 		 * scanning the frequencies and make the stations we serve
@@ -2163,8 +2271,11 @@
 
 static int prism2_ioctl_priv_inquire(struct net_device *dev, int *i)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	if (local->func->cmd(dev, HFA384X_CMDCODE_INQUIRE, *i, NULL, NULL))
 		return -EOPNOTSUPP;
@@ -2177,14 +2288,17 @@
 					  struct iw_request_info *info,
 					  void *wrqu, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int *i = (int *) extra;
 	int param = *i;
 	int value = *(i + 1);
 	int ret = 0;
 	u16 val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	switch (param) {
 	case PRISM2_PARAM_TXRATECTRL:
 		local->fw_tx_rate_control = value;
@@ -2528,11 +2642,14 @@
 					      struct iw_request_info *info,
 					      void *wrqu, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int *param = (int *) extra;
 	int ret = 0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	switch (*param) {
 	case PRISM2_PARAM_TXRATECTRL:
 		*param = local->fw_tx_rate_control;
@@ -2716,10 +2833,13 @@
 				     struct iw_request_info *info,
 				     void *wrqu, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 resp0;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	if (local->func->cmd(dev, HFA384X_CMDCODE_READMIF, *extra, NULL,
 			     &resp0))
 		return -EOPNOTSUPP;
@@ -2734,10 +2854,13 @@
 				      struct iw_request_info *info,
 				      void *wrqu, char *extra)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	u16 cr, val;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	cr = *extra;
 	val = *(extra + 1);
 	if (local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF, cr, &val, NULL))
@@ -2749,11 +2872,14 @@
 
 static int prism2_ioctl_priv_monitor(struct net_device *dev, int *i)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret = 0;
 	u32 mode;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	printk(KERN_DEBUG "%s: process %d (%s) used deprecated iwpriv monitor "
 	       "- update software to use iwconfig mode monitor\n",
 	       dev->name, current->pid, current->comm);
@@ -2792,8 +2918,11 @@
 
 static int prism2_ioctl_priv_reset(struct net_device *dev, int *i)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	printk(KERN_DEBUG "%s: manual reset request(%d)\n", dev->name, *i);
 	switch (*i) {
@@ -3401,9 +3530,12 @@
 int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	struct iwreq *wrq = (struct iwreq *) ifr;
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	int ret = 0;
+
+	iface = netdev_priv(dev);
+	local = iface->local;
 
 	switch (cmd) {
 		/* Private ioctls (iwpriv) that have not yet been converted
diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_pci.c	2004-11-13 20:56:44 -08:00
@@ -50,10 +50,13 @@
 
 static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
 	writeb(v, local->mem_start + a);
@@ -62,11 +65,14 @@
 
 static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 	u8 v;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	v = readb(local->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
@@ -76,10 +82,13 @@
 
 static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
 	writew(v, local->mem_start + a);
@@ -88,11 +97,14 @@
 
 static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 	u16 v;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	v = readw(local->mem_start + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
@@ -111,29 +123,37 @@
 
 static inline void hfa384x_outb(struct net_device *dev, int a, u8 v)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+	iface = netdev_priv(dev);
+	local = iface->local;
 	writeb(v, local->mem_start + a);
 }
 
 static inline u8 hfa384x_inb(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+	iface = netdev_priv(dev);
+	local = iface->local;
 	return readb(local->mem_start + a);
 }
 
 static inline void hfa384x_outw(struct net_device *dev, int a, u16 v)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+	iface = netdev_priv(dev);
+	local = iface->local;
 	writew(v, local->mem_start + a);
 }
 
 static inline u16 hfa384x_inw(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = netdev_priv(dev);
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
+	iface = netdev_priv(dev);
+	local = iface->local;
 	return readw(local->mem_start + a);
 }
 
@@ -290,7 +310,7 @@
 	dev = prism2_init_local_data(&prism2_pci_funcs, cards_found);
 	if (dev == NULL)
 		goto fail;
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	local = iface->local;
 	cards_found++;
 
@@ -338,9 +358,12 @@
 
 static void prism2_pci_remove(struct pci_dev *pdev)
 {
-	struct net_device *dev = pci_get_drvdata(pdev);
-	struct hostap_interface *iface = netdev_priv(dev);
+	struct net_device *dev;
+	struct hostap_interface *iface;
 	void __iomem *mem_start;
+
+	dev = pci_get_drvdata(pdev);
+	iface = netdev_priv(dev);
 
 	/* Reset the hardware, and ensure interrupts are disabled. */
 	prism2_pci_cor_sreset(iface->local);
diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:56:44 -08:00
@@ -100,10 +100,13 @@
 
 static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
 	outb(v, dev->base_addr + a);
@@ -112,11 +115,14 @@
 
 static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 	u8 v;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	v = inb(dev->base_addr + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
@@ -126,10 +132,13 @@
 
 static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
 	outw(v, dev->base_addr + a);
@@ -138,11 +147,14 @@
 
 static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 	u16 v;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	v = inw(dev->base_addr + a);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
@@ -153,10 +165,13 @@
 static inline void hfa384x_outsw_debug(struct net_device *dev, int a,
 				       u8 *buf, int wc)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTSW, a, wc);
 	outsw(dev->base_addr + a, buf, wc);
@@ -166,10 +181,13 @@
 static inline void hfa384x_insw_debug(struct net_device *dev, int a,
 				      u8 *buf, int wc)
 {
-	struct hostap_interface *iface = dev->priv;
-	local_info_t *local = iface->local;
+	struct hostap_interface *iface;
+	local_info_t *local;
 	unsigned long flags;
 
+	iface = netdev_priv(dev);
+	local = iface->local;
+
 	spin_lock_irqsave(&local->lock, flags);
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INSW, a, wc);
 	insw(dev->base_addr + a, buf, wc);
@@ -498,7 +516,7 @@
 	dev = prism2_init_local_data(&prism2_plx_funcs, cards_found);
 	if (dev == NULL)
 		goto fail;
-	iface = dev->priv;
+	iface = netdev_priv(dev);
 	local = iface->local;
 	cards_found++;
 
@@ -541,8 +559,11 @@
 
 static void prism2_plx_remove(struct pci_dev *pdev)
 {
-	struct net_device *dev = pci_get_drvdata(pdev);
-	struct hostap_interface *iface = dev->priv;
+	struct net_device *dev;
+	struct hostap_interface *iface;
+
+	dev = pci_get_drvdata(pdev);
+	iface = netdev_priv(dev);
 
 	/* Reset the hardware, and ensure interrupts are disabled. */
 	prism2_plx_cor_sreset(iface->local);
diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:56:44 -08:00
+++ b/drivers/net/wireless/hostap/hostap_wlan.h	2004-11-13 20:56:44 -08:00
@@ -635,7 +635,8 @@
 
 /* Per radio private Host AP data - shared by all net devices interfaces used
  * by each radio (wlan#, wlan#ap, wlan#sta, WDS).
- * ((struct hostap_interface *) dev->priv)->local points to this structure. */
+ * ((struct hostap_interface *) netdev_priv(dev))->local points to this
+ * structure. */
 struct local_info {
 	struct module *hw_module;
 	int card_idx;
@@ -918,7 +919,7 @@
 
 /* Per interface private Host AP data
  * Allocated for each net device that Host AP uses (wlan#, wlan#ap, wlan#sta,
- * WDS) and dev->priv points to this structure. */
+ * WDS) and netdev_priv(dev) points to this structure. */
 struct hostap_interface {
 	struct list_head list; /* list entry in Host AP interface list */
 	struct net_device *dev; /* pointer to this device */



-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH wireless-2.6 16/16] Host AP: Replaced MODULE_PARM with module_param*
  2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
                   ` (16 preceding siblings ...)
  2004-11-14  5:24 ` [PATCH wireless-2.6 15/16] Host AP: Replaced direct dev->priv references with netdev_priv(dev) Jouni Malinen
@ 2004-11-14  5:25 ` Jouni Malinen
  17 siblings, 0 replies; 29+ messages in thread
From: Jouni Malinen @ 2004-11-14  5:25 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


diff -Nru a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c	2004-11-13 20:56:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_ap.c	2004-11-13 20:56:53 -08:00
@@ -18,22 +18,22 @@
 
 static int other_ap_policy[MAX_PARM_DEVICES] = { AP_OTHER_AP_SKIP_ALL,
 						 DEF_INTS };
-MODULE_PARM(other_ap_policy, PARM_MIN_MAX "i");
+module_param_array(other_ap_policy, int, NULL, 0444);
 MODULE_PARM_DESC(other_ap_policy, "Other AP beacon monitoring policy (0-3)");
 
 static int ap_max_inactivity[MAX_PARM_DEVICES] = { AP_MAX_INACTIVITY_SEC,
 						   DEF_INTS };
-MODULE_PARM(ap_max_inactivity, PARM_MIN_MAX "i");
+module_param_array(ap_max_inactivity, int, NULL, 0444);
 MODULE_PARM_DESC(ap_max_inactivity, "AP timeout (in seconds) for station "
 		 "inactivity");
 
 static int ap_bridge_packets[MAX_PARM_DEVICES] = { 1, DEF_INTS };
-MODULE_PARM(ap_bridge_packets, PARM_MIN_MAX "i");
+module_param_array(ap_bridge_packets, int, NULL, 0444);
 MODULE_PARM_DESC(ap_bridge_packets, "Bridge packets directly between "
 		 "stations");
 
 static int autom_ap_wds[MAX_PARM_DEVICES] = { 0, DEF_INTS };
-MODULE_PARM(autom_ap_wds, PARM_MIN_MAX "i");
+module_param_array(autom_ap_wds, int, NULL, 0444);
 MODULE_PARM_DESC(autom_ap_wds, "Add WDS connections to other APs "
 		 "automatically");
 
diff -Nru a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c	2004-11-13 20:56:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_cs.c	2004-11-13 20:56:53 -08:00
@@ -36,14 +36,14 @@
 MODULE_LICENSE("GPL");
 
 
-static unsigned int irq_mask = 0xdeb8;
-MODULE_PARM(irq_mask, "i");
+static int irq_mask = 0xdeb8;
+module_param(irq_mask, int, 0444);
 
 static int irq_list[4] = { -1 };
-MODULE_PARM(irq_list, "1-4i");
+module_param_array(irq_list, int, NULL, 0444);
 
-static int ignore_cis_vcc = 0;
-MODULE_PARM(ignore_cis_vcc, "i");
+static int ignore_cis_vcc;
+module_param(ignore_cis_vcc, int, 0444);
 MODULE_PARM_DESC(ignore_cis_vcc, "Ignore broken CIS VCC entry");
 
 
diff -Nru a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c	2004-11-13 20:56:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_hw.c	2004-11-13 20:56:53 -08:00
@@ -59,43 +59,43 @@
 /* #define final_version */
 
 static int mtu = 1500;
-MODULE_PARM(mtu, "i");
+module_param(mtu, int, 0444);
 MODULE_PARM_DESC(mtu, "Maximum transfer unit");
 
 static int channel[MAX_PARM_DEVICES] = { 3, DEF_INTS };
-MODULE_PARM(channel, PARM_MIN_MAX "i");
+module_param_array(channel, int, NULL, 0444);
 MODULE_PARM_DESC(channel, "Initial channel");
 
-static char *essid[MAX_PARM_DEVICES] = { "test" };
-MODULE_PARM(essid, PARM_MIN_MAX "s");
+static char essid[33] = "test";
+module_param_string(essid, essid, sizeof(essid), 0444);
 MODULE_PARM_DESC(essid, "Host AP's ESSID");
 
 static int iw_mode[MAX_PARM_DEVICES] = { IW_MODE_MASTER, DEF_INTS };
-MODULE_PARM(iw_mode, PARM_MIN_MAX "i");
+module_param_array(iw_mode, int, NULL, 0444);
 MODULE_PARM_DESC(iw_mode, "Initial operation mode");
 
 static int beacon_int[MAX_PARM_DEVICES] = { 100, DEF_INTS };
-MODULE_PARM(beacon_int, PARM_MIN_MAX "i");
+module_param_array(beacon_int, int, NULL, 0444);
 MODULE_PARM_DESC(beacon_int, "Beacon interval (1 = 1024 usec)");
 
 static int dtim_period[MAX_PARM_DEVICES] = { 1, DEF_INTS };
-MODULE_PARM(dtim_period, PARM_MIN_MAX "i");
+module_param_array(dtim_period, int, NULL, 0444);
 MODULE_PARM_DESC(dtim_period, "DTIM period");
 
 #if defined(PRISM2_PCI) && defined(PRISM2_BUS_MASTER)
 static int bus_master_threshold_rx[MAX_PARM_DEVICES] = { 100, DEF_INTS };
-MODULE_PARM(bus_master_threshold_rx, "i");
+module_param_array(bus_master_threshold_rx, int, NULL, 0444);
 MODULE_PARM_DESC(bus_master_threshold_rx, "Packet length threshold for using "
 		 "PCI bus master on RX");
 
 static int bus_master_threshold_tx[MAX_PARM_DEVICES] = { 100, DEF_INTS };
-MODULE_PARM(bus_master_threshold_tx, "i");
+module_param_array(bus_master_threshold_tx, int, NULL, 0444);
 MODULE_PARM_DESC(bus_master_threshold_tx, "Packet length threshold for using "
 		 "PCI bus master on TX");
 #endif /* PRISM2_PCI and PRISM2_BUS_MASTER */
 
-static char *dev_template = "wlan%d";
-MODULE_PARM(dev_template, "s");
+static char dev_template[16] = "wlan%d";
+module_param_string(dev_template, dev_template, sizeof(dev_template), 0444);
 MODULE_PARM_DESC(dev_template, "Prefix for network device name (default: "
 		 "wlan%d)");
 
@@ -3346,9 +3346,8 @@
 		card_idx = 0;
 	local->card_idx = card_idx;
 
-	i = essid[card_idx] == NULL ? 0 : card_idx;
-	len = strlen(essid[i]);
-	memcpy(local->essid, essid[i],
+	len = strlen(essid);
+	memcpy(local->essid, essid,
 	       len > MAX_SSID_LEN ? MAX_SSID_LEN : len);
 	local->essid[MAX_SSID_LEN] = '\0';
 	i = GET_INT_PARM(iw_mode, card_idx);
diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:56:53 -08:00
+++ b/drivers/net/wireless/hostap/hostap_plx.c	2004-11-13 20:56:53 -08:00
@@ -35,8 +35,8 @@
 MODULE_LICENSE("GPL");
 
 
-static int ignore_cis = 0;
-MODULE_PARM(ignore_cis, "i");
+static int ignore_cis;
+module_param(ignore_cis, int, 0444);
 MODULE_PARM_DESC(ignore_cis, "Do not verify manfid information in CIS");
 
 


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH wireless-2.6 10/16] Host AP: Use void __iomem * with {read,write}{b,w}
  2004-11-14  5:18     ` [PATCH wireless-2.6 10/16] Host AP: Use void __iomem * " Jouni Malinen
@ 2004-11-14 23:49       ` Jeff Garzik
  0 siblings, 0 replies; 29+ messages in thread
From: Jeff Garzik @ 2004-11-14 23:49 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev

applied patches 10-16 to wireless-2.6 (and thus netdev-2.6, and thus -mm).

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2004-11-14 23:49 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-08  7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
2004-11-08  7:10 ` [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages Jouni Malinen
2004-11-09  7:40   ` Jeff Garzik
2004-11-08  7:11 ` [PATCH wireless-2.6 2/12] Host AP: Fix interface packet counters Jouni Malinen
2004-11-08  7:12 ` [PATCH wireless-2.6 3/12] Host AP: Ignore (Re)AssocResp messages silently Jouni Malinen
2004-11-08  7:12 ` [PATCH wireless-2.6 4/12] Host AP: Remove ioctl debug messages Jouni Malinen
2004-11-08  7:13 ` [PATCH wireless-2.6 5/12] Host AP: Fix hw address changing for wifi# interface Jouni Malinen
2004-11-08  7:13 ` [PATCH wireless-2.6 6/12] Host AP: Prevent STAs from associating using AP address Jouni Malinen
2004-11-08  7:14 ` [PATCH wireless-2.6 7/12] Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined Jouni Malinen
2004-11-08  7:14 ` [PATCH wireless-2.6 8/12] Host AP: Do not bridge packets to unauthorized ports Jouni Malinen
2004-11-08  7:15 ` [PATCH wireless-2.6 9/12] Host AP: Fix card enabling after firmware download Jouni Malinen
2004-11-08  7:16 ` [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w} Jouni Malinen
2004-11-09  7:29   ` Jeff Garzik
2004-11-14  5:18     ` [PATCH wireless-2.6 10/16] Host AP: Use void __iomem * " Jouni Malinen
2004-11-14 23:49       ` Jeff Garzik
2004-11-08  7:17 ` [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG Jouni Malinen
2004-11-09  7:29   ` Jeff Garzik
2004-11-14  5:20     ` [PATCH wireless-2.6 11/16] " Jouni Malinen
2004-11-08  7:17 ` [PATCH wireless-2.6 12/12] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
2004-11-09  8:04 ` [PATCH wireless-2.6 0/12] Host AP update Jeff Garzik
2004-11-09  9:09   ` Michael Renzmann
2004-11-09 15:26     ` Jeff Garzik
2004-11-09 21:32       ` Vladimir Kondratiev
2004-11-14  5:15   ` Jouni Malinen
2004-11-14  5:21 ` [PATCH wireless-2.6 12/16] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
2004-11-14  5:22 ` [PATCH wireless-2.6 13/16] Host AP: pci_register_driver() return value changes Jouni Malinen
2004-11-14  5:23 ` [PATCH wireless-2.6 14/16] Host AP: Updated to use Linux wireless extensions v17 Jouni Malinen
2004-11-14  5:24 ` [PATCH wireless-2.6 15/16] Host AP: Replaced direct dev->priv references with netdev_priv(dev) Jouni Malinen
2004-11-14  5:25 ` [PATCH wireless-2.6 16/16] Host AP: Replaced MODULE_PARM with module_param* Jouni Malinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.