aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40e_adminq.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_adminq.c58
1 files changed, 20 insertions, 38 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
index 15853fd699a4..79a30dd8c26f 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
@@ -53,16 +53,24 @@ static void i40e_adminq_init_regs(struct i40e_hw *hw)
53 hw->aq.asq.tail = I40E_VF_ATQT1; 53 hw->aq.asq.tail = I40E_VF_ATQT1;
54 hw->aq.asq.head = I40E_VF_ATQH1; 54 hw->aq.asq.head = I40E_VF_ATQH1;
55 hw->aq.asq.len = I40E_VF_ATQLEN1; 55 hw->aq.asq.len = I40E_VF_ATQLEN1;
56 hw->aq.asq.bal = I40E_VF_ATQBAL1;
57 hw->aq.asq.bah = I40E_VF_ATQBAH1;
56 hw->aq.arq.tail = I40E_VF_ARQT1; 58 hw->aq.arq.tail = I40E_VF_ARQT1;
57 hw->aq.arq.head = I40E_VF_ARQH1; 59 hw->aq.arq.head = I40E_VF_ARQH1;
58 hw->aq.arq.len = I40E_VF_ARQLEN1; 60 hw->aq.arq.len = I40E_VF_ARQLEN1;
61 hw->aq.arq.bal = I40E_VF_ARQBAL1;
62 hw->aq.arq.bah = I40E_VF_ARQBAH1;
59 } else { 63 } else {
60 hw->aq.asq.tail = I40E_PF_ATQT; 64 hw->aq.asq.tail = I40E_PF_ATQT;
61 hw->aq.asq.head = I40E_PF_ATQH; 65 hw->aq.asq.head = I40E_PF_ATQH;
62 hw->aq.asq.len = I40E_PF_ATQLEN; 66 hw->aq.asq.len = I40E_PF_ATQLEN;
67 hw->aq.asq.bal = I40E_PF_ATQBAL;
68 hw->aq.asq.bah = I40E_PF_ATQBAH;
63 hw->aq.arq.tail = I40E_PF_ARQT; 69 hw->aq.arq.tail = I40E_PF_ARQT;
64 hw->aq.arq.head = I40E_PF_ARQH; 70 hw->aq.arq.head = I40E_PF_ARQH;
65 hw->aq.arq.len = I40E_PF_ARQLEN; 71 hw->aq.arq.len = I40E_PF_ARQLEN;
72 hw->aq.arq.bal = I40E_PF_ARQBAL;
73 hw->aq.arq.bah = I40E_PF_ARQBAH;
66 } 74 }
67} 75}
68 76
@@ -298,27 +306,14 @@ static i40e_status i40e_config_asq_regs(struct i40e_hw *hw)
298 wr32(hw, hw->aq.asq.head, 0); 306 wr32(hw, hw->aq.asq.head, 0);
299 wr32(hw, hw->aq.asq.tail, 0); 307 wr32(hw, hw->aq.asq.tail, 0);
300 308
301 if (hw->mac.type == I40E_MAC_VF) { 309 /* set starting point */
302 /* configure the transmit queue */ 310 wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
303 wr32(hw, I40E_VF_ATQBAH1, 311 I40E_PF_ATQLEN_ATQENABLE_MASK));
304 upper_32_bits(hw->aq.asq.desc_buf.pa)); 312 wr32(hw, hw->aq.asq.bal, lower_32_bits(hw->aq.asq.desc_buf.pa));
305 wr32(hw, I40E_VF_ATQBAL1, 313 wr32(hw, hw->aq.asq.bah, upper_32_bits(hw->aq.asq.desc_buf.pa));
306 lower_32_bits(hw->aq.asq.desc_buf.pa));
307 wr32(hw, I40E_VF_ATQLEN1, (hw->aq.num_asq_entries |
308 I40E_VF_ATQLEN1_ATQENABLE_MASK));
309 reg = rd32(hw, I40E_VF_ATQBAL1);
310 } else {
311 /* configure the transmit queue */
312 wr32(hw, I40E_PF_ATQBAH,
313 upper_32_bits(hw->aq.asq.desc_buf.pa));
314 wr32(hw, I40E_PF_ATQBAL,
315 lower_32_bits(hw->aq.asq.desc_buf.pa));
316 wr32(hw, I40E_PF_ATQLEN, (hw->aq.num_asq_entries |
317 I40E_PF_ATQLEN_ATQENABLE_MASK));
318 reg = rd32(hw, I40E_PF_ATQBAL);
319 }
320 314
321 /* Check one register to verify that config was applied */ 315 /* Check one register to verify that config was applied */
316 reg = rd32(hw, hw->aq.asq.bal);
322 if (reg != lower_32_bits(hw->aq.asq.desc_buf.pa)) 317 if (reg != lower_32_bits(hw->aq.asq.desc_buf.pa))
323 ret_code = I40E_ERR_ADMIN_QUEUE_ERROR; 318 ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
324 319
@@ -340,30 +335,17 @@ static i40e_status i40e_config_arq_regs(struct i40e_hw *hw)
340 wr32(hw, hw->aq.arq.head, 0); 335 wr32(hw, hw->aq.arq.head, 0);
341 wr32(hw, hw->aq.arq.tail, 0); 336 wr32(hw, hw->aq.arq.tail, 0);
342 337
343 if (hw->mac.type == I40E_MAC_VF) { 338 /* set starting point */
344 /* configure the receive queue */ 339 wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries |
345 wr32(hw, I40E_VF_ARQBAH1, 340 I40E_PF_ARQLEN_ARQENABLE_MASK));
346 upper_32_bits(hw->aq.arq.desc_buf.pa)); 341 wr32(hw, hw->aq.arq.bal, lower_32_bits(hw->aq.arq.desc_buf.pa));
347 wr32(hw, I40E_VF_ARQBAL1, 342 wr32(hw, hw->aq.arq.bah, upper_32_bits(hw->aq.arq.desc_buf.pa));
348 lower_32_bits(hw->aq.arq.desc_buf.pa));
349 wr32(hw, I40E_VF_ARQLEN1, (hw->aq.num_arq_entries |
350 I40E_VF_ARQLEN1_ARQENABLE_MASK));
351 reg = rd32(hw, I40E_VF_ARQBAL1);
352 } else {
353 /* configure the receive queue */
354 wr32(hw, I40E_PF_ARQBAH,
355 upper_32_bits(hw->aq.arq.desc_buf.pa));
356 wr32(hw, I40E_PF_ARQBAL,
357 lower_32_bits(hw->aq.arq.desc_buf.pa));
358 wr32(hw, I40E_PF_ARQLEN, (hw->aq.num_arq_entries |
359 I40E_PF_ARQLEN_ARQENABLE_MASK));
360 reg = rd32(hw, I40E_PF_ARQBAL);
361 }
362 343
363 /* Update tail in the HW to post pre-allocated buffers */ 344 /* Update tail in the HW to post pre-allocated buffers */
364 wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1); 345 wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1);
365 346
366 /* Check one register to verify that config was applied */ 347 /* Check one register to verify that config was applied */
348 reg = rd32(hw, hw->aq.arq.bal);
367 if (reg != lower_32_bits(hw->aq.arq.desc_buf.pa)) 349 if (reg != lower_32_bits(hw->aq.arq.desc_buf.pa))
368 ret_code = I40E_ERR_ADMIN_QUEUE_ERROR; 350 ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
369 351