ixgbe_api.c revision 1.15 1 1.1 dyoung /******************************************************************************
2 1.1 dyoung
3 1.13 msaitoh Copyright (c) 2001-2015, Intel Corporation
4 1.1 dyoung All rights reserved.
5 1.1 dyoung
6 1.1 dyoung Redistribution and use in source and binary forms, with or without
7 1.1 dyoung modification, are permitted provided that the following conditions are met:
8 1.1 dyoung
9 1.1 dyoung 1. Redistributions of source code must retain the above copyright notice,
10 1.1 dyoung this list of conditions and the following disclaimer.
11 1.1 dyoung
12 1.1 dyoung 2. Redistributions in binary form must reproduce the above copyright
13 1.1 dyoung notice, this list of conditions and the following disclaimer in the
14 1.1 dyoung documentation and/or other materials provided with the distribution.
15 1.1 dyoung
16 1.1 dyoung 3. Neither the name of the Intel Corporation nor the names of its
17 1.1 dyoung contributors may be used to endorse or promote products derived from
18 1.1 dyoung this software without specific prior written permission.
19 1.1 dyoung
20 1.1 dyoung THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 1.1 dyoung AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 1.1 dyoung IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 1.1 dyoung ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 1.1 dyoung LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 1.1 dyoung CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 1.1 dyoung SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 1.1 dyoung INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 1.1 dyoung CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 1.1 dyoung ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 1.1 dyoung POSSIBILITY OF SUCH DAMAGE.
31 1.1 dyoung
32 1.1 dyoung ******************************************************************************/
33 1.15 msaitoh /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 299200 2016-05-06 22:54:56Z pfg $*/
34 1.15 msaitoh /*$NetBSD: ixgbe_api.c,v 1.15 2016/12/05 08:50:29 msaitoh Exp $*/
35 1.1 dyoung
36 1.1 dyoung #include "ixgbe_api.h"
37 1.1 dyoung #include "ixgbe_common.h"
38 1.1 dyoung
39 1.13 msaitoh static const u32 ixgbe_mvals_base[IXGBE_MVALS_IDX_LIMIT] = {
40 1.13 msaitoh IXGBE_MVALS_INIT()
41 1.13 msaitoh };
42 1.13 msaitoh
43 1.13 msaitoh static const u32 ixgbe_mvals_X540[IXGBE_MVALS_IDX_LIMIT] = {
44 1.13 msaitoh IXGBE_MVALS_INIT(_X540)
45 1.13 msaitoh };
46 1.13 msaitoh
47 1.13 msaitoh static const u32 ixgbe_mvals_X550[IXGBE_MVALS_IDX_LIMIT] = {
48 1.13 msaitoh IXGBE_MVALS_INIT(_X550)
49 1.13 msaitoh };
50 1.13 msaitoh
51 1.13 msaitoh static const u32 ixgbe_mvals_X550EM_x[IXGBE_MVALS_IDX_LIMIT] = {
52 1.13 msaitoh IXGBE_MVALS_INIT(_X550EM_x)
53 1.13 msaitoh };
54 1.13 msaitoh
55 1.1 dyoung /**
56 1.8 msaitoh * ixgbe_dcb_get_rtrup2tc - read rtrup2tc reg
57 1.8 msaitoh * @hw: pointer to hardware structure
58 1.8 msaitoh * @map: pointer to u8 arr for returning map
59 1.8 msaitoh *
60 1.8 msaitoh * Read the rtrup2tc HW register and resolve its content into map
61 1.8 msaitoh **/
62 1.8 msaitoh void ixgbe_dcb_get_rtrup2tc(struct ixgbe_hw *hw, u8 *map)
63 1.8 msaitoh {
64 1.8 msaitoh if (hw->mac.ops.get_rtrup2tc)
65 1.8 msaitoh hw->mac.ops.get_rtrup2tc(hw, map);
66 1.8 msaitoh }
67 1.8 msaitoh
68 1.8 msaitoh /**
69 1.1 dyoung * ixgbe_init_shared_code - Initialize the shared code
70 1.1 dyoung * @hw: pointer to hardware structure
71 1.1 dyoung *
72 1.1 dyoung * This will assign function pointers and assign the MAC type and PHY code.
73 1.1 dyoung * Does not touch the hardware. This function must be called prior to any
74 1.1 dyoung * other function in the shared code. The ixgbe_hw structure should be
75 1.1 dyoung * memset to 0 prior to calling this function. The following fields in
76 1.1 dyoung * hw structure should be filled in prior to calling this function:
77 1.1 dyoung * back, device_id, vendor_id, subsystem_device_id,
78 1.1 dyoung * subsystem_vendor_id, and revision_id
79 1.1 dyoung **/
80 1.1 dyoung s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
81 1.1 dyoung {
82 1.1 dyoung s32 status;
83 1.1 dyoung
84 1.1 dyoung DEBUGFUNC("ixgbe_init_shared_code");
85 1.1 dyoung
86 1.1 dyoung /*
87 1.1 dyoung * Set the mac type
88 1.1 dyoung */
89 1.1 dyoung ixgbe_set_mac_type(hw);
90 1.1 dyoung
91 1.1 dyoung switch (hw->mac.type) {
92 1.1 dyoung case ixgbe_mac_82598EB:
93 1.1 dyoung status = ixgbe_init_ops_82598(hw);
94 1.1 dyoung break;
95 1.1 dyoung case ixgbe_mac_82599EB:
96 1.1 dyoung status = ixgbe_init_ops_82599(hw);
97 1.1 dyoung break;
98 1.12 msaitoh case ixgbe_mac_X540:
99 1.12 msaitoh status = ixgbe_init_ops_X540(hw);
100 1.12 msaitoh break;
101 1.12 msaitoh case ixgbe_mac_X550:
102 1.12 msaitoh status = ixgbe_init_ops_X550(hw);
103 1.12 msaitoh break;
104 1.12 msaitoh case ixgbe_mac_X550EM_x:
105 1.12 msaitoh status = ixgbe_init_ops_X550EM(hw);
106 1.12 msaitoh break;
107 1.1 dyoung case ixgbe_mac_82599_vf:
108 1.5 msaitoh case ixgbe_mac_X540_vf:
109 1.12 msaitoh case ixgbe_mac_X550_vf:
110 1.12 msaitoh case ixgbe_mac_X550EM_x_vf:
111 1.1 dyoung status = ixgbe_init_ops_vf(hw);
112 1.1 dyoung break;
113 1.1 dyoung default:
114 1.1 dyoung status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
115 1.1 dyoung break;
116 1.1 dyoung }
117 1.14 msaitoh hw->mac.max_link_up_time = IXGBE_LINK_UP_TIME;
118 1.1 dyoung
119 1.1 dyoung return status;
120 1.1 dyoung }
121 1.1 dyoung
122 1.1 dyoung /**
123 1.1 dyoung * ixgbe_set_mac_type - Sets MAC type
124 1.1 dyoung * @hw: pointer to the HW structure
125 1.1 dyoung *
126 1.1 dyoung * This function sets the mac type of the adapter based on the
127 1.1 dyoung * vendor ID and device ID stored in the hw structure.
128 1.1 dyoung **/
129 1.1 dyoung s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
130 1.1 dyoung {
131 1.1 dyoung s32 ret_val = IXGBE_SUCCESS;
132 1.1 dyoung
133 1.1 dyoung DEBUGFUNC("ixgbe_set_mac_type\n");
134 1.1 dyoung
135 1.8 msaitoh if (hw->vendor_id != IXGBE_INTEL_VENDOR_ID) {
136 1.8 msaitoh ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
137 1.8 msaitoh "Unsupported vendor id: %x", hw->vendor_id);
138 1.8 msaitoh return IXGBE_ERR_DEVICE_NOT_SUPPORTED;
139 1.8 msaitoh }
140 1.8 msaitoh
141 1.13 msaitoh hw->mvals = ixgbe_mvals_base;
142 1.13 msaitoh
143 1.7 msaitoh switch (hw->device_id) {
144 1.7 msaitoh case IXGBE_DEV_ID_82598:
145 1.7 msaitoh case IXGBE_DEV_ID_82598_BX:
146 1.7 msaitoh case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
147 1.7 msaitoh case IXGBE_DEV_ID_82598AF_DUAL_PORT:
148 1.7 msaitoh case IXGBE_DEV_ID_82598AT:
149 1.7 msaitoh case IXGBE_DEV_ID_82598AT2:
150 1.7 msaitoh case IXGBE_DEV_ID_82598EB_CX4:
151 1.7 msaitoh case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
152 1.7 msaitoh case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
153 1.7 msaitoh case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
154 1.7 msaitoh case IXGBE_DEV_ID_82598EB_XF_LR:
155 1.7 msaitoh case IXGBE_DEV_ID_82598EB_SFP_LOM:
156 1.7 msaitoh hw->mac.type = ixgbe_mac_82598EB;
157 1.7 msaitoh break;
158 1.7 msaitoh case IXGBE_DEV_ID_82599_KX4:
159 1.7 msaitoh case IXGBE_DEV_ID_82599_KX4_MEZZ:
160 1.7 msaitoh case IXGBE_DEV_ID_82599_XAUI_LOM:
161 1.7 msaitoh case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
162 1.7 msaitoh case IXGBE_DEV_ID_82599_KR:
163 1.7 msaitoh case IXGBE_DEV_ID_82599_SFP:
164 1.7 msaitoh case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
165 1.7 msaitoh case IXGBE_DEV_ID_82599_SFP_FCOE:
166 1.7 msaitoh case IXGBE_DEV_ID_82599_SFP_EM:
167 1.7 msaitoh case IXGBE_DEV_ID_82599_SFP_SF2:
168 1.7 msaitoh case IXGBE_DEV_ID_82599_SFP_SF_QP:
169 1.12 msaitoh case IXGBE_DEV_ID_82599_QSFP_SF_QP:
170 1.7 msaitoh case IXGBE_DEV_ID_82599EN_SFP:
171 1.7 msaitoh case IXGBE_DEV_ID_82599_CX4:
172 1.7 msaitoh case IXGBE_DEV_ID_82599_BYPASS:
173 1.7 msaitoh case IXGBE_DEV_ID_82599_T3_LOM:
174 1.7 msaitoh hw->mac.type = ixgbe_mac_82599EB;
175 1.7 msaitoh break;
176 1.7 msaitoh case IXGBE_DEV_ID_82599_VF:
177 1.7 msaitoh case IXGBE_DEV_ID_82599_VF_HV:
178 1.7 msaitoh hw->mac.type = ixgbe_mac_82599_vf;
179 1.7 msaitoh break;
180 1.7 msaitoh case IXGBE_DEV_ID_X540_VF:
181 1.7 msaitoh case IXGBE_DEV_ID_X540_VF_HV:
182 1.7 msaitoh hw->mac.type = ixgbe_mac_X540_vf;
183 1.13 msaitoh hw->mvals = ixgbe_mvals_X540;
184 1.7 msaitoh break;
185 1.7 msaitoh case IXGBE_DEV_ID_X540T:
186 1.12 msaitoh case IXGBE_DEV_ID_X540T1:
187 1.7 msaitoh case IXGBE_DEV_ID_X540_BYPASS:
188 1.7 msaitoh hw->mac.type = ixgbe_mac_X540;
189 1.13 msaitoh hw->mvals = ixgbe_mvals_X540;
190 1.7 msaitoh break;
191 1.12 msaitoh case IXGBE_DEV_ID_X550T:
192 1.14 msaitoh case IXGBE_DEV_ID_X550T1:
193 1.12 msaitoh hw->mac.type = ixgbe_mac_X550;
194 1.13 msaitoh hw->mvals = ixgbe_mvals_X550;
195 1.12 msaitoh break;
196 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_KX4:
197 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_KR:
198 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_10G_T:
199 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_1G_T:
200 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_SFP:
201 1.12 msaitoh hw->mac.type = ixgbe_mac_X550EM_x;
202 1.13 msaitoh hw->mvals = ixgbe_mvals_X550EM_x;
203 1.12 msaitoh break;
204 1.12 msaitoh case IXGBE_DEV_ID_X550_VF:
205 1.12 msaitoh case IXGBE_DEV_ID_X550_VF_HV:
206 1.12 msaitoh hw->mac.type = ixgbe_mac_X550_vf;
207 1.13 msaitoh hw->mvals = ixgbe_mvals_X550;
208 1.12 msaitoh break;
209 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_VF:
210 1.12 msaitoh case IXGBE_DEV_ID_X550EM_X_VF_HV:
211 1.12 msaitoh hw->mac.type = ixgbe_mac_X550EM_x_vf;
212 1.13 msaitoh hw->mvals = ixgbe_mvals_X550EM_x;
213 1.12 msaitoh break;
214 1.7 msaitoh default:
215 1.8 msaitoh ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
216 1.8 msaitoh ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
217 1.8 msaitoh "Unsupported device id: %x",
218 1.8 msaitoh hw->device_id);
219 1.7 msaitoh break;
220 1.9 msaitoh }
221 1.1 dyoung
222 1.1 dyoung DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
223 1.5 msaitoh hw->mac.type, ret_val);
224 1.1 dyoung return ret_val;
225 1.1 dyoung }
226 1.1 dyoung
227 1.1 dyoung /**
228 1.1 dyoung * ixgbe_init_hw - Initialize the hardware
229 1.1 dyoung * @hw: pointer to hardware structure
230 1.1 dyoung *
231 1.1 dyoung * Initialize the hardware by resetting and then starting the hardware
232 1.1 dyoung **/
233 1.1 dyoung s32 ixgbe_init_hw(struct ixgbe_hw *hw)
234 1.1 dyoung {
235 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw),
236 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
237 1.1 dyoung }
238 1.1 dyoung
239 1.1 dyoung /**
240 1.1 dyoung * ixgbe_reset_hw - Performs a hardware reset
241 1.1 dyoung * @hw: pointer to hardware structure
242 1.1 dyoung *
243 1.1 dyoung * Resets the hardware by resetting the transmit and receive units, masks and
244 1.1 dyoung * clears all interrupts, performs a PHY reset, and performs a MAC reset
245 1.1 dyoung **/
246 1.1 dyoung s32 ixgbe_reset_hw(struct ixgbe_hw *hw)
247 1.1 dyoung {
248 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw),
249 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
250 1.1 dyoung }
251 1.1 dyoung
252 1.1 dyoung /**
253 1.1 dyoung * ixgbe_start_hw - Prepares hardware for Rx/Tx
254 1.1 dyoung * @hw: pointer to hardware structure
255 1.1 dyoung *
256 1.1 dyoung * Starts the hardware by filling the bus info structure and media type,
257 1.1 dyoung * clears all on chip counters, initializes receive address registers,
258 1.1 dyoung * multicast table, VLAN filter table, calls routine to setup link and
259 1.1 dyoung * flow control settings, and leaves transmit and receive units disabled
260 1.1 dyoung * and uninitialized.
261 1.1 dyoung **/
262 1.1 dyoung s32 ixgbe_start_hw(struct ixgbe_hw *hw)
263 1.1 dyoung {
264 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw),
265 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
266 1.1 dyoung }
267 1.1 dyoung
268 1.1 dyoung /**
269 1.1 dyoung * ixgbe_enable_relaxed_ordering - Enables tx relaxed ordering,
270 1.1 dyoung * which is disabled by default in ixgbe_start_hw();
271 1.1 dyoung *
272 1.1 dyoung * @hw: pointer to hardware structure
273 1.1 dyoung *
274 1.1 dyoung * Enable relaxed ordering;
275 1.1 dyoung **/
276 1.1 dyoung void ixgbe_enable_relaxed_ordering(struct ixgbe_hw *hw)
277 1.1 dyoung {
278 1.1 dyoung if (hw->mac.ops.enable_relaxed_ordering)
279 1.1 dyoung hw->mac.ops.enable_relaxed_ordering(hw);
280 1.1 dyoung }
281 1.1 dyoung
282 1.1 dyoung /**
283 1.1 dyoung * ixgbe_clear_hw_cntrs - Clear hardware counters
284 1.1 dyoung * @hw: pointer to hardware structure
285 1.1 dyoung *
286 1.1 dyoung * Clears all hardware statistics counters by reading them from the hardware
287 1.1 dyoung * Statistics counters are clear on read.
288 1.1 dyoung **/
289 1.1 dyoung s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw)
290 1.1 dyoung {
291 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw),
292 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
293 1.1 dyoung }
294 1.1 dyoung
295 1.1 dyoung /**
296 1.1 dyoung * ixgbe_get_media_type - Get media type
297 1.1 dyoung * @hw: pointer to hardware structure
298 1.1 dyoung *
299 1.1 dyoung * Returns the media type (fiber, copper, backplane)
300 1.1 dyoung **/
301 1.1 dyoung enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw)
302 1.1 dyoung {
303 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw),
304 1.5 msaitoh ixgbe_media_type_unknown);
305 1.1 dyoung }
306 1.1 dyoung
307 1.1 dyoung /**
308 1.1 dyoung * ixgbe_get_mac_addr - Get MAC address
309 1.1 dyoung * @hw: pointer to hardware structure
310 1.1 dyoung * @mac_addr: Adapter MAC address
311 1.1 dyoung *
312 1.1 dyoung * Reads the adapter's MAC address from the first Receive Address Register
313 1.1 dyoung * (RAR0) A reset of the adapter must have been performed prior to calling
314 1.1 dyoung * this function in order for the MAC address to have been loaded from the
315 1.1 dyoung * EEPROM into RAR0
316 1.1 dyoung **/
317 1.1 dyoung s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr)
318 1.1 dyoung {
319 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr,
320 1.5 msaitoh (hw, mac_addr), IXGBE_NOT_IMPLEMENTED);
321 1.1 dyoung }
322 1.1 dyoung
323 1.1 dyoung /**
324 1.1 dyoung * ixgbe_get_san_mac_addr - Get SAN MAC address
325 1.1 dyoung * @hw: pointer to hardware structure
326 1.1 dyoung * @san_mac_addr: SAN MAC address
327 1.1 dyoung *
328 1.1 dyoung * Reads the SAN MAC address from the EEPROM, if it's available. This is
329 1.1 dyoung * per-port, so set_lan_id() must be called before reading the addresses.
330 1.1 dyoung **/
331 1.1 dyoung s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
332 1.1 dyoung {
333 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_san_mac_addr,
334 1.5 msaitoh (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
335 1.1 dyoung }
336 1.1 dyoung
337 1.1 dyoung /**
338 1.1 dyoung * ixgbe_set_san_mac_addr - Write a SAN MAC address
339 1.1 dyoung * @hw: pointer to hardware structure
340 1.1 dyoung * @san_mac_addr: SAN MAC address
341 1.1 dyoung *
342 1.1 dyoung * Writes A SAN MAC address to the EEPROM.
343 1.1 dyoung **/
344 1.1 dyoung s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
345 1.1 dyoung {
346 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.set_san_mac_addr,
347 1.5 msaitoh (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
348 1.1 dyoung }
349 1.1 dyoung
350 1.1 dyoung /**
351 1.1 dyoung * ixgbe_get_device_caps - Get additional device capabilities
352 1.1 dyoung * @hw: pointer to hardware structure
353 1.1 dyoung * @device_caps: the EEPROM word for device capabilities
354 1.1 dyoung *
355 1.1 dyoung * Reads the extra device capabilities from the EEPROM
356 1.1 dyoung **/
357 1.1 dyoung s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps)
358 1.1 dyoung {
359 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_device_caps,
360 1.5 msaitoh (hw, device_caps), IXGBE_NOT_IMPLEMENTED);
361 1.1 dyoung }
362 1.1 dyoung
363 1.1 dyoung /**
364 1.1 dyoung * ixgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from the EEPROM
365 1.1 dyoung * @hw: pointer to hardware structure
366 1.1 dyoung * @wwnn_prefix: the alternative WWNN prefix
367 1.1 dyoung * @wwpn_prefix: the alternative WWPN prefix
368 1.1 dyoung *
369 1.1 dyoung * This function will read the EEPROM from the alternative SAN MAC address
370 1.1 dyoung * block to check the support for the alternative WWNN/WWPN prefix support.
371 1.1 dyoung **/
372 1.1 dyoung s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix,
373 1.5 msaitoh u16 *wwpn_prefix)
374 1.1 dyoung {
375 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_wwn_prefix,
376 1.5 msaitoh (hw, wwnn_prefix, wwpn_prefix),
377 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
378 1.1 dyoung }
379 1.1 dyoung
380 1.1 dyoung /**
381 1.1 dyoung * ixgbe_get_fcoe_boot_status - Get FCOE boot status from EEPROM
382 1.1 dyoung * @hw: pointer to hardware structure
383 1.1 dyoung * @bs: the fcoe boot status
384 1.1 dyoung *
385 1.1 dyoung * This function will read the FCOE boot status from the iSCSI FCOE block
386 1.1 dyoung **/
387 1.1 dyoung s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs)
388 1.1 dyoung {
389 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_fcoe_boot_status,
390 1.5 msaitoh (hw, bs),
391 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
392 1.1 dyoung }
393 1.1 dyoung
394 1.1 dyoung /**
395 1.1 dyoung * ixgbe_get_bus_info - Set PCI bus info
396 1.1 dyoung * @hw: pointer to hardware structure
397 1.1 dyoung *
398 1.1 dyoung * Sets the PCI bus info (speed, width, type) within the ixgbe_hw structure
399 1.1 dyoung **/
400 1.1 dyoung s32 ixgbe_get_bus_info(struct ixgbe_hw *hw)
401 1.1 dyoung {
402 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw),
403 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
404 1.1 dyoung }
405 1.1 dyoung
406 1.1 dyoung /**
407 1.1 dyoung * ixgbe_get_num_of_tx_queues - Get Tx queues
408 1.1 dyoung * @hw: pointer to hardware structure
409 1.1 dyoung *
410 1.1 dyoung * Returns the number of transmit queues for the given adapter.
411 1.1 dyoung **/
412 1.1 dyoung u32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw)
413 1.1 dyoung {
414 1.1 dyoung return hw->mac.max_tx_queues;
415 1.1 dyoung }
416 1.1 dyoung
417 1.1 dyoung /**
418 1.1 dyoung * ixgbe_get_num_of_rx_queues - Get Rx queues
419 1.1 dyoung * @hw: pointer to hardware structure
420 1.1 dyoung *
421 1.1 dyoung * Returns the number of receive queues for the given adapter.
422 1.1 dyoung **/
423 1.1 dyoung u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw)
424 1.1 dyoung {
425 1.1 dyoung return hw->mac.max_rx_queues;
426 1.1 dyoung }
427 1.1 dyoung
428 1.1 dyoung /**
429 1.1 dyoung * ixgbe_stop_adapter - Disable Rx/Tx units
430 1.1 dyoung * @hw: pointer to hardware structure
431 1.1 dyoung *
432 1.1 dyoung * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
433 1.1 dyoung * disables transmit and receive units. The adapter_stopped flag is used by
434 1.1 dyoung * the shared code and drivers to determine if the adapter is in a stopped
435 1.1 dyoung * state and should not touch the hardware.
436 1.1 dyoung **/
437 1.1 dyoung s32 ixgbe_stop_adapter(struct ixgbe_hw *hw)
438 1.1 dyoung {
439 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw),
440 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
441 1.1 dyoung }
442 1.1 dyoung
443 1.1 dyoung /**
444 1.1 dyoung * ixgbe_read_pba_string - Reads part number string from EEPROM
445 1.1 dyoung * @hw: pointer to hardware structure
446 1.1 dyoung * @pba_num: stores the part number string from the EEPROM
447 1.1 dyoung * @pba_num_size: part number string buffer length
448 1.1 dyoung *
449 1.1 dyoung * Reads the part number string from the EEPROM.
450 1.1 dyoung **/
451 1.1 dyoung s32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size)
452 1.1 dyoung {
453 1.1 dyoung return ixgbe_read_pba_string_generic(hw, pba_num, pba_num_size);
454 1.1 dyoung }
455 1.1 dyoung
456 1.1 dyoung /**
457 1.1 dyoung * ixgbe_read_pba_num - Reads part number from EEPROM
458 1.1 dyoung * @hw: pointer to hardware structure
459 1.1 dyoung * @pba_num: stores the part number from the EEPROM
460 1.1 dyoung *
461 1.1 dyoung * Reads the part number from the EEPROM.
462 1.1 dyoung **/
463 1.1 dyoung s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num)
464 1.1 dyoung {
465 1.1 dyoung return ixgbe_read_pba_num_generic(hw, pba_num);
466 1.1 dyoung }
467 1.1 dyoung
468 1.1 dyoung /**
469 1.1 dyoung * ixgbe_identify_phy - Get PHY type
470 1.1 dyoung * @hw: pointer to hardware structure
471 1.1 dyoung *
472 1.1 dyoung * Determines the physical layer module found on the current adapter.
473 1.1 dyoung **/
474 1.1 dyoung s32 ixgbe_identify_phy(struct ixgbe_hw *hw)
475 1.1 dyoung {
476 1.1 dyoung s32 status = IXGBE_SUCCESS;
477 1.1 dyoung
478 1.1 dyoung if (hw->phy.type == ixgbe_phy_unknown) {
479 1.1 dyoung status = ixgbe_call_func(hw, hw->phy.ops.identify, (hw),
480 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
481 1.1 dyoung }
482 1.1 dyoung
483 1.1 dyoung return status;
484 1.1 dyoung }
485 1.1 dyoung
486 1.1 dyoung /**
487 1.1 dyoung * ixgbe_reset_phy - Perform a PHY reset
488 1.1 dyoung * @hw: pointer to hardware structure
489 1.1 dyoung **/
490 1.1 dyoung s32 ixgbe_reset_phy(struct ixgbe_hw *hw)
491 1.1 dyoung {
492 1.1 dyoung s32 status = IXGBE_SUCCESS;
493 1.1 dyoung
494 1.1 dyoung if (hw->phy.type == ixgbe_phy_unknown) {
495 1.1 dyoung if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS)
496 1.1 dyoung status = IXGBE_ERR_PHY;
497 1.1 dyoung }
498 1.1 dyoung
499 1.1 dyoung if (status == IXGBE_SUCCESS) {
500 1.1 dyoung status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw),
501 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
502 1.1 dyoung }
503 1.1 dyoung return status;
504 1.1 dyoung }
505 1.1 dyoung
506 1.1 dyoung /**
507 1.1 dyoung * ixgbe_get_phy_firmware_version -
508 1.1 dyoung * @hw: pointer to hardware structure
509 1.1 dyoung * @firmware_version: pointer to firmware version
510 1.1 dyoung **/
511 1.1 dyoung s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version)
512 1.1 dyoung {
513 1.1 dyoung s32 status = IXGBE_SUCCESS;
514 1.1 dyoung
515 1.1 dyoung status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version,
516 1.5 msaitoh (hw, firmware_version),
517 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
518 1.1 dyoung return status;
519 1.1 dyoung }
520 1.1 dyoung
521 1.1 dyoung /**
522 1.1 dyoung * ixgbe_read_phy_reg - Read PHY register
523 1.1 dyoung * @hw: pointer to hardware structure
524 1.1 dyoung * @reg_addr: 32 bit address of PHY register to read
525 1.1 dyoung * @phy_data: Pointer to read data from PHY register
526 1.1 dyoung *
527 1.1 dyoung * Reads a value from a specified PHY register
528 1.1 dyoung **/
529 1.1 dyoung s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
530 1.5 msaitoh u16 *phy_data)
531 1.1 dyoung {
532 1.1 dyoung if (hw->phy.id == 0)
533 1.1 dyoung ixgbe_identify_phy(hw);
534 1.1 dyoung
535 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
536 1.5 msaitoh device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
537 1.1 dyoung }
538 1.1 dyoung
539 1.1 dyoung /**
540 1.1 dyoung * ixgbe_write_phy_reg - Write PHY register
541 1.1 dyoung * @hw: pointer to hardware structure
542 1.1 dyoung * @reg_addr: 32 bit PHY register to write
543 1.1 dyoung * @phy_data: Data to write to the PHY register
544 1.1 dyoung *
545 1.1 dyoung * Writes a value to specified PHY register
546 1.1 dyoung **/
547 1.1 dyoung s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
548 1.5 msaitoh u16 phy_data)
549 1.1 dyoung {
550 1.1 dyoung if (hw->phy.id == 0)
551 1.1 dyoung ixgbe_identify_phy(hw);
552 1.1 dyoung
553 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
554 1.5 msaitoh device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
555 1.1 dyoung }
556 1.1 dyoung
557 1.1 dyoung /**
558 1.1 dyoung * ixgbe_setup_phy_link - Restart PHY autoneg
559 1.1 dyoung * @hw: pointer to hardware structure
560 1.1 dyoung *
561 1.1 dyoung * Restart autonegotiation and PHY and waits for completion.
562 1.1 dyoung **/
563 1.1 dyoung s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
564 1.1 dyoung {
565 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw),
566 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
567 1.1 dyoung }
568 1.1 dyoung
569 1.1 dyoung /**
570 1.12 msaitoh * ixgbe_setup_internal_phy - Configure integrated PHY
571 1.12 msaitoh * @hw: pointer to hardware structure
572 1.12 msaitoh *
573 1.12 msaitoh * Reconfigure the integrated PHY in order to enable talk to the external PHY.
574 1.12 msaitoh * Returns success if not implemented, since nothing needs to be done in this
575 1.12 msaitoh * case.
576 1.12 msaitoh */
577 1.12 msaitoh s32 ixgbe_setup_internal_phy(struct ixgbe_hw *hw)
578 1.12 msaitoh {
579 1.12 msaitoh return ixgbe_call_func(hw, hw->phy.ops.setup_internal_link, (hw),
580 1.12 msaitoh IXGBE_SUCCESS);
581 1.12 msaitoh }
582 1.12 msaitoh
583 1.12 msaitoh /**
584 1.1 dyoung * ixgbe_check_phy_link - Determine link and speed status
585 1.1 dyoung * @hw: pointer to hardware structure
586 1.1 dyoung *
587 1.1 dyoung * Reads a PHY register to determine if link is up and the current speed for
588 1.1 dyoung * the PHY.
589 1.1 dyoung **/
590 1.1 dyoung s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
591 1.5 msaitoh bool *link_up)
592 1.1 dyoung {
593 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
594 1.5 msaitoh link_up), IXGBE_NOT_IMPLEMENTED);
595 1.1 dyoung }
596 1.1 dyoung
597 1.1 dyoung /**
598 1.1 dyoung * ixgbe_setup_phy_link_speed - Set auto advertise
599 1.1 dyoung * @hw: pointer to hardware structure
600 1.1 dyoung * @speed: new link speed
601 1.1 dyoung *
602 1.1 dyoung * Sets the auto advertised capabilities
603 1.1 dyoung **/
604 1.1 dyoung s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
605 1.5 msaitoh bool autoneg_wait_to_complete)
606 1.1 dyoung {
607 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
608 1.7 msaitoh autoneg_wait_to_complete),
609 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
610 1.1 dyoung }
611 1.1 dyoung
612 1.1 dyoung /**
613 1.12 msaitoh * ixgbe_set_phy_power - Control the phy power state
614 1.12 msaitoh * @hw: pointer to hardware structure
615 1.12 msaitoh * @on: TRUE for on, FALSE for off
616 1.12 msaitoh */
617 1.12 msaitoh s32 ixgbe_set_phy_power(struct ixgbe_hw *hw, bool on)
618 1.12 msaitoh {
619 1.12 msaitoh return ixgbe_call_func(hw, hw->phy.ops.set_phy_power, (hw, on),
620 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
621 1.12 msaitoh }
622 1.12 msaitoh
623 1.12 msaitoh /**
624 1.1 dyoung * ixgbe_check_link - Get link and speed status
625 1.1 dyoung * @hw: pointer to hardware structure
626 1.1 dyoung *
627 1.1 dyoung * Reads the links register to determine if link is up and the current speed
628 1.1 dyoung **/
629 1.1 dyoung s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
630 1.5 msaitoh bool *link_up, bool link_up_wait_to_complete)
631 1.1 dyoung {
632 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed,
633 1.5 msaitoh link_up, link_up_wait_to_complete),
634 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
635 1.1 dyoung }
636 1.1 dyoung
637 1.1 dyoung /**
638 1.1 dyoung * ixgbe_disable_tx_laser - Disable Tx laser
639 1.1 dyoung * @hw: pointer to hardware structure
640 1.1 dyoung *
641 1.1 dyoung * If the driver needs to disable the laser on SFI optics.
642 1.1 dyoung **/
643 1.1 dyoung void ixgbe_disable_tx_laser(struct ixgbe_hw *hw)
644 1.1 dyoung {
645 1.1 dyoung if (hw->mac.ops.disable_tx_laser)
646 1.1 dyoung hw->mac.ops.disable_tx_laser(hw);
647 1.1 dyoung }
648 1.1 dyoung
649 1.1 dyoung /**
650 1.1 dyoung * ixgbe_enable_tx_laser - Enable Tx laser
651 1.1 dyoung * @hw: pointer to hardware structure
652 1.1 dyoung *
653 1.1 dyoung * If the driver needs to enable the laser on SFI optics.
654 1.1 dyoung **/
655 1.1 dyoung void ixgbe_enable_tx_laser(struct ixgbe_hw *hw)
656 1.1 dyoung {
657 1.1 dyoung if (hw->mac.ops.enable_tx_laser)
658 1.1 dyoung hw->mac.ops.enable_tx_laser(hw);
659 1.1 dyoung }
660 1.1 dyoung
661 1.1 dyoung /**
662 1.1 dyoung * ixgbe_flap_tx_laser - flap Tx laser to start autotry process
663 1.1 dyoung * @hw: pointer to hardware structure
664 1.1 dyoung *
665 1.1 dyoung * When the driver changes the link speeds that it can support then
666 1.1 dyoung * flap the tx laser to alert the link partner to start autotry
667 1.1 dyoung * process on its end.
668 1.1 dyoung **/
669 1.1 dyoung void ixgbe_flap_tx_laser(struct ixgbe_hw *hw)
670 1.1 dyoung {
671 1.1 dyoung if (hw->mac.ops.flap_tx_laser)
672 1.1 dyoung hw->mac.ops.flap_tx_laser(hw);
673 1.1 dyoung }
674 1.1 dyoung
675 1.1 dyoung /**
676 1.1 dyoung * ixgbe_setup_link - Set link speed
677 1.1 dyoung * @hw: pointer to hardware structure
678 1.1 dyoung * @speed: new link speed
679 1.1 dyoung *
680 1.1 dyoung * Configures link settings. Restarts the link.
681 1.1 dyoung * Performs autonegotiation if needed.
682 1.1 dyoung **/
683 1.1 dyoung s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
684 1.5 msaitoh bool autoneg_wait_to_complete)
685 1.1 dyoung {
686 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
687 1.7 msaitoh autoneg_wait_to_complete),
688 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
689 1.1 dyoung }
690 1.1 dyoung
691 1.1 dyoung /**
692 1.12 msaitoh * ixgbe_setup_mac_link - Set link speed
693 1.12 msaitoh * @hw: pointer to hardware structure
694 1.12 msaitoh * @speed: new link speed
695 1.12 msaitoh *
696 1.12 msaitoh * Configures link settings. Restarts the link.
697 1.12 msaitoh * Performs autonegotiation if needed.
698 1.12 msaitoh **/
699 1.12 msaitoh s32 ixgbe_setup_mac_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
700 1.12 msaitoh bool autoneg_wait_to_complete)
701 1.12 msaitoh {
702 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.setup_mac_link, (hw, speed,
703 1.12 msaitoh autoneg_wait_to_complete),
704 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
705 1.12 msaitoh }
706 1.12 msaitoh
707 1.12 msaitoh /**
708 1.1 dyoung * ixgbe_get_link_capabilities - Returns link capabilities
709 1.1 dyoung * @hw: pointer to hardware structure
710 1.1 dyoung *
711 1.1 dyoung * Determines the link capabilities of the current configuration.
712 1.1 dyoung **/
713 1.1 dyoung s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
714 1.5 msaitoh bool *autoneg)
715 1.1 dyoung {
716 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw,
717 1.5 msaitoh speed, autoneg), IXGBE_NOT_IMPLEMENTED);
718 1.1 dyoung }
719 1.1 dyoung
720 1.1 dyoung /**
721 1.1 dyoung * ixgbe_led_on - Turn on LEDs
722 1.1 dyoung * @hw: pointer to hardware structure
723 1.1 dyoung * @index: led number to turn on
724 1.1 dyoung *
725 1.1 dyoung * Turns on the software controllable LEDs.
726 1.1 dyoung **/
727 1.1 dyoung s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index)
728 1.1 dyoung {
729 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index),
730 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
731 1.1 dyoung }
732 1.1 dyoung
733 1.1 dyoung /**
734 1.1 dyoung * ixgbe_led_off - Turn off LEDs
735 1.1 dyoung * @hw: pointer to hardware structure
736 1.1 dyoung * @index: led number to turn off
737 1.1 dyoung *
738 1.1 dyoung * Turns off the software controllable LEDs.
739 1.1 dyoung **/
740 1.1 dyoung s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index)
741 1.1 dyoung {
742 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index),
743 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
744 1.1 dyoung }
745 1.1 dyoung
746 1.1 dyoung /**
747 1.1 dyoung * ixgbe_blink_led_start - Blink LEDs
748 1.1 dyoung * @hw: pointer to hardware structure
749 1.1 dyoung * @index: led number to blink
750 1.1 dyoung *
751 1.1 dyoung * Blink LED based on index.
752 1.1 dyoung **/
753 1.1 dyoung s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index)
754 1.1 dyoung {
755 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index),
756 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
757 1.1 dyoung }
758 1.1 dyoung
759 1.1 dyoung /**
760 1.1 dyoung * ixgbe_blink_led_stop - Stop blinking LEDs
761 1.1 dyoung * @hw: pointer to hardware structure
762 1.1 dyoung *
763 1.1 dyoung * Stop blinking LED based on index.
764 1.1 dyoung **/
765 1.1 dyoung s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index)
766 1.1 dyoung {
767 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index),
768 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
769 1.1 dyoung }
770 1.1 dyoung
771 1.1 dyoung /**
772 1.1 dyoung * ixgbe_init_eeprom_params - Initialize EEPROM parameters
773 1.1 dyoung * @hw: pointer to hardware structure
774 1.1 dyoung *
775 1.1 dyoung * Initializes the EEPROM parameters ixgbe_eeprom_info within the
776 1.1 dyoung * ixgbe_hw struct in order to set up EEPROM access.
777 1.1 dyoung **/
778 1.1 dyoung s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw)
779 1.1 dyoung {
780 1.1 dyoung return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw),
781 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
782 1.1 dyoung }
783 1.1 dyoung
784 1.1 dyoung
785 1.1 dyoung /**
786 1.1 dyoung * ixgbe_write_eeprom - Write word to EEPROM
787 1.1 dyoung * @hw: pointer to hardware structure
788 1.1 dyoung * @offset: offset within the EEPROM to be written to
789 1.1 dyoung * @data: 16 bit word to be written to the EEPROM
790 1.1 dyoung *
791 1.1 dyoung * Writes 16 bit value to EEPROM. If ixgbe_eeprom_update_checksum is not
792 1.1 dyoung * called after this function, the EEPROM will most likely contain an
793 1.1 dyoung * invalid checksum.
794 1.1 dyoung **/
795 1.1 dyoung s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data)
796 1.1 dyoung {
797 1.1 dyoung return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data),
798 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
799 1.5 msaitoh }
800 1.5 msaitoh
801 1.5 msaitoh /**
802 1.5 msaitoh * ixgbe_write_eeprom_buffer - Write word(s) to EEPROM
803 1.5 msaitoh * @hw: pointer to hardware structure
804 1.5 msaitoh * @offset: offset within the EEPROM to be written to
805 1.5 msaitoh * @data: 16 bit word(s) to be written to the EEPROM
806 1.5 msaitoh * @words: number of words
807 1.5 msaitoh *
808 1.5 msaitoh * Writes 16 bit word(s) to EEPROM. If ixgbe_eeprom_update_checksum is not
809 1.5 msaitoh * called after this function, the EEPROM will most likely contain an
810 1.5 msaitoh * invalid checksum.
811 1.5 msaitoh **/
812 1.5 msaitoh s32 ixgbe_write_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, u16 words,
813 1.5 msaitoh u16 *data)
814 1.5 msaitoh {
815 1.5 msaitoh return ixgbe_call_func(hw, hw->eeprom.ops.write_buffer,
816 1.5 msaitoh (hw, offset, words, data),
817 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
818 1.1 dyoung }
819 1.1 dyoung
820 1.1 dyoung /**
821 1.1 dyoung * ixgbe_read_eeprom - Read word from EEPROM
822 1.1 dyoung * @hw: pointer to hardware structure
823 1.1 dyoung * @offset: offset within the EEPROM to be read
824 1.1 dyoung * @data: read 16 bit value from EEPROM
825 1.1 dyoung *
826 1.1 dyoung * Reads 16 bit value from EEPROM
827 1.1 dyoung **/
828 1.1 dyoung s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data)
829 1.1 dyoung {
830 1.1 dyoung return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data),
831 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
832 1.5 msaitoh }
833 1.5 msaitoh
834 1.5 msaitoh /**
835 1.5 msaitoh * ixgbe_read_eeprom_buffer - Read word(s) from EEPROM
836 1.5 msaitoh * @hw: pointer to hardware structure
837 1.5 msaitoh * @offset: offset within the EEPROM to be read
838 1.5 msaitoh * @data: read 16 bit word(s) from EEPROM
839 1.5 msaitoh * @words: number of words
840 1.5 msaitoh *
841 1.5 msaitoh * Reads 16 bit word(s) from EEPROM
842 1.5 msaitoh **/
843 1.5 msaitoh s32 ixgbe_read_eeprom_buffer(struct ixgbe_hw *hw, u16 offset,
844 1.5 msaitoh u16 words, u16 *data)
845 1.5 msaitoh {
846 1.5 msaitoh return ixgbe_call_func(hw, hw->eeprom.ops.read_buffer,
847 1.5 msaitoh (hw, offset, words, data),
848 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
849 1.1 dyoung }
850 1.1 dyoung
851 1.1 dyoung /**
852 1.1 dyoung * ixgbe_validate_eeprom_checksum - Validate EEPROM checksum
853 1.1 dyoung * @hw: pointer to hardware structure
854 1.1 dyoung * @checksum_val: calculated checksum
855 1.1 dyoung *
856 1.1 dyoung * Performs checksum calculation and validates the EEPROM checksum
857 1.1 dyoung **/
858 1.1 dyoung s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val)
859 1.1 dyoung {
860 1.1 dyoung return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum,
861 1.5 msaitoh (hw, checksum_val), IXGBE_NOT_IMPLEMENTED);
862 1.1 dyoung }
863 1.1 dyoung
864 1.1 dyoung /**
865 1.1 dyoung * ixgbe_eeprom_update_checksum - Updates the EEPROM checksum
866 1.1 dyoung * @hw: pointer to hardware structure
867 1.1 dyoung **/
868 1.1 dyoung s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw)
869 1.1 dyoung {
870 1.1 dyoung return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw),
871 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
872 1.1 dyoung }
873 1.1 dyoung
874 1.1 dyoung /**
875 1.1 dyoung * ixgbe_insert_mac_addr - Find a RAR for this mac address
876 1.1 dyoung * @hw: pointer to hardware structure
877 1.1 dyoung * @addr: Address to put into receive address register
878 1.1 dyoung * @vmdq: VMDq pool to assign
879 1.1 dyoung *
880 1.1 dyoung * Puts an ethernet address into a receive address register, or
881 1.15 msaitoh * finds the rar that it is already in; adds to the pool list
882 1.1 dyoung **/
883 1.1 dyoung s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
884 1.1 dyoung {
885 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.insert_mac_addr,
886 1.5 msaitoh (hw, addr, vmdq),
887 1.1 dyoung IXGBE_NOT_IMPLEMENTED);
888 1.1 dyoung }
889 1.1 dyoung
890 1.1 dyoung /**
891 1.1 dyoung * ixgbe_set_rar - Set Rx address register
892 1.1 dyoung * @hw: pointer to hardware structure
893 1.1 dyoung * @index: Receive address register to write
894 1.1 dyoung * @addr: Address to put into receive address register
895 1.1 dyoung * @vmdq: VMDq "set"
896 1.1 dyoung * @enable_addr: set flag that address is active
897 1.1 dyoung *
898 1.1 dyoung * Puts an ethernet address into a receive address register.
899 1.1 dyoung **/
900 1.1 dyoung s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
901 1.5 msaitoh u32 enable_addr)
902 1.1 dyoung {
903 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq,
904 1.5 msaitoh enable_addr), IXGBE_NOT_IMPLEMENTED);
905 1.1 dyoung }
906 1.1 dyoung
907 1.1 dyoung /**
908 1.1 dyoung * ixgbe_clear_rar - Clear Rx address register
909 1.1 dyoung * @hw: pointer to hardware structure
910 1.1 dyoung * @index: Receive address register to write
911 1.1 dyoung *
912 1.1 dyoung * Puts an ethernet address into a receive address register.
913 1.1 dyoung **/
914 1.1 dyoung s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index)
915 1.1 dyoung {
916 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.clear_rar, (hw, index),
917 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
918 1.1 dyoung }
919 1.1 dyoung
920 1.1 dyoung /**
921 1.1 dyoung * ixgbe_set_vmdq - Associate a VMDq index with a receive address
922 1.1 dyoung * @hw: pointer to hardware structure
923 1.1 dyoung * @rar: receive address register index to associate with VMDq index
924 1.1 dyoung * @vmdq: VMDq set or pool index
925 1.1 dyoung **/
926 1.1 dyoung s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
927 1.1 dyoung {
928 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq),
929 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
930 1.6 msaitoh
931 1.6 msaitoh }
932 1.6 msaitoh
933 1.6 msaitoh /**
934 1.6 msaitoh * ixgbe_set_vmdq_san_mac - Associate VMDq index 127 with a receive address
935 1.6 msaitoh * @hw: pointer to hardware structure
936 1.6 msaitoh * @vmdq: VMDq default pool index
937 1.6 msaitoh **/
938 1.6 msaitoh s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq)
939 1.6 msaitoh {
940 1.6 msaitoh return ixgbe_call_func(hw, hw->mac.ops.set_vmdq_san_mac,
941 1.6 msaitoh (hw, vmdq), IXGBE_NOT_IMPLEMENTED);
942 1.1 dyoung }
943 1.1 dyoung
944 1.1 dyoung /**
945 1.1 dyoung * ixgbe_clear_vmdq - Disassociate a VMDq index from a receive address
946 1.1 dyoung * @hw: pointer to hardware structure
947 1.1 dyoung * @rar: receive address register index to disassociate with VMDq index
948 1.1 dyoung * @vmdq: VMDq set or pool index
949 1.1 dyoung **/
950 1.1 dyoung s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
951 1.1 dyoung {
952 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.clear_vmdq, (hw, rar, vmdq),
953 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
954 1.1 dyoung }
955 1.1 dyoung
956 1.1 dyoung /**
957 1.1 dyoung * ixgbe_init_rx_addrs - Initializes receive address filters.
958 1.1 dyoung * @hw: pointer to hardware structure
959 1.1 dyoung *
960 1.1 dyoung * Places the MAC address in receive address register 0 and clears the rest
961 1.1 dyoung * of the receive address registers. Clears the multicast table. Assumes
962 1.1 dyoung * the receiver is in reset when the routine is called.
963 1.1 dyoung **/
964 1.1 dyoung s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw)
965 1.1 dyoung {
966 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw),
967 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
968 1.1 dyoung }
969 1.1 dyoung
970 1.1 dyoung /**
971 1.1 dyoung * ixgbe_get_num_rx_addrs - Returns the number of RAR entries.
972 1.1 dyoung * @hw: pointer to hardware structure
973 1.1 dyoung **/
974 1.1 dyoung u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw)
975 1.1 dyoung {
976 1.1 dyoung return hw->mac.num_rar_entries;
977 1.1 dyoung }
978 1.1 dyoung
979 1.1 dyoung /**
980 1.1 dyoung * ixgbe_update_uc_addr_list - Updates the MAC's list of secondary addresses
981 1.1 dyoung * @hw: pointer to hardware structure
982 1.1 dyoung * @addr_list: the list of new multicast addresses
983 1.1 dyoung * @addr_count: number of addresses
984 1.1 dyoung * @func: iterator function to walk the multicast address list
985 1.1 dyoung *
986 1.1 dyoung * The given list replaces any existing list. Clears the secondary addrs from
987 1.1 dyoung * receive address registers. Uses unused receive address registers for the
988 1.1 dyoung * first secondary addresses, and falls back to promiscuous mode as needed.
989 1.1 dyoung **/
990 1.1 dyoung s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
991 1.5 msaitoh u32 addr_count, ixgbe_mc_addr_itr func)
992 1.1 dyoung {
993 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw,
994 1.5 msaitoh addr_list, addr_count, func),
995 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
996 1.1 dyoung }
997 1.1 dyoung
998 1.1 dyoung /**
999 1.1 dyoung * ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses
1000 1.1 dyoung * @hw: pointer to hardware structure
1001 1.1 dyoung * @mc_addr_list: the list of new multicast addresses
1002 1.1 dyoung * @mc_addr_count: number of addresses
1003 1.1 dyoung * @func: iterator function to walk the multicast address list
1004 1.1 dyoung *
1005 1.1 dyoung * The given list replaces any existing list. Clears the MC addrs from receive
1006 1.1 dyoung * address registers and the multicast table. Uses unused receive address
1007 1.1 dyoung * registers for the first multicast addresses, and hashes the rest into the
1008 1.1 dyoung * multicast table.
1009 1.1 dyoung **/
1010 1.1 dyoung s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
1011 1.5 msaitoh u32 mc_addr_count, ixgbe_mc_addr_itr func,
1012 1.5 msaitoh bool clear)
1013 1.1 dyoung {
1014 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw,
1015 1.5 msaitoh mc_addr_list, mc_addr_count, func, clear),
1016 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1017 1.1 dyoung }
1018 1.1 dyoung
1019 1.1 dyoung /**
1020 1.1 dyoung * ixgbe_enable_mc - Enable multicast address in RAR
1021 1.1 dyoung * @hw: pointer to hardware structure
1022 1.1 dyoung *
1023 1.1 dyoung * Enables multicast address in RAR and the use of the multicast hash table.
1024 1.1 dyoung **/
1025 1.1 dyoung s32 ixgbe_enable_mc(struct ixgbe_hw *hw)
1026 1.1 dyoung {
1027 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw),
1028 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1029 1.1 dyoung }
1030 1.1 dyoung
1031 1.1 dyoung /**
1032 1.1 dyoung * ixgbe_disable_mc - Disable multicast address in RAR
1033 1.1 dyoung * @hw: pointer to hardware structure
1034 1.1 dyoung *
1035 1.1 dyoung * Disables multicast address in RAR and the use of the multicast hash table.
1036 1.1 dyoung **/
1037 1.1 dyoung s32 ixgbe_disable_mc(struct ixgbe_hw *hw)
1038 1.1 dyoung {
1039 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw),
1040 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1041 1.1 dyoung }
1042 1.1 dyoung
1043 1.1 dyoung /**
1044 1.1 dyoung * ixgbe_clear_vfta - Clear VLAN filter table
1045 1.1 dyoung * @hw: pointer to hardware structure
1046 1.1 dyoung *
1047 1.1 dyoung * Clears the VLAN filer table, and the VMDq index associated with the filter
1048 1.1 dyoung **/
1049 1.1 dyoung s32 ixgbe_clear_vfta(struct ixgbe_hw *hw)
1050 1.1 dyoung {
1051 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw),
1052 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1053 1.1 dyoung }
1054 1.1 dyoung
1055 1.1 dyoung /**
1056 1.1 dyoung * ixgbe_set_vfta - Set VLAN filter table
1057 1.1 dyoung * @hw: pointer to hardware structure
1058 1.1 dyoung * @vlan: VLAN id to write to VLAN filter
1059 1.1 dyoung * @vind: VMDq output index that maps queue to VLAN id in VFTA
1060 1.1 dyoung * @vlan_on: boolean flag to turn on/off VLAN in VFTA
1061 1.1 dyoung *
1062 1.1 dyoung * Turn on/off specified VLAN in the VLAN filter table.
1063 1.1 dyoung **/
1064 1.1 dyoung s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
1065 1.1 dyoung {
1066 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind,
1067 1.5 msaitoh vlan_on), IXGBE_NOT_IMPLEMENTED);
1068 1.5 msaitoh }
1069 1.5 msaitoh
1070 1.5 msaitoh /**
1071 1.5 msaitoh * ixgbe_set_vlvf - Set VLAN Pool Filter
1072 1.5 msaitoh * @hw: pointer to hardware structure
1073 1.5 msaitoh * @vlan: VLAN id to write to VLAN filter
1074 1.5 msaitoh * @vind: VMDq output index that maps queue to VLAN id in VFVFB
1075 1.5 msaitoh * @vlan_on: boolean flag to turn on/off VLAN in VFVF
1076 1.5 msaitoh * @vfta_changed: pointer to boolean flag which indicates whether VFTA
1077 1.5 msaitoh * should be changed
1078 1.5 msaitoh *
1079 1.5 msaitoh * Turn on/off specified bit in VLVF table.
1080 1.5 msaitoh **/
1081 1.5 msaitoh s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on,
1082 1.5 msaitoh bool *vfta_changed)
1083 1.5 msaitoh {
1084 1.5 msaitoh return ixgbe_call_func(hw, hw->mac.ops.set_vlvf, (hw, vlan, vind,
1085 1.5 msaitoh vlan_on, vfta_changed), IXGBE_NOT_IMPLEMENTED);
1086 1.1 dyoung }
1087 1.1 dyoung
1088 1.1 dyoung /**
1089 1.1 dyoung * ixgbe_fc_enable - Enable flow control
1090 1.1 dyoung * @hw: pointer to hardware structure
1091 1.1 dyoung *
1092 1.1 dyoung * Configures the flow control settings based on SW configuration.
1093 1.1 dyoung **/
1094 1.6 msaitoh s32 ixgbe_fc_enable(struct ixgbe_hw *hw)
1095 1.1 dyoung {
1096 1.6 msaitoh return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw),
1097 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1098 1.5 msaitoh }
1099 1.5 msaitoh
1100 1.5 msaitoh /**
1101 1.12 msaitoh * ixgbe_setup_fc - Set up flow control
1102 1.12 msaitoh * @hw: pointer to hardware structure
1103 1.12 msaitoh *
1104 1.12 msaitoh * Called at init time to set up flow control.
1105 1.12 msaitoh **/
1106 1.12 msaitoh s32 ixgbe_setup_fc(struct ixgbe_hw *hw)
1107 1.12 msaitoh {
1108 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.setup_fc, (hw),
1109 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
1110 1.12 msaitoh }
1111 1.12 msaitoh
1112 1.12 msaitoh /**
1113 1.5 msaitoh * ixgbe_set_fw_drv_ver - Try to send the driver version number FW
1114 1.5 msaitoh * @hw: pointer to hardware structure
1115 1.5 msaitoh * @maj: driver major number to be sent to firmware
1116 1.11 riastrad * @minr: driver minor number to be sent to firmware
1117 1.5 msaitoh * @build: driver build number to be sent to firmware
1118 1.5 msaitoh * @ver: driver version number to be sent to firmware
1119 1.5 msaitoh **/
1120 1.10 riastrad s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 minr, u8 build,
1121 1.5 msaitoh u8 ver)
1122 1.5 msaitoh {
1123 1.10 riastrad return ixgbe_call_func(hw, hw->mac.ops.set_fw_drv_ver, (hw, maj, minr,
1124 1.5 msaitoh build, ver), IXGBE_NOT_IMPLEMENTED);
1125 1.1 dyoung }
1126 1.1 dyoung
1127 1.5 msaitoh
1128 1.8 msaitoh
1129 1.12 msaitoh /**
1130 1.12 msaitoh * ixgbe_dmac_config - Configure DMA Coalescing registers.
1131 1.12 msaitoh * @hw: pointer to hardware structure
1132 1.12 msaitoh *
1133 1.12 msaitoh * Configure DMA coalescing. If enabling dmac, dmac is activated.
1134 1.12 msaitoh * When disabling dmac, dmac enable dmac bit is cleared.
1135 1.12 msaitoh **/
1136 1.12 msaitoh s32 ixgbe_dmac_config(struct ixgbe_hw *hw)
1137 1.12 msaitoh {
1138 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.dmac_config, (hw),
1139 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
1140 1.12 msaitoh }
1141 1.12 msaitoh
1142 1.12 msaitoh /**
1143 1.12 msaitoh * ixgbe_dmac_update_tcs - Configure DMA Coalescing registers.
1144 1.12 msaitoh * @hw: pointer to hardware structure
1145 1.12 msaitoh *
1146 1.12 msaitoh * Disables dmac, updates per TC settings, and then enable dmac.
1147 1.12 msaitoh **/
1148 1.12 msaitoh s32 ixgbe_dmac_update_tcs(struct ixgbe_hw *hw)
1149 1.12 msaitoh {
1150 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.dmac_update_tcs, (hw),
1151 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
1152 1.12 msaitoh }
1153 1.12 msaitoh
1154 1.12 msaitoh /**
1155 1.12 msaitoh * ixgbe_dmac_config_tcs - Configure DMA Coalescing registers.
1156 1.12 msaitoh * @hw: pointer to hardware structure
1157 1.12 msaitoh *
1158 1.12 msaitoh * Configure DMA coalescing threshold per TC and set high priority bit for
1159 1.12 msaitoh * FCOE TC. The dmac enable bit must be cleared before configuring.
1160 1.12 msaitoh **/
1161 1.12 msaitoh s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw)
1162 1.12 msaitoh {
1163 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.dmac_config_tcs, (hw),
1164 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
1165 1.12 msaitoh }
1166 1.12 msaitoh
1167 1.12 msaitoh /**
1168 1.12 msaitoh * ixgbe_setup_eee - Enable/disable EEE support
1169 1.12 msaitoh * @hw: pointer to the HW structure
1170 1.12 msaitoh * @enable_eee: boolean flag to enable EEE
1171 1.12 msaitoh *
1172 1.12 msaitoh * Enable/disable EEE based on enable_ee flag.
1173 1.12 msaitoh * Auto-negotiation must be started after BASE-T EEE bits in PHY register 7.3C
1174 1.12 msaitoh * are modified.
1175 1.12 msaitoh *
1176 1.12 msaitoh **/
1177 1.12 msaitoh s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee)
1178 1.12 msaitoh {
1179 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.setup_eee, (hw, enable_eee),
1180 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
1181 1.12 msaitoh }
1182 1.12 msaitoh
1183 1.12 msaitoh /**
1184 1.12 msaitoh * ixgbe_set_source_address_pruning - Enable/Disable source address pruning
1185 1.12 msaitoh * @hw: pointer to hardware structure
1186 1.12 msaitoh * @enbale: enable or disable source address pruning
1187 1.12 msaitoh * @pool: Rx pool - Rx pool to toggle source address pruning
1188 1.12 msaitoh **/
1189 1.12 msaitoh void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable,
1190 1.12 msaitoh unsigned int pool)
1191 1.12 msaitoh {
1192 1.12 msaitoh if (hw->mac.ops.set_source_address_pruning)
1193 1.12 msaitoh hw->mac.ops.set_source_address_pruning(hw, enable, pool);
1194 1.12 msaitoh }
1195 1.12 msaitoh
1196 1.12 msaitoh /**
1197 1.12 msaitoh * ixgbe_set_ethertype_anti_spoofing - Enable/Disable Ethertype anti-spoofing
1198 1.12 msaitoh * @hw: pointer to hardware structure
1199 1.12 msaitoh * @enable: enable or disable switch for Ethertype anti-spoofing
1200 1.12 msaitoh * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing
1201 1.12 msaitoh *
1202 1.12 msaitoh **/
1203 1.12 msaitoh void ixgbe_set_ethertype_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)
1204 1.12 msaitoh {
1205 1.12 msaitoh if (hw->mac.ops.set_ethertype_anti_spoofing)
1206 1.12 msaitoh hw->mac.ops.set_ethertype_anti_spoofing(hw, enable, vf);
1207 1.12 msaitoh }
1208 1.12 msaitoh
1209 1.12 msaitoh /**
1210 1.12 msaitoh * ixgbe_read_iosf_sb_reg - Read 32 bit PHY register
1211 1.12 msaitoh * @hw: pointer to hardware structure
1212 1.12 msaitoh * @reg_addr: 32 bit address of PHY register to read
1213 1.12 msaitoh * @device_type: type of device you want to communicate with
1214 1.12 msaitoh * @phy_data: Pointer to read data from PHY register
1215 1.12 msaitoh *
1216 1.12 msaitoh * Reads a value from a specified PHY register
1217 1.12 msaitoh **/
1218 1.12 msaitoh s32 ixgbe_read_iosf_sb_reg(struct ixgbe_hw *hw, u32 reg_addr,
1219 1.12 msaitoh u32 device_type, u32 *phy_data)
1220 1.12 msaitoh {
1221 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.read_iosf_sb_reg, (hw, reg_addr,
1222 1.12 msaitoh device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
1223 1.12 msaitoh }
1224 1.12 msaitoh
1225 1.12 msaitoh /**
1226 1.12 msaitoh * ixgbe_write_iosf_sb_reg - Write 32 bit register through IOSF Sideband
1227 1.12 msaitoh * @hw: pointer to hardware structure
1228 1.12 msaitoh * @reg_addr: 32 bit PHY register to write
1229 1.12 msaitoh * @device_type: type of device you want to communicate with
1230 1.12 msaitoh * @phy_data: Data to write to the PHY register
1231 1.12 msaitoh *
1232 1.12 msaitoh * Writes a value to specified PHY register
1233 1.12 msaitoh **/
1234 1.12 msaitoh s32 ixgbe_write_iosf_sb_reg(struct ixgbe_hw *hw, u32 reg_addr,
1235 1.12 msaitoh u32 device_type, u32 phy_data)
1236 1.12 msaitoh {
1237 1.12 msaitoh return ixgbe_call_func(hw, hw->mac.ops.write_iosf_sb_reg, (hw, reg_addr,
1238 1.12 msaitoh device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
1239 1.12 msaitoh }
1240 1.12 msaitoh
1241 1.12 msaitoh /**
1242 1.12 msaitoh * ixgbe_disable_mdd - Disable malicious driver detection
1243 1.12 msaitoh * @hw: pointer to hardware structure
1244 1.12 msaitoh *
1245 1.12 msaitoh **/
1246 1.12 msaitoh void ixgbe_disable_mdd(struct ixgbe_hw *hw)
1247 1.12 msaitoh {
1248 1.12 msaitoh if (hw->mac.ops.disable_mdd)
1249 1.12 msaitoh hw->mac.ops.disable_mdd(hw);
1250 1.12 msaitoh }
1251 1.12 msaitoh
1252 1.12 msaitoh /**
1253 1.12 msaitoh * ixgbe_enable_mdd - Enable malicious driver detection
1254 1.12 msaitoh * @hw: pointer to hardware structure
1255 1.12 msaitoh *
1256 1.12 msaitoh **/
1257 1.12 msaitoh void ixgbe_enable_mdd(struct ixgbe_hw *hw)
1258 1.12 msaitoh {
1259 1.12 msaitoh if (hw->mac.ops.enable_mdd)
1260 1.12 msaitoh hw->mac.ops.enable_mdd(hw);
1261 1.12 msaitoh }
1262 1.12 msaitoh
1263 1.12 msaitoh /**
1264 1.12 msaitoh * ixgbe_mdd_event - Handle malicious driver detection event
1265 1.12 msaitoh * @hw: pointer to hardware structure
1266 1.12 msaitoh * @vf_bitmap: vf bitmap of malicious vfs
1267 1.12 msaitoh *
1268 1.12 msaitoh **/
1269 1.12 msaitoh void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap)
1270 1.12 msaitoh {
1271 1.12 msaitoh if (hw->mac.ops.mdd_event)
1272 1.12 msaitoh hw->mac.ops.mdd_event(hw, vf_bitmap);
1273 1.12 msaitoh }
1274 1.12 msaitoh
1275 1.12 msaitoh /**
1276 1.12 msaitoh * ixgbe_restore_mdd_vf - Restore VF that was disabled during malicious driver
1277 1.12 msaitoh * detection event
1278 1.12 msaitoh * @hw: pointer to hardware structure
1279 1.12 msaitoh * @vf: vf index
1280 1.12 msaitoh *
1281 1.12 msaitoh **/
1282 1.12 msaitoh void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf)
1283 1.12 msaitoh {
1284 1.12 msaitoh if (hw->mac.ops.restore_mdd_vf)
1285 1.12 msaitoh hw->mac.ops.restore_mdd_vf(hw, vf);
1286 1.12 msaitoh }
1287 1.12 msaitoh
1288 1.12 msaitoh /**
1289 1.12 msaitoh * ixgbe_enter_lplu - Transition to low power states
1290 1.12 msaitoh * @hw: pointer to hardware structure
1291 1.12 msaitoh *
1292 1.12 msaitoh * Configures Low Power Link Up on transition to low power states
1293 1.12 msaitoh * (from D0 to non-D0).
1294 1.12 msaitoh **/
1295 1.12 msaitoh s32 ixgbe_enter_lplu(struct ixgbe_hw *hw)
1296 1.12 msaitoh {
1297 1.12 msaitoh return ixgbe_call_func(hw, hw->phy.ops.enter_lplu, (hw),
1298 1.12 msaitoh IXGBE_NOT_IMPLEMENTED);
1299 1.12 msaitoh }
1300 1.8 msaitoh
1301 1.1 dyoung /**
1302 1.13 msaitoh * ixgbe_handle_lasi - Handle external Base T PHY interrupt
1303 1.13 msaitoh * @hw: pointer to hardware structure
1304 1.13 msaitoh *
1305 1.13 msaitoh * Handle external Base T PHY interrupt. If high temperature
1306 1.13 msaitoh * failure alarm then return error, else if link status change
1307 1.13 msaitoh * then setup internal/external PHY link
1308 1.13 msaitoh *
1309 1.13 msaitoh * Return IXGBE_ERR_OVERTEMP if interrupt is high temperature
1310 1.13 msaitoh * failure alarm, else return PHY access status.
1311 1.13 msaitoh */
1312 1.13 msaitoh s32 ixgbe_handle_lasi(struct ixgbe_hw *hw)
1313 1.13 msaitoh {
1314 1.13 msaitoh return ixgbe_call_func(hw, hw->phy.ops.handle_lasi, (hw),
1315 1.13 msaitoh IXGBE_NOT_IMPLEMENTED);
1316 1.13 msaitoh }
1317 1.13 msaitoh
1318 1.13 msaitoh /**
1319 1.1 dyoung * ixgbe_read_analog_reg8 - Reads 8 bit analog register
1320 1.1 dyoung * @hw: pointer to hardware structure
1321 1.1 dyoung * @reg: analog register to read
1322 1.1 dyoung * @val: read value
1323 1.1 dyoung *
1324 1.1 dyoung * Performs write operation to analog register specified.
1325 1.1 dyoung **/
1326 1.1 dyoung s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
1327 1.1 dyoung {
1328 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg,
1329 1.5 msaitoh val), IXGBE_NOT_IMPLEMENTED);
1330 1.1 dyoung }
1331 1.1 dyoung
1332 1.1 dyoung /**
1333 1.1 dyoung * ixgbe_write_analog_reg8 - Writes 8 bit analog register
1334 1.1 dyoung * @hw: pointer to hardware structure
1335 1.1 dyoung * @reg: analog register to write
1336 1.1 dyoung * @val: value to write
1337 1.1 dyoung *
1338 1.1 dyoung * Performs write operation to Atlas analog register specified.
1339 1.1 dyoung **/
1340 1.1 dyoung s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
1341 1.1 dyoung {
1342 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg,
1343 1.5 msaitoh val), IXGBE_NOT_IMPLEMENTED);
1344 1.1 dyoung }
1345 1.1 dyoung
1346 1.1 dyoung /**
1347 1.1 dyoung * ixgbe_init_uta_tables - Initializes Unicast Table Arrays.
1348 1.1 dyoung * @hw: pointer to hardware structure
1349 1.1 dyoung *
1350 1.1 dyoung * Initializes the Unicast Table Arrays to zero on device load. This
1351 1.1 dyoung * is part of the Rx init addr execution path.
1352 1.1 dyoung **/
1353 1.1 dyoung s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw)
1354 1.1 dyoung {
1355 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.init_uta_tables, (hw),
1356 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1357 1.1 dyoung }
1358 1.1 dyoung
1359 1.1 dyoung /**
1360 1.1 dyoung * ixgbe_read_i2c_byte - Reads 8 bit word over I2C at specified device address
1361 1.1 dyoung * @hw: pointer to hardware structure
1362 1.1 dyoung * @byte_offset: byte offset to read
1363 1.12 msaitoh * @dev_addr: I2C bus address to read from
1364 1.1 dyoung * @data: value read
1365 1.1 dyoung *
1366 1.1 dyoung * Performs byte read operation to SFP module's EEPROM over I2C interface.
1367 1.1 dyoung **/
1368 1.1 dyoung s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1369 1.5 msaitoh u8 *data)
1370 1.1 dyoung {
1371 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte, (hw, byte_offset,
1372 1.5 msaitoh dev_addr, data), IXGBE_NOT_IMPLEMENTED);
1373 1.1 dyoung }
1374 1.1 dyoung
1375 1.1 dyoung /**
1376 1.13 msaitoh * ixgbe_read_i2c_byte_unlocked - Reads 8 bit word via I2C from device address
1377 1.13 msaitoh * @hw: pointer to hardware structure
1378 1.13 msaitoh * @byte_offset: byte offset to read
1379 1.13 msaitoh * @dev_addr: I2C bus address to read from
1380 1.13 msaitoh * @data: value read
1381 1.13 msaitoh *
1382 1.13 msaitoh * Performs byte read operation to SFP module's EEPROM over I2C interface.
1383 1.13 msaitoh **/
1384 1.13 msaitoh s32 ixgbe_read_i2c_byte_unlocked(struct ixgbe_hw *hw, u8 byte_offset,
1385 1.13 msaitoh u8 dev_addr, u8 *data)
1386 1.13 msaitoh {
1387 1.13 msaitoh return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte_unlocked,
1388 1.13 msaitoh (hw, byte_offset, dev_addr, data),
1389 1.13 msaitoh IXGBE_NOT_IMPLEMENTED);
1390 1.13 msaitoh }
1391 1.13 msaitoh
1392 1.13 msaitoh /**
1393 1.12 msaitoh * ixgbe_read_i2c_combined - Perform I2C read combined operation
1394 1.12 msaitoh * @hw: pointer to the hardware structure
1395 1.12 msaitoh * @addr: I2C bus address to read from
1396 1.12 msaitoh * @reg: I2C device register to read from
1397 1.12 msaitoh * @val: pointer to location to receive read value
1398 1.12 msaitoh *
1399 1.12 msaitoh * Returns an error code on error.
1400 1.12 msaitoh */
1401 1.12 msaitoh s32 ixgbe_read_i2c_combined(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 *val)
1402 1.12 msaitoh {
1403 1.12 msaitoh return ixgbe_call_func(hw, hw->phy.ops.read_i2c_combined, (hw, addr,
1404 1.12 msaitoh reg, val), IXGBE_NOT_IMPLEMENTED);
1405 1.12 msaitoh }
1406 1.12 msaitoh
1407 1.12 msaitoh /**
1408 1.13 msaitoh * ixgbe_read_i2c_combined_unlocked - Perform I2C read combined operation
1409 1.13 msaitoh * @hw: pointer to the hardware structure
1410 1.13 msaitoh * @addr: I2C bus address to read from
1411 1.13 msaitoh * @reg: I2C device register to read from
1412 1.13 msaitoh * @val: pointer to location to receive read value
1413 1.13 msaitoh *
1414 1.13 msaitoh * Returns an error code on error.
1415 1.13 msaitoh **/
1416 1.13 msaitoh s32 ixgbe_read_i2c_combined_unlocked(struct ixgbe_hw *hw, u8 addr, u16 reg,
1417 1.13 msaitoh u16 *val)
1418 1.13 msaitoh {
1419 1.13 msaitoh return ixgbe_call_func(hw, hw->phy.ops.read_i2c_combined_unlocked,
1420 1.13 msaitoh (hw, addr, reg, val),
1421 1.13 msaitoh IXGBE_NOT_IMPLEMENTED);
1422 1.13 msaitoh }
1423 1.13 msaitoh
1424 1.13 msaitoh /**
1425 1.1 dyoung * ixgbe_write_i2c_byte - Writes 8 bit word over I2C
1426 1.1 dyoung * @hw: pointer to hardware structure
1427 1.1 dyoung * @byte_offset: byte offset to write
1428 1.12 msaitoh * @dev_addr: I2C bus address to write to
1429 1.1 dyoung * @data: value to write
1430 1.1 dyoung *
1431 1.1 dyoung * Performs byte write operation to SFP module's EEPROM over I2C interface
1432 1.1 dyoung * at a specified device address.
1433 1.1 dyoung **/
1434 1.1 dyoung s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1435 1.5 msaitoh u8 data)
1436 1.1 dyoung {
1437 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte, (hw, byte_offset,
1438 1.5 msaitoh dev_addr, data), IXGBE_NOT_IMPLEMENTED);
1439 1.1 dyoung }
1440 1.1 dyoung
1441 1.1 dyoung /**
1442 1.13 msaitoh * ixgbe_write_i2c_byte_unlocked - Writes 8 bit word over I2C
1443 1.13 msaitoh * @hw: pointer to hardware structure
1444 1.13 msaitoh * @byte_offset: byte offset to write
1445 1.13 msaitoh * @dev_addr: I2C bus address to write to
1446 1.13 msaitoh * @data: value to write
1447 1.13 msaitoh *
1448 1.13 msaitoh * Performs byte write operation to SFP module's EEPROM over I2C interface
1449 1.13 msaitoh * at a specified device address.
1450 1.13 msaitoh **/
1451 1.13 msaitoh s32 ixgbe_write_i2c_byte_unlocked(struct ixgbe_hw *hw, u8 byte_offset,
1452 1.13 msaitoh u8 dev_addr, u8 data)
1453 1.13 msaitoh {
1454 1.13 msaitoh return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte_unlocked,
1455 1.13 msaitoh (hw, byte_offset, dev_addr, data),
1456 1.13 msaitoh IXGBE_NOT_IMPLEMENTED);
1457 1.13 msaitoh }
1458 1.13 msaitoh
1459 1.13 msaitoh /**
1460 1.12 msaitoh * ixgbe_write_i2c_combined - Perform I2C write combined operation
1461 1.12 msaitoh * @hw: pointer to the hardware structure
1462 1.12 msaitoh * @addr: I2C bus address to write to
1463 1.12 msaitoh * @reg: I2C device register to write to
1464 1.12 msaitoh * @val: value to write
1465 1.12 msaitoh *
1466 1.12 msaitoh * Returns an error code on error.
1467 1.12 msaitoh */
1468 1.12 msaitoh s32 ixgbe_write_i2c_combined(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 val)
1469 1.12 msaitoh {
1470 1.12 msaitoh return ixgbe_call_func(hw, hw->phy.ops.write_i2c_combined, (hw, addr,
1471 1.12 msaitoh reg, val), IXGBE_NOT_IMPLEMENTED);
1472 1.12 msaitoh }
1473 1.12 msaitoh
1474 1.12 msaitoh /**
1475 1.13 msaitoh * ixgbe_write_i2c_combined_unlocked - Perform I2C write combined operation
1476 1.13 msaitoh * @hw: pointer to the hardware structure
1477 1.13 msaitoh * @addr: I2C bus address to write to
1478 1.13 msaitoh * @reg: I2C device register to write to
1479 1.13 msaitoh * @val: value to write
1480 1.13 msaitoh *
1481 1.13 msaitoh * Returns an error code on error.
1482 1.13 msaitoh **/
1483 1.13 msaitoh s32 ixgbe_write_i2c_combined_unlocked(struct ixgbe_hw *hw, u8 addr, u16 reg,
1484 1.13 msaitoh u16 val)
1485 1.13 msaitoh {
1486 1.13 msaitoh return ixgbe_call_func(hw, hw->phy.ops.write_i2c_combined_unlocked,
1487 1.13 msaitoh (hw, addr, reg, val), IXGBE_NOT_IMPLEMENTED);
1488 1.13 msaitoh }
1489 1.13 msaitoh
1490 1.13 msaitoh /**
1491 1.1 dyoung * ixgbe_write_i2c_eeprom - Writes 8 bit EEPROM word over I2C interface
1492 1.1 dyoung * @hw: pointer to hardware structure
1493 1.1 dyoung * @byte_offset: EEPROM byte offset to write
1494 1.1 dyoung * @eeprom_data: value to write
1495 1.1 dyoung *
1496 1.1 dyoung * Performs byte write operation to SFP module's EEPROM over I2C interface.
1497 1.1 dyoung **/
1498 1.1 dyoung s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw,
1499 1.5 msaitoh u8 byte_offset, u8 eeprom_data)
1500 1.1 dyoung {
1501 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.write_i2c_eeprom,
1502 1.5 msaitoh (hw, byte_offset, eeprom_data),
1503 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1504 1.1 dyoung }
1505 1.1 dyoung
1506 1.1 dyoung /**
1507 1.1 dyoung * ixgbe_read_i2c_eeprom - Reads 8 bit EEPROM word over I2C interface
1508 1.1 dyoung * @hw: pointer to hardware structure
1509 1.1 dyoung * @byte_offset: EEPROM byte offset to read
1510 1.1 dyoung * @eeprom_data: value read
1511 1.1 dyoung *
1512 1.1 dyoung * Performs byte read operation to SFP module's EEPROM over I2C interface.
1513 1.1 dyoung **/
1514 1.1 dyoung s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data)
1515 1.1 dyoung {
1516 1.1 dyoung return ixgbe_call_func(hw, hw->phy.ops.read_i2c_eeprom,
1517 1.5 msaitoh (hw, byte_offset, eeprom_data),
1518 1.5 msaitoh IXGBE_NOT_IMPLEMENTED);
1519 1.1 dyoung }
1520 1.1 dyoung
1521 1.1 dyoung /**
1522 1.1 dyoung * ixgbe_get_supported_physical_layer - Returns physical layer type
1523 1.1 dyoung * @hw: pointer to hardware structure
1524 1.1 dyoung *
1525 1.1 dyoung * Determines physical layer capabilities of the current configuration.
1526 1.1 dyoung **/
1527 1.1 dyoung u32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw)
1528 1.1 dyoung {
1529 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.get_supported_physical_layer,
1530 1.5 msaitoh (hw), IXGBE_PHYSICAL_LAYER_UNKNOWN);
1531 1.1 dyoung }
1532 1.1 dyoung
1533 1.1 dyoung /**
1534 1.6 msaitoh * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependent on device specifics
1535 1.1 dyoung * @hw: pointer to hardware structure
1536 1.1 dyoung * @regval: bitfield to write to the Rx DMA register
1537 1.1 dyoung *
1538 1.1 dyoung * Enables the Rx DMA unit of the device.
1539 1.1 dyoung **/
1540 1.1 dyoung s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval)
1541 1.1 dyoung {
1542 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.enable_rx_dma,
1543 1.5 msaitoh (hw, regval), IXGBE_NOT_IMPLEMENTED);
1544 1.5 msaitoh }
1545 1.5 msaitoh
1546 1.5 msaitoh /**
1547 1.5 msaitoh * ixgbe_disable_sec_rx_path - Stops the receive data path
1548 1.5 msaitoh * @hw: pointer to hardware structure
1549 1.5 msaitoh *
1550 1.5 msaitoh * Stops the receive data path.
1551 1.5 msaitoh **/
1552 1.5 msaitoh s32 ixgbe_disable_sec_rx_path(struct ixgbe_hw *hw)
1553 1.5 msaitoh {
1554 1.5 msaitoh return ixgbe_call_func(hw, hw->mac.ops.disable_sec_rx_path,
1555 1.5 msaitoh (hw), IXGBE_NOT_IMPLEMENTED);
1556 1.5 msaitoh }
1557 1.5 msaitoh
1558 1.5 msaitoh /**
1559 1.5 msaitoh * ixgbe_enable_sec_rx_path - Enables the receive data path
1560 1.5 msaitoh * @hw: pointer to hardware structure
1561 1.5 msaitoh *
1562 1.5 msaitoh * Enables the receive data path.
1563 1.5 msaitoh **/
1564 1.5 msaitoh s32 ixgbe_enable_sec_rx_path(struct ixgbe_hw *hw)
1565 1.5 msaitoh {
1566 1.5 msaitoh return ixgbe_call_func(hw, hw->mac.ops.enable_sec_rx_path,
1567 1.5 msaitoh (hw), IXGBE_NOT_IMPLEMENTED);
1568 1.1 dyoung }
1569 1.1 dyoung
1570 1.1 dyoung /**
1571 1.1 dyoung * ixgbe_acquire_swfw_semaphore - Acquire SWFW semaphore
1572 1.1 dyoung * @hw: pointer to hardware structure
1573 1.1 dyoung * @mask: Mask to specify which semaphore to acquire
1574 1.1 dyoung *
1575 1.1 dyoung * Acquires the SWFW semaphore through SW_FW_SYNC register for the specified
1576 1.1 dyoung * function (CSR, PHY0, PHY1, EEPROM, Flash)
1577 1.1 dyoung **/
1578 1.12 msaitoh s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u32 mask)
1579 1.1 dyoung {
1580 1.1 dyoung return ixgbe_call_func(hw, hw->mac.ops.acquire_swfw_sync,
1581 1.5 msaitoh (hw, mask), IXGBE_NOT_IMPLEMENTED);
1582 1.1 dyoung }
1583 1.1 dyoung
1584 1.1 dyoung /**
1585 1.1 dyoung * ixgbe_release_swfw_semaphore - Release SWFW semaphore
1586 1.1 dyoung * @hw: pointer to hardware structure
1587 1.1 dyoung * @mask: Mask to specify which semaphore to release
1588 1.1 dyoung *
1589 1.1 dyoung * Releases the SWFW semaphore through SW_FW_SYNC register for the specified
1590 1.1 dyoung * function (CSR, PHY0, PHY1, EEPROM, Flash)
1591 1.1 dyoung **/
1592 1.12 msaitoh void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u32 mask)
1593 1.1 dyoung {
1594 1.1 dyoung if (hw->mac.ops.release_swfw_sync)
1595 1.1 dyoung hw->mac.ops.release_swfw_sync(hw, mask);
1596 1.1 dyoung }
1597 1.1 dyoung
1598 1.12 msaitoh
1599 1.12 msaitoh void ixgbe_disable_rx(struct ixgbe_hw *hw)
1600 1.12 msaitoh {
1601 1.12 msaitoh if (hw->mac.ops.disable_rx)
1602 1.12 msaitoh hw->mac.ops.disable_rx(hw);
1603 1.12 msaitoh }
1604 1.12 msaitoh
1605 1.12 msaitoh void ixgbe_enable_rx(struct ixgbe_hw *hw)
1606 1.12 msaitoh {
1607 1.12 msaitoh if (hw->mac.ops.enable_rx)
1608 1.12 msaitoh hw->mac.ops.enable_rx(hw);
1609 1.12 msaitoh }
1610 1.12 msaitoh
1611 1.12 msaitoh /**
1612 1.12 msaitoh * ixgbe_set_rate_select_speed - Set module link speed
1613 1.12 msaitoh * @hw: pointer to hardware structure
1614 1.12 msaitoh * @speed: link speed to set
1615 1.12 msaitoh *
1616 1.12 msaitoh * Set module link speed via the rate select.
1617 1.12 msaitoh */
1618 1.12 msaitoh void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
1619 1.12 msaitoh {
1620 1.12 msaitoh if (hw->mac.ops.set_rate_select_speed)
1621 1.12 msaitoh hw->mac.ops.set_rate_select_speed(hw, speed);
1622 1.12 msaitoh }
1623