Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapting the code to Linux 4.15 #12

Closed
wants to merge 1 commit into from

Conversation

@DGdev91
Copy link

commented Dec 23, 2017

Linux 4.15 dropped setup_timer
torvalds/linux@513ae78#diff-ba8897e9349509c7ca4d37b0704bee9c

i've tried to adapt the code using timer_setup instead, wich acts a bit differently.

The callback functions are more or less the same, and i used a global variable, "__devicepointer", to pass the pointer.

There's probably a cleaner solution than this one, but it works.

I know you don't accept third party patches to this repo since it's supposed to be a simple mirror, so i'm already closing the request. i've just posted this because it can be useful to someone.

Adapting the code to Linux 4.15
Linux 4.15 dropped setup_timer
torvalds/linux@513ae78#diff-ba8897e9349509c7ca4d37b0704bee9c

i've tried to adapt the code using timer_setup instead, wich acts a bit differently.

The callback functions are more or less the same, and i used a global variable, "__devicepointer", to pass the pointer.

There's probably a cleaner solution than this one, but it works.
@angelsl

This comment has been minimized.

Copy link

commented on bc248cd Dec 23, 2017

The correct way is simply

struct rtl8168_private *tp = from_timer(tp, timer, link_timer);

__devicepointer is no longer needed.

This comment has been minimized.

Copy link

replied Dec 23, 2017

Er, replace link_timer with esd_timer in rtl8168_esd_timer, of course.

This comment has been minimized.

Copy link
Owner Author

replied Dec 23, 2017

Oh, i didn' realized you commented also here.

Well, that solves the problem for the rtl8168_private struct, but the code references many times also "net_device", how can we get it?

This comment has been minimized.

Copy link

replied Dec 23, 2017

struct net_device *dev = tp->dev;

This comment has been minimized.

Copy link
Owner Author

replied Dec 24, 2017

Well, it was easier than i tought.
Thanks, code updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.