1. 15 3月, 2014 3 次提交
  2. 11 3月, 2014 1 次提交
  3. 24 2月, 2014 5 次提交
  4. 17 2月, 2014 6 次提交
  5. 19 1月, 2014 1 次提交
  6. 15 1月, 2014 1 次提交
  7. 08 1月, 2014 2 次提交
  8. 07 1月, 2014 4 次提交
  9. 06 1月, 2014 1 次提交
  10. 04 1月, 2014 7 次提交
  11. 19 12月, 2013 1 次提交
  12. 11 12月, 2013 1 次提交
  13. 21 11月, 2013 1 次提交
    • H
      net: rework recvmsg handler msg_name and msg_namelen logic · f3d33426
      Hannes Frederic Sowa 提交于
      This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
      set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
      to return msg_name to the user.
      
      This prevents numerous uninitialized memory leaks we had in the
      recvmsg handlers and makes it harder for new code to accidentally leak
      uninitialized memory.
      
      Optimize for the case recvfrom is called with NULL as address. We don't
      need to copy the address at all, so set it to NULL before invoking the
      recvmsg handler. We can do so, because all the recvmsg handlers must
      cope with the case a plain read() is called on them. read() also sets
      msg_name to NULL.
      
      Also document these changes in include/linux/net.h as suggested by David
      Miller.
      
      Changes since RFC:
      
      Set msg->msg_name = NULL if user specified a NULL in msg_name but had a
      non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
      affect sendto as it would bail out earlier while trying to copy-in the
      address. It also more naturally reflects the logic by the callers of
      verify_iovec.
      
      With this change in place I could remove "
      if (!uaddr || msg_sys->msg_namelen == 0)
      	msg->msg_name = NULL
      ".
      
      This change does not alter the user visible error logic as we ignore
      msg_namelen as long as msg_name is NULL.
      
      Also remove two unnecessary curly brackets in ___sys_recvmsg and change
      comments to netdev style.
      
      Cc: David Miller <davem@davemloft.net>
      Suggested-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3d33426
  14. 20 11月, 2013 3 次提交
  15. 15 11月, 2013 1 次提交
  16. 07 10月, 2013 1 次提交
  17. 25 9月, 2013 1 次提交
    • E
      NFC: NCI: Modify NCI SPI to implement CS/INT handshake per the spec · 2bed2785
      Eric Lapuyade 提交于
      The NFC Forum NCI specification defines both a hardware and software
      protocol when using a SPI physical transport to connect an NFC NCI
      Chipset. The hardware requirement is that, after having raised the chip
      select line, the SPI driver must wait for an INT line from the NFC
      chipset to raise before it sends the data. The chip select must be
      raised first though, because this is the signal that the NFC chipset
      will detect to wake up and then raise its INT line. If the INT line
      doesn't raise in a timely fashion, the SPI driver should abort
      operation.
      
      When data is transferred from Device host (DH) to NFC Controller (NFCC),
      the signaling sequence is the following:
      
      Data Transfer from DH to NFCC
      • 1-Master asserts SPI_CSN
      • 2-Slave asserts SPI_INT
      • 3-Master sends NCI-over-SPI protocol header and payload data
      • 4-Slave deasserts SPI_INT
      • 5-Master deasserts SPI_CSN
      
      When data must be transferred from NFCC to DH, things are a little bit
      different.
      
      Data Transfer from NFCC to DH
      • 1-Slave asserts SPI_INT -> NFC chipset irq handler called -> process
      reading from SPI
      • 2-Master asserts SPI_CSN
      • 3-Master send 2-octet NCI-over-SPI protocol header
      • 4-Slave sends 2-octet NCI-over-SPI protocol payload length
      • 5-Slave sends NCI-over-SPI protocol payload
      • 6-Master deasserts SPI_CSN
      
      In this case, SPI driver should function normally as it does today. Note
      that the INT line can and will be lowered anytime between beginning of
      step 3 and end of step 5. A low INT is therefore valid after chip select
      has been raised.
      
      This would be easily implemented in a single driver. Unfortunately, we
      don't write the SPI driver and I had to imagine some workaround trick to
      get the SPI and NFC drivers to work in a synchronized fashion. The trick
      is the following:
      
      - send an empty spi message: this will raise the chip select line, and
      send nothing. We expect the /CS line will stay arisen because we asked
      for it in the spi_transfer cs_change field
      - wait for a completion, that will be completed by the NFC driver IRQ
      handler when it knows we are in the process of sending data (NFC spec
      says that we use SPI in a half duplex mode, so we are either sending or
      receiving).
      - when completed, proceed with the normal data send.
      
      This has been tested and verified to work very consistently on a Nexus
      10 (spi-s3c64xx driver). It may not work the same with other spi
      drivers.
      
      The previously defined nci_spi_ops{} whose intended purpose were to
      address this problem are not used anymore and therefore totally removed.
      
      The nci_spi_send() takes a new optional write_handshake_completion
      completion pointer. If non NULL, the nci spi layer will run the above
      trick when sending data to the NFC Chip. If NULL, the data is sent
      normally all at once and it is then the NFC driver responsibility to
      know what it's doing.
      Signed-off-by: NEric Lapuyade <eric.lapuyade@intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      2bed2785