Bug 522269 - [PATCH] Mistake while converting hostap driver to net_device_ops causes hostapd to fail
Summary: [PATCH] Mistake while converting hostap driver to net_device_ops causes hosta...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 11
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-09 22:55 UTC by Martin Decky
Modified: 2009-09-29 14:33 UTC (History)
2 users (show)

Fixed In Version: 2.6.30.8-64.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-29 14:33:56 UTC


Attachments (Terms of Use)
Patch to revert the toxic part of the upstream changeset (840 bytes, patch)
2009-09-09 22:55 UTC, Martin Decky
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Linux Kernel 14000 None None None Never

Description Martin Decky 2009-09-09 22:55:07 UTC
Created attachment 360364 [details]
Patch to revert the toxic part of the upstream changeset

Description of problem:
During the 2.6.30 kernel development cycle, the hostap driver was converted to use net_device_ops. Within this conversion a tiny mistake was made in hostap_main.c. The original fragment of code was:

if (type != HOSTAP_INTERFACE_MASTER) {
    /* use main radio device queue */
    dev->tx_queue_len = 0;
}

While the equivalent new fragment (with unrelated lines marked) is:

switch(type) {
case HOSTAP_INTERFACE_AP:
    dev->netdev_ops = &hostap_mgmt_netdev_ops;  /* unrelated */
    dev->type = ARPHRD_IEEE80211;               /* unrelated */
    dev->header_ops = &hostap_80211_ops;        /* unrelated */
    break;
case HOSTAP_INTERFACE_MASTER:
    dev->tx_queue_len = 0;                 /* use main radio device queue */
    dev->netdev_ops = &hostap_master_ops;  /* unrelated */
    break;
default:
    dev->netdev_ops = &hostap_netdev_ops;  /* unrelated */
}

Apparently the condition when dev->tx_queue_len is set to 0 was reversed in the new code, which is wrong.

The original changeset in kernel GIT can be examined here:
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blobdiff;f=drivers/net/wireless/hostap/hostap_main.c;h=6fe122f18c0dcd68f8de72db16cc3310338aaf2b;hp=792dd14c894eeb7a4052dad45dab801017579b5a;hb=5ae4efbcd2611562a8b93596be034e63495706a5;hpb=4cfa8e45f4bb26ff38155f94a810a876b739958d


Version-Release number of selected component (if applicable):
Any kernel since 2.6.30, e.g. kernel-PAE-2.6.30.5-43.fc11.i686


How reproducible:
Always when the hostap driver is used in AP mode (via hostapd).


Steps to Reproduce:
1. Configure and run hostapd to provide AP services
2. Let a different computer/device associate with the AP

  
Actual results:
The size of TX queue of wifi0 (the physical wireless device) is set to zero.

WPA/WPA2 association works OK (given the configuration of hostapd is correct), but any further communication is blocked (because the size of the TX queue of wifi0 is zero) and error messages are printed to the kernel ring buffer:

Virtual device wifi0 asks to queue packet!


Expected results:
The size of TX queue of wifi0 should be non-zero, the size of queues for wlan0 and wlan0ap should be zero.

Wireless communication should work after successful association, no warnings should be printed to the kernel ring buffer.


Additional info:
Please include the attached patch in the next kernel release for Fedora 11 and rawhide. I am going to send the same patch to the upstream kernel maintainer as well.

Comment 1 Chuck Ebbert 2009-09-25 03:56:00 UTC
Fixed in 2.6.30.8-62 ... and you should have also submitted that patch for the stable kernel series.

Comment 2 Martin Decky 2009-09-25 08:52:03 UTC
(In reply to comment #1)

Thanks a lot! The fix was merged into linux-next on 2009-09-15.

Should I try to make somebody to merge it into linux-2.6.30.y and linux-2.6.31.y myself now or are you going to do it?

Comment 3 Fedora Update System 2009-09-25 16:01:52 UTC
kernel-2.6.30.8-64.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/kernel-2.6.30.8-64.fc11

Comment 4 Fedora Update System 2009-09-29 14:33:06 UTC
kernel-2.6.30.8-64.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.