aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-03-21 14:06:25 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-26 00:17:42 -0400
commitc3033b01d763aff572080db09ddcebed115b9cf5 (patch)
treeb75bb33ba85185c9d6775ceafad09a103f643b35 /drivers/net/e1000/e1000_main.c
parentf89e6e3834035c6e8203042f3527931aa7f52496 (diff)
e1000: Convert boolean_t to bool
On Thu, 2008-03-06 at 10:07 -0800, Kok, Auke wrote: > 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 comment typo ahread to ahead 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/e1000/e1000_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 0991648c53dc..37c46558e1c7 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -169,21 +169,21 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
169static int e1000_set_mac(struct net_device *netdev, void *p); 169static int e1000_set_mac(struct net_device *netdev, void *p);
170static irqreturn_t e1000_intr(int irq, void *data); 170static irqreturn_t e1000_intr(int irq, void *data);
171static irqreturn_t e1000_intr_msi(int irq, void *data); 171static irqreturn_t e1000_intr_msi(int irq, void *data);
172static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter, 172static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
173 struct e1000_tx_ring *tx_ring); 173 struct e1000_tx_ring *tx_ring);
174#ifdef CONFIG_E1000_NAPI 174#ifdef CONFIG_E1000_NAPI
175static int e1000_clean(struct napi_struct *napi, int budget); 175static int e1000_clean(struct napi_struct *napi, int budget);
176static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter, 176static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
177 struct e1000_rx_ring *rx_ring, 177 struct e1000_rx_ring *rx_ring,
178 int *work_done, int work_to_do); 178 int *work_done, int work_to_do);
179static boolean_t e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, 179static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
180 struct e1000_rx_ring *rx_ring, 180 struct e1000_rx_ring *rx_ring,
181 int *work_done, int work_to_do); 181 int *work_done, int work_to_do);
182#else 182#else
183static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter, 183static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
184 struct e1000_rx_ring *rx_ring); 184 struct e1000_rx_ring *rx_ring);
185static boolean_t e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, 185static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
186 struct e1000_rx_ring *rx_ring); 186 struct e1000_rx_ring *rx_ring);
187#endif 187#endif
188static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter, 188static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
189 struct e1000_rx_ring *rx_ring, 189 struct e1000_rx_ring *rx_ring,
@@ -584,7 +584,7 @@ void e1000_power_up_phy(struct e1000_adapter *adapter)
584static void e1000_power_down_phy(struct e1000_adapter *adapter) 584static void e1000_power_down_phy(struct e1000_adapter *adapter)
585{ 585{
586 /* Power down the PHY so no link is implied when interface is down * 586 /* Power down the PHY so no link is implied when interface is down *
587 * The PHY cannot be powered down if any of the following is TRUE * 587 * The PHY cannot be powered down if any of the following is true *
588 * (a) WoL is enabled 588 * (a) WoL is enabled
589 * (b) AMT is active 589 * (b) AMT is active
590 * (c) SoL/IDER session is active */ 590 * (c) SoL/IDER session is active */
@@ -673,7 +673,7 @@ e1000_reset(struct e1000_adapter *adapter)
673{ 673{
674 uint32_t pba = 0, tx_space, min_tx_space, min_rx_space; 674 uint32_t pba = 0, tx_space, min_tx_space, min_rx_space;
675 uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF; 675 uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
676 boolean_t legacy_pba_adjust = FALSE; 676 bool legacy_pba_adjust = false;
677 677
678 /* Repartition Pba for greater than 9k mtu 678 /* Repartition Pba for greater than 9k mtu
679 * To take effect CTRL.RST is required. 679 * To take effect CTRL.RST is required.
@@ -687,7 +687,7 @@ e1000_reset(struct e1000_adapter *adapter)
687 case e1000_82540: 687 case e1000_82540:
688 case e1000_82541: 688 case e1000_82541:
689 case e1000_82541_rev_2: 689 case e1000_82541_rev_2:
690 legacy_pba_adjust = TRUE; 690 legacy_pba_adjust = true;
691 pba = E1000_PBA_48K; 691 pba = E1000_PBA_48K;
692 break; 692 break;
693 case e1000_82545: 693 case e1000_82545:
@@ -698,7 +698,7 @@ e1000_reset(struct e1000_adapter *adapter)
698 break; 698 break;
699 case e1000_82547: 699 case e1000_82547:
700 case e1000_82547_rev_2: 700 case e1000_82547_rev_2:
701 legacy_pba_adjust = TRUE; 701 legacy_pba_adjust = true;
702 pba = E1000_PBA_30K; 702 pba = E1000_PBA_30K;
703 break; 703 break;
704 case e1000_82571: 704 case e1000_82571:
@@ -716,7 +716,7 @@ e1000_reset(struct e1000_adapter *adapter)
716 break; 716 break;
717 } 717 }
718 718
719 if (legacy_pba_adjust == TRUE) { 719 if (legacy_pba_adjust) {
720 if (adapter->netdev->mtu > E1000_RXBUFFER_8192) 720 if (adapter->netdev->mtu > E1000_RXBUFFER_8192)
721 pba -= 8; /* allocate more FIFO for Tx */ 721 pba -= 8; /* allocate more FIFO for Tx */
722 722
@@ -1366,15 +1366,15 @@ e1000_sw_init(struct e1000_adapter *adapter)
1366 1366
1367 e1000_set_media_type(hw); 1367 e1000_set_media_type(hw);
1368 1368
1369 hw->wait_autoneg_complete = FALSE; 1369 hw->wait_autoneg_complete = false;
1370 hw->tbi_compatibility_en = TRUE; 1370 hw->tbi_compatibility_en = true;
1371 hw->adaptive_ifs = TRUE; 1371 hw->adaptive_ifs = true;
1372 1372
1373 /* Copper options */ 1373 /* Copper options */
1374 1374
1375 if (hw->media_type == e1000_media_type_copper) { 1375 if (hw->media_type == e1000_media_type_copper) {
1376 hw->mdix = AUTO_ALL_MODES; 1376 hw->mdix = AUTO_ALL_MODES;
1377 hw->disable_polarity_correction = FALSE; 1377 hw->disable_polarity_correction = false;
1378 hw->master_slave = E1000_MASTER_SLAVE; 1378 hw->master_slave = E1000_MASTER_SLAVE;
1379 } 1379 }
1380 1380
@@ -1576,7 +1576,7 @@ e1000_close(struct net_device *netdev)
1576 * @start: address of beginning of memory 1576 * @start: address of beginning of memory
1577 * @len: length of memory 1577 * @len: length of memory
1578 **/ 1578 **/
1579static boolean_t 1579static bool
1580e1000_check_64k_bound(struct e1000_adapter *adapter, 1580e1000_check_64k_bound(struct e1000_adapter *adapter,
1581 void *start, unsigned long len) 1581 void *start, unsigned long len)
1582{ 1582{
@@ -1587,10 +1587,10 @@ e1000_check_64k_bound(struct e1000_adapter *adapter,
1587 * write location to cross 64k boundary due to errata 23 */ 1587 * write location to cross 64k boundary due to errata 23 */
1588 if (adapter->hw.mac_type == e1000_82545 || 1588 if (adapter->hw.mac_type == e1000_82545 ||
1589 adapter->hw.mac_type == e1000_82546) { 1589 adapter->hw.mac_type == e1000_82546) {
1590 return ((begin ^ (end - 1)) >> 16) != 0 ? FALSE : TRUE; 1590 return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
1591 } 1591 }
1592 1592
1593 return TRUE; 1593 return true;
1594} 1594}
1595 1595
1596/** 1596/**
@@ -2133,7 +2133,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
2133 /* Enable 82543 Receive Checksum Offload for TCP and UDP */ 2133 /* Enable 82543 Receive Checksum Offload for TCP and UDP */
2134 if (hw->mac_type >= e1000_82543) { 2134 if (hw->mac_type >= e1000_82543) {
2135 rxcsum = E1000_READ_REG(hw, RXCSUM); 2135 rxcsum = E1000_READ_REG(hw, RXCSUM);
2136 if (adapter->rx_csum == TRUE) { 2136 if (adapter->rx_csum) {
2137 rxcsum |= E1000_RXCSUM_TUOFL; 2137 rxcsum |= E1000_RXCSUM_TUOFL;
2138 2138
2139 /* Enable 82571 IPv4 payload checksum for UDP fragments 2139 /* Enable 82571 IPv4 payload checksum for UDP fragments
@@ -2669,7 +2669,7 @@ e1000_watchdog(unsigned long data)
2669 if (link) { 2669 if (link) {
2670 if (!netif_carrier_ok(netdev)) { 2670 if (!netif_carrier_ok(netdev)) {
2671 uint32_t ctrl; 2671 uint32_t ctrl;
2672 boolean_t txb2b = 1; 2672 bool txb2b = true;
2673 e1000_get_speed_and_duplex(&adapter->hw, 2673 e1000_get_speed_and_duplex(&adapter->hw,
2674 &adapter->link_speed, 2674 &adapter->link_speed,
2675 &adapter->link_duplex); 2675 &adapter->link_duplex);
@@ -2691,12 +2691,12 @@ e1000_watchdog(unsigned long data)
2691 adapter->tx_timeout_factor = 1; 2691 adapter->tx_timeout_factor = 1;
2692 switch (adapter->link_speed) { 2692 switch (adapter->link_speed) {
2693 case SPEED_10: 2693 case SPEED_10:
2694 txb2b = 0; 2694 txb2b = false;
2695 netdev->tx_queue_len = 10; 2695 netdev->tx_queue_len = 10;
2696 adapter->tx_timeout_factor = 8; 2696 adapter->tx_timeout_factor = 8;
2697 break; 2697 break;
2698 case SPEED_100: 2698 case SPEED_100:
2699 txb2b = 0; 2699 txb2b = false;
2700 netdev->tx_queue_len = 100; 2700 netdev->tx_queue_len = 100;
2701 /* maybe add some timeout factor ? */ 2701 /* maybe add some timeout factor ? */
2702 break; 2702 break;
@@ -2704,7 +2704,7 @@ e1000_watchdog(unsigned long data)
2704 2704
2705 if ((adapter->hw.mac_type == e1000_82571 || 2705 if ((adapter->hw.mac_type == e1000_82571 ||
2706 adapter->hw.mac_type == e1000_82572) && 2706 adapter->hw.mac_type == e1000_82572) &&
2707 txb2b == 0) { 2707 !txb2b) {
2708 uint32_t tarc0; 2708 uint32_t tarc0;
2709 tarc0 = E1000_READ_REG(&adapter->hw, TARC0); 2709 tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
2710 tarc0 &= ~(1 << 21); 2710 tarc0 &= ~(1 << 21);
@@ -2802,7 +2802,7 @@ e1000_watchdog(unsigned long data)
2802 E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_RXDMT0); 2802 E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_RXDMT0);
2803 2803
2804 /* Force detection of hung controller every watchdog period */ 2804 /* Force detection of hung controller every watchdog period */
2805 adapter->detect_tx_hung = TRUE; 2805 adapter->detect_tx_hung = true;
2806 2806
2807 /* With 82571 controllers, LAA may be overwritten due to controller 2807 /* With 82571 controllers, LAA may be overwritten due to controller
2808 * reset from the other port. Set the appropriate LAA in RAR[0] */ 2808 * reset from the other port. Set the appropriate LAA in RAR[0] */
@@ -3025,12 +3025,12 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3025 if (++i == tx_ring->count) i = 0; 3025 if (++i == tx_ring->count) i = 0;
3026 tx_ring->next_to_use = i; 3026 tx_ring->next_to_use = i;
3027 3027
3028 return TRUE; 3028 return true;
3029 } 3029 }
3030 return FALSE; 3030 return false;
3031} 3031}
3032 3032
3033static boolean_t 3033static bool
3034e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 3034e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3035 struct sk_buff *skb) 3035 struct sk_buff *skb)
3036{ 3036{
@@ -3060,10 +3060,10 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3060 if (unlikely(++i == tx_ring->count)) i = 0; 3060 if (unlikely(++i == tx_ring->count)) i = 0;
3061 tx_ring->next_to_use = i; 3061 tx_ring->next_to_use = i;
3062 3062
3063 return TRUE; 3063 return true;
3064 } 3064 }
3065 3065
3066 return FALSE; 3066 return false;
3067} 3067}
3068 3068
3069#define E1000_MAX_TXD_PWR 12 3069#define E1000_MAX_TXD_PWR 12
@@ -4038,7 +4038,7 @@ e1000_clean(struct napi_struct *napi, int budget)
4038 * @adapter: board private structure 4038 * @adapter: board private structure
4039 **/ 4039 **/
4040 4040
4041static boolean_t 4041static bool
4042e1000_clean_tx_irq(struct e1000_adapter *adapter, 4042e1000_clean_tx_irq(struct e1000_adapter *adapter,
4043 struct e1000_tx_ring *tx_ring) 4043 struct e1000_tx_ring *tx_ring)
4044{ 4044{
@@ -4049,7 +4049,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4049#ifdef CONFIG_E1000_NAPI 4049#ifdef CONFIG_E1000_NAPI
4050 unsigned int count = 0; 4050 unsigned int count = 0;
4051#endif 4051#endif
4052 boolean_t cleaned = FALSE; 4052 bool cleaned = false;
4053 unsigned int total_tx_bytes=0, total_tx_packets=0; 4053 unsigned int total_tx_bytes=0, total_tx_packets=0;
4054 4054
4055 i = tx_ring->next_to_clean; 4055 i = tx_ring->next_to_clean;
@@ -4057,7 +4057,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4057 eop_desc = E1000_TX_DESC(*tx_ring, eop); 4057 eop_desc = E1000_TX_DESC(*tx_ring, eop);
4058 4058
4059 while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) { 4059 while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
4060 for (cleaned = FALSE; !cleaned; ) { 4060 for (cleaned = false; !cleaned; ) {
4061 tx_desc = E1000_TX_DESC(*tx_ring, i); 4061 tx_desc = E1000_TX_DESC(*tx_ring, i);
4062 buffer_info = &tx_ring->buffer_info[i]; 4062 buffer_info = &tx_ring->buffer_info[i];
4063 cleaned = (i == eop); 4063 cleaned = (i == eop);
@@ -4105,7 +4105,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4105 if (adapter->detect_tx_hung) { 4105 if (adapter->detect_tx_hung) {
4106 /* Detect a transmit hang in hardware, this serializes the 4106 /* Detect a transmit hang in hardware, this serializes the
4107 * check with the clearing of time_stamp and movement of i */ 4107 * check with the clearing of time_stamp and movement of i */
4108 adapter->detect_tx_hung = FALSE; 4108 adapter->detect_tx_hung = false;
4109 if (tx_ring->buffer_info[eop].dma && 4109 if (tx_ring->buffer_info[eop].dma &&
4110 time_after(jiffies, tx_ring->buffer_info[eop].time_stamp + 4110 time_after(jiffies, tx_ring->buffer_info[eop].time_stamp +
4111 (adapter->tx_timeout_factor * HZ)) 4111 (adapter->tx_timeout_factor * HZ))
@@ -4200,7 +4200,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
4200 * @adapter: board private structure 4200 * @adapter: board private structure
4201 **/ 4201 **/
4202 4202
4203static boolean_t 4203static bool
4204#ifdef CONFIG_E1000_NAPI 4204#ifdef CONFIG_E1000_NAPI
4205e1000_clean_rx_irq(struct e1000_adapter *adapter, 4205e1000_clean_rx_irq(struct e1000_adapter *adapter,
4206 struct e1000_rx_ring *rx_ring, 4206 struct e1000_rx_ring *rx_ring,
@@ -4219,7 +4219,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
4219 uint8_t last_byte; 4219 uint8_t last_byte;
4220 unsigned int i; 4220 unsigned int i;
4221 int cleaned_count = 0; 4221 int cleaned_count = 0;
4222 boolean_t cleaned = FALSE; 4222 bool cleaned = false;
4223 unsigned int total_rx_bytes=0, total_rx_packets=0; 4223 unsigned int total_rx_bytes=0, total_rx_packets=0;
4224 4224
4225 i = rx_ring->next_to_clean; 4225 i = rx_ring->next_to_clean;
@@ -4247,7 +4247,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
4247 4247
4248 next_buffer = &rx_ring->buffer_info[i]; 4248 next_buffer = &rx_ring->buffer_info[i];
4249 4249
4250 cleaned = TRUE; 4250 cleaned = true;
4251 cleaned_count++; 4251 cleaned_count++;
4252 pci_unmap_single(pdev, 4252 pci_unmap_single(pdev,
4253 buffer_info->dma, 4253 buffer_info->dma,
@@ -4373,7 +4373,7 @@ next_desc:
4373 * @adapter: board private structure 4373 * @adapter: board private structure
4374 **/ 4374 **/
4375 4375
4376static boolean_t 4376static bool
4377#ifdef CONFIG_E1000_NAPI 4377#ifdef CONFIG_E1000_NAPI
4378e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, 4378e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
4379 struct e1000_rx_ring *rx_ring, 4379 struct e1000_rx_ring *rx_ring,
@@ -4393,7 +4393,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
4393 unsigned int i, j; 4393 unsigned int i, j;
4394 uint32_t length, staterr; 4394 uint32_t length, staterr;
4395 int cleaned_count = 0; 4395 int cleaned_count = 0;
4396 boolean_t cleaned = FALSE; 4396 bool cleaned = false;
4397 unsigned int total_rx_bytes=0, total_rx_packets=0; 4397 unsigned int total_rx_bytes=0, total_rx_packets=0;
4398 4398
4399 i = rx_ring->next_to_clean; 4399 i = rx_ring->next_to_clean;
@@ -4420,7 +4420,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
4420 4420
4421 next_buffer = &rx_ring->buffer_info[i]; 4421 next_buffer = &rx_ring->buffer_info[i];
4422 4422
4423 cleaned = TRUE; 4423 cleaned = true;
4424 cleaned_count++; 4424 cleaned_count++;
4425 pci_unmap_single(pdev, buffer_info->dma, 4425 pci_unmap_single(pdev, buffer_info->dma,
4426 buffer_info->length, 4426 buffer_info->length,