Hi,

I tried to make driver for BCM4318 [AirForce One 54g] 802.11g Wireless LAN 
Controller (dell d610 laptop) but failed.

I have read http://hub.opensolaris.org/bin/view/Community+Group+laptop/ndis and 
I've downloaded 
http://hub.opensolaris.org/bin/download/Community+Group+laptop/downloads/ndis-1.2.5.tar.gz
 and windows driver (from link on the page).

When I run "make ndis" I get following error:
[b]
$ make ndis
/usr/gnu/bin/gcc -g -O2 -D_KERNEL -D__i386__ -I../include -I. -c ../if_ndis.c 
-o if_ndis.o
../if_ndis.c:156: error: static declaration of 'wifi_bcastaddr' follows 
non-static declaration
../include/sys/mac_wifi.h:114: note: previous declaration of 'wifi_bcastaddr' 
was here
*** Error code 1
make: Fatal error: Command failed for target `if_ndis.o'
[/b]
After removing declaration from ../include/sys/mac_wifi.h
[b]
$ diff -c ../include/sys/mac_wifi.h.old ../include/sys/mac_wifi.h
*** ../include/sys/mac_wifi.h.old       Sat Nov 28 08:35:33 2009
--- ../include/sys/mac_wifi.h   Sat Nov 28 08:35:21 2009
***************
*** 111,117 ****
        uint_t                  wd_qospad;
  } wifi_data_t;
  
! extern uint8_t wifi_bcastaddr[];
  
  #endif        /* _KERNEL */
  
--- 111,117 ----
        uint_t                  wd_qospad;
  } wifi_data_t;
  
! /* extern uint8_t wifi_bcastaddr[]; */
  
  #endif        /* _KERNEL */
[/b]
I get following error
[b]
make ndis
/usr/gnu/bin/gcc -g -O2 -D_KERNEL -D__i386__ -I../include -I. -c ../if_ndis.c 
-o if_ndis.o
/usr/gnu/bin/gcc -g -O2 -D_KERNEL -D__i386__ -I../include -I. -c ../ndis_prop.c 
-o ndis_prop.o
/opt/onbld/bin/i386/ctfconvert -g -l NDISWRAPPER if_ndis.o
ERROR: ctfconvert: die 80: base type without name
Removing if_ndis.o
*** Error code 1
make: Fatal error: Command failed for target `ndis'
[/b]

Then I tried to compile using SunStudio 12u1 cc.

[b]make ndis CC=/opt/sunstudio12.1/bin/cc[/b]

It displays a lof of warnings like following
[b]
warning:  attribute "__stdcall__" is unknown, ignored
warning: argument #4 is incompatible with prototype:
warning: assignment type mismatch
[/b]

but I get [b]bcmndis[/b]

Then I run
[b]
$ make ndisapi                             
/usr/gnu/bin/gcc -g -O -D_KERNEL -D__i386__ -I../include -c ../subr_ndis.c -o 
subr_ndis.o
/usr/gnu/bin/gcc -g -O -D_KERNEL -D__i386__ -I../include -c ../subr_ntoskrnl.c 
-o subr_ntoskrnl.o
/usr/gnu/bin/gcc -g -O -D_KERNEL -D__i386__ -I../include -c ../subr_pe.c -o 
subr_pe.o
/usr/gnu/bin/gcc -g -O -D_KERNEL -D__i386__ -I../include -c ../subr_hal.c -o 
subr_hal.o
/usr/gnu/bin/gcc -g -O -D_KERNEL -D__i386__ -I../include -c ../kern_ndis.c -o 
kern_ndis.o
/usr/gnu/bin/gcc -g -O -D_KERNEL -D__i386__ -I../include -c ../kern_windrv.c -o 
kern_windrv.o
/opt/onbld/bin/i386/ctfconvert -g -l NDISWRAPPER subr_ndis.o
ERROR: ctfconvert: die 80: base type without name
Removing subr_ndis.o
*** Error code 1
make: Fatal error: Command failed for target `ndisapi'
[/b]
With Sun compiler (to suppress warnings I add -erroff=)
[b]
$ make ndisapi "CC=/opt/sunstudio12.1/bin/cc 
-erroff=E_ASSIGNMENT_TYPE_MISMATCH,E_ATTRIBUTE_UNKNOWN,E_PROTOTYPE_MISMATCH_PROMOTE,E_IDENTIFIER_REDECLARED"
/opt/sunstudio12.1/bin/cc 
-erroff=E_ASSIGNMENT_TYPE_MISMATCH,E_ATTRIBUTE_UNKNOWN,E_PROTOTYPE_MISMATCH_PROMOTE,E_IDENTIFIER_REDECLARED
 -g -O -D_KERNEL -D__i386__ -I../include -c ../subr_ndis.c -o subr_ndis.o
"../subr_ndis.c", line 1148: warning: argument #2 is incompatible with 
prototype:
        prototype: pointer to void : "../include/ntoskrnl_var.h", line 1169
        argument : pointer to function(pointer to void, pointer to void, 
pointer to void, pointer to void) returning void
"../subr_ndis.c", line 1209: warning: argument #2 is incompatible with 
prototype:
        prototype: pointer to void : "../include/ntoskrnl_var.h", line 1169
        argument : pointer to function(pointer to struct kdpc {unsigned short 
k_type, unsigned char k_num, unsigned char k_importance, struct list_entry {..} 
k_dpclistentry, pointer to void k_deferedfunc, pointer to void k_deferredctx, 
pointer to void k_sysarg1, pointer to void k_sysarg2, unsigned int k_lock}, 
pointer to struct ndis_miniport_timer {struct ktimer {..} nmt_ktimer, struct 
kdpc {..} nmt_kdpc, pointer to function(..) returning void nmt_timerfunc, 
pointer to void nmt_timerctx, pointer to struct ndis_miniport_block {..} 
nmt_block, pointer to struct ndis_miniport_timer {..} nmt_nexttimer}, pointer 
to void, pointer to void) returning void
"../subr_ndis.c", line 1833: void function cannot return value
cc: acomp failed for ../subr_ndis.c
*** Error code 1
make: Fatal error: Command failed for target `subr_ndis.o'
[/b]

After some changes in ../subr_ndis.c
[b]
$ diff -c ../subr_ndis.c.old ../subr_ndis.c
*** ../subr_ndis.c.old  Sat Nov 28 09:06:09 2009
--- ../subr_ndis.c      Sat Nov 28 09:07:44 2009
***************
*** 1830,1837 ****
        uint32_t                protrsvdlen;
  {
        __FUNCNAME__;
!       return(NdisAllocatePacketPool(status, pool,
!           descnum + oflowdescnum, protrsvdlen));
  }
  
  __stdcall uint32_t
--- 1830,1837 ----
        uint32_t                protrsvdlen;
  {
        __FUNCNAME__;
!       NdisAllocatePacketPool(status, pool,
!           descnum + oflowdescnum, protrsvdlen);
  }
  
  __stdcall uint32_t

I got ndisapi.
[/b]
[b]
pfexec cp -i bcmndis /kernel/drv/bcmndis   
pfexec cp -i ndisapi /kernel/misc/ndisapi
[/b]

[b]$ pfexec /usr/X11/bin/scanpci -v[/b]
shows
[b]
pci bus 0x0003 cardnum 0x03 function 0x00: vendor 0x14e4 device 0x4318
 Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller
 CardVendor 0x1028 card 0x0005 (Dell, Wireless 1370 WLAN Mini-PCI Card)
  STATUS    0x0000  COMMAND 0x0106
  CLASS     0x02 0x80 0x00  REVISION 0x02
  BIST      0x00  HEADER 0x00  LATENCY 0x40  CACHE 0x00
  BASE0     0xdfcfe000 SIZE 8192  MEM
  BASEROM   0x00000000  addr 0x00000000
  MAX_LAT   0x00  MIN_GNT 0x00  INT_PIN 0x01  INT_LINE 0x0a
[/b]
So I run
[b]pfexec add_drv -i 'pci14e4,4318' -v bcmndis[/b]
after this my system hangs and in few seconds reboots.
Adding [b]debug-level=0xff;[/b] into [b]/kernel/drv/bcmndis.conf[/b] doesn't 
add info into [b]/var/adm/messages[/b]
I can see only
[b]
Nov 28 09:22:22 solaris savecore: [ID 570001 auth.error] reboot after panic: 
BAD TRAP: type=e (#pf Page fault) rp=da940a08 addr=4 occur
red in module "<unknown>" due to a NULL pointer dereference
[/b]

Stack in kernel when panic:
[b]
$ pfexec mdb -k unix.0 vmcore.0
Loading modules: [ unix genunix specfs dtrace mac cpu.generic uppc pcplusmp 
rootnex scsi_vhci zfs sockfs ip hook neti sctp arp usba uhci fctl lofs random 
sd fcip cpc crypto logindmux ptm ufs sppp ipc ]
> ::stack
0xe4a3ea1e()
0xe4a3f0d1(da940b38, eb81c000, 0, e, e4bd5000, e4bd5000)
ndis_init_nic+0xc7(d74c8000, f8295338, 5, 1)
ndis_attach+0xd8d(d0702618, 0, 0, 0)
devi_attach+0x7c(d0702618)
attach_node+0x9a(d0702618, 1, 0, d0702618)
i_ndi_config_node+0x9c(d0702618, 6, 0, 1)
i_ddi_attachchild+0x3d(d0702618, 0, da940d08, fe917377)
devi_attach_node+0xbb(d0702618, 4048, 0, 0)
config_immediate_children+0xe6(d0705610, 4048, 26, da940d9c)
devi_config_common+0x8a(d0705610, 4048, 26, 0)
mt_config_thread+0x3f(d0f84da0, 0)
thread_start+8()
> $q
$
[/b]

Some info about my system:
[b]
$ uname -a                                                                      
                                         
SunOS solaris 5.11 snv_127 i86pc i386 i86pc
$ /opt/sunstudio12.1/bin/cc -V                                                  
                                         
cc: Sun C 5.10 SunOS_i386 2009/06/03
$ gcc --version                                                                 
                            
gcc (GCC) 4.4.2
...
$ ld --version
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1685
[/b]
-- 
This message posted from opensolaris.org

Reply via email to