aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_hw.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-07-11 18:17:18 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 19:38:52 -0400
commite982f17c87488a98df6bc4f5454a176646b4d00b (patch)
treed615c679fbe14c877722c3a906d3322e4382f8aa /drivers/net/e1000/e1000_hw.c
parentc03e83b0351f8a9464d32f31302ec75ba88518dc (diff)
e1000: Remove spaces after casts and function names
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r--drivers/net/e1000/e1000_hw.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 5d3c2bd7b61..9d6edf3e73f 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -3533,7 +3533,7 @@ static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
3533 DEBUGOUT("MDI Error\n"); 3533 DEBUGOUT("MDI Error\n");
3534 return -E1000_ERR_PHY; 3534 return -E1000_ERR_PHY;
3535 } 3535 }
3536 *phy_data = (u16) mdic; 3536 *phy_data = (u16)mdic;
3537 } else { 3537 } else {
3538 /* We must first send a preamble through the MDIO pin to signal the 3538 /* We must first send a preamble through the MDIO pin to signal the
3539 * beginning of an MII instruction. This is done by sending 32 3539 * beginning of an MII instruction. This is done by sending 32
@@ -3648,7 +3648,7 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
3648 * for the PHY register in the MDI Control register. The MAC will take 3648 * for the PHY register in the MDI Control register. The MAC will take
3649 * care of interfacing with the PHY to send the desired data. 3649 * care of interfacing with the PHY to send the desired data.
3650 */ 3650 */
3651 mdic = (((u32) phy_data) | 3651 mdic = (((u32)phy_data) |
3652 (reg_addr << E1000_MDIC_REG_SHIFT) | 3652 (reg_addr << E1000_MDIC_REG_SHIFT) |
3653 (phy_addr << E1000_MDIC_PHY_SHIFT) | 3653 (phy_addr << E1000_MDIC_PHY_SHIFT) |
3654 (E1000_MDIC_OP_WRITE)); 3654 (E1000_MDIC_OP_WRITE));
@@ -3682,7 +3682,7 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
3682 mdic = ((PHY_TURNAROUND) | (reg_addr << 2) | (phy_addr << 7) | 3682 mdic = ((PHY_TURNAROUND) | (reg_addr << 2) | (phy_addr << 7) |
3683 (PHY_OP_WRITE << 12) | (PHY_SOF << 14)); 3683 (PHY_OP_WRITE << 12) | (PHY_SOF << 14));
3684 mdic <<= 16; 3684 mdic <<= 16;
3685 mdic |= (u32) phy_data; 3685 mdic |= (u32)phy_data;
3686 3686
3687 e1000_shift_out_mdi_bits(hw, mdic, 32); 3687 e1000_shift_out_mdi_bits(hw, mdic, 32);
3688 } 3688 }
@@ -4032,14 +4032,14 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw)
4032 if (ret_val) 4032 if (ret_val)
4033 return ret_val; 4033 return ret_val;
4034 4034
4035 hw->phy_id = (u32) (phy_id_high << 16); 4035 hw->phy_id = (u32)(phy_id_high << 16);
4036 udelay(20); 4036 udelay(20);
4037 ret_val = e1000_read_phy_reg(hw, PHY_ID2, &phy_id_low); 4037 ret_val = e1000_read_phy_reg(hw, PHY_ID2, &phy_id_low);
4038 if (ret_val) 4038 if (ret_val)
4039 return ret_val; 4039 return ret_val;
4040 4040
4041 hw->phy_id |= (u32) (phy_id_low & PHY_REVISION_MASK); 4041 hw->phy_id |= (u32)(phy_id_low & PHY_REVISION_MASK);
4042 hw->phy_revision = (u32) phy_id_low & ~PHY_REVISION_MASK; 4042 hw->phy_revision = (u32)phy_id_low & ~PHY_REVISION_MASK;
4043 4043
4044 switch (hw->mac_type) { 4044 switch (hw->mac_type) {
4045 case e1000_82543: 4045 case e1000_82543:
@@ -5174,7 +5174,7 @@ s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw)
5174 checksum += eeprom_data; 5174 checksum += eeprom_data;
5175 } 5175 }
5176 5176
5177 if (checksum == (u16) EEPROM_SUM) 5177 if (checksum == (u16)EEPROM_SUM)
5178 return E1000_SUCCESS; 5178 return E1000_SUCCESS;
5179 else { 5179 else {
5180 DEBUGOUT("EEPROM Checksum Invalid\n"); 5180 DEBUGOUT("EEPROM Checksum Invalid\n");
@@ -5205,7 +5205,7 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw)
5205 } 5205 }
5206 checksum += eeprom_data; 5206 checksum += eeprom_data;
5207 } 5207 }
5208 checksum = (u16) EEPROM_SUM - checksum; 5208 checksum = (u16)EEPROM_SUM - checksum;
5209 if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) { 5209 if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) {
5210 DEBUGOUT("EEPROM Write Error\n"); 5210 DEBUGOUT("EEPROM Write Error\n");
5211 return -E1000_ERR_EEPROM; 5211 return -E1000_ERR_EEPROM;
@@ -5610,8 +5610,8 @@ s32 e1000_read_mac_addr(struct e1000_hw *hw)
5610 DEBUGOUT("EEPROM Read Error\n"); 5610 DEBUGOUT("EEPROM Read Error\n");
5611 return -E1000_ERR_EEPROM; 5611 return -E1000_ERR_EEPROM;
5612 } 5612 }
5613 hw->perm_mac_addr[i] = (u8) (eeprom_data & 0x00FF); 5613 hw->perm_mac_addr[i] = (u8)(eeprom_data & 0x00FF);
5614 hw->perm_mac_addr[i+1] = (u8) (eeprom_data >> 8); 5614 hw->perm_mac_addr[i+1] = (u8)(eeprom_data >> 8);
5615 } 5615 }
5616 5616
5617 switch (hw->mac_type) { 5617 switch (hw->mac_type) {
@@ -5693,37 +5693,37 @@ u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
5693 case 0: 5693 case 0:
5694 if (hw->mac_type == e1000_ich8lan) { 5694 if (hw->mac_type == e1000_ich8lan) {
5695 /* [47:38] i.e. 0x158 for above example address */ 5695 /* [47:38] i.e. 0x158 for above example address */
5696 hash_value = ((mc_addr[4] >> 6) | (((u16) mc_addr[5]) << 2)); 5696 hash_value = ((mc_addr[4] >> 6) | (((u16)mc_addr[5]) << 2));
5697 } else { 5697 } else {
5698 /* [47:36] i.e. 0x563 for above example address */ 5698 /* [47:36] i.e. 0x563 for above example address */
5699 hash_value = ((mc_addr[4] >> 4) | (((u16) mc_addr[5]) << 4)); 5699 hash_value = ((mc_addr[4] >> 4) | (((u16)mc_addr[5]) << 4));
5700 } 5700 }
5701 break; 5701 break;
5702 case 1: 5702 case 1:
5703 if (hw->mac_type == e1000_ich8lan) { 5703 if (hw->mac_type == e1000_ich8lan) {
5704 /* [46:37] i.e. 0x2B1 for above example address */ 5704 /* [46:37] i.e. 0x2B1 for above example address */
5705 hash_value = ((mc_addr[4] >> 5) | (((u16) mc_addr[5]) << 3)); 5705 hash_value = ((mc_addr[4] >> 5) | (((u16)mc_addr[5]) << 3));
5706 } else { 5706 } else {
5707 /* [46:35] i.e. 0xAC6 for above example address */ 5707 /* [46:35] i.e. 0xAC6 for above example address */
5708 hash_value = ((mc_addr[4] >> 3) | (((u16) mc_addr[5]) << 5)); 5708 hash_value = ((mc_addr[4] >> 3) | (((u16)mc_addr[5]) << 5));
5709 } 5709 }
5710 break; 5710 break;
5711 case 2: 5711 case 2:
5712 if (hw->mac_type == e1000_ich8lan) { 5712 if (hw->mac_type == e1000_ich8lan) {
5713 /*[45:36] i.e. 0x163 for above example address */ 5713 /*[45:36] i.e. 0x163 for above example address */
5714 hash_value = ((mc_addr[4] >> 4) | (((u16) mc_addr[5]) << 4)); 5714 hash_value = ((mc_addr[4] >> 4) | (((u16)mc_addr[5]) << 4));
5715 } else { 5715 } else {
5716 /* [45:34] i.e. 0x5D8 for above example address */ 5716 /* [45:34] i.e. 0x5D8 for above example address */
5717 hash_value = ((mc_addr[4] >> 2) | (((u16) mc_addr[5]) << 6)); 5717 hash_value = ((mc_addr[4] >> 2) | (((u16)mc_addr[5]) << 6));
5718 } 5718 }
5719 break; 5719 break;
5720 case 3: 5720 case 3:
5721 if (hw->mac_type == e1000_ich8lan) { 5721 if (hw->mac_type == e1000_ich8lan) {
5722 /* [43:34] i.e. 0x18D for above example address */ 5722 /* [43:34] i.e. 0x18D for above example address */
5723 hash_value = ((mc_addr[4] >> 2) | (((u16) mc_addr[5]) << 6)); 5723 hash_value = ((mc_addr[4] >> 2) | (((u16)mc_addr[5]) << 6));
5724 } else { 5724 } else {
5725 /* [43:32] i.e. 0x634 for above example address */ 5725 /* [43:32] i.e. 0x634 for above example address */
5726 hash_value = ((mc_addr[4]) | (((u16) mc_addr[5]) << 8)); 5726 hash_value = ((mc_addr[4]) | (((u16)mc_addr[5]) << 8));
5727 } 5727 }
5728 break; 5728 break;
5729 } 5729 }
@@ -5795,10 +5795,9 @@ void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
5795 /* HW expects these in little endian so we reverse the byte order 5795 /* HW expects these in little endian so we reverse the byte order
5796 * from network order (big endian) to little endian 5796 * from network order (big endian) to little endian
5797 */ 5797 */
5798 rar_low = ((u32) addr[0] | 5798 rar_low = ((u32)addr[0] | ((u32)addr[1] << 8) |
5799 ((u32) addr[1] << 8) | 5799 ((u32)addr[2] << 16) | ((u32)addr[3] << 24));
5800 ((u32) addr[2] << 16) | ((u32) addr[3] << 24)); 5800 rar_high = ((u32)addr[4] | ((u32)addr[5] << 8));
5801 rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
5802 5801
5803 /* Disable Rx and flush all Rx frames before enabling RSS to avoid Rx 5802 /* Disable Rx and flush all Rx frames before enabling RSS to avoid Rx
5804 * unit hang. 5803 * unit hang.
@@ -6412,7 +6411,7 @@ void e1000_tbi_adjust_stats(struct e1000_hw *hw, struct e1000_hw_stats *stats,
6412 * since the test for a multicast frame will test positive on 6411 * since the test for a multicast frame will test positive on
6413 * a broadcast frame. 6412 * a broadcast frame.
6414 */ 6413 */
6415 if ((mac_addr[0] == (u8) 0xff) && (mac_addr[1] == (u8) 0xff)) 6414 if ((mac_addr[0] == (u8)0xff) && (mac_addr[1] == (u8)0xff))
6416 /* Broadcast packet */ 6415 /* Broadcast packet */
6417 stats->bprc++; 6416 stats->bprc++;
6418 else if (*mac_addr & 0x01) 6417 else if (*mac_addr & 0x01)
@@ -7382,7 +7381,7 @@ static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer)
7382 offset = (offset >> 2); 7381 offset = (offset >> 2);
7383 7382
7384 for (i = 0; i < length; i++) { 7383 for (i = 0; i < length; i++) {
7385 *((u32 *) buffer + i) = 7384 *((u32 *)buffer + i) =
7386 E1000_READ_REG_ARRAY_DWORD(hw, HOST_IF, offset + i); 7385 E1000_READ_REG_ARRAY_DWORD(hw, HOST_IF, offset + i);
7387 } 7386 }
7388 return E1000_SUCCESS; 7387 return E1000_SUCCESS;
@@ -7513,7 +7512,7 @@ static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
7513 sum = hdr->checksum; 7512 sum = hdr->checksum;
7514 hdr->checksum = 0; 7513 hdr->checksum = 0;
7515 7514
7516 buffer = (u8 *) hdr; 7515 buffer = (u8 *)hdr;
7517 i = length; 7516 i = length;
7518 while (i--) 7517 while (i--)
7519 sum += buffer[i]; 7518 sum += buffer[i];
@@ -7523,7 +7522,7 @@ static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
7523 length >>= 2; 7522 length >>= 2;
7524 /* The device driver writes the relevant command block into the ram area. */ 7523 /* The device driver writes the relevant command block into the ram area. */
7525 for (i = 0; i < length; i++) { 7524 for (i = 0; i < length; i++) {
7526 E1000_WRITE_REG_ARRAY_DWORD(hw, HOST_IF, i, *((u32 *) hdr + i)); 7525 E1000_WRITE_REG_ARRAY_DWORD(hw, HOST_IF, i, *((u32 *)hdr + i));
7527 E1000_WRITE_FLUSH(); 7526 E1000_WRITE_FLUSH();
7528 } 7527 }
7529 7528
@@ -7616,7 +7615,7 @@ static u8 e1000_calculate_mng_checksum(char *buffer, u32 length)
7616 for (i=0; i < length; i++) 7615 for (i=0; i < length; i++)
7617 sum += buffer[i]; 7616 sum += buffer[i];
7618 7617
7619 return (u8) (0 - sum); 7618 return (u8)(0 - sum);
7620} 7619}
7621 7620
7622/***************************************************************************** 7621/*****************************************************************************