From dsh@neva.vlink.ru  Sat Aug 13 10:00:08 2005
Return-Path: <dsh@neva.vlink.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id F221F16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Aug 2005 10:00:07 +0000 (GMT)
	(envelope-from dsh@neva.vlink.ru)
Received: from deliver.smtp.vlink.ru (alias.rigel.internal.vlink.ru [217.23.88.17])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6679E43D46
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Aug 2005 10:00:06 +0000 (GMT)
	(envelope-from dsh@neva.vlink.ru)
Received: from smtp.smtp.vlink.ru (clamav.smtp.vlink.ru [192.168.4.1])
	by deliver.smtp.vlink.ru (Postfix) with ESMTP id 52A0D45414;
	Sat, 13 Aug 2005 14:00:04 +0400 (MSD)
Received: from neva.vlink.ru (neva.vlink.ru [217.107.252.29])
	by smtp.smtp.vlink.ru (Postfix) with ESMTP id 0F64F45413;
	Sat, 13 Aug 2005 14:00:04 +0400 (MSD)
Received: from neva.vlink.ru (localhost [127.0.0.1])
	by neva.vlink.ru (8.13.4/8.13.4) with ESMTP id j7DA01Yo050135;
	Sat, 13 Aug 2005 14:00:01 +0400 (MSD)
	(envelope-from dsh@neva.vlink.ru)
Received: (from dsh@localhost)
	by neva.vlink.ru (8.13.4/8.13.4/Submit) id j7DA01iQ050130;
	Sat, 13 Aug 2005 14:00:01 +0400 (MSD)
	(envelope-from dsh)
Message-Id: <200508131000.j7DA01iQ050130@neva.vlink.ru>
Date: Sat, 13 Aug 2005 14:00:01 +0400 (MSD)
From: Denis Shaposhnikov <dsh@vlink.ru>
Reply-To: Denis Shaposhnikov <dsh@vlink.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dsh@neva.vlink.ru, Sam Leffler <sam@errno.com>
Subject: still can't get working ipw(4) with adhoc
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         84861
>Category:       kern
>Synopsis:       [ipw] [patch] still can't get working ipw(4) with adhoc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    thompsa
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 13 10:00:36 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Oct 15 18:58:06 UTC 2007
>Originator:     Denis Shaposhnikov
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD localhost.my.domain 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Fri Aug 12 22:53:24 MSD 2005 dsh@localhost.my.domain:/var/FreeBSD/obj/var/FreeBSD/src/sys/WIZARD i386

and

FreeBSD localhost.my.domain 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Fri Jun 10 21:52:01 MSD 2005     dsh@localhost.my.domain:/var/FreeBSD/obj/var/FreeBSD/src/sys/WIZARD  i386

too.

>Description:

Can't get working ipw(4) association in adhoc mode with FreeBSD's ipw. Before,
I'vi been using ipw-1.7.1 from damien's site but can't use it now because API
change.

>How-To-Repeat:

# kldload if_ipw
# ifconfig ipw0 name wifi0
# ipwcontrol -i wifi0 -f /usr/local/share/ipw-firmware/ipw2100-1.3-i.fw
# ifconfig wifi0

wifi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:04:23:a0:55:1f
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 1
        authmode OPEN privacy OFF txpowmax 100

# ifconfig wifi0 mediaopt adhoc ssid betty up
# ifconfig wifi0

wifi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 00:04:23:a0:55:1f
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <ibss>)
        status: associated
        ssid "" channel 2
        authmode OPEN privacy OFF txpowmax 100

As you see SSID is "". But

# ifconfig wifi0 ssid betty scan

SSID            BSSID              CHAN RATE  S:N   INT CAPS
betty           2e:83:12:9a:21:a1    2   11M 58:0   100 I   

# ifconfig wifi0 down
# ifconfig wifi0

wifi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:04:23:a0:55:1f
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <ibss>)
        status: no carrier
        ssid betty channel 2
        authmode OPEN privacy OFF txpowmax 100

>Fix:

Please, take a look to ipw-1.7.1. For example, this is for ipw-1.7.1 on CURRENT from Fri Jun 10 21:52:01 MSD 2005:

# ifconfig wifi0

wifi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:04:23:a0:55:1f
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <ibss>)
        status: associated
        ssid betty channel 1 bssid 5a:80:44:bb:91:1c
        authmode OPEN privacy OFF txpowmax 100 rtsthreshold 2312

>Release-Note:
>Audit-Trail:

From: Denis Shaposhnikov <dsh@vlink.ru>
To: bug-followup@FreeBSD.org, dsh@vlink.ru
Cc:  
Subject: kern/84861 : still can't get working ipw(4) with adhoc
Date: Mon, 15 Aug 2005 11:04:26 +0400

 This patch fixes adhoc's ipw(4) on my system. I've made it from
 ipw-freebsd-1.7.1 which works fine before API change.
 
 System: FreeBSD localhost.my.domain 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Fri Aug 12 22:53:24 MSD 2005 dsh@localhost.my.domain:/var/FreeBSD/obj/var/FreeBSD/src/sys/WIZARD i386
 
 --- sys/dev/ipw/if_ipw.c.orig	Fri Aug 12 17:10:10 2005
 +++ sys/dev/ipw/if_ipw.c	Sat Aug 13 22:35:29 2005
 @@ -825,23 +825,26 @@
  {
  	struct ifnet *ifp = ic->ic_ifp;
  	struct ipw_softc *sc = ifp->if_softc;
 -	struct ieee80211_node *ni;
 -	uint8_t macaddr[IEEE80211_ADDR_LEN];
 +	struct ieee80211_node *ni = ic->ic_bss;
  	uint32_t len;
 +	uint8_t val;
  
  	switch (nstate) {
  	case IEEE80211_S_RUN:
 -		DELAY(200); /* firmware needs a short delay here */
 +		len = IEEE80211_NWID_LEN;
 +		ipw_read_table2(sc, IPW_INFO_CURRENT_SSID, ni->ni_essid, &len);
 +		ni->ni_esslen = len;
  
 -		len = IEEE80211_ADDR_LEN;
 -		ipw_read_table2(sc, IPW_INFO_CURRENT_BSSID, macaddr, &len);
 +		val = ipw_read_table1(sc, IPW_INFO_CURRENT_CHANNEL);
 +		ni->ni_chan = &ic->ic_channels[val];
 +
 +		DELAY(1000); /* firmware needs a short delay here */
  
 -		ni = ieee80211_find_node(&ic->ic_scan, macaddr);
 -		if (ni == NULL)
 -			break;
 +		len = IEEE80211_ADDR_LEN;
 +		ipw_read_table2(sc, IPW_INFO_CURRENT_BSSID, ni->ni_bssid, &len);
 +		IEEE80211_ADDR_COPY(ni->ni_macaddr, ni->ni_bssid);
  
  		ieee80211_ref_node(ni);
 -		ieee80211_sta_join(ic, ni);
  		ieee80211_node_authorize(ni);
  
  		if (ic->ic_opmode == IEEE80211_M_STA)
 
 -- 
 DSS5-RIPE DSS-RIPN 2:550/5068@fidonet 2:550/5069@fidonet
 mailto:dsh@vlink.ru http://neva.vlink.ru/~dsh/

From: Jordan Sissel <psionic@csh.rit.edu>
To: bug-followup@FreeBSD.org, dsh@vlink.ru
Cc:  
Subject: Re: kern/84861: [ipw] [patch] still can't get working ipw(4) with adhoc
Date: Sat, 20 May 2006 03:53:57 -0400

 Confirm this patch works 
 
 % uname -a
 FreeBSD  6.1-RELEASE FreeBSD 6.1-RELEASE #1: Sat May 20 02:41:28 UTC
 2006     jls@nightfall-wire:/usr/obj/usr/src/sys/SOEKRIS  i386
 
 Soekris net4501 with ipw2100
 
 I have tested this with a Windows wireless client, and it associates to
 the the access point without issue. I have not tested packet
 transmission (say, a ping) yet.
 
 Please have this committeed! :)
 
 -Jordan

From: Denis Shaposhnikov <dsh@vlink.ru>
To: bug-followup@FreeBSD.org, dsh@vlink.ru
Cc:  
Subject: Re: kern/84861: [ipw] [patch] still can't get working ipw(4) with
 adhoc
Date: Sat, 01 Jul 2006 19:08:59 +0400

 Hi!
 
 Is any chance to commit it? The patch is still actual.
 
 Thank you!
 
 -- 
 DSS5-RIPE DSS-RIPN 2:550/5068@fidonet 2:550/5069@fidonet
 xmpp:dsh@vlink.ru mailto:dsh@vlink.ru http://neva.vlink.ru/~dsh/
Responsible-Changed-From-To: freebsd-bugs->sam 
Responsible-Changed-By: sam 
Responsible-Changed-When: Fri Sep 1 22:19:46 UTC 2006 
Responsible-Changed-Why:  
I will deal with ipw issues 

http://www.freebsd.org/cgi/query-pr.cgi?pr=84861 
Responsible-Changed-From-To: sam->thompsa 
Responsible-Changed-By: sam 
Responsible-Changed-When: Mon Oct 15 18:57:46 UTC 2007 
Responsible-Changed-Why:  
hand to Andrew since I think his latest overhaul of the driver has fixed this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=84861 
>Unformatted:
