diff options
author | Joe Perches <joe@perches.com> | 2008-03-21 14:06:37 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-26 00:17:45 -0400 |
commit | 446490ca44dcc8a1a9f3c082809bdab208626891 (patch) | |
tree | c03c43be82866695c6793d9d46c838ed5d1e4457 /drivers/net/ixgb/ixgb_hw.c | |
parent | bab2bce7dcea9aaf9374b6c24001d6afcced4ca5 (diff) |
ixgb: convert boolean_t to bool
> send me a patch for e1000 and for ixgb and I'll happily apply those :)
boolean_t to bool
TRUE to true
FALSE to false
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ixgb/ixgb_hw.c')
-rw-r--r-- | drivers/net/ixgb/ixgb_hw.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c index 80a8b9888225..8a04bbd258a6 100644 --- a/drivers/net/ixgb/ixgb_hw.c +++ b/drivers/net/ixgb/ixgb_hw.c | |||
@@ -41,7 +41,7 @@ static void ixgb_mta_set(struct ixgb_hw *hw, uint32_t hash_value); | |||
41 | 41 | ||
42 | static void ixgb_get_bus_info(struct ixgb_hw *hw); | 42 | static void ixgb_get_bus_info(struct ixgb_hw *hw); |
43 | 43 | ||
44 | static boolean_t ixgb_link_reset(struct ixgb_hw *hw); | 44 | static bool ixgb_link_reset(struct ixgb_hw *hw); |
45 | 45 | ||
46 | static void ixgb_optics_reset(struct ixgb_hw *hw); | 46 | static void ixgb_optics_reset(struct ixgb_hw *hw); |
47 | 47 | ||
@@ -60,9 +60,9 @@ static uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw, | |||
60 | uint32_t phy_address, | 60 | uint32_t phy_address, |
61 | uint32_t device_type); | 61 | uint32_t device_type); |
62 | 62 | ||
63 | static boolean_t ixgb_setup_fc(struct ixgb_hw *hw); | 63 | static bool ixgb_setup_fc(struct ixgb_hw *hw); |
64 | 64 | ||
65 | static boolean_t mac_addr_valid(uint8_t *mac_addr); | 65 | static bool mac_addr_valid(uint8_t *mac_addr); |
66 | 66 | ||
67 | static uint32_t ixgb_mac_reset(struct ixgb_hw *hw) | 67 | static uint32_t ixgb_mac_reset(struct ixgb_hw *hw) |
68 | { | 68 | { |
@@ -114,7 +114,7 @@ static uint32_t ixgb_mac_reset(struct ixgb_hw *hw) | |||
114 | * | 114 | * |
115 | * hw - Struct containing variables accessed by shared code | 115 | * hw - Struct containing variables accessed by shared code |
116 | *****************************************************************************/ | 116 | *****************************************************************************/ |
117 | boolean_t | 117 | bool |
118 | ixgb_adapter_stop(struct ixgb_hw *hw) | 118 | ixgb_adapter_stop(struct ixgb_hw *hw) |
119 | { | 119 | { |
120 | uint32_t ctrl_reg; | 120 | uint32_t ctrl_reg; |
@@ -127,13 +127,13 @@ ixgb_adapter_stop(struct ixgb_hw *hw) | |||
127 | */ | 127 | */ |
128 | if(hw->adapter_stopped) { | 128 | if(hw->adapter_stopped) { |
129 | DEBUGOUT("Exiting because the adapter is already stopped!!!\n"); | 129 | DEBUGOUT("Exiting because the adapter is already stopped!!!\n"); |
130 | return FALSE; | 130 | return false; |
131 | } | 131 | } |
132 | 132 | ||
133 | /* Set the Adapter Stopped flag so other driver functions stop | 133 | /* Set the Adapter Stopped flag so other driver functions stop |
134 | * touching the Hardware. | 134 | * touching the Hardware. |
135 | */ | 135 | */ |
136 | hw->adapter_stopped = TRUE; | 136 | hw->adapter_stopped = true; |
137 | 137 | ||
138 | /* Clear interrupt mask to stop board from generating interrupts */ | 138 | /* Clear interrupt mask to stop board from generating interrupts */ |
139 | DEBUGOUT("Masking off all interrupts\n"); | 139 | DEBUGOUT("Masking off all interrupts\n"); |
@@ -286,15 +286,15 @@ ixgb_identify_phy(struct ixgb_hw *hw) | |||
286 | * Leaves the transmit and receive units disabled and uninitialized. | 286 | * Leaves the transmit and receive units disabled and uninitialized. |
287 | * | 287 | * |
288 | * Returns: | 288 | * Returns: |
289 | * TRUE if successful, | 289 | * true if successful, |
290 | * FALSE if unrecoverable problems were encountered. | 290 | * false if unrecoverable problems were encountered. |
291 | *****************************************************************************/ | 291 | *****************************************************************************/ |
292 | boolean_t | 292 | bool |
293 | ixgb_init_hw(struct ixgb_hw *hw) | 293 | ixgb_init_hw(struct ixgb_hw *hw) |
294 | { | 294 | { |
295 | uint32_t i; | 295 | uint32_t i; |
296 | uint32_t ctrl_reg; | 296 | uint32_t ctrl_reg; |
297 | boolean_t status; | 297 | bool status; |
298 | 298 | ||
299 | DEBUGFUNC("ixgb_init_hw"); | 299 | DEBUGFUNC("ixgb_init_hw"); |
300 | 300 | ||
@@ -318,9 +318,8 @@ ixgb_init_hw(struct ixgb_hw *hw) | |||
318 | /* Delay a few ms just to allow the reset to complete */ | 318 | /* Delay a few ms just to allow the reset to complete */ |
319 | msleep(IXGB_DELAY_AFTER_EE_RESET); | 319 | msleep(IXGB_DELAY_AFTER_EE_RESET); |
320 | 320 | ||
321 | if (ixgb_get_eeprom_data(hw) == FALSE) { | 321 | if (!ixgb_get_eeprom_data(hw)) |
322 | return(FALSE); | 322 | return false; |
323 | } | ||
324 | 323 | ||
325 | /* Use the device id to determine the type of phy/transceiver. */ | 324 | /* Use the device id to determine the type of phy/transceiver. */ |
326 | hw->device_id = ixgb_get_ee_device_id(hw); | 325 | hw->device_id = ixgb_get_ee_device_id(hw); |
@@ -337,11 +336,11 @@ ixgb_init_hw(struct ixgb_hw *hw) | |||
337 | */ | 336 | */ |
338 | if (!mac_addr_valid(hw->curr_mac_addr)) { | 337 | if (!mac_addr_valid(hw->curr_mac_addr)) { |
339 | DEBUGOUT("MAC address invalid after ixgb_init_rx_addrs\n"); | 338 | DEBUGOUT("MAC address invalid after ixgb_init_rx_addrs\n"); |
340 | return(FALSE); | 339 | return(false); |
341 | } | 340 | } |
342 | 341 | ||
343 | /* tell the routines in this file they can access hardware again */ | 342 | /* tell the routines in this file they can access hardware again */ |
344 | hw->adapter_stopped = FALSE; | 343 | hw->adapter_stopped = false; |
345 | 344 | ||
346 | /* Fill in the bus_info structure */ | 345 | /* Fill in the bus_info structure */ |
347 | ixgb_get_bus_info(hw); | 346 | ixgb_get_bus_info(hw); |
@@ -661,12 +660,12 @@ ixgb_clear_vfta(struct ixgb_hw *hw) | |||
661 | * hw - Struct containing variables accessed by shared code | 660 | * hw - Struct containing variables accessed by shared code |
662 | *****************************************************************************/ | 661 | *****************************************************************************/ |
663 | 662 | ||
664 | static boolean_t | 663 | static bool |
665 | ixgb_setup_fc(struct ixgb_hw *hw) | 664 | ixgb_setup_fc(struct ixgb_hw *hw) |
666 | { | 665 | { |
667 | uint32_t ctrl_reg; | 666 | uint32_t ctrl_reg; |
668 | uint32_t pap_reg = 0; /* by default, assume no pause time */ | 667 | uint32_t pap_reg = 0; /* by default, assume no pause time */ |
669 | boolean_t status = TRUE; | 668 | bool status = true; |
670 | 669 | ||
671 | DEBUGFUNC("ixgb_setup_fc"); | 670 | DEBUGFUNC("ixgb_setup_fc"); |
672 | 671 | ||
@@ -950,7 +949,7 @@ ixgb_check_for_link(struct ixgb_hw *hw) | |||
950 | 949 | ||
951 | if ((xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) && | 950 | if ((xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) && |
952 | (status_reg & IXGB_STATUS_LU)) { | 951 | (status_reg & IXGB_STATUS_LU)) { |
953 | hw->link_up = TRUE; | 952 | hw->link_up = true; |
954 | } else if (!(xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) && | 953 | } else if (!(xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) && |
955 | (status_reg & IXGB_STATUS_LU)) { | 954 | (status_reg & IXGB_STATUS_LU)) { |
956 | DEBUGOUT("XPCSS Not Aligned while Status:LU is set.\n"); | 955 | DEBUGOUT("XPCSS Not Aligned while Status:LU is set.\n"); |
@@ -974,10 +973,10 @@ ixgb_check_for_link(struct ixgb_hw *hw) | |||
974 | * | 973 | * |
975 | * Called by any function that needs to check the link status of the adapter. | 974 | * Called by any function that needs to check the link status of the adapter. |
976 | *****************************************************************************/ | 975 | *****************************************************************************/ |
977 | boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw) | 976 | bool ixgb_check_for_bad_link(struct ixgb_hw *hw) |
978 | { | 977 | { |
979 | uint32_t newLFC, newRFC; | 978 | uint32_t newLFC, newRFC; |
980 | boolean_t bad_link_returncode = FALSE; | 979 | bool bad_link_returncode = false; |
981 | 980 | ||
982 | if (hw->phy_type == ixgb_phy_type_txn17401) { | 981 | if (hw->phy_type == ixgb_phy_type_txn17401) { |
983 | newLFC = IXGB_READ_REG(hw, LFC); | 982 | newLFC = IXGB_READ_REG(hw, LFC); |
@@ -986,7 +985,7 @@ boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw) | |||
986 | || (hw->lastRFC + 250 < newRFC)) { | 985 | || (hw->lastRFC + 250 < newRFC)) { |
987 | DEBUGOUT | 986 | DEBUGOUT |
988 | ("BAD LINK! too many LFC/RFC since last check\n"); | 987 | ("BAD LINK! too many LFC/RFC since last check\n"); |
989 | bad_link_returncode = TRUE; | 988 | bad_link_returncode = true; |
990 | } | 989 | } |
991 | hw->lastLFC = newLFC; | 990 | hw->lastLFC = newLFC; |
992 | hw->lastRFC = newRFC; | 991 | hw->lastRFC = newRFC; |
@@ -1155,21 +1154,21 @@ ixgb_get_bus_info(struct ixgb_hw *hw) | |||
1155 | * mac_addr - pointer to MAC address. | 1154 | * mac_addr - pointer to MAC address. |
1156 | * | 1155 | * |
1157 | *****************************************************************************/ | 1156 | *****************************************************************************/ |
1158 | static boolean_t | 1157 | static bool |
1159 | mac_addr_valid(uint8_t *mac_addr) | 1158 | mac_addr_valid(uint8_t *mac_addr) |
1160 | { | 1159 | { |
1161 | boolean_t is_valid = TRUE; | 1160 | bool is_valid = true; |
1162 | DEBUGFUNC("mac_addr_valid"); | 1161 | DEBUGFUNC("mac_addr_valid"); |
1163 | 1162 | ||
1164 | /* Make sure it is not a multicast address */ | 1163 | /* Make sure it is not a multicast address */ |
1165 | if (IS_MULTICAST(mac_addr)) { | 1164 | if (IS_MULTICAST(mac_addr)) { |
1166 | DEBUGOUT("MAC address is multicast\n"); | 1165 | DEBUGOUT("MAC address is multicast\n"); |
1167 | is_valid = FALSE; | 1166 | is_valid = false; |
1168 | } | 1167 | } |
1169 | /* Not a broadcast address */ | 1168 | /* Not a broadcast address */ |
1170 | else if (IS_BROADCAST(mac_addr)) { | 1169 | else if (IS_BROADCAST(mac_addr)) { |
1171 | DEBUGOUT("MAC address is broadcast\n"); | 1170 | DEBUGOUT("MAC address is broadcast\n"); |
1172 | is_valid = FALSE; | 1171 | is_valid = false; |
1173 | } | 1172 | } |
1174 | /* Reject the zero address */ | 1173 | /* Reject the zero address */ |
1175 | else if (mac_addr[0] == 0 && | 1174 | else if (mac_addr[0] == 0 && |
@@ -1179,7 +1178,7 @@ mac_addr_valid(uint8_t *mac_addr) | |||
1179 | mac_addr[4] == 0 && | 1178 | mac_addr[4] == 0 && |
1180 | mac_addr[5] == 0) { | 1179 | mac_addr[5] == 0) { |
1181 | DEBUGOUT("MAC address is all zeros\n"); | 1180 | DEBUGOUT("MAC address is all zeros\n"); |
1182 | is_valid = FALSE; | 1181 | is_valid = false; |
1183 | } | 1182 | } |
1184 | return (is_valid); | 1183 | return (is_valid); |
1185 | } | 1184 | } |
@@ -1190,10 +1189,10 @@ mac_addr_valid(uint8_t *mac_addr) | |||
1190 | * | 1189 | * |
1191 | * hw - Struct containing variables accessed by shared code | 1190 | * hw - Struct containing variables accessed by shared code |
1192 | *****************************************************************************/ | 1191 | *****************************************************************************/ |
1193 | static boolean_t | 1192 | static bool |
1194 | ixgb_link_reset(struct ixgb_hw *hw) | 1193 | ixgb_link_reset(struct ixgb_hw *hw) |
1195 | { | 1194 | { |
1196 | boolean_t link_status = FALSE; | 1195 | bool link_status = false; |
1197 | uint8_t wait_retries = MAX_RESET_ITERATIONS; | 1196 | uint8_t wait_retries = MAX_RESET_ITERATIONS; |
1198 | uint8_t lrst_retries = MAX_RESET_ITERATIONS; | 1197 | uint8_t lrst_retries = MAX_RESET_ITERATIONS; |
1199 | 1198 | ||
@@ -1208,7 +1207,7 @@ ixgb_link_reset(struct ixgb_hw *hw) | |||
1208 | link_status = | 1207 | link_status = |
1209 | ((IXGB_READ_REG(hw, STATUS) & IXGB_STATUS_LU) | 1208 | ((IXGB_READ_REG(hw, STATUS) & IXGB_STATUS_LU) |
1210 | && (IXGB_READ_REG(hw, XPCSS) & | 1209 | && (IXGB_READ_REG(hw, XPCSS) & |
1211 | IXGB_XPCSS_ALIGN_STATUS)) ? TRUE : FALSE; | 1210 | IXGB_XPCSS_ALIGN_STATUS)) ? true : false; |
1212 | } while (!link_status && --wait_retries); | 1211 | } while (!link_status && --wait_retries); |
1213 | 1212 | ||
1214 | } while (!link_status && --lrst_retries); | 1213 | } while (!link_status && --lrst_retries); |