1. 28 2月, 2010 3 次提交
  2. 27 2月, 2010 5 次提交
    • F
      skbuff: align sk_buff::cb to 64 bit and close some potential holes · da3f5cf1
      Felix Fietkau 提交于
      The alignment requirement for 64-bit load/store instructions on ARM is
      implementation defined. Some CPUs (such as Marvell Feroceon) do not
      generate an exception, if such an instruction is executed with an
      address that is not 64 bit aligned. In such a case, the Feroceon
      corrupts adjacent memory, which showed up in my tests as a crash in the
      rx path of ath9k that only occured with CONFIG_XFRM set.
      
      This crash happened, because the first field of the mac80211 rx status
      info in the cb is an u64, and changing it corrupted the skb->sp field.
      
      This patch also closes some potential pre-existing holes in the sk_buff
      struct surrounding the cb[] area.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Cc: stable@kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da3f5cf1
    • P
      rtnetlink: support specifying device flags on device creation · 3729d502
      Patrick McHardy 提交于
      commit e8469ed959c373c2ff9e6f488aa5a14971aebe1f
      Author: Patrick McHardy <kaber@trash.net>
      Date:   Tue Feb 23 20:41:30 2010 +0100
      
      Support specifying the initial device flags when creating a device though
      rtnl_link. Devices allocated by rtnl_create_link() are marked as INITIALIZING
      in order to surpress netlink registration notifications. To complete setup,
      rtnl_configure_link() must be called, which performs the device flag changes
      and invokes the deferred notifiers if everything went well.
      
      Two examples:
      
      # add macvlan to eth0
      #
      $ ip link add link eth0 up allmulticast on type macvlan
      
      [LINK]11: macvlan0@eth0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
          link/ether 26:f8:84:02:f9:2a brd ff:ff:ff:ff:ff:ff
      [ROUTE]ff00::/8 dev macvlan0  table local  metric 256  mtu 1500 advmss 1440 hoplimit 0
      [ROUTE]fe80::/64 dev macvlan0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0
      [LINK]11: macvlan0@eth0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500
          link/ether 26:f8:84:02:f9:2a
      [ADDR]11: macvlan0    inet6 fe80::24f8:84ff:fe02:f92a/64 scope link
             valid_lft forever preferred_lft forever
      [ROUTE]local fe80::24f8:84ff:fe02:f92a via :: dev lo  table local  proto none  metric 0  mtu 16436 advmss 16376 hoplimit 0
      [ROUTE]default via fe80::215:e9ff:fef0:10f8 dev macvlan0  proto kernel  metric 1024  mtu 1500 advmss 1440 hoplimit 0
      [NEIGH]fe80::215:e9ff:fef0:10f8 dev macvlan0 lladdr 00:15:e9:f0:10:f8 router STALE
      [ROUTE]2001:6f8:974::/64 dev macvlan0  proto kernel  metric 256  expires 0sec mtu 1500 advmss 1440 hoplimit 0
      [PREFIX]prefix 2001:6f8:974::/64 dev macvlan0 onlink autoconf valid 14400 preferred 131084
      [ADDR]11: macvlan0    inet6 2001:6f8:974:0:24f8:84ff:fe02:f92a/64 scope global dynamic
             valid_lft 86399sec preferred_lft 14399sec
      
      # add VLAN to eth1, eth1 is down
      #
      $ ip link add link eth1 up type vlan id 1000
      RTNETLINK answers: Network is down
      
      <no events>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3729d502
    • P
      dev: support deferring device flag change notifications · bd380811
      Patrick McHardy 提交于
      Split dev_change_flags() into two functions: __dev_change_flags() to
      perform the actual changes and __dev_notify_flags() to invoke netdevice
      notifiers. This will be used by rtnl_link to defer netlink notifications
      until the device has been fully configured.
      
      This changes ordering of some operations, in particular:
      
      - netlink notifications are sent after all changes have been performed.
        As a side effect this surpresses one unnecessary netlink message when
        the IFF_UP and other flags are changed simultaneously.
      
      - The NETDEV_UP/NETDEV_DOWN and NETDEV_CHANGE notifiers are invoked
        after all changes have been performed. Their relative is unchanged.
      
      - net_dmaengine_put() is invoked before the NETDEV_DOWN notifier instead
        of afterwards. This should not make any difference since both RX and TX
        are already shut down at this point.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd380811
    • P
      rtnetlink: handle rtnl_link netlink notifications manually · a2835763
      Patrick McHardy 提交于
      In order to support specifying device flags during device creation,
      we must be able to roll back device registration in case setting the
      flags fails without sending any notifications related to the device
      to userspace.
      
      This patch changes rollback_registered_many() and register_netdevice()
      to manually send netlink notifications for devices not handled by
      rtnl_link and allows to defer notifications for devices handled by
      rtnl_link until setup is complete.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a2835763
    • J
      netdevice.h: check for CONFIG_WLAN instead of CONFIG_WLAN_80211 · caf66e58
      John W. Linville 提交于
      In "wireless: remove WLAN_80211 and WLAN_PRE80211 from Kconfig" I
      inadvertantly missed a line in include/linux/netdevice.h.  I thereby
      effectively reverted "net: Set LL_MAX_HEADER properly for wireless." by
      accident. :-(  Now we should check there for CONFIG_WLAN instead.
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Reported-by: NChristoph Egger <siccegge@stud.informatik.uni-erlangen.de>
      Cc: stable@kernel.org
      caf66e58
  3. 26 2月, 2010 5 次提交
  4. 25 2月, 2010 2 次提交
  5. 23 2月, 2010 5 次提交
  6. 20 2月, 2010 2 次提交
    • K
      nl80211: add power save commands · ffb9eb3d
      Kalle Valo 提交于
      The most needed command from nl80211, which Wireless Extensions had,
      is support for power save mode. Add a simple command to make it possible
      to enable and disable power save via nl80211.
      
      I was also planning about extending the interface, for example adding the
      timeout value, but after thinking more about this I decided not to do it.
      Basically there were three reasons:
      
      Firstly, the parameters for power save are very much hardware dependent.
      Trying to find a unified interface which would work with all hardware, and
      still make sense to users, will be very difficult.
      
      Secondly, IEEE 802.11 power save implementation in Linux is still in state
      of flux. We have a long way to still to go and there is no way to predict
      what kind of implementation we will have after few years. And because we
      need to support nl80211 interface a long time, practically forever, adding
      now parameters to nl80211 might create maintenance problems later on.
      
      Third issue are the users. Power save parameters are mostly used for
      debugging, so debugfs is better, more flexible, interface for this.
      For example, wpa_supplicant currently doesn't configure anything related
      to power save mode. It's better to strive that kernel can automatically
      optimise the power save parameters, like with help of pm qos network
      and other traffic parameters.
      
      Later on, when we have better understanding of power save, we can extend
      this command with more features, if there's a need for that.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ffb9eb3d
    • P
      Introduce PCMCIA_DEVICE_PROD_ID3 · fbc87d67
      Pavel Roskin 提交于
      ...and use it in hostap_cs and orinoco_cs.
      
      Another PCMCIA device with Intersil Prism chipset has been reported:
      
      Socket 0:
        product info: "Gigabyte", "GN-WLM01_P25L_ADAPTER", "ISL37300P", "Eval-RevA"
        manfid: 0x02e0, 0x1011
        function: 6 (network)
      
      As it's the case with some other Prism based devices, the third ID
      string contains a design name that should be sufficient to identify the
      card as having Intersil Prism chipset and thus compatible with both
      orinoco_cs and hostap_cs.
      
      Introduce PCMCIA_DEVICE_PROD_ID3 that matches the third ID string only.
      
      Use it in orinoco_cs and hostap_cs to match cards with the third ID
      string indicating Prism chipset.  Remove corresponding entries that use
      PCMCIA_DEVICE_PROD_ID123.
      Reported-by: NOzzy <ozzymud@gmail.com>
      Signed-off-by: NPavel Roskin <proski@gnu.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fbc87d67
  7. 19 2月, 2010 10 次提交
  8. 18 2月, 2010 5 次提交
  9. 17 2月, 2010 3 次提交
    • J
      ipv6.h: reassembly: replace calculated magic number with multiplication · 9874c41c
      Joe Perches 提交于
      On Tue, 2010-02-16 at 16:47 +0100, Patrick McHardy wrote:
      > Joe Perches wrote:
      > >> @@ -246,6 +246,8 @@ extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb);
      > >>  int ip6_frag_nqueues(struct net *net);
      > >>  int ip6_frag_mem(struct net *net);
      > >>
      > >> +#define IPV6_FRAG_HIGH_THRESH	262144		/* == 256*1024 */
      > >> +#define IPV6_FRAG_LOW_THRESH	196608		/* == 192*1024 */
      > >>  #define IPV6_FRAG_TIMEOUT	(60*HZ)		/* 60 seconds */
      > >
      > > 196608 isn't a number I want to remember.
      > > Is this better as:
      > >
      > > #define IPV6_FRAG_HIGH_THRESH	(256 * 1024)	/* 262144 */
      > > #define IPV6_FRAG_LOW_THRESH	(192 * 1024)	/* 196608 */
      >
      > Please send a patch, I'll apply it once these patches are in Dave's
      > tree.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9874c41c
    • T
      percpu: add __percpu sparse annotations to net drivers · 47d74275
      Tejun Heo 提交于
      Add __percpu sparse annotations to net drivers.
      
      These annotations are to make sparse consider percpu variables to be
      in a different address space and warn if accessed without going
      through percpu accessors.  This patch doesn't affect normal builds.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47d74275
    • T
      percpu: add __percpu sparse annotations to net · 7d720c3e
      Tejun Heo 提交于
      Add __percpu sparse annotations to net.
      
      These annotations are to make sparse consider percpu variables to be
      in a different address space and warn if accessed without going
      through percpu accessors.  This patch doesn't affect normal builds.
      
      The macro and type tricks around snmp stats make things a bit
      interesting.  DEFINE/DECLARE_SNMP_STAT() macros mark the target field
      as __percpu and SNMP_UPD_PO_STATS() macro is updated accordingly.  All
      snmp_mib_*() users which used to cast the argument to (void **) are
      updated to cast it to (void __percpu **).
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d720c3e