Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is part of the Chelsio T6 Ethernet driver for Linux.
0003  *
0004  * Copyright (c) 2017-2018 Chelsio Communications, Inc. All rights reserved.
0005  *
0006  * This software is available to you under a choice of one of two
0007  * licenses.  You may choose to be licensed under the terms of the GNU
0008  * General Public License (GPL) Version 2, available from the file
0009  * COPYING in the main directory of this source tree, or the
0010  * OpenIB.org BSD license below:
0011  *
0012  *     Redistribution and use in source and binary forms, with or
0013  *     without modification, are permitted provided that the following
0014  *     conditions are met:
0015  *
0016  *      - Redistributions of source code must retain the above
0017  *        copyright notice, this list of conditions and the following
0018  *        disclaimer.
0019  *
0020  *      - Redistributions in binary form must reproduce the above
0021  *        copyright notice, this list of conditions and the following
0022  *        disclaimer in the documentation and/or other materials
0023  *        provided with the distribution.
0024  *
0025  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0026  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0027  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0028  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0029  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0030  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0031  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0032  * SOFTWARE.
0033  */
0034 
0035 #ifndef __CXGB4_SRQ_H
0036 #define __CXGB4_SRQ_H
0037 
0038 struct adapter;
0039 struct cpl_srq_table_rpl;
0040 
0041 #define SRQ_WAIT_TO (HZ * 5)
0042 
0043 struct srq_entry {
0044     u8 valid;
0045     u8 idx;
0046     u8 qlen;
0047     u16 pdid;
0048     u16 cur_msn;
0049     u16 max_msn;
0050     u32 qbase;
0051 };
0052 
0053 struct srq_data {
0054     unsigned int srq_size;
0055     struct srq_entry *entryp;
0056     struct completion comp;
0057     struct mutex lock; /* generic mutex for srq data */
0058 };
0059 
0060 struct srq_data *t4_init_srq(int srq_size);
0061 int cxgb4_get_srq_entry(struct net_device *dev,
0062             int srq_idx, struct srq_entry *entryp);
0063 void do_srq_table_rpl(struct adapter *adap,
0064               const struct cpl_srq_table_rpl *rpl);
0065 #endif  /* __CXGB4_SRQ_H */