Deleted Added
full compact
ixgbe_api.c (171411) ixgbe_api.c (172043)
1/*******************************************************************************
2
3 Copyright (c) 2001-2007, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32*******************************************************************************/
1/*******************************************************************************
2
3 Copyright (c) 2001-2007, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32*******************************************************************************/
33/* $FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 171384 2007-07-11 23:03:16Z jfv $ */
33/* $FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 172043 2007-09-04 02:31:35Z jfv $ */
34
34
35
35#include "ixgbe_api.h"
36#include "ixgbe_common.h"
37
38extern s32 ixgbe_init_shared_code_82598(struct ixgbe_hw *hw);
39extern s32 ixgbe_init_shared_code_phy(struct ixgbe_hw *hw);
40
41/**
42 * ixgbe_init_shared_code - Initialize the shared code

--- 4 unchanged lines hidden (view full) ---

47 * other function in the shared code. The ixgbe_hw structure should be
48 * memset to 0 prior to calling this function. The following fields in
49 * hw structure should be filled in prior to calling this function:
50 * hw_addr, back, device_id, vendor_id, subsystem_device_id,
51 * subsystem_vendor_id, and revision_id
52 **/
53s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
54{
36#include "ixgbe_api.h"
37#include "ixgbe_common.h"
38
39extern s32 ixgbe_init_shared_code_82598(struct ixgbe_hw *hw);
40extern s32 ixgbe_init_shared_code_phy(struct ixgbe_hw *hw);
41
42/**
43 * ixgbe_init_shared_code - Initialize the shared code

--- 4 unchanged lines hidden (view full) ---

48 * other function in the shared code. The ixgbe_hw structure should be
49 * memset to 0 prior to calling this function. The following fields in
50 * hw structure should be filled in prior to calling this function:
51 * hw_addr, back, device_id, vendor_id, subsystem_device_id,
52 * subsystem_vendor_id, and revision_id
53 **/
54s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
55{
55 s32 status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
56 s32 status;
56
57 /*
58 * Assign generic function pointers before entering adapter-specific
59 * init
60 */
61 ixgbe_assign_func_pointers_generic(hw);
62
57
58 /*
59 * Assign generic function pointers before entering adapter-specific
60 * init
61 */
62 ixgbe_assign_func_pointers_generic(hw);
63
64 /*
65 * Set the mac type
66 */
67 ixgbe_set_mac_type(hw);
68
69 switch (hw->mac.type) {
70 case ixgbe_mac_82598EB:
71 status = ixgbe_init_shared_code_82598(hw);
72 status = ixgbe_init_shared_code_phy(hw);
73 break;
74 default:
75 status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
76 break;
77 }
78
79 return status;
80}
81
82/**
83 * ixgbe_set_mac_type - Sets MAC type
84 * @hw: pointer to the HW structure
85 *
86 * This function sets the mac type of the adapter based on the
87 * vendor ID and device ID stored in the hw structure.
88 **/
89s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
90{
91 s32 ret_val = IXGBE_SUCCESS;
92
93 DEBUGFUNC("ixgbe_set_mac_type");
94
63 if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) {
64 switch (hw->device_id) {
95 if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) {
96 switch (hw->device_id) {
65 case IXGBE_DEV_ID_82598:
66 case IXGBE_DEV_ID_82598_FPGA:
67 case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
68 case IXGBE_DEV_ID_82598AF_DUAL_PORT:
97 case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
98 case IXGBE_DEV_ID_82598AF_DUAL_PORT:
69 case IXGBE_DEV_ID_82598AT_DUAL_PORT:
70 status = ixgbe_init_shared_code_82598(hw);
71 status = ixgbe_init_shared_code_phy(hw);
99 case IXGBE_DEV_ID_82598EB_CX4:
100 hw->mac.type = ixgbe_mac_82598EB;
72 break;
73 default:
101 break;
102 default:
74 status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
103 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
75 break;
76 }
104 break;
105 }
106 } else {
107 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
77 }
78
108 }
109
79 return status;
110 return ret_val;
80}
81
82/**
83 * ixgbe_init_hw - Initialize the hardware
84 * @hw: pointer to hardware structure
85 *
86 * Initialize the hardware by resetting and then starting the hardware
87 **/

--- 550 unchanged lines hidden (view full) ---

638 * Configures the flow control settings based on SW configuration.
639 **/
640s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num)
641{
642 return ixgbe_call_func(hw, ixgbe_func_setup_fc, (hw, packetbuf_num),
643 IXGBE_NOT_IMPLEMENTED);
644}
645
111}
112
113/**
114 * ixgbe_init_hw - Initialize the hardware
115 * @hw: pointer to hardware structure
116 *
117 * Initialize the hardware by resetting and then starting the hardware
118 **/

--- 550 unchanged lines hidden (view full) ---

669 * Configures the flow control settings based on SW configuration.
670 **/
671s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num)
672{
673 return ixgbe_call_func(hw, ixgbe_func_setup_fc, (hw, packetbuf_num),
674 IXGBE_NOT_IMPLEMENTED);
675}
676
677
678/**
679 * ixgbe_read_analog_reg8 - Reads 8 bit analog register
680 * @hw: pointer to hardware structure
681 * @reg: analog register to read
682 * @val: read value
683 *
684 * Performs write operation to analog register specified.
685 **/
686s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
687{
688 return ixgbe_call_func(hw, ixgbe_func_read_analog_reg8, (hw, reg, val),
689 IXGBE_NOT_IMPLEMENTED);
690}
691
692/**
693 * ixgbe_write_analog_reg8 - Writes 8 bit analog register
694 * @hw: pointer to hardware structure
695 * @reg: analog register to write
696 * @val: value to write
697 *
698 * Performs write operation to Atlas analog register specified.
699 **/
700s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
701{
702 return ixgbe_call_func(hw, ixgbe_func_write_analog_reg8, (hw, reg, val),
703 IXGBE_NOT_IMPLEMENTED);
704}
705