aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-08-23 00:47:03 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:01 -0400
commitc676504ef5fe682bd343149de0e5c57bbf793ff9 (patch)
tree31e051a26b4bca8eea118259246b8d1f6ff72b98 /drivers/net/ixgb
parent3e33545ba6f8ca04b28a015e095662a35a4e2670 (diff)
ixgb: endianness
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ixgb')
-rw-r--r--drivers/net/ixgb/ixgb_ee.c16
-rw-r--r--drivers/net/ixgb/ixgb_ee.h28
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c4
-rw-r--r--drivers/net/ixgb/ixgb_hw.h4
4 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/ixgb/ixgb_ee.c b/drivers/net/ixgb/ixgb_ee.c
index 52c99d01d568..e8eb0fd6c576 100644
--- a/drivers/net/ixgb/ixgb_ee.c
+++ b/drivers/net/ixgb/ixgb_ee.c
@@ -411,7 +411,7 @@ ixgb_write_eeprom(struct ixgb_hw *hw, uint16_t offset, uint16_t data)
411 ixgb_cleanup_eeprom(hw); 411 ixgb_cleanup_eeprom(hw);
412 412
413 /* clear the init_ctrl_reg_1 to signify that the cache is invalidated */ 413 /* clear the init_ctrl_reg_1 to signify that the cache is invalidated */
414 ee_map->init_ctrl_reg_1 = le16_to_cpu(EEPROM_ICW1_SIGNATURE_CLEAR); 414 ee_map->init_ctrl_reg_1 = cpu_to_le16(EEPROM_ICW1_SIGNATURE_CLEAR);
415 415
416 return; 416 return;
417} 417}
@@ -476,19 +476,19 @@ ixgb_get_eeprom_data(struct ixgb_hw *hw)
476 uint16_t ee_data; 476 uint16_t ee_data;
477 ee_data = ixgb_read_eeprom(hw, i); 477 ee_data = ixgb_read_eeprom(hw, i);
478 checksum += ee_data; 478 checksum += ee_data;
479 hw->eeprom[i] = le16_to_cpu(ee_data); 479 hw->eeprom[i] = cpu_to_le16(ee_data);
480 } 480 }
481 481
482 if (checksum != (uint16_t) EEPROM_SUM) { 482 if (checksum != (uint16_t) EEPROM_SUM) {
483 DEBUGOUT("ixgb_ee: Checksum invalid.\n"); 483 DEBUGOUT("ixgb_ee: Checksum invalid.\n");
484 /* clear the init_ctrl_reg_1 to signify that the cache is 484 /* clear the init_ctrl_reg_1 to signify that the cache is
485 * invalidated */ 485 * invalidated */
486 ee_map->init_ctrl_reg_1 = le16_to_cpu(EEPROM_ICW1_SIGNATURE_CLEAR); 486 ee_map->init_ctrl_reg_1 = cpu_to_le16(EEPROM_ICW1_SIGNATURE_CLEAR);
487 return (FALSE); 487 return (FALSE);
488 } 488 }
489 489
490 if ((ee_map->init_ctrl_reg_1 & le16_to_cpu(EEPROM_ICW1_SIGNATURE_MASK)) 490 if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK))
491 != le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) { 491 != cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) {
492 DEBUGOUT("ixgb_ee: Signature invalid.\n"); 492 DEBUGOUT("ixgb_ee: Signature invalid.\n");
493 return(FALSE); 493 return(FALSE);
494 } 494 }
@@ -511,8 +511,8 @@ ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw)
511{ 511{
512 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 512 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
513 513
514 if ((ee_map->init_ctrl_reg_1 & le16_to_cpu(EEPROM_ICW1_SIGNATURE_MASK)) 514 if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK))
515 == le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) { 515 == cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) {
516 return (TRUE); 516 return (TRUE);
517 } else { 517 } else {
518 return ixgb_get_eeprom_data(hw); 518 return ixgb_get_eeprom_data(hw);
@@ -528,7 +528,7 @@ ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw)
528 * Returns: 528 * Returns:
529 * Word at indexed offset in eeprom, if valid, 0 otherwise. 529 * Word at indexed offset in eeprom, if valid, 0 otherwise.
530 ******************************************************************************/ 530 ******************************************************************************/
531uint16_t 531__le16
532ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index) 532ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index)
533{ 533{
534 534
diff --git a/drivers/net/ixgb/ixgb_ee.h b/drivers/net/ixgb/ixgb_ee.h
index ef236b935c15..7908bf3005ed 100644
--- a/drivers/net/ixgb/ixgb_ee.h
+++ b/drivers/net/ixgb/ixgb_ee.h
@@ -76,22 +76,22 @@
76/* EEPROM structure */ 76/* EEPROM structure */
77struct ixgb_ee_map_type { 77struct ixgb_ee_map_type {
78 uint8_t mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS]; 78 uint8_t mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS];
79 uint16_t compatibility; 79 __le16 compatibility;
80 uint16_t reserved1[4]; 80 __le16 reserved1[4];
81 uint32_t pba_number; 81 __le32 pba_number;
82 uint16_t init_ctrl_reg_1; 82 __le16 init_ctrl_reg_1;
83 uint16_t subsystem_id; 83 __le16 subsystem_id;
84 uint16_t subvendor_id; 84 __le16 subvendor_id;
85 uint16_t device_id; 85 __le16 device_id;
86 uint16_t vendor_id; 86 __le16 vendor_id;
87 uint16_t init_ctrl_reg_2; 87 __le16 init_ctrl_reg_2;
88 uint16_t oem_reserved[16]; 88 __le16 oem_reserved[16];
89 uint16_t swdpins_reg; 89 __le16 swdpins_reg;
90 uint16_t circuit_ctrl_reg; 90 __le16 circuit_ctrl_reg;
91 uint8_t d3_power; 91 uint8_t d3_power;
92 uint8_t d0_power; 92 uint8_t d0_power;
93 uint16_t reserved2[28]; 93 __le16 reserved2[28];
94 uint16_t checksum; 94 __le16 checksum;
95}; 95};
96 96
97/* EEPROM Functions */ 97/* EEPROM Functions */
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index ddad26bb5c58..fddd5844168d 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -422,7 +422,7 @@ ixgb_get_eeprom(struct net_device *netdev,
422{ 422{
423 struct ixgb_adapter *adapter = netdev_priv(netdev); 423 struct ixgb_adapter *adapter = netdev_priv(netdev);
424 struct ixgb_hw *hw = &adapter->hw; 424 struct ixgb_hw *hw = &adapter->hw;
425 uint16_t *eeprom_buff; 425 __le16 *eeprom_buff;
426 int i, max_len, first_word, last_word; 426 int i, max_len, first_word, last_word;
427 int ret_val = 0; 427 int ret_val = 0;
428 428
@@ -446,7 +446,7 @@ ixgb_get_eeprom(struct net_device *netdev,
446 first_word = eeprom->offset >> 1; 446 first_word = eeprom->offset >> 1;
447 last_word = (eeprom->offset + eeprom->len - 1) >> 1; 447 last_word = (eeprom->offset + eeprom->len - 1) >> 1;
448 448
449 eeprom_buff = kmalloc(sizeof(uint16_t) * 449 eeprom_buff = kmalloc(sizeof(__le16) *
450 (last_word - first_word + 1), GFP_KERNEL); 450 (last_word - first_word + 1), GFP_KERNEL);
451 if(!eeprom_buff) 451 if(!eeprom_buff)
452 return -ENOMEM; 452 return -ENOMEM;
diff --git a/drivers/net/ixgb/ixgb_hw.h b/drivers/net/ixgb/ixgb_hw.h
index 40ef5ca88717..af5643324ee3 100644
--- a/drivers/net/ixgb/ixgb_hw.h
+++ b/drivers/net/ixgb/ixgb_hw.h
@@ -711,7 +711,7 @@ struct ixgb_hw {
711 uint32_t bar2; 711 uint32_t bar2;
712 uint32_t bar3; 712 uint32_t bar3;
713 uint16_t pci_cmd_word; /* PCI command register id from PCI configuration space */ 713 uint16_t pci_cmd_word; /* PCI command register id from PCI configuration space */
714 uint16_t eeprom[IXGB_EEPROM_SIZE]; /* EEPROM contents read at init time */ 714 __le16 eeprom[IXGB_EEPROM_SIZE]; /* EEPROM contents read at init time */
715 unsigned long io_base; /* Our I/O mapped location */ 715 unsigned long io_base; /* Our I/O mapped location */
716 uint32_t lastLFC; 716 uint32_t lastLFC;
717 uint32_t lastRFC; 717 uint32_t lastRFC;
@@ -809,7 +809,7 @@ void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr);
809uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw); 809uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw);
810uint16_t ixgb_get_ee_device_id(struct ixgb_hw *hw); 810uint16_t ixgb_get_ee_device_id(struct ixgb_hw *hw);
811boolean_t ixgb_get_eeprom_data(struct ixgb_hw *hw); 811boolean_t ixgb_get_eeprom_data(struct ixgb_hw *hw);
812uint16_t ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index); 812__le16 ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index);
813 813
814/* Everything else */ 814/* Everything else */
815void ixgb_led_on(struct ixgb_hw *hw); 815void ixgb_led_on(struct ixgb_hw *hw);