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

[wlanloader] WLAN loader plugin #81

Merged
merged 1 commit into from Sep 23, 2014
Merged

Conversation

kjokinie
Copy link
Contributor

Apparently Android by default resets the WLAN driver after
every use of WLAN hotspot. To make it easier to work with android
kernels whose WLAN module depends on this kind of reset service,
this plugin will imitate that behavior by reloading the
kernel module via a systemd service after each use of
WLAN hotspot.

If you want to utilize this plugin, please add a systemd system
service that is named "wlan-module-load.service" to your adaptation
project. The service should modprobe the wlan kernel module at
ExecStart, and rmmod it at ExecStop.

If the systemd service is not present in the system, the plugin will
not do anything.

Signed-off-by: Kalle Jokiniemi kalle.jokiniemi@jolla.com

@kjokinie
Copy link
Contributor Author

This second version fixes comments from spiiroin and adds some missing "wlanloader:" prefixes to error / debug prints. Works quite well with patched up connman that does not crash anymore in case wlan module goes away.

static void reset_wlan_module(void)
{
DBusError err = DBUS_ERROR_INIT;
DBusPendingCall *pc = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'pc' variable is not really used -> should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, removing.

@spiiroin
Copy link
Contributor

One minor comment, otherwise LGTM

}

if (!dbus_connection_send_with_reply(conn, req, &pc, -1))
goto cleanup;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synchronous call similar to other things, can this block other dsme operations?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, this is how async calls are made via libdbus, the callback is assigned in set_notify below

@saukko
Copy link

saukko commented Sep 23, 2014

LGTM, however it would be probably more efficient to use libkmod but in that case it would be hw adaptation specific instead of current way which can easily change on each hw adaptation.

@kjokinie
Copy link
Contributor Author

I had a version with libkmod, but that introduces minimum 500ms blocking calls when loading and unloading modules, which was not acceptable for system critical component like dsme.

@kjokinie
Copy link
Contributor Author

V3:

  • Removed unused *pc pointer.

Apparently Android by default resets the WLAN driver after
every use of WLAN hotspot. To make it easier to work with android
kernels whose WLAN module depends on this kind of reset service,
this plugin will imitate that behavior by reloading the
kernel module via a systemd service after each use of
WLAN hotspot.

If you want to utilize this plugin, please add a systemd system
service that is named "wlan-module-load.service" to your adaptation
project. The service should modprobe the wlan kernel module at
ExecStart, and rmmod it at ExecStop.

If the systemd service is not present in the system, the plugin will
not do anything.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jolla.com>
@kjokinie
Copy link
Contributor Author

V4:

  • Fixed the configure option to actually disable the module in case --disable-wlanloader is passed :)

@kjokinie
Copy link
Contributor Author

All commented issues fixed now. Merging.

kjokinie pushed a commit that referenced this pull request Sep 23, 2014
[wlanloader] WLAN loader plugin
@kjokinie kjokinie merged commit b7a50e5 into nemomobile:master Sep 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants