Realtek 8101E NIC and FreeBSD 4.11

Velja Kalik vkalik at yahoo.com
Sat Dec 22 12:55:47 PST 2007


Hello all,
   
  has anyone tried to compile the Realtek driver (rtl_bsd_drv_v174.tgz) on FreeBSD 4.x? From
   
  http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=7&PFid=7&Level=5&Conn=4&DownTypeID=3&GetDown=false#RTL8100E/RTL8101E/RTL8102E-GR
   
  Readme.txt says:
   
  1. Method 1 advises to just copy the .ko module to /modules, but there is no .ko file in the tgz archive. That is even ok since I guess they would have to put a .ko module in tgz archive for all popular versions of FreeBSD (4.x/5.x/6.x) and their kernel versions.
   
  2. Method 2 advises to go for compilation of kernel modules using the .c, .h and Makefile from the tgz archive.
   
  I made backups of original files,
  compiled new kernel without "rl",
  rebooted (everything from step 1 and 2),
   
  copied everything from tgz archive in place,
  edited if_rlreg.h so that the first #define lines would look like this (for 4.11):
   
  #define VERSION(_MainVer,_MinorVer) ((_MainVer)*10+(_MinorVer))
#define OS_VER VERSION(4,11)
/*#if __FreeBSD_version < 500000*/
/*#define VERSION(_MainVer,_MinorVer) ((_MainVer)*100000+(_MinorVer)*10000)*/
/*#else*/
/*#define VERSION(_MainVer,_MinorVer) ((_MainVer)*100000+(_MinorVer)*1000)*/
/*#endif*/
/*#define OS_VER __FreeBSD_version*/
   
  (uncommented first 2 lines, commented next 6 lines).
   
  Then in the /usr/src/sys/modules/rl I ran "make clean" (which is ok) and then "make" and it started to complain:
   
  host# make
Warning: Object directory not changed from original
/usr/src/sys/modules/rl
@ -> /usr/src/sys
machine -> /usr/src/sys/i386/include
touch opt_bdg.h
perl @/kern/makeops.pl -h @/kern/device_if.m
perl @/kern/makeops.pl -h @/kern/bus_if.m
perl @/kern/makeops.pl -h @/pci/pci_if.m
cc -O -pipe   -D_KERNEL -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual  -fformat-extensions -ansi -DKLD_MODULE
-nostdinc -I-  -I. -I@ -I@/../include -I/usr/include 
-mpreferred-stack-boundary=2 -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual  -fformat-extensions -ansi -c
/usr/src/sys/modules/rl/../../pci/if_rl.c
In file included from
/usr/src/sys/modules/rl/../../pci/if_rl.c:73:
@/pci/if_rlreg.h:506: field `mtx' has incomplete type
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_attach':
/usr/src/sys/modules/rl/../../pci/if_rl.c:257:
warning: implicit declaration of function `mtx_init'
/usr/src/sys/modules/rl/../../pci/if_rl.c:257:
`MTX_NETWORK_LOCK' undeclared (first use in this
function)
/usr/src/sys/modules/rl/../../pci/if_rl.c:257: (Each
undeclared identifier is reported only once
/usr/src/sys/modules/rl/../../pci/if_rl.c:257: for
each function it appears in.)
/usr/src/sys/modules/rl/../../pci/if_rl.c:257:
`MTX_DEF' undeclared (first use in this function)
/usr/src/sys/modules/rl/../../pci/if_rl.c:524:
warning: passing arg 2 of `ether_ifattach' makes
integer from pointer without a cast
/usr/src/sys/modules/rl/../../pci/if_rl.c:555:
`IFM_1000_T' undeclared (first use in this function)
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_detach':
/usr/src/sys/modules/rl/../../pci/if_rl.c:588:
warning: implicit declaration of function `mtx_lock'
/usr/src/sys/modules/rl/../../pci/if_rl.c:590:
warning: implicit declaration of function `mtx_unlock'
/usr/src/sys/modules/rl/../../pci/if_rl.c:596: too few
arguments to function `ether_ifdetach'
/usr/src/sys/modules/rl/../../pci/if_rl.c:618:
warning: implicit declaration of function
`mtx_destroy'
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_start':
/usr/src/sys/modules/rl/../../pci/if_rl.c:993:
warning: passing arg 1 of `bpf_mtap' from incompatible
pointertype
/usr/src/sys/modules/rl/../../pci/if_rl.c:1067:
warning: passing arg 1 of `bpf_mtap' from incompatible
pointer type
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_rxeof':
/usr/src/sys/modules/rl/../../pci/if_rl.c:1533:
structure has no member named `if_input'
/usr/src/sys/modules/rl/../../pci/if_rl.c:1630:
structure has no member named `if_input'
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_intr':
/usr/src/sys/modules/rl/../../pci/if_rl.c:1723:
structure has no member named `if_link_state'
/usr/src/sys/modules/rl/../../pci/if_rl.c:1723:
`LINK_STATE_UP' undeclared (first use in this
function)
/usr/src/sys/modules/rl/../../pci/if_rl.c:1724: syntax
error before `/'
/usr/src/sys/modules/rl/../../pci/if_rl.c:1729:
structure has no member named `if_link_state'
/usr/src/sys/modules/rl/../../pci/if_rl.c:1729:
`LINK_STATE_DOWN' undeclared (first use in this
function)
/usr/src/sys/modules/rl/../../pci/if_rl.c:1730: syntax
error before `/'
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_setmulti':
/usr/src/sys/modules/rl/../../pci/if_rl.c:1830:
structure has no member named `tqh_first'
/usr/src/sys/modules/rl/../../pci/if_rl.c:1830:
structure has no member named `tqe_next'
/usr/src/sys/modules/rl/../../pci/if_rl.c:1800:
warning: `ifma' might be used uninitialized in this
function
/usr/src/sys/modules/rl/../../pci/if_rl.c: In function
`rl_ifmedia_sts':
/usr/src/sys/modules/rl/../../pci/if_rl.c:2061:
`IFM_1000_T' undeclared (first use in this function)
*** Error code 1

Stop in /usr/src/sys/modules/rl.
host#

  and gives out an error for compiling of course.
   
  Do you have a suggestion how can I solve MTX_* error problems, since it looks like mutexes are used in code and "man mutex" on FreeBSD web says that mutex.h is introduced in FreeBSD 5.0 (and this is 4.11)?
  For IFM_* errors where are those IFM variables/constants supposed to be included from?
   
  I guess all would be easy if I had used FreeBSD 5.x or 6.x, but all nodes have to be 4.11 (comercial compiler on system for FreeBSD 4.x) so its not like I can choose other verions :) NIC is integrated Realtek 8101E (PCIEx).
   
  No reply from Bill Paul or Yves...
   
  Thank you for any kind of help or information!
   
  Regards,
  Velja

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.


More information about the freebsd-questions mailing list