ixgbe_common.h revision 190873
1179055Sjfv/******************************************************************************
2171384Sjfv
3190873Sjfv  Copyright (c) 2001-2009, Intel Corporation
4171384Sjfv  All rights reserved.
5171384Sjfv
6171384Sjfv  Redistribution and use in source and binary forms, with or without
7171384Sjfv  modification, are permitted provided that the following conditions are met:
8171384Sjfv
9171384Sjfv   1. Redistributions of source code must retain the above copyright notice,
10171384Sjfv      this list of conditions and the following disclaimer.
11171384Sjfv
12171384Sjfv   2. Redistributions in binary form must reproduce the above copyright
13171384Sjfv      notice, this list of conditions and the following disclaimer in the
14171384Sjfv      documentation and/or other materials provided with the distribution.
15171384Sjfv
16171384Sjfv   3. Neither the name of the Intel Corporation nor the names of its
17171384Sjfv      contributors may be used to endorse or promote products derived from
18171384Sjfv      this software without specific prior written permission.
19171384Sjfv
20171384Sjfv  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21171384Sjfv  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22171384Sjfv  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23171384Sjfv  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24171384Sjfv  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25171384Sjfv  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26171384Sjfv  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27171384Sjfv  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28171384Sjfv  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29171384Sjfv  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30171384Sjfv  POSSIBILITY OF SUCH DAMAGE.
31171384Sjfv
32179055Sjfv******************************************************************************/
33179055Sjfv/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.h 190873 2009-04-10 00:22:48Z jfv $*/
34171384Sjfv
35171384Sjfv#ifndef _IXGBE_COMMON_H_
36171384Sjfv#define _IXGBE_COMMON_H_
37171384Sjfv
38171384Sjfv#include "ixgbe_type.h"
39190873Sjfv#define IXGBE_WRITE_REG64(hw, reg, value) \
40190873Sjfv	do { \
41190873Sjfv		IXGBE_WRITE_REG(hw, reg, (u32) value); \
42190873Sjfv		IXGBE_WRITE_REG(hw, reg + 4, (u32) (value >> 32)); \
43190873Sjfv	} while (0)
44171384Sjfv
45179055Sjfvs32 ixgbe_init_ops_generic(struct ixgbe_hw *hw);
46171384Sjfvs32 ixgbe_init_hw_generic(struct ixgbe_hw *hw);
47171384Sjfvs32 ixgbe_start_hw_generic(struct ixgbe_hw *hw);
48171384Sjfvs32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw);
49179055Sjfvs32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num);
50171384Sjfvs32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr);
51171384Sjfvs32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw);
52185352Sjfvvoid ixgbe_set_lan_id_multi_port_pcie(struct ixgbe_hw *hw);
53171384Sjfvs32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw);
54171384Sjfv
55171384Sjfvs32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index);
56171384Sjfvs32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index);
57171384Sjfv
58171384Sjfvs32 ixgbe_init_eeprom_params_generic(struct ixgbe_hw *hw);
59171384Sjfvs32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data);
60171384Sjfvs32 ixgbe_read_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 *data);
61171384Sjfvs32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
62179055Sjfv                                       u16 *data);
63171384Sjfvs32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,
64179055Sjfv                                           u16 *checksum_val);
65171384Sjfvs32 ixgbe_update_eeprom_checksum_generic(struct ixgbe_hw *hw);
66171384Sjfv
67179055Sjfvs32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
68179055Sjfv                          u32 enable_addr);
69181003Sjfvs32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index);
70171384Sjfvs32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw);
71171384Sjfvs32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list,
72179055Sjfv                                      u32 mc_addr_count,
73179055Sjfv                                      ixgbe_mc_addr_itr func);
74179055Sjfvs32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list,
75179055Sjfv                                      u32 addr_count, ixgbe_mc_addr_itr func);
76190873Sjfvvoid ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
77171384Sjfvs32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
78171384Sjfvs32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw);
79190873Sjfvs32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
80171384Sjfv
81190873Sjfvs32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
82190873Sjfvs32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packtetbuf_num);
83185352Sjfvs32 ixgbe_fc_autoneg(struct ixgbe_hw *hw);
84185352Sjfv
85171384Sjfvs32 ixgbe_validate_mac_addr(u8 *mac_addr);
86171384Sjfvs32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u16 mask);
87171384Sjfvvoid ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u16 mask);
88171384Sjfvs32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
89171384Sjfv
90179055Sjfvs32 ixgbe_read_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 *val);
91179055Sjfvs32 ixgbe_write_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 val);
92190873Sjfvs32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
93190873Sjfvs32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
94190873Sjfv
95171384Sjfv#endif /* IXGBE_COMMON */
96