ena.h (7926bc4492a9a5c1e12595355d5c11121eb51f4b) | ena.h (6959869eaea77fbdc99e46523daeb896662d9cca) |
---|---|
1/*- 2 * BSD LICENSE 3 * 4 * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 382 unchanged lines hidden (view full) --- 391 if_t ifp; 392 device_t pdev; 393 struct ifmedia media; 394 395 /* OS resources */ 396 struct resource *memory; 397 struct resource *registers; 398 | 1/*- 2 * BSD LICENSE 3 * 4 * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 382 unchanged lines hidden (view full) --- 391 if_t ifp; 392 device_t pdev; 393 struct ifmedia media; 394 395 /* OS resources */ 396 struct resource *memory; 397 struct resource *registers; 398 |
399 struct mtx global_mtx; 400 struct sx ioctl_sx; | 399 struct sx global_lock; |
401 402 /* MSI-X */ 403 struct msix_entry *msix_entries; 404 int msix_vecs; 405 406 /* DMA tags used throughout the driver adapter for Tx and Rx */ 407 bus_dma_tag_t tx_buf_tag; 408 bus_dma_tag_t rx_buf_tag; --- 54 unchanged lines hidden (view full) --- 463 464 enum ena_regs_reset_reason_types reset_reason; 465}; 466 467#define ENA_RING_MTX_LOCK(_ring) mtx_lock(&(_ring)->ring_mtx) 468#define ENA_RING_MTX_TRYLOCK(_ring) mtx_trylock(&(_ring)->ring_mtx) 469#define ENA_RING_MTX_UNLOCK(_ring) mtx_unlock(&(_ring)->ring_mtx) 470 | 400 401 /* MSI-X */ 402 struct msix_entry *msix_entries; 403 int msix_vecs; 404 405 /* DMA tags used throughout the driver adapter for Tx and Rx */ 406 bus_dma_tag_t tx_buf_tag; 407 bus_dma_tag_t rx_buf_tag; --- 54 unchanged lines hidden (view full) --- 462 463 enum ena_regs_reset_reason_types reset_reason; 464}; 465 466#define ENA_RING_MTX_LOCK(_ring) mtx_lock(&(_ring)->ring_mtx) 467#define ENA_RING_MTX_TRYLOCK(_ring) mtx_trylock(&(_ring)->ring_mtx) 468#define ENA_RING_MTX_UNLOCK(_ring) mtx_unlock(&(_ring)->ring_mtx) 469 |
470#define ENA_LOCK_INIT(adapter) \ 471 sx_init(&(adapter)->global_lock, "ENA global lock") 472#define ENA_LOCK_DESTROY(adapter) sx_destroy(&(adapter)->global_lock) 473#define ENA_LOCK_LOCK(adapter) sx_xlock(&(adapter)->global_lock) 474#define ENA_LOCK_UNLOCK(adapter) sx_unlock(&(adapter)->global_lock) 475 |
|
471static inline int ena_mbuf_count(struct mbuf *mbuf) 472{ 473 int count = 1; 474 475 while ((mbuf = mbuf->m_next) != NULL) 476 ++count; 477 478 return count; --- 35 unchanged lines hidden --- | 476static inline int ena_mbuf_count(struct mbuf *mbuf) 477{ 478 int count = 1; 479 480 while ((mbuf = mbuf->m_next) != NULL) 481 ++count; 482 483 return count; --- 35 unchanged lines hidden --- |