1. 01 Jan, 2023 2 commits
    • Christian Marangi's avatar
      net: dsa: tag_qca: fix wrong MGMT_DATA2 size · d9dba91b
      Christian Marangi authored
      It was discovered that MGMT_DATA2 can contain up to 28 bytes of data
      instead of the 12 bytes written in the Documentation by accounting the
      limit of 16 bytes declared in Documentation subtracting the first 4 byte
      in the packet header.
      
      Update the define with the real world value.
      Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Fixes: c2ee8181 ("net: dsa: tag_qca: add define for handling mgmt Ethernet packet")
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Cc: stable@vger.kernel.org # v5.18+
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9dba91b
    • Christian Marangi's avatar
      net: dsa: qca8k: fix wrong length value for mgmt eth packet · 9807ae69
      Christian Marangi authored
      The assumption that Documentation was right about how this value work was
      wrong. It was discovered that the length value of the mgmt header is in
      step of word size.
      
      As an example to process 4 byte of data the correct length to set is 2.
      To process 8 byte 4, 12 byte 6, 16 byte 8...
      
      Odd values will always return the next size on the ack packet.
      (length of 3 (6 byte) will always return 8 bytes of data)
      
      This means that a value of 15 (0xf) actually means reading/writing 32 bytes
      of data instead of 16 bytes. This behaviour is totally absent and not
      documented in the switch Documentation.
      
      In fact from Documentation the max value that mgmt eth can process is
      16 byte of data while in reality it can process 32 bytes at once.
      
      To handle this we always round up the length after deviding it for word
      size. We check if the result is odd and we round another time to align
      to what the switch will provide in the ack packet.
      The workaround for the length limit of 15 is still needed as the length
      reg max value is 0xf(15)
      Reported-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Fixes: 90386223 ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet")
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Cc: stable@vger.kernel.org # v5.18+
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9807ae69
  2. 30 Dec, 2022 18 commits
  3. 28 Dec, 2022 20 commits