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