Commit 446490ca authored by Joe Perches's avatar Joe Perches Committed by Jeff Garzik
Browse files

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAuke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent bab2bce7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -173,15 +173,15 @@ struct ixgb_adapter {
	uint64_t hw_csum_tx_error;
	uint32_t tx_int_delay;
	uint32_t tx_timeout_count;
	boolean_t tx_int_delay_enable;
	boolean_t detect_tx_hung;
	bool tx_int_delay_enable;
	bool detect_tx_hung;

	/* RX */
	struct ixgb_desc_ring rx_ring;
	uint64_t hw_csum_rx_error;
	uint64_t hw_csum_rx_good;
	uint32_t rx_int_delay;
	boolean_t rx_csum;
	bool rx_csum;

	/* OS defined structs */
	struct napi_struct napi;
@@ -194,7 +194,7 @@ struct ixgb_adapter {
	u16 msg_enable;
	struct ixgb_hw_stats stats;
	uint32_t alloc_rx_buff_failed;
	boolean_t have_msi;
	bool have_msi;
	unsigned long flags;
};

+25 −25
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static void ixgb_shift_out_bits(struct ixgb_hw *hw,
				uint16_t count);
static void ixgb_standby_eeprom(struct ixgb_hw *hw);

static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw);
static bool ixgb_wait_eeprom_command(struct ixgb_hw *hw);

static void ixgb_cleanup_eeprom(struct ixgb_hw *hw);

@@ -279,10 +279,10 @@ ixgb_cleanup_eeprom(struct ixgb_hw *hw)
 * The command is done when the EEPROM's data out pin goes high.
 *
 * Returns:
 *      TRUE: EEPROM data pin is high before timeout.
 *      FALSE:  Time expired.
 *      true: EEPROM data pin is high before timeout.
 *      false:  Time expired.
 *****************************************************************************/
static boolean_t
static bool
ixgb_wait_eeprom_command(struct ixgb_hw *hw)
{
	uint32_t eecd_reg;
@@ -301,12 +301,12 @@ ixgb_wait_eeprom_command(struct ixgb_hw *hw)
		eecd_reg = IXGB_READ_REG(hw, EECD);

		if(eecd_reg & IXGB_EECD_DO)
			return (TRUE);
			return (true);

		udelay(50);
	}
	ASSERT(0);
	return (FALSE);
	return (false);
}

/******************************************************************************
@@ -319,10 +319,10 @@ ixgb_wait_eeprom_command(struct ixgb_hw *hw)
 * valid.
 *
 * Returns:
 *  TRUE: Checksum is valid
 *  FALSE: Checksum is not valid.
 *  true: Checksum is valid
 *  false: Checksum is not valid.
 *****************************************************************************/
boolean_t
bool
ixgb_validate_eeprom_checksum(struct ixgb_hw *hw)
{
	uint16_t checksum = 0;
@@ -332,9 +332,9 @@ ixgb_validate_eeprom_checksum(struct ixgb_hw *hw)
		checksum += ixgb_read_eeprom(hw, i);

	if(checksum == (uint16_t) EEPROM_SUM)
		return (TRUE);
		return (true);
	else
		return (FALSE);
		return (false);
}

/******************************************************************************
@@ -457,10 +457,10 @@ ixgb_read_eeprom(struct ixgb_hw *hw,
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *      TRUE: if eeprom read is successful
 *      FALSE: otherwise.
 *      true: if eeprom read is successful
 *      false: otherwise.
 *****************************************************************************/
boolean_t
bool
ixgb_get_eeprom_data(struct ixgb_hw *hw)
{
	uint16_t i;
@@ -484,16 +484,16 @@ ixgb_get_eeprom_data(struct ixgb_hw *hw)
		/* clear the init_ctrl_reg_1 to signify that the cache is
		 * invalidated */
		ee_map->init_ctrl_reg_1 = cpu_to_le16(EEPROM_ICW1_SIGNATURE_CLEAR);
		return (FALSE);
		return (false);
	}

	if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK))
		 != cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) {
		DEBUGOUT("ixgb_ee: Signature invalid.\n");
		return(FALSE);
		return(false);
	}

	return(TRUE);
	return(true);
}

/******************************************************************************
@@ -503,17 +503,17 @@ ixgb_get_eeprom_data(struct ixgb_hw *hw)
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *      TRUE: eeprom signature was good and the eeprom read was successful
 *      FALSE: otherwise.
 *      true: eeprom signature was good and the eeprom read was successful
 *      false: otherwise.
 ******************************************************************************/
static boolean_t
static bool
ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw)
{
	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;

	if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK))
	    == cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) {
		return (TRUE);
		return (true);
	} else {
		return ixgb_get_eeprom_data(hw);
	}
@@ -533,7 +533,7 @@ ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index)
{

	if ((index < IXGB_EEPROM_SIZE) &&
		(ixgb_check_and_get_eeprom_data(hw) == TRUE)) {
		(ixgb_check_and_get_eeprom_data(hw) == true)) {
	   return(hw->eeprom[index]);
	}

@@ -557,7 +557,7 @@ ixgb_get_ee_mac_addr(struct ixgb_hw *hw,

	DEBUGFUNC("ixgb_get_ee_mac_addr");

	if (ixgb_check_and_get_eeprom_data(hw) == TRUE) {
	if (ixgb_check_and_get_eeprom_data(hw) == true) {
		for (i = 0; i < IXGB_ETH_LENGTH_OF_ADDRESS; i++) {
			mac_addr[i] = ee_map->mac_addr[i];
			DEBUGOUT2("mac(%d) = %.2X\n", i, mac_addr[i]);
@@ -577,7 +577,7 @@ ixgb_get_ee_mac_addr(struct ixgb_hw *hw,
uint32_t
ixgb_get_ee_pba_number(struct ixgb_hw *hw)
{
	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
	if (ixgb_check_and_get_eeprom_data(hw) == true)
		return (le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG])
			| (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16));

@@ -598,7 +598,7 @@ ixgb_get_ee_device_id(struct ixgb_hw *hw)
{
	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;

	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
	if (ixgb_check_and_get_eeprom_data(hw) == true)
		return (le16_to_cpu(ee_map->device_id));

	return (0);
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ struct ixgb_ee_map_type {
/* EEPROM Functions */
uint16_t ixgb_read_eeprom(struct ixgb_hw *hw, uint16_t reg);

boolean_t ixgb_validate_eeprom_checksum(struct ixgb_hw *hw);
bool ixgb_validate_eeprom_checksum(struct ixgb_hw *hw);

void ixgb_update_eeprom_checksum(struct ixgb_hw *hw);

+5 −5
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
#include <asm/uaccess.h>

extern int ixgb_up(struct ixgb_adapter *adapter);
extern void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog);
extern void ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog);
extern void ixgb_reset(struct ixgb_adapter *adapter);
extern int ixgb_setup_rx_resources(struct ixgb_adapter *adapter);
extern int ixgb_setup_tx_resources(struct ixgb_adapter *adapter);
@@ -136,7 +136,7 @@ ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
		return -EINVAL;
	
	if(netif_running(adapter->netdev)) {
		ixgb_down(adapter, TRUE);
		ixgb_down(adapter, true);
		ixgb_reset(adapter);
		ixgb_up(adapter);
		ixgb_set_speed_duplex(netdev);
@@ -185,7 +185,7 @@ ixgb_set_pauseparam(struct net_device *netdev,
		hw->fc.type = ixgb_fc_none;

	if(netif_running(adapter->netdev)) {
		ixgb_down(adapter, TRUE);
		ixgb_down(adapter, true);
		ixgb_up(adapter);
		ixgb_set_speed_duplex(netdev);
	} else
@@ -210,7 +210,7 @@ ixgb_set_rx_csum(struct net_device *netdev, uint32_t data)
	adapter->rx_csum = data;

	if(netif_running(netdev)) {
		ixgb_down(adapter,TRUE);
		ixgb_down(adapter, true);
		ixgb_up(adapter);
		ixgb_set_speed_duplex(netdev);
	} else
@@ -570,7 +570,7 @@ ixgb_set_ringparam(struct net_device *netdev,
		return -EINVAL;

	if(netif_running(adapter->netdev))
		ixgb_down(adapter,TRUE);
		ixgb_down(adapter, true);

	rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD);
	rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD);
+28 −29
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ static void ixgb_mta_set(struct ixgb_hw *hw, uint32_t hash_value);

static void ixgb_get_bus_info(struct ixgb_hw *hw);

static boolean_t ixgb_link_reset(struct ixgb_hw *hw);
static bool ixgb_link_reset(struct ixgb_hw *hw);

static void ixgb_optics_reset(struct ixgb_hw *hw);

@@ -60,9 +60,9 @@ static uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
				  uint32_t phy_address,
				  uint32_t device_type);

static boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
static bool ixgb_setup_fc(struct ixgb_hw *hw);

static boolean_t mac_addr_valid(uint8_t *mac_addr);
static bool mac_addr_valid(uint8_t *mac_addr);

static uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
{
@@ -114,7 +114,7 @@ static uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 *
 * hw - Struct containing variables accessed by shared code
 *****************************************************************************/
boolean_t
bool
ixgb_adapter_stop(struct ixgb_hw *hw)
{
	uint32_t ctrl_reg;
@@ -127,13 +127,13 @@ ixgb_adapter_stop(struct ixgb_hw *hw)
	 */
	if(hw->adapter_stopped) {
		DEBUGOUT("Exiting because the adapter is already stopped!!!\n");
		return FALSE;
		return false;
	}

	/* Set the Adapter Stopped flag so other driver functions stop
	 * touching the Hardware.
	 */
	hw->adapter_stopped = TRUE;
	hw->adapter_stopped = true;

	/* Clear interrupt mask to stop board from generating interrupts */
	DEBUGOUT("Masking off all interrupts\n");
@@ -286,15 +286,15 @@ ixgb_identify_phy(struct ixgb_hw *hw)
 * Leaves the transmit and receive units disabled and uninitialized.
 *
 * Returns:
 *      TRUE if successful,
 *      FALSE if unrecoverable problems were encountered.
 *      true if successful,
 *      false if unrecoverable problems were encountered.
 *****************************************************************************/
boolean_t
bool
ixgb_init_hw(struct ixgb_hw *hw)
{
	uint32_t i;
	uint32_t ctrl_reg;
	boolean_t status;
	bool status;

	DEBUGFUNC("ixgb_init_hw");

@@ -318,9 +318,8 @@ ixgb_init_hw(struct ixgb_hw *hw)
	/* Delay a few ms just to allow the reset to complete */
	msleep(IXGB_DELAY_AFTER_EE_RESET);

	if (ixgb_get_eeprom_data(hw) == FALSE) {
		return(FALSE);
	}
	if (!ixgb_get_eeprom_data(hw))
		return false;

	/* Use the device id to determine the type of phy/transceiver. */
	hw->device_id = ixgb_get_ee_device_id(hw);
@@ -337,11 +336,11 @@ ixgb_init_hw(struct ixgb_hw *hw)
	 */
	if (!mac_addr_valid(hw->curr_mac_addr)) {
		DEBUGOUT("MAC address invalid after ixgb_init_rx_addrs\n");
		return(FALSE);
		return(false);
	}

	/* tell the routines in this file they can access hardware again */
	hw->adapter_stopped = FALSE;
	hw->adapter_stopped = false;

	/* Fill in the bus_info structure */
	ixgb_get_bus_info(hw);
@@ -661,12 +660,12 @@ ixgb_clear_vfta(struct ixgb_hw *hw)
 * hw - Struct containing variables accessed by shared code
 *****************************************************************************/

static boolean_t
static bool
ixgb_setup_fc(struct ixgb_hw *hw)
{
	uint32_t ctrl_reg;
	uint32_t pap_reg = 0;   /* by default, assume no pause time */
	boolean_t status = TRUE;
	bool status = true;

	DEBUGFUNC("ixgb_setup_fc");

@@ -950,7 +949,7 @@ ixgb_check_for_link(struct ixgb_hw *hw)

	if ((xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) &&
	    (status_reg & IXGB_STATUS_LU)) {
		hw->link_up = TRUE;
		hw->link_up = true;
	} else if (!(xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) &&
		   (status_reg & IXGB_STATUS_LU)) {
		DEBUGOUT("XPCSS Not Aligned while Status:LU is set.\n");
@@ -974,10 +973,10 @@ ixgb_check_for_link(struct ixgb_hw *hw)
 *
 * Called by any function that needs to check the link status of the adapter.
 *****************************************************************************/
boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw)
bool ixgb_check_for_bad_link(struct ixgb_hw *hw)
{
	uint32_t newLFC, newRFC;
	boolean_t bad_link_returncode = FALSE;
	bool bad_link_returncode = false;

	if (hw->phy_type == ixgb_phy_type_txn17401) {
		newLFC = IXGB_READ_REG(hw, LFC);
@@ -986,7 +985,7 @@ boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw)
		    || (hw->lastRFC + 250 < newRFC)) {
			DEBUGOUT
			    ("BAD LINK! too many LFC/RFC since last check\n");
			bad_link_returncode = TRUE;
			bad_link_returncode = true;
		}
		hw->lastLFC = newLFC;
		hw->lastRFC = newRFC;
@@ -1155,21 +1154,21 @@ ixgb_get_bus_info(struct ixgb_hw *hw)
 * mac_addr - pointer to MAC address.
 *
 *****************************************************************************/
static boolean_t
static bool
mac_addr_valid(uint8_t *mac_addr)
{
	boolean_t is_valid = TRUE;
	bool is_valid = true;
	DEBUGFUNC("mac_addr_valid");

	/* Make sure it is not a multicast address */
	if (IS_MULTICAST(mac_addr)) {
		DEBUGOUT("MAC address is multicast\n");
		is_valid = FALSE;
		is_valid = false;
	}
	/* Not a broadcast address */
	else if (IS_BROADCAST(mac_addr)) {
		DEBUGOUT("MAC address is broadcast\n");
		is_valid = FALSE;
		is_valid = false;
	}
	/* Reject the zero address */
	else if (mac_addr[0] == 0 &&
@@ -1179,7 +1178,7 @@ mac_addr_valid(uint8_t *mac_addr)
			 mac_addr[4] == 0 &&
			 mac_addr[5] == 0) {
		DEBUGOUT("MAC address is all zeros\n");
		is_valid = FALSE;
		is_valid = false;
	}
	return (is_valid);
}
@@ -1190,10 +1189,10 @@ mac_addr_valid(uint8_t *mac_addr)
 *
 * hw - Struct containing variables accessed by shared code
 *****************************************************************************/
static boolean_t
static bool
ixgb_link_reset(struct ixgb_hw *hw)
{
	boolean_t link_status = FALSE;
	bool link_status = false;
	uint8_t wait_retries = MAX_RESET_ITERATIONS;
	uint8_t lrst_retries = MAX_RESET_ITERATIONS;

@@ -1208,7 +1207,7 @@ ixgb_link_reset(struct ixgb_hw *hw)
			link_status =
			    ((IXGB_READ_REG(hw, STATUS) & IXGB_STATUS_LU)
			     && (IXGB_READ_REG(hw, XPCSS) &
				 IXGB_XPCSS_ALIGN_STATUS)) ? TRUE : FALSE;
				 IXGB_XPCSS_ALIGN_STATUS)) ? true : false;
		} while (!link_status && --wait_retries);

	} while (!link_status && --lrst_retries);
Loading