Softc structure linkage problem

Admin admin at sycos.co.uk
Mon Feb 2 07:07:22 PST 2004


I am using FreeBSD Version 5.1.

I am having problem to use the softc structure variables to assign the pointer to make_dev and bus_alloc_resource functions.

When I declare dev_t sdev as global variable and assign to make_dev as follows:

int unit = device_get_unit(device);

sdev = make_dev(&sy_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "sy3c%d", unit);

I am able to create device node, load the kld and unload the kld.

 When I declare dev_t dev as part of sy_softc structure and assign the scp->dev pointer to make_dev function as shown above, the code compiles ok.  When I load the kld with "kldload -v ./sy3c.ko" command, it flags error. The errors log file err_log is attached.

I have also attached the driver code for reference.

Would you please advise a.s.a.p to resolve this problem.

Regards

Gurdial Chandra      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sy3c.c
Type: application/octet-stream
Size: 13861 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040202/9995874b/sy3c-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: err_log
Type: application/octet-stream
Size: 2977 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040202/9995874b/err_log-0001.obj


More information about the freebsd-questions mailing list