1. 20 6月, 2013 1 次提交
  2. 18 6月, 2013 2 次提交
  3. 14 6月, 2013 10 次提交
    • S
      NFC: Add secure elements addition and removal API · fed7c25e
      Samuel Ortiz 提交于
      This API will allow NFC drivers to add and remove the secure elements
      they know about or detect. Typically this should be called (asynchronously
      or not) from the driver or the host interface stack detect_se hook.
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      fed7c25e
    • S
      NFC: Extend and fix the internal secure element API · 0a946301
      Samuel Ortiz 提交于
      Secure elements need to be discovered after enabling the NFC controller.
      This is typically done by the NCI core and the HCI drivers (HCI does not
      specify how to discover SEs, it is left to the specific drivers).
      Also, the SE enable/disable API explicitely takes a SE index as its
      argument.
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      0a946301
    • S
      NFC: Remove the static supported_se field · 0b456c41
      Samuel Ortiz 提交于
      Supported secure elements are typically found during a discovery process
      initiated when the NFC controller is up and running. For a given NFC
      chipset there can be many configurations (embedded SE or not, with or
      without a SIM card wired to the NFC controller SWP interface, etc...) and
      thus driver code will never know before hand which SEs are available.
      So we remove this field, it will be replaced by a real SE discovery
      mechanism.
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      0b456c41
    • S
      NFC: pn533: Copy NFCID2 through ATR_REQ · 322bce95
      Samuel Ortiz 提交于
      When using NFC-F we should copy the NFCID2 buffer that we got from
      SENSF_RES through the ATR_REQ NFCID3 buffer. Not doing so violates
      NFC Forum digital requirement #189.
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      322bce95
    • F
      NFC: Add NCI over SPI receive · 391d8a2d
      Frederic Danis 提交于
      Before any operation, driver interruption is de-asserted to prevent
      race condition between TX and RX.
      
      Transaction starts by emitting "Direct read" and acknowledged mode
      bytes. Then packet length is read allowing to allocate correct NCI
      socket buffer. After that payload is retrieved.
      
      A delay after the transaction can be added.
      This delay is determined by the driver during nci_spi_allocate_device()
      call and can be 0.
      
      If acknowledged mode is set:
      - CRC of header and payload is checked
      - if frame reception fails (CRC error): NACK is sent
      - if received frame has ACK or NACK flag: unblock nci_spi_send()
      
      Payload is passed to NCI module.
      
      At the end, driver interruption is re asserted.
      Signed-off-by: NFrederic Danis <frederic.danis@linux.intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      391d8a2d
    • F
      NFC: Add NCI over SPI send · ee9596d4
      Frederic Danis 提交于
      Before any operation, driver interruption is de-asserted to prevent
      race condition between TX and RX.
      
      The NCI over SPI header is added in front of NCI packet.
      If acknowledged mode is set, CRC-16-CCITT is added to the packet.
      Then the packet is forwarded to SPI module to be sent.
      
      A delay after the transaction is added.
      This delay is determined by the driver during nci_spi_allocate_device()
      call and can be 0.
      
      After data has been sent, driver interruption is re-asserted.
      
      If acknowledged mode is set, nci_spi_send will block until
      acknowledgment is received.
      Signed-off-by: NFrederic Danis <frederic.danis@linux.intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      ee9596d4
    • F
      NFC: Add basic NCI over SPI · 8a00a61b
      Frederic Danis 提交于
      The NFC Forum defines a transport interface based on
      Serial Peripheral Interface (SPI) for the NFC Controller
      Interface (NCI).
      
      This module implements the SPI transport of NCI, calling SPI module
      directly to read/write data to NFC controller (NFCC).
      
      NFCC driver should provide functions performing device open and close.
      It should also provide functions asserting/de-asserting interruption
      to prevent TX/RX race conditions.
      NFCC driver can also fix a delay between transactions if needed by
      the hardware.
      Signed-off-by: NFrederic Danis <frederic.danis@linux.intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      8a00a61b
    • E
      NFC: HCI: Implement fw_upload ops · 9a695d23
      Eric Lapuyade 提交于
      This is a simple forward to the HCI driver. When driver is done with the
      operation, it shall directly notify NFC Core by calling
      nfc_fw_upload_done().
      Signed-off-by: NEric Lapuyade <eric.lapuyade@intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      9a695d23
    • E
      NFC: Add firmware upload netlink command · 9674da87
      Eric Lapuyade 提交于
      As several NFC chipsets can have their firmwares upgraded and
      reflashed, this patchset adds a new netlink command to trigger
      that the driver loads or flashes a new firmware. This will allows
      userspace triggered firmware upgrade through netlink.
      The firmware name or hint is passed as a parameter, and the driver
      will eventually fetch the firmware binary through the request_firmware
      API.
      The cmd can only be executed when the nfc dev is not in use. Actual
      firmware loading/flashing is an asynchronous operation. Result of the
      operation shall send a new event up to user space through the nfc dev
      multicast socket. During operation, the nfc dev is not openable and
      thus not usable.
      Signed-off-by: NEric Lapuyade <eric.lapuyade@intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      9674da87
    • F
      NFC: NCI: Fix skb->dev usage · 1095e69f
      Frederic Danis 提交于
      skb->dev is used for carrying a net_device pointer and not
      an nci_dev pointer.
      
      Remove usage of skb-dev to carry nci_dev and replace it by parameter
      in nci_recv_frame(), nci_send_frame() and driver send() functions.
      
      NfcWilink driver is also updated to use those functions.
      Signed-off-by: NFrederic Danis <frederic.danis@linux.intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      1095e69f
  4. 13 6月, 2013 1 次提交
  5. 12 6月, 2013 1 次提交
  6. 11 6月, 2013 2 次提交
  7. 05 6月, 2013 2 次提交
  8. 04 6月, 2013 4 次提交
    • J
      cfg80211: separate internal SME implementation · ceca7b71
      Johannes Berg 提交于
      The current internal SME implementation in cfg80211 is
      very mixed up with the MLME handling, which has been
      causing issues for a long time. There are three things
      that the implementation has to provide:
       * a basic SME implementation for nl80211's connect()
         call (for drivers implementing auth/assoc, which is
         really just mac80211) and wireless extensions
       * MLME events for the userspace SME
       * SME events (connected, disconnected etc.) for all
         different SME implementation possibilities (driver,
         cfg80211 and userspace)
      
      To achieve these goals it isn't necessary to track the
      software SME's connection status outside of it's state
      (which is the part that caused many issues.) Instead,
      track it only in the SME data (wdev->conn) and in the
      general case only track whether the wdev is connected
      or not (via wdev->current_bss.)
      
      Also separate the internal implementation to not have
      callbacks from the SME events, but rather call it from
      the API functions that the driver (or rather mac80211)
      calls. This separates the code better.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ceca7b71
    • J
      cfg80211/mac80211: clean up cfg80211 SME APIs · 6ff57cf8
      Johannes Berg 提交于
      Do some cleanups in the cfg80211 SME APIs, which are
      only used by mac80211.
      
      Most of these functions get a frame passed, and there
      isn't really any reason to export multiple functions
      as cfg80211 can check the frame type instead, do that.
      
      Additionally, the API functions have confusing names
      like cfg80211_send_...() which was meant to indicate
      that it sends an event to userspace, but gets a bit
      confusing when there's both TX and RX and they're not
      all clearly labeled.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      6ff57cf8
    • F
    • J
      cfg80211: take WoWLAN support information out of wiphy struct · 964dc9e2
      Johannes Berg 提交于
      There's no need to take up the space for devices that don't
      support WoWLAN, and most drivers can even make the support
      data static const (except where it's modified at runtime.)
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      964dc9e2
  9. 29 5月, 2013 2 次提交
  10. 27 5月, 2013 1 次提交
  11. 25 5月, 2013 3 次提交
  12. 24 5月, 2013 1 次提交
  13. 17 5月, 2013 5 次提交
  14. 06 5月, 2013 1 次提交
    • K
      net: frag, fix race conditions in LRU list maintenance · b56141ab
      Konstantin Khlebnikov 提交于
      This patch fixes race between inet_frag_lru_move() and inet_frag_lru_add()
      which was introduced in commit 3ef0eb0d
      ("net: frag, move LRU list maintenance outside of rwlock")
      
      One cpu already added new fragment queue into hash but not into LRU.
      Other cpu found it in hash and tries to move it to the end of LRU.
      This leads to NULL pointer dereference inside of list_move_tail().
      
      Another possible race condition is between inet_frag_lru_move() and
      inet_frag_lru_del(): move can happens after deletion.
      
      This patch initializes LRU list head before adding fragment into hash and
      inet_frag_lru_move() doesn't touches it if it's empty.
      
      I saw this kernel oops two times in a couple of days.
      
      [119482.128853] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [119482.132693] IP: [<ffffffff812ede89>] __list_del_entry+0x29/0xd0
      [119482.136456] PGD 2148f6067 PUD 215ab9067 PMD 0
      [119482.140221] Oops: 0000 [#1] SMP
      [119482.144008] Modules linked in: vfat msdos fat 8021q fuse nfsd auth_rpcgss nfs_acl nfs lockd sunrpc ppp_async ppp_generic bridge slhc stp llc w83627ehf hwmon_vid snd_hda_codec_hdmi snd_hda_codec_realtek kvm_amd k10temp kvm snd_hda_intel snd_hda_codec edac_core radeon snd_hwdep ath9k snd_pcm ath9k_common snd_page_alloc ath9k_hw snd_timer snd soundcore drm_kms_helper ath ttm r8169 mii
      [119482.152692] CPU 3
      [119482.152721] Pid: 20, comm: ksoftirqd/3 Not tainted 3.9.0-zurg-00001-g9f95269 #132 To Be Filled By O.E.M. To Be Filled By O.E.M./RS880D
      [119482.161478] RIP: 0010:[<ffffffff812ede89>]  [<ffffffff812ede89>] __list_del_entry+0x29/0xd0
      [119482.166004] RSP: 0018:ffff880216d5db58  EFLAGS: 00010207
      [119482.170568] RAX: 0000000000000000 RBX: ffff88020882b9c0 RCX: dead000000200200
      [119482.175189] RDX: 0000000000000000 RSI: 0000000000000880 RDI: ffff88020882ba00
      [119482.179860] RBP: ffff880216d5db58 R08: ffffffff8155c7f0 R09: 0000000000000014
      [119482.184570] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88020882ba00
      [119482.189337] R13: ffffffff81c8d780 R14: ffff880204357f00 R15: 00000000000005a0
      [119482.194140] FS:  00007f58124dc700(0000) GS:ffff88021fcc0000(0000) knlGS:0000000000000000
      [119482.198928] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [119482.203711] CR2: 0000000000000000 CR3: 00000002155f0000 CR4: 00000000000007e0
      [119482.208533] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [119482.213371] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [119482.218221] Process ksoftirqd/3 (pid: 20, threadinfo ffff880216d5c000, task ffff880216d3a9a0)
      [119482.223113] Stack:
      [119482.228004]  ffff880216d5dbd8 ffffffff8155dcda 0000000000000000 ffff000200000001
      [119482.233038]  ffff8802153c1f00 ffff880000289440 ffff880200000014 ffff88007bc72000
      [119482.238083]  00000000000079d5 ffff88007bc72f44 ffffffff00000002 ffff880204357f00
      [119482.243090] Call Trace:
      [119482.248009]  [<ffffffff8155dcda>] ip_defrag+0x8fa/0xd10
      [119482.252921]  [<ffffffff815a8013>] ipv4_conntrack_defrag+0x83/0xe0
      [119482.257803]  [<ffffffff8154485b>] nf_iterate+0x8b/0xa0
      [119482.262658]  [<ffffffff8155c7f0>] ? inet_del_offload+0x40/0x40
      [119482.267527]  [<ffffffff815448e4>] nf_hook_slow+0x74/0x130
      [119482.272412]  [<ffffffff8155c7f0>] ? inet_del_offload+0x40/0x40
      [119482.277302]  [<ffffffff8155d068>] ip_rcv+0x268/0x320
      [119482.282147]  [<ffffffff81519992>] __netif_receive_skb_core+0x612/0x7e0
      [119482.286998]  [<ffffffff81519b78>] __netif_receive_skb+0x18/0x60
      [119482.291826]  [<ffffffff8151a650>] process_backlog+0xa0/0x160
      [119482.296648]  [<ffffffff81519f29>] net_rx_action+0x139/0x220
      [119482.301403]  [<ffffffff81053707>] __do_softirq+0xe7/0x220
      [119482.306103]  [<ffffffff81053868>] run_ksoftirqd+0x28/0x40
      [119482.310809]  [<ffffffff81074f5f>] smpboot_thread_fn+0xff/0x1a0
      [119482.315515]  [<ffffffff81074e60>] ? lg_local_lock_cpu+0x40/0x40
      [119482.320219]  [<ffffffff8106d870>] kthread+0xc0/0xd0
      [119482.324858]  [<ffffffff8106d7b0>] ? insert_kthread_work+0x40/0x40
      [119482.329460]  [<ffffffff816c32dc>] ret_from_fork+0x7c/0xb0
      [119482.334057]  [<ffffffff8106d7b0>] ? insert_kthread_work+0x40/0x40
      [119482.338661] Code: 00 00 55 48 8b 17 48 b9 00 01 10 00 00 00 ad de 48 8b 47 08 48 89 e5 48 39 ca 74 29 48 b9 00 02 20 00 00 00 ad de 48 39 c8 74 7a <4c> 8b 00 4c 39 c7 75 53 4c 8b 42 08 4c 39 c7 75 2b 48 89 42 08
      [119482.343787] RIP  [<ffffffff812ede89>] __list_del_entry+0x29/0xd0
      [119482.348675]  RSP <ffff880216d5db58>
      [119482.353493] CR2: 0000000000000000
      
      Oops happened on this path:
      ip_defrag() -> ip_frag_queue() -> inet_frag_lru_move() -> list_move_tail() -> __list_del_entry()
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: David S. Miller <davem@davemloft.net>
      Acked-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b56141ab
  15. 02 5月, 2013 1 次提交
    • E
      af_unix: fix a fatal race with bit fields · 60bc851a
      Eric Dumazet 提交于
      Using bit fields is dangerous on ppc64/sparc64, as the compiler [1]
      uses 64bit instructions to manipulate them.
      If the 64bit word includes any atomic_t or spinlock_t, we can lose
      critical concurrent changes.
      
      This is happening in af_unix, where unix_sk(sk)->gc_candidate/
      gc_maybe_cycle/lock share the same 64bit word.
      
      This leads to fatal deadlock, as one/several cpus spin forever
      on a spinlock that will never be available again.
      
      A safer way would be to use a long to store flags.
      This way we are sure compiler/arch wont do bad things.
      
      As we own unix_gc_lock spinlock when clearing or setting bits,
      we can use the non atomic __set_bit()/__clear_bit().
      
      recursion_level can share the same 64bit location with the spinlock,
      as it is set only with this spinlock held.
      
      [1] bug fixed in gcc-4.8.0 :
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52080Reported-by: NAmbrose Feinstein <ambrose@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60bc851a
  16. 30 4月, 2013 3 次提交
    • D
      hostap: Don't use create_proc_read_entry() · 6bbefe86
      David Howells 提交于
      Don't use create_proc_read_entry() as that is deprecated, but rather use
      proc_create_data() and seq_file instead.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc: Jouni Malinen <j@w1.fi>
      cc: John W. Linville <linville@tuxdriver.com>
      cc: Johannes Berg <johannes@sipsolutions.net>
      cc: linux-wireless@vger.kernel.org
      cc: netdev@vger.kernel.org
      cc: devel@driverdev.osuosl.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6bbefe86
    • E
      net: defer net_secret[] initialization · aebda156
      Eric Dumazet 提交于
      Instead of feeding net_secret[] at boot time, defer the init
      at the point first socket is created.
      
      This permits some platforms to use better entropy sources than
      the ones available at boot time.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aebda156
    • S
      sctp: Correct type and usage of sctp_end_cksum() · eee1d5a1
      Simon Horman 提交于
      Change the type of the crc32 parameter of sctp_end_cksum()
      from __be32 to __u32 to reflect that fact that it is passed
      to cpu_to_le32().
      
      There are five in-tree users of sctp_end_cksum().
      The following four had warnings flagged by sparse which are
      no longer present with this change.
      
      net/netfilter/ipvs/ip_vs_proto_sctp.c:sctp_nat_csum()
      net/netfilter/ipvs/ip_vs_proto_sctp.c:sctp_csum_check()
      net/sctp/input.c:sctp_rcv_checksum()
      net/sctp/output.c:sctp_packet_transmit()
      
      The fifth user is net/netfilter/nf_nat_proto_sctp.c:sctp_manip_pkt().
      It has been updated to pass a __u32 instead of a __be32,
      the value in question was already calculated in cpu byte-order.
      
      net/netfilter/nf_nat_proto_sctp.c:sctp_manip_pkt() has also
      been updated to assign the return value of sctp_end_cksum()
      directly to a variable of type __le32, matching the
      type of the return value. Previously the return value
      was assigned to a variable of type __be32 and then that variable
      was finally assigned to another variable of type __le32.
      
      Problems flagged by sparse.
      Compile and sparse tested only.
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      eee1d5a1