| .. | .. |
|---|
| 45 | 45 | #include <linux/slab.h> |
|---|
| 46 | 46 | #include <linux/io.h> |
|---|
| 47 | 47 | #include <linux/crc32c.h> |
|---|
| 48 | +#include <linux/net/intel/i40e_client.h> |
|---|
| 48 | 49 | #include <rdma/ib_smi.h> |
|---|
| 49 | 50 | #include <rdma/ib_verbs.h> |
|---|
| 50 | 51 | #include <rdma/ib_pack.h> |
|---|
| .. | .. |
|---|
| 57 | 58 | #include "i40iw_d.h" |
|---|
| 58 | 59 | #include "i40iw_hmc.h" |
|---|
| 59 | 60 | |
|---|
| 60 | | -#include <i40e_client.h> |
|---|
| 61 | 61 | #include "i40iw_type.h" |
|---|
| 62 | 62 | #include "i40iw_p.h" |
|---|
| 63 | 63 | #include <rdma/i40iw-abi.h> |
|---|
| .. | .. |
|---|
| 67 | 67 | #include "i40iw_user.h" |
|---|
| 68 | 68 | #include "i40iw_puda.h" |
|---|
| 69 | 69 | |
|---|
| 70 | | -#define I40IW_FW_VERSION 2 |
|---|
| 70 | +#define I40IW_FW_VER_DEFAULT 2 |
|---|
| 71 | 71 | #define I40IW_HW_VERSION 2 |
|---|
| 72 | 72 | |
|---|
| 73 | 73 | #define I40IW_ARP_ADD 1 |
|---|
| .. | .. |
|---|
| 326 | 326 | }; |
|---|
| 327 | 327 | |
|---|
| 328 | 328 | /** |
|---|
| 329 | + * i40iw_fw_major_ver - get firmware major version |
|---|
| 330 | + * @dev: iwarp device |
|---|
| 331 | + **/ |
|---|
| 332 | +static inline u64 i40iw_fw_major_ver(struct i40iw_sc_dev *dev) |
|---|
| 333 | +{ |
|---|
| 334 | + return RS_64(dev->feature_info[I40IW_FEATURE_FW_INFO], |
|---|
| 335 | + I40IW_FW_VER_MAJOR); |
|---|
| 336 | +} |
|---|
| 337 | + |
|---|
| 338 | +/** |
|---|
| 339 | + * i40iw_fw_minor_ver - get firmware minor version |
|---|
| 340 | + * @dev: iwarp device |
|---|
| 341 | + **/ |
|---|
| 342 | +static inline u64 i40iw_fw_minor_ver(struct i40iw_sc_dev *dev) |
|---|
| 343 | +{ |
|---|
| 344 | + return RS_64(dev->feature_info[I40IW_FEATURE_FW_INFO], |
|---|
| 345 | + I40IW_FW_VER_MINOR); |
|---|
| 346 | +} |
|---|
| 347 | + |
|---|
| 348 | +/** |
|---|
| 329 | 349 | * to_iwdev - get device |
|---|
| 330 | 350 | * @ibdev: ib device |
|---|
| 331 | 351 | **/ |
|---|
| .. | .. |
|---|
| 362 | 382 | } |
|---|
| 363 | 383 | |
|---|
| 364 | 384 | /** |
|---|
| 365 | | - * to_iwmr_from_ibfmr - get device memory region |
|---|
| 366 | | - * @ibfmr: ib fmr |
|---|
| 367 | | - **/ |
|---|
| 368 | | -static inline struct i40iw_mr *to_iwmr_from_ibfmr(struct ib_fmr *ibfmr) |
|---|
| 369 | | -{ |
|---|
| 370 | | - return container_of(ibfmr, struct i40iw_mr, ibfmr); |
|---|
| 371 | | -} |
|---|
| 372 | | - |
|---|
| 373 | | -/** |
|---|
| 374 | 385 | * to_iwmw - get device memory window |
|---|
| 375 | 386 | * @ibmw: ib memory window |
|---|
| 376 | 387 | **/ |
|---|
| .. | .. |
|---|
| 398 | 409 | } |
|---|
| 399 | 410 | |
|---|
| 400 | 411 | /* i40iw.c */ |
|---|
| 401 | | -void i40iw_add_ref(struct ib_qp *); |
|---|
| 402 | | -void i40iw_rem_ref(struct ib_qp *); |
|---|
| 412 | +void i40iw_qp_add_ref(struct ib_qp *ibqp); |
|---|
| 413 | +void i40iw_qp_rem_ref(struct ib_qp *ibqp); |
|---|
| 403 | 414 | struct ib_qp *i40iw_get_qp(struct ib_device *, int); |
|---|
| 404 | 415 | |
|---|
| 405 | 416 | void i40iw_flush_wqes(struct i40iw_device *iwdev, |
|---|
| .. | .. |
|---|
| 411 | 422 | bool ipv4, |
|---|
| 412 | 423 | u32 action); |
|---|
| 413 | 424 | |
|---|
| 414 | | -int i40iw_manage_apbvt(struct i40iw_device *iwdev, |
|---|
| 415 | | - u16 accel_local_port, |
|---|
| 416 | | - bool add_port); |
|---|
| 425 | +enum i40iw_status_code i40iw_manage_apbvt(struct i40iw_device *iwdev, |
|---|
| 426 | + u16 accel_local_port, bool add_port); |
|---|
| 417 | 427 | |
|---|
| 418 | 428 | struct i40iw_cqp_request *i40iw_get_cqp_request(struct i40iw_cqp *cqp, bool wait); |
|---|
| 419 | 429 | void i40iw_free_cqp_request(struct i40iw_cqp *cqp, struct i40iw_cqp_request *cqp_request); |
|---|
| .. | .. |
|---|
| 543 | 553 | bool wait); |
|---|
| 544 | 554 | void i40iw_receive_ilq(struct i40iw_sc_vsi *vsi, struct i40iw_puda_buf *rbuf); |
|---|
| 545 | 555 | void i40iw_free_sqbuf(struct i40iw_sc_vsi *vsi, void *bufp); |
|---|
| 546 | | -void i40iw_free_qp_resources(struct i40iw_device *iwdev, |
|---|
| 547 | | - struct i40iw_qp *iwqp, |
|---|
| 548 | | - u32 qp_num); |
|---|
| 556 | +void i40iw_free_qp_resources(struct i40iw_qp *iwqp); |
|---|
| 557 | + |
|---|
| 549 | 558 | enum i40iw_status_code i40iw_obj_aligned_mem(struct i40iw_device *iwdev, |
|---|
| 550 | 559 | struct i40iw_dma_mem *memptr, |
|---|
| 551 | 560 | u32 size, u32 mask); |
|---|
| 552 | 561 | |
|---|
| 553 | 562 | void i40iw_request_reset(struct i40iw_device *iwdev); |
|---|
| 554 | 563 | void i40iw_destroy_rdma_device(struct i40iw_ib_device *iwibdev); |
|---|
| 555 | | -void i40iw_setup_cm_core(struct i40iw_device *iwdev); |
|---|
| 564 | +int i40iw_setup_cm_core(struct i40iw_device *iwdev); |
|---|
| 556 | 565 | void i40iw_cleanup_cm_core(struct i40iw_cm_core *cm_core); |
|---|
| 557 | 566 | void i40iw_process_ceq(struct i40iw_device *, struct i40iw_ceq *iwceq); |
|---|
| 558 | 567 | void i40iw_process_aeq(struct i40iw_device *); |
|---|