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 |