A bit further.
authorRonald G. Minnich <rminnich@google.com>
Sun, 26 Jan 2014 22:34:51 +0000 (14:34 -0800)
committerRonald G. Minnich <rminnich@google.com>
Sun, 26 Jan 2014 22:34:51 +0000 (14:34 -0800)
We really need to figure out outl(int, ...) vs outl(void *, ...)

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/drivers/net/e1000/e1000_hw.h
kern/drivers/net/e1000/e1000_mac.c
kern/drivers/net/e1000/e1000_manage.h
kern/drivers/net/e1000/e1000_osdep.h
kern/drivers/net/e1000/e1000_phy.h

index 5f83e0f..accdead 100644 (file)
@@ -42,6 +42,8 @@
 #include <pmap.h>
 #include <smp.h>
 #include <ip.h>
+#include "e1000_osdep.h"
+#include "e1000_regs.h"
 #include "e1000_defines.h"
 
 struct e1000_hw;
@@ -494,19 +496,10 @@ struct e1000_host_mng_command_info {
        uint8_t command_data[E1000_HI_MAX_MNG_DATA_LENGTH];
 };
 
-#include <vfs.h>
-#include <kfs.h>
-#include <slab.h>
-#include <kmalloc.h>
-#include <kref.h>
-#include <string.h>
-#include <stdio.h>
-#include <assert.h>
-#include <error.h>
-#include <cpio.h>
-#include <pmap.h>
-#include <smp.h>
-#include <ip.h>
+#include "e1000_mac.h"
+#include "e1000_phy.h"
+#include "e1000_nvm.h"
+#include "e1000_manage.h"
 
 struct e1000_mac_operations {
        /* Function pointers for the MAC. */
index 6315333..7ef6ba5 100644 (file)
@@ -293,7 +293,7 @@ static void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw)
         * The status register reports the correct function number
         * for the device regardless of function swap state.
         */
-       reg = E1000_READ_REG(hw, E1000_STATUS);
+       reg = E1000_READ_REG((int)hw, E1000_STATUS);
        bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
 }
 
@@ -311,7 +311,7 @@ void e1000_set_lan_id_multi_port_pci(struct e1000_hw *hw)
 
        e1000_read_pci_cfg(hw, PCI_HEADER_TYPE_REGISTER, &pci_header_type);
        if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
-               status = E1000_READ_REG(hw, E1000_STATUS);
+               status = E1000_READ_REG((int)hw, E1000_STATUS);
                bus->func = (status & E1000_STATUS_FUNC_MASK)
                            >> E1000_STATUS_FUNC_SHIFT;
        } else {
index 14467aa..e2e09f5 100644 (file)
 
 *******************************************************************************/
 
-FILE_LICENCE ( GPL2_OR_LATER );
-
 #ifndef _E1000_MANAGE_H_
 #define _E1000_MANAGE_H_
 
 bool e1000_check_mng_mode_generic(struct e1000_hw *hw);
 bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw);
-s32  e1000_mng_enable_host_if_generic(struct e1000_hw *hw);
-s32  e1000_mng_host_if_write_generic(struct e1000_hw *hw, u8 *buffer,
-                                     u16 length, u16 offset, u8 *sum);
-s32  e1000_mng_write_cmd_header_generic(struct e1000_hw *hw,
+int32_t  e1000_mng_enable_host_if_generic(struct e1000_hw *hw);
+int32_t  e1000_mng_host_if_write_generic(struct e1000_hw *hw, uint8_t *buffer,
+                                     uint16_t length,
+                                    uint16_t offset, uint8_t *sum);
+int32_t  e1000_mng_write_cmd_header_generic(struct e1000_hw *hw,
                                     struct e1000_host_mng_command_header *hdr);
-s32  e1000_mng_write_dhcp_info_generic(struct e1000_hw *hw,
-                                       u8 *buffer, u16 length);
+int32_t  e1000_mng_write_dhcp_info_generic(struct e1000_hw *hw,
+                                       uint8_t *buffer, uint16_t length);
 bool e1000_enable_mng_pass_thru(struct e1000_hw *hw);
 
 enum e1000_mng_mode {
index 13d3fe6..29ffbc7 100644 (file)
@@ -65,7 +65,7 @@
 #define E1000_WRITE_REG(a, reg, value) \
     outl((int)((a)->hw_addr + E1000_REGISTER(a, reg)), (value))
 
-#define E1000_READ_REG(a, reg) (inl((a)->hw_addr + E1000_REGISTER(a, reg)))
+#define E1000_READ_REG(a, reg) (inl((int)((a)->hw_addr + E1000_REGISTER(a, reg))))
 
 #define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \
     outl((int)((a)->hw_addr + E1000_REGISTER(a, reg) + ((offset) << 2)), (value))
index edc5dd2..37d2dc4 100644 (file)
 #define _E1000_PHY_H_
 
 void e1000_init_phy_ops_generic(struct e1000_hw *hw);
-s32  e1000_null_read_reg(struct e1000_hw *hw, uint32_t offset, uint16_t *data);
+int32_t  e1000_null_read_reg(struct e1000_hw *hw, uint32_t offset, uint16_t *data);
 void e1000_null_phy_generic(struct e1000_hw *hw);
-s32  e1000_null_lplu_state(struct e1000_hw *hw, bool active);
-s32  e1000_null_write_reg(struct e1000_hw *hw, uint32_t offset, uint16_t data);
-s32  e1000_check_downshift_generic(struct e1000_hw *hw);
-s32  e1000_check_polarity_m88(struct e1000_hw *hw);
-s32  e1000_check_polarity_igp(struct e1000_hw *hw);
-s32  e1000_check_polarity_ife(struct e1000_hw *hw);
-s32  e1000_check_reset_block_generic(struct e1000_hw *hw);
-s32  e1000_copper_link_autoneg(struct e1000_hw *hw);
-s32  e1000_copper_link_setup_igp(struct e1000_hw *hw);
-s32  e1000_copper_link_setup_m88(struct e1000_hw *hw);
+int32_t  e1000_null_lplu_state(struct e1000_hw *hw, bool active);
+int32_t  e1000_null_write_reg(struct e1000_hw *hw, uint32_t offset, uint16_t data);
+int32_t  e1000_check_downshift_generic(struct e1000_hw *hw);
+int32_t  e1000_check_polarity_m88(struct e1000_hw *hw);
+int32_t  e1000_check_polarity_igp(struct e1000_hw *hw);
+int32_t  e1000_check_polarity_ife(struct e1000_hw *hw);
+int32_t  e1000_check_reset_block_generic(struct e1000_hw *hw);
+int32_t  e1000_copper_link_autoneg(struct e1000_hw *hw);
+int32_t  e1000_copper_link_setup_igp(struct e1000_hw *hw);
+int32_t  e1000_copper_link_setup_m88(struct e1000_hw *hw);
 #if 0
 s32  e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw);
 s32  e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw);
@@ -52,43 +52,43 @@ s32  e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
 s32  e1000_get_cable_length_m88(struct e1000_hw *hw);
 s32  e1000_get_cable_length_igp_2(struct e1000_hw *hw);
 #endif
-s32  e1000_get_cfg_done_generic(struct e1000_hw *hw);
-s32  e1000_get_phy_id(struct e1000_hw *hw);
-s32  e1000_get_phy_info_igp(struct e1000_hw *hw);
-s32  e1000_get_phy_info_m88(struct e1000_hw *hw);
-s32  e1000_phy_sw_reset_generic(struct e1000_hw *hw);
+int32_t  e1000_get_cfg_done_generic(struct e1000_hw *hw);
+int32_t  e1000_get_phy_id(struct e1000_hw *hw);
+int32_t  e1000_get_phy_info_igp(struct e1000_hw *hw);
+int32_t  e1000_get_phy_info_m88(struct e1000_hw *hw);
+int32_t  e1000_phy_sw_reset_generic(struct e1000_hw *hw);
 #if 0
 void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
 #endif
-s32  e1000_phy_hw_reset_generic(struct e1000_hw *hw);
-s32  e1000_phy_reset_dsp_generic(struct e1000_hw *hw);
-s32  e1000_phy_setup_autoneg(struct e1000_hw *hw);
-s32  e1000_read_kmrn_reg_generic(struct e1000_hw *hw, uint32_t offset,
+int32_t  e1000_phy_hw_reset_generic(struct e1000_hw *hw);
+int32_t  e1000_phy_reset_dsp_generic(struct e1000_hw *hw);
+int32_t  e1000_phy_setup_autoneg(struct e1000_hw *hw);
+int32_t  e1000_read_kmrn_reg_generic(struct e1000_hw *hw, uint32_t offset,
                                 uint16_t *data);
-s32  e1000_read_phy_reg_igp(struct e1000_hw *hw,
+int32_t  e1000_read_phy_reg_igp(struct e1000_hw *hw,
                            uint32_t offset, uint16_t *data);
-s32  e1000_read_phy_reg_m88(struct e1000_hw *hw,
+int32_t  e1000_read_phy_reg_m88(struct e1000_hw *hw,
                            uint32_t offset, uint16_t *data);
-s32  e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active);
-s32  e1000_setup_copper_link_generic(struct e1000_hw *hw);
-s32  e1000_wait_autoneg_generic(struct e1000_hw *hw);
-s32  e1000_write_kmrn_reg_generic(struct e1000_hw *hw, uint32_t offset,
+int32_t  e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active);
+int32_t  e1000_setup_copper_link_generic(struct e1000_hw *hw);
+int32_t  e1000_wait_autoneg_generic(struct e1000_hw *hw);
+int32_t  e1000_write_kmrn_reg_generic(struct e1000_hw *hw, uint32_t offset,
                                  uint16_t data);
-s32  e1000_write_phy_reg_igp(struct e1000_hw *hw,
+int32_t  e1000_write_phy_reg_igp(struct e1000_hw *hw,
                             uint32_t offset, uint16_t data);
-s32  e1000_write_phy_reg_m88(struct e1000_hw *hw,
+int32_t  e1000_write_phy_reg_m88(struct e1000_hw *hw,
                             uint32_t offset, uint16_t data);
-s32  e1000_phy_reset_dsp(struct e1000_hw *hw);
-s32  e1000_phy_has_link_generic(struct e1000_hw *hw, uint32_t iterations,
+int32_t  e1000_phy_reset_dsp(struct e1000_hw *hw);
+int32_t  e1000_phy_has_link_generic(struct e1000_hw *hw, uint32_t iterations,
                                 uint32_t usec_interval, bool *success);
-s32  e1000_phy_init_script_igp3(struct e1000_hw *hw);
+int32_t  e1000_phy_init_script_igp3(struct e1000_hw *hw);
 enum e1000_phy_type e1000_get_phy_type_from_id(uint32_t phy_id);
-s32  e1000_determine_phy_address(struct e1000_hw *hw);
+int32_t  e1000_determine_phy_address(struct e1000_hw *hw);
 void e1000_power_up_phy_copper(struct e1000_hw *hw);
 void e1000_power_down_phy_copper(struct e1000_hw *hw);
-s32  e1000_read_phy_reg_mdic(struct e1000_hw *hw,
+int32_t  e1000_read_phy_reg_mdic(struct e1000_hw *hw,
                             uint32_t offset, uint16_t *data);
-s32  e1000_write_phy_reg_mdic(struct e1000_hw *hw,
+int32_t  e1000_write_phy_reg_mdic(struct e1000_hw *hw,
                              uint32_t offset, uint16_t data);
 
 #define E1000_MAX_PHY_ADDR                4