i40e_osdep.c (1a36faad54665288ed4eb839d2a4699ae2ead45e) i40e_osdep.c (ceebc2f348c028b21bf9bcc99f7a3c4b0cb7d926)
1/******************************************************************************
2
1/******************************************************************************
2
3 Copyright (c) 2013-2015, Intel Corporation
3 Copyright (c) 2013-2017, 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
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

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

54 mem->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO);
55 return(mem->va == NULL);
56}
57
58i40e_status
59i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem)
60{
61 free(mem->va, M_DEVBUF);
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
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

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

54 mem->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO);
55 return(mem->va == NULL);
56}
57
58i40e_status
59i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem)
60{
61 free(mem->va, M_DEVBUF);
62 mem->va = NULL;
63
62 return(0);
63}
64
65i40e_status
66i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem,
67 enum i40e_memory_type type __unused, u64 size, u32 alignment)
68{
69 device_t dev = ((struct i40e_osdep *)hw->back)->dev;

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

202 vprintf(fmt, args);
203 va_end(args);
204}
205
206const char *
207ixl_vc_opcode_str(uint16_t op)
208{
209 switch (op) {
64 return(0);
65}
66
67i40e_status
68i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem,
69 enum i40e_memory_type type __unused, u64 size, u32 alignment)
70{
71 device_t dev = ((struct i40e_osdep *)hw->back)->dev;

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

204 vprintf(fmt, args);
205 va_end(args);
206}
207
208const char *
209ixl_vc_opcode_str(uint16_t op)
210{
211 switch (op) {
210 case I40E_VIRTCHNL_OP_VERSION:
212 case VIRTCHNL_OP_VERSION:
211 return ("VERSION");
213 return ("VERSION");
212 case I40E_VIRTCHNL_OP_RESET_VF:
214 case VIRTCHNL_OP_RESET_VF:
213 return ("RESET_VF");
215 return ("RESET_VF");
214 case I40E_VIRTCHNL_OP_GET_VF_RESOURCES:
216 case VIRTCHNL_OP_GET_VF_RESOURCES:
215 return ("GET_VF_RESOURCES");
217 return ("GET_VF_RESOURCES");
216 case I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE:
218 case VIRTCHNL_OP_CONFIG_TX_QUEUE:
217 return ("CONFIG_TX_QUEUE");
219 return ("CONFIG_TX_QUEUE");
218 case I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE:
220 case VIRTCHNL_OP_CONFIG_RX_QUEUE:
219 return ("CONFIG_RX_QUEUE");
221 return ("CONFIG_RX_QUEUE");
220 case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES:
222 case VIRTCHNL_OP_CONFIG_VSI_QUEUES:
221 return ("CONFIG_VSI_QUEUES");
223 return ("CONFIG_VSI_QUEUES");
222 case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:
224 case VIRTCHNL_OP_CONFIG_IRQ_MAP:
223 return ("CONFIG_IRQ_MAP");
225 return ("CONFIG_IRQ_MAP");
224 case I40E_VIRTCHNL_OP_ENABLE_QUEUES:
226 case VIRTCHNL_OP_ENABLE_QUEUES:
225 return ("ENABLE_QUEUES");
227 return ("ENABLE_QUEUES");
226 case I40E_VIRTCHNL_OP_DISABLE_QUEUES:
228 case VIRTCHNL_OP_DISABLE_QUEUES:
227 return ("DISABLE_QUEUES");
229 return ("DISABLE_QUEUES");
228 case I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS:
229 return ("ADD_ETHER_ADDRESS");
230 case I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS:
231 return ("DEL_ETHER_ADDRESS");
232 case I40E_VIRTCHNL_OP_ADD_VLAN:
230 case VIRTCHNL_OP_ADD_ETH_ADDR:
231 return ("ADD_ETH_ADDR");
232 case VIRTCHNL_OP_DEL_ETH_ADDR:
233 return ("DEL_ETH_ADDR");
234 case VIRTCHNL_OP_ADD_VLAN:
233 return ("ADD_VLAN");
235 return ("ADD_VLAN");
234 case I40E_VIRTCHNL_OP_DEL_VLAN:
236 case VIRTCHNL_OP_DEL_VLAN:
235 return ("DEL_VLAN");
237 return ("DEL_VLAN");
236 case I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE:
238 case VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE:
237 return ("CONFIG_PROMISCUOUS_MODE");
239 return ("CONFIG_PROMISCUOUS_MODE");
238 case I40E_VIRTCHNL_OP_GET_STATS:
240 case VIRTCHNL_OP_GET_STATS:
239 return ("GET_STATS");
241 return ("GET_STATS");
240 case I40E_VIRTCHNL_OP_FCOE:
241 return ("FCOE");
242 case I40E_VIRTCHNL_OP_EVENT:
242 case VIRTCHNL_OP_RSVD:
243 return ("RSVD");
244 case VIRTCHNL_OP_EVENT:
243 return ("EVENT");
245 return ("EVENT");
244 case I40E_VIRTCHNL_OP_CONFIG_RSS_KEY:
246 case VIRTCHNL_OP_CONFIG_RSS_KEY:
245 return ("CONFIG_RSS_KEY");
247 return ("CONFIG_RSS_KEY");
246 case I40E_VIRTCHNL_OP_CONFIG_RSS_LUT:
248 case VIRTCHNL_OP_CONFIG_RSS_LUT:
247 return ("CONFIG_RSS_LUT");
249 return ("CONFIG_RSS_LUT");
248 case I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS:
250 case VIRTCHNL_OP_GET_RSS_HENA_CAPS:
249 return ("GET_RSS_HENA_CAPS");
251 return ("GET_RSS_HENA_CAPS");
250 case I40E_VIRTCHNL_OP_SET_RSS_HENA:
252 case VIRTCHNL_OP_SET_RSS_HENA:
251 return ("SET_RSS_HENA");
252 default:
253 return ("UNKNOWN");
254 }
255}
256
257u16
258i40e_read_pci_cfg(struct i40e_hw *hw, u32 reg)

--- 18 unchanged lines hidden ---
253 return ("SET_RSS_HENA");
254 default:
255 return ("UNKNOWN");
256 }
257}
258
259u16
260i40e_read_pci_cfg(struct i40e_hw *hw, u32 reg)

--- 18 unchanged lines hidden ---