Hi Jiri,

Thank you, I'll change that allocation method in next week :)

Regards,
Agnieszka


On Thu, May 29, 2014 at 5:09 PM, Jiri Svoboda <[email protected]>
wrote:

> Hi Agnieszka,
>
> that looks like you're making good progress :-) I am looking forward to
> trying it out. I also appreciate you sticking tou our C style.
>
> I have only a very minor (in terms of severity) suggestion: You copied the
> #define _DDF_DATA_IMPLANT from the 8139 driver. That should be avoided in
> new drivers, it was introduced only as a way to transition drivers to
> new/updated way of allocating soft state. It's a rather simple fix (and
> yes, we should do it in 8139 as well).
>
> The gist is that in the past drivers allocated driver-specific date for
> device and function nodes manually and then they set a pointer int the
> device/function node. They also freed the data manually. Today these memory
> blocks are allocated and freed automatically by the device framework. Still
> you can supply your own memory block using the ddf_{dev|fun}_data_implant
> functions which are made visible by defining _DDF_DATA_IMPLANT.
>
> Nowadays you should use the function ddf_dev_data_alloc() /
> ddf_fun_data_alloc() to allocate the memory and it will be freed
> automatically when it's no longer needed - this makes synchronization
> easier - you can protect that data structure with a simple mutex, for
> example. The only catch is that the function node for which the data is
> being allocated must be passed as argument to ddf_fun_data_alloc() - so you
> must first create the function node and only then allocate the
> driver-specific date (currently the driver does it the other way around).
>
> A typical sequence of driver handling an 'add device' request:
> (1) create function node(s)
> (2) allocate driver-specific data using ddf_fun_data_alloc()
> (3) initialize the HW
> (4) bind the function node(s) (ddf_fun_bind())
> (5) add the function node(s) to a category (cathegories)
>
> Anyway it's more of a cosmetic issue.
>
> Cheers
> -Jiri
>
> ---------- Původní zpráva ----------
> Od: Agnieszka Tabaka <[email protected]>
> Komu: HelenOS development mailing list <[email protected]>
> Datum: 26. 5. 2014 23:52:43
> Předmět: [HelenOS-devel] RTL8169 driver for HelenOS - weekly report 1
>
> Hi all,
>
> In the first week of GSoC coding, I've created basic working skeleton for
> RTL8169 driver. Driver is able to detect card in system, read MAC address
> and it responds to link status change (plugging and unplugging cable). It
> installs it's interrupt handler, responds to link status change interrupts
> and re-enables interrupts properly. I was also working on packet
> transmission: creating DMA buffers for rings and packet data. I hope that
> in the next week I'll be able to send a packet over the wire :)
>
> Code is available at: https://code.launchpad.net/~nufcia/helenos/rtl8169
>
> Regards,
> Agnieszka
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
>
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to