From: Nico v. H. <va...@va...> - 2006-10-14 15:32:40
|
Hello, I`m new to kernel and driver programming, but i`d like to participate! I`ve installed syllable on my laptop, but syllable didn`t found my network card. After a little research i found out that the tg3 driver wasn`t ported. So i downloaded the linux drivers and tried to port it myself. after copy, paste and adjust the first few lines and compiled them i got a lot of errors: static struct pci_device_id tg3_pci_tbl[] = { { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702FE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705M_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702X, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703X, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5782, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5789, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704S_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5720, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5721, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5752M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5753, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5753M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5753F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5754, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5754M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5755, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5755M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5786, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5787, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5787M, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5714S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5715, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5715S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5781, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_TIGON3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { 0, } }; ok this is a struct with a few constants, but didn`t found their declaration in the linux driver code nor in the linux kernel code, can anyone help me with this?? searched the internet... couldn`t find anything.... and i always get an error on "u32", is this an invalid integer or something?? please help, i may sound like a noob, cause i am! but you all started somewhere too :P |
From: Nico v. H. <va...@va...> - 2006-10-15 14:19:35
|
I get an erroron the following lines: 223:#define TG3PCI_REG_BASE_ADDR 0x00000078 224:#define TG3PCI_REG_DATA 0x00000080 225:static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) 226:{ 227: unsigned long flags; 228: 229: spin_lock_irqsave(&tp->indirect_lock, flags); 330: pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off); 331: pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val); 332: spin_unlock_irqrestore(&tp->indirect_lock, flags); 333:} It says: bash-2.03$ make cc -kernel -fno-PIC -c tg3.c -o objs/tg3.o tg3.c:218: warning: parameter names (without types) in function declaration tg3.c:218: warning: data definition has no type or storage class tg3.c: In function `tg3_write_indirect_reg32': tg3.c:330: error: `psBus' undeclared (first use in this function) tg3.c:330: error: (Each undeclared identifier is reported only once tg3.c:330: error: for each function it appears in.) tg3.c:330: error: dereferencing pointer to incomplete type tg3.c:330: error: dereferencing pointer to incomplete type tg3.c:330: error: dereferencing pointer to incomplete type tg3.c:331: error: dereferencing pointer to incomplete type tg3.c:331: error: dereferencing pointer to incomplete type tg3.c:331: error: dereferencing pointer to incomplete type tg3.c:333:2: warning: no newline at end of file make: *** [objs/tg3.o] Error 1 As you can read it says 'psBus' undeclared... well i think it is but it is also never been used in these lines and nowhere else in the code. Does anyone do know where this error possibly come from? Nico |
From: Wang Y. <ypw...@gm...> - 2006-10-15 14:29:10
|
Hi, Nico I don't have experience in Device Driver on Syllable. After I google "psBus", I found the following link: http://www.other-space.com/sub/?section=System_Programming&tutorial=Device_Drivers Does it possible that it needs some header file to include when porting on Syllable? Hope that can help. Cheers, Andy On 10/15/06, Nico van Huis <va...@va...> wrote: > > I get an erroron the following lines: > > 223:#define TG3PCI_REG_BASE_ADDR 0x00000078 > 224:#define TG3PCI_REG_DATA 0x00000080 > 225:static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) > 226:{ > 227: unsigned long flags; > 228: > 229: spin_lock_irqsave(&tp->indirect_lock, flags); > 330: pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off); > 331: pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val); > 332: spin_unlock_irqrestore(&tp->indirect_lock, flags); > 333:} > > It says: > > bash-2.03$ make > cc -kernel -fno-PIC -c tg3.c -o objs/tg3.o > tg3.c:218: warning: parameter names (without types) in function > declaration > tg3.c:218: warning: data definition has no type or storage class > tg3.c: In function `tg3_write_indirect_reg32': > tg3.c:330: error: `psBus' undeclared (first use in this function) > tg3.c:330: error: (Each undeclared identifier is reported only once > tg3.c:330: error: for each function it appears in.) > tg3.c:330: error: dereferencing pointer to incomplete type > tg3.c:330: error: dereferencing pointer to incomplete type > tg3.c:330: error: dereferencing pointer to incomplete type > tg3.c:331: error: dereferencing pointer to incomplete type > tg3.c:331: error: dereferencing pointer to incomplete type > tg3.c:331: error: dereferencing pointer to incomplete type > tg3.c:333:2: warning: no newline at end of file > make: *** [objs/tg3.o] Error 1 > > As you can read it says 'psBus' undeclared... well i think it is but it is > also never been used in these lines > and nowhere else in the code. > > Does anyone do know where this error possibly come from? > > Nico > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > Syllable-kernel mailing list > Syl...@li... > https://lists.sourceforge.net/lists/listinfo/syllable-kernel > > > |
From: Kristian V. D. V. <va...@li...> - 2006-10-15 19:12:53
|
On Sunday 15 October 2006 15:19, Nico van Huis wrote: > I get an erroron the following lines: > > 223:#define TG3PCI_REG_BASE_ADDR 0x00000078 > 224:#define TG3PCI_REG_DATA 0x00000080 > 225:static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) > 226:{ > 227: unsigned long flags; > 228: > 229: spin_lock_irqsave(&tp->indirect_lock, flags); > 330: pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off); > 331: pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val); > 332: spin_unlock_irqrestore(&tp->indirect_lock, flags); > 333:} > > It says: > > bash-2.03$ make > cc -kernel -fno-PIC -c tg3.c -o objs/tg3.o > tg3.c:218: warning: parameter names (without types) in function declarati= on > tg3.c:218: warning: data definition has no type or storage class > tg3.c: In function `tg3_write_indirect_reg32': > tg3.c:330: error: `psBus' undeclared (first use in this function) > tg3.c:330: error: (Each undeclared identifier is reported only once > tg3.c:330: error: for each function it appears in.) > tg3.c:330: error: dereferencing pointer to incomplete type > tg3.c:330: error: dereferencing pointer to incomplete type > tg3.c:330: error: dereferencing pointer to incomplete type > tg3.c:331: error: dereferencing pointer to incomplete type > tg3.c:331: error: dereferencing pointer to incomplete type > tg3.c:331: error: dereferencing pointer to incomplete type > tg3.c:333:2: warning: no newline at end of file > make: *** [objs/tg3.o] Error 1 > > As you can read it says 'psBus' undeclared... well i think it is but it is > also never been used in these lines and nowhere else in the code. =46rom linux_comp.h: #define pci_write_config_byte(dev, address, val) \ psBus->write_pci_config((dev)->nBus, (dev)->nDevice, (dev)->nFunction,=20 address, sizeof(val), (uint32)val) > Does anyone do know where this error possibly come from? You probable have a "g_psBus" that is global to the entire driver. The bes= t=20 way to handle this is to change the Linux pci_write_config_byte() to a=20 Syllable psBus->write_pci_config() yourself in the code: psBus->write_pci_config(tp->pdev->nBus, tp->pdev->nDevice,=20 tp->pdev->nFunction, TG3PCI_REG_BASE_ADDR, sizeof(off), (uint32)off); Or failing that, ensure any function that uses macros has a local psBus: PCI_bus_s *psBus =3D g_psBus; at the top of the function. =2D-=20 Vanders http://www.syllable.org http://www.liqwyd.com |