xref: /illumos-gate/usr/src/uts/common/io/bnxe/bnxe_lock.c (revision 3ce5372277f4657ad0e52d36c979527c4ca22de2)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2014 QLogic Corporation
24  * The contents of this file are subject to the terms of the
25  * QLogic End User License (the "License").
26  * You may not use this file except in compliance with the License.
27  *
28  * You can obtain a copy of the License at
29  * http://www.qlogic.com/Resources/Documents/DriverDownloadHelp/
30  * QLogic_End_User_Software_License.txt
31  * See the License for the specific language governing permissions
32  * and limitations under the License.
33  */
34 
35 #include "bnxe.h"
36 
37 #ifndef BNXE_LOCKS_INLINE
38 
39 void BNXE_LOCK_ENTER_INTR          (um_device_t * pUM, int idx)  { mutex_enter(&pUM->intrMutex[idx]);          }
40 void BNXE_LOCK_EXIT_INTR           (um_device_t * pUM, int idx)  { mutex_exit(&pUM->intrMutex[idx]);           }
41 void BNXE_LOCK_ENTER_INTR_FLIP     (um_device_t * pUM, int idx)  { mutex_enter(&pUM->intrFlipMutex[idx]);      }
42 void BNXE_LOCK_EXIT_INTR_FLIP      (um_device_t * pUM, int idx)  { mutex_exit(&pUM->intrFlipMutex[idx]);       }
43 void BNXE_LOCK_ENTER_TX            (um_device_t * pUM, int idx)  { mutex_enter(&pUM->txq[idx].txMutex);        }
44 void BNXE_LOCK_EXIT_TX             (um_device_t * pUM, int idx)  { mutex_exit(&pUM->txq[idx].txMutex);         }
45 void BNXE_LOCK_ENTER_FREETX        (um_device_t * pUM, int idx)  { mutex_enter(&pUM->txq[idx].freeTxDescMutex);}
46 void BNXE_LOCK_EXIT_FREETX         (um_device_t * pUM, int idx)  { mutex_exit(&pUM->txq[idx].freeTxDescMutex); }
47 void BNXE_LOCK_ENTER_RX            (um_device_t * pUM, int idx)  { mutex_enter(&pUM->rxq[idx].rxMutex);        }
48 void BNXE_LOCK_EXIT_RX             (um_device_t * pUM, int idx)  { mutex_exit(&pUM->rxq[idx].rxMutex);         }
49 void BNXE_LOCK_ENTER_DONERX        (um_device_t * pUM, int idx)  { mutex_enter(&pUM->rxq[idx].doneRxMutex);    }
50 void BNXE_LOCK_EXIT_DONERX         (um_device_t * pUM, int idx)  { mutex_exit(&pUM->rxq[idx].doneRxMutex);     }
51 void BNXE_LOCK_ENTER_SB            (um_device_t * pUM, int idx)  { mutex_enter(&pUM->sbMutex[idx]);            }
52 void BNXE_LOCK_EXIT_SB             (um_device_t * pUM, int idx)  { mutex_exit(&pUM->sbMutex[idx]);             }
53 void BNXE_LOCK_ENTER_ETH_CON       (um_device_t * pUM)           { mutex_enter(&pUM->ethConMutex);             }
54 void BNXE_LOCK_EXIT_ETH_CON        (um_device_t * pUM)           { mutex_exit(&pUM->ethConMutex);              }
55 void BNXE_LOCK_ENTER_MCP           (um_device_t * pUM)           { mutex_enter(&pUM->mcpMutex);                }
56 void BNXE_LOCK_EXIT_MCP            (um_device_t * pUM)           { mutex_exit(&pUM->mcpMutex);                 }
57 void BNXE_LOCK_ENTER_PHY           (um_device_t * pUM)           { mutex_enter(&pUM->phyMutex);                }
58 void BNXE_LOCK_EXIT_PHY            (um_device_t * pUM)           { mutex_exit(&pUM->phyMutex);                 }
59 void BNXE_LOCK_ENTER_IND           (um_device_t * pUM)           { mutex_enter(&pUM->indMutex);                }
60 void BNXE_LOCK_EXIT_IND            (um_device_t * pUM)           { mutex_exit(&pUM->indMutex);                 }
61 void BNXE_LOCK_ENTER_CID           (um_device_t * pUM)           { mutex_enter(&pUM->cidMutex);                }
62 void BNXE_LOCK_EXIT_CID            (um_device_t * pUM)           { mutex_exit(&pUM->cidMutex);                 }
63 void BNXE_LOCK_ENTER_SPQ           (um_device_t * pUM)           { mutex_enter(&pUM->spqMutex);                }
64 void BNXE_LOCK_EXIT_SPQ            (um_device_t * pUM)           { mutex_exit(&pUM->spqMutex);                 }
65 void BNXE_LOCK_ENTER_SPREQ         (um_device_t * pUM)           { mutex_enter(&pUM->spReqMutex);              }
66 void BNXE_LOCK_EXIT_SPREQ          (um_device_t * pUM)           { mutex_exit(&pUM->spReqMutex);               }
67 void BNXE_LOCK_ENTER_RRREQ         (um_device_t * pUM)           { mutex_enter(&pUM->rrReqMutex);              }
68 void BNXE_LOCK_EXIT_RRREQ          (um_device_t * pUM)           { mutex_exit(&pUM->rrReqMutex);               }
69 void BNXE_LOCK_ENTER_ISLES_CONTROL (um_device_t * pUM)           { mutex_enter(&pUM->islesCtrlMutex);          }
70 void BNXE_LOCK_EXIT_ISLES_CONTROL  (um_device_t * pUM)           { mutex_exit(&pUM->islesCtrlMutex);           }
71 void BNXE_LOCK_ENTER_TOE           (um_device_t * pUM)           { mutex_enter(&pUM->toeMutex);                }
72 void BNXE_LOCK_EXIT_TOE            (um_device_t * pUM)           { mutex_exit(&pUM->toeMutex);                 }
73 void BNXE_LOCK_ENTER_MEM           (um_device_t * pUM)           { mutex_enter(&pUM->memMutex);                }
74 void BNXE_LOCK_EXIT_MEM            (um_device_t * pUM)           { mutex_exit(&pUM->memMutex);                 }
75 void BNXE_LOCK_ENTER_OFFLOAD       (um_device_t * pUM)           { mutex_enter(&pUM->offloadMutex);            }
76 void BNXE_LOCK_EXIT_OFFLOAD        (um_device_t * pUM)           { mutex_exit(&pUM->offloadMutex);             }
77 void BNXE_LOCK_ENTER_HWINIT        (um_device_t * pUM)           { mutex_enter(&pUM->hwInitMutex);             }
78 void BNXE_LOCK_EXIT_HWINIT         (um_device_t * pUM)           { mutex_exit(&pUM->hwInitMutex);              }
79 void BNXE_LOCK_ENTER_GLD           (um_device_t * pUM)           { mutex_enter(&pUM->gldMutex);                }
80 void BNXE_LOCK_EXIT_GLD            (um_device_t * pUM)           { mutex_exit(&pUM->gldMutex);                 }
81 void BNXE_LOCK_ENTER_GLDTX         (um_device_t * pUM, krw_t rw) { rw_enter(&pUM->gldTxMutex, rw);             }
82 void BNXE_LOCK_EXIT_GLDTX          (um_device_t * pUM)           { rw_exit(&pUM->gldTxMutex);                  }
83 void BNXE_LOCK_ENTER_TIMER         (um_device_t * pUM)           { mutex_enter(&pUM->timerMutex);              }
84 void BNXE_LOCK_EXIT_TIMER          (um_device_t * pUM)           { mutex_exit(&pUM->timerMutex);               }
85 void BNXE_LOCK_ENTER_STATS         (um_device_t * pUM)           { mutex_enter(&pUM->kstatMutex);              }
86 void BNXE_LOCK_EXIT_STATS          (um_device_t * pUM)           { mutex_exit(&pUM->kstatMutex);               }
87 
88 #endif /* BNXE_LOCKS_INLINE */
89 
90