23 Jul, 2009

8 commits

  • If skge hardware is capable of waking up the system from sleep,
    enable magic packet WoL during driver initialisation.

    This makes WoL work without calling 'ethtool -s ethX wol g'
    for each adapter.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Michael Guntsche
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Rafael J. Wysocki
     
  • David S. Miller
     
  • fix this build error when CONFIG_MII is not set
    drivers/net/ks8851.c:999: undefined reference to `generic_mii_ioctl'
    drivers/net/ks8851.c:1050: undefined reference to `mii_link_ok'
    drivers/net/ks8851.c:1056: undefined reference to `mii_nway_restart'
    drivers/net/ks8851.c:1044: undefined reference to `mii_ethtool_sset'
    drivers/net/ks8851.c:1038: undefined reference to `mii_ethtool_gset'

    Signed-off-by: Alexander Beregalov
    Acked-by: Ben Dooks

    Alexander Beregalov
     
  • This patch fixes a bug in the non-lro path. Wrong size of received
    packet was being passed for updating receive statistics. This patch
    is against the net-2.6 git.

    Signed-off-by: Ajit Khaparde
    Signed-off-by: David S. Miller

    Ajit Khaparde
     
  • Since commit 0b9da337dca972e7a4144e298ec3adb8f244d4a4 ("Rework
    ucc_geth driver to use of_mdio infrastructure") the fixed-link
    support is broken.

    This patch fixes the support by removing !ug_info->phy_node check,
    and adds a call to of_phy_connect_fixed_link() if a phy is not attached
    to the MAC.

    Also, remove an old fixed-link code that we don't use any longer.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Grant Likely
    Signed-off-by: David S. Miller

    Anton Vorontsov
     
  • Since commit fe192a49118f5b1272317d60c7930ece4e13ae49 ("Rework gianfar
    driver to use of_mdio infrastructure") the fixed-link support is
    broken, the driver oopses at init_phy():

    Unable to handle kernel paging request for data at address 0x000000e4
    Faulting instruction address: 0xc01cf298
    Oops: Kernel access of bad area, sig: 11 [#1]
    [...]
    NIP [c01cf298] init_phy+0x80/0xdc
    LR [c01cf250] init_phy+0x38/0xdc
    Call Trace:
    [cf81fe80] [c01d1cf8] gfar_enet_open+0x6c/0x19c
    [cf81fea0] [c024494c] dev_open+0xfc/0x134
    [cf81fec0] [c0242edc] dev_change_flags+0x84/0x1ac
    [cf81fee0] [c0399ee0] ic_open_devs+0x168/0x2d8
    [cf81ff20] [c039b2e8] ip_auto_config+0x90/0x2a4
    [cf81ff60] [c0003884] do_one_initcall+0x34/0x1a8

    This patch fixes the oops, and removes phy_node checks, and adds a call
    to of_phy_connect_fixed_link() if a phy isn't attached..

    Also, remove an old fixed-link code that we don't use any longer.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Grant Likely
    Signed-off-by: David S. Miller

    Anton Vorontsov
     
  • Since commit aa73832c5a80d6c52c69b18af858d88fa595dd3c ("Rework
    fs_enet driver to use of_mdio infrastructure") the fixed-link support
    is broken in the fs_enet driver.

    This patch fixes the support by removing a check for phy_node, and adding
    a call to of_phy_connect_fixed_link().

    Also set netdev parent device via SET_NETDEV_DEV() call, this is needed
    so that OF MDIO core could find a node pointer for a device.

    Plus, fix "if (IS_ERR(phydev))" check, in case of errors,
    of_phy_connect() returns NULL, not ERR_PTR as phy_connect().

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Grant Likely
    Signed-off-by: David S. Miller

    Anton Vorontsov
     
  • Fixed-link support is broken for the ucc_eth, gianfar, and fs_enet
    device drivers. The "OF MDIO rework" patches removed most of the
    support. Instead of re-adding fixed-link stuff to the drivers, this
    patch adds a support function for parsing the fixed-link property
    and obtaining a dummy phy to match.

    Note: the dummy phy handling in arch/powerpc is a bit of a hack and
    needs to be reworked. This function is being added now to solve the
    regression in the Ethernet drivers, but it should be considered a
    temporary measure until the fixed link handling can be reworked.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Grant Likely
    Signed-off-by: David S. Miller

    Anton Vorontsov
     

22 Jul, 2009

29 commits

  • Reset rx chain before trying to drain it.
    Shut interrupts off last, incase there's something to report.

    Signed-off-by: Mike McCormack
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Mike McCormack
     
  • The values in the advertising field are typically ADVERTISED_xxx, not
    SUPPORTED_xxx. Both SUPPORTED_10000baseT_Full and
    ADVERTISED_1000baseT_Full have the same value.

    The semantic match that finds this problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    struct ethtool_cmd E;
    @@
    *E.advertising = SUPPORTED_10000baseT_Full
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • If the NULL test is necessary, then the dereference should be moved below
    the NULL test.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    type T;
    expression E,E1;
    identifier i,fld;
    statement S;
    @@

    - T i = E->fld;
    + T i;
    ... when != E=E1
    when != i
    if (E == NULL||...) S
    + i = E->fld;
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • If the NULL test is necessary, then the dereferences should be moved below
    the NULL test.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    type T;
    expression E,E1;
    identifier i,fld;
    statement S;
    @@

    - T i = E->fld;
    + T i;
    ... when != E=E1
    when != i
    BUG_ON (E == NULL||...);
    + i = E->fld;
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Firmware V4 on CF8381 reports region code shifted by 1 byte to left.
    The following patch checks for this and handles it properly.

    Signed-off-by: Marek Vasut
    Signed-off-by: John W. Linville

    Marek Vasut
     
  • Two users of ar9170 devices have now reported their cards
    have been programmed with a regulatory domain of 0x8000.
    This is not a valid regulatory domain as such these users were
    unable to use these devices. Since this doesn't seem to be
    a device EEPROM corruption we must treat it specially. It
    may have been possible the manufacturer intended to use 0x0
    as the regulatory domain and that would ultimately yield
    to US but since we cannot get confirmationf or this we
    default this special case to one of our world regulatory
    domains, specifically 0x64.

    Reported-by: DavidFreeman on #linux-wireless
    Reported-by: Joerg Albert
    Cc: Christian Lamparter ,
    Cc: Stephen Chen
    Cc: David Quan
    Cc: Tony Yang
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Fix a potential NULL dereference bug during
    error handling in p54spi_probe.

    This bug was discovered by smatch:
    (http://repo.or.cz/w/smatch.git).

    Signed-off-by: Dan Carpenter
    Signed-off-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Dan Carpenter
     
  • Fix another polarity error introduced by the rfkill rewrite,
    this time in acer_rfkill_set().

    Signed-off-by: Alan Jenkins
    Signed-off-by: John W. Linville

    Alan Jenkins
     
  • Signed-off-by: Evgeniy Polyakov
    Signed-off-by: David S. Miller

    Evgeniy Polyakov
     
  • Many Nokia handsets support a Phonet interface to the cellular modem
    via a vendor-specific USB interface. CDC Phonet follows the
    Communications Device Class model, with one control interface, and
    and a pair of inactive and active data alternative interface. The later
    has two bulk endpoint, one per direction.

    This was tested against Nokia E61, Nokia N95, and the existing Phonet
    gadget function for the Linux composite USB gadget framework.

    Signed-off-by: Rémi Denis-Courmont
    Signed-off-by: David S. Miller

    Rémi Denis-Courmont
     
  • Set the driver data before using it. Fixes an oops when doing rmmod.

    Signed-off-by: Finn Thain
    Signed-off-by: David S. Miller

    Finn Thain
     
  • A pointer to mac_sonic_probe is passed to the core via
    platform_driver_register and so the function must not disappear when the
    .init sections are discarded. Otherwise (if also having HOTPLUG=y)
    unbinding and binding a device to the driver via sysfs will result in an
    oops as does a device being registered late.

    Various other functions that are called by mac_sonic_probe need to move
    to .devinit.text, too.

    An alternative to this patch is using platform_driver_probe instead of
    platform_driver_register plus removing the pointer to the probe function
    from the struct platform_driver.

    Signed-off-by: Uwe Kleine-König
    Tested-by: Finn Thain
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     
  • This patch fixes a double free corruption in __cfg80211_scan_done:

    ================================================
    BUG kmalloc-512: Object already free
    ------------------------------------------------

    INFO: Allocated in load_elf_binary+0x18b/0x19af age=6
    INFO: Freed in load_elf_binary+0x104e/0x19af age=5
    INFO: Slab 0xffffea0001bae4c0 objects=14 used=7
    INFO: Object 0xffff88007e8a9918 @offset=6424 fp=0xffff88007e8a9488

    Bytes b4 0xffff88007e8a9908: 00 00 00 00 00 00 00 00 5a 5a
    [...]
    Pid: 28705, comm: rmmod Tainted: P C 2.6.31-rc2-wl #1
    Call Trace:
    [] print_trailer+0x14e/0x16e
    [] object_err+0x42/0x61
    [] __slab_free+0x2af/0x396
    [] ? wiphy_unregister+0x92/0x142 [cfg80211]
    [] kfree+0x13c/0x17a
    [] ? wiphy_unregister+0x92/0x142 [cfg80211]
    [] wiphy_unregister+0x92/0x142 [cfg80211]
    [] ieee80211_unregister_hw+0xc8/0xff [mac80211]
    [] p54_unregister_common+0x31/0x66 [p54common]
    [...]
    FIX kmalloc-512: Object at 0xffff88007e8a9918 not freed

    The code path which leads to the *funny* double free:

    request = rdev->scan_req;
    dev = dev_get_by_index(&init_net, request->ifidx);
    /*
    * the driver was unloaded recently and
    * therefore dev_get_by_index will return NULL!
    */
    if (!dev)
    goto out;
    [...]
    rdev->scan_req = NULL; /* not executed... */
    [...]
    out:
    kfree(request);

    Signed-off-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Christian Lamparter
     
  • Some drivers don't need the return value of rfkill_set_hw_state(),
    so it should not be marked as __must_check.

    Signed-off-by: Alan Jenkins
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Alan Jenkins
     
  • For AP mode we must tune ANI specially for 2 GHz and
    for 5 GHz. We mask in only the flags we want to toggle
    on ath9k_hw_ani_control() through the ah->ani_function
    bitmask, this will take care of ignoring changes during
    ANI reset which we were disabling before.

    Testedy-by: Steven Luo
    Cc: Bennyam Malavazi
    Cc: Jouni Malinen
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • The commit below changed the semantics of rt2x00_check_rev so that it no
    longer checked the bottom 4 bits of the rev were non-zero. During that
    conversion this part of the check was not propogated to the rt2500usb
    initialisation.

    commit 358623c22c9fd837b3b1b444377037f72553dc9f
    Author: Ivo van Doorn
    Date: Tue May 5 19:46:08 2009 +0200

    rt2x00: Simplify rt2x00_check_rev

    Without this check rt73 devices are miss recognised as rt2500 devices and
    two drivers are loaded. Preventing the device being used. Reinstate this
    check.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: John W. Linville

    Andy Whitcroft
     
  • Potential memory leak via msg pointer in nl80211_get_key() function.

    Signed-off-by: Niko Jokinen
    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Niko Jokinen
     
  • When rtl8187 is unloaded and CONFIG_RTL8187_LEDS is set, the kernel
    may oops when the module is unloaded as the workqueue for led_on was
    not being cancelled.

    This patch fixes the problem reported in
    http://marc.info/?l=linux-wireless&m=124742957615781&w=2.

    Reported-by: Gábor Stefanik
    Signed-off-by: Larry Finger
    Signed-off-by: John W. Linville

    Larry Finger
     
  • Pavel Roskin reported some issues with using AP mode without
    nohwcrypt=1. Most likely this is similar to the problem fixed
    some time ago in ath9k by 3f53dd64f192450cb331c0fecfc26ca952fb242f,
    "ath9k: Fix hw crypto configuration for TKIP in AP mode."

    That only affects TKIP but it's easiest to just disable that and
    WEP too until we get a proper fix in.

    Signed-off-by: Bob Copeland
    Signed-off-by: John W. Linville

    Bob Copeland
     
  • For forwarded frames, we save the precursor address in addr1 in case it
    needs to be used to send a Path Error. mesh_path_discard_frame,
    however, was using addr2 instead of addr1 to send Path Error frames, so
    correct that and also make the comment regarding this more clear.

    Signed-off-by: Andrey Yurovsky
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • Once the "data" pointer is freed, we can't be iterating
    to the next item in the list any more so we need to use
    list_for_each_entry_safe with a temporary variable.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • If you rmmod the module while associated, frames might
    be transmitted during unregistration -- which will crash
    if the hwsim%d interface is unregistered first, so only
    do that after all the virtual wiphys are gone.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • The point of this function is to set the software and hardware state at
    the same time. When I tried to use it, I found it was only setting the
    software state.

    Signed-off-by: Alan Jenkins
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Alan Jenkins
     
  • The location of the 802.11 header is calculated incorrectly due to a
    wrong placement of parentheses. Found by kmemcheck.

    Signed-off-by: Pavel Roskin
    Signed-off-by: John W. Linville

    Pavel Roskin
     
  • Apparently there actually _are_ tools that try to set
    this in sysfs even though it wasn't supposed to be used
    this way without claiming first. Guess what: now that
    I've cleaned it all up it doesn't matter and we can
    simply allow setting the soft-block state in sysfs.

    Signed-off-by: Johannes Berg
    Tested-By: Darren Salt
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • My kvm instance was complaining a lot about sleeping
    in atomic contexts in the mesh code, and it turns out
    that both mesh_path_add() and mpp_path_add() need to
    be able to sleep (they even use synchronize_rcu()!).
    I put in a might_sleep() to annotate that, but I see
    no way, at least right now, of actually making sure
    those functions are only called from process context
    since they are both called during TX and RX and the
    mesh code itself even calls them with rcu_read_lock()
    "held".

    Therefore, let's disable it completely for now.

    It's possible that I'm only seeing this because the
    hwsim's beaconing is broken and thus the peers aren't
    discovered right away, but it is possible that this
    happens even if beaconing is working, for a peer that
    doesn't exist or so.

    It should be possible to solve this by deferring the
    freeing of the tables to call_rcu() instead of using
    synchronize_rcu(), and also using atomic allocations,
    but maybe it makes more sense to rework the code to
    not call these from atomic contexts and defer more of
    the work to the workqueue. Right now, I can't work on
    either of those solutions though.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • The byte count table is only used for aggregation. Updating it
    in other cases caused fragmented frames to be dropped.

    This fixes http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2004

    Signed-off-by: Reinette Chatre
    Signed-off-by: John W. Linville

    Reinette Chatre
     
  • This changes the power_level file to adhere to the "one value
    per file" sysfs rule. The user will know which power level was
    requested as it will be the number just written to this file. It
    is thus not necessary to create a new sysfs file for this value.

    In addition it fixes a problem where powertop's parsing expects
    this value to be the first value in this file without any descriptions.

    Signed-off-by: Reinette Chatre
    cc: stable@kernel.org
    Signed-off-by: John W. Linville

    Reinette Chatre
     
  • The driver private data is now based on wiphy. So we should not
    touch the private data after wiphy_free() is called. The patch
    fixes the potential NULL pointer dereference by making the
    iwm_wdev_free() the last one on the interface removal path.

    Signed-off-by: Zhu Yi
    Signed-off-by: John W. Linville

    Zhu Yi
     

21 Jul, 2009

3 commits