|
From: Nico v. H. <va...@va...> - 2006-10-22 22:26:22
|
Hello,
I`m making some progress in understanding on how to port drivers to
syllable,
but not understanding all of it.
I`m comparing the syllable r8169 driver to the linux tg3 driver
and finding some structs that are in linux header files, is there a
syllable replacement for these? or can i just copy them from the
linux source:
From: netdevice.h
struct net_device_stats
From: linux/timer.h
struct list_head
timer_list
From: workqueue.h
struct work_struct
From: ethtool.h
struct ethtool_coalesce
Now i`m having difficulties with the following struct:
static DeviceOperations_s g_sDevOps =
{
device_3c59x_open,
device_3c59x_close,
device_3c59x_ioctl,
device_3c59x_read,
device_3c59x_write,
NULL, // dop_readv
NULL, // dop_writev
NULL, // dop_add_select_req
NULL // dop_rem_select_req
};
How do i implement this for the tg3?
can i copy the 5 functions into the tg3 driver from the 3c59x driver?
Or.....?
Nico
----- Original Message -----
From: "Nico van Huis" <va...@va...>
To: <syl...@li...>
Sent: Monday, October 16, 2006 7:11 PM
Subject: Re: Syllable-kernel Digest, Vol 2, Issue 2
>I don`t understand the following lines, so i can`t solve the problem,
> please help!!
>
> 325 static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
> 326 {
> 327 //PCI_bus_s *psBus = g_psBus;
> 328 PCI_bus_s* psBus = get_busmanager( PCI_BUS_NAME, PCI_BUS_VERSION );
> 329 if( psBus == NULL ) {
> 330 return( NULL );
> 331 }
> 332 333 unsigned long flags;
> 334 335 spin_lock_irqsave(&tp->indirect_lock, flags);
> 336 psBus->write_pci_config(
> 337 &(tp)->pdev->nBus, 338 &tp->pdev->nDevice, 339
> &tp->pdev->nFunction, 340 TG3PCI_REG_BASE_ADDR, 341 sizeof(off), 342
> (uint32)off);
> 343 //pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off);
> 344 psBus->write_pci_config(
> 345 &tp->pdev->nBus, 346 &tp->pdev->nDevice, 347
> &tp->pdev->nFunction, 348 TG3PCI_REG_DATA, 349 val);
> 350 //pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val);
> 351 spin_unlock_irqrestore(&tp->indirect_lock, flags);
> 352 }
>
> 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: warning: `return' with a value, in function returning void
> tg3.c:337: error: dereferencing pointer to incomplete type
> tg3.c:338: error: dereferencing pointer to incomplete type
> tg3.c:339: error: dereferencing pointer to incomplete type
> tg3.c:345: error: dereferencing pointer to incomplete type
> tg3.c:346: error: dereferencing pointer to incomplete type
> tg3.c:347: error: dereferencing pointer to incomplete type
> tg3.c:349: error: too few arguments to function
> tg3.c:352:2: warning: no newline at end of file
> make: *** [objs/tg3.o] Error 1
>
> I really want to understand what the psBus does and their functions...
> can anyone explain and help to solve this??
>
|