diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2011-11-12 23:34:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-13 16:03:54 -0500 |
commit | f9c058b633000e64fba05fc14ba94dd09a20e674 (patch) | |
tree | 4d5875a94f8f8acad4c2f587cab7fcd96dccb89d /drivers/net | |
parent | 00253a8cf3119af6cb07c9de2c08a50d39fc7201 (diff) |
bnx2x: DCBX: use #define instead of magic
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c index a0598fd9be42..5051cf3deb20 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | |||
@@ -874,7 +874,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp, | |||
874 | /*For IEEE admin_recommendation_bw_precentage | 874 | /*For IEEE admin_recommendation_bw_precentage |
875 | *For IEEE admin_recommendation_ets_pg */ | 875 | *For IEEE admin_recommendation_ets_pg */ |
876 | af->pfc.pri_en_bitmap = (u8)dp->admin_pfc_bitmap; | 876 | af->pfc.pri_en_bitmap = (u8)dp->admin_pfc_bitmap; |
877 | for (i = 0; i < 4; i++) { | 877 | for (i = 0; i < DCBX_CONFIG_MAX_APP_PROTOCOL; i++) { |
878 | if (dp->admin_priority_app_table[i].valid) { | 878 | if (dp->admin_priority_app_table[i].valid) { |
879 | struct bnx2x_admin_priority_app_table *table = | 879 | struct bnx2x_admin_priority_app_table *table = |
880 | dp->admin_priority_app_table; | 880 | dp->admin_priority_app_table; |
@@ -2249,7 +2249,7 @@ static int bnx2x_set_admin_app_up(struct bnx2x *bp, u8 idtype, u16 idval, u8 up) | |||
2249 | int i, ff; | 2249 | int i, ff; |
2250 | 2250 | ||
2251 | /* iterate over the app entries looking for idtype and idval */ | 2251 | /* iterate over the app entries looking for idtype and idval */ |
2252 | for (i = 0, ff = -1; i < 4; i++) { | 2252 | for (i = 0, ff = -1; i < DCBX_CONFIG_MAX_APP_PROTOCOL; i++) { |
2253 | struct bnx2x_admin_priority_app_table *app_ent = | 2253 | struct bnx2x_admin_priority_app_table *app_ent = |
2254 | &bp->dcbx_config_params.admin_priority_app_table[i]; | 2254 | &bp->dcbx_config_params.admin_priority_app_table[i]; |
2255 | if (bnx2x_admin_app_is_equal(app_ent, idtype, idval)) | 2255 | if (bnx2x_admin_app_is_equal(app_ent, idtype, idval)) |
@@ -2258,7 +2258,7 @@ static int bnx2x_set_admin_app_up(struct bnx2x *bp, u8 idtype, u16 idval, u8 up) | |||
2258 | if (ff < 0 && !app_ent->valid) | 2258 | if (ff < 0 && !app_ent->valid) |
2259 | ff = i; | 2259 | ff = i; |
2260 | } | 2260 | } |
2261 | if (i < 4) | 2261 | if (i < DCBX_CONFIG_MAX_APP_PROTOCOL) |
2262 | /* if found overwrite up */ | 2262 | /* if found overwrite up */ |
2263 | bp->dcbx_config_params. | 2263 | bp->dcbx_config_params. |
2264 | admin_priority_app_table[i].priority = up; | 2264 | admin_priority_app_table[i].priority = up; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h index 2c6a3bca6f28..2ab9254e2d5e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h | |||
@@ -90,6 +90,7 @@ struct bnx2x_admin_priority_app_table { | |||
90 | u32 app_id; | 90 | u32 app_id; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | #define DCBX_CONFIG_MAX_APP_PROTOCOL 4 | ||
93 | struct bnx2x_config_dcbx_params { | 94 | struct bnx2x_config_dcbx_params { |
94 | u32 overwrite_settings; | 95 | u32 overwrite_settings; |
95 | u32 admin_dcbx_version; | 96 | u32 admin_dcbx_version; |
@@ -109,7 +110,8 @@ struct bnx2x_config_dcbx_params { | |||
109 | u32 admin_recommendation_bw_precentage[8]; | 110 | u32 admin_recommendation_bw_precentage[8]; |
110 | u32 admin_recommendation_ets_pg[8]; | 111 | u32 admin_recommendation_ets_pg[8]; |
111 | u32 admin_pfc_bitmap; | 112 | u32 admin_pfc_bitmap; |
112 | struct bnx2x_admin_priority_app_table admin_priority_app_table[4]; | 113 | struct bnx2x_admin_priority_app_table |
114 | admin_priority_app_table[DCBX_CONFIG_MAX_APP_PROTOCOL]; | ||
113 | u32 admin_default_priority; | 115 | u32 admin_default_priority; |
114 | }; | 116 | }; |
115 | 117 | ||