• Vladimir Oltean's avatar
    net: dsa: sja1105: fix static FDB writes for SJA1110 · cb81698f
    Vladimir Oltean authored
    The blamed commit made FDB access on SJA1110 functional only as far as
    dumping the existing entries goes, but anything having to do with an
    entry's index (adding, deleting) is still broken.
    
    There are in fact 2 problems, all caused by improperly inheriting the
    code from SJA1105P/Q/R/S:
    - An entry size is SJA1110_SIZE_L2_LOOKUP_ENTRY (24) bytes and not
      SJA1105PQRS_SIZE_L2_LOOKUP_ENTRY (20) bytes
    - The "index" field within an FDB entry is at bits 10:1 for SJA1110 and
      not 15:6 as in SJA1105P/Q/R/S
    
    This patch moves the packing function for the cmd->index outside of
    sja1105pqrs_common_l2_lookup_cmd_packing() and into the device specific
    functions sja1105pqrs_l2_lookup_cmd_packing and
    sja1110_l2_lookup_cmd_packing.
    
    Fixes: 74e7feff ("net: dsa: sja1105: fix dynamic access to L2 Address Lookup table for SJA1110")
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    cb81698f
sja1105_dynamic_config.c 47.5 KB