mlxsw: pci: Add max span resources to resources query
authorNogah Frankel <nogahf@mellanox.com>
Thu, 21 Jul 2016 10:03:10 +0000 (12:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2016 06:11:59 +0000 (23:11 -0700)
Add max span resources to resources query.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/pci.c

index d57ad0db44bd64ed783499c4b730ad00a8cadf27..d3476ead998285b68c95eb4ad3ac2a38f0b703d2 100644 (file)
@@ -268,6 +268,8 @@ struct mlxsw_driver {
 };
 
 struct mlxsw_resources {
+       u8      max_span_valid:1;
+       u8      max_span;
 };
 
 struct mlxsw_resources *mlxsw_core_resources_get(struct mlxsw_core *mlxsw_core);
index a724b6692c0d4a7e0dbd9d753866a36b5a6cca09..1d1360c178bb5df47009a2174b688974b8f3db31 100644 (file)
@@ -1155,6 +1155,7 @@ mlxsw_pci_config_profile_swid_config(struct mlxsw_pci *mlxsw_pci,
 }
 
 #define MLXSW_RESOURCES_TABLE_END_ID 0xffff
+#define MLXSW_MAX_SPAN_ID 0x2420
 #define MLXSW_RESOURCES_QUERY_MAX_QUERIES 100
 #define MLXSW_RESOURCES_PER_QUERY 32
 
@@ -1162,6 +1163,10 @@ static void mlxsw_pci_resources_query_parse(int id, u64 val,
                                            struct mlxsw_resources *resources)
 {
        switch (id) {
+       case MLXSW_MAX_SPAN_ID:
+               resources->max_span = val;
+               resources->max_span_valid = 1;
+               break;
        default:
                break;
        }