kern/84861 : still can't get working ipw(4) with adhoc

Denis Shaposhnikov dsh at vlink.ru
Mon Aug 15 07:10:16 GMT 2005


The following reply was made to PR kern/84861; it has been noted by GNATS.

From: Denis Shaposhnikov <dsh at vlink.ru>
To: bug-followup at FreeBSD.org, dsh at 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 at 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 at fidonet 2:550/5069 at fidonet
 mailto:dsh at vlink.ru http://neva.vlink.ru/~dsh/


More information about the freebsd-bugs mailing list