# freebsd analog for linux's modprobe with parameter?



## edhunter (Jun 18, 2009)

Hello guys

I know that in freebsd I could load kernel modules with kldload (and that is modprobe in linux), but is there any analog for this:


```
modprobe wctdm opermode=BULGARIA
```

??

10x in advance


----------



## SirDice (Jun 18, 2009)

Have a look at device.hints(5) and sysctl(8). Also look at the man page of the device you're trying to configure.


----------



## edhunter (Jun 19, 2009)

10x but it didnt work
i added to device.hints

```
hint.wctdm24xxp.0.opermod="BULGARIA"
hint.wctdm.0.opermod="BULGARIA"
```

but when i do kldload /usr/local/lib/zaptel/wctdm24xxp.ko this hint doesnt matter (

also in the sysctl values for wctdm24xxp there is no opermod variable

here are some sysctl -a grep wctdm

```
dev.wctdm24xxp.0.%driver: wctdm24xxp
dev.wctdm24xxp.0.%location: slot=12 function=0
dev.wctdm24xxp.0.%pnpinfo: vendor=0xd161 device=0x8005 subvendor=0xd161 subdevice=0x8005 class=0x020000
dev.wctdm24xxp.0.%parent: pci0
```


----------



## SirDice (Jun 19, 2009)

Where does this driver come from? I can't find anywhere in the base or the ports.


----------



## edhunter (Jun 19, 2009)

this is from ports - /usr/ports/misc/zaptel
drivers for digium voip cards


----------



## tangram (Jun 19, 2009)

edhunter said:
			
		

> this is from ports - /usr/ports/misc/zaptel
> drivers for digium voip cards



Did you read the package message upon finishing the install?


```
% cat /usr/ports/misc/zaptel/files/pkg-message.in

IMPORTANT! MAKE SURE TO READ THE FOLLOWING!

To use the driver set zaptel_enable="YES" in your rc.conf.

To load the driver run (as root):

# %%PREFIX%%/etc/rc.d/zaptel start

To unload it:

# %%PREFIX%%/etc/rc.d/zaptel stop

It'll also load the driver automatically when the system is started.
```

So just follow the instructions and add [cmd=]zaptel_enable="YES"[/cmd] to /etc/rc.conf.


----------



## tangram (Jun 19, 2009)

Oh and have a look at the FreeBSD Handbook and Kernel Drivers, Subsystems, and Modules particularly.


----------



## edhunter (Jun 19, 2009)

tangram, i can load the driver ... thats no problem. And yes i know where handbook is...

This driver is ported from linux. My problem is that it needs some parameters that can be set on linux but not on freebsd.


----------



## vivek (Jun 19, 2009)

What about /usr/local/etc/zaptel.conf.sample?  Just copy it as 

```
cp /usr/local/etc/zaptel.conf.sample /usr/local/etc/zaptel.conf
```
Now edit the file and see if you can pass those parameters including country name.


----------



## richardpl (Jun 19, 2009)

http://osdir.com/ml/telephony.pbx.asterisk.bsd/2005-10/msg00118.html


----------



## tangram (Jun 19, 2009)

edhunter said:
			
		

> tangram, i can load the driver ... thats no problem. And yes i know where handbook is...
> 
> This driver is ported from linux. My problem is that it needs some parameters that can be set on linux but not on freebsd.



I misunderstood and apologize for that.

That said have a look zaptel.conf.sample, copy it over as zaptel.conf and edit it (probably in Tone Zone Data section).


----------



## edhunter (Jun 19, 2009)

In zaptel.conf I have set

```
unused=3,4
fxsks=1,2
loadzone = bg
defaultzone=bg
```

but this is for tones only not for "electrical" parameters of line...

Actually in the beginning I was asking something without explaining the situation.
I have posted a question on asterisk-bsd maillist. There I have put more information http://www.mail-archive.com/asterisk-bsd@lists.digium.com/msg02900.html


----------



## richardpl (Jun 19, 2009)

Maybe you need to put such flags into /boot/loader.conf and also load kernel module from /boot/loader.conf if driver/module only allows to accept such values only during initialization - if there is no something like hard reset ....


----------

