# BCM4318: Using the ad-hoc mode

## manuels

Hi,

I want to use my /dev/wlan1 device in ad-hoc mode, but gentoo's network setup script does not want to:

```
 * Service net.wlan1 stopping

 * Service net.wlan1 stopped

 * Service net.wlan1 starting

Error for wireless request "Set Mode" (8B06) :

    SET failed on device wlan1 ; Device or resource busy.

 wlan1 does not support the following configuration commands

   mode ad-hoc

 * WARNING:  net.wlan1 has started but is inactive

```

the /etc/conf.d/net looks like this:

```
iwconfig_wlan1="mode ad-hoc"

wpa_supplicant_wlan1="-Dwext"

preup() {

        ifconfig ${IFACE} down

}

```

It doesn't work neither with nor without the preup() function.

But it works if I setup up the device manually:

```
ifconfig wlan1 down

iwconfig wlan1 mode ad-hoc

ifconfig wlan1 up
```

Does anybody know what to do?

PS: actually I the ad-hoc mode is just a workaround.

I wanna use the master mode, but it seems that the b43 driver does not support it:

```
iwconfig wlan1 mode master

Error for wireless request "Set Mode" (8B06) :

    SET failed on device wlan1 ; Invalid argument.

```

Here are some details about the device:

```
00:0e.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
```

----------

## manuels

*bump*

----------

## albright

This is no answer, but why not just forget about /etc/conf.d/net and use

a script at startup to configure the network card?

----------

## devilheart

 *Quote:*   

> wlan1 does not support the following configuration commands
> 
>    mode ad-hoc 

 looks like you driver does not support this feature. this is not surprising, besides managed mode, getting ah-hoc (or master) mode has always been a nasty business unless you are lucky enough to have a good wnic (like atheros). if your wnic is a minipci nic you should replace it with an atheros one (or one which has certified linux support). it should cost around 25€ for an ieee 802.11n product (even less for a g product)

----------

## IvanMajhen

Hi. I have the sam card and ad-hoc works:

```
/etc/init.d/net.wlan0 stop

killall dhcpcd

iwconfig wlan0 mode ad-hoc essid youressid key xxxxxxxxxx

iwconfig wlan0 txpower on

ifconfig wlan0 up

dhcpcd wlan0

```

----------

## devilheart

can you really comunicate in ad-hoc mode? I have a bcm4306 card, I can set ad-hoc mode but it never worked

----------

## manuels

Setting adhoc mode up manually works (at least I get no error message -- I've not tried to communicate in this mode), but not by the scripts.

Ok, I'm gonna try to communicate with adhoc mode later and see if it works.

----------

## manuels

ok, I've tested it: Setting ad-hoc mode up manually works fine.

----------

