From nobody@FreeBSD.org  Mon Mar 31 23:52:34 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5EECB1065673
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Mar 2008 23:52:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 52F748FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Mar 2008 23:52:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m2VNq9Es077344
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Mar 2008 23:52:09 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m2VNq8xl077343;
	Mon, 31 Mar 2008 23:52:08 GMT
	(envelope-from nobody)
Message-Id: <200803312352.m2VNq8xl077343@www.freebsd.org>
Date: Mon, 31 Mar 2008 23:52:08 GMT
From: Simas Kvilius <kvilius.simas@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [wi] imposible to enable ad-hoc demo mode with Orinoco Gold PC card
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122319
>Category:       kern
>Synopsis:       [wi] imposible to enable ad-hoc demo mode with Orinoco Gold PC card
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 01 00:00:03 UTC 2008
>Closed-Date:    
>Last-Modified:  Wed Apr  2 14:50:01 UTC 2008
>Originator:     Simas Kvilius
>Release:        7.0
>Organization:
Home
>Environment:
>Description:
I'm using old Lucent orinoco wireless card in ad-hoc demo mode.
It seems someone forgot to implement ad-hoc demo mode in the newest wi
driver (driver which comes with RELENG7). I added  following statement
to if_wi.c line 407 to indicate, that my card supports ad-hoc demo
mode (someone definitely forgot to include this):

ic->ic_caps |= IEEE80211_C_AHDEMO;

Now I can enable ad-hoc demo mode using ifconfig utility (with command
ifconfig wi0 mode 11b media DS/11Mbps mediaopt adhoc mediaopt flag0),
but it seems there is another bug. Now I cannot change radio channel
(nic is always stuck in channel 3, i think this channel is hardcoded
as default ibss channel inside my nic).
Could anyone fix this bug with channels (I tried to figure out where
problem is, but it seems I'm to lame to do kernel hacking of this
level by myself). My card was working fine with FreeBSD 5.1 (both with
ifconfig and wicontrol tools) and Linux.
>How-To-Repeat:
1. Try to enable adhoc mode on Lucent Orinoco Gold PC card using "ifconfig wi0 mode 11b media DS/11Mbps mediaopt adhoc mediaopt flag0"

2. Try to change channel using ifconfig wi0 channel 13 (or any other channel)
>Fix:
Add  following statement
to if_wi.c line 407 to indicate:

ic->ic_caps |= IEEE80211_C_AHDEMO;

(this solves only the first part of the problem)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: remko 
Responsible-Changed-When: Tue Apr 1 06:39:55 UTC 2008 
Responsible-Changed-Why:  
reassign to networking team 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122319 

From: "Simas Kvilius" <kvilius.simas@gmail.com>
To: bug-followup@FreeBSD.org, kvilius.simas@gmail.com
Cc:  
Subject: Re: kern/122319: [wi] imposible to enable ad-hoc demo mode with Orinoco Gold PC card
Date: Wed, 2 Apr 2008 17:16:32 +0300

 Addition info:
 Today I tested FreeBSD6.3 wi driver and inspected underlying wi code.
 I found out that FreeBSD6.3 has the same adhoc demo bug  as 7.0
 (inability to turn on ad-hoc demo mode), I added following code to
 /dev/wi/if_wi.c line 385:
 
 
 ic->ic_caps |= IEEE80211_C_AHDEMO;
 
 
 This code line completely fixed issues with my Lucent Orinoco wireless
 card in FreeBSD6.3, now I'm able to do both tasks: enable ad-hoc mode
 and change radio channels.
 
 ifconfig wi0 media DS/11Mbps mode 11b mediaopt adhoc,flag0 <-- this
 command enables ad-hoc demo mode as it should
 ifconfig wi0 channel 13 <-- this command changes radio channel as it should
 
 This discovery implies two things:
 
 1.  Inability to enable ad-hoc demo mode in FreeBSD6.3 and FreeBSD7.0
 and inability to change channels if FreeBSD are two separate (and
 probably unrelated) bugs.
 
 2. Because in FreeBSD6.3 I can change channels, but in FreeBSD I can
 not, the bug lies somewhere in code, which was updated between
 FreeBSD6.3 and 7.0, moreover I discovered that I cannot change channel
 in standard adhoc mode as well as in adhoc demo mode, so this bug is
 general to adhoc mode.
>Unformatted:
